1import{e as S,g as $,a as z}from"./chunk-BNE96o5liwOFb.js";import{r as R,a as l}from"./chunk-rtlSGV0HlPFTb.js";const v=new Map([["png",1],["jpeg",1],["webp",2],["avif",3]]),x=[1,2];function f(e){return e.width===void 0&&e.height===void 0?"responsive":"fixed"}function b(e){const i=f(e),t=Array.isArray(e.src.imageTypes)?e.src.imageTypes:[e.src.imageTypes];if(i==="responsive")return t.map(n=>{let r=e.src.availableWidths;return r||(r=S.deviceWidths),{srcset:r.map(o=>`${e.src.imageUrlFor(o,n)} ${o}w`).join(", "),sizes:e.sizes??(e.size?`${e.size}vw`:void 0),type:n,mimeType:n!="auto"?`image/${n}`:void 0}});const{width:s}=e;return s===void 0?[]:t.map(n=>({srcset:x.map(a=>`${e.src.imageUrlFor(s*a,n)} ${a}x`).filter(a=>a!==void 0).join(", "),type:n,mimeType:n!="auto"?`image/${n}`:void 0}))}function g(e){if(f(e)==="responsive")return $(e.size);if(e.width!==void 0)return e.width;const t=e.src.aspectRatio;if(t&&e.height!==void 0)return e.height*t}function q(e){if(e.height!==void 0)return e.height;const i=g(e),t=e.src.aspectRatio;if(t&&i!==void 0)return Math.round(i/t)}function j(e){const i=e.src.imageTypes==="auto"?"auto":void 0,t=g(e)||640;return e.src.imageUrlFor(t,i)}function E(e,i){var r;const s=["ri-img",`ri-${f(e)==="responsive"?"responsive":"fixed"}`],n=(r=e.src.lqip)==null?void 0:r.class;return n&&!i&&s.push(z(n)),s.join(" ")}function L(e,i){var t;if(!i)return z((t=e.src.lqip)==null?void 0:t.inlineStyles)}function C(e){var y,w;const[i,t]=R.useState(!1),{src:s,size:n,sizes:r,width:a,height:o,...d}=e,c={src:s,size:n,sizes:r,width:a,height:o},m=b(c),h=l.createElement("img",{className:E(c,i),loading:d.loading||"lazy",decoding:d.decoding||"async",width:g(c),height:q(c),srcSet:s.imageTypes==="auto"?(y=m[0])==null?void 0:y.srcset:void 0,src:j(c),...d,"data-ri-lqip":(w=c.src.lqip)==null?void 0:w.attribute,style:L(c,i),onLoad:()=>t(!0)});return s.imageTypes==="auto"?h:l.createElement("picture",null,m.sort((u,T)=>(v.get(T.type)??0)-(v.get(u.type)??0)).map(u=>l.createElement("source",{key:u.mimeType,srcSet:u.srcset,type:u.mimeType,sizes:u.sizes})),h)}export{C as R};
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.