import gt from"./By7gKsnr.js";import _t from"./CcbNvuVW.js";import Xe from"./_MKtFqXF.js";import{b3 as ge,b4 as we,b5 as bt,i as yt,u as me,b6 as ht,ay as et,b7 as xt,b8 as wt,b9 as Be,b2 as tt,ba as Ct,d as ze,bb as st,v as Me,q as je,Z as kt,b0 as $t,bc as St,a_ as Ft,bd as Pt,_ as nt,R as at,be as qe,bf as At,bg as Et,I as It,T as lt,F as Rt,$ as ot,bh as He,bi as Nt,bj as Lt,bk as Dt,bl as Ot,bm as Tt,bn as Vt,g as Bt,au as qt,a4 as Ut,bo as zt,a as Mt,a8 as jt,bp as ne,bq as Gt}from"./BDl4c6dV.js";import{k as b,j as W,L as a,O as v,H as Z,Y as ee,I as E,S as O,_ as re,U as B,V as se,u as n,a as J,R as D,P as d,a3 as le,a4 as oe,W as C,M as z,ao as Wt,Z as ke,a2 as Ht,a0 as $e,aj as rt,X as Ye,al as Yt,N as Kt,r as Ke,b as Ce,z as it,a5 as Ue,a1 as ut,t as Qt}from"./DGQDO-VU.js";import{u as ct}from"./CByEd5-Q.js";import{u as Zt}from"./vscFxidx.js";import{_ as Jt}from"./C6mNxbbv.js";import{V as Xt}from"./Cu5tR6Ux.js";import{C as es}from"./Dat28EeT.js";const _e={TOPSELLER:"topseller",DATE_NEWEST:"date_newest",PRICE_DESC:"price_desc",PRICE_ASC:"price_asc",REDUCTION_DESC:"reduction_desc",REDUCTION_ASC:"reduction_asc"},Q={TOPSELLER:"topseller",DATE_NEWEST:"date-newest",PRICE_DESC:"price-desc",PRICE_ASC:"price-asc",REDUCTION_DESC:"reduction-desc",REDUCTION_ASC:"reduction-asc"},ae={topSeller:{by:ge.Price,direction:we.Descending,name:_e.TOPSELLER,query:Q.TOPSELLER},dateNewest:{by:ge.DateAdded,name:_e.DATE_NEWEST,query:Q.DATE_NEWEST},priceDesc:{by:ge.Price,direction:we.Descending,name:_e.PRICE_DESC,query:Q.PRICE_DESC},priceAsc:{by:ge.Price,direction:we.Ascending,name:_e.PRICE_ASC,query:Q.PRICE_ASC},reductionDesc:{by:ge.Reduction,direction:we.Descending,name:_e.REDUCTION_DESC,query:Q.REDUCTION_DESC},reductionAsc:{by:ge.Reduction,direction:we.Ascending,name:_e.REDUCTION_ASC,query:Q.REDUCTION_ASC}},dt=(e=["topSeller","dateNewest","priceDesc","priceAsc","reductionDesc","reductionAsc"])=>bt(ae,e),Ge=(e,g)=>{switch(e){case Q.PRICE_DESC:return ae.priceDesc;case Q.PRICE_ASC:return ae.priceAsc;case Q.REDUCTION_DESC:return ae.reductionDesc;case Q.REDUCTION_ASC:return ae.reductionAsc;case Q.TOPSELLER:return ae.topSeller;case Q.DATE_NEWEST:return ae.dateNewest;default:return ae[g||"dateNewest"]}},ts={WHITE:{id:6,hex:"#ffffff"},BEIGE:{id:1564,hex:"#e3dad1"},BLACK:{id:7,hex:"#000000"},GRAY:{id:8,hex:"#888888"},DARK_GRAY:{id:611,hex:"#808080"},RED:{id:9,hex:"#a52a2a"},BLUE:{id:10,hex:"#0000ff"},BRIGHT_GREEN:{id:11,hex:"#00ff00"},BRIGHT_YELLOW:{id:12,hex:"#ffff00"},BRIGHT_RED:{id:13,hex:"#ff0000"},DULL_PINK:{id:62,hex:"#ffc0cb"},YELLOW:{id:594,hex:"#ffd700"},MIX:{id:1370,hex:["#0000ff","#ffa500","#ff0000","#008000"]}},ss=["page","sort","term","menu","email","utm_id","utm_term","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","gclid","fbclid","msclkid","gbraid","wbraid"];function ns(e={}){const g=yt(),o=me(),c=b(()=>{const _=Object.fromEntries(Object.entries(o.query).filter(([y])=>!ss.includes(y)));return ht(_)}),r=_=>_?xt(c.value,_):et(c.value),l=async(_,y=!0)=>{const F={sort:o.query.sort,term:o.query.term,..._?wt(_):{}};Be(o.query,F)||(await g.push({query:{...F}}),y&&window.scroll({behavior:"smooth",top:0}))},s=async()=>{await g.replace({query:{term:o.query.term}})},m=()=>{var _;return{where:{...tt(c.value)},page:Ct(o.query),sort:Ge(((_=o.query)==null?void 0:_.sort)||"",e==null?void 0:e.defaultSort)}};return{activeFilters:c,applyFilters:l,isActiveFilter:r,resetFilterUrl:s,productConditions:b(()=>m())}}const as=(e="md")=>({isSize:o=>o===e}),ls={class:"flex gap-2 overflow-x-auto scrollbar-hide md:block md:overflow-visible"},mt=W({__name:"SortingItemsList",props:{items:{type:Array,required:!0},selected:{type:String,default:""}},emits:["click:item"],setup(e){const g=me();return(o,c)=>{const r=ze;return a(),v("ul",ls,[(a(!0),v(Z,null,ee(e.items,l=>(a(),v("li",{key:l.name},[E(r,{"only-exact-active":!0,class:se(["btn btn-ghost btn-small md:border-0 md:p-0 md:normal-case md:tracking-normal md:hover:underline",{"font-bold":l.name===e.selected}]),to:{params:{...n(g).params},query:{...n(g).query,sort:l.query}},rel:"nofollow",onClick:s=>o.$emit("click:item",l)},{default:O(()=>[re(B(o.$t(`sorting_select.${l.name}`)),1)]),_:2},1032,["class","to","onClick"])]))),128))])}}}),os={key:0,class:"absolute right-0 top-full z-50 mt-2 min-w-full whitespace-nowrap border border-gray-200 bg-white px-4 pb-5 pt-3 shadow"},rs={name:"AppMenu"},is=W({...rs,setup(e){const g=J(null),o=J(!1),c=()=>{o.value=!1};st(g,c);const r=()=>{o.value=!o.value};return(l,s)=>(a(),v("div",{ref_key:"targetClickOutside",ref:g},[D(l.$slots,"default",{},()=>[d("div",null,[D(l.$slots,"label",le(oe({toggle:r})))]),o.value?(a(),v("div",os,[D(l.$slots,"menu-content",le(oe({toggle:r,close:c})))])):C("",!0)])],512))}}),us={class:"flex justify-end"},cs=W({__name:"SortingMenu",props:{values:{type:Array,required:!0},selected:{type:String,default:""}},setup(e){const g=e,{trackFilterApply:o}=Me(),c=r=>{o("sort",r.name),J(g.selected)};return(r,l)=>{const s=_t,m=Xe,_=je,y=mt,F=kt,T=is;return a(),z(T,{class:"relative"},{label:O(({toggle:P})=>[d("div",us,[E(_,{"data-test-id":"sorting-button",class:"flex items-center",onClick:P},{icon:O(()=>[E(s,{class:"mr-3.5 h-[15px] w-[18p]"})]),badge:O(()=>[E(m,{class:"ml-2 h-2 w-3.5"})]),default:O(()=>[d("span",null,B(r.$t(`sorting_select.${e.selected}`)),1)]),_:2},1032,["onClick"])])]),"menu-content":O(({close:P})=>[E(F,null,{default:O(()=>[E(y,{items:e.values,selected:e.selected,class:"w-full space-y-2","onClick:item":I=>(c(I),P())},null,8,["items","selected","onClick:item"])]),_:2},1024)]),_:1})}}}),ds={key:0,class:"col-span-12 col-start-1 row-start-5 md:col-span-4 md:col-start-9"},ms={key:1,class:"col-span-12 col-start-1 row-span-2 row-start-5 md:col-span-4 md:col-start-9"},ps={key:2,class:"col-span-12 col-start-1 row-start-5 md:col-span-8 md:col-start-5"},vs={key:3,class:"col-span-12 col-start-1 row-start-5"},fs={key:4,class:"col-span-12 col-start-1 row-start-[10] md:col-span-4 md:col-start-9"},gs={key:5,class:"col-span-12 col-start-1 row-span-2 row-start-[10] md:col-span-4 md:col-start-9"},_s={key:6,class:"col-span-12 col-start-1 row-start-[10] md:col-span-8 md:col-start-5"},bs={key:7,class:"col-span-12 col-start-1 row-start-[10]"},ys=W({__name:"ProductList",props:{productsCount:{type:Number,default:()=>0},products:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},productCardClass:{type:String,default:()=>"col-span-6 md:col-span-4"}},emits:["intersect:row","click:product"],setup(e,{emit:g}){const o=Wt(),c=e,r=g,{products:l}=ke(c),{query:s}=me(),{md:m,lg:_}=$t(),y=b(()=>parseInt(s.page)||1),F=b(()=>_.value?4:m.value?3:2),T=i=>Pt(i,{columns:F.value,page:y.value,perPage:18}),P=J([]),I=(i,$)=>{const R=T($);if(St($,F.value)&&P.value.findIndex(k=>k.row===R)===-1){const k=l.value.slice($,$+F.value).map((u,H)=>({...u,index:$+H}));r("intersect:row",{row:R,items:k}),P.value.push({row:R,items:k})}},q=b(()=>{let i=27;return o["gbp_2_banner-1x1"]&&(i+=2),o["gbp_2_banner-1x2"]&&(i+=4),o["gbp_2_banner-2x1"]&&(i+=1),o["gbp_1_banner-1x1"]&&(i-=1),o["gbp_1_banner-1x2"]&&(i-=2),o["gbp_1_banner-2x1"]&&(i-=2),o["gbp_1_banner-full-width"]&&(i-=3),i});return(i,$)=>{const R=Ft;return a(),v("div",null,[(a(!0),v(Z,null,ee(n(l),(V,k)=>D(i.$slots,"product",{product:V,loading:e.loading},()=>[(a(),z(R,{class:se(e.productCardClass),key:`product-${V.id}`,"data-test-id":"product-item",product:V,"listing-meta-data":{name:"Category Product List",id:"CategoryProductList"},"image-loading":k===0?"eager":"lazy",loading:e.loading,"onClick:product":u=>r("click:product",V,k),"onIntersect:product":u=>I(u,k),"show-siblings":!0},null,8,["class","product","image-loading","loading","onClick:product","onIntersect:product"]))])),256)),i.$slots["gbp_1_banner-1x1"]&&e.productsCount>=14?(a(),v("div",ds,[D(i.$slots,"gbp_1_banner-1x1")])):C("",!0),i.$slots["gbp_1_banner-1x2"]&&e.productsCount>=16?(a(),v("div",ms,[D(i.$slots,"gbp_1_banner-1x2")])):C("",!0),i.$slots["gbp_1_banner-2x1"]&&e.productsCount>=13?(a(),v("div",ps,[D(i.$slots,"gbp_1_banner-2x1")])):C("",!0),i.$slots["gbp_1_banner-full-width"]&&e.productsCount>=12?(a(),v("div",vs,[D(i.$slots,"gbp_1_banner-full-width")])):C("",!0),i.$slots["gbp_2_banner-1x1"]&&e.productsCount>=q.value?(a(),v("div",fs,[D(i.$slots,"gbp_2_banner-1x1")])):C("",!0),i.$slots["gbp_2_banner-1x2"]&&e.productsCount>=q.value?(a(),v("div",gs,[D(i.$slots,"gbp_2_banner-1x2")])):C("",!0),i.$slots["gbp_2_banner-2x1"]&&e.productsCount>=q.value?(a(),v("div",_s,[D(i.$slots,"gbp_2_banner-2x1")])):C("",!0),i.$slots["gbp_2_banner-full-width"]&&e.productsCount>=q.value?(a(),v("div",bs,[D(i.$slots,"gbp_2_banner-full-width")])):C("",!0)])}}}),hs={key:0},xs=W({__name:"PaginationTotals",props:{pagination:{type:Object,default:()=>{}}},setup(e){return ke(e),(o,c)=>e.pagination?(a(),v("div",hs,B(Math.min(e.pagination.total,(e.pagination.page-1)*e.pagination.perPage+e.pagination.current))+" van de "+B(e.pagination.total)+" gezien ",1)):C("",!0)}}),ws=W({__name:"PaginationButton",props:{disabled:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},page:{}},setup(e){const g=e,o=me(),c=b(()=>{var s;const l={path:o.path,query:{...o.query,page:g.page.toString()}};return g.page===1&&((s=l==null?void 0:l.query)==null||delete s.page),l}),r=()=>{window.scroll({behavior:"smooth",top:0})};return(l,s)=>{const m=ze;return a(),z(m,{to:c.value,class:se(["inline-flex items-center px-4 py-2 text-center text-sm",{"font-bold":l.isActive}]),"data-test-id":"paginationButton",onClick:r},{default:O(()=>[D(l.$slots,"default")]),_:3},8,["to","class"])}}}),Cs={key:0,class:"flex flex-row items-stretch justify-center space-x-2"},ks=d("div",{class:"p-3"},"...",-1),$s=d("div",{class:"p-3"},"...",-1),Ss=W({__name:"Pagination",props:{firstPage:{type:Number,required:!0},currentPage:{type:Number,required:!0},lastPage:{type:Number,required:!0},visible:{type:Number,default:5}},setup(e){const g=e,{visible:o,firstPage:c,currentPage:r,lastPage:l}=ke(g),{limitedPageNumbers:s,previousPage:m,nextPage:_,showFirst:y,showFirstDots:F,showLast:T,showLastDots:P,canNavigateLeft:I,canNavigateRight:q}=ct({firstPage:c,currentPage:r,lastPage:l,visiblePages:o});return(i,$)=>{const R=nt,V=ws,k=at;return n(l)!==1?(a(),v("div",Cs,[D(i.$slots,"previous-button",le(oe({canNavigateLeft:n(I),previousPage:n(m)})),()=>[n(I)?(a(),z(V,{key:0,page:n(m)},{default:O(()=>[E(R,{class:"h-3 w-3"})]),_:1},8,["page"])):C("",!0)]),D(i.$slots,"first-page-button",le(oe({canNavigateLeft:n(I),previousPage:n(m),showFirst:n(y)})),()=>[n(y)?(a(),z(V,{key:0,page:n(c)},{default:O(()=>[re(B(n(c)),1)]),_:1},8,["page"])):C("",!0)]),n(F)?D(i.$slots,"page-dots",{key:0},()=>[ks]):C("",!0),D(i.$slots,"page-buttons",le(oe({limitedPageNumbers:n(s),currentPage:n(r)})),()=>[(a(!0),v(Z,null,ee(n(s),u=>(a(),z(V,{key:u,"is-active":n(r)===u,page:u},{default:O(()=>[re(B(u),1)]),_:2},1032,["is-active","page"]))),128))]),n(P)?D(i.$slots,"page-dots",{key:1},()=>[$s]):C("",!0),D(i.$slots,"last-page-button",le(oe({lastPage:n(l),showLast:n(T)})),()=>[n(T)?(a(),z(V,{key:0,page:n(l)},{default:O(()=>[re(B(n(l)),1)]),_:1},8,["page"])):C("",!0)]),D(i.$slots,"next-button",le(oe({canNavigateRight:n(q),nextPage:n(_)})),()=>[n(q)?(a(),z(V,{key:0,page:n(_)},{default:O(()=>[E(k,{class:"h-3 w-3"})]),_:1},8,["page"])):C("",!0)])])):C("",!0)}}}),Fs={key:0,class:"flex flex-row items-stretch justify-center space-x-2"},Ps=d("span",null,"Toon meer artikelen",-1),As=W({__name:"LoadMore",props:{firstPage:{},currentPage:{},lastPage:{},visible:{default:5}},emits:["loadMore"],setup(e,{emit:g}){const o=g,c=e,{visible:r,firstPage:l,currentPage:s,lastPage:m}=ke(c),{canNavigateRight:_}=ct({firstPage:l,currentPage:s,lastPage:m,visiblePages:r}),y=me(),F=b(()=>({path:y.path,query:{...y.query}}));function T(){o("loadMore")}return(P,I)=>{const q=ze;return n(m)!==1&&n(_)?(a(),v("div",Fs,[E(q,{class:"btn btn-cta w-full md:w-auto md:px-12",to:F.value,event:"",onClick:Ht(T,["prevent","stop"])},{default:O(()=>[Ps]),_:1},8,["to"])])):C("",!0)}}}),Es=(e,g)=>e.reduce((o,c)=>{const r=g.find(l=>l.slug===c);return o[c]=pt(g,[c],{sortable:(r==null?void 0:r.attributeGroupType)!=="size_filter"}),o},{}),pt=(e,g,{sortable:o}={sortable:!0})=>{const r=(g?e.filter(l=>g.includes(l.slug)):e).reduce((l,s)=>{var m;return(m=s.values)==null||m.forEach(_=>{const y=s.type===qe.BOOLEAN,F="name"in _;if(y&&F&&_.name===!1)return;const T=Is(_,s.type),P=F?String(_.name):"";l.push({key:s.slug,displayName:y?s.name:P,count:_.productCount,value:T,whereCondition:{[s.slug]:T}})}),l},[]);return o?r.sort((l,s)=>l.displayName.localeCompare(s.displayName)):r},Is=(e,g)=>{switch(g){case qe.BOOLEAN:return e.name;case qe.RANGE:return{min:e.min,max:e.max};default:return e.id}},Rs=["for"],Ns=["id","value"],vt=W({__name:"Checkbox",props:{modelValue:{default:()=>[]},item:{default:void 0},id:{},label:{default:void 0}},emits:["update:model-value"],setup(e,{emit:g}){const o=e,c=g,r=b({get:()=>o.modelValue,set:l=>c("update:model-value",l)});return b(()=>r.value.findIndex(l=>l===o.item)!==-1),(l,s)=>(a(),v("label",{for:l.id,class:"group block py-2"},[$e(d("input",{id:l.id,"onUpdate:modelValue":s[0]||(s[0]=m=>r.value=m),value:l.item,type:"checkbox"},null,8,Ns),[[rt,r.value]]),d("span",null,[D(l.$slots,"label",{},()=>[re(B(l.label),1)])])],8,Rs))}}),Ls={class:"flex w-full flex-col"},Ds={class:"flex items-center justify-between"},Os={class:"grow capitalize"},Ts={key:0,class:"ml-2.5 hidden font-bold md:block"},Vs={key:0,class:"mt-1 truncate text-xs text-gray-400 md:hidden"},Bs=W({__name:"FilterGroup",props:{label:{type:String,default:""},resetLabel:{type:String,default:null},badge:{type:Number,default:0},showAction:{type:Boolean,default:!1}},emits:["apply"],setup(e,{emit:g}){const o=e,c=g,r=J(!1),l=J(o.badge),s=()=>{r.value=!r.value},m=()=>{l.value!==o.badge&&c("apply"),s()},_=J(null);return st(_,()=>{r.value&&(c("apply"),r.value=!1)}),(y,F)=>{const T=at,P=Xe;return a(),v("div",{ref_key:"target",ref:_,class:"border-b border-gray-300 md:relative md:border-0"},[d("button",{type:"button","data-class":"md:btn md:btn-ghost flex w-full min-w-[124px] items-center py-3 text-left",class:"flex w-full min-w-[124px] items-center py-3 text-left md:inline-flex md:min-w-0 md:gap-2.5 md:border md:border-gray-300 md:px-3 md:py-2 md:leading-normal",onClick:s},[d("div",Ls,[d("div",Ds,[d("span",Os,B(e.label),1),e.badge?(a(),v("span",Ts,"("+B(e.badge)+")",1)):C("",!0)]),e.badge&&y.$slots["active-filters"]?(a(),v("div",Vs,[D(y.$slots,"active-filters")])):C("",!0)]),E(T,{class:"h-3 w-3.5 flex-none md:ml-3 md:hidden"}),E(P,{class:"hidden h-2 w-3.5 flex-none md:block"})]),d("div",{class:se(["absolute inset-0 z-20 flex flex-col bg-white transition-transform duration-200 md:inset-auto md:left-0 md:top-full md:mt-2 md:w-[264px] md:rounded md:border md:border-gray-200 md:shadow",r.value?"translate-x-0":"translate-x-full md:hidden md:translate-x-0"])},[D(y.$slots,"default",{toggle:s,applyFilters:m})],2)],512)}}}),qs={class:"pb-28 md:p-6"},Us=d("button",{class:"flex h-4 w-4 cursor-pointer rounded-full bg-black focus:outline-none"},[d("div",{class:"m-auto h-2 w-2 rounded-full bg-white"})],-1),zs={class:"mt-4 flex items-center"},Ms={class:"mx-auto px-1 text-center text-xs font-semibold"},js=W({__name:"RangeSlider",props:{modelValue:{default:()=>[3,29999]},min:{default:0},max:{default:1e5},currencyCode:{},locale:{}},emits:["update:model-value","change","drag-start","drag-end","dragging","error"],setup(e,{emit:g}){const o=e,c=g,r=b({get:()=>o.modelValue,set:s=>c("update:model-value",s)}),l=(s,m)=>{const _=[...r.value];_[m]=s,r.value=_};return(s,m)=>{const _=Jt;return a(),v("div",qs,[E(n(Xt),{modelValue:r.value,"onUpdate:modelValue":m[0]||(m[0]=y=>r.value=y),"enable-cross":!1,min:s.min,max:s.max,contained:"",adsorb:"",tooltip:"none","tooltip-placement":"bottom",interval:1,onChange:m[1]||(m[1]=y=>c("change")),onDragStart:m[2]||(m[2]=y=>c("drag-start")),onDragEnd:m[3]||(m[3]=y=>c("drag-end")),onDragging:m[4]||(m[4]=y=>c("dragging")),onError:m[5]||(m[5]=y=>c("error"))},{dot:O(()=>[Us]),_:1},8,["modelValue","min","max"]),d("div",zs,[E(_,{"model-value":r.value[0],min:s.min,max:s.modelValue[1],"currency-code":s.currencyCode,locale:s.locale,"format-options":{minimumFractionDigits:0},"onUpdate:modelValue":m[6]||(m[6]=y=>l(y,0))},null,8,["model-value","min","max","currency-code","locale"]),d("div",Ms,B(s.$t("filter.to")),1),E(_,{"model-value":r.value[1],min:s.modelValue[0],max:s.max,"currency-code":s.currencyCode,locale:s.locale,"format-options":{minimumFractionDigits:0},"onUpdate:modelValue":m[7]||(m[7]=y=>l(y,1))},null,8,["model-value","min","max","currency-code","locale"])])])}}}),Gs={class:"pb-28 md:p-6"},Ws=["for"],Hs=["id","name"],Ys=W({__name:"BooleanFilter",props:{modelValue:{type:Boolean,default:()=>!0},filter:{type:Object,required:!0}},emits:["update:modelValue"],setup(e,{emit:g}){const o=e,c=g,r=b({get:()=>o.modelValue,set:l=>{c("update:modelValue",l)}});return(l,s)=>(a(),v("div",Gs,[d("label",{for:e.filter.slug,class:"group block py-2"},[$e(d("input",{id:e.filter.slug,"onUpdate:modelValue":s[0]||(s[0]=m=>r.value=m),type:"checkbox",name:e.filter.slug},null,8,Hs),[[rt,r.value]]),d("span",null,B(e.filter.name),1)],8,Ws)]))}}),Ks=["data-color-id"],Qs={key:1,class:"grid h-full w-full grid-cols-2"},Zs=W({__name:"ColorChip",props:{...At,color:{type:Object,required:!0},isActive:{type:Boolean,default:!1},rounded:{type:String,default:"default"}},setup(e){const g=e,{isSize:o}=as(g.size),c=b(()=>Et(g.color.id)),r=b(()=>Array.isArray(c.value)),l=b(()=>r.value?c.value.length%2!==0:!1),s=b(()=>r.value?!1:es(c.value).isLight()),m=b(()=>c.value===ts.WHITE.hex||c.value==="#f2efe9"),_=b(()=>({backgroundColor:r.value?"transparent":c.value}));return(y,F)=>{const T=It;return a(),v("span",{key:`color-picker-color-${e.color.value}`,"data-color-id":e.color.id,style:Ye(_.value),class:se(["relative col-span-1 flex items-center justify-center overflow-hidden border border-transparent bg-white",{"!border-gray-500":m.value,"h-2 w-2":n(o)("xs"),"h-3 w-3":n(o)("sm"),"h-4 w-4":n(o)("md"),"h-6 w-6":n(o)("lg"),"h-8 w-8":n(o)("xl"),rounded:e.rounded==="default","rounded-sm":e.rounded==="sm","!border-black":r.value}])},[e.isActive?(a(),z(T,{key:0,class:se(["absolute inset-x-0 m-auto h-5 w-5",s.value?"text-primary":"text-white"])},null,8,["class"])):C("",!0),r.value?(a(),v("span",Qs,[(a(!0),v(Z,null,ee(c.value,(P,I)=>(a(),v("span",{key:`${I}-${P}`,style:Ye({backgroundColor:P}),class:se([{"last-of-type:col-span-full":l.value},"h-full w-full"])},null,6))),128))])):C("",!0)],14,Ks)}}}),Qe=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),Js={class:"flex flex-col pb-28 md:max-h-96 md:pb-0"},Xs={key:0,class:"mb-4 flex-none md:mb-0 md:p-6 md:pb-0"},en=["placeholder"],tn={class:"h-full grow overflow-hidden overflow-y-auto overscroll-contain pb-6 md:px-6 md:pt-6"},sn={key:0,class:"text-lg"},nn={class:"m-0"},an=["aria-label","onClick"],ln=W({__name:"MultipleSelectionList",props:{items:{type:Array,default:()=>[]},name:{type:String,required:!0},modelValue:{type:Array,default:()=>[]},limit:{type:Number,default:null},selectedFirst:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1}},emits:["update:model-value"],setup(e,{emit:g}){const o=e,c=g,r=b({get:()=>o.modelValue,set:i=>c("update:model-value",i)}),l=i=>{s(i)?_(i):m(i)},s=i=>!!r.value.find($=>$.value===i.value),m=i=>{r.value.push(i)},_=i=>{const $=r.value.findIndex(R=>R===i);$!==-1&&r.value.splice($,1)},y=J(!1),F=J(""),T=b(()=>{var k,u,H,pe,j,ie,ue;if(((u=(k=P.value)==null?void 0:k[0])==null?void 0:u.key)!=="brand")return[{items:P.value}];const i=(H=P.value)==null?void 0:H.filter(s),$=((j=(pe=q.value)==null?void 0:pe.data)==null?void 0:j.map(M=>M.id))||[],R=(ie=P.value)==null?void 0:ie.filter(M=>$.includes(`${M.value}`)),V=(ue=P.value)==null?void 0:ue.filter(M=>!$.includes(`${M.value}`));return V.length?[{label:"Gekozen merken",items:i},R.length?{label:"Favoriete merken",items:R.filter(M=>!s(M))}:null,{label:i.length||R.length?"Overige merken":"",items:V.filter(M=>!s(M))}].filter(M=>M):[{items:R.length?R:V}]}),P=b(()=>{if(F.value==="")return I.value;const i=Qe(F.value.toLowerCase());return I.value.filter($=>Qe($.displayName.toLowerCase()).includes(i))}),I=b(()=>{const i=o.selectedFirst?Array.from(o.items).sort(($,R)=>s($)&&!s(R)?-1:!s($)&&s(R)?1:0):o.items;return o.limit!=null&&!y.value?i.slice(0,o.limit):i}),{favoriteBrands:q}=lt();return(i,$)=>{const R=vt,V=je;return a(),v("div",Js,[e.searchable?(a(),v("div",Xs,[$e(d("input",{"onUpdate:modelValue":$[0]||($[0]=k=>F.value=k),type:"text",placeholder:`Zoek naar een ${e.name.toLowerCase()}`,class:"m-0 h-10 w-full border-gray-200 bg-gray-100 text-sm text-black/60 shadow-inner"},null,8,en),[[Yt,F.value]])])):C("",!0),d("div",tn,[(a(!0),v(Z,null,ee(T.value,k=>(a(),v(Z,null,[k.items.length&&k.label?(a(),v("strong",sn,B(k.label),1)):C("",!0),d("ul",nn,[(a(!0),v(Z,null,ee(k.items,u=>D(i.$slots,"item",Kt({key:u.value,ref_for:!0},{item:u,toggleItem:l,selectItem:m,deselectItem:_,isActive:s(u)}),()=>[d("li",null,[d("button",{"aria-label":`select color ${u.displayName}`,class:"appearance-none focus:outline-none",onClick:H=>l(u)},[E(R,{id:u.displayName,modelValue:r.value,"onUpdate:modelValue":$[1]||($[1]=H=>r.value=H),item:u,label:u.displayName},null,8,["id","modelValue","item","label"])],8,an)])])),128))])],64))),256))]),!F.value&&e.limit!=null&&!y.value&&e.items.length>e.limit?(a(),z(V,{key:1,size:"sm",type:"ghost",class:"mr-auto flex-none py-0 text-xs font-semibold text-secondary",onClick:$[2]||($[2]=k=>y.value=!0)},{default:O(()=>[re(B(i.$t("filter.show_all")),1)]),_:1})):C("",!0)])}}}),on={class:"pointer-events-none fixed inset-0 z-50 md:pointer-events-auto md:static md:z-20"},rn={class:"flex-none p-6 md:hidden"},un={class:"text-4xl"},cn={class:"grow overflow-hidden overflow-y-auto overscroll-contain md:overflow-visible"},dn={class:"mb-6 px-6 md:hidden"},mn=d("div",{class:"mb-2"},"Sorteren op",-1),pn={class:"flex-wrap gap-2 px-6 md:mb-6 md:flex md:items-center md:px-0"},vn=d("div",{class:"mb-5 text-2xl md:hidden"},"Filters",-1),fn={key:0},gn={class:"flex-none p-6 md:hidden"},_n=["onClick"],bn=d("span",{class:"text-4xl"},"Maat",-1),yn={class:"grow overflow-hidden overflow-y-auto overscroll-contain px-6 md:overflow-visible md:p-0"},hn={class:"flex flex-col pb-28 md:max-h-96 md:pb-0"},xn={class:"grow overflow-hidden overflow-y-auto overscroll-contain md:p-6"},wn={class:"mb-4 text-lg font-bold"},Cn={class:"m-0"},kn={class:"contents flex-none items-center justify-between bg-gray-100 p-4 md:flex"},$n=["onClick"],Sn=d("span",null,"Filter",-1),Fn=[Sn],Pn={class:"contents"},An={class:"flex-none p-6 md:hidden"},En=["onClick"],In={class:"text-4xl"},Rn={class:"grow overflow-hidden overflow-y-auto overscroll-contain px-6 md:overflow-visible md:p-0"},Nn=["aria-label","onClick"],Ln={class:"contents flex-none items-center justify-between bg-gray-100 p-4 md:flex"},Dn=["onClick"],On=["onClick"],Tn=d("span",null,"Filter",-1),Vn=[Tn],Bn={class:"relative z-20 flex-none bg-gray-100 p-6 md:hidden"},qn=["innerHTML"],Ze=6,Un=W({__name:"Filters",props:{filters:{type:Array,default:()=>[]},activeFilters:{type:Object,default:()=>{}},isActiveFilter:{type:Function,default:()=>!1},filteredCount:{type:Number,default:0},unfilteredCount:{type:Number,default:0},fetchingFilteredCount:{type:Boolean,default:!1}},emits:["filter:apply","filter:stateChanged","filter:reset"],setup(e,{emit:g}){const{formatCurrency:o}=Rt();function c(t){return JSON.parse(JSON.stringify(t))}const r=e,l=g,{filters:s,activeFilters:m}=ke(r),{toggle:_,isOpen:y}=ot("FilterSlideIn"),F=b(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.map(p=>p.slug)}),T=b(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.filter(p=>p.attributeGroupType.includes("size"))}),P=b(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.filter(p=>!p.attributeGroupType.includes("size"))}),I=b(()=>Es(F.value,s.value)),q=b(()=>I.value.prices?He(I.value,"min"):null),i=b(()=>I.value.prices?He(I.value,"max"):null),$=(t,p="min")=>{var L;const A=(L=t.max_savings_percentage)==null?void 0:L[0];return A?A.value[p]:p==="min"?0:1e4},R=b(()=>I.value.max_savings_percentage?$(I.value,"min"):null),V=b(()=>I.value.max_savings_percentage?$(I.value,"max"):null),k=b(()=>{var p;const t={range:A=>[A.values[0].min,A.values[0].max],boolean:()=>!1,attributes:()=>[]};return(p=s==null?void 0:s.value)==null?void 0:p.reduce((A,L)=>({...A,[L.slug]:(t[L.type]||(()=>[]))(L)}),{max_savings_percentage:[0,1e4]})}),u=J({});u.value=Ke(c(k.value)),Ce(k,t=>{u.value=Ke(c(t)),ie(),Ce(u.value,()=>{Se()})});const H=t=>{Dt(t).forEach(([A,L])=>{u.value[A]=typeof L[0].value=="boolean"?L[0].value===!0||L[0].value==="true":L})},pe=(t,p)=>{t&&q.value&&q.value!==t&&(u.value.prices[0]=t),p&&i.value&&i.value!==p&&(u.value.prices[1]=p)},j=(t,p)=>{t&&R.value&&R.value!==t&&(u.value.max_savings_percentage[0]=t),p&&V.value&&V.value!==p&&(u.value.max_savings_percentage[1]=p)},ie=()=>{H(Nt(I.value,m.value)),m.value.minPrice||m.value.maxPrice?pe(parseInt(m.value.minPrice),parseInt(m.value.maxPrice)):u.value.prices=[q.value,i.value],m.value.minReduction||m.value.maxReduction?j(parseInt(m.value.minReduction),parseInt(m.value.maxReduction)):u.value.max_savings_percentage=[R.value||0,V.value||1e4]};ie();const ue=b(()=>{var t;return!Be(k.value.prices,(t=u.value.prices)==null?void 0:t.slice(0,2))}),M=b(()=>{var t;return!Be(k.value.max_savings_percentage,(t=u.value.max_savings_percentage)==null?void 0:t.slice(0,2))}),Y=(t,p)=>{ce("filter:apply"),t!==!1&&_(p)},Se=Lt({delay:50},()=>ce("filter:stateChanged"));Ce(u.value,()=>{Se()});const ce=t=>{try{l(t,{...Ot(Tt(u.value,["isNew","prices","sale","max_savings_percentage"])),...ue.value&&Vt(u.value.prices),...M.value&&{minReduction:u.value.max_savings_percentage[0],maxReduction:u.value.max_savings_percentage[1]},...u.value.sale&&{sale:!0},...u.value.isNew&&{isNew:!0}})}catch(p){console.error(p)}},Ae=t=>{u.value[t]=k.value[t],ce("filter:apply"),y.value=!0,_(void 0)},be=()=>{Object.assign(u.value,c(k.value)),l("filter:reset"),ce("filter:apply"),y.value=!0,_(void 0)},{$currentShop:ye}=Bt(),Ee=ye.locale.replace("_","-"),Ie=ye.currency,Re=me(),Ne=Object.values(dt(["topSeller","priceAsc","priceDesc"])),We=b(()=>Ge(Re.query.sort||"").name),ve=b(()=>Object.keys(u.value).map(t=>{var L,f,h;const p=u.value[t],A=(L=r.filters)==null?void 0:L.find(w=>w.slug===t);if((A==null?void 0:A.type)==="boolean"&&p===!0)return[{displayName:A.name,key:t,...A.values.find(w=>w.name===!0)}];if(t==="prices"){if(!((f=k.value)!=null&&f.prices))return null;const[w,S]=p,[N,G]=k.value.prices;return w===N&&S===G?null:[{key:t,min:w},{key:t,max:S}]}if(t==="max_savings_percentage"){if(!((h=k.value)!=null&&h.max_savings_percentage))return null;const[w,S]=p,[N,G]=k.value.max_savings_percentage;return w===N&&S===G?null:[{key:t,min:w},{key:t,max:S}]}return p}).filter(t=>t&&t.length).flat().filter(t=>t)),{trackFilterApply:Fe}=Me(),Le=t=>{Fe("sort",t.name)},de=J(!0),he=t=>{var p,A,L;if(t==="size"){let f=0;for(const h in u.value)h.toLowerCase().includes(t)&&(f+=((p=u.value[h])==null?void 0:p.length)||0);return f}return u.value[t]===!0?1:(A=u.value[t])!=null&&A.length?t==="prices"?ue.value?1:0:(L=u.value[t])==null?void 0:L.length:0};function xe(t){var p,A,L,f,h;if(t==="prices"){let w="";const S=(p=r.filters)==null?void 0:p.find(K=>K.slug===t),N=ve.value.find(K=>K.key===t&&K.min),G=ve.value.find(K=>K.key===t&&K.max);return N!==void 0&&G!==void 0&&(N.min!==((L=(A=S==null?void 0:S.values)==null?void 0:A[0])==null?void 0:L.min)&&(w=`van ${o(N.min)} tot ${o(G.max)}`),G.max!==((h=(f=S==null?void 0:S.values)==null?void 0:f[0])==null?void 0:h.max)&&(w=`van ${o(N.min)} tot ${o(G.max)}`)),w.trim()}return ve.value.filter(w=>w.key===t).map(w=>w.displayName).join(", ")}function De(){T.value.forEach(t=>{var p;(p=k.value[t.slug])!=null&&p.length?u.value[t.slug]=[...k.value[t.slug]]:u.value[t.slug]=k.value[t.slug]}),ce("filter:apply"),y.value=!0,_(void 0)}function Oe(t){return t.type==="range"?!(!t.values[0].min||!t.values[0].max):t.type==="boolean"?!!t.values.find(p=>p.name===!0&&p.productCount>0):!0}const{getFavoriteBrands:Te}=lt();return it(async()=>{await Te()}),(t,p)=>{var K,Pe;const A=nt,L=mt,f=vt,h=Bs,w=js,S=Ys,N=Zs,G=je;return a(),v("div",on,[d("div",{class:se(["size-full bg-gray-600/40 transition-opacity duration-200 md:hidden",n(y)?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"]),onClick:p[0]||(p[0]=(...x)=>n(_)&&n(_)(...x))},null,2),d("div",{class:se(["pointer-events-auto absolute inset-y-0 right-0 flex w-11/12 flex-col bg-white transition-transform duration-200 md:static md:block md:transform-none",n(y)?"translate-x-0":"translate-x-full"])},[d("div",rn,[d("button",{class:"mb-2 mr-4 flex size-6 items-center justify-center",type:"button",onClick:p[1]||(p[1]=(...x)=>n(_)&&n(_)(...x))},[E(A,{class:"h-3 w-3.5"})]),d("span",un,B(t.$t("plp.filter_sort")),1),(K=ve.value)!=null&&K.length?(a(),v("button",{key:0,type:"button",class:"link absolute right-6 top-7",onClick:be}," wis filters ")):C("",!0)]),d("div",cn,[d("div",dn,[mn,E(L,{class:"-mx-6 px-6",items:n(Ne),selected:We.value,"onClick:item":p[2]||(p[2]=x=>Le(x))},null,8,["items","selected"])]),d("div",pn,[vn,T.value.length?(a(),v("div",fn,[E(h,{onApply:p[3]||(p[3]=x=>Y(!1)),badge:he("size"),label:"Maat"},{"active-filters":O(()=>[(a(!0),v(Z,null,ee(T.value,(x,X)=>(a(),v("div",{class:"contents",key:x.slug},B(xe(x.slug)),1))),128))]),default:O(x=>[d("div",gn,[d("button",{type:"button",class:"mb-2 flex h-6 w-6 items-center",onClick:x.applyFilters},[E(A,{class:"h-3 w-3.5"})],8,_n),bn]),d("div",yn,[d("div",hn,[d("div",xn,[(a(!0),v(Z,null,ee(T.value,(X,fe)=>(a(),v("div",{class:"contents",key:X.slug},[d("div",wn,B(X.name),1),d("ul",Cn,[(a(!0),v(Z,null,ee(I.value[X.slug],te=>(a(),v("li",{key:te.value},[E(f,{id:te.displayName,modelValue:u.value[X.slug],"onUpdate:modelValue":U=>u.value[X.slug]=U,item:te,label:te.displayName},null,8,["id","modelValue","onUpdate:modelValue","item","label"])]))),128))])]))),128))]),d("div",kn,[he("size")>0?(a(),v("button",{key:0,type:"button",class:"link absolute right-6 top-[22px] md:static",onClick:De}," wis filters ")):C("",!0),d("button",{type:"button",class:"btn btn-cta ml-auto hidden md:flex",onClick:()=>{x.toggle(),Y(void 0,!1)}},Fn,8,$n)])])])]),_:1},8,["badge"])])):C("",!0),(a(!0),v(Z,null,ee(P.value,(x,X)=>{var fe;return a(),v(Z,null,[Oe(x)?(a(),z(h,{onApply:p[4]||(p[4]=te=>Y(!1)),key:x.slug,class:se(de.value&&Ze<=X?"md:hidden":""),badge:he(x.slug),label:x.name},Ue({default:O(te=>[d("div",Pn,[d("div",An,[d("button",{type:"button",class:"mb-2 flex h-6 w-6 items-center",onClick:te.applyFilters},[E(A,{class:"h-3 w-3.5"})],8,En),d("span",In,B(x.name),1)]),d("div",Rn,[x.type==="range"?(a(),z(w,{key:0,modelValue:u.value[x.slug],"onUpdate:modelValue":U=>u.value[x.slug]=U,max:x.values[0].max,min:x.values[0].min,"currency-code":n(Ie),locale:n(Ee)},null,8,["modelValue","onUpdate:modelValue","max","min","currency-code","locale"])):x.type==="boolean"?(a(),z(S,{key:1,modelValue:u.value[x.slug],"onUpdate:modelValue":U=>u.value[x.slug]=U,filter:x},null,8,["modelValue","onUpdate:modelValue","filter"])):x.type==="attributes"?(a(),z(n(ln),{key:2,"model-value":u.value[x.slug],items:I.value[x.slug],name:x.name,searchable:["brand"].includes(x.slug)},Ue({_:2},[["_color"].includes(x.slug)?{name:"item",fn:O(({item:U,toggleItem:Ve,isActive:ft})=>[(a(),v("li",{key:U.value},[d("button",{"aria-label":`select color ${U.displayName}`,class:"appearance-none focus:outline-none",onClick:Qn=>Ve(U)},[E(N,{"data-test-id":"filter-color-circle",color:{id:U.value,value:U.value,label:U.displayName},class:"h-5 w-5","is-active":ft},null,8,["color","is-active"])],8,Nn)]))]),key:"0"}:{name:"item",fn:O(({item:U})=>[(a(),v("li",{key:U.value},[E(f,{id:U.displayName,modelValue:u.value[x.slug],"onUpdate:modelValue":Ve=>u.value[x.slug]=Ve,item:U,label:U.displayName},null,8,["id","modelValue","onUpdate:modelValue","item","label"])]))]),key:"1"}]),1032,["model-value","items","name","searchable"])):C("",!0),d("div",Ln,[$e(d("button",{type:"button",class:"link absolute right-6 top-[22px] md:static",onClick:U=>Ae(x.slug)}," wis filters ",8,Dn),[[ut,xe(x.slug)]]),d("button",{type:"button",class:"btn btn-cta ml-auto hidden md:flex",onClick:()=>{te.toggle(),Y(!0,!1)}},Vn,8,On)])])])]),_:2},[(fe=u.value[x.slug])!=null&&fe.length?{name:"active-filters",fn:O(()=>[re(B(xe(x.slug)),1)]),key:"0"}:void 0]),1032,["class","badge","label"])):C("",!0)],64)}),256)),P.value.length>Ze?(a(),v("button",{key:1,type:"button",class:"md:gap-2.5md:px-3 hidden items-center py-3 text-left underline underline-offset-4 hover:no-underline md:inline-flex md:min-w-0 md:py-2 md:leading-normal",onClick:p[5]||(p[5]=x=>de.value=!de.value)},B(de.value?"Alle filters":"Minder filters"),1)):C("",!0),(Pe=ve.value)!=null&&Pe.length?(a(),v("button",{key:2,type:"button",class:"ml-4 hidden underline hover:no-underline md:flex",onClick:p[6]||(p[6]=x=>be())}," Wis filters ")):C("",!0)])]),d("div",Bn,[E(G,{"data-test-id":"apply-filter-button","is-full-width":"",class:"btn btn-cta w-full",onClick:Y},{default:O(()=>[d("span",{innerHTML:t.$t("filter.show_results_count",{count:e.filteredCount||e.unfilteredCount})},null,8,qn)]),_:1})])],2)])}}}),zn={key:0},Mn={key:0,class:"mx-auto my-20 max-w-md text-center"},jn={key:1,class:"mb-3 md:mb-4"},Gn={class:"font-bold"},Wn={class:"contents"},Hn={class:"contents flex-col md:flex"},Yn={class:"ml-auto flex-1 !transform-none"},Kn={key:0,"data-class":"rounded-full bg-white px-2 py-1 text-xs text-black",class:"m-0 w-6 !transform-none font-bold"},Je=48,ra=W({__name:"ProductListWithFilters",props:{showResultCount:{type:Boolean,default:!1},conditions:{type:Object,default:{}},keySuffix:{type:String,default:""},listingMetaData:{type:Object,default:{name:"Category Product List",id:"CategoryProductList"}},productCardClass:{type:String,default:()=>"col-span-6 md:col-span-4"},category:{type:Object,default:()=>({id:"",path:"",name:""})}},setup(e){var A,L;const g=e,{register:o}=Zt(),c=Qt(g,"conditions"),r=qt("conditions",()=>({})),l=me(),s=b(()=>l.query),m=b(()=>l.params),_=l.fullPath,{pageState:y}=Ut(),{toggle:F}=ot("FilterSlideIn"),{applyFilters:T,productConditions:P,isActiveFilter:I,activeFilters:q}=ns(),i=b(()=>Object.keys(q.value).length),$={name:"relevance",query:"relevance"},R=b(()=>{var f,h;return!!((h=(f=c.value)==null?void 0:f.where)!=null&&h.term)}),V=b(()=>{var f,h;return(!((f=s.value)!=null&&f.sort)||((h=s.value)==null?void 0:h.sort)==="relevance")&&R.value}),k=b(()=>{const f=Object.values(dt(["topSeller","priceAsc","priceDesc"]));return R.value&&f.push($),f}),u=b(()=>{var f;return V.value?$:Ge(((f=s.value)==null?void 0:f.sort)||"","topSeller")}),H=b(()=>{var f,h,w,S;return{...c.value,where:{...(f=c.value)==null?void 0:f.where,...P.value.where,attributes:[...((w=(h=c.value)==null?void 0:h.where)==null?void 0:w.attributes)||[],...(((S=P.value.where)==null?void 0:S.attributes)||[]).filter(({key:N})=>N!=="cat")]}}});Ce(H,()=>{const{categoryId:f,...h}=H.value.where;r.value=h},{immediate:!0});const pe=b(()=>{var h,w;let f=u.value;return((h=u.value)==null?void 0:h.query)==="relevance"?f=void 0:u.value.query==="topseller"&&(f={sortingKey:`merch${(w=l.path||"/s/"+m.value.slug)==null?void 0:w.replaceAll("/","-")}`,direction:"asc"}),{perPage:Je,...H.value,sort:f}}),{pagination:j,products:ie,fetchProducts:ue,fetchingProducts:M,filters:Y,fetchFilters:Se,unfilteredProductsCount:ce,filteredProductsCount:Ae,fetchProductsCount:be,fetchingProductsCount:ye,loadMore:Ee,enableWatch:Ie}=zt(!0,`useProductList-${g.keySuffix}`,pe,H),{trackViewItemList:Re,trackSelectItem:Ne,trackFilterApply:We,trackEmptyList:ve}=Me(),Fe=b(()=>Y==null?void 0:Y.value.filter(f=>{var h,w,S;return!((S=(w=(h=c.value.where)==null?void 0:h.attributes)==null?void 0:w.map(N=>N.key))!=null&&S.includes(f.slug))})),{handled:Le}=Mt();jt(async()=>{await Le(async()=>{await Promise.all([ue(!0,!0,!0),Se(),be(H)])})},`ProductListWithFilters-${g.keySuffix}`);const de=J(null);Ie(()=>{var f,h;(h=(f=de.value)==null?void 0:f._setupProxy)==null||h.setStateFromUrlParams()});const he=async f=>{var w,S,N;const h=tt(f);await be({...c.value,where:{...(w=c.value)==null?void 0:w.where,...h,attributes:[...((N=(S=c.value)==null?void 0:S.where)==null?void 0:N.attributes)||[],...h.attributes||[]]}})},xe=f=>{o(),Ne({product:f,listingMetaData:g.listingMetaData,pagePayload:{content_name:_,page_type:y.value.type,page_type_id:""}})};it(()=>{Ce(ne,(f,h)=>{},{immediate:!0})});const De=({items:f})=>{var w;const h=((((w=j.value)==null?void 0:w.page)||1)-1)*24;Re({items:f,listingMetaData:g.listingMetaData,paginationOffset:h,source:"story|todo-id",category:g.category})},Oe=(f,h=!1)=>{const w=s.value.cat?{cat:s.value.cat}:{},S=s.value&&h?Te():{},N={...f,...S,...w};et(N)||Object.keys(N).forEach(G=>{Array.isArray(N[G])?N[G].join("|"):N[G]}),T(N)},Te=()=>{const f={},h=t.value.map(S=>S.key),w=JSON.parse(s.value.filters||"{}");for(const S of Object.keys(w))h.includes(S.toLowerCase())||(f[S]=w[S]);return f},t=b(()=>Y.value?pt(Y.value,Y.value.map(f=>f.slug),{sortable:!1}).filter(f=>!!f.count):[]),p=+((A=l.query)==null?void 0:A.page)>1&&!((L=l.redirectedFrom)!=null&&L.name);return(f,h)=>{var x;const w=gt,S=cs,N=ys,G=xs,K=Ss,Pe=As;return a(),v("div",null,[e.showResultCount?(a(),v("div",zn,[!n(M)&&!n(ye)&&n(ne)===0?(a(),v("p",Mn," Sorry, dit kunnen we niet vinden. Controleer je zoekterm of probeer iets anders. ")):(a(),v("div",jn,[d("span",Gn,B(n(ne)),1),re(" zoekresultaten ")]))])):C("",!0),d("div",Wn,[d("div",Hn,[n(ne)>0?(a(),v("button",{key:0,type:"button","data-test-id":"filter-toggle-button",class:"btn btn-cta sticky top-[98px] z-20 w-full md:hidden",onClick:h[0]||(h[0]=(...X)=>n(F)&&n(F)(...X))},[E(w,{class:"h-6 w-6"}),d("span",Yn,B(f.$t("plp.filter_sort")),1),i.value?(a(),v("span",Kn,"("+B(i.value)+")",1)):C("",!0)])):C("",!0),$e(E(Un,{"active-filters":n(q),filters:Fe.value,"is-active-filter":n(I),"filtered-count":n(Ae),"unfiltered-count":n(ce),"fetching-filtered-count":n(ye),"onFilter:apply":Oe,"onFilter:stateChanged":he,ref_key:"filtersRef",ref:de},null,8,["active-filters","filters","is-active-filter","filtered-count","unfiltered-count","fetching-filtered-count"]),[[ut,Fe.value]]),n(ne)>0?(a(),z(S,{key:1,selected:((x=u.value)==null?void 0:x.name)||"",values:k.value,class:"hidden md:ml-auto md:flex"},null,8,["selected","values"])):C("",!0)]),E(N,{"per-page":Je,productsCount:n(ne),products:n(ie),"product-card-class":e.productCardClass,loading:n(M),class:"-mx-6 mt-4 grid w-auto grid-flow-dense grid-cols-12 gap-2 md:mx-0 md:gap-x-2.5 md:gap-y-3.5","onClick:product":xe,"onIntersect:row":De},Ue({_:2},[ee(f.$slots,(X,fe)=>({name:fe,fn:O(te=>[D(f.$slots,fe,le(oe(te)))])}))]),1032,["productsCount","products","product-card-class","loading"]),n(j)&&n(ne)>0?(a(),z(G,{key:0,pagination:n(j),class:"my-4 text-center md:mt-12"},null,8,["pagination"])):C("",!0),E(Gt,{ssr:""},{default:O(()=>[n(j)&&n(p)&&n(ne)>0?(a(),z(K,{key:0,"current-page":n(j).page,"first-page":n(j).first,"last-page":n(j).last},null,8,["current-page","first-page","last-page"])):C("",!0)]),_:1}),n(j)&&!n(M)&&!n(p)&&n(ne)>0?(a(),z(Pe,{key:1,"current-page":n(j).page,"first-page":n(j).first,"last-page":n(j).last,onLoadMore:n(Ee)},null,8,["current-page","first-page","last-page","onLoadMore"])):C("",!0)])])}}});export{ra as _};