import{d as P,P as u,q as S,u as t,o as p,c as g,a as v,t as w,h as _}from"./BoiSz2A_.js";import{u as k,a as q}from"./C9FC9urW.js";const z=["src","srcset","alt","sizes"],B=["src"],A=P({__name:"allerImgixImg",props:{media:{type:Object,required:!0},sizes:{type:String,required:!0},modifiers:{type:Object,required:!1},renderWidths:{type:Array,default:()=>[320,360,380,390,410,1020,1080,1280,1440,1900]},gifWidths:{type:Array,default:()=>[[414,414],[768,768],[940,940]]},small:{type:Boolean,default:!1}},setup(a){const e=a,{public:y}=_(),{mediaSrc:s,defaultModifiers:l,focalPointCalc:c}=k(e.media),d=e.media.alt||s||"",n=q(),h=n(s,{...l,...e.modifiers}),W=e.renderWidths.map(i=>{const r={...l,...e.modifiers,w:i};return n(s,r)+" "+i+"w"}),f=i=>n(s,{fm:"mp4",ar:e.modifiers&&e.modifiers.ar?e.modifiers.ar:y.media.aspectRatio||"16:9",fit:"crop","fp-x":e.media.focalPoint?c(e.media.focalPoint.x):.5,"fp-y":e.media.focalPoint?c(e.media.focalPoint.y):.5,w:i}),o=e.media&&s&&s.endsWith(".gif")?u(f(e.gifWidths[0][1])):u(!1),x=()=>{const i=e.gifWidths.reduce((r,m)=>window.innerWidth>=m[0]?m:r);i!==e.gifWidths[0]&&(o.value=f(i[1]))};return S(()=>{o.value&&x()}),(i,r)=>t(o)?(p(),g("video",{key:1,autoplay:"",loop:"",muted:"",playsinline:"",class:"w-full h-full",src:t(o),preload:"none"},[v("p",null,w(t(d)),1)],8,B)):(p(),g("img",{key:0,src:t(h),srcset:a.small?void 0:t(W).join(" ,"),alt:t(d),sizes:a.small?void 0:a.sizes},null,8,z))}});export{A as _};