1import{_ as b}from"./CTeZ7uON.js";import{f as $,u as y,p as z,q as B,s as N,h as c,o as h,c as v,m as w,a as k,l as x,N as I,C as g,I as M}from"./CN3a-T4Y.js";function S(e){const t=e.split(/[\s,]+/).filter(Boolean).map(s=>{const[i,r]=s.split(":");return{screenMaxWidth:Number.parseInt(i??"",10),size:r??""}}).filter(s=>Number.isFinite(s.screenMaxWidth)&&s.size.length>0).sort((s,i)=>s.screenMaxWidth-i.screenMaxWidth);return t.length===0?e:t.map((s,i)=>{const r=t[i+1];return r?`(max-width: ${r.screenMaxWidth}px) ${s.size}`:s.size}).join(", ")}function U(e,t){const s=t?S(t):void 0,i={};for(const{format:r,path:f,width:l}of e){const a=`${f} ${l}w`;i[r]=i[r]?`${i[r]}, ${a}`:a}return{sizes:s,srcsetByFormat:i}}const W=["srcset","sizes"],E=["srcset","sizes"],F=["src","alt","width","height","loading","fetchpriority"],j=$({__name:"LcpImage",props:{src:{},alt:{},width:{},height:{},sizes:{default:void 0},imgClass:{default:void 0},loading:{default:"eager"},fetchpriority:{default:void 0},preload:{type:Boolean,default:!1},deferUntilNear:{type:Boolean,default:!1}},setup(e){const t=e,s=M(),i=g(()=>s.public.lcpImageManifest?.[t.src]),r=g(()=>(i.value?.derivatives.length??0)>0),f=g(()=>U(i.value?.derivatives??[],t.sizes)),l=g(()=>f.value.sizes);function a(n){return f.value.srcsetByFormat[n]??""}y(()=>
1{if(!t.preload||!r.value)return{};const n=a("avif");return n?{link:[{rel:"preload",as:"image",href:t.src,imagesrcset:n,imagesizes:l.value,fetchpriority:"high"}]}:{}});const o=z(!t.deferUntilNear),m=z(null);let u;B(()=>{if(!(!t.deferUntilNear||o.value||!m.value)){if(typeof IntersectionObserver>"u"){o.value=!0;return}u=new IntersectionObserver(n=>{n.some(p=>p.isIntersecting)&&(o.value=!0,u?.disconnect(),u=void 0)},{rootMargin:"80px 0px"}),u.observe(m.value)}}),N(()=>{u?.disconnect()});function d(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}return y(()=>!t.deferUntilNear||!r.value?{}:{noscript:[{innerHTML:`<img ${[`src="${d(t.src)}"`,`alt="${d(t.alt)}"`,`width="${d(String(t.width))}"`,`height="${d(String(t.height))}"`,t.imgClass?`class="${d(t.imgClass)}"`:"",'loading="lazy"'].filter(Boolean).join(" ")}>`,tagPosition:"bodyClose"}]}),(n,p)=>{const C=b;return c(r)?(h(),v("picture",{key:0,ref_key:"rootEl",ref:m},[c(o)?(h(),v("source",{key:0,type:"image/avif",srcset:a("avif"),sizes:c(l)},null,8,W)):w("",!0),c(o)?(h(),v("source",{key:1,type:"image/webp",srcset:a("webp"),sizes:c(l)},null,8,E)):w("",!0),k("img",{src:c(o)?e.src:void 0,alt:e.alt,width:e.width,height:e.height,class:x(e.imgClass),loading:e.loading,fetchpriority:e.fetchpriority},null,10,F)],512)):(h(),I(C,{key:1,src:e.src,alt:e.alt,width:e.width,height:e.height,sizes:e.sizes,class:x(e.imgClass),loading:e.loading,fetchpriority:e.fetchpriority,preload:e.preload},null,8,["src","alt","width","height","sizes","class","loading","fetchpriority","preload"]))}}}),L=Object.assign(j,{__name:"LcpImage"});export{L as _};
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.