import F from"./CE4It_C4.js";import I from"./B3sjvGiU.js";import M from"./CHKhfOMq.js";import N from"./GQCWnG0A.js";import{_ as j}from"./CglRsQQc.js";import{R as O,u as T,s as U,b as V,r as b,H as z,z as E,f as p,I as G,h as H,i,j as e,w as A,k as g,m as o,p as s,F as d,B as y,l as J,t as K,P as Q}from"./BCLrUOBx.js";import"./CTAcmMAz.js";import"./Bxmfm8sn.js";const W=()=>({categories:null}),X={emptyCategories(){this.categories=null}},Y=O("category",{state:W,actions:X}),Z={class:"container-fluid ptb-20 ptb-sm-15 flow-hidden"},tt={class:"mlr--5"},et={key:0,class:"tile-container category-tile-wrapper"},ot={class:"shimmer-wrapper"},st={key:1,class:"pos-rel"},at={key:0,class:"info-msg"},nt={key:1},rt={key:0,class:"category-tile-wrapper"},ct={key:1,class:"category-tile-wrapper"},yt={__name:"CategoryListingLayout",props:{subCategoriesMap:{type:Object,default:null}},setup(k){const C=T(),{langCode:w}=U(C),S=Y(),{emptyCategories:f}=S,x=V(),{getRequest:B}=x,l=b(null),u=b(!0),n=z(),{shimmerCount:L}=E(),h=p(()=>{var t;return(t=n==null?void 0:n.name)==null?void 0:t.includes("brands")}),_=p(()=>{var t;return((t=l.value)==null?void 0:t.data)||[]}),R=p(()=>{var t;return(t=l.value)==null?void 0:t.last_page}),v=async()=>{var c;u.value=!0;let t="categories";h.value&&(t="brands");const r=await B({params:`?${Q({page:((c=n.query)==null?void 0:c.page)||1})}`,lang:w.value,api:t});l.value=r==null?void 0:r.data,u.value=!1};return G(()=>n.query,async()=>{f(),await v()}),H(async()=>{f(),await v()}),(t,r)=>{const c=F,D=I,P=M,$=N,q=j;return e(),i(q,null,{default:A(()=>[g("div",Z,[g("div",tt,[s(u)?(e(),o("div",et,[g("div",ot,[(e(!0),o(d,null,y(s(L).PRODUCT,a=>(e(),i(c,{class:"category-tile",key:a}))),128))])])):(e(),o("div",st,[s(_).length?(e(),o("div",nt,[s(h)?(e(),o("div",rt,[(e(!0),o(d,null,y(s(_),(a,m)=>(e(),i(D,{class:"category-tile",key:m,brand:a},null,8,["brand"]))),128))])):(e(),o("div",ct,[(e(!0),o(d,null,y(s(_),(a,m)=>(e(),i(P,{class:"category-tile",key:m,"sub-category":a,category:k.subCategoriesMap[a.id]},null,8,["sub-category","category"]))),128))]))])):(e(),o("div",at,K(t.$t("categoryListingLayout.noItemFound")),1)),J($,{class:"mt-15 mt-sm-10","total-page":s(R)},null,8,["total-page"])]))])])]),_:1})}}};export{yt as default};
