Rebuilt dist/ and api release bundle, with the migration for catalog paging indexes. Fix Less build error: fade(@token, N%) on theme tokens failed in both user-app and user-app-v2 CustomerChoiceView; use alpha(), the project's token-aware helper. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{d as X,u as ae,o as te,a as oe,b as a,c,e as d,F as D,r as G,n as T,f as V,g as O,h as b,i as R,_ as q,j as W,t as N,I as Y,k as le,l as ie,w as re,m as P,p as x,q as ce,s as ue,v as de,x as _e,K as J,y as ve,z as pe,A as fe,B as A,C as me,D as ge,E as he}from"./index-Fj5Qv9qV.js";import{R as ye}from"./RateStrip-DnEwhro4.js";import{u as ke}from"./catalogStore-CXCIHfvg.js";import{P as Ie,L as j}from"./index-DQTQmdnT.js";import"./filters-CF2i06Nn.js";const $e={key:0,class:"hero"},Se=["onClick"],be=["src","alt"],Ce={key:1,class:"hero__artFallback","aria-hidden":"true"},Pe={key:0,class:"hero__dots"},we=["aria-label","onClick"],Q=46,xe=.76,Ee=36.6,Re=.75,Oe=X({__name:"HeroCarousel",props:{slides:{},autoplay:{type:Boolean,default:!0}},emits:["select"],setup(_,{emit:k}){const y=_,C=k,u=b(0),v=b(null),r=b(!1),p=b(0);let I=0,f=null,h;const m=ae(),g=R(()=>y.slides.length);function w(n){let l=n-u.value;g.value>2&&(l>g.value/2&&(l-=g.value),l<-g.value/2&&(l+=g.value));const i=r.value?p.value:0,e=Math.abs(l),t=l*Ee+i,$=l===0?1:xe,S=e>1?0:e===0?1:Re;return{transform:`translate3d(${t}%, 0, 0) scale(${$})`,opacity:String(S),zIndex:String(10-e),pointerEvents:e>1?"none":"auto",transition:r.value?"none":"transform .42s cubic-bezier(.22,.61,.36,1), opacity .42s ease"}}function E(n){u.value=(n%g.value+g.value)%g.value,o()}function z(){E(u.value+1)}function U(){E(u.value-1)}function B(n){var l,i;g.value<2||(r.value=!0,I=n.clientX,p.value=0,f=n.pointerId,(i=(l=n.currentTarget).setPointerCapture)==null||i.call(l,n.pointerId),s())}function L(n){var i;if(!r.value||n.pointerId!==f)return;const l=((i=v.value)==null?void 0:i.clientWidth)||1;p.value=(n.clientX-I)/l*100}function H(n){if(!r.value)return;const l=n.clientX-I;r.value=!1,p.value=0,f=null,l>Q?U():l<-Q?z():o()}function F(n,l){if(!(Math.abs(p.value)>1)){if(n!==u.value){E(n);return}C("select",l)}}function s(){h&&clearInterval(h),h=void 0}function o(){s(),y.autoplay&&!m.isReducedMotion&&g.value>1&&(h=setInterval(z,6e3))}return te(o),oe(s),(n,l)=>_.slides.length?(a(),c("section",$e,[d("div",{class:"hero__stage",ref_key:"stage",ref:v,onPointerdown:B,onPointermove:L,onPointerup:H,onPointercancel:H},[(a(!0),c(D,null,G(_.slides,(i,e)=>(a(),c("article",{key:i.key,class:V(["hero__card",{"is-active":e===u.value}]),style:T(w(e)),onClick:t=>F(e,i)},[i.image?(a(),c("img",{key:0,src:i.image,alt:i.title,class:"hero__art",draggable:"false"},null,8,be)):(a(),c("div",Ce))],14,Se))),128))],544),_.slides.length>1?(a(),c("div",Pe,[(a(!0),c(D,null,G(_.slides,(i,e)=>(a(),c("button",{key:i.key,type:"button",class:V(["hero__dot",{"is-active":e===u.value}]),"aria-label":i.title,onClick:t=>E(e)},null,10,we))),128))])):O("",!0)])):O("",!0)}}),He=q(Oe,[["__scopeId","data-v-d3ac0cc7"]]),ze={class:"cats no-scrollbar"},Be=["onClick"],Le={class:"cats__mark","aria-hidden":"true"},Me=["src"],Ae={class:"cats__title"},Te=X({__name:"CategoryGrid",props:{categories:{},activeId:{}},emits:["select"],setup(_,{emit:k}){const y=k;return(C,u)=>(a(),c("div",ze,[(a(!0),c(D,null,G(_.categories,v=>{var r;return a(),c("button",{key:v.id,type:"button",class:V(["cats__tile",{"is-active":v.id===_.activeId}]),onClick:p=>y("select",v)},[d("span",Le,[(r=v.icon)!=null&&r.image?(a(),c("img",{key:0,src:v.icon.image,alt:""},null,8,Me)):(a(),W(Y,{key:1,icon:"vuesax-linear:3d-cube-scan",size:"27"}))]),d("span",Ae,N(v.title),1)],10,Be)}),128))]))}}),De=q(Te,[["__scopeId","data-v-155beefb"]]),Ue={class:"panel__art"},Fe=["alt"],Ne={class:"panel__title"},Ge={class:"panel__meta"},Ve={class:"panel__weight"},Xe={key:0,class:"panel__wageOld"},qe={class:"panel__wage"},We=X({__name:"ProductPanel",props:{value:{},wageBefore:{}},emits:["open"],setup(_,{emit:k}){const y=_,C=k,{image:u,title:v,min_gram:r,wage:p}=le(y.value);function I(f){return f%1===0?String(f):f.toFixed(2)}return(f,h)=>{const m=ie("lazy");return a(),c("article",{class:"panel","data-product-origin":"",onClick:h[0]||(h[0]=g=>C("open",_.value))},[d("div",Ue,[re(d("img",{alt:P(v)},null,8,Fe),[[m,P(u)]])]),d("h3",Ne,N(P(v)),1),d("div",Ge,[d("span",Ve,N(P(r))+" گرم",1),P(p)!=null?(a(),c(D,{key:0},[h[1]||(h[1]=d("span",{class:"panel__sep","aria-hidden":"true"},null,-1)),_.wageBefore!=null?(a(),c("span",Xe,"اجرت "+N(I(_.wageBefore))+"٪",1)):O("",!0),d("span",qe,N(I(P(p)))+"٪ اجرت",1)],64)):O("",!0)])])}}}),ne=q(We,[["__scopeId","data-v-ccafc905"]]),je={class:"reel"},Ye=["onClick"],Ke={class:"reel__allMark","aria-hidden":"true"},Z=46,Je=.78,ee=92.5,Qe=.62,Ze=X({__name:"ProductCarousel",props:{products:{}},emits:["open","all"],setup(_,{emit:k}){const y=_,C=k,u=b(0),v=b(null),r=b(!1),p=b(0);let I=0,f=null;const h=R(()=>[...y.products.map(s=>({key:s.id,kind:"product",product:s})),{key:"__all__",kind:"all"}]),m=R(()=>h.value.length);function g(s){let o=s-u.value;m.value>2&&(o>m.value/2&&(o-=m.value),o<-m.value/2&&(o+=m.value));const n=r.value?p.value:0,l=o*ee+n,i=Math.min(Math.abs(o+n/ee),1),e=1-(1-Je)*i,t=1-(1-Qe)*i,$=Math.abs(o)<=1,S=$?t:0;return{transform:`translate3d(${l}%, 0, 0) scale(${e})`,opacity:String(S),zIndex:String(10-Math.abs(o)),pointerEvents:$?"auto":"none",transition:r.value?"none":"transform .55s cubic-bezier(.21,1.02,.36,1), opacity .45s ease"}}function w(s){u.value=(s%m.value+m.value)%m.value}function E(){w(u.value+1)}function z(){w(u.value-1)}function U(s){var o,n;m.value<2||(r.value=!0,I=s.clientX,p.value=0,f=s.pointerId,(n=(o=s.currentTarget).setPointerCapture)==null||n.call(o,s.pointerId))}function B(s){var n;if(!r.value||s.pointerId!==f)return;const o=((n=v.value)==null?void 0:n.clientWidth)||1;p.value=(s.clientX-I)/o*100}function L(s){if(!r.value)return;const o=s.clientX-I;r.value=!1,p.value=0,f=null,o>Z?z():o<-Z&&E()}function H(s,o){if(!(Math.abs(p.value)>1)){if(s!==u.value){w(s);return}C("open",o)}}function F(s){if(!(Math.abs(p.value)>1)){if(s!==u.value){w(s);return}C("all")}}return(s,o)=>(a(),c("section",je,[d("div",{class:"reel__stage",ref_key:"stage",ref:v,onPointerdown:U,onPointermove:B,onPointerup:L,onPointercancel:L},[(a(!0),c(D,null,G(h.value,(n,l)=>(a(),c("div",{key:n.key,class:V(["reel__cell",{"is-active":l===u.value}]),style:T(g(l))},[n.kind==="product"?(a(),W(ne,{key:0,value:n.product,onOpen:i=>H(l,i)},null,8,["value","onOpen"])):(a(),c("button",{key:1,type:"button",class:"reel__all",onClick:i=>F(l)},[d("span",Ke,[x(Y,{icon:"vuesax-linear:arrow-left-2",size:"26"})]),o[0]||(o[0]=d("span",{class:"reel__allText"},"مشاهده همه محصولات جدید",-1))],8,Ye))],6))),128))],544)]))}}),et=q(Ze,[["__scopeId","data-v-9bb6595e"]]),tt="/assets/shipping-and-delivery-CyUGL93q.png",nt="/assets/sports-and-competition-ao926_SX.png",se="/assets/montzar-logo-05_bmbid.png",st=[{type:"popup",src:tt,text:"ارسال سریع و مطمئن سفارشهای شما به سراسر کشور.",link:void 0},{type:"popup",src:nt,text:"جدیدترین محصولات منتزر را در بخش محصولات جدید ببینید.",link:void 0},{type:"popup",src:se,text:"منتزر، همراه شما در خرید و فروش طلا.",link:void 0}],at=ce("config",{state:()=>({config:{main_slider:st},cats:[],loaded:!1}),actions:{setCats(_){this.cats=_},async init(_=!1){try{const{categories:k}=await ue.getCatalogFacets();this.cats=k.map(y=>({...y,icon:{image:se}})),this.loaded=!0}catch(k){console.log(k)}}}}),ot={class:"home"},lt={class:"home__bar"},it={class:"home__barInner"},rt={class:"home__list"},ct={key:3,class:"home__empty"},ut=70,dt=6,_t=4,vt=X({__name:"HomeView",setup(_){let k=!1;const y=me(),C=at(),u=de(),v=ke(),r=_e(),p=b(!v.loaded),I=b(!1),f=R(()=>v.products),h=b(r.peek(J.goldPrice)??null),m=b(r.peek(J.homeSlider)??null),g=b(k);function w(e){return{"--reveal-delay":`${e*ut}ms`}}const E=R(()=>f.value),z=R(()=>f.value.slice(0,dt)),U=R(()=>f.value.slice(0,_t)),B=R(()=>{var e;return(e=m.value)!=null&&e.length?m.value.filter(t=>t.image).map((t,$)=>({key:`${$}-${t.image}`,title:"",image:t.image,link:t.link||void 0})):C.cats.slice(0,5).map(t=>({key:t.id,title:t.title,image:L(t.id),categoryId:t.id}))});function L(e){var $,S;const t=f.value.find(M=>{var K;return((K=M.category)==null?void 0:K.id)===e});return(S=($=t==null?void 0:t.images)==null?void 0:$[0])==null?void 0:S.url}function H(e){he(e)}function F(e){u.query.cats=[e.id],y.push({name:"search"})}function s(e){if(e.link){/^https?:\/\//i.test(e.link)?window.open(e.link,"_blank","noopener"):y.push(e.link);return}e.categoryId&&(u.query.cats=[e.categoryId]),y.push({name:"search"})}function o(){y.push({name:"newestProduct"})}async function n(e=!1){const[t,$,S,M]=await Promise.allSettled([v.load(e),C.init(e),r.goldPrice({force:e}),r.homeSlider({force:e})]);t.status==="rejected"&&console.log(t.reason),$.status==="rejected"&&console.log($.reason),h.value=S.status==="fulfilled"?S.value:null,m.value=M.status==="fulfilled"?M.value:null}async function l(){await n(!0),I.value=!1}te(async()=>{await n(),p.value=!1,!g.value&&(await ve(),requestAnimationFrame(()=>{g.value=!0,k=!0}))});let i=!1;return pe(async()=>{if(!i){i=!0;return}try{h.value=await r.goldPrice({force:!0})}catch(e){console.log(e)}}),(e,t)=>{const $=ge("container");return a(),c("div",ot,[d("header",lt,[d("div",it,[t[1]||(t[1]=d("img",{src:fe,alt:"منتزر",class:"home__logo"},null,-1)),x(ye,{quote:h.value,compact:"",class:"home__rate"},null,8,["quote"])])]),x(P(Ie),{modelValue:I.value,"onUpdate:modelValue":t[0]||(t[0]=S=>I.value=S),onRefresh:l},{pulling:A(()=>[x(P(j),{size:"18"})]),loosing:A(()=>[x(P(j),{size:"18"})]),loading:A(()=>[x(P(j),{size:"18"})]),success:A(()=>[...t[2]||(t[2]=[d("span",null,null,-1)])]),default:A(()=>[x($,{class:V(["home__body",{"is-revealed":g.value}])},{default:A(()=>[B.value.length?(a(),W(He,{key:0,slides:B.value,class:"home__hero home__reveal",style:T(w(0)),onSelect:s},null,8,["slides","style"])):O("",!0),P(C).cats.length?(a(),c("section",{key:1,class:"home__section home__reveal",style:T(w(1))},[t[3]||(t[3]=d("h2",{class:"home__heading"},"دسته بندی ها",-1)),x(De,{categories:P(C).cats,"active-id":null,onSelect:F},null,8,["categories"])],4)):O("",!0),E.value.length?(a(),c("section",{key:2,class:"home__section home__reveal",style:T(w(2))},[t[4]||(t[4]=d("h2",{class:"home__heading"},"محصولات جدید",-1)),x(et,{products:z.value,onOpen:H,onAll:o},null,8,["products"]),d("div",rt,[(a(!0),c(D,null,G(U.value,(S,M)=>(a(),W(ne,{key:S.id,value:S,class:"home__reveal",style:T(w(3+M)),onOpen:H},null,8,["value","style"]))),128))])],4)):O("",!0),!p.value&&!f.value.length?(a(),c("section",ct,[x(Y,{icon:"vuesax-linear:box",size:"26"}),t[5]||(t[5]=d("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))])):O("",!0)]),_:1},8,["class"])]),_:1},8,["modelValue"])])}}}),yt=q(vt,[["__scopeId","data-v-61c3c2c4"]]);export{yt as default};
|