Files
hedena_gold/apps/user-app/dist/assets/DashboardView-BZZgC12f.js
T
s.esmaeiliandCursor 046d8f541a build: refresh release artifacts with admin /admin asset base
Redeploy-ready admin/user/api bundles after shared-domain path fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-31 23:09:26 +03:30

2 lines
11 KiB
JavaScript

import{d as X,G as Y,H as J,k as y,K as O,b as Q,o as Z,f as d,g as s,q as i,x as l,J as v,X as B,U as ee,D as S,e as c,i as I,F as T,n as _,I as h,h as V,t as f,W as D,r as se,B as te,Y as ae,N as ie,j as g,M as oe,_ as le}from"./index-BaBzPc_n.js";import{A as ne}from"./AppPullRefresh-BiENK1qu.js";import{S as re}from"./SectionHead-DACJGM0a.js";import{R as de}from"./RateStrip-BUaLzdhv.js";import{p as ce}from"./filters-C7vyx8aF.js";import{u as ue}from"./useReveal-DqwhC5ep.js";import{D as ve}from"./index-BET06VfC.js";import"./KeyCode-CKxX-ked.js";import"./classCallCheck-CVMl89dr.js";import"./raf-nDFcuFT6.js";const fe="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",pe={class:"dash"},_e={class:"dash__bar"},he={class:"dash__barInner"},me={key:1,class:"dash__barSpacer","aria-hidden":"true"},ye={class:"dash__profileNudgeIcon","aria-hidden":"true"},ge={class:"dash__balanceHead"},be={class:"dash__eyebrow"},xe={class:"dash__figure"},ke={class:"dash__balanceRow"},we={class:"dash__rowValue"},Ce={class:"dash__identity"},Ee={class:"dash__name"},Se={class:"dash__mobile"},Ie={class:"dash__inviteIcon","aria-hidden":"true"},De={class:"dash__inviteCopy"},Fe={class:"dash__inviteIcon","aria-hidden":"true"},Le={class:"dash__access"},Ne=["onClick"],Ae={class:"dash__tileIcon","aria-hidden":"true"},Oe={class:"dash__tileTitle"},Be={class:"dash__tileArrow","aria-hidden":"true"},Te=["src"],Ve=["src"],Me={class:"p-8 text-justify"},Pe={class:"dash__choice"},Re=X({__name:"DashboardView",setup($e){const o=ie(),r=Y(),b=J(),n=y(b.peek(O.profile)??null),m=y(!1),F=y(b.peek(O.goldPrice)??null),C=y(!1),E=g(()=>n.value?parseFloat(n.value.goldDebtGrams)>0:!1),M=g(()=>E.value?"بدهکار گرمی":"بستانکار گرمی"),P=g(()=>n.value?Math.abs(parseFloat(n.value.goldDebtGrams)):0),x=g(()=>{var e;const t=(e=n.value)==null?void 0:e.verificationStep;return!!t&&t!=="VERIFIED"&&t!=="STEP_TWO_SUBMITTED"}),u=ee({notify:!1,loginNotify:!1}),R=[{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},{id:8,icon:"vuesax-linear:3d-cube-scan",title:"سفارش ساخت",tone:"rose",disabled:!1}],$=[{id:4,icon:"vuesax-linear:box-tick",title:"سفارش مشتریان",tone:"forest",disabled:!1},{id:5,icon:"vuesax-linear:profile-2user",title:"مشتریان من",tone:"sand",disabled:!1}],z={id:7,icon:"vuesax-linear:brush",title:"ظاهر",tone:"ink",disabled:!1},U=g(()=>[...R,...r.isSalesExpert?$:[],z]);function q(t){if(t===7){o.push({name:"appearanceSettings"});return}if(!r.isLoggedIn){u.loginNotify=!0;return}t===0&&o.push({name:"ordersList"}),t===1&&o.push({name:"transactionsList"}),t===2&&o.push({name:"profileData"}),t===3&&o.push({name:"favoritesList"}),t===4&&o.push({name:"ChildOrder"}),t===5&&o.push({name:"customerChoice"}),t===6&&o.push({name:"report"}),t===8&&(k.value=!0)}const k=y(!1);function L(t){k.value=!1,o.push({name:t})}async function H(){u.notify=!1;try{await S.endSharedSession()}catch{}let t=null;try{t=(await S.ssoLogoutUrl()).logout_url}catch{t=null}if(r.logout(),sessionStorage.removeItem("gb_iam_sso_checked"),t){window.location.assign(t);return}o.push({name:"home"})}async function w(){m.value=!1;const[t,e]=await Promise.allSettled([r.isLoggedIn?b.me({force:!0}):Promise.resolve(null),b.goldPrice({force:!0})]);t.status==="fulfilled"?(n.value=t.value,m.value=!1):(m.value=r.isLoggedIn&&!n.value,console.log(t.reason)),F.value=e.status==="fulfilled"?e.value:null}async function j(){try{await w()}finally{C.value=!1}}async function N(){if(r.isLoggedIn)try{const t=await S.getExpertIdentity();r.setSalesExpert(t.isSalesExpert)}catch{}}let A=!1;Q(()=>{A&&(w(),N()),A=!0});const{revealed:G,revealDelay:p,reveal:K}=ue("dashboard");return Z(async()=>{N(),await w(),K()}),(t,e)=>{const W=oe("container");return c(),d("div",pe,[s("header",_e,[s("div",he,[e[12]||(e[12]=s("span",{class:"dash__barSpacer","aria-hidden":"true"},null,-1)),e[13]||(e[13]=s("h1",{class:"dash__barTitle"},"میز کار",-1)),i(r).isLoggedIn?(c(),d("button",{key:0,type:"button",class:"dash__barBtn","aria-label":"خروج",onClick:e[0]||(e[0]=a=>u.notify=!0)},[l(h,{icon:"vuesax-linear:logout",size:"19"})])):(c(),d("span",me))])]),l(ne,{modelValue:C.value,"onUpdate:modelValue":e[3]||(e[3]=a=>C.value=a),onRefresh:j},{default:v(()=>[l(W,{class:I(["dash__body",{"is-revealed":i(G)}])},{default:v(()=>[i(r).isLoggedIn&&n.value?(c(),d(T,{key:0},[x.value?(c(),d("section",{key:0,class:"dash__profileNudge reveal",style:_(i(p)(0))},[s("div",ye,[l(h,{icon:"vuesax-linear:info-circle",size:"16"})]),e[14]||(e[14]=s("div",{class:"dash__profileNudgeCopy"},[s("h3",null,"پروفایل شما تکمیل نشده است"),s("p",null,"برای ادامه، مدارک پروفایل را بارگذاری کنید.")],-1)),s("button",{type:"button",class:"dash__profileNudgeCta",onClick:e[1]||(e[1]=a=>i(o).push({name:"completeProfile"}))}," تکمیل پروفایل ")],4)):V("",!0),s("section",{class:"dash__balance reveal",style:_(i(p)(x.value?1:0))},[s("div",ge,[s("div",null,[s("div",be,f(M.value),1),s("div",xe,[D(f(P.value)+" ",1),e[15]||(e[15]=s("span",{class:"dash__unit"},"گرم",-1))])]),s("span",{class:I(["dash__seal",E.value?"is-debtor":"is-creditor"])},f(E.value?"بدهکار":"بستانکار"),3)]),s("div",ke,[e[17]||(e[17]=s("span",{class:"dash__rowLabel"},"بدهی ریالی",-1)),s("span",we,[D(f(i(ce)(n.value.fiatDebtRial))+" ",1),e[16]||(e[16]=s("i",null,"ریال",-1))])]),s("div",Ce,[s("span",Ee,f(n.value.fullName),1),s("span",Se,f(i(r).mobile),1)])],4)],64)):i(r).isLoggedIn?(c(),d("section",{key:1,class:"dash__invite reveal",style:_(i(p)(0))},[s("div",Ie,[l(h,{icon:"vuesax-linear:security-user",size:"20"})]),s("div",De,[e[18]||(e[18]=s("h3",null,"حساب شما",-1)),s("p",null,f(m.value?"موجودی الان در دسترس نیست. دوباره تلاش کنید.":"در حال دریافت موجودی…"),1)]),m.value?(c(),d("button",{key:0,type:"button",class:"dash__inviteCta",onClick:w}," تلاش دوباره ")):V("",!0)],4)):(c(),d("section",{key:2,class:"dash__invite reveal",style:_(i(p)(0))},[s("div",Fe,[l(h,{icon:"vuesax-linear:security-user",size:"20"})]),e[19]||(e[19]=s("div",{class:"dash__inviteCopy"},[s("h3",null,"حساب گرمی شما"),s("p",null,"برای دیدن موجودی، سفارش‌ها و اسناد خود وارد شوید.")],-1)),s("button",{type:"button",class:"dash__inviteCta",onClick:e[2]||(e[2]=a=>i(o).push({name:"login"}))}," ورود / ثبت‌نام ")],4)),s("section",{class:"dash__section reveal",style:_(i(p)(n.value&&x.value?2:1))},[s("div",Le,[(c(!0),d(T,null,se(U.value,a=>(c(),d("button",{key:a.id,type:"button",class:I(["dash__tile",[`is-${a.tone}`,{"is-disabled":a.disabled}]]),onClick:ze=>q(a.id)},[s("span",Ae,[l(h,{icon:a.icon,size:"21"},null,8,["icon"])]),s("span",Oe,f(a.title),1),s("span",Be,[l(h,{icon:"vuesax-linear:arrow-left-2",size:"14"})])],10,Ne))),128))])],4),s("section",{class:"dash__section reveal",style:_(i(p)(n.value&&x.value?3:2))},[l(re,{title:"نرخ روز",subtitle:"آخرین نرخ اعلام‌شده"}),l(de,{quote:F.value},null,8,["quote"])],4)]),_:1},8,["class"])]),_:1},8,["modelValue"]),l(B,{timeOut:-1,show:u.notify,"onUpdate:show":e[5]||(e[5]=a=>u.notify=a),closeOnClickOverlay:!0},{img:v(()=>[s("img",{src:i(fe),alt:""},null,8,Te)]),title:v(()=>[...e[20]||(e[20]=[D("آیا می خواهید از برنامه خارج شوید؟",-1)])]),button:v(()=>[s("div",{class:"text-center text-[color:var(--c-primary)]",onClick:H},"بله"),s("div",{class:"text-center text-[color:var(--c-inkMuted)]",onClick:e[4]||(e[4]=a=>u.notify=!1)},"بی خیال")]),_:1},8,["show"]),l(B,{timeOut:-1,show:u.loginNotify,"onUpdate:show":e[8]||(e[8]=a=>u.loginNotify=a),closeOnClickOverlay:!0},{img:v(()=>[s("img",{src:i(ae),alt:""},null,8,Ve)]),title:v(()=>[s("div",Me," برای دسترسی به تمامی امکانات نرم افزار "+f(i(te).name)+"، ابتدا گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید. ",1)]),button:v(()=>[s("div",{class:"text-center text-[color:var(--c-primary)]",onClick:e[6]||(e[6]=a=>i(o).push({name:"login"}))},"ورود/ثبت نام"),s("div",{class:"text-center text-danger",onClick:e[7]||(e[7]=a=>u.loginNotify=!1)},"بیخیال")]),_:1},8,["show"]),l(i(ve),{visible:k.value,"onUpdate:visible":e[11]||(e[11]=a=>k.value=a),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:v(()=>[s("div",Pe,[s("button",{type:"button",class:"dash__choiceBtn",onClick:e[9]||(e[9]=a=>L("makeOrderList"))},"ثبت سفارش"),s("button",{type:"button",class:"dash__choiceBtn is-quiet",onClick:e[10]||(e[10]=a=>L("makeOrderStatus"))},"مشاهده سفارش")])]),_:1},8,["visible"])])}}}),Qe=le(Re,[["__scopeId","data-v-8e4889b3"]]);export{Qe as default};