import v from"./CE4It_C4.js";import k from"./Dyp1qGEf.js";import{K as x,m as r,j as s,k as n,t as p,l as d,w as _,F as h,B as g,i as S,T,q as $,_ as B,P as C,Q as P,u as b,s as f,b as I}from"./BCLrUOBx.js";import{u as D}from"./Bxmfm8sn.js";import{u as G}from"./DFFf0IVd.js";import"./CTAcmMAz.js";import"./B2sEaWda.js";import"./a5umXhxZ.js";import"./BnLnKt_p.js";import"./Di7fl9dA.js";import"./Ce8lFovl.js";const H={setup(){const t=b(),{langCode:o}=f(t),e=G(),{products:u}=f(e),{fetchProducts:a,setHomeProducts:l}=e,i=I(),{unAuthGet:c}=i;return{langCode:o,products:u,fetchProducts:a,unAuthGet:c,setHomeProducts:l}},name:"Discover",data(){return{currentItems:[],loading:!0}},watch:{},props:{},components:{ProductTile:k,TileShimmer:v},computed:{},mixins:[D],methods:{},created(){},async mounted(){var t;if(this.products)this.currentItems=(t=this.products)==null?void 0:t.data,this.loading=!1;else try{this.loading=!0;const e=(await this.unAuthGet({api:"products",params:`?${C({is_home_page:!0})}`,lang:this.langCode})).data.result;this.setHomeProducts(e),this.currentItems=e.data,this.loading=!1}catch(o){P({statusCode:400,message:o.message})}}},L={class:"home-section"},N={class:"area"},V={class:"title"},A={class:"area-content"},E={class:"tile-container"},F={class:"shimmer-wrapper",key:"shimmer"},j={class:"flex wrap align-start discover-area",key:"products"},q={class:"center-text mt-20 mt-sm-15"};function K(t,o,e,u,a,l){const i=v,c=k,y=B;return s(),r("div",L,[n("div",N,[n("h4",V,p(t.$t("discover.dailyDiscover")),1),n("div",A,[n("div",E,[d(T,{name:"fade",mode:"out-in"},{default:_(()=>[a.loading?(s(),r("div",F,[(s(),r(h,null,g(15,m=>d(i,{key:m})),64))])):(s(),r("div",j,[(s(!0),r(h,null,g(a.currentItems,(m,w)=>(s(),S(c,{key:w,product:m},null,8,["product"]))),128))]))]),_:1})])])]),n("div",q,[d(y,{to:t.listingLink({slug:"daily-discover"}),class:"w-100 br-primary outline-btn btn-lg plr-35 plr-sm-20"},{default:_(()=>[$(p(t.$t("discover.showMore")),1)]),_:1},8,["to"])])])}const tt=x(H,[["render",K]]);export{tt as default};
