import K from"./BnapQtOb.js";import O from"./C-Tw4iS-.js";import Q from"./CKuCh9ox.js";import W from"./CE4It_C4.js";import X from"./Dyp1qGEf.js";import Z from"./GQCWnG0A.js";import{h as tt}from"./zH0z38ay.js";import{b as st,s as R,u as et,r as m,H as ot,x as at,y as nt,e as rt,f as g,I as it,m as c,k as s,p as o,A as S,t as l,q as ct,l as u,F as x,B,P as C,j as n,i as lt}from"./BCLrUOBx.js";import{u as mt}from"./CCot8u0_.js";import{u as ut}from"./VJGZwNiG.js";import"./Bvs3L9q-.js";import"./CWalxxGV.js";import"./CE6lP_wf.js";import"./CglRsQQc.js";import"./CTAcmMAz.js";import"./B2sEaWda.js";import"./a5umXhxZ.js";import"./Bxmfm8sn.js";import"./BnLnKt_p.js";import"./Di7fl9dA.js";import"./Ce8lFovl.js";const _t={class:"store-container mb-30 mb-sm-15"},dt={class:"container-fluid"},pt={class:"store-info"},gt={class:"left-area"},ht={class:"img-wrap"},ft=["src","alt"],vt={class:"store-content"},yt={class:"bold mb-5"},bt={key:0,class:"store-rating ls-0"},wt={class:"f-12 ml-5"},kt={class:"opacity-8 f-9"},qt={class:""},Dt={class:"right-area"},$t={class:"container-fluid mb-50 mb-sm-20"},Pt={class:"flex sided mb-15"},Rt={class:"main-content"},St={key:0,class:"tile-container"},xt={class:"shimmer-wrapper"},Bt={key:1,class:"pos-rel"},Ct={key:0,class:"info-msg"},Ft={class:"tile-container"},At={class:"flow-hidden"},is={__name:"[slug]",async setup(Lt){var P;let _,w;const h=st(),{ssrGetRequest:Mt,unAuthGet:F,postRequest:Gt}=h,{customScripts:It}=R(h),A=et(),{langCode:k}=R(A);m(null);const f=m(!1),a=ot(),d=m(!1),p=m(null),{data:v,pending:Nt,error:Vt}=([_,w]=at(async()=>ut("flash-sale",async()=>{var i;const{unAuthGet:e}=h;return(await e({api:"store",params:`?${C({slug:(i=a==null?void 0:a.params)==null?void 0:i.slug,sortby:a.query.sortby||"",page:a.query.page||"",required_rating:!0})}`,lang:k.value})).data})),_=await _,w(),_),L=()=>{d.value=!d.value};p.value=(P=v.value)==null?void 0:P.result;const{pageMeta:M}=mt(),{getImageURL:q,formatPrice:G}=nt(),{review:D,store:t}=v.value;d.value=v.value.following,rt(M({meta_title:t==null?void 0:t.meta_title,meta_description:t==null?void 0:t.meta_description,meta_keywords:t==null?void 0:t.meta_keywords,image_url:q(t==null?void 0:t.image)}));const I=g(()=>t==null?void 0:t.id),N=g(()=>tt(t==null?void 0:t.created_at).format("MMM DD, YYYY")),y=g(()=>{var e;return((e=p.value)==null?void 0:e.data)||null}),V=g(()=>{var e;return(e=p.value)==null?void 0:e.last_page}),$=m(null),Y=e=>{var r;(r=$.value)==null||r.resettingRoute(e)};it(()=>a.query,async()=>{await U()});const U=async()=>{var r,i;f.value=!0;const e=await F({params:`?${C({slug:(r=a==null?void 0:a.params)==null?void 0:r.slug,sortby:a.query.sortby||"",page:a.query.page||""})}`,api:"store",lang:k.value});p.value=(i=e==null?void 0:e.data)==null?void 0:i.result,f.value=!1};return(e,r)=>{const i=K,H=O,T=Q,j=W,E=X,z=Z;return n(),c("div",null,[s("div",_t,[s("div",dt,[s("div",pt,[s("div",gt,[s("div",ht,[s("img",{src:o(q)(o(t).image),alt:e.$t("footer.siteLogo"),height:"50",width:"50"},null,8,ft)]),s("div",vt,[s("div",null,[s("h4",yt,l(o(t).name),1),o(D)?(n(),c("h6",bt,[ct(l(e.$t("store.avgRating"))+" ",1),s("b",wt,l(o(G)(o(D))),1)])):S("",!0)]),s("div",null,[s("p",kt,l(e.$t("store.memberSince")),1),s("h6",qt,[s("b",null,l(o(N)),1)])])])]),s("div",Dt,[u(i,{class:"primary-btn w-150x",following:o(d),"store-id":o(I),onChangeFollowing:L},null,8,["following","store-id"])])])])]),s("div",$t,[s("div",Pt,[u(H,{class:"mtb-0",page:o(t).name},null,8,["page"]),u(T,{onFetchingData:Y})]),s("div",Rt,[o(f)?(n(),c("div",St,[s("div",xt,[(n(),c(x,null,B(20,b=>u(j,{key:b})),64))])])):(n(),c("div",Bt,[o(y)&&!o(y).length?(n(),c("div",Ct,l(e.$t("listingLayout.noProductFound")),1)):S("",!0),s("div",Ft,[(n(!0),c(x,null,B(o(y),(b,J)=>(n(),lt(E,{key:J,product:b},null,8,["product"]))),128))]),s("div",At,[u(z,{class:"mt-30",ref_key:"productPagination",ref:$,"total-page":o(V)},null,8,["total-page"])])]))])])])}}};export{is as default};
