1 line
8.0 KiB
JavaScript
1 line
8.0 KiB
JavaScript
import{A as e,Ct as t,E as n,F as r,G as ee,I as i,K as a,L as o,M as s,O as c,P as l,Q as te,T as ne,Y as u,_ as re,bt as d,ft as f,j as p,k as m,n as h,q as g,wt as _,xt as v}from"./BasicIcon-CjTTsi6o.js";import{o as ie}from"./format-BHJptHdF.js";import{b as y,c as ae,i as oe,l as se,o as ce,r as le,s as b,x}from"./index-BQQA5ZX-.js";import{t as ue}from"./IconChevronBack-B10eZjCQ.js";import{t as S}from"./IconLayoutGrid-fpJ_H2ee.js";import{t as de}from"./IconDiamond-Yhg3u2_R.js";import{t as fe}from"./PageSkeleton-CyATkHE1.js";import{n as pe,r as me,t as he}from"./crm-DPw1h61_.js";import{t as ge}from"./useGoBack-D3aJ73Q-.js";import{t as _e}from"./IconHeart-BmvFB3Xr.js";var C=[`width`,`height`],ve=o({__name:`IconMedal`,props:{size:{default:44}},setup(e){return(t,n)=>(g(),s(`svg`,{class:`icon-medal`,width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[...n[0]||=[l(`<path d="M18 28.5L14 44l10-5 10 5-4-15.5" fill="#C0C7D1"></path><path d="M18 28.5L14 44l10-5V28.5H18Z" fill="#A8B0BC"></path><circle cx="24" cy="18" r="14" fill="#D8DEE6"></circle><circle cx="24" cy="18" r="11" fill="#F3F5F8" stroke="#B8C0CB" stroke-width="1.5"></circle><path d="M24 10.5l2.2 4.5 5 .7-3.6 3.5.9 5L24 21.8 19.5 24l.9-5-3.6-3.5 5-.7L24 10.5Z" fill="#8B95A5"></path>`,5)]],8,C))}}),w={class:`page home-page`},T={class:`home-header`},E={class:`home-header__user`},D={class:`home-header__hello`},O={class:`home-header__actions`},k={class:`page__scroll page__scroll--with-nav home-scroll`},A={key:0,class:`home-error`},j=[`aria-label`],M={class:`hero-banner__content`},N={class:`hero-banner__title`},P={key:0},F={key:0,class:`hero-banner__dots`,role:`tablist`,"aria-label":`بنرها`},ye=[`aria-label`,`aria-selected`,`onClick`],be={class:`quick-grid`,"aria-label":`دسترسی سریع`},xe=[`onClick`],Se={class:`quick-card__icon`,"aria-hidden":`true`},Ce={class:`quick-card__label`},we={class:`level-card`,"aria-label":`سطح عضویت`},Te={class:`level-card__top`},Ee={class:`level-card__identity`},De={class:`level-card__text`},Oe={class:`level-card__name`},ke={class:`level-card__next`},Ae={class:`level-card__progress`},je=[`aria-valuenow`],Me={class:`level-card__points`},I={class:`section`},Ne={class:`section__head`},Pe={class:`product-row`},Fe=[`onClick`],Ie={key:0,class:`product-card__badge`},Le={class:`product-card__body`},Re={class:`product-card__name`},ze={class:`product-card__sub`},Be=[`aria-label`,`aria-pressed`,`onClick`],L=h(o({__name:`HomeView`,setup(o){let l=re(),{goBack:h}=ge(`/`),C=ae(),L=he(),R=se(),z=f(!0),B=f(null),V=f([]),H=f(null),U=f(null),Ve=[{id:`qa-club`,label:`باشگاه مشتریان`,to:`/profile`,icon:x},{id:`qa-cat`,label:`دسته بندی`,to:`/categories`,icon:S},{id:`qa-new`,label:`محصولات جدید`,to:`/products`,icon:de},{id:`qa-swatch`,label:`درخواست کالیته`,to:`/catalog-request`,icon:y}],He=[{id:`qa-customers`,label:`مشتریان من`,to:`/customers`,icon:x},{id:`qa-reminders`,label:`یادآورها`,to:`/reminders`,icon:b},{id:`qa-cat`,label:`دسته بندی`,to:`/categories`,icon:S},{id:`qa-swatch`,label:`درخواست کالیته`,to:`/catalog-request`,icon:y}],Ue=c(()=>C.isAgent?He:Ve),W={id:`fallback`,slot:`home_hero`,title:`کالکشن پاییز و زمستان`,subtitle:`جدیدترین پارچهها`,ctaLabel:`مشاهده کالکشن`,ctaLink:`/categories`,imageUrl:``},G=f([W]),K=f(0),q,J=c(()=>G.value[K.value]??W),We=c(()=>{let e=J.value.imageUrl;if(e)return{"--hero-image":`url("${e}")`}});function Y(){X(),!(G.value.length<2)&&(q=window.setInterval(()=>{K.value=(K.value+1)%G.value.length},5e3))}function X(){q&&window.clearInterval(q),q=void 0}function Ge(e){K.value=e,Y()}let Z=c(()=>C.user?.firstName||`کاربر`),Ke=c(()=>C.user?.lastName||``),Q=c(()=>{if(U.value)return U.value;let e=C.user;return{label:e?.levelLabel||`برنزی`,nextLabel:e?.nextLevelLabel||`نقرهای`,pointsRemaining:e?.pointsToNext??0,progressPercent:e?.levelProgress??0}});a(X),ee(async()=>{z.value=!0,B.value=null;try{let[e,t]=await
|