import{_ as H}from"./DpUJxqoL.js";import{l as C,k,E as s,F as w,u as t,O as x,b as F,P as c,J as B,Z as T,N as P,U as m,V as b,L as v,ai as q,R as g,Q as h,H as I,a4 as M,a2 as J,a3 as Q,_ as Z,$ as G,q as K}from"./DEIzhR9A.js";import{E as X,p as Y,q as _,a9 as R,F as ee,j as te,aa as ie,e as se,l as le}from"./Cfh3kXIQ.js";import{_ as oe}from"./C5qvglTP.js";import ae from"./Dqvtgzyr.js";import ne from"./BJFSaJwp.js";import re from"./CYLXjrQd.js";import ce from"./-IL9qb0M.js";import{_ as de}from"./Cmn_vM4N.js";import{_ as ue}from"./CZjMpD9W.js";import{u as me}from"./DObx2S2v.js";import{_ as fe}from"./B5Zp2Vr1.js";import{_ as pe}from"./BlYltdjn.js";import{u as ge}from"./Cjs1FLPk.js";import{u as ye}from"./wx5q-daT.js";const L=C({__name:"ProductImage",props:{sizes:{type:String,required:!1,default:void 0},image:{type:Object,required:!0},shouldTrim:{type:Boolean,default:!1},fit:{type:String,default:"contain"},alt:{type:String,default:void 0},quality:{type:Number,default:75},load:{type:Function,default:()=>{}},imageLoading:{type:String,default:"lazy"},preloadImage:{type:Boolean,default:!1}},setup(e){const l=e,i=k(()=>X(l.image.attributes,"imageBackground")==="transparent"?"F4F4F4":"FFFFFF");return(a,r)=>{const d=H;return s(),w(d,{alt:e.alt,quality:e.quality,background:t(i),src:e.image.hash,modifiers:{...e.shouldTrim&&{trim:1}},sizes:e.sizes,loading:e.imageLoading,preload:e.preloadImage,class:x(["picture block",{"picture-contain":e.fit==="contain","picture-cover":e.fit==="cover"}]),onLoad:e.load},null,8,["alt","quality","background","src","modifiers","sizes","loading","preload","class","onLoad"])}}}),ve={class:"absolute inset-0"},be=C({__name:"ProductImageSlider",props:{images:{type:Array,default:()=>[]},title:{type:String,default:""},sizes:{type:String,default:"sm:400 md:800"}},setup(e){const l=e,i=F(0),a=F([]),r=()=>{i.value=i.value+1>=l.images.length?0:i.value+1,a.value.includes(i.value)||a.value.push(i.value)},d=()=>{i.value=i.value-1<0?l.images.length-1:i.value-1};return(y,u)=>{const f=L,p=oe,o=ae,n=ne;return s(),c("div",ve,[(s(!0),c(B,null,T(e.images,($,z)=>(s(),w(p,{key:z},{default:P(()=>[z===t(i)||t(a).includes(z)?(s(),w(f,{key:0,image:$,alt:e.title,sizes:e.sizes,fit:"cover",class:x(["absolute inset-0 transition-opacity duration-200",{"opacity-100":z===t(i),"opacity-0":z!==t(i)}])},null,8,["image","alt","sizes","class"])):m("",!0)]),_:2},1024))),128)),b("button",{class:"absolute left-0 top-1/2 -mt-8 w-[46px] p-4 text-gray-700 focus:outline-none",onClick:u[0]||(u[0]=q($=>d(),["prevent","stop"]))},[v(o)]),b("button",{class:"absolute right-0 top-1/2 -mt-8 w-[46px] p-4 text-gray-700 focus:outline-none",onClick:u[1]||(u[1]=q($=>r(),["prevent","stop"]))},[v(n)])])}}}),he={key:0,class:"inline-block rounded-sm bg-red-500 px-2 py-1 text-sm text-white"},ke={key:0,class:"text-black line-through"},$e={key:0,class:"text-sm text-gray-700"},ze={key:0,class:"mt-0.5 text-sm text-gray-700"},we=C({__name:"ProductPrice",props:{appliedReductions:{type:Array,required:!1,default:()=>[]},price:{type:Object,required:!0,default:()=>{}},lowestPriorPrice:{type:Object,default:()=>({withTax:null})},showTaxInfo:{type:Boolean,default:!1},showPriceFrom:{type:Boolean,default:!1},showPriceReductionBadge:{type:Boolean,default:!1},size:{type:String,default:"xl"},type:{type:String,default:"loud"}},setup(e){const l=e,{formatCurrency:i}=me(),a=Y(),r=k(()=>_(l.price)),d=k(()=>l.appliedReductions&&l.showPriceReductionBadge),y=k(()=>l.lowestPriorPrice&&l.lowestPriorPrice.withTax);return(u,f)=>(s(),c("div",null,[g(u.$slots,"default",{price:e.price,appliedReductions:e.appliedReductions,toCurrency:t(i)},()=>{var p;return[g(u.$slots,"relative-reductions",{},()=>[t(d)&&e.appliedReductions.length?(s(),c("span",he," -"+h(t(r).relative*100)+"% ",1)):m("",!0)]),b("p",{class:x(["mt-0.5 leading-none md:mt-0",{"mt-2":t(d),"text-lg":e.size==="xl","text-md md:text-sm":e.size==="sm","font-bold":e.type==="loud","text-red-500":e.appliedReductions.length}])},[e.appliedReductions.length?(s(),c("span",ke,h(t(i)(e.price.withTax+t(r).absoluteWithTax)),1)):m("",!0),e.showPriceFrom?(s(),c(B,{key:1},[I(h(u.$t("from")),1)],64)):m("",!0),I(" "+h(t(i)(e.price.withTax)),1)],2),g(u.$slots,"tax-info",{},()=>[e.showTaxInfo?(s(),c("span",$e,h(u.$t("incl_tax")),1)):m("",!0)]),t(a).activeLpl&&e.appliedReductions.length&&t(y)?(s(),c("p",ze,h(u.$t("best_price_30d"))+" "+h(t(i)(((p=e.lowestPriorPrice)==null?void 0:p.withTax)||0)),1)):m("",!0)]})]))}}),xe=C({__name:"ColorCircle",props:{color:{type:Object,default:()=>{}},hasActiveDot:{type:Boolean,default:!1},size:{type:String,default:"md",validator:e=>["xl","lg","md","sm","xs"].includes(e)}},setup(e){const l=e,{isSize:i}=R(l.size),a=k(()=>ee.getColorCodeForId(l.color.id)==="#ffffff");return(r,d)=>(s(),c("span",{key:`color-picker-color-${e.color.value}`,style:M({backgroundColor:r.$helpers.product.getColorCodeForId(e.color.id)}),class:x(["col-span-1 flex items-center justify-center border border-transparent bg-white",{"!border-gray-500":t(a),"size-2.5":t(i)("sm"),"size-4":t(i)("md"),"size-5":t(i)("lg"),"size-8":t(i)("xl")}])},[e.hasActiveDot?(s(),c("span",{key:0,class:x(["inline-block size-2 rounded bg-white",{"bg-black":t(a)}])},null,2)):m("",!0)],6))}}),Pe={class:"flex flex-wrap items-center space-x-1"},Ce=C({__name:"ProductColorsList",props:{value:{type:Array,default:()=>[]},colors:{type:Array,default:()=>[]},withValues:{type:Boolean,default:!1},limit:{type:Number,default:3},size:{type:String,default:"lg",validator:e=>["xl","lg","md","sm","xs"].includes(e)}},setup(e){const l=e,i=l.limit===0?l.colors.length:l.limit,a=k(()=>l.colors.slice(0,i)),r=k(()=>l.colors.length-i);return(d,y)=>{const u=xe,f=fe;return s(),c("div",null,[g(d.$slots,"default",{colors:e.colors},()=>[b("div",Pe,[g(d.$slots,"colors",{colors:t(a)},()=>[(s(!0),c(B,null,T(t(a),p=>g(d.$slots,"color",{color:p},()=>[v(u,{size:e.size,color:p},null,8,["size","color"])])),256))]),g(d.$slots,"further-colors",{count:t(r)},()=>[J(b("span",{class:"pl-1 text-sm leading-none text-gray-600"},h(d.$t("colors",t(r),{count:t(r)})),513),[[Q,t(r)>0]])])]),e.withValues?(s(),w(f,{key:0,class:"mt-1",items:t(a)},null,8,["items"])):m("",!0)])])}}}),Se=["aria-label"],Ae=C({__name:"ProductSizePickerButton",props:{id:{type:Number,required:!0},activeId:{type:Number,default:()=>{}},isAvailable:{type:Boolean,required:!0},label:{type:String,required:!0}},emits:["click"],setup(e){const l=e,i=k(()=>l.activeId===l.id);return(a,r)=>(s(),c("button",{"aria-label":a.$t("select_product_size",{size:e.label}),class:x({"text-gray-600 line-through":!e.isAvailable,"font-bold":t(i)}),onClick:r[0]||(r[0]=d=>a.$emit("click",e.id))},[g(a.$slots,"default",{},()=>[I(h(e.label),1)])],10,Se))}}),Ie=C({__name:"ProductSizePicker",props:{id:{type:Number,default:void 0},variants:{type:Array,required:!0},modelValue:{type:Object,default:()=>{}},size:{type:String,default:"sm",validator:e=>["xl","sm"].includes(e)}},emits:["input","update:modelValue"],setup(e,{emit:l}){const i=e,a=l,r=k({get(){return i.modelValue},set(f){a("update:modelValue",f),a("input",f)}}),d=f=>{const p=i.variants.find(o=>o.id===f);p&&(r.value=p)},y=k(()=>i.variants.map(f=>({id:f.id,size:te(f.attributes,"vendorSize"),isAvailable:ie(f)}))),{isSize:u}=R(i.size);return(f,p)=>{var n;const o=Ae;return s(),c("div",{key:(n=t(r))==null?void 0:n.id,class:x(["inline-flex items-center space-x-4",{"text-xl":t(u)("xl"),"text-sm":t(u)("sm")}])},[(s(!0),c(B,null,T(t(y),$=>{var z,A;return s(),w(o,{id:$.id,key:$.id,size:e.size,"active-id":(z=t(r))==null?void 0:z.id,label:((A=$.size)==null?void 0:A.label)||"","is-available":$.isAvailable,onClick:d},null,8,["id","size","active-id","label","is-available"])}),128))],2)}}}),Be=["id"],Fe={key:0,class:"absolute inset-0 opacity-0 transition duration-500 group-hover:opacity-100"},Te={class:"py-3 pb-6"},Ve={class:"inline-flex w-full justify-between"},qe={key:0,class:"mt-4"},Re={key:1,class:"mt-2 text-xs uppercase tracking-wider md:mt-1"},Le={key:1,class:"mt-2 space-y-5"},Ne={class:"mt-2"},_e=C({__name:"ProductCard",props:{id:{type:Number,required:!0},link:{type:[Object,String],default:()=>""},loading:{type:Boolean,default:!0},isInWishlist:{type:Boolean,default:!1},title:{type:String,required:!0},price:{type:Object,default:()=>{}},lowestPriorPrice:{type:Object,default:()=>({withTax:null})},variants:{type:Array,default:()=>[]},image:{type:Object,default:()=>{}},hoverImages:{type:Array,default:()=>[]},badgeLabel:{type:String,default:null},showAddToCart:{type:Boolean,default:!1},showAddToWishlist:{type:Boolean,default:!0},showAvailableColors:{type:Boolean,default:!0},colors:{type:Array,default:()=>[]},columns:{type:Number,default:void 0},isAvailable:{type:Boolean,default:!0},trackingPayload:{type:Object,default:()=>null}},emits:["intersect:product","click:product","click:toggle-wishlist","click:add-to-basket"],setup(e){const l=e,i=o=>l.columns===o,a=ge(),{$helpers:r}=se(),{trackSelectItem:d}=ye(),y=F(r.product.getFirstAvailableVariant(l.variants)),u=()=>{l.trackingPayload&&d(l.trackingPayload)},f=k(()=>{var o,n;return((o=y.value)==null?void 0:o.stock.isSellableWithoutStock)||((n=y.value)==null?void 0:n.stock.quantity)>0}),p=k(()=>a.isMobile);return(o,n)=>{const $=L,z=be,A=le,N=re,j=ce,V=de,O=ue,W=we,U=Ce,D=Ie,E=pe;return s(),c("div",{class:x(["group relative",{"animate-pulse":e.loading,"col-span-12 md:col-span-6":i(1),"col-span-6 md:col-span-4":i(2)}])},[g(o.$slots,"default",{},()=>[v(E,{threshold:.5,onEnter:n[6]||(n[6]=S=>o.$emit("intersect:product",e.id))},{default:P(()=>[b("article",{id:`product-${e.id}`},[g(o.$slots,"header",{},()=>[v(A,{to:e.link,onClick:u},{default:P(()=>[b("div",{class:"group aspect-h-4 aspect-w-3 relative flex items-center justify-center bg-gray-200",onClick:n[0]||(n[0]=S=>o.$emit("click:product"))},[g(o.$slots,"header-actions"),g(o.$slots,"header-image",{image:e.image},()=>[v($,{fit:"cover",alt:e.title,image:e.image,sizes:i(2)||e.columns===void 0?"sm:200 lg:400 xl:600 2xl:850":"sm:400 xl:600 2xl:850","should-trim":!1,class:x(["transition-opacity duration-500",{"group-hover:opacity-0":!t(p)&&e.hoverImages.length&&e.isAvailable,"opacity-40":!e.isAvailable}])},null,8,["alt","image","sizes","class"]),!t(p)&&e.hoverImages.length?(s(),c("div",Fe,[e.isAvailable?(s(),w(z,{key:0,sizes:i(2)||e.columns===void 0?"sm:200 lg:400 xl:600 2xl:850":"sm:400 xl:600 2xl:850",title:e.title,images:e.hoverImages},null,8,["sizes","title","images"])):m("",!0)])):m("",!0)])])]),_:3},8,["to"])]),g(o.$slots,"description",Z(G(o.$props)),()=>[b("div",Te,[b("div",Ve,[v(A,{to:e.link},{default:P(()=>[b("p",{class:"font-default text-md md:text-sm",onClick:n[1]||(n[1]=S=>o.$emit("click:product"))},h(e.title),1)]),_:1},8,["to"]),v(O,null,{default:P(()=>[e.showAddToWishlist?(s(),w(V,{key:0,size:"sm",type:"ghost","no-padding":"",class:x(["mr-4 inline-block size-4 md:group-hover:visible",{"md:invisible":!e.isInWishlist}]),onClick:n[2]||(n[2]=S=>o.$emit("click:toggle-wishlist"))},{icon:P(()=>[e.isInWishlist?m("",!0):(s(),w(N,{key:0,class:"size-4","data-test-id":"wishlist-icon"})),e.isInWishlist?(s(),w(j,{key:1,class:"size-4","data-test-id":"wishlist-filled"})):m("",!0)]),_:1},8,["class"])):m("",!0)]),_:1})]),g(o.$slots,"description-price",{price:e.price},()=>[v(A,{to:e.link},{default:P(()=>[b("div",{onClick:n[3]||(n[3]=S=>o.$emit("click:product"))},[v(W,{"data-test-id":"price",price:e.price,"lowest-prior-price":e.lowestPriorPrice,"applied-reductions":e.price.appliedReductions,type:"whisper",size:"sm"},null,8,["price","lowest-prior-price","applied-reductions"])])]),_:1},8,["to"])]),e.showAddToCart?m("",!0):(s(),c("div",qe,[e.showAvailableColors?(s(),w(U,{key:0,limit:5,size:"sm",colors:e.colors},null,8,["colors"])):m("",!0),e.badgeLabel?(s(),c("p",Re,h(o.$t(`badge_labels.${e.badgeLabel}`)),1)):m("",!0)])),e.showAddToCart?(s(),c("div",Le,[b("div",Ne,[v(D,{id:e.id,modelValue:t(y),"onUpdate:modelValue":n[4]||(n[4]=S=>K(y)?y.value=S:null),class:"h-auto",variants:e.variants},null,8,["id","modelValue","variants"])]),v(V,{type:"outline",disabled:!t(f),onClick:n[5]||(n[5]=S=>o.$emit("click:add-to-basket",t(y)))},{default:P(()=>[I(h(o.$t("add")),1)]),_:1},8,["disabled"])])):m("",!0)])])],8,Be)]),_:3})])],2)}}});export{L as _,_e as a,we as b,Ie as c,xe as d};