1import{j as e,r as t}from"./vendor-react-BfgFmtGS.js";import{a as r}from"./echoTypePolicy-D6McwraQ.js";import{b as a}from"./imageLoadFailurePolicy-DJD2yr3u.js";import{b as i}from"./startup-diagnostics-bridge-BB8dzHvV.js";import{g as n}from"./exploreContentIdentity-D-Otu-po.js";import{i as s}from"./exploreViewportExposure-p9xfc4T3.js";import{r as o,a as c,p as l}from"./exploreSeenStorage-B3zkLirJ.js";const d=String("https://cdn.myechoboard.com").replace(/\/+$/,""),u=e=>"string"==typeof e?e.trim():"",m=(e,t)=>{const r=e.metadata&&"object"==typeof e.metadata&&!Array.isArray(e.metadata)?e.metadata:{},a=u(r.thumbnail_url)||u(e.image_url);if(!a||!d||!a.startsWith(`${d}/`)||a.includes("/cdn-cgi/image/"))return a;const i=a.slice(d.length).replace(/^\/+/,"");return`${d}/cdn-cgi/image/width=${t},quality=${t<400?65:70},format=auto/${i}`},p=({alt:r,imageUrl:i,compactImageUrl:n,mobileRetinaImageUrl:s,index:o,aspectRatio:c})=>{const l=t.useRef(!1),[d,u]=t.useState(!1);return d?e.jsx("div",{className:"echo-public-explore__image-fallback",role:"img","aria-label":`${r} image unavailable`,style:{aspectRatio:c},children:e.jsx("span",{children:"Image unavailable"})}):e.jsx("img",{src:i,srcSet:n!==i?`${n} 200w, ${s} 360w, ${i} 400w`:void 0,sizes:"(max-width: 700px) 33vw, 244px",alt:r,width:600,height:Math.max(120,Math.round(600/c)),style:{aspectRatio:c},loading:o<2?"eager":"lazy",decoding:"async",fetchpriority:0===o?"high":o<4?"auto":"low",onError:e=>{if(!l.current)return l.current=!0,e.currentTarget.removeAttribute("srcset"),void(e.currentTarget.src=a(i));u(!0)}})},h=({rows:t,failed:a=!1,onUpgrade:i,sentinelRef:n})=>{const s=t.filter(e=>r(e)).slice(0,16),o=(e,t)=>{e.preventDefault(),i(t)},c=(t,r)=>{const a=u(t.id),i=u(t.title)||u(t.description)||"Echo",n=m(t,400),s=m(t,200),c=m(t,360);if(!a||!n)return null;const l=(e=>{const t=e.metadata&&"object"==typeof e.metadata&&!Array.isArray(e.metadata)?e.metadata:{},r=Number(t.aspect_ratio);if(Number.isFinite(r)&&r>.2&&r<5)return r;const a=Number(t.width),i=Number(t.height);return Number.isFinite(a)&&Number.isFinite(i)&&a>0&&i>0?a/i:.8})(t);return e.jsx("article",{className:"echo-public-explore__card","data-public-explore-id":a,children:e.jsxs("a",{href:`/echo/${encodeURIComponent(a)}`,onClick:e=>o(e,`/echo/${encodeURIComponent(a)}`),children:[e.jsx(p,{alt:i,imageUrl:n,compactImageUrl:s||n,mobileRetinaImageUrl:c||n,index:r,aspectRatio:l}),e.jsxs("span",{className:"echo-public-explore__caption",children:[e.jsx("strong",{children:i}),u(t.source_board_name)?e.jsx("small",{children:u(t.source_board_name)}):null]})]})},a)};return e.jsxs("div",{className:"echo-public-explore",children:[e.jsxs("header",{className:"echo-public-explore__header",children:[e.jsxs("a",{href:"/explore",className:"echo-public-explore__brand",onClick:e=>o(e,"/explore"),children:[e.jsx("span",{className:"echo-public-explore__mark","aria-hidden":"true",children:"E"}),e.jsx("span",{children:"Echo"})]}),e.jsx("button",{type:"button",className:"echo-public-explore__search",onClick:()=>i("/explore"),children:"Search visual ideas"}),e.jsx("button",{type:"button",className:"echo-public-explore__signin",onClick:()=>i("/auth"),children:"Sign in"})]}),e.jsxs("main",{children:[e.jsxs("div",{className:"echo-public-explore__intro",children:[e.jsx("p",{children:"Explore"}),e.jsx("h1",{children:"Ideas worth remembering"}),a?e.jsx("button",{className:"echo-public-explore__retry",type:"button",onClick:()=>i("/explore"),children:"Feed is taking a moment â try the full experience"}):null]}),e.jsx("div",{className:"echo-public-explore__lead-grid","aria-label":"Explore Echoes",children:s.slice(0,4).map((e,t)=>c(e,t))}),e.jsx("div",{className:"echo-public-explore__grid",children:s.slice(4).map((e,t)=>c(e,t+4))}),e.jsx("div",{ref:n,className:"echo-public-explore__sentinel","aria-hidden":"true"})]})]})};function b({upgrade:a}){const[d,u]=t.useState([]),[m,p]=t.useState(!1),[b,x]=t.useState(null),f=t.useRef(!1),g=t.useCallback(e=>{f.current||(f.current=!0,a(e).catch(()=>{f.current=!1,p(!0)}))},[a]);return t.useEffect(()=>{const e=window.__ECHO_DIRECT_EXPLORE_WARMUP__;if(!e)return void p(!0);let t=!1;return e.then(e=>{if(!t){const t=o(null),a=c(null),s=Array.isArray(e)?e.filter(e=>{const i=e,s=n(i);return!(!r(i)||t.has(i.id)||s&&a.has(s)||(t.add(i.id),s&&a.add(s),0))}):[];if(0===s.length)return void g();u(s),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i("echo.route.ready",performance.now(),"millisecond")})})}}).catch(()=>{t||p(!0)}),()=>{t=!0}},[g]),t.useEffect(()=>{if(0===d.length||"undefined"==typeof IntersectionObserver)return;const e=new Map(d.map(e=>[e.id,e])),t=new Set,r=new IntersectionObserver(r=>{if("visible"===document.visibilityState)for(const a of r){const r=a.target.dataset.publicExploreId,i=r?e.get(r):void 0;if(!r||!i||t.has(r)||!s(a))continue;t.add(r);const o=n(i);l(o?[r,o]:[r],null)}},{threshold:[0,.05,.1,.2,.35,.6,1]}),a=()=>{"visible"===document.visibilityState&&document.querySelectorAll("[data-public-explore-id]").forEach(e
1=>{r.unobserve(e),r.observe(e)})};return a(),document.addEventListener("visibilitychange",a),()=>{r.disconnect(),document.removeEventListener("visibilitychange",a)}},[d]),t.useEffect(()=>{if(!b||"undefined"==typeof IntersectionObserver)return;const e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&g()},{rootMargin:"600px 0px"});return e.observe(b),()=>e.disconnect()},[g,b]),t.useEffect(()=>{var e;document.documentElement.setAttribute("data-echo-app-mounted","true"),document.documentElement.setAttribute("data-echo-startup-mode","public-fast-path"),null==(e=window.__ECHO_BOOT_RECOVERY__)||e.disarm(),window.dispatchEvent(new Event("echo:first-frame"))},[]),e.jsx(h,{rows:d,failed:m,onUpgrade:g,sentinelRef:x})}export{b as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.