Files
nademitex_user/dist/assets/HomeView-wCye6_sU.js
T

1 line
8.9 KiB
JavaScript
Raw Normal View History

2026-09-14 16:59:21 +03:30
import{A as e,Ct as t,D as n,Et as r,J as i,L as a,M as o,N as s,O as c,P as l,R as u,St as d,Tt as f,Y as p,Z as m,_ as ee,b as te,et as ne,j as h,mt as g,n as re,q as ie,rt as ae,z as _}from"./BasicIcon-C6boaehV.js";import{o as oe}from"./format-BHJptHdF.js";import{c as se,i as ce,l as le,o as ue,r as de,s as fe}from"./index-B6MlTGUp.js";import{t as pe}from"./IconChevronBack-DORV2H0q.js";import{t as me}from"./PageSkeleton-uO-jhbNm.js";import{n as he,r as ge,t as _e}from"./crm-CtglbPsN.js";import{t as ve}from"./useGoBack-CgNp0uP9.js";import{t as ye}from"./IconHeart-CZMe29Nz.js";var be=`/assets/level-medal-Avpe4Lqa.webp`,v=`/assets/quick-club-crown-C-NrSU3x.webp`,y=`/assets/quick-categories-grid-BcZY1Wu0.webp`,b=`/assets/quick-catalog-request-DBOA8vbZ.webp`,x=`/assets/quick-new-products-DBGxsuVa.webp`,xe={class:`page home-page`},Se={class:`home-header mobile-only`},S={class:`home-header__user`},C={class:`home-header__hello`},w={class:`home-header__actions`},T={class:`home-desk-head desktop-only`},E={class:`home-desk-head__sub`},D={class:`page__scroll page__scroll--with-nav home-scroll`},O={key:0,class:`home-error`},k=[`aria-label`],A={class:`hero-banner__content`},j={key:0,class:`hero-banner__title`},Ce={key:0},we={key:1,class:`hero-banner__title`},Te={key:0,class:`hero-banner__dots`,role:`tablist`,"aria-label":`بنرها`},Ee=[`aria-label`,`aria-selected`,`onClick`],De={class:`quick-grid`,"aria-label":`دسترسی سریع`},Oe=[`onClick`],ke={class:`quick-card__icon`,"aria-hidden":`true`},Ae=[`src`],je={class:`quick-card__label`},Me={class:`level-card`,"aria-label":`سطح عضویت`},Ne={class:`level-card__top`},Pe={class:`level-card__identity`},Fe=[`src`],Ie={class:`level-card__text`},Le={class:`level-card__name`},Re={class:`level-card__next`},ze={class:`level-card__progress`},Be=[`aria-valuenow`],Ve={class:`level-card__points`},He={class:`section`},M={class:`section__head`},Ue={class:`product-row`},We=[`onClick`],Ge={key:0,class:`product-card__badge`},Ke={class:`product-card__body`},qe={class:`product-card__name`},Je={class:`product-card__sub`},Ye=[`aria-label`,`aria-pressed`,`onClick`],N=re(_({__name:`HomeView`,setup(re){let _=ee(),{goBack:N}=ve(`/`),P=se(),Xe=_e(),F=le(),I=g(!0),L=g(null),R=g([]),z=g(null),B=g(null),Ze=[{id:`qa-club`,label:`باشگاه مشتریان`,to:`/profile`,image:v},{id:`qa-cat`,label:`دسته بندی`,to:`/categories`,image:y},{id:`qa-new`,label:`محصولات جدید`,to:`/products`,image:x},{id:`qa-swatch`,label:`درخواست کالیته`,to:`/catalog-request`,image:b}],Qe=[{id:`qa-customers`,label:`باشگاه مشتریان`,to:`/customers`,image:v},{id:`qa-new`,label:`محصولات جدید`,to:`/products`,image:x},{id:`qa-cat`,label:`دسته بندی`,to:`/categories`,image:y},{id:`qa-swatch`,label:`درخواست کالیته`,to:`/catalog-request`,image:b}],$e=e(()=>P.isAgent?Qe:Ze),V={id:`fallback`,slot:`home_hero`,title:`کالکشن پاییز و زمستان`,subtitle:`جدیدترین پارچه‌ها`,ctaLabel:`مشاهده کالکشن`,ctaLink:`/categories`,imageUrl:``,showTitle:!0,showSubtitle:!0,showCta:!0},H=g([V]),U=g(0),W=g(`hero-next`),G,K=e(()=>H.value[U.value]??V),et=e(()=>{let e=K.value;return e.showTitle!==!1&&e.title||e.showSubtitle!==!1&&e.subtitle||e.showCta!==!1&&e.ctaLabel});function tt(e){if(e.imageUrl)return{"--hero-image":`url("${e.imageUrl}")`}}function q(e,t){let n=H.value.length;if(!n)return;let r=(e%n+n)%n;r!==U.value&&(t===1?W.value=`hero-next`:t===-1?W.value=`hero-prev`:U.value===n-1&&r===0?W.value=`hero-next`:U.value===0&&r===n-1?W.value=`hero-prev`:W.value=r>U.value?`hero-next`:`hero-prev`,U.value=r)}function J(){Y(),!(H.value.length<2)&&(G=window.setInterval(()=>{q(U.value+1,1)},5500))}function Y(){G&&window.clearInterval(G),G=void 0}function nt(e){q(e),J()}let X=e(()=>P.user?.firstName||`کاربر`),Z=e(()=>P.user?.lastName||``),Q=e(()=>{if(B.value)return B.value;let e=P.user;return{label:e?.levelLabel||`برنزی`,nextLabel:e?.nextLevelLabel||`نقره‌ای`,pointsRemaining:e?.pointsToNext??0,progressPercent:e?.levelProgress?