1import{d as j,y as H,k as ae,m as o,A as u,G as b,n,U as G,q as h,B as c,r as t,X as ne,F as v,C as W,ak as F,V as J,N as Y,c as re,g as le,h as K,bp as ie,p as i,aX as X,H as q,t as p,a0 as ce,Q as ue}from"./CVwrGpym.js";import{_ as de}from"./D0nB8eqA.js";import{_ as pe}from"./Ds83UTSa.js";import{_ as me}from"./BSkmk37U.js";import{e as fe,h as D,g as Q,a as he}from"./Cb6LajRI.js";import{u as ge}from"./RCeNOTWx.js";import{u as ye}from"./DU0o-R4G.js";import{u as _e}from"./C_XSefLT.js";const ve=["aria-label"],ke=["aria-label"],Ce=j({__name:"ProductCardImages",props:{to:{},images:{},isHover:{type:Boolean},product:{}},setup(U){const a=U,M=H(null),d=H(0);ae(()=>{a.isHover?g(1):g(0)});function g(s){s>a.images.length-1||(d.value=s)}function $(){g(d.value>=a.images.length-1?0:d.value+1)}function k(){g(d.value<=0?a.images.length-1:d.value-1)}return(s,Z)=>{var C;const y=J,x=de,O=Y;return o(),u(O,{ref_key:"el",ref:M,to:s.to,class:F(["product-image-container"]),"aria-label":(C=s.product.currentTranslation)==null?void 0:C.title},{default:b(()=>{var m;return[s.isHover&&s.images.length>1?(o(),n("button",{key:0,class:"absolute left-1 top-1/2 z-10 -translate-y-1/2","aria-label":s.$t("previousSlide"),onClick:G(k,["stop","prevent"])},[h(y,{name:"chevron_left",class:"h-6 w-6 text-gray-elements"})],8,ve)):c("",!0),("isEmpty"in s?s.isEmpty:t(ne))(s.images)?(o(),u(x,{key:1,alt:(m=s.product.currentTranslation)==null?void 0:m.title,class:"transition-300 absolute inset-0 h-full w-full",src:"/images/no-image.webp","data-e2e-image":"product"},null,8,["alt"])):(o(!0),n(v,{key:2},W(s.images,(V,B)=>{var _;return o(),u(x,{key:B,alt:(_=s.product.currentTranslation)==null?void 0:_.title,class:F(["transition-300 absolute inset-0 h-full w-full",t(d)===B?"opacity-100":"opacity-0"]),src:V.url,"data-e2e-image":"product"},null,8,["alt","src","class"])}),128)),s.isHover&&s.images.length>1?(o(),n("button",{key:3,class:"absolute right-1 top-1/2 z-10 -translate-y-1/2","aria-label":s.$t("nextSlide"),onClick:G($,["stop","prevent"])},[h(y,{name:"chevron_right",class:"h-6 w-6 text-gray-elements"})],8,ke)):c("",!0)]}),_:1},8,["to","aria-label"])}}}),we={class:"relative mb-2.5"},Se={class:"pointer-events-none absolute left-4 top-3.5 flex max-h-full flex-col flex-wrap items-start gap-2"},be={class:"flex"},$e={"data-e2e-item":"product-title"},xe={class:"flex items-center gap-1 font-gt-ultra-median text-xxs font-250 italic text-gray-60"},Be={class:"lowercase"},Ie={class:"text-base font-normal not-italic text-orange-60","data-e2e-item":"product-price"},Te={key:1,class:"text-base font-normal not-italic text-orange-60","data-e2e-item":"out-of-stock"},Pe={key:1,class:"text-base font-normal not-italic text-orange-60","data-e2e-item":"out-of-stock"},ze={key:2,class:"flex gap-1 text-base font-normal not-italic text-orange-60","data-e2e-item":"product-price"},Ee={key:0,class:"text-gray-70 line-through"},We=j({__name:"ProductCardPlp",props:{hover:{type:Boolean},imageBrightnessFilter:{default:"100"},cardContentPosition:{default:"left"},product:{},plpType:{},extractSetting:{type:Boolean},productIndex:{default:0},statisticItemListName:{default:""},imageBackgroundColor:{},showWishlistButton:{type:Boolean,default:!0}},setup(U){const a=U,{inWishlist:M,updateWishlist:d}=ge(),{productMaterials:g,productLink:$,productPrice:k,productTitlePlp:s,discountValue:Z,productStartAtPrice:y,isConfigurationInventoryOutOfStockPlp:x,isConfigurationOutOfStockPlp:O,productSKU:C}=ye(a.product,fe),{filtersData:m}=re(),{mdAndDown:V}=_e(),{selectItemEvent:B}=le(),_=H(!1),ee=K(()=>ie(a.product)),te=K(()=>{var T,P,z,E;const e=a.product,f=a.product;let w=!1;if((T=e==null?void 0:e.collections)!=null&&T.length)w=e.collections.some(l=>l.slug===D.readyToShip);else if((P=f==null?void 0:f.collections_ids)!=null&&P.length&&(m!=null&&m.collections)){const l=m.collections.find(N=>N.slug===D.readyToShip);l&&(w=f.collections_ids.includes(l.id))}const I=(z=e==null?void 0:e.categories)==null?void 0:z.some(l=>l.sku===Q.sale);return!!(((E=e==null?void 0:e.categories)==null?void 0:E.some(l=>l.sku===Q.readyToShip))||w||I)});function oe(){V.value||(_.value=!0)}function se(){_.value=!1}function A(){B(a.product,{index:a.productIndex,item_list_name:a.statisticItemListName})}return(e,f)=>{var l,N;const w=Ce,I=J,S=pe,T=ce,P=ue,z=Y,E=me;return o(),n("div",{class:"group/product-card relative transform-gpu overflow-hidden bg-white transition hover:z-10",onMouseenter:oe,onMouseleave:se},[i("div",we,[i("div",{class:"aspect-h-1 aspect-w-1 w-full overflow-hidden bg-white",style:X({filter:`brightness(${e.imageBrightnessFilter}
1%)`,backgroundColor:((l=e.imageBackgroundColor)==null?void 0:l.hexa)||"transparent"})},[h(w,{class:"block h-full w-full",to:t($),"is-hover":t(_),images:t(ee),product:e.product,onClick:A},null,8,["to","is-hover","images","product"])],4),i("div",Se,[t(te)?(o(),u(S,{key:0,color:"secondary",text:"",class:"h-6 py-0 font-light"},{default:b(()=>[h(I,{name:"truck-red",class:"mr-0.5 size-6 text-primary"}),q(" "+p(e.$t("readyToShip")),1)]),_:1})):c("",!0),e.product.sale?(o(),u(S,{key:1,color:"secondary",text:e.$t("sale"),class:"h-6 py-0 font-light"},null,8,["text"])):c("",!0),e.product.bestseller?(o(),u(S,{key:2,color:"secondary",class:"h-6 py-0 font-light",text:e.$t("bestSeller")},null,8,["text"])):c("",!0),e.product.badges?(o(!0),n(v,{key:3},W(e.product.badges,(r,L)=>{var R;return o(),u(S,{key:L,color:"secondary",class:"h-6 py-0 font-light",text:(R=r==null?void 0:r.currentTranslation)==null?void 0:R.name},null,8,["text"])}),128)):c("",!0)]),h(P,null,{default:b(()=>[e.product.default_sku&&e.showWishlistButton?(o(),u(T,{key:0,class:"absolute right-2 top-2 rounded-full bg-white text-gray-90",variant:"clear","variant-type":"icon",size:"xs",text:"xs","aria-label":e.$t("addToWishlist"),"data-e2e-btn":"add-to-wishlist",onClick:f[0]||(f[0]=r=>{t(d)({sku:t(C),vendor_model:e.product.vendor_model}),A()})},{default:b(()=>[h(I,{name:"heart",class:F(["size-3.5",[t(M)({sku:t(C),vendor_model:e.product.vendor_model})?"fill-current text-strawberry":"text-strawberry"]]),"aria-hidden":"true"},null,8,["class"])]),_:1},8,["aria-label"])):c("",!0)]),_:1})]),i("div",{class:"relative flex flex-col space-y-1",style:X({alignItems:e.cardContentPosition==="left"?"start":"center"})},[i("div",be,[h(z,{to:t($),class:"block flex-auto text-xs font-light md:text-sm",onClick:A},{default:b(()=>[i("span",$e,p(t(s)),1)]),_:1},8,["to"])]),i("p",xe,[(N=e.product)!=null&&N.active_configurations_count&&!t(y)?(o(),n(v,{key:0},[t(k)&&!t(x)?(o(),n(v,{key:0},[i("span",Be,p(e.$t("startingAt"))+":",1),i("span",Ie,p(e.$n(t(k),"currency")),1)],64)):(o(),n("span",Te,p(e.$t("outOfStock")),1))],64)):t(O)?(o(),n("span",Pe,p(e.$t("outOfStock")),1)):(o(),n("span",ze,[t(y)?(o(),n("span",Ee,p(e.$n(t(y),"currency")),1)):c("",!0),q(" "+p(e.$n(t(k),"currency")),1)]))]),(o(!0),n(v,null,W(t(g),r=>{var L;return o(),n(v,{key:r==null?void 0:r.id},[((L=r==null?void 0:r.materials)==null?void 0:L.length)>=1?(o(),u(E,{key:0,product:e.product,data:r,"show-images":a.plpType===t(he).default,"show-current-material":!1},null,8,["product","data","show-images"])):c("",!0)],64)}),128))],4)],32)}}});export{We as _}; 2//# sourceMappingURL=DKmMCyk_.js.map
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.