import{d as _,r as O,f as a,bF as I,aB as S,h as d,o as u,i as y,D as g,L as P,k as l,v,bG as C,a5 as D,a9 as A,q as F}from"./Cvzsf6pb.js";const z={class:"base-picture"},R=["data-error"],k=_({inheritAttrs:!1,__name:"BasePicture",props:{placeholder:{},placeholderClass:{},custom:{type:Boolean},src:{},format:{},quality:{},background:{},fit:{},modifiers:{},preset:{},provider:{},sizes:{},densities:{},preload:{},width:{},height:{},alt:{},referrerpolicy:{},usemap:{},longdesc:{},ismap:{type:Boolean},loading:{},crossorigin:{},decoding:{},nonce:{}},setup(m){const e=m,b=!1,p=O(!1),f=a(()=>Number.parseFloat(`${e.height}`)/Number.parseFloat(`${e.width}`)),n=a(()=>I().getSizes(e.src,{modifiers:{width:Number.parseFloat(`${e.width}`),height:Number.parseFloat(`${e.height}`)},sizes:e.sizes})),B=a(()=>{const{sizes:t,...s}=e;return{...S(),...s,src:n.value.src}}),L=a(()=>{var t;return((t=n.value)==null?void 0:t.srcset)===void 0?[]:n.value.srcset.split(",").map(s=>{const[r,i]=s.trim().split(" "),h=Number.parseFloat(i);return{needles:[h,h/2],url:r,width:i}})}),o=a(()=>{var t;return((t=n.value)==null?void 0:t.sizes)===void 0?[]:(n.value.sizes.split(",")??[]).map(s=>{const r=s.replace(/(.*\)\s)/,"").trim(),i=s.replace(r,"").trim();return{breakpoint:i===""?void 0:i,width:Number.parseFloat(r)}})}),c=a(()=>o.value.map(({breakpoint:t,width:s})=>({height:Math.round(s*f.value),key:t,media:t,srcset:L.value.filter(r=>r.needles.includes(s)).map(r=>`${r.url} ${r.width}`).join(", "),width:s})));return(t,s)=>(u(),d("picture",z,[(u(!0),d(g,null,P(l(c),({key:r,...i})=>(u(),d("source",v({key:r},{ref_for:!0},i),null,16))),128)),y("img",v({...l(B),...l(b)?{onerror:"this.setAttribute('data-error', 1)"}:{}},{"data-error":l(p)?1:void 0,onError:s[0]||(s[0]=r=>p.value=!0)}),null,16,R)]))}}),E=Object.assign(k,{__name:"BasePicture"}),M=_({__name:"BaseCover",props:{brandCode:{},bundlePresentation:{default:"rotated"},bundleScale:{default:void 0},issueNumber:{default:""},issueYear:{default:""},productType:{default:void 0},variation:{default:"latest"},placeholder:{},placeholderClass:{},custom:{type:Boolean},format:{},quality:{},background:{},fit:{},modifiers:{},preset:{},provider:{},sizes:{default:""},densities:{},preload:{},width:{},height:{},alt:{},referrerpolicy:{},usemap:{},longdesc:{},ismap:{type:Boolean},loading:{},crossorigin:{},decoding:{},nonce:{}},setup(m){const e=m,b={DONDC:["DONAL","DONPO"],DONDD:["DONAL","DONEX"],DONMK:["DONAL","DONEX","DONPO"],FLWSY:["FLOW","FLWSP"],LIBBS:["LIBBO","LIBSP"],LIBPB:["LIBEL","LIBBO"],LIBPS:["LIBEL","LIBSP"],LIBPU:["LIBEL","LIBBO","LIBPZ"],LISPP:["LIBEL","LIBSP","LIBPZ"],MARPL:["MARGR","MARSP"],MASPP:["MARGR","MARSP","MARPZ"],VTWBS:["VTWON","WLSTY"]},p=a(()=>{const[,o]=Object.entries(b).find(([c])=>c===e.productType)??[];return o||[e.productType]}),f=a(()=>{const{brandCode:o,bundlePresentation:c,bundleScale:t,issueNumber:s,issueYear:r,productType:i,variation:h,...N}=e;return N}),n=a(()=>p.value.map(o=>({...f.value,key:o,src:C({brandCode:e.brandCode,productType:o,variation:e.variation,issueYear:e.issueYear,issueNumber:e.issueNumber})}))),B=a(()=>({[`base-cover--${e.bundlePresentation}`]:n.value.length>1})),L=a(()=>({"--bundle-scale":e.bundleScale??e.bundlePresentation==="rotated"?.85:.75}));return(o,c)=>{const t=E;return u(),d("figure",{class:A(["base-cover",l(B)]),style:D(l(L))},[(u(!0),d(g,null,P(l(n),({key:s,...r})=>(u(),F(t,v({key:s},{ref_for:!0},r),null,16))),128))],6)}}}),T=Object.assign(M,{__name:"BaseCover"});export{T as _}; //# sourceMappingURL=x6YIWJUm.js.map