import{p as bt,C as O,aI as Re,q as P,N as f,K as _,a3 as $,E as a,O as d,D as v,J as N,P as p,F as I,aL as fe,Q as g,R as b,u as e,S as T,M as pe,L as me,aD as ge,aA as Ee,am as x,r as Le,x as ae,y as ht,a8 as _t,cd as kt,bc as Be,bd as wt,aM as Fe,bg as ye,at as Y,ak as Ne,aQ as Ct,w as $t,aw as Te,T as Pt,bw as Vt,as as Ae,b_ as St}from"./vendor-BGtMsOoo.js";import{g as re,v as It,bs as Bt,bt as Ft,bu as Tt,aZ as At,aO as Mt,P as Dt,aP as zt,aY as Rt,a_ as Et,a$ as Lt,b0 as Nt,b1 as Ot,b2 as Ut,b3 as oe,n as qt,o as Kt,e as Oe,bv as Ue,aW as qe,l as Ke,bw as Qt,bx as xt,L as Gt,i as jt,a7 as Qe,by as se,a8 as xe,m as Ht,q as Wt,O as Yt,j as Zt,aD as Jt,bz as de,bA as Me,M as De,bB as Xt,bC as eo,bD as to}from"./index-CRze-aDK.js";import{u as oo}from"./useBreadcrumbs-DdGLvHNR.js";import{b as ao}from"./index-Go5WDFxx.js";import{P as Ge,_ as so,g as ro}from"./filters-popup-sidebar.vue_vue_type_style_index_0_lang-B-nDYXmJ.js";import{u as je}from"./useSlugInfo-CDk-jWkx.js";import{_ as lo}from"./product-card-grid.vue_vue_type_script_setup_true_lang-DTzN8zH8.js";import{P as no}from"./product-skeleton-grid-CDRk-2IF.js";import{P as io}from"./product-skeleton-list-axb2pdwT.js";function co(m,s=0){const l=Bt(s),c=m?`
    category(
        storeId: $storeId
        userId: $userId
        cultureName: $cultureName
        currencyCode: $currencyCode
        id: "${m}"
    ) {
        id
        name
        slug
        seoInfo {
            pageTitle
            metaKeywords
            metaDescription
        }
        breadcrumbs {
            title
            seoPath
        }
        parent {
            id
            name
            slug
        }
        images {
            url
        }
    }`:"";return bt`
    query GetCategory(
      $storeId: String!
      $userId: String
      $cultureName: String
      $currencyCode: String
      $maxLevel: Int
      $onlyActive: Boolean
      $productFilter: String
    ) {
      ${c}

      childCategories(
        storeId: $storeId
        userId: $userId
        cultureName: $cultureName
        currencyCode: $currencyCode
        maxLevel: $maxLevel
        onlyActive: $onlyActive
        productFilter: $productFilter
        ${m?`categoryId: "${m}"`:""}
      ) {
        __typename
        ${l}
      }
    }
  `}async function uo(m){const{storeId:s,userId:l,cultureName:c,currencyCode:y}=re,u=co(m.categoryId??"",m.maxLevel),{data:i}=await It.query({query:u,variables:{storeId:s,userId:l,cultureName:c,currencyCode:y,...m}});return i}const po={class:"font-bold"},mo={class:"-mt-1 mb-0.5 py-0.5 text-xs font-black uppercase text-neutral-900"},go={class:"flex flex-col pl-4"},yo=O({__name:"category-selector",props:{category:{},loading:{type:Boolean}},setup(m){const s=m,l=Re(),{objectType:c,seoInfo:y}=je(l.path.slice(1)),u=P(()=>{var n;return(n=s.category)==null?void 0:n.parent}),i=P(()=>{var n;return((n=s.category)==null?void 0:n.childCategories)||[]}),t=Ft(i);return(n,V)=>{var S,A,E,U;const r=f("VcWidgetSkeleton"),C=f("VcIcon"),h=f("router-link"),k=f("VcWidget");return n.loading?(a(),_(r,{key:0,size:"xs"},{default:d(()=>[(a(),v(I,null,N(6,M=>p("div",{key:M})),64))]),_:1})):u.value||(A=(S=n.category)==null?void 0:S.childCategories)!=null&&A.length?(a(),_(k,{key:1,size:"xs"},fe({_:2},[u.value?{name:"header",fn:d(()=>[g(h,{to:e(Tt)(u.value),class:"-mx-2 flex grow items-center gap-1.5 rounded-sm px-2 py-1 text-sm hover:bg-neutral-50"},{default:d(()=>[g(C,{class:"fill-primary",name:"chevron-left",size:"xs"}),p("span",po,b(u.value.name),1)]),_:1},8,["to"])]),key:"0"}:void 0,(U=(E=n.category)==null?void 0:E.childCategories)!=null&&U.length?{name:"default",fn:d(()=>{var M;return[p("div",mo,[e(c)==="Category"?(a(),v(I,{key:0},[T(b(n.category.name),1)],64)):e(c)==="Catalog"?(a(),v(I,{key:1},[T(b((M=e(y))==null?void 0:M.pageTitle),1)],64)):$("",!0)]),p("div",go,[(a(!0),v(I,null,N(i.value,(R,D)=>(a(),_(h,{key:D,to:e(t)[R.id],class:"-mx-2 mt-0.5 truncate rounded-sm px-2 py-0.5 text-sm transition-colors hover:bg-neutral-50"},{default:d(()=>[T(b(R.name),1)]),_:2},1032,["to"]))),128))])]}),key:"1"}:void 0]),1024)):$("",!0)}}}),fo={class:"vc-product-card-list grid gap-x-3.5 bg-additional-50 px-4 pb-5 pt-4 md:place-items-center lg:rounded lg:py-3.5 lg:shadow lg:outline lg:outline-1 lg:outline-offset-0 lg:outline-neutral-200 lg:hover:shadow-lg"},vo={class:"vc-product-card-list__mobile-left sm:contents"},bo={class:"vc-product-card-list__properties mt-2 hidden w-full grid-cols-[40%_1fr] gap-x-1.5 gap-y-0.5 text-sm leading-4 text-neutral-800 empty:mt-0 lg:mt-0.5 lg:text-xs xl:grid"},ho={class:"min-w-0"},_o={class:"truncate font-bold"},ko={class:"min-w-0"},wo={class:"truncate"},Co={class:"min-w-0"},$o={class:"truncate font-bold"},Po={class:"min-w-0"},Vo={class:"truncate"},So={class:"min-w-0"},Io={class:"truncate font-bold"},Bo={class:"min-w-0"},Fo={class:"truncate"},To={class:"vc-product-card-list__price mt-2 w-full sm:mt-0 2xl:pr-2"},Ao={class:"vc-product-card-list__add-to-cart mt-3 flex w-full flex-col gap-2 sm:mt-0"},Mo={class:"flex items-center gap-1 lg:mt-0.5"},Do=O({__name:"product-card-list",props:{product:{},lazy:{type:Boolean,default:!0},browserTarget:{},productReviewsEnabled:{type:Boolean}},emits:["linkClick"],setup(m){const s=m,{isComponentRegistered:l,getComponent:c,shouldRenderComponent:y,getComponentProps:u}=At(),i=P(()=>Mt(s.product.id,s.product.slug)),t=P(()=>s.product.productType===Dt.Digital),n=P(()=>Object.values(zt(s.product.properties??[],Rt.Product)).slice(0,3)),V=P(()=>s.product.hasVariations?s.product.minVariationPrice:s.product.price);return(r,C)=>{var M,R,D;const h=f("VcImage"),k=f("router-link"),S=f("VcProductActions"),A=f("VcTooltip"),E=f("VcItemPriceCatalog"),U=f("VcProductButton");return a(),v("div",fo,[p("div",vo,[g(k,{to:i.value,class:"vc-product-card-list__img relative block size-[72px] xl:size-[86px]",onClick:C[0]||(C[0]=F=>r.$emit("linkClick",F))},{default:d(()=>[g(h,{src:r.product.imgSrc,alt:r.product.name,"size-suffix":"md",class:"size-full rounded object-cover object-center",lazy:r.lazy},null,8,["src","alt","lazy"]),g(Et,{price:r.product.price,size:"sm"},null,8,["price"])]),_:1},8,["to"]),g(S,{class:"vc-product-card-list__buttons mt-3 place-self-start lg:mt-2"},{default:d(()=>[g(e(Lt),{product:r.product},null,8,["product"]),r.$cfg.product_compare_enabled?(a(),_(e(Nt),{key:0,product:r.product},null,8,["product"])):$("",!0)]),_:1})]),g(A,{class:"w-full",placement:"bottom-start",width:"16rem"},{trigger:d(()=>[g(k,{to:i.value,target:r.browserTarget,class:"vc-product-card-list__name w-full grow text-sm font-black text-[--link-color] hover:text-[--link-hover-color] sm:line-clamp-3 sm:overflow-hidden lg:mt-1 2xl:pr-2",onClick:C[1]||(C[1]=F=>r.$emit("linkClick",F))},{default:d(()=>[T(b(r.product.name),1)]),_:1},8,["to","target"])]),content:d(()=>[T(b(r.product.name),1)]),_:1}),p("div",bo,[(a(!0),v(I,null,N(n.value,F=>(a(),v(I,{key:F.name},[p("div",ho,[p("div",_o,b(F.label)+":",1)]),p("div",ko,[p("div",wo,b(F.value),1)])],64))),128)),r.productReviewsEnabled&&r.product.rating?(a(),v(I,{key:0},[p("div",Co,[p("div",$o,b(r.$t("shared.catalog.product_card.product_rating")),1)]),p("div",Po,[p("div",Vo,[g(Ot,{rating:r.product.rating},null,8,["rating"])])])],64)):$("",!0),r.$cfg.vendor_enabled&&r.product.vendor?(a(),v(I,{key:1},[p("div",So,[p("div",Io,b(r.$t("shared.catalog.product_card.product_vendor")),1)]),p("div",Bo,[p("div",Fo,[g(Ut,{vendor:r.product.vendor},null,8,["vendor"])])])],64)):$("",!0)]),p("div",To,[g(E,{"with-from-label":r.product.hasVariations||r.product.isConfigurable,value:V.value,class:"md:flex-col md:gap-0"},null,8,["with-from-label","value"])]),p("div",Ao,[e(l)(e(oe).CARD_BUTTON)&&e(y)(e(oe).CARD_BUTTON,r.product)?(a(),_(pe(e(c)(e(oe).CARD_BUTTON)),me({key:0,product:r.product},e(u)(e(oe).CARD_BUTTON)),null,16,["product"])):r.product.isConfigurable?(a(),_(U,{key:1,to:i.value,"link-text":"Customize","button-text":"Customize",color:"accent",icon:"cube-transparent",target:r.browserTarget||r.$cfg.details_browser_target||"_blank",onLinkClick:C[2]||(C[2]=F=>r.$emit("linkClick",F))},null,8,["to","target"])):r.product.hasVariations?(a(),_(U,{key:2,to:i.value,"link-text":r.$t("pages.catalog.show_on_a_separate_page"),"button-text":r.$t("pages.catalog.variations_button",[(((M=r.product.variations)==null?void 0:M.length)||0)+1]),target:r.browserTarget||r.$cfg.details_browser_target||"_blank",onLinkClick:C[3]||(C[3]=F=>r.$emit("linkClick",F))},null,8,["to","link-text","button-text","target"])):(a(),v(I,{key:3},[ge(r.$slots,"cart-handler",{},void 0,!0),p("div",Mo,[g(qt,{"is-in-stock":(R=r.product.availabilityData)==null?void 0:R.isInStock,"is-digital":t.value,quantity:(D=r.product.availabilityData)==null?void 0:D.availableQuantity},null,8,["is-in-stock","is-digital","quantity"]),g(Kt,{"product-id":r.product.id},null,8,["product-id"])])],64))])])}}}),zo=Oe(Do,[["__scopeId","data-v-71d324dc"]]),Ro=O({__name:"display-products",props:{loading:{type:Boolean},products:{default:()=>[]},itemsPerPage:{default:Ue},viewMode:{default:"grid"},browserTarget:{},cardType:{},columnsAmountTablet:{default:"3"},columnsAmountDesktop:{default:"4"}},emits:["itemLinkClick"],setup(m){const s=m,l=Ee(qe),{isEnabled:c}=Ke(Qt),y=c(xt),u=P(()=>s.viewMode==="list"?io:no),i=P(()=>s.viewMode==="list"?zo:lo),t=P(()=>({null:1,xs:2,md:Number(s.columnsAmountTablet),xl:Number(s.columnsAmountDesktop)})),n=P(()=>Object.entries(t.value).map(([h,k])=>`${h}${h?":":""}grid-cols-${k}`).join(" ")),V=P(()=>s.viewMode==="grid"?r():s.viewMode=="list"?C():0);function r(){return l.isSmaller("xs")?t.value.null:l.isInBetween("xs","md")?t.value.xs*2:l.isInBetween("md","xl")?t.value.md*2:l.isGreaterOrEqual("xl")?t.value.xl*2:0}function C(){return l.isSmaller("xs")?2:l.isInBetween("xs","sm")?4:l.isInBetween("sm","lg")?6:l.isInBetween("lg","2xl")?4:l.isGreaterOrEqual("2xl")?5:0}return(h,k)=>(a(),v("div",{class:x(h.viewMode==="list"?"-mx-5 divide-y lg:divide-y-0 lg:mx-0 lg:space-y-3.5":"grid gap-5 "+n.value)},[h.loading?(a(!0),v(I,{key:0},N(h.itemsPerPage,S=>(a(),_(pe(u.value),{key:S}))),128)):(a(!0),v(I,{key:1},N(h.products,(S,A)=>(a(),_(pe(i.value),{key:S.id+A,product:S,lazy:A>=V.value,"browser-target":h.browserTarget,"hide-properties":h.cardType==="short","product-reviews-enabled":e(y),onLinkClick:E=>h.$emit("itemLinkClick",S,E)},{"add-to-list-handler":d(()=>[ge(h.$slots,"add-to-list-handler",me({ref_for:!0},{item:S}))]),"cart-handler":d(()=>[ge(h.$slots,"cart-handler",me({ref_for:!0},{item:S}))]),_:2},1064,["product","lazy","browser-target","hide-properties","product-reviews-enabled","onLinkClick"]))),128))],2))}});function He(){const m=Le(!1),s=ae(),{catalogId:l}=re;async function c(y){var u,i;m.value=!0;try{const t=await uo(y);s.value={...t.category,childCategories:t.childCategories.childCategories??[],name:(u=t.category)==null?void 0:u.name,id:((i=t.category)==null?void 0:i.id)||l}}catch(t){throw Gt.error(`${He.name}.${c.name}`,t),t}finally{m.value=!1}}return{fetchCategory:c,loading:ht(m),category:P(()=>s.value)}}const Eo={class:"space-x-2",role:"group"},Lo={class:"max-lg:hidden"},No={class:"max-lg:hidden"},ze=O({__name:"view-mode",props:{mode:{default:"grid"}},emits:["update:mode"],setup(m){const s=m,l=P(()=>s.mode);return(c,y)=>{const u=f("VcTabSwitch");return a(),v("div",Eo,[g(u,{modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=i=>l.value=i),value:"grid",icon:"grid",onChange:y[1]||(y[1]=i=>c.$emit("update:mode",i))},{default:d(()=>[p("span",Lo,b(c.$t("shared.catalog.view_mode.grid_label")),1)]),_:1},8,["modelValue"]),g(u,{modelValue:l.value,"onUpdate:modelValue":y[2]||(y[2]=i=>l.value=i),value:"list",icon:"list",onChange:y[3]||(y[3]=i=>c.$emit("update:mode",i))},{default:d(()=>[p("span",No,b(c.$t("shared.catalog.view_mode.list_label")),1)]),_:1},8,["modelValue"])])}}}),{i18n:Oo}=re;function Uo({category:m,allowSetMeta:s,categoryComponentAnchorIsVisible:l}){const c=P(()=>{var t,n,V;return((n=(t=m.value)==null?void 0:t.seoInfo)==null?void 0:n.pageTitle)??((V=m.value)==null?void 0:V.name)??(m.value?"":Oo.global.t("pages.catalog.title"))}),y=P(()=>{var t,n;return(n=(t=m.value)==null?void 0:t.seoInfo)==null?void 0:n.metaDescription}),u=P(()=>{var t,n;return(n=(t=m.value)==null?void 0:t.seoInfo)==null?void 0:n.metaKeywords}),i=P(()=>{var t,n,V;return(V=(n=(t=m.value)==null?void 0:t.images)==null?void 0:n[0])==null?void 0:V.url});_t(()=>{var t,n;if(s.value&&l.value){jt({title:c,meta:{keywords:u,description:y}});const V=(n=(t=m.value)==null?void 0:t.seoInfo)!=null&&n.semanticUrl?`${window.location.host}\${currentCategory.value?.seoInfo?.semanticUrl`:window.location.toString();kt({ogUrl:V,ogTitle:c,ogDescription:y,ogImage:i,ogType:"website"})}})}const qo={class:"flex"},Ko={class:"ms-4 flex items-center xl:ms-8"},Qo={class:"ms-4 flex items-center xl:ms-6"},xo=O({__name:"category-controls",props:Be({savedBranches:{},loading:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:Be(["openBranchesModal","applyInStock"],["update:modelValue"]),setup(m){const s=wt(m,"modelValue");return(l,c)=>{const y=f("VcCheckbox"),u=f("VcTooltip"),i=f("i18n-t");return a(),v("div",qo,[p("div",Ko,[g(u,{placement:"bottom-start",width:"12rem"},{trigger:d(()=>[g(y,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=t=>s.value=t),disabled:l.loading,onClick:c[1]||(c[1]=t=>l.$emit("applyInStock")),onKeyup:c[2]||(c[2]=Fe(t=>l.$emit("applyInStock"),["enter"]))},{default:d(()=>[p("span",{class:x(["whitespace-nowrap text-sm",{"text-neutral":!s.value}])},b(l.$t("pages.catalog.instock_filter_card.checkbox_label")),3)]),_:1},8,["modelValue","disabled"])]),content:d(()=>[T(b(l.$t("pages.catalog.instock_filter_card.tooltip_text")),1)]),_:1})]),p("div",Qo,[g(u,{placement:"bottom-start",width:"13rem"},{trigger:d(()=>[g(y,{"model-value":!!l.savedBranches.length,disabled:l.loading,onClick:c[3]||(c[3]=ye(t=>l.$emit("openBranchesModal",!1),["prevent"])),onKeyup:c[4]||(c[4]=Fe(ye(t=>l.$emit("openBranchesModal",!1),["prevent"]),["enter"]))},{default:d(()=>[g(i,{keypath:"pages.catalog.branch_availability_filter_card.available_in",tag:"div",class:x(["text-sm",{"text-neutral":!l.savedBranches.length}]),scope:"global"},{default:d(()=>[p("span",{class:x({"font-bold text-[--link-color]":l.savedBranches.length})},b(l.$t("pages.catalog.branch_availability_filter_card.branches",{n:l.savedBranches.length})),3)]),_:1},8,["class"])]),_:1},8,["model-value","disabled"])]),content:d(()=>[T(b(l.$t("pages.catalog.branch_availability_filter_card.select_branch_text")),1)]),_:1})])])}}}),Go=O({__name:"category-horizontal-filters",props:{loading:{type:Boolean},keywordQueryParam:{},filters:{},hideSorting:{type:Boolean,default:!1},hideAllFilters:{type:Boolean,default:!1}},emits:["applyFilters","applySort","showPopupSidebar"],setup(m,{emit:s}){const l=s,c=Qe(xe.Sort,{defaultValue:se[0].id,validator:u=>se.some(i=>i.id===u)});function y(u,i){c.value=u,i()}return(u,i)=>{const t=f("VcButton"),n=f("VcRadioButton"),V=f("VcMenuItem"),r=f("VcDropdownMenu");return a(),_(Ge,{class:"category-horizontal-filters",orientation:"horizontal",keyword:u.keywordQueryParam,filters:u.filters,loading:u.loading,onChange:i[3]||(i[3]=C=>u.$emit("applyFilters",C))},{prepend:d(()=>[u.hideAllFilters?$("",!0):(a(),_(t,{key:0,size:"sm",variant:"outline",class:"category-horizontal-filters__show-all","prepend-icon":"filter",onClick:i[0]||(i[0]=C=>u.$emit("showPopupSidebar"))},{default:d(()=>[T(b(u.$t("common.buttons.all_filters")),1)]),_:1})),u.hideSorting?$("",!0):(a(),_(r,{key:1,"offset-options":4,class:"category-horizontal-filters__sorting","max-height":"20rem",width:"15rem","z-index":"3"},{trigger:d(()=>[g(t,{size:"sm",variant:"outline","prepend-icon":"switch-vertical",class:"category-horizontal-filters__sorting-trigger"},{default:d(()=>[T(b(u.$t("common.buttons.sort_by")),1)]),_:1})]),content:d(({close:C})=>[(a(!0),v(I,null,N(e(se),h=>(a(),_(V,{key:h.id,class:"category-horizontal-filters__sorting-input",color:"secondary",size:"sm",onClick:k=>y(h.id,C)},{default:d(()=>[g(n,{modelValue:e(c),"onUpdate:modelValue":i[1]||(i[1]=k=>Y(c)?c.value=k:null),size:"sm",value:h.id,label:h.name,class:"category-horizontal-filters__sorting-input",onChange:()=>{l("applySort"),C()},onClick:i[2]||(i[2]=ye(()=>{},["stop"]))},null,8,["modelValue","value","label","onChange"])]),_:2},1032,["onClick"]))),128))]),_:1}))]),_:1},8,["keyword","filters","loading"])}}}),jo=O({__name:"category-products",props:{cardType:{},columnsAmountDesktop:{},columnsAmountTablet:{},fetchingMoreProducts:{type:Boolean},fetchingProducts:{type:Boolean},fixedProductsCount:{},hasActiveFilters:{type:Boolean},hasSelectedFacets:{type:Boolean},itemsPerPage:{},pagesCount:{},pageNumber:{},products:{},savedViewMode:{}},emits:["resetFacetFilters","changePage","selectProduct","resetFilterKeyword"],setup(m,{emit:s}){const l=s,c=m,y=Qe(xe.Keyword,{defaultValue:""}),u=Ne(c,"pageNumber");function i(t){l("selectProduct",t)}return(t,n)=>{const V=f("VcInfinityScrollLoader"),r=f("VcScrollTopButton"),C=f("VcButton"),h=f("VcEmptyView");return a(),v("div",null,[t.products.length||t.fetchingProducts?(a(),v(I,{key:0},[g(Ro,{loading:t.fetchingProducts,"view-mode":t.savedViewMode,"items-per-page":t.itemsPerPage,products:t.products,"browser-target":t.$cfg.details_browser_target,"card-type":t.cardType,"columns-amount-desktop":t.columnsAmountDesktop,"columns-amount-tablet":t.columnsAmountTablet,onItemLinkClick:i},{"cart-handler":d(({item:k})=>[g(e(Ht),{product:k,"reserved-space":t.savedViewMode==="grid"},null,8,["product","reserved-space"])]),_:1},8,["loading","view-mode","items-per-page","products","browser-target","card-type","columns-amount-desktop","columns-amount-tablet"]),Number(t.fixedProductsCount)?$("",!0):(a(),_(V,{key:0,loading:t.fetchingProducts||t.fetchingMoreProducts,"is-page-limit-reached":u.value>=e(Wt),"page-number":u.value,"pages-count":t.pagesCount,distance:"400",class:"mt-8",onVisible:n[0]||(n[0]=k=>t.$emit("changePage",++u.value))},null,8,["loading","is-page-limit-reached","page-number","pages-count"])),g(r)],64)):(a(),_(h,{key:1,text:t.hasActiveFilters||e(y)?t.$t("pages.catalog.no_products_filtered_message"):t.$t("pages.catalog.no_products_message"),icon:"outline-stock"},fe({_:2},[t.hasSelectedFacets||e(y)?{name:"button",fn:d(()=>[g(C,{"prepend-icon":"reset",onClick:n[1]||(n[1]=k=>t.$emit("resetFilterKeyword"))},{default:d(()=>[T(b(t.$t("pages.catalog.no_products_button")),1)]),_:1})]),key:"0"}:void 0]),1032,["text"]))])}}}),Ho={class:"flex"},Wo={key:1,class:"inline-block w-48 bg-neutral-200 md:w-64"},Yo={key:2},Zo={key:3},Jo={key:4,class:"-top-1 ml-2 whitespace-nowrap text-sm font-normal normal-case text-neutral lg:top-[-0.5em] lg:text-base"},Xo={class:"font-black"},ea={key:3,class:"z-10 ml-auto flex grow items-center max-lg:order-2 lg:ml-4 lg:grow-0 xl:ml-8"},ta={class:"mr-2 hidden shrink-0 text-sm font-bold text-neutral-900 lg:block"},oa={key:1,class:"flex flex-wrap gap-x-3 gap-y-2 pb-6"},aa={class:"text-center"},sa=O({__name:"category",props:{isRoot:{type:Boolean},categoryId:{},title:{},hideTotal:{type:Boolean},hideBreadcrumbs:{type:Boolean},hideSidebar:{type:Boolean},hideControls:{type:Boolean},hideSorting:{type:Boolean},viewMode:{},filtersOrientation:{},cardType:{},columnsAmountDesktop:{},columnsAmountTablet:{},keyword:{},filter:{},fixedProductsCount:{},allowSetMeta:{type:Boolean},showButtonToDefaultView:{type:Boolean},filtersDisplayOrder:{}},setup(m){const s=m,l=["grid","list"],{allowSetMeta:c}=Ct(s),y=Ne(s,"filtersDisplayOrder"),{catalogId:u,currencyCode:i}=re,n=Ee(qe).smaller("md"),{themeContext:V}=Yt(),{getFacets:r,facetsQueryParam:C,fetchingMoreProducts:h,fetchingProducts:k,fetchingFacets:S,hasSelectedFacets:A,isFiltersDirty:E,isFiltersSidebarVisible:U,keywordQueryParam:M,localStorageBranches:R,localStorageInStock:D,pagesCount:F,products:G,productsFilters:Z,searchQueryParam:J,sortQueryParam:K,totalProductsCount:le,applyFilters:We,fetchProducts:Ye,fetchMoreProducts:Ze,hideFiltersSidebar:ve,openBranchesModal:be,removeFacetFilter:Je,resetFacetFilters:X,resetFilterKeyword:Xe,showFiltersSidebar:he,updateProductsFilters:et,currentPage:j,updateCurrentPage:tt,resetCurrentPage:ne}=Zt({filtersDisplayOrder:y,useQueryParams:!0,withFacets:!0}),{loading:_e,category:z,fetchCategory:ot}=He(),{analytics:ee}=Jt(),L=$t("viewMode","grid"),ke=Le(Ue),we=ae(null),at=Te(we),st=P(()=>!at.value&&n.value),q=P(()=>!n.value&&s.filtersOrientation==="horizontal"),Ce=P(()=>s.viewMode&&l.includes(s.viewMode)),$e=ae(null),rt=Te($e),lt=Re(),{objectType:Pe,slugInfo:H}=je(lt.path.slice(1));Uo({category:z,allowSetMeta:c,categoryComponentAnchorIsVisible:rt});const nt=oo(()=>{var o,w;return ao(Pe.value==="Catalog"&&((o=H.value)!=null&&o.entityInfo)?[{itemId:H.value.entityInfo.id,semanticUrl:H.value.entityInfo.semanticUrl,title:H.value.entityInfo.pageTitle??H.value.entityInfo.semanticUrl,typeName:Pe.value}]:(w=z.value)==null?void 0:w.breadcrumbs)}),ie=ae(null),Q=Pt(()=>({categoryId:s.categoryId,itemsPerPage:s.fixedProductsCount||ke.value,sort:K.value,keyword:s.keyword||(!s.categoryId&&!s.isRoot?J.value:M.value),filter:[s.filter,C.value,de(D.value),Me(R.value)].filter(Boolean).join(" ")})),{getSettingValue:it}=Ke(De.MODULE_ID);function ce(o){We(o)}async function ct(o){const w={...Q.value,filter:[s.filter,Xt(o.facets),de(o.inStock),Me(o.branches)].filter(Boolean).join(" ")};et({branches:o.branches,inStock:o.inStock,facets:await r(w)})}async function ut(o){var w,W;o>F.value||(tt(o),await Ze({...Q.value,page:j.value}),ee("viewItemList",G.value,{item_list_id:`${(w=z.value)==null?void 0:w.slug}_page_${j.value}`,item_list_name:`${(W=z.value)==null?void 0:W.name} (page ${j.value})`}),J.value&&Ve())}async function dt(){var o,w;await Ye(Q.value),ee("viewItemList",G.value,{item_list_id:(o=z.value)==null?void 0:o.slug,item_list_name:(w=z.value)==null?void 0:w.name}),J.value&&Ve()}function Ve(){ee("viewSearchResults",J.value,{visible_items:G.value.map(o=>({code:o.code})),results_count:le.value,results_page:j.value})}function pt(o){ee("selectItem",o)}return Vt(()=>!n.value,ve),Ae(()=>s.categoryId,o=>{if(o||s.isRoot){const{zero_price_product_enabled:w}=V.value.settings,ue=it(De.CATALOG_EMPTY_CATEGORIES_ENABLED)?void 0:ro([eo({catalogId:u,categoryId:o}),to(!!w,i),de(!0)]);ot({categoryId:o,maxLevel:1,onlyActive:!0,productFilter:ue})}},{immediate:!0}),Ae(s,({viewMode:o})=>{o&&l.includes(o)&&(L.value=o)}),St(P(()=>JSON.stringify(Q.value)),()=>{ie.value&&ie.value.scrollIntoView({block:"center"}),dt()},{debounce:20,flush:"post",immediate:!0}),(o,w)=>{const W=f("VcBreadcrumbs"),ue=f("i18n-t"),mt=f("VcTypography"),Se=f("VcButton"),gt=f("VcSelect"),Ie=f("VcChip"),yt=f("VcIcon"),ft=f("VcLayout"),vt=f("VcContainer");return a(),_(vt,{ref_key:"categoryComponentAnchor",ref:$e,class:x({"polygon-neutral-bg":!e(G).length&&!e(k)})},{default:d(()=>[o.hideBreadcrumbs?$("",!0):(a(),_(W,{key:0,class:"mb-2.5 md:mb-4",items:e(nt)},null,8,["items"])),!o.hideSidebar&&(e(n)||q.value)?(a(),_(so,{key:1,"is-exist-selected-facets":e(A),"is-popup-sidebar-filter-dirty":e(E),"popup-sidebar-filters":e(Z),"facets-loading":e(S),"is-mobile":e(n),"is-visible":e(U),"keyword-query-param":e(M),"sort-query-param":e(K),loading:e(k),"hide-controls":o.hideControls,onHidePopupSidebar:e(ve),onResetFacetFilters:e(X),onOpenBranchesModal:e(be),onUpdatePopupSidebarFilters:ct,onApplyFilters:ce},null,8,["is-exist-selected-facets","is-popup-sidebar-filter-dirty","popup-sidebar-filters","facets-loading","is-mobile","is-visible","keyword-query-param","sort-query-param","loading","hide-controls","onHidePopupSidebar","onResetFacetFilters","onOpenBranchesModal"])):$("",!0),g(ft,{"sticky-sidebar":""},fe({default:d(()=>[p("div",Ho,[g(mt,{tag:"h1"},{default:d(()=>{var B;return[!o.categoryId&&!o.isRoot?(a(),_(ue,{key:0,keypath:"pages.search.header",tag:"span"},{keyword:d(()=>[p("strong",null,b(e(Q).keyword),1)]),_:1})):!e(z)&&e(_e)?(a(),v("span",Wo,"   ")):o.title?(a(),v("span",Yo,b(o.title),1)):(a(),v("span",Zo,b((B=e(z))==null?void 0:B.name),1)),!e(k)&&!o.hideTotal&&!o.fixedProductsCount?(a(),v("sup",Jo,[p("b",Xo,b(o.$n(e(le),"decimal")),1),T(" "+b(o.$t("pages.catalog.products_found_message",e(le))),1)])):$("",!0)]}),_:1}),!Ce.value&&q.value?(a(),_(ze,{key:0,mode:e(L),"onUpdate:mode":w[1]||(w[1]=B=>Y(L)?L.value=B:null),class:"ml-auto flex"},null,8,["mode"])):$("",!0)]),p("div",{ref_key:"stickyMobileHeaderAnchor",ref:we,class:"-mt-px"},null,512),p("div",{class:x(["sticky top-0 z-10 my-1.5 flex h-14 items-center empty:h-2 lg:relative lg:mb-3.5 lg:mt-3 lg:h-auto lg:flex-wrap lg:justify-end",{"z-40 -mx-5 bg-additional-50 px-5 md:-mx-12 md:px-12":st.value}])},[o.hideSidebar?$("",!0):(a(),_(Se,{key:0,class:"mr-2.5 flex-none md:!hidden",icon:"filter",size:"sm",onClick:e(he)},null,8,["onClick"])),!Ce.value&&!q.value?(a(),_(ze,{key:1,mode:e(L),"onUpdate:mode":w[2]||(w[2]=B=>Y(L)?L.value=B:null),class:"ml-3 inline-flex max-lg:order-3 lg:ml-0 lg:mr-auto"},null,8,["mode"])):$("",!0),!o.hideControls&&!e(n)&&!q.value?(a(),_(xo,{key:2,modelValue:e(D),"onUpdate:modelValue":w[3]||(w[3]=B=>Y(D)?D.value=B:null),loading:e(k),"saved-branches":e(R),class:"max-lg:order-4",onOpenBranchesModal:e(be),onApplyInStock:e(ne)},null,8,["modelValue","loading","saved-branches","onOpenBranchesModal","onApplyInStock"])):$("",!0),!o.hideSorting&&!q.value?(a(),v("div",ea,[p("span",ta,b(o.$t("pages.catalog.sort_by_label")),1),g(gt,{modelValue:e(K),"onUpdate:modelValue":w[4]||(w[4]=B=>Y(K)?K.value=B:null),"text-field":"name","value-field":"id",disabled:e(k),items:e(se),class:"w-0 grow lg:w-48",size:"sm",onChange:e(ne)},null,8,["modelValue","disabled","items","onChange"])])):$("",!0)],2),q.value&&!e(n)?(a(),_(Go,{key:0,"facets-loading":e(S),"keyword-query-param":e(M),"sort-query-param":e(K),loading:e(k)||e(S),filters:e(Z),"hide-sorting":o.hideSorting,"hide-all-filters":o.hideSidebar,onResetFacetFilters:e(X),onApplyFilters:ce,onShowPopupSidebar:e(he),onApplySort:e(ne)},null,8,["facets-loading","keyword-query-param","sort-query-param","loading","filters","hide-sorting","hide-all-filters","onResetFacetFilters","onShowPopupSidebar","onApplySort"])):$("",!0),e(A)?(a(),v("div",oa,[(a(!0),v(I,null,N(e(Z).facets,B=>(a(),v(I,null,[(a(!0),v(I,null,N(B.values,te=>(a(),v(I,null,[te.selected?(a(),_(Ie,{key:B.paramName+te.value,color:"secondary",closable:"",truncate:"",onClose:ra=>e(Je)({paramName:B.paramName,value:te.value})},{default:d(()=>[T(b(te.label),1)]),_:2},1032,["onClose"])):$("",!0)],64))),256))],64))),256)),g(Ie,{color:"secondary",variant:"outline",clickable:"",onClick:e(X)},{default:d(()=>[p("span",null,b(o.$t("common.buttons.reset_filters")),1),g(yt,{name:"reset"})]),_:1},8,["onClick"])])):$("",!0),p("div",{ref_key:"categoryProductsAnchor",ref:ie},null,512),g(jo,{"card-type":o.cardType,"columns-amount-desktop":o.columnsAmountDesktop,"columns-amount-tablet":o.columnsAmountTablet,"fetching-more-products":e(h),"fetching-products":e(k),"fixed-products-count":o.fixedProductsCount,"has-active-filters":e(A)||e(D)||!!e(R).length,"has-selected-facets":e(A),"items-per-page":ke.value,"pages-count":e(F),"page-number":e(j),products:e(G),"saved-view-mode":e(L),"search-params":e(Q),onChangePage:ut,onResetFacetFilters:e(X),onResetFilterKeyword:e(Xe),onSelectProduct:pt},null,8,["card-type","columns-amount-desktop","columns-amount-tablet","fetching-more-products","fetching-products","fixed-products-count","has-active-filters","has-selected-facets","items-per-page","pages-count","page-number","products","saved-view-mode","search-params","onResetFacetFilters","onResetFilterKeyword"]),p("div",aa,[o.showButtonToDefaultView?(a(),_(Se,{key:0,class:"my-8",color:"primary",to:{query:{view:"default"}}},{default:d(()=>[T(b(o.$t("pages.catalog.show_all_results")),1)]),_:1})):$("",!0)])]),_:2},[!o.hideSidebar&&!e(n)&&!q.value?{name:"sidebar",fn:d(()=>[o.categoryId||o.isRoot?(a(),_(yo,{key:0,category:e(z),loading:!e(z)&&e(_e),class:"mb-4 lg:mb-5"},null,8,["category","loading"])):$("",!0),g(Ge,{keyword:e(M),filters:e(Z),loading:e(k),onChange:w[0]||(w[0]=B=>ce(B))},null,8,["keyword","filters","loading"])]),key:"0"}:void 0]),1024)]),_:1},8,["class"])}}}),ya=Oe(sa,[["__scopeId","data-v-ad78607d"]]);export{ya as default};
//# sourceMappingURL=category-B905syOS.js.map
