Files
tehran_taj/apps/user-app-v2/dist/assets/DashboardView-BmvrjyGs.js
T

2 lines
12 KiB
JavaScript
Raw Normal View History

import{d as X,U as Z,y as ss,h as p,K as E,A as es,o as as,z as A,c as h,p as t,C as k,m as i,s as N,W as q,D as ts,P as os,v as $,b as c,I as o,f as H,n as w,e as s,t as u,T as ns,g as L,B as is,F as ls,i as D,E as rs,_ as ds}from"./index-D8rImuYS.js";import{A as us}from"./AppPullRefresh-CRlsXY5y.js";import{P as _s}from"./PageBar-D3jj0fpH.js";import{R as hs}from"./RateStrip-D2_9D2Dh.js";import{p as cs}from"./filters-DFCzE8sv.js";import{D as j}from"./index-BZmou6Ct.js";import"./KeyCode-C3zI_tcU.js";import"./classCallCheck-MbKOlzYJ.js";import"./raf-nDFcuFT6.js";const vs={class:"dash"},ps={key:1,class:"dash__exitSpacer","aria-hidden":"true"},fs={class:"dash__heroHead"},bs={class:"dash__heroIdentity"},ms={class:"dash__heroName"},ys={class:"dash__heroMobile"},ws={class:"dash__heroBalance"},gs={class:"dash__heroFigure"},xs={class:"dash__heroNum"},ks={class:"dash__heroDebt"},Cs={class:"dash__heroHead"},Is={class:"dash__heroIdentity"},zs={class:"dash__heroMobile"},Ss={class:"dash__heroPending"},$s=["alt"],Ls={class:"dash__bannerIcon","aria-hidden":"true"},Ds={class:"dash__bannerText"},Ts={class:"dash__bannerChevron","aria-hidden":"true"},Bs={class:"dash__bannerIcon","aria-hidden":"true"},Es={class:"dash__bannerText"},Ns={class:"dash__bannerChevron","aria-hidden":"true"},Ps={class:"dash__rowIcon","aria-hidden":"true"},Fs={class:"dash__rowChevron","aria-hidden":"true"},Rs={class:"dash__rowIcon","aria-hidden":"true"},Vs={class:"dash__rowChevron","aria-hidden":"true"},Ms={class:"dash__rowIcon","aria-hidden":"true"},Os={class:"dash__rowChevron","aria-hidden":"true"},Us={class:"dash__rowIcon","aria-hidden":"true"},As={class:"dash__rowChevron","aria-hidden":"true"},qs={class:"dash__rowIcon","aria-hidden":"true"},Hs={class:"dash__rowChevron","aria-hidden":"true"},js={class:"dash__rowIcon","aria-hidden":"true"},Gs={class:"dash__rowChevron","aria-hidden":"true"},Ks={class:"dash__rowIcon","aria-hidden":"true"},Ws={class:"dash__rowChevron","aria-hidden":"true"},Ys={class:"dash__rowIcon","aria-hidden":"true"},Js={class:"dash__rowChevron","aria-hidden":"true"},Qs={class:"dash__rowIcon","aria-hidden":"true"},Xs={class:"dash__rowChevron","aria-hidden":"true"},Zs={class:"dash__rowIcon","aria-hidden":"true"},se={class:"dash__rowChevron","aria-hidden":"true"},ee={class:"dash__choice"},ae={class:"dash__choice"},te=70,oe=X({__name:"DashboardView",setup(ne){const r=ts(),l=Z(),g=ss(),v=p(g.peek(E.profile)??null),P=p(g.peek(E.goldPrice)??null),C=p(g.peek(E.customButton)??null),f=p([]),T=p(!1),x=p(!1),G=D(()=>{const a=C.value;return!!(a!=null&&a.enabled&&a.title.trim()&&a.link.trim())});function K(){var e,y;const a=(y=(e=C.value)==null?void 0:e.link)==null?void 0:y.trim();a&&window.open(a,"_blank","noopener,noreferrer")}const F=D(()=>v.value?parseFloat(v.value.goldDebtGrams)>0:!1),W=D(()=>v.value?Math.abs(parseFloat(v.value.goldDebtGrams)):0),Y=D(()=>{const a=W.value;return Number.isFinite(a)?a.toLocaleString("fa-IR",{maximumFractionDigits:3}):"۰"}),b=os({notify:!1,loginNotify:!1});function _(a){if(!l.isLoggedIn){b.loginNotify=!0;return}a===0&&r.push({name:"ordersList"}),a===1&&r.push({name:"transactionsList"}),a===2&&r.push({name:"profileData"}),a===3&&r.push({name:"favoritesList"}),a===4&&r.push({name:"ChildOrder"}),a===5&&r.push({name:"customerChoice"}),a===6&&r.push({name:"report"}),a===7&&(I.value=!0),a===8&&(z.value=!0)}const I=p(!1);function R(a){I.value=!1,r.push({name:a})}const z=p(!1);function V(a){z.value=!1;const e=a==="surveyFeed"?"/surveys":"/surveys/mine";A(()=>{r.push(e).catch(()=>{window.location.assign(e)})})}async function J(){b.notify=!1;try{await $.endSharedSession()}catch{}let a=null;try{a=(await $.ssoLogoutUrl()).logout_url}catch{a=null}if(l.logout(),sessionStorage.removeItem("gb_iam_sso_checked"),a){window.location.assign(a);return}r.push({name:"home"})}async function S(){x.value=!1;const[a,e,y]=await Promise.allSettled([l.isLoggedIn?g.me({force:!0}):Promise.resolve(null),g.goldPrice({force:!0}),g.customButton({force:!0})]);if(a.status==="fulfilled"?(v.value=a.value,x.value=!1):(x.value=l.isLoggedIn&&!v.value,console.log(a.rea