1import{bj as G,b8 as P,bk as D,aR as $,aH as p,aL as B,bm as H,bl as J,aY as t,bn as K,aP as Q,bs as W,aQ as Y,aT as X,bg as Z,aW as g,aU as ee,bo as oe,a_ as ae,bp as E,a$ as te,aG as x,b0 as C,da as se,aI as b,dp as ne,b2 as ie,b3 as re,aK as le,aM as de,aJ as ce,bt as T,bv as j,bL as ue,aE as fe}from"#entry";import{_ as pe}from"./DwA4r_-F.js";import{P as me}from"./Bbiqjs46.js";/* empty css */try{(function(){var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new s.Error().stack;c&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[c]="f5dac6ac-4ee2-48de-9ece-496cfce5c5f7",s._sentryDebugIdIdentifier="sentry-dbid-f5dac6ac-4ee2-48de-9ece-496cfce5c5f7")})()}catch{}const he={base:"animate-pulse rounded-md bg-elevated"},ge={__name:"USkeleton",props:{as:{type:null,required:!1},class:{type:null,required:!1}},setup(s){const c=s,a=G(),v=P(()=>D({extend:D(he),...a.ui?.skeleton||{}}));return(m,_)=>(p(),$(t(K),{as:s.as,"aria-busy":"true","aria-label":"loading","aria-live":"polite",role:"alert",class:J(v.value({class:c.class}))},{default:B(()=>[H(m.$slots,"default")]),_:3},8,["as","class"]))}},be=["src","alt","width","height"],ve={class:"absolute inset-0 m-2 flex justify-between"},_e=Q({__name:"thumb",props:{pid:{},cid:{},roundsPhotoIds:{},usePhotoSwipe:{type:Boolean}},emits:["image-click"],setup(s,{emit:c}){const a=s,v=c,m=W(),_=Y(),F=X(_,`competitions/${a.cid}/photos/${a.pid}`),e=Z(F),z=g(null),u=g(),f=g(!1),h=g(!1),A=ee(_,`competitions/${a.cid}/rounds`),k=oe(A);let i=null;const N=P(()=>{if(!a.roundsPhotoIds||!a.pid||!k.value)return[];const o=[];for(const[n,l]of Object.entries(a.roundsPhotoIds))l.includes(a.pid)&&o.push(n);return k.value.filter(n=>o.includes(n.rid))});function V(o){return o==="longlist"?"i-lucide-clipboard-list":o==="finalists"?"i-lucide-award":"i-lucide-star"}const L=P(()=>e.value?.caption?`${e.value.caption.slice(0,30)}...`:a.pid),w=typeof window<"u"&&typeof Image<"u",y=()=>{console.error(`Failed to load image for photo ${a.pid}`),h.value=!0},S=o=>o?w?new Promise((n,l)=>{const r=new Image;r.src=o,r.onload=()=>n(o),r.onerror=d=>l(d)}):Promise.resolve(o):Promise.reject(new Error("Image source is undefined or empty")),I=async()=>{if(f.value=!1,h.value=!1,u.value=void 0,!!e.value){if(!a.cid||!a.pid){console.error("Missing competition ID or photo ID",{cid:a.cid,pid:a.pid});return}try{if(e.value?.thumbsGenerated!==!1){const o=`photos/${a.cid}/${e.value?.uid}/${a.pid}`,n=`${o}_lazy.jpg`,l=T(m,n),r=await j(l);u.value=r;const d=`${o}_thumb.jpg`,q=T(m,d),U=await j(q);await S(U),u.value=U,w&&(f.value=!0);return}}catch(o){console.warn(`Thumbnail loading failed for ${e.value?.pid}, falling back. Error:`,o)}if(e.value?.downloadURL)try{await S(e.value.downloadURL),u.value=e.value.downloadURL,w&&(f.value=!0)}catch(o){console.error(`Failed to load original image ${e.value?.pid} from downloadURL. Error:`,o),y()}else console.error(`No downloadURL available for photo ${e.value?.pid}`),y()}},M=()=>{a.usePhotoSwipe!==!1?O(0):v("image-click")},O=o=>{!i&&e.value&&(i=new me({pswpModule:()=>ue(()=>import("./BtvbkNA0.js"),[],import.meta.url)}),i.init(),R()),i?.loadAndOpen(o)},R=()=>{if(i&&e.value){const o=[{src:e.value.downloadURL||u.value||"",width:e.value.dimensions?.width||800,height:e.value.dimensions?.height||600,alt:e.value.caption||L.value}];i.options.dataSource=o}};return ae(()=>{e.value&&I(),E(e,o=>{o&&(I(),i&&R())},{immediate:!0}),E(()=>[a.pid,a.cid],()=>{I()})}),te(()=>{i?.destroy(),i=null}),(o,n)=>{const l=ge,r=pe;return t(e)&&t(e).pid?(p(),x("li",{key:0,onClick:M,class:"image-container cursor-pointer"},[!t(f)&&!t(h)?(p(),$(l,{key:0,class:"h-full w-full animate-pulse bg-gray-200"})):C("",!0),se(b("img",{ref_key:"photoElement",ref:z,src:t(u),alt:t(L),width:t(e)?.dimensions.width,height:t(e)?.dimensions.height,onLoad:n[0]||(n[0]=d=>f.value=!0),onError:y},null,40,be),[[ne,t(f)&&!t(h)]]),b("div",ve,[b("div",null,[(p(!0),x(ie,null,re(t(N),d=>(p(),$(r,{icon:V(d.rid),class:"m-1",color:"neutral",key:d.rid},null,8,["icon"]))),128))]),b("div",null,[le(r,{class:"m-1",color:"neutral"},{default:B(()=>
1[de(ce(t(e).lid),1)]),_:1})])])])):C("",!0)}}}),$e=Object.assign(fe(_e,[["__scopeId","data-v-e4f77d5b"]]),{__name:"BaseThumb"});export{$e 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.