import ce from"./B4xaLLe5.js";import ue from"./mXfklTID.js";import me from"./DiAtKFwY.js";import pe from"./Ccd8tfgx.js";import _e from"./CXhFgGTt.js";import de from"./wyhPgXX6.js";import fe from"./CZTef-we.js";import he from"./B7R0KftR.js";import{u as be,s as m,b as ge,x as ve,y as ye,f as o,e as ke,z as Se,m as p,k as l,l as r,i as a,A as s,p as t,F as N,B as F,C as $e,t as R,w as T,_ as we,j as n,q as xe}from"./BCLrUOBx.js";import Be from"./Chg4k-Cc.js";import Ce from"./D02JOna2.js";import Ae from"./Gc_cU3nS.js";import{u as De}from"./DFFf0IVd.js";import{u as Le}from"./VJGZwNiG.js";import{u as Ne}from"./CCot8u0_.js";import"./-hq_PDZF.js";import"./ChGwzFWX.js";import"./ClLTueSy.js";import"./CTAcmMAz.js";import"./DEdyn6s7.js";import"./zH0z38ay.js";import"./x_rD_Ya3.js";import"./3yN3dRTL.js";import"./a5umXhxZ.js";import"./Bxmfm8sn.js";import"./Di7fl9dA.js";import"./BnLnKt_p.js";import"./Ce8lFovl.js";import"./Dyp1qGEf.js";import"./B2sEaWda.js";import"./CHKhfOMq.js";import"./B3sjvGiU.js";import"./CE4It_C4.js";import"./CglRsQQc.js";const Fe={class:"container-fluid"},Re={key:0,class:"brands-inner"},Te={class:"brand-banner"},He={key:1,class:"area home-section grid-product-wrapper"},Ve={class:"flex sided title"},Ee={class:"search-product-tile"},$t={__name:"index",async setup(Me){let _,x;const H=be(),{langCode:V}=m(H),v=ge(),{unAuthGet:E}=v,{topBanner:M}=m(v),y=De(),{hasHomeData:P}=m(y),{setHomeData:z}=y,{data:Pe,pending:ze,error:Ge}=([_,x]=ve(async()=>Le("home",async()=>{if(P.value)return null;const e=await E({api:"home",params:"",lang:V.value});return z(e),e.data})),_=await _,x(),_),{customScripts:Ie,site_setting:B}=m(v),{pageMeta:G,preloadScript:d}=Ne(),{getImageURL:c,collectionLink:I}=ye(),{featuredCategories:U,flashSales:j,collections:k,featuredBrands:C,slider:f,banners:q,siteFeatures:A}=m(y),J=o(()=>f.value.main[0]),K=o(()=>f.value.right_top),O=o(()=>f.value.right_bottom),Q=o(()=>({link:[d(c(J.value.image),"image"),d(c(K.value.image),"image"),d(c(O.value.image),"image"),d(c(M.value.image),"image")]}));ke({...G({...B.value,image_url:c(B.value.header_logo)}),...Q.value});const W=o(()=>{var e;return(e=A.value)==null?void 0:e.length}),D=o(()=>{var e;return(e=b.value)==null?void 0:e.banner5}),L=o(()=>{var e;return(e=b.value)==null?void 0:e.banner6}),S=o(()=>{var e;return(e=b.value)==null?void 0:e.banner1}),X=o(()=>{if(k.value){const e=[...k.value];return e==null||e.pop(),e}return[]}),h=o(()=>{var e,i;return(i=(e=k.value)==null?void 0:e.slice(-1))==null?void 0:i.pop()}),{bannerType:Y}=Se(),b=o(()=>{var i;let e={banner1:null,banner2:null,banner3:null,banner4:null,banner5:null,banner6:null};return(i=q.value)==null||i.forEach(g=>{e["banner"+Y["BANNER_"+g.type]]=g}),e});return(e,i)=>{const g=ce,Z=ue,ee=me,te=pe,ne=_e,oe=de,re=fe,$=he,ae=we,se=Be,ie=Ce,le=Ae;return n(),p("div",null,[l("div",Fe,[r(g,{slider:t(f),class:"home-section"},null,8,["slider"]),t(W)?(n(),a(Z,{key:0,"site-features":t(A)},null,8,["site-features"])):s("",!0),r(ee,{"flash-sales":t(j)},null,8,["flash-sales"]),r(te,{"banner-data":t(b)},null,8,["banner-data"]),(n(!0),p(N,null,F(t(X),(u,w)=>(n(),a(ne,{key:w,collection:u},null,8,["collection"]))),128)),r(oe,{class:"category-wrapper",title:e.$t("searchPopup.categories"),type:"subCategory","item-list":t(U)},null,8,["title","item-list"]),l("div",{class:$e(["brands-wrapper",{"full-screen":!t(S)}])},[t(C)?(n(),p("div",Re,[r(re,{class:"featured-brands",title:e.$t("listingLayout.brands"),"item-list":t(C)},null,8,["title","item-list"])])):s("",!0),l("div",Te,[t(S)?(n(),a($,{key:0,banner:t(S)},null,8,["banner"])):s("",!0)])],2),t(h)?(n(),p("div",He,[l("div",Ve,[l("h4",null,R(t(h).title),1),r(ae,{class:"link",to:t(I)(t(h))},{default:T(()=>[xe(R(e.$t("featured.showAll")),1)]),_:1},8,["to"])]),l("div",Ee,[(n(!0),p(N,null,F(t(h).products,(u,w)=>(n(),a(se,{key:`prod-${w}`,product:u},null,8,["product"]))),128))])])):s("",!0),t(D)?(n(),a($,{key:2,class:"home-section mb-0 br-primary flow-hidden",banner:t(D)},null,8,["banner"])):s("",!0),r(le,{class:"mn-h-400x"},{default:T(({renderArea:u})=>[u?(n(),a(ie,{key:0})):s("",!0)]),_:1}),t(L)?(n(),a($,{key:3,class:"home-section mt-0 br-primary flow-hidden",banner:t(L)},null,8,["banner"])):s("",!0)])])}}};export{$t as default};
