Files
s.esmaeiliandCursor d316d15335 Commit admin and user-app release builds after order and panel polish.
Includes the Dashboard CSS comment fix needed for the admin production build.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-16 23:40:39 +03:30

2 lines
9.0 KiB
JavaScript

import{d as j,W as q,G,k as w,K as I,b as K,o as W,f as d,g as e,q as o,x as n,H as c,X as F,T as X,e as u,i as C,F as A,n as v,I as h,h as Y,t as f,V as S,r as J,B as Q,Y as Z,M as ee,j as m,D as N,L as se,_ as te}from"./index-DfuyKmMj.js";import{A as ae}from"./AppPullRefresh-CioamhMC.js";import{S as oe}from"./SectionHead-DuyW68OU.js";import{R as le}from"./RateStrip-CLpy56jM.js";import{p as ie}from"./filters-W1VDxROv.js";import{u as ne}from"./useReveal-CFiFySfi.js";const re="data:image/svg+xml,%3csvg%20width='200'%20height='150'%20viewBox='0%200%20200%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20Soft%20brand%20wash%20--%3e%3cellipse%20cx='100'%20cy='122'%20rx='72'%20ry='18'%20fill='%2323493c'%20fill-opacity='0.06'/%3e%3ccircle%20cx='100'%20cy='72'%20r='54'%20fill='%2323493c'%20fill-opacity='0.07'/%3e%3ccircle%20cx='44'%20cy='40'%20r='5'%20fill='%238D6A46'%20fill-opacity='0.3'/%3e%3ccircle%20cx='158'%20cy='48'%20r='7'%20fill='%237A1B33'%20fill-opacity='0.12'/%3e%3c!--%20Door%20frame%20--%3e%3crect%20x='62'%20y='28'%20width='76'%20height='92'%20rx='10'%20fill='%23FFFFFF'%20stroke='%2323493c'%20stroke-opacity='0.16'%20stroke-width='1.75'/%3e%3crect%20x='62'%20y='28'%20width='76'%20height='92'%20rx='10'%20fill='%2323493c'%20fill-opacity='0.04'/%3e%3c!--%20Open%20door%20(hinged%20left,%20swung%20out)%20--%3e%3cpath%20d='M72%2036h28c1.1%200%202%20.9%202%202v76c0%201.1-.9%202-2%202H72c-1.1%200-2-.9-2-2V38c0-1.1.9-2%202-2z'%20fill='%23E8EFEC'%20/%3e%3cpath%20d='M100%2036l34%208v64l-34%208V36z'%20fill='%2323493c'%20fill-opacity='0.12'%20stroke='%2323493c'%20stroke-opacity='0.22'%20stroke-width='1.25'%20/%3e%3cpath%20d='M118%2072h8'%20stroke='%238D6A46'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c!--%20Exit%20arrow%20--%3e%3cg%20transform='translate(128%2058)'%3e%3ccircle%20cx='22'%20cy='22'%20r='20'%20fill='%237A1B33'/%3e%3cpath%20d='M12%2022h16M22%2014l8%208-8%208'%20stroke='%23FAFAFA'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c/g%3e%3c!--%20Soft%20ground%20line%20--%3e%3cpath%20d='M48%20128h104'%20stroke='%23ECEDEF'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e",de={class:"dash"},ce={class:"dash__bar"},ue={class:"dash__barInner"},fe={key:1,class:"dash__barSpacer","aria-hidden":"true"},_e={class:"dash__profileNudgeIcon","aria-hidden":"true"},pe={class:"dash__balanceHead"},ve={class:"dash__eyebrow"},he={class:"dash__figure"},me={class:"dash__balanceRow"},ge={class:"dash__rowValue"},ye={class:"dash__identity"},be={class:"dash__name"},xe={class:"dash__mobile"},ke={class:"dash__inviteIcon","aria-hidden":"true"},we={class:"dash__access"},Ce=["onClick"],Se={class:"dash__tileIcon","aria-hidden":"true"},Ee={class:"dash__tileTitle"},De={class:"dash__tileArrow","aria-hidden":"true"},Ie=["src"],Fe=["src"],Ae={class:"p-8 text-justify"},Ne=j({__name:"DashboardView",setup(Te){const l=ee(),_=q(),g=G(),i=w(g.peek(I.profile)??null),E=w(g.peek(I.goldPrice)??null),b=w(!1),x=m(()=>i.value?parseFloat(i.value.goldDebtGrams)>0:!1),T=m(()=>x.value?"بدهکار گرمی":"بستانکار گرمی"),V=m(()=>i.value?Math.abs(parseFloat(i.value.goldDebtGrams)):0),y=m(()=>{var s;const t=(s=i.value)==null?void 0:s.verificationStep;return!!t&&t!=="VERIFIED"&&t!=="STEP_TWO_SUBMITTED"}),r=X({notify:!1,loginNotify:!1}),L=[{id:0,icon:"vuesax-linear:box",title:"سفارشات",tone:"forest",disabled:!1},{id:1,icon:"vuesax-linear:receipt-text",title:"اسناد",tone:"sand",disabled:!1},{id:2,icon:"vuesax-linear:user",title:"پروفایل",tone:"wine",disabled:!1},{id:3,icon:"vuesax-linear:heart",title:"علاقمندی",tone:"rose",disabled:!1},{id:6,icon:"vuesax-linear:chart-2",title:"گزارش",tone:"slate",disabled:!1}],P=[{id:4,icon:"vuesax-linear:box-tick",title:"سفارش مشتریان",tone:"forest",disabled:!1},{id:5,icon:"vuesax-linear:profile-2user",title:"مشتریان من",tone:"sand",disabled:!1}],R={id:7,icon:"vuesax-linear:brush",title:"ظاهر",tone:"ink",disabled:!1},B=m(()=>[...L,..._.isSalesExpert?P:[],R]);function M(t){if(t===7){l.push({name:"appearanceSettings"});return}if(!_.isLoggedIn){r.loginNotify=!0;return}t===0&&l.push({name:"ordersList"}),t===1&&l.push({name:"transactionsList"}),t===2&&l.push({name:"profileData"}),t===3&&l.push({name:"favoritesList"}),t===4&&l.push({name:"ChildOrder"}),t===5&&l.push({name:"customerChoice"}),t===6&&l.push({name:"report"})}async function O(){r.notify=!1;try{await N.endSharedSession()}catch{}let t=null;try{t=(await N.ssoLogoutUrl()).logout_url}catch{t=null}if(_.logout(),sessionStorage.removeItem("gb_iam_sso_checked"),t){window.location.assign(t);return}l.push({name:"home"})}async function k(){const[t,s]=await Promise.allSettled([_.isLoggedIn?g.me({force:!0}):Promise.resolve(null),g.goldPrice({force:!0})]);t.status==="fulfilled"?i.value=t.value:console.log(t.reason),E.value=s.status==="fulfilled"?s.value:null}async function z(){await k(),b.value=!1}let D=!1;K(()=>{D&&k(),D=!0});const{revealed:$,revealDelay:p,reveal:U}=ne("dashboard");return W(async()=>{await k(),U()}),(t,s)=>{const H=se("container");return u(),d("div",de,[e("header",ce,[e("div",ue,[s[9]||(s[9]=e("span",{class:"dash__barSpacer","aria-hidden":"true"},null,-1)),s[10]||(s[10]=e("h1",{class:"dash__barTitle"},"میز کار",-1)),o(_).isLoggedIn?(u(),d("button",{key:0,type:"button",class:"dash__barBtn","aria-label":"خروج",onClick:s[0]||(s[0]=a=>r.notify=!0)},[n(h,{icon:"vuesax-linear:logout",size:"19"})])):(u(),d("span",fe))])]),n(ae,{modelValue:b.value,"onUpdate:modelValue":s[3]||(s[3]=a=>b.value=a),onRefresh:z},{default:c(()=>[n(H,{class:C(["dash__body",{"is-revealed":o($)}])},{default:c(()=>[i.value?(u(),d(A,{key:0},[y.value?(u(),d("section",{key:0,class:"dash__profileNudge reveal",style:v(o(p)(0))},[e("div",_e,[n(h,{icon:"vuesax-linear:info-circle",size:"16"})]),s[11]||(s[11]=e("div",{class:"dash__profileNudgeCopy"},[e("h3",null,"پروفایل شما تکمیل نشده است"),e("p",null,"برای ادامه، مدارک پروفایل را بارگذاری کنید.")],-1)),e("button",{type:"button",class:"dash__profileNudgeCta",onClick:s[1]||(s[1]=a=>o(l).push({name:"completeProfile"}))}," تکمیل پروفایل ")],4)):Y("",!0),e("section",{class:"dash__balance reveal",style:v(o(p)(y.value?1:0))},[e("div",pe,[e("div",null,[e("div",ve,f(T.value),1),e("div",he,[S(f(V.value)+" ",1),s[12]||(s[12]=e("span",{class:"dash__unit"},"گرم",-1))])]),e("span",{class:C(["dash__seal",x.value?"is-debtor":"is-creditor"])},f(x.value?"بدهکار":"بستانکار"),3)]),e("div",me,[s[14]||(s[14]=e("span",{class:"dash__rowLabel"},"بدهی ریالی",-1)),e("span",ge,[S(f(o(ie)(i.value.fiatDebtRial))+" ",1),s[13]||(s[13]=e("i",null,"ریال",-1))])]),e("div",ye,[e("span",be,f(i.value.fullName),1),e("span",xe,f(o(_).mobile),1)])],4)],64)):(u(),d("section",{key:1,class:"dash__invite reveal",style:v(o(p)(0))},[e("div",ke,[n(h,{icon:"vuesax-linear:security-user",size:"20"})]),s[15]||(s[15]=e("div",{class:"dash__inviteCopy"},[e("h3",null,"حساب گرمی شما"),e("p",null,"برای دیدن موجودی، سفارش‌ها و اسناد خود وارد شوید.")],-1)),e("button",{type:"button",class:"dash__inviteCta",onClick:s[2]||(s[2]=a=>o(l).push({name:"login"}))}," ورود / ثبت‌نام ")],4)),e("section",{class:"dash__section reveal",style:v(o(p)(i.value&&y.value?2:1))},[e("div",we,[(u(!0),d(A,null,J(B.value,a=>(u(),d("button",{key:a.id,type:"button",class:C(["dash__tile",[`is-${a.tone}`,{"is-disabled":a.disabled}]]),onClick:Ve=>M(a.id)},[e("span",Se,[n(h,{icon:a.icon,size:"21"},null,8,["icon"])]),e("span",Ee,f(a.title),1),e("span",De,[n(h,{icon:"vuesax-linear:arrow-left-2",size:"14"})])],10,Ce))),128))])],4),e("section",{class:"dash__section reveal",style:v(o(p)(i.value&&y.value?3:2))},[n(oe,{title:"نرخ روز",subtitle:"آخرین نرخ اعلام‌شده"}),n(le,{quote:E.value},null,8,["quote"])],4)]),_:1},8,["class"])]),_:1},8,["modelValue"]),n(F,{timeOut:-1,show:r.notify,"onUpdate:show":s[5]||(s[5]=a=>r.notify=a),closeOnClickOverlay:!0},{img:c(()=>[e("img",{src:o(re),alt:""},null,8,Ie)]),title:c(()=>[...s[16]||(s[16]=[S("آیا می خواهید از برنامه خارج شوید؟",-1)])]),button:c(()=>[e("div",{class:"text-center text-[color:var(--c-primary)]",onClick:O},"بله"),e("div",{class:"text-center text-[color:var(--c-inkMuted)]",onClick:s[4]||(s[4]=a=>r.notify=!1)},"بی خیال")]),_:1},8,["show"]),n(F,{timeOut:-1,show:r.loginNotify,"onUpdate:show":s[8]||(s[8]=a=>r.loginNotify=a),closeOnClickOverlay:!0},{img:c(()=>[e("img",{src:o(Z),alt:""},null,8,Fe)]),title:c(()=>[e("div",Ae," برای دسترسی به تمامی امکانات نرم افزار "+f(o(Q).name)+"، ابتدا گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید. ",1)]),button:c(()=>[e("div",{class:"text-center text-[color:var(--c-primary)]",onClick:s[6]||(s[6]=a=>o(l).push({name:"login"}))},"ورود/ثبت نام"),e("div",{class:"text-center text-danger",onClick:s[7]||(s[7]=a=>r.loginNotify=!1)},"بیخیال")]),_:1},8,["show"])])}}}),ze=te(Ne,[["__scopeId","data-v-8a47738b"]]);export{ze as default};