@zeniai/web-app-ui 5.1.76-prod → 5.1.77-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-DgtM3nxS.js +1 -0
- package/dist/assets/AddressScreen-BNnoxI42.js +9 -0
- package/dist/assets/AiCfoScreen-CfF5p-2L.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-DZPEV8jE.js +1 -0
- package/dist/assets/BillPayRoutes-Cj3rPF7j.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen--z9oIuUu.js +9 -0
- package/dist/assets/CardsAiCfoScreen-DNag4rPx.js +14 -0
- package/dist/assets/ChargeCardRoutes-BD5wy1XM.js +71 -0
- package/dist/assets/{CompanyPassportScreen-BLsZ8Uuy.js → CompanyPassportScreen-bzkzFMdg.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-Dfi17Hh2.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DClXD2_x.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-Cv0uxL5k.js +30 -0
- package/dist/assets/{DashboardRoutes-Xszs783p.js → DashboardRoutes-Dveel7PM.js} +4 -4
- package/dist/assets/DefaultTenantHome-BtVpxYc1.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-lYOXV3jg.js +18 -0
- package/dist/assets/DrawerScreen-Bn7fJuoP.js +1 -0
- package/dist/assets/EntityDetailRoutes-DG2HbUDs.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-C_cBFDYx.js +25 -0
- package/dist/assets/FeaturePreviewScreen-WDFKDhR6.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-dpBPyj0d.js +1 -0
- package/dist/assets/{MagicLinkRoutes-DuELPviL.js → MagicLinkRoutes-D0IIGCiK.js} +20 -20
- package/dist/assets/MagicLinkSignInScreen-YW9ZqePv.js +12 -0
- package/dist/assets/MobileAppDrawer-eFjjhgJh.js +1 -0
- package/dist/assets/NotFoundScreen-6qASDiQT.js +1 -0
- package/dist/assets/{NotificationRoutes-CJQORxml.js → NotificationRoutes-CMH_9nag.js} +1 -1
- package/dist/assets/OAuthConsentScreen-CJxsBNoU.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DFI-6LXP.js +1 -0
- package/dist/assets/PeopleRoutes-CQe5mT0Q.js +22 -0
- package/dist/assets/PerformanceRoutes-C2kO5CvR.js +1 -0
- package/dist/assets/{Preview-Cw7jL1Lj.js → Preview-C-vmj6G_.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-YQRuxVuF.js → QBOConnectionScreen-VPR245Vs.js} +1 -1
- package/dist/assets/ReferralListScreen-DuTA8ZNx.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-DKDcC83F.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-C7g9vUNM.js +1 -0
- package/dist/assets/ReimbursementRoutes-DT6ULuDS.js +68 -0
- package/dist/assets/ReportsRoutes-UEATkQRA.js +1 -0
- package/dist/assets/RewardsRoutes-CDs_o_bR.js +1 -0
- package/dist/assets/ScreenRoutes-7YrD1RCk.js +2 -0
- package/dist/assets/SettingsRoutes-BILGacxq.js +57 -0
- package/dist/assets/SetupPagesScreen-BMNyy9c9.js +29 -0
- package/dist/assets/SignInScreen-CmRE9PCe.js +1 -0
- package/dist/assets/SignOutScreen-DRSiKmWQ.js +9 -0
- package/dist/assets/TaskListScreen-svrYmHZ7.js +9 -0
- package/dist/assets/TaskRoutes-Dn0uto0H.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CB__3R_j.js +1 -0
- package/dist/assets/{TransactionDetailScreen-DY5IcfRV.js → TransactionDetailScreen-DxYq4JVW.js} +2 -2
- package/dist/assets/TransactionListRoutes-0JWLB9MV.js +1 -0
- package/dist/assets/TreasuryRoutes-C7KBazk5.js +37 -0
- package/dist/assets/{VendorsRoutes-BnxlBevs.js → VendorsRoutes-vdMn6WBc.js} +19 -19
- package/dist/assets/WiseConfirmationScreen-DLbtxnuL.js +12 -0
- package/dist/assets/ZeniAccountRoutes-C9zOReRG.js +73 -0
- package/dist/assets/ZeniAccountStatementScreen-DW7NA-BZ.js +9 -0
- package/dist/assets/{accountMappingHelper-C2f8hGo7.js → accountMappingHelper-talErUKy.js} +1 -1
- package/dist/assets/{analytics-BYlEHy--.js → analytics-ChMmdjNV.js} +1 -1
- package/dist/assets/{analyticsHelper-Cw9lxNal.js → analyticsHelper-D_xPTvv0.js} +1 -1
- package/dist/assets/{core-CvVQwh-G.js → core-BoNEfvLs.js} +5 -5
- package/dist/assets/{decodeURIComponentSafe-C_ttRntx.js → decodeURIComponentSafe-v7XwPgPo.js} +1 -1
- package/dist/assets/dnd-DvJtEb2B.js +6 -0
- package/dist/assets/{empty-CqdRwXT0.js → empty-b5TFvQkm.js} +1 -1
- package/dist/assets/{index-iPhf2_13.js → empty-dNqnyFZ3.js} +1 -1
- package/dist/assets/{emptyVideoElement-C5q-nSLE.js → emptyVideoElement-CHUUTLZE.js} +1 -1
- package/dist/assets/epic-DBs37iOr.js +2 -0
- package/dist/assets/{getLocaleForTenant-BKpCR6Mg.js → getLocaleForTenant-DOJkec7u.js} +1 -1
- package/dist/assets/{index-LzTRB_X0.js → index-BTYYfZaH.js} +34161 -28660
- package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
- package/dist/assets/index-BvFLIInY.js +1 -0
- package/dist/assets/{index-CyWCR990.js → index-CJO1bhSt.js} +2 -2
- package/dist/assets/index-DM4yT559.js +1 -0
- package/dist/assets/{index-H3w7aQmk.js → index-DcWwIWd7.js} +1 -1
- package/dist/assets/{index-DkXdrecr.js → index-HOeFcz85.js} +1 -1
- package/dist/assets/{index-CBYzZDpo.js → index-VwB1TFIZ.js} +1 -1
- package/dist/assets/{index-CFH22x4t.js → index-drCPF-LE.js} +1 -1
- package/dist/assets/{lexical-DEMTOP18.js → lexical-D_KbwLmW.js} +1 -1
- package/dist/assets/{liveblocks-OUACL7Sm.js → liveblocks-CsaY8yYO.js} +1 -1
- package/dist/assets/{lottie-CtoJzpCG.js → lottie-DbDVmnvZ.js} +1 -1
- package/dist/assets/{mui-B_sWk5no.js → mui-CblpH0Ha.js} +1 -1
- package/dist/assets/{pathToGoBack-CJrDL_Y4.js → pathToGoBack-j1V7r3Mn.js} +1 -1
- package/dist/assets/{pdf-Bd_BBdKz.js → pdf-D2egRSjc.js} +3 -3
- package/dist/assets/{pdf-lib-B6zbzfIK.js → pdf-lib-DMbxzmyG.js} +1 -1
- package/dist/assets/{plaid-BeX18ubU.js → plaid-74upgTWR.js} +1 -1
- package/dist/assets/{pusher-aLhruJgZ.js → pusher-CjiDlk8e.js} +1 -1
- package/dist/assets/{react-BGSmuuzy.js → react-B9xrzEYj.js} +1 -1
- package/dist/assets/{react-BvotTNj-.js → react-Bdgrv6d7.js} +1 -1
- package/dist/assets/{react-zqzsPGgA.js → react-Dvg14ilb.js} +1 -1
- package/dist/assets/{react-T1MP5N4W.js → react-lDmXKsDH.js} +1 -1
- package/dist/assets/{react-D3Ygj9wO.js → react-otWFcO3Y.js} +1 -1
- package/dist/assets/{react-CVqp8PAx.js → react-sFkWW8vV.js} +1 -1
- package/dist/assets/{recharts-ScPc1hFQ.js → recharts-NoTYHO1X.js} +3 -3
- package/dist/assets/{routePaths-CCOmiobh.js → routePaths-DxhKVAQu.js} +1 -1
- package/dist/assets/{sentry-COtwFETz.js → sentry-BUYxAJ0R.js} +1 -1
- package/dist/assets/{url-sMzMgETT.js → url-5YtRx5NC.js} +1 -1
- package/dist/assets/{url-DgoPdzhF.js → url-SyvMap6d.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BWYRRRl-.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-CBG7z3tT.js +1 -0
- package/dist/assets/useCashManagementBanner-DO-traME.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-C5IaHrcj.js +1 -0
- package/dist/assets/{useDeviceId-FKP5CkBV.js → useDeviceId-LzGT5z98.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BOI-L6Xh.js +1 -0
- package/dist/assets/useInitialThreadRequest-BoQP-jON.js +1 -0
- package/dist/assets/{utils-B-68Nh7i.js → utils-D-CJm-xs.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-CNv0kM7W.js → withTransactionSidePanel-IQKxlXVX.js} +4 -4
- package/dist/assets/zeni-epic-state-DcOrwCh7.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +6 -6
- package/dist/assets/AddressRoutes-CQEm5psH.js +0 -1
- package/dist/assets/AddressScreen-DLTJPBtB.js +0 -9
- package/dist/assets/AiCfoScreen-CIW6Rkrd.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-BvMuz4fH.js +0 -1
- package/dist/assets/BillPayRoutes-DCoEJWAC.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-BXKB7X5s.js +0 -9
- package/dist/assets/ChargeCardRoutes-CSwlWrZ1.js +0 -71
- package/dist/assets/ConnectionAuthScreen-B13ytSR6.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-bHMRpQpq.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-Bb0R8e9B.js +0 -23
- package/dist/assets/DefaultTenantHome-Ckgm6fYm.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-R5H3Lj3F.js +0 -18
- package/dist/assets/DrawerScreen-C1-3TQnN.js +0 -1
- package/dist/assets/EntityDetailRoutes-BklwOWcC.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-CkJkhfFq.js +0 -25
- package/dist/assets/FeaturePreviewScreen-DeAByMab.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-tj9Ftuv9.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CRn0-bwq.js +0 -12
- package/dist/assets/MobileAppDrawer-C6MRZ7yW.js +0 -1
- package/dist/assets/NotFoundScreen-BXgaohYF.js +0 -1
- package/dist/assets/OAuthConsentScreen-BBkfTgiS.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DC7TR9_4.js +0 -1
- package/dist/assets/PeopleRoutes-csHlQp5o.js +0 -22
- package/dist/assets/PerformanceRoutes-BzTXPXqo.js +0 -1
- package/dist/assets/ReferralListScreen-jCzCZDWf.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-YTWZ_f_x.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DqNByTW4.js +0 -1
- package/dist/assets/ReimbursementRoutes-CKT5CdX2.js +0 -68
- package/dist/assets/ReportsRoutes-BBHE4Oo-.js +0 -1
- package/dist/assets/RewardsRoutes-BuxVlZVs.js +0 -1
- package/dist/assets/ScreenRoutes-CGfFu7WV.js +0 -2
- package/dist/assets/SettingsRoutes-CZbvgGLZ.js +0 -57
- package/dist/assets/SetupPagesScreen-DhoJ2EKU.js +0 -29
- package/dist/assets/SignInScreen-C8GQD2TL.js +0 -1
- package/dist/assets/SignOutScreen-BDPFv8fh.js +0 -9
- package/dist/assets/TaskListScreen-BAOvGtza.js +0 -9
- package/dist/assets/TaskRoutes-BO5cvZoD.js +0 -9
- package/dist/assets/TransactionDetailRoutes-7L3zeSND.js +0 -1
- package/dist/assets/TransactionListRoutes-Bgj6-3fA.js +0 -1
- package/dist/assets/TreasuryRoutes-BVhGqN6W.js +0 -37
- package/dist/assets/WiseConfirmationScreen-CnaVF5HH.js +0 -12
- package/dist/assets/ZeniAccountRoutes-DNooyVe8.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-CyycwdN8.js +0 -9
- package/dist/assets/dnd-DNR-B7xM.js +0 -6
- package/dist/assets/empty-BINoIGGW.js +0 -1
- package/dist/assets/epic-C5jlPncF.js +0 -2
- package/dist/assets/index-6ei8cz0C.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CP6mqvu5.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CT6wQzQG.js +0 -1
- package/dist/assets/useInitialThreadRequest-BRMmNSgV.js +0 -1
- package/dist/assets/zeni-epic-state-CECAZYIg.js +0 -13
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-OUACL7Sm.js";import{h as me,i as Aa,u as Ce,j as y,g as Ie,n as fe,N as Sa,s as Vt,o as Un,p as se}from"./core-CvVQwh-G.js";import{eS as ie,bt as He,PO as Na,e$ as Ee,f0 as Ae,f1 as ke,fW as Je,cr as ea,PP as aa,PQ as ut,tT as Ra,jR as Ua,PR as Oa,gW as ba,Aw as da,Ay as Ve,Az as mt,jH as Ht,PS as ta,Ak as ya,PT as On,PU as jn,An as Ma,PV as Vn,Oc as $a,s3 as Nt,At as ca,h5 as Hn,PW as Mt,PX as na,bo as Nn,PY as Mn,fH as Ga,fG as za,B1 as $n,fF as Qa,NU as Gn,PZ as $t,ck as Gt,cL as zn,Ob as ka,BD as zt,P_ as Ft,Bd as Ia,P$ as Qt,BE as Qn,OD as Yn,BF as Zn,Cz as Kn,td as Wn,Ct as qn,Q0 as Xn,Ax as We,Q1 as Jn,Q2 as er,Q3 as ar,Q4 as tr,Q5 as nr,Q6 as Ct,Q7 as rr,AO as Yt,AH as sr,Q8 as cr,fY as or,AX as Zt,A$ as Kt,fX as ir,Q9 as dr,Bp as Wt,Qa as lr,Qb as ur,Qc as mr,AZ as qt,AK as Xt,Aq as Jt,AT as en,AR as an,AV as Cr,Qd as tn,Qe as Ya,Ba as Ea,KT as nn,cN as pt,Qf as pr,Qg as hr,Qh as fr,Qi as gr,B7 as ct,Bw as br,Bs as yr,B3 as Sr,Bu as Ir,Bk as Er,Bm as Ar,Qj as rn,BC as La,Ig as kr,Qk as _r,Ql as Dr,Qm as wr,Qn as sn,Qo as Pr,BZ as vr,Bc as cn,B6 as Pe,Bb as Tr,Qp as Fr,Qq as Br,Ah as xr,Qr as on,Qs as dn,Qt as Lr,Aj as Rr,Ai as Bt,Qu as Ur,Qv as Or,Qw as jr,KP as Vr,Qx as ht,Qy as Hr,wU as ln,kp as Nr,gX as Mr,C2 as $r,Qz as un,QA as Gr,C3 as zr,QB as Qr,df as Yr,tN as Zr,BU as Kr,BO as je,bs as Wr,bF as qr,cw as Xr,bG as Jr,K0 as es}from"./zeni-epic-state-CECAZYIg.js";import{z as ae,I as Me,a as oe,G as Y,B as _a,c4 as Za,cf as as,cg as ts,ch as ns,p as Ue,ci as rs,cj as ss,X as Da,aN as Re,q as Se,bo as ft,ck as cs,w as wa,j as Ka,m as gt,d as q,D as bt,a8 as Wa,cl as os,$ as mn,aq as yt,bA as oa,cm as ot,cn as is,s as St,co as ds,at as Cn,a3 as it,Y as pn,f as hn,cp as ls,cq as us,cr as ms,cs as Cs,ct as ps,cu as hs,o as ja,cv as fs,cw as gs,cx as tt,K as bs,cy as ys,cz as Ss,cA as Is,cB as Es,cC as As,i as ks}from"./index-LzTRB_X0.js";import{n as ve,D as fn,S as _s}from"./mui-B_sWk5no.js";import{a as d}from"./sentry-COtwFETz.js";import{g as he,a as Pa,b as gn,c as _e,d as De,e as Ne,f as $e,h as Ge,A as Ds,i as It,P as ws,j as Et,s as ia,k as bn,l as qe,m as yn,n as Ps,o as Sn,p as vs,S as xt}from"./SetupPagesScreen-DhoJ2EKU.js";import{u as In}from"./useInitialThreadRequest-BRMmNSgV.js";import qa from"./NotFoundScreen-BXgaohYF.js";import{M as Xe}from"./MobileAppDrawer-C6MRZ7yW.js";import{u as En}from"./useAskAiCfoHostNavButtonProps-CT6wQzQG.js";import{v as Lt}from"./utils-B-68Nh7i.js";import{d as Ts}from"./recharts-ScPc1hFQ.js";import{t as Fs}from"./AddressScreen-DLTJPBtB.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./analyticsHelper-Cw9lxNal.js";import"./routePaths-CCOmiobh.js";import"./BusinessVerificationPageScreen-BXKB7X5s.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="826904e9-1137-49cb-b33c-5e1f24a9e1c5",e._sentryDebugIdIdentifier="sentry-dbid-826904e9-1137-49cb-b33c-5e1f24a9e1c5")}catch{}})();function Bs(){const e=me(),{cardId:a}=Aa(),t=Ce(),r=ae.getSignedInUser(),n=y(Z=>ie(Z)),f=Me(),h=He(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[D,c]=d.useState(!1),l=y(Z=>Na(Z).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=g(Y.isChargeCardFeatureEnabled),m=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=g(Y.isDebitCardFeatureEnabled),B=Ee(n),F=Ae(n),u=ke(R,n),p=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=_e({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:u}),o=De({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:S,isBookKeepingTenant:F,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:p}),P=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,E=y(Z=>Je(Z,n.companyId)),O=ea(E.controllers),{creditAccount:I,creditAccountRepayment:b}=y(Z=>aa(Z)),x=y(Z=>Z.classListState.fetchState),i=!v&&o&&m,C=y(Z=>ut(Z,a,i,o)),[j,M]=d.useState(!1),L=C.chargeCard,T=L?.cardCreatedByUser?.userId,$=y(Z=>T!=null?Ra(Z.userRoleState,T):void 0),Q=$?.accountingClassIDs[0],H=y(Z=>Q!=null?Ua(Z.classState,{classId:Q,reportId:"class_list"}):void 0),A=L?.cardHolderUser?.userId,G=y(Z=>A!=null?Ra(Z.userRoleState,A):void 0),W=G?.accountingClassIDs[0],k=y(Z=>W!=null?Ua(Z.classState,{classId:W,reportId:"class_list"}):void 0),U=L?.type.code==="business_physical_credit_card"||L?.type.code==="business_physical_debit_card",ne=L?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&D===!1&&U&&(c(!0),setTimeout(()=>{t(Oa()),ne&&t(ba({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,D,U,ne]),d.useEffect(()=>{j||C.fetchState==="Completed"||C.fetchState==="In-Progress"||a==null||(M(!0),t(da(a,i,!1)))},[j,C,a,t]),d.useEffect(()=>{if(C.fetchState==="Completed"&&(U===!1||U&&L?.status?.code!=="active"||L?.cardHolderUserId!==r.userId||l===!1&&D===!1||L?.type.code==="business_physical_debit_card"||L?.type.code==="business_virtual_debit_card")){const Z=he(n.tenantEmailDomain,a,r,L,l);e(Z)}},[C.fetchState,l,U]),d.useEffect(()=>{I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&o&&m&&h&&t(Ve()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&m&&h&&t(mt()),x!=="Completed"&&x!=="In-Progress"&&t(Ht())},[I.fetchState,b.fetchState,t,o,m,h,x]);const J=()=>{if(r!=null&&a!=null){t(Oa());const Z=he(n.tenantEmailDomain,a,r);e(Z)}},_=L?.type.code==="business_physical_debit_card"||L?.type.code==="business_virtual_debit_card",z=Ne(o,w,P,m),X=Pa(o,m,h,I,b),ee=gn(_,C);return C.fetchState!=="Completed"?s.jsx(_a,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Za,{showConfetti:l}),s.jsx(as,{onGotItClick:J,isDebitCard:L?.type.code==="business_physical_debit_card",controllerEmails:O,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:P,isChargeCardSetupEnabled:m,productInformation:z,creditAccountInformation:X,debitAccountInformation:ee,chargeCardDetailView:C,creditAccount:I,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:H?.className,cardHolderRoles:G?.userRoles,cardHolderDepartmentName:k?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=ts(),f=d.useRef(t),h=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{h.current=r},[r]);const D=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(h.current==null)return;const S=Date.now();S-g.current<5e3||(g.current=S,h.current())};return a.forEach(S=>{const[m,R]=ns(S);if(R==="")return;const B=n.channel(m),F=p=>{f.current(R,p)};let u;if(B?.subscribed===!0)u=B,u.bind(R,F),l.has(m)||(l.add(m),v()),c.push(()=>{B.unbind(R,F)});else{if(u=B??n.subscribe(m),u.bind(R,F),!l.has(m)){l.add(m);const p=()=>{v()};u.bind("pusher:subscription_succeeded",p),c.push(()=>{u.unbind("pusher:subscription_succeeded",p)})}c.push(()=>{u.unbind(R,F)})}}),()=>{c.forEach(S=>S())}},[n,D])},An="charge-card-transaction-update",kn="charge-card-transaction-created",_n="charge-card-transaction-declined",Dn="charge-card-transaction-updated",wn="charge-card-transaction-receipt-uploaded",ra="charge-card-status-update",kt="charge-card-spending-updated",Xa="credit-account-balance-updated",Ja="charge-card-created",_t="charge-card-limit-updated",Dt="charge-card-limit-reset",wt="charge-card-renamed",xs="charge-card-department-updated",Pn="charge-card-repayment-completed",vn="charge-card-payment-date-updated",va="charge-card-cashback-redeemed",Ta="charge-card-cashback-earned",sa=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),Ls=[Ta,va],Rs=fe(function(e){const a=ta(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(On({uiState:{sortKey:a,sortOrder:t}}))}}})(ss);function Us(){const e=me(),a=Ce(),t=Ie(),r=ae.getSignedInUser(),n=y(R=>ie(R)),{useFeatureGate:f}=oe(),{isFeatureEnabled:h}=f(Y.isCardsCommentingEnabled),[g,D]=d.useState(!1),c=y(R=>ta(R)),l=In(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const R=Ue(t.state?.pathnameStackToGoBack),B=R.poppedPathname??Os(n.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:R.newStack}})},[e,t,n.tenantEmailDomain]),S=$e(n);if(At({events:sa(S,Ls),onEvent:R=>{switch(R){case Ta:case va:return void a(ya(!0))}},onSubscribed:()=>{a(ya(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(D(!0),a(ya()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const m=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||m?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(qa,{}):s.jsx(Rs,{onBackClick:v,isCardsCommentingEnabled:h,initialOpenThreadRequest:l}):s.jsx(rs,{onBackClick:v})}const Os=e=>`/${e}/cards`,js={containerWidth:new wa(100,58)},Vs=({appContent:e})=>{const a=Da(),t=Ce(),r=me(),{cardId:n}=Aa(),f=Ie(),{useDynamicConfig:h}=oe(),[g,D]=d.useState(!1),[c,l]=d.useState(!1),[v,S]=d.useState(!1),[m,R]=d.useState(!1),B=ae.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const F=y(k=>ie(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=h(Re.zeniCardsConfig),p=u.max_charge_card_activation_attempts_by_card_id,w=y(k=>jn(k,n)),o=w.chargeCard,P=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:E}=oe(),{isFeatureEnabled:O}=E(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=E(Y.isDebitCardFeatureEnabled),b=ke(I,F),x=_e({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:b}),i=!!F.companyChargeCardInfo?.info?.isChargeCardEnabled,C=F.userRole.includes("charge_card_user"),j=Ee(F),M=Ae(F),L=F.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=De({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:O,isBookKeepingTenant:M,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:L}),$=!C&&T&&i;d.useEffect(()=>{g===!1&&P!=="In-Progress"&&P!=="Completed"&&(t(Ma()),D(!0)),c===!1&&w.fetchState==="Not-Started"&&(l(!0),t(da(n,$,T)))},[c,w.fetchState,g,P]);const Q=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(w.fetchState==="Completed"){if(v===!1&&(Q===!1||Q&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==B.userId)){const k=he(F.tenantEmailDomain,n,B,o,!0),U=Se(f.state?.pathnameStackToGoBack,f.pathname);r(k,{state:{pathnameStackToGoBack:U}})}else if(v&&w.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(Vn({chargeCardId:n}));const k=he(F.tenantEmailDomain,n,B,o,!0),U=Se(f.state?.pathnameStackToGoBack,f.pathname);t($a()),r(k,{state:{pathnameStackToGoBack:U}})}}},[w.fetchState,o?.type.code,v,w.isRefreshingViewInBackground]);const H=ae.getZeniOtpTokenForCardHolder(n),A=y(k=>Nt(k.userState,B.userId)),G=()=>{o?.status?.code!=="active"&&t(ca(n,!0))};d.useEffect(()=>{w.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&v===!1&&(setTimeout(G,3e3),S(!0))},[w.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const W=k=>{R(k)};if(P!=="Completed"||o==null)return s.jsx(_a,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(A?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Ms,{children:[s.jsx(Xe,{isAppContentDrawerOpen:m,handleDrawerToggle:W}),s.jsx(Hs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:A.phone,signedInUser:B,isSandboxEnv:ft(),chargeCardDetailState:w,signedInUserToken:H,navigate:r,currentTenant:F,location:f,maxChargeCardActivationAttempts:p[n]!=null?p[n]:u.default_max_charge_card_activation_attempts!=null?u.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Ns,{windowSize:a,children:e}):null]})},Hs=fe(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Hn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const h=Mt(e,n),g=a.updateStatus,D=na(e,!1,!1,!1);let c=!1;D.fetchState==="Completed"&&D.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Nn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Ka.cardVaultId,twoFAView:h,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:h}=a,g=h.chargeCard?.cardProviderID,{tenantEmailDomain:D}=f;return{onGetOtp:c=>{g!=null&&e(Qa(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e($n(r,c))},onResendOtp:c=>{g!=null&&e(za(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ga(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ae.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Mn({chargeCardId:r}))},onBackClick:()=>{const c=Ue(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?Ge(D):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(cs),Ns=ve.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: ${e=>`${js.containerWidth.value(e.windowSize)}%`};
|
|
5
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
-
`,Ms=ve.div`
|
|
7
|
-
display: flex;
|
|
8
|
-
min-height: 100%;
|
|
9
|
-
width: 100%;
|
|
10
|
-
flex: 1 1 auto;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
align-items: center;
|
|
13
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
14
|
-
`,Va=bt.getLocalizedStrings().dateFormat,$s={overlayWidth:new wa(100,100,58)},Tn=[Pn,Xa],Gs=new Set(Tn),zs=fe(function(e,a){const t=a.currentTenant?.companyId;return{plaidConnectionDetails:Yn(e,t,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Zn(e.depositAccountState,e.depositAccountListState)}},function(e,a){const{navigate:t,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:f,isCashbackInfoFetchStateCompleted:h,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:D,controllerEmails:c,paymentDetails:l,productInformation:v,cashbackInformation:S,paymentSourceInformation:m,creditAccountInformation:R,debitAccountInformation:B,paymentInitiatedDate:F,sourcePage:u}=a,{tenantEmailDomain:p}=r,w=()=>{e(zt(!0));const o=$e(r);o!=null&&o!==""&&e(Ia(o,!0,!0)),e(Ve(!0))};return{onBackNavigation:()=>{if(h&&g&&D&&S!=null&&q.trackCardsPayEarlyFormClick(c,v,S,"Back",l.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:l.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:l.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:l.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:l.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:F?.add(3,"day").format(Va.visual.MMMDCommaYYYYformat),paymentInitiatedDate:F?.format(Va.visual.MMMDCommaYYYYformat)},m,R,B),u==="cardPaymentHistory")a.closeDrawerHandler(!0),e(Qt());else{const o=Ge(p);t(o)}},onUpdatePaymentAccountStatus:(o,P,E)=>{e(qn(o,P,"bill_pay","bill_pay_detail",E))},onEstablishConnectionSuccess:()=>{e(Ia(r.companyId,!0))},onFetchLinkTokenClick:o=>{e(Wn("external_account",o))},onEstablishConnectionClick:o=>{e(Kn(o,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${p}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{f?window.open(`/${p}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onEventReceived:o=>{Gs.has(o)&&w()},onPusherSubscribed:w}})(Wa(os)),Pt=({isPaymentDrawerOpen:e,closeDrawerHandler:a,pageName:t,creditAccountSpentAmount:r,productInformation:n,sourcePage:f,creditAccountInformation:h,debitAccountInformation:g,cashbackInformation:D,isDebitCardInfoFetchStateCompleted:c,isCreditCardInfoFetchStateCompleted:l,isCashbackInfoFetchStateCompleted:v,paymentInitiatedDate:S,retryRepayment:m})=>{const R=me(),{useDynamicConfig:B}=oe(),{configValue:F}=B(Re.zeniAccountsConfig),u=Gn(F),p=y(z=>$t(z)),{creditAccount:w}=y(z=>aa(z)),o=y(z=>ie(z)),P=gt(),E=Da(),O=Ce(),I=ae.getSignedInUser(),b=Me(),[x,i]=d.useState(!1),[C,j]=d.useState(!1),{configValue:M}=B(Re.zeniCardsConfig),L=M.credit_card_auto_pay_threshold_by_company_id?.[o.companyId]??M.default_credit_card_auto_pay_threshold??Ds,T=Gt(b?.loggedInUserRoleMap),$=zn(b?.loggedInUserRoleMap),Q=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled,H=y(z=>ka(z,o.companyId)),A=H.companyChargeCardInfo?.primaryFundingAccount,G=H.allFundingAccounts.find(z=>z.id===A?.accountId),W=y(z=>Je(z,o.companyId)),k=ea(W.controllers);d.useEffect(()=>{if(p.fetchState!=="Completed"&&p.fetchState!=="In-Progress"&&O(zt()),p.fetchState==="Completed"&&!C){const z=o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,X=p.transferFromAccounts.find(Z=>Z.id===z);let ee;if(f==="cardPaymentHistory"&&m){const Z=m.paymentAccountId!=null?p.transferFromAccounts.find(re=>re.id===m.paymentAccountId):void 0;ee={amount:m.amount,isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Lt(),transferFrom:Z??X}}else ee={amount:{amount:w.balance.amount+w.hold.amount,currencyCode:w.balance.currencyCode,currencySymbol:w.balance.currencySymbol},isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Lt(),transferFrom:X};O(Ft(ee)),j(!0)}},[p.fetchState,C,f,m,p.transferFromAccounts,o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,o.companyChargeCardInfo?.info?.isAutoPayEnabled,w.balance.amount,w.balance.currencyCode,w.balance.currencySymbol,w.hold.amount,O]);const U={isZeniCheckingEnabled:o.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:G?.accType==="depositAccount",creditCardPaymentSourceAccountName:G?.label,creditCardPaymentSourceAccountType:G?.accType,creditCardPaymentSourceLastFourDigits:G?.accountLast4,creditCardPaymentSourceBalance:G?.accountBalance?.available?.amount??0};if(d.useEffect(()=>{H.fetchState!=="Completed"&&H.fetchState!=="In-Progress"&&O(Ia(o.companyId,!0))},[H.fetchState]),d.useEffect(()=>{p.updateStatus==="Completed"&&D!=null&&v&&l&&c&&q.trackCardsPayEarlyPayNowClick(k,n,D,p.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:p.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:p.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:p.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:p.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:S?.add(3,"day").format(Va.visual.MMMDCommaYYYYformat),paymentInitiatedDate:S?.format(Va.visual.MMMDCommaYYYYformat)},U,h,g)},[p.updateStatus,D,v,l,c,S]),d.useEffect(()=>{p.fetchState==="Completed"&&D!=null&&v&&l&&c&&!x&&e&&C&&D!=null&&(q.trackCardsPayEarlyFormView(k,n,D,t,o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,w.balance.amount,U,h,g),i(!0))},[p,v,l,c,x,e,C]),I==null)throw Error("Can't access invite people page without signing in...");const ne=()=>{a(!0),O(Qt())},J=$e(o),_={events:e?sa(J,Tn):[],eventCallback:(z,X,ee)=>{ee.onEventReceived(z)},onSubscribed:z=>{z.onPusherSubscribed()}};return s.jsx(s.Fragment,{children:s.jsx(fn,{onClose:()=>{ne()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:$s.overlayWidth.valuePercentage(E),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:P.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(Qs,{onClick:z=>z.stopPropagation(),children:s.jsx(zs,{..._,closeDrawerHandler:a,navigate:R,paymentDetails:p,creditAccountSpentAmount:r,onTransferClick:()=>{v&&l&&c&&D!=null&&q.trackCardsPayEarlyFormClick(k,n,D,"Pay Now",p.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:p.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:p.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:p.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:p.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},U,h,g),O(Qn({companyId:o.companyId}))},onDismissClick:ne,onSaveChangesToLocalStore:z=>{O(Ft(z))},currentTenant:o,hasZeniAccountsAdminAccess:T,isZeniAccountsUser:$,isZeniAccountSetupEnabled:Q,productInformation:n,sourcePage:f,controllerEmails:k,autoPayThreshold:L,paymentSourceInformation:U,creditAccountInformation:h,debitAccountInformation:g,cashbackInformation:D,isCashbackInfoFetchStateCompleted:v,isCreditCardInfoFetchStateCompleted:l,isDebitCardInfoFetchStateCompleted:c,paymentInitiatedDate:S,maxInsuredAmount:u.maxInsuredAmount})})})})},Qs=ve(_s)`
|
|
15
|
-
display: flex;
|
|
16
|
-
min-height: 100%;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
`,vt=e=>e!=null&&typeof e=="object"?e:null,ce=e=>typeof e=="string"?e:void 0,we=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Ha=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",nt=e=>{if(e==null||typeof e!="object")return!1;const a=e;return typeof a.transaction_id=="string"&&typeof a.amount=="number"&&typeof a.currency_code=="string"&&typeof a.currency_symbol=="string"&&typeof a.direction=="string"&&!!Ha(a.transaction_status)&&!!Ha(a.transaction_type)},Tt=(e,a)=>{const t=e?.card_status;if(!Ha(t))return null;const r=e?.is_locked_by_admin;return{cardId:a,cardStatus:t,isLockedByAdmin:typeof r=="boolean"?r:void 0}},dt=[An,kn,_n,Dn,wn,ra,kt,Xa,_t,Dt,wt],Fn=[Ta,va],Ys=new Set([...dt,...Fn]),rt=bt.getLocalizedStrings().dateFormat,Zs=fe(function(e,a){const{includeCreditAccountInfo:t,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:f}=a,h=ae.getSignedInUser(),g=e.tenantState.currentTenantId,D={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:g??""},c=ut(e,r,t,f),l=cr(e,r),v=or(e);return{chargeCardDetailView:c,chargeCardsRecurringExpensesState:l,vgsVaultId:Ka.cardVaultId,transactionAttachmentsEndpointToFetch:`${it}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${it}/card_transaction_attachment`,authParams:D,isSnackbarOpen:v.isSnackbarOpen,cardsEndPoint:`${Cn.cardMicroServiceBaseUrl}`,signedInUserToken:c.twoFAView.token??n}},function(e,a){const{cardId:t,currentTenant:r,navigate:n,location:f,cardProviderId:h,includeCreditAccountInfo:g,setIsPaymentOpen:D,controllerEmails:c,productInformation:l,cashbackInformation:v,primaryFundingAccountDetails:S,creditAccountInformation:m,debitAccountInformation:R,isChargeCardFeatureEnabled:B}=a,{tenantEmailDomain:F}=r;return{onEventReceived:(u,p)=>{(({event:w,data:o,cardId:P,dispatch:E,subscribedEvents:O})=>{const I=vt(o);switch(w){case Ta:case va:return void E(ya(!0));case An:{const b=ce(I?.card_id);if(b==null||b!==P)return;const x=ce(I?.transaction_id),i=I?.transaction_status;return x!=null&&Ha(i)?void E(rr({transactionId:x,transactionStatus:i})):void E(We(P,null,null,!0))}case ra:{const b=ce(I?.card_id)??P;if(b!==P)return;const x=Tt(I,b);return x!=null?void E(Ct(x)):void E(ca(P,!0))}case kt:{const b=ce(I?.card_id)??P;if(b!==P)return;const x=ce(I?.currency_code),i=ce(I?.currency_symbol),C=we(I?.balance);return x!=null&&i!=null&&C!=null?(E(nr({cardId:b,currencyCode:x,currencySymbol:i,balance:C,hold:we(I?.hold),dailyPurchaseSpends:we(I?.daily_purchase_spends),monthlyPurchaseSpends:we(I?.monthly_purchase_spends),dailyWithdrawals:we(I?.daily_withdrawals),monthlyWithdrawals:we(I?.monthly_withdrawals)})),void E(Ve(!0))):(E(ca(P,!0)),void E(Ve(!0)))}case Xa:{const b=ce(I?.currency_code),x=ce(I?.currency_symbol),i=we(I?.available_amount),C=we(I?.balance_amount);return b!=null&&x!=null&&i!=null&&C!=null?void E(tr({currencyCode:b,currencySymbol:x,available:i,balance:C,hold:we(I?.hold_amount),cashback:we(I?.cashback_amount)})):void E(Ve(!0))}case kn:{const b=ce(I?.card_id)??P;if(b!==P)return;const x=I?.transaction;return nt(x)?void E(ar({cardId:b,transaction:x})):void E(We(P,null,null,!0))}case _n:{const b=ce(I?.card_id)??P;if(b!==P)return;const x=I?.transaction;return nt(x)?void E(er({cardId:b,declineReason:ce(I?.decline_reason),transaction:x})):void E(We(P,null,null,!0))}case Dn:{const b=ce(I?.card_id)??P;if(b!==P)return;const x=I?.transaction;return nt(x)?void E(Jn({cardId:b,transaction:x})):void E(We(P,null,null,!0))}case wn:{const b=ce(I?.card_id)??P;if(b!==P)return;const x=ce(I?.transaction_id),i=I?.attachment_file_paths;return x!=null&&Array.isArray(i)&&i.every(C=>typeof C=="string")?void E(Xn({cardId:b,transactionId:x,attachmentFilePaths:i})):void E(We(P,null,null,!0))}case _t:case Dt:case wt:{const b=ce(I?.card_id);if(b==null||b!==P)return;E(ca(P,!0))}}})({event:u,data:p,cardId:t,dispatch:e,subscribedEvents:Ys})},onPusherSubscribed:()=>{e(ca(t,!0)),e(We(t,null,null,!0)),e(Ve(!0))},onReloadTransactions:()=>{e(da(t,g,B))},onFetchChargeCardTransactionList:(u,p)=>{e(We(t,u,p))},onUpdateScrollYOffset:u=>{},onGetOtp:u=>{h!=null&&e(Qa(u,"ChargeCardHolder",t))},onResendOtp:u=>{h!=null&&e(za(u,"ChargeCardHolder",t))},onVerifyOtp:(u,p)=>{h!=null&&e(Ga(u,p,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&ae.saveZeniOtpTokenForCardHolder(u,t)},onColorCodeChange:u=>{e(Cr(t,u))},onLockChargeCard:(u,p)=>{e(an(u,t,p))},onUnlockChargeCard:u=>{e(en(u,t))},onCloseChargeCard:u=>{e(Jt(t,u))},onFetchChargeCardsRecurringExpenses:()=>{e(Xt([t]))},updateChargeCardName:(u,p)=>{e(qt(u,t,p))},updateChargeCardTransactionAttachments:(u,p)=>{p!=null&&e(mr({transactionId:u,data:p}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(u,p,w,o)=>{e(ur({chargeCardId:p,transactionId:u,fetchState:w,error:o}))},updateChargeCardTransactionReceiptsShowTick:(u,p,w)=>{e(lr({chargeCardId:p,transactionId:u,shouldShowTick:w}))},onChargeCardRevokeInviteClick:()=>{e(Wt(t))},updateChargeCardTransactionIsViewReceiptClicked:(u,p,w)=>{e(dr({chargeCardId:p,transactionId:u,isViewReceiptClicked:w}))},onChargeCardTransactionRowClick:(u,p)=>{const w=Se(f.state?.pathnameStackToGoBack,f.pathname);n(`../../transaction/${u}/${p}`,{state:{pathnameStackToGoBack:w}})},onBackClick:()=>{const u=Ue(f.state?.pathnameStackToGoBack),p=Ge(F);n(p,{state:{pathnameStackToGoBack:u.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(ir())},onUpdateDebitCardPinAttempt:u=>{e(Kt(t,u)),u==="success"&&e(ba({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(u,p)=>{u?e(ba({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):p!=null&&e(ba({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:p.message}]}))},updateSpendLimit(u,p,w,o){e(Zt(u,p,w.code,o))},shouldOpenCreditCardPaymentDrawer(u){u&&v!=null&&q.trackCardsPayEarlyClick(c,l,v,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:S?.accType==="depositAccount",creditCardPaymentSourceAccountName:S?.label,creditCardPaymentSourceAccountType:S?.accType,creditCardPaymentSourceLastFourDigits:S?.accountLast4,creditCardPaymentSourceBalance:S?.accountBalance?.available?.amount??0},m,R),D(u)}}})(Wa(ds));function Ks(){const e=me(),a=Ce(),t=Ie(),{cardId:r}=Aa(),[n,f]=d.useState(!1),[h,g]=d.useState(!1),{useDynamicConfig:D}=oe(),c=ae.getSignedInUser(),l=y(N=>ie(N)),v=y(N=>Na(N).firstViewAfterActivation),S=y(N=>N.classListState.fetchState),{configValue:m}=D(Re.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:R}=D(Re.zeniCardsConfig),B=R.enable_card_controls_for_company_ids,F=R.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(B)&&B.includes(l.companyId),[u,p]=d.useState(!1),[w,o]=d.useState(!1),{useFeatureGate:P}=oe(),{isFeatureEnabled:E}=P(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:O}=P(Y.isDebitCardFeatureEnabled),I=ke(O,l),b=_e({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:I}),{isFeatureEnabled:x}=P(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=P(Y.isCardsCommentingEnabled),C=Ae(l),j=Ee(l),M=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=De({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:E,isBookKeepingTenant:C,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:M}),T=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!l.companyChargeCardInfo?.info?.isChargeCardEnabled,Q=!l.userRole.includes("charge_card_user")&&L&&$;if(r==null)throw Error("Empty card id is not valid...");const H=y(N=>ka(N,l.companyId)),{creditAccount:A,creditAccountRepayment:G}=y(N=>aa(N)),W=ae.getZeniOtpTokenForCardHolder(r),k=y(N=>ut(N,r,Q,L)),{isAiCfoAccessEnabled:U,onAskAiCfoClick:ne}=En({mobileExploreReferrer:"Card Detail"});mn({isDataReady:k.fetchState==="Completed"});const J=y(N=>ta(N)),_=k.chargeCard,z=Me(),X=He(z?.loggedInUserRoleMap),ee=_?.type.code==="business_physical_debit_card"||_?.type.code==="business_virtual_debit_card",Z=_?.type.code==="business_physical_debit_card"||_?.type.code==="business_physical_credit_card",re=_?.type.code==="business_virtual_debit_card"||_?.type.code==="business_virtual_credit_card",Te=_?.type.code==="business_virtual_debit_card",ge=Pa(L,$,X,A,G),be=gn(ee,k),ze=It(X,J),K=Ne(L,b,T,$),ye=k.depositAccountLimitFetchState.fetchState!=="Completed"&&k.depositAccountLimitFetchState.fetchState!=="In-Progress",Oe=y(N=>Je(N,l.companyId)),Fe=ea(Oe.controllers),pe=y(N=>_?.cardCreatedByUser?.userId!=null?Ra(N.userRoleState,_?.cardCreatedByUser?.userId):void 0),Be=y(N=>pe?.accountingClassIDs[0]!=null?Ua(N.classState,{classId:pe?.accountingClassIDs[0],reportId:"class_list"}):void 0),te=y(N=>_?.cardHolderUser?.userId!=null?Ra(N.userRoleState,_?.cardHolderUser?.userId):void 0),Fa=y(N=>te?.accountingClassIDs[0]!=null?Ua(N.classState,{classId:te?.accountingClassIDs[0],reportId:"class_list"}):void 0),le=l?.userRole,Qe=y(N=>na(N,!1,b,E).revokeCardInvite),de=yt(Qe.saveStatus.fetchState);if(d.useEffect(()=>{if(de==="In-Progress"&&Qe.saveStatus.fetchState==="Completed"){const N=Ge(l.tenantEmailDomain);e(N)}},[de,Qe.saveStatus.fetchState,e,l.tenantEmailDomain]),d.useEffect(()=>{v&&n===!1&&re&&(f(!0),setTimeout(()=>{a(Oa()),Te&&a(ba({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[v,n,re,Te]),d.useEffect(()=>{u||k.fetchState==="Completed"||k.fetchState==="In-Progress"||r==null||(p(!0),a(da(r,Q,L,!1)))},[u,k,r,a]),d.useEffect(()=>{!w&&k.fetchState==="Completed"&&k.chargeCard?.connectedAccountId!=null&&ee&&ye&&X&&(o(!0),a(Yt({depositAccountId:k.chargeCard?.connectedAccountId})))},[w,k,a,ye,X]),d.useEffect(()=>{J.fetchState!=="Completed"&&J.fetchState!=="In-Progress"&&X&&a(ya()),S!=="Completed"&&S!=="In-Progress"&&a(Ht()),k.transactionStatistics.fetchState!=="Completed"&&k.transactionStatistics.fetchState!=="In-Progress"&&a(sr({chargeCardId:r})),H.fetchState!=="Completed"&&H.fetchState!=="In-Progress"&&a(Ia(l.companyId,!0))},[J.fetchState,a,X,S,k.transactionStatistics.fetchState,H.fetchState]),d.useEffect(()=>{if(!(k.fetchState!=="Completed"||L&&A.fetchState!=="Completed"||_==null||k.transactionStatistics.fetchState!=="Completed"||ee&&X&&k.depositAccountLimitFetchState.fetchState!=="Completed")){const N=_.type.code.includes("physical"),ue=N?_.cardActivationAttemptHistory[0]?.timestamp:_.createTime;q.trackCardsCardDetailView(Fe,K,{cardId:r,cardName:_.cardName,cardType:_.type.code.includes("credit")?"credit":"debit",cardCategory:N?"physical":"virtual",cardLimit:oa(_.limit.amount),cardLastFourDigits:_.accountLast4,cardStatus:_.status.code,cardAssignedDate:_.createTime?.format(rt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:_.providerCardCreateTime?.format(rt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:ue?.format(rt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:_.creditLimitFrequency.name,cardSpentAmount:oa(_.balance.amount),cardAvailableLimit:oa(_.available.amount),cardUtilizationPercent:_.limit.amount>0?Math.round((_.limit.amount-_.available.amount)/_.limit.amount*100):0,cardUtilizationAmount:oa(_.limit.amount-_.available.amount),totalNumberOfDeclinedTransactions:k.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:k.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:k.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:k.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:k.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:k.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:ot(_.cardCreatedByUser,!1),cardIssuedByEmail:_.cardCreatedByUser?.email,cardIssuedByUserId:_.cardCreatedByUser?.userId,cardIssuedByRole:pe?.userRoles,cardIssuedByDepartment:Be?.className},{cardholderName:ot(_.cardHolderUser,!1),cardholderEmail:_.cardHolderUser?.email,cardholderRole:te?.userRoles,cardholderUserId:_.cardHolderUser?.userId,cardholderDepartment:Fa?.className},ge,be)}},[k.fetchState,k.depositAccountLimitFetchState.fetchState,k.transactionStatistics.fetchState,A.fetchState,X]),c==null)throw Error("Can't access card detail page without signing in...");const la=$e(l),Ba=X?[...dt,...Fn]:dt,ua={events:sa(la,Ba),eventCallback:(N,ue,xe)=>{xe.onEventReceived(N,ue)},onSubscribed:N=>{N.onPusherSubscribed()}},ma=()=>{if(r!=null&&_!=null){const{ownerName:N,cardName:ue,utilisation:xe,limit:Ye,frequency:Ze,cardColor:Ke}=st(_),V=_.cardHolderUserId===c.userId;q.trackCardsDetailPageViewed(r,N,ue,xe,Ye,Ze,Ke,V)}};d.useEffect(()=>{if(k.fetchState==="Completed"){const N=k.chargeCard;if(N?.status.code==="inactive"||ee&&N?.isPinSet===!1||Z&&v){const ue=he(l.tenantEmailDomain,r,c,_,v);e(ue)}}},[k.fetchState]);const Ca=(N,ue)=>{if(r!=null&&_!=null){const{ownerName:xe,cardName:Ye,utilisation:Ze,limit:Ke,frequency:V}=st(_),Le=_.cardHolderUserId===c.userId;q.trackCardsDetailPageClicked(r,xe,Ye,Ze,Ke,V,N,Le,ue)}},pa=(N,ue)=>{if(r!=null&&_!=null){const{ownerName:xe,cardName:Ye,utilisation:Ze,limit:Ke,frequency:V}=st(_),Le=_.cardHolderUserId===c.userId;q.trackCardsVerifyPopUpClick(r,xe,Ye,Ze,Ke,V,N,Le,ue)}},ha=A.balance.amount+A.hold.amount,et=l.companyChargeCardInfo?.info?.primaryFundingAccount,xa=H.allFundingAccounts.find(N=>N.id===et?.accountId),fa=k.chargeCard!=null,at=k.depositAccountLimit!=null;return k.fetchState!=="Error"||fa?!fa&&(k.fetchState==="In-Progress"||k.fetchState==="Not-Started")||Qe.saveStatus.fetchState==="In-Progress"||!at&&ee&&X&&k.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(is,{}):s.jsxs(s.Fragment,{children:[s.jsx(Za,{showConfetti:v}),k.fetchState==="Completed"?s.jsx(St,{analytics:q,onLoad:ma}):null,h===!0?s.jsx(Pt,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:h,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:K,creditAccountInformation:ge,debitAccountInformation:be,cashbackInformation:ze,creditAccountSpentAmount:ha,isDebitCardInfoFetchStateCompleted:!ee||!X||k.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!L||A.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!X||J.fetchState==="Completed",paymentInitiatedDate:G.initiatedRepaymentDate}):null,s.jsx(Zs,{...ua,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:pa,onFireOnClickAnalytics:Ca,isSandboxEnv:ft(),signedInUser:c,location:t,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:pe?.userRoles,cardIssuedByDepartmentName:Be?.className,cardHolderRoles:te?.userRoles,cardHolderDepartmentName:Fa?.className,loggedInUserRole:le,isChargeCardFeatureEnabled:L,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:$,isCardControlsEnabled:F,isEarlyPayEnabled:x,controllerEmails:Fe,chargeCardCashbackDetailState:J,productInformation:K,creditAccountInformation:ge,debitAccountInformation:be,cashbackInformation:ze,classListFetchState:S,primaryFundingAccountDetails:xa,currentTenant:l,cardProviderId:k.chargeCard?.cardProviderID,cardId:r,creditAccount:A,creditAccountRepayment:G,includeCreditAccountInfo:Q,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:m.documentAiReceiptMaxSizeLimitBytes!=null?m.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:U,onAskAiCfoClick:ne,isCardsCommentingEnabled:i})]}):s.jsx(qa,{})}const st=e=>{const a=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,t=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,f=e.creditLimitFrequency.name;return{ownerName:a,cardName:t,utilisation:r,cardColor:e.cardColorCode??"",frequency:f,limit:n}},Bn=[ra,Xa,vn,va,Ta,Ja,wt,xs,_t,Dt,kt],Ws=new Set(Bn),lt=Ts((e,a,t,r)=>{e(Ea(a,t,r,!0))},400),qs=ve.div`
|
|
19
|
-
display: flex;
|
|
20
|
-
width: 100%;
|
|
21
|
-
flex: 1 1 auto;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Xs=fe(function(e,a){const t=na(e,a.includeCreditAccountDebitSummaryAndCashbackInfo,a.isDebitCardFeatureEnabled&&a.isDebitCardSetupEnabled,a.isChargeCardFeatureEnabled&&a.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:pr(e),bulkActionView:hr(e),companyLegalName:a.currentTenant.companyName,admins:a.admins,searchText:t.searchText,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigateAndClearBulkSelection:t,currentTenant:r,location:n,signedInUser:f,chargeCardListState:h,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:D,isCreditCardProductVisibleForExpressInterest:c,isChargeCardSetupEnabled:l,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:S,isDebitCardTOSAccepted:m,isChargeCardTOSAccepted:R,controllerEmails:B,depositAccountListWithDebitCardIssued:F,primaryFundingAccountDetails:u,chargeCardSetUpViewFetchState:p,productInformation:w,cashbackInformation:o,creditAccountInformation:P,debitAccountInformation:E,updatePayNowInfoTooltip:O,isUserHasCardsAdminLevelAccess:I}=a,{tenantEmailDomain:b}=r,{cards:x}=h;return{onChargeCardRowClick:(i,C)=>{const j=yn(x,i);let M;j!=null&&((T=>{const $=T.limit.amount-T.available.amount,Q=`${T.cardHolderUser?.firstName.toLowerCase()} ${T.cardHolderUser?.lastName.toLowerCase()}`,H=T.cardName,A=T.department?.className??"",G=T.limit.amount,W=T.creditLimitFrequency.name;q.trackCardsListRowClicked(Q,H,A,$,G,W,f.userId===T.cardHolderUserId)})(j),qe(v,S,F)&&q.trackCardsCardListRowClick(B,w,"Card Row Item","row_clicked",C+1,{cardOwner:ot(j.cardHolderUser,!1),cardName:j.cardName,cardType:j.type.code.includes("credit")?"credit":"debit",cardStatus:j.status.code,cardUtilizationAmount:oa(j.limit.amount-j.available.amount),cardUtilizationPercent:j.limit.amount>0?Math.round((j.limit.amount-j.available.amount)/j.limit.amount*100):0,cardLimit:oa(j.limit.amount)},o,P,E)),M=j?.status.code==="request_on_hold"&&f.userId===j.cardHolderUserId?Sn(b):he(b,i,f,j);const L=Se(n.state?.pathnameStackToGoBack,n.pathname);t(M,{state:{pathnameStackToGoBack:L}})},onFetchChargeCardsRecurringExpenses:i=>{e(Xt(i))},onFetchDepositAccountLimit:i=>{e(Yt({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Ar(i))},onChargeCardRevokeInviteClick:i=>{e(Wt(i))},onLockChargeCardList:(i,C)=>{e(Er(i,C))},onUnlockChargeCardList:i=>{e(Ir(i))},onCloseChargeCardList:(i,C)=>{e(Sr(i,C))},onRevokeChargeCardList:i=>{e(yr(i))},updateChargeCardListSpendLimit(i,C,j){e(br(i,C,j.code))},onLockChargeCard:(i,C)=>{e(an(I,i,C))},onUnlockChargeCard:i=>{e(en(I,i))},onCloseChargeCard:(i,C)=>{e(Jt(i,C))},onUpdateSpendLimit(i,C,j,M){e(Zt(i,C,j.code,M))},updateChargeCardName:(i,C)=>{e(qt(I,i,C))},onClickSetupIcon:()=>{q.trackCardsListPageClicked("settings"),qe(v,S,F)&&o!=null&&q.trackCardsSettingsClick(B,w,o,P,E);const i=Ps(b),C=Se(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:C}})},onIssueCardClick:()=>{q.trackCardsListPageClicked("new card"),qe(v,S,F)&&o!=null&&q.trackCardsNewCardClick(B,w,o,"New Button","card_creation_initiated","Card List",P,E);const i=Js(b),C=Se(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:C}})},onColumnSortConfigChanged:(i,C)=>{qe(v,S,F)&&o!=null&&q.trackCardsCardListSortClick(B,w,o,"Sort Icon","sort",i,C==="ascending"?"ASC":"DESC","Cards List",P,E),e(ct({uiState:{sortKey:i,sortOrder:C}}))},onSearchTextChanged:i=>{e(gr(i))},onReloadCards:()=>{e(Ea(g,v&&S,D&&l,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{qe(v,S,F)&&o!=null&&q.trackCardsCashbackOverviewClick(B,w,o,"Cashback Overview","cashback_details_viewed",P,E),t("./cashback")},onClickStatementsIcon:()=>{qe(v,S,F)&&o!=null&&q.trackCardsStatementsClick(B,w,o,P,E),t("./statements")},onCreateNowClick:i=>{qe(v,S,F)&&o!=null&&q.trackCardsNewCardClick(B,w,o,"Promo Banner","card_creation_initiated","Card List",P,E),t(`./new?cardType=${i}`)},onPromoCardClick:i=>{t(i==="debit"&&v&&!m||i==="credit"&&c&&!R?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,C)=>{p==="Completed"&&r.company!=null&&o!=null&&q.trackCardsPayEarlyClick(B,w,o,"Card List",i,C,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:u?.accType==="depositAccount",creditCardPaymentSourceAccountName:u?.label,creditCardPaymentSourceAccountType:u?.accType,creditCardPaymentSourceLastFourDigits:u?.accountLast4,creditCardPaymentSourceBalance:u?.accountBalance?.available?.amount??0},P,E);const j=ec(b);t(j)},navigateToCreditCardPaymentHistoryPage:()=>{const i=ac(b),C=Se(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:C}})},shouldShowPayNowInfoTooltip:O,onSetRowActionCardId:i=>{e(fr(i))},onSetBulkActionCardIds:i=>{e(tn(i))},onEventReceived:i=>{Ws.has(i)&<(e,g,v&&S,D&&l)},onPusherSubscribed:()=>{lt(e,g,v&&S,D&&l)}}})(Wa(ls));function Rt({isPaymentDrawerOpen:e}){const a=me(),t=Ce(),r=Ie(),n=d.useCallback((V,Le)=>{t(tn([])),a(V,Le)},[t,a]),[f,h]=d.useState(!1),[g,D]=d.useState(ae.getPayNowInfoTooltip()??!1),c=V=>{ae.savePayNowInfoTooltip(V),D(V)},[l,v]=d.useState(!1),S=ae.getSignedInUser(),m=y(V=>ie(V)),[R,B]=d.useState(!1),[F,u]=d.useState(!1),{isAiCfoAccessEnabled:p,onAskAiCfoClick:w}=En({mobileExploreReferrer:"Cards"}),o=m.userRole.includes("charge_card_user"),P=!o,E=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:O,useDynamicConfig:I}=oe(),{isFeatureEnabled:b}=O(Y.isCashbackFeatureEnabled),{isFeatureEnabled:x}=O(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=O(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=O(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:j}=O(Y.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:M}=O(Y.isCardsCommentingEnabled),L=ke(i,m),T=_e({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:L}),$=Ee(m),Q=Ae(m),H=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=De({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:Q,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:H}),G=bn({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:Q}),{configValue:W}=I(Re.zeniCardsConfig),k=Me(),U=He(k?.loggedInUserRoleMap),ne=y(V=>Je(V,m.companyId)),J=ea(ne.controllers),_=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,z=W.credit_card_pay_now_threshold_by_company_id?.[m.companyId]??W.default_credit_card_pay_now_threshold??ws,X=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(m.companyId),ee=!!m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Z=!!m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,Te=!!m.company?.companyChargeCardInfo?.isChargeCardEnabled,ge=!!m.company?.companyDebitCardInfo?.isDebitCardEnabled,be=y(V=>$t(V)),ze=yt(be.updateStatus),K=y(V=>na(V,P,T&&E,A&&re)),ye=K.cards.filter(V=>V.type.code.includes("debit")).map(V=>V.connectedAccountId),Oe=[...new Set(ye)],Fe=y(V=>ta(V)),pe=y(V=>Ya(V,Oe)),Be=y(V=>ka(V,m.companyId)),te=Be.companyChargeCardInfo?.primaryFundingAccount,Fa=Be.allFundingAccounts.find(V=>V.id===te?.accountId),le=K.fetchState,Qe=K.creditAccount;mn({isDataReady:le==="Completed"});const{creditAccountRepayment:de}=y(V=>aa(V)),la=y(V=>Na(V).firstViewAfterActivation),{areTenantIdsInSync:Ba}=pn(),ua=It(U,Fe),ma=Pa(A,re,U,Qe,de),Ca=Et(T,E,U,pe,K.debitCardSummary),pa=Ne(A,T,E,re),ha=K.creditAccount.balance.amount+K.creditAccount.hold.amount;if(d.useEffect(()=>{le==="Completed"&&(ae.getPayNowInfoTooltip()==null||ha<z*K.creditAccount.limit.amount/100)&&c(!0)},[le,z,ha,K.creditAccount.limit.amount]),d.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||ze==="In-Progress"&&be.updateStatus==="Completed")c(!1),h(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){h(!1),document.body.style.overflow="auto";const V=Ge(m.tenantEmailDomain);n(V)}},[e,de.initiatedRepayments.amount,de.fetchState,ze,be.updateStatus,n,m.tenantEmailDomain]),d.useEffect(()=>{!R&&(re||E)&&(Te||ge)&&Ba&&(B(!0),t(Ea(P,T&&E,A&&re,!1)))},[R,P,t,Ba,Te,ge]),d.useEffect(()=>{la&&l===!1&&(v(!0),setTimeout(()=>{t(Oa())},5e3))},[la,l]),d.useEffect(()=>()=>{lt.flush()},[]),d.useEffect(()=>{le==="Completed"&&o&&K.cards.length===1&&(K.cards[0].status.code==="inactive"&&K.cards[0].type.code==="business_physical_credit_card"?n(`./${K.cards[0].id}/activate`):K.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${K.cards[0].id}`)))},[le,o,r.state,n,K.cards]),d.useEffect(()=>{if(le==="Completed"&&o){const V=K.cards.length,Le=K.cards.filter(ga=>ga.cardHolderUserId===S?.userId).filter(ga=>ga.status.code==="request_on_hold");Le.length>0&&V===Le.length&&n("./onboard")}},[le,K.cards,o,n,S?.userId]),d.useEffect(()=>{le!=="Completed"||A&&de.fetchState!=="Completed"||T&&E&&U&&pe.fetchState!=="Completed"||q.trackCardsCardListView(J,pa,ua,ma,Ca)},[le,Qe,de.fetchState,pe.fetchState,U]),S==null)throw Error("Can't access charge card list page without signing in...");const et=y(V=>nn(V.userState,V.userRoleState,V.userListViewState,"cardAdmin")),xa=pt(k?.loggedInUserRoleMap),fa=V=>{u(V)},at=K.creditAccount.limit,N=()=>{h(!1),n("..")},ue=m.companyChargeCardInfo?.info!=null&&ia({cardInfo:m.companyChargeCardInfo.info,isProductVisible:A&&Te,isTOSAccepted:ee,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:xa}),xe=m.companyDebitCardInfo?.info!=null&&ia({cardInfo:m.companyDebitCardInfo.info,isProductVisible:T&&ge,isTOSAccepted:Z,isSetupEnabled:E,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:xa}),Ye=ue||xe,Ze=$e(m),Ke={events:sa(Ze,Bn),eventCallback:(V,Le,ga)=>{ga.onEventReceived(V)},onSubscribed:V=>{V.onPusherSubscribed()}};return re||E?s.jsxs(s.Fragment,{children:[le==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(St,{analytics:q,onLoad:()=>{q.trackPageLoaded(hn.Event.cardsListPage),(A&&!re||T&&!E)&&q.trackCardsPromoView(J,{isCreditCardOffered:A,isDebitCardOffered:T,isDebitCardEnabled:E,isCreditCardEnabled:re},"Banner",T&&!E?"Debit Card":A&&!re?"Credit Card":"","Card List")}}),s.jsx(Za,{showConfetti:la})]}):null,f===!0?s.jsx(Pt,{closeDrawerHandler:N,isPaymentDrawerOpen:f,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:ha,productInformation:pa,creditAccountInformation:ma,debitAccountInformation:Ca,cashbackInformation:ua,isDebitCardInfoFetchStateCompleted:!(T&&E&&U)||pe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!A||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!U||Fe.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(qs,{children:[s.jsx(Xe,{isAppContentDrawerOpen:F,handleDrawerToggle:fa}),s.jsx(Xs,{...Ke,isCashbackFeatureEnabled:b,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:T,isCreditCardProductVisibleForExpressInterest:G,updatePayNowInfoTooltip:c,showPayNowInfoTooltip:g,creditCardPayNowThreshold:z,signedInUser:S,chargeCardListState:K,location:r,admins:et.users,navigateAndClearBulkSelection:n,currentTenant:m,isCardControlsEnabled:X,companyChargeCardInfoCreditAccountLimit:m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:m.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:U,includeCreditAccountDebitSummaryAndCashbackInfo:P,onClickMenuIcon:()=>{fa(!0)},creditLimit:at,isChargeCardSetupEnabled:re,isChargeCardEnabledOnCompany:Te,isDebitCardSetupEnabled:E,isDebitCardEnabledOnCompany:ge,isEarlyPayEnabled:C,isChargeCardPaymentHistoryFeatureEnabled:j,cashbackRate:_,controllerEmails:J,chargeCardCashbackDetailState:Fe,depositAccountListWithDebitCardIssued:pe,isChargeCardTOSAccepted:ee,isDebitCardTOSAccepted:Z,primaryFundingAccountDetails:Fa,chargeCardSetUpViewFetchState:Be.fetchState,productInformation:pa,creditAccountInformation:ma,debitAccountInformation:Ca,cashbackInformation:ua,isAiCfoAccessEnabled:p,onAskAiCfoClick:w,isCardsCommentingEnabled:M})]})]}):(ee||Z)&&U===!0?s.jsx(Sa,{to:"../setup"}):Ye?s.jsx(Sa,{to:"../promo"}):s.jsx(_a,{fetchState:le})}const Js=e=>`/${e}/cards/new`,ec=e=>`/${e}/cards/payment`,ac=e=>`/${e}/cards/payment-history`,xn=[Pn,vn],tc=new Set(xn),nc=fe(function(e){const a=ae.getSignedInUser(),t=ie(e),r=e.tenantState.currentTenantId,n=rn(e),f={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:r??""},h=t?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:kr(t),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:f,companyName:h,spendManagementEndPoint:`${it}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,a){const{location:t,navigate:r}=a;return{onBackClick:()=>{const n=Ue(t.state?.pathnameStackToGoBack),f=n.poppedPathname??"..";r(f,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,f)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:f}}})},onFiltersChange:n=>{e(Dr({filters:n}))},onReloadPayments:()=>{e(La(!0))},onEventReceived:n=>{tc.has(n)&&e(La(!0))},onPusherSubscribed:()=>{e(La(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(_r({uiState:{downloadState:n}}))}}})(Wa(us));function rc(){const e=me(),a=Ie(),t=Ce(),{areTenantIdsInSync:r}=pn(),{useFeatureGate:n}=oe();if(ae.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const f=y(_=>ie(_)),h=y(_=>rn(_)),[g,D]=d.useState(!1),[c,l]=d.useState(!1),[v,S]=d.useState(!1),[m,R]=d.useState(null),B=!f.userRole.includes("charge_card_user"),F=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:u}=n(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:p}=n(Y.isDebitCardFeatureEnabled),w=ke(p,f),o=_e({isDebitCardFeatureEnabled:p,isBankingOnlyTenant:w}),P=Ee(f),E=Ae(f),O=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=De({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:u,isBookKeepingTenant:E,isDebitCardProductVisible:o,chargeCardsCreditAccountLimit:O}),b=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,x=Me(),i=He(x?.loggedInUserRoleMap),C=y(_=>na(_,B,o&&F,I&&b)),j=d.useMemo(()=>{const _=C.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(_.map(z=>z.connectedAccountId))]},[C.cards]),M=y(_=>ta(_)),L=y(_=>Ya(_,j)),{creditAccountRepayment:T}=y(_=>aa(_)),$=d.useMemo(()=>It(i,M),[i,M]),Q=d.useMemo(()=>Pa(I,b,i,C.creditAccount,T),[I,b,i,C.creditAccount,T]),H=d.useMemo(()=>Et(o,F,i,L,C.debitCardSummary),[o,F,i,L,C.debitCardSummary]),A=d.useMemo(()=>Ne(I,o,F,b),[I,o,F,b]),G=C.creditAccount.balance.amount+C.creditAccount.hold.amount,W=d.useMemo(()=>m!=null?h.repaymentHistory.find(_=>_.cardRepaymentId===m):void 0,[m,h.repaymentHistory]),k=d.useCallback(_=>{R(_),t(Ea(B,o&&F,I&&b,!1)),S(!0)},[t,B,o,F,I,b]),U=d.useCallback(()=>{S(!1),R(null),document.body.style.overflow="auto"},[]);d.useEffect(()=>{g||h.fetchState==="Completed"||h.fetchState==="In-Progress"||(D(!0),t(La()))},[g,t,h.fetchState]),d.useEffect(()=>{!c&&(b||F)&&r&&(l(!0),t(Ea(B,!1,I&&b,!1)))},[c,b,F,r,t,B,I]);const ne=$e(f),J={events:sa(ne,xn),eventCallback:(_,z,X)=>{X.onEventReceived(_)},onSubscribed:_=>{_.onPusherSubscribed()}};return s.jsxs(s.Fragment,{children:[v?s.jsx(Pt,{closeDrawerHandler:U,isPaymentDrawerOpen:v,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:G,productInformation:A,creditAccountInformation:Q,debitAccountInformation:H,cashbackInformation:$,isDebitCardInfoFetchStateCompleted:!(o&&F&&i)||L.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!I||T.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||M.fetchState==="Completed",paymentInitiatedDate:T.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(nc,{...J,location:a,navigate:e,accountInfoByAccountId:h.accountInfoByAccountId,onRetryPaymentClick:k})]})}const Ut=ve.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
height: 100vh;
|
|
28
|
-
width: 100%;
|
|
29
|
-
flex: 1 1 auto;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
overflow: auto;
|
|
32
|
-
align-items: center;
|
|
33
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
34
|
-
`,Ot=bt.getLocalizedStrings().months;function sc(){const e=me(),a=Ce(),t=Ie(),{creditAccount:r,creditAccountRepayment:n}=y(A=>aa(A)),f=`${Cn.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[h,g]=d.useState(!1),[D,c]=d.useState(!1),l=y(A=>wr(A)),{useFeatureGate:v}=oe(),S=y(A=>ie(A)),{isFeatureEnabled:m}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:R}=v(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isCardsCommentingEnabled),F=In(B?S.companyId:void 0,{clearParams:B&&l.fetchState==="Completed"}),u=ke(R,S),p=_e({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:u}),w=Ee(S),o=Ae(S),P=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=De({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:m,isBookKeepingTenant:o,isDebitCardProductVisible:p,chargeCardsCreditAccountLimit:P}),O=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,I=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,b=y(A=>Je(A,S.companyId)),x=ea(b.controllers),i=y(A=>sn(A)),C=i.cards.filter(A=>A.type.code.includes("debit")).map(A=>A.connectedAccountId),j=[...new Set(C)],M=y(A=>Ya(A,j)),L=y(A=>Pr(A));d.useEffect(()=>{D||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),a(Ve()))},[h,a,r.fetchState]),d.useEffect(()=>{D||r.fetchState!=="Completed"||r.id==null||l.fetchState==="Completed"||l.fetchState==="In-Progress"||(c(!0),a(vr(r.id)))},[D,a,r.fetchState,r.id,l.fetchState]),d.useEffect(()=>{M.fetchState!=="Completed"&&M.fetchState!=="In-Progress"&&p&&O&&a(cn()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a(Pe()),L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&p&&O&&a(Tr()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&E&&I&&a(mt())},[M.fetchState,p,O,i.fetchState,L.fetchState,n.fetchState,E,I]),d.useEffect(()=>{if(l.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&i.fetchState==="Completed"&&(!p||!O||M.fetchState==="Completed"&&L.fetchState==="Completed")){let A="",G="";if(l.statements.length>0){const ne=l.statements[l.statements.length-1].period,[J,_]=ne.split("-"),z=l.statements[0].period,[X,ee]=z.split("-");A=`${Ot[parseInt(_)-1]} ${J}`,G=`${Ot[parseInt(ee)-1]} ${X}`}const W=Ne(E,p,O,I),k=Pa(E,I,!0,r,n),U=Et(p,O,!0,M,L);q.trackCardsCreditCardStatementsView(x,W,{numberOfStatements:l.statements.length,oldestStatementMonthYear:A,latestStatementMonthYear:G},k,U)}},[l.fetchState,r.fetchState,n.fetchState,M.fetchState,i.fetchState,L.fetchState]);const T=()=>{const A=Ue(t.state?.pathnameStackToGoBack),G=A.poppedPathname??"..";e(G,{state:{pathnameStackToGoBack:A.newStack}})},$=y(A=>ta(A)),Q=ae.getSignedInUser(),H={userId:Q?.userId??"",sessionId:Q?.zeniSessionId??"",tenantId:S.tenantId??""};if(Q==null)throw Error("Can't access address page without signing in...");if(l.fetchState!=="Completed")return s.jsx(Ut,{children:s.jsx(ms,{onBackClick:T})});{const A=Ne(E,p,O,I);return s.jsx(Ut,{children:s.jsx(Cs,{currentTenantCompanyName:S.companyName,statementListView:l,productInformation:A,onBackClick:T,authParams:H,controllerEmails:x,isChargeCardFeatureEnabled:E,isDebitCardFeatureEnabled:p,isDebitCardSetupEnabled:O,isChargeCardSetupEnabled:I,isCardsCommentingEnabled:B,initialOpenThreadRequest:F,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:M,debitCardSummary:L,downloadEndPoint:f})})}}const Ln=[ra,Ja],cc=new Set(Ln),oc={containerWidth:new wa(100,58)},ic=({appContent:e})=>{const a=Da(),t=Ce(),r=me(),n=Ie(),{useDynamicConfig:f}=oe(),[h,g]=d.useState(!1),[D,c]=d.useState(!1),[l,v]=d.useState(!1),[S,m]=d.useState(!1),R=d.useRef(!1),B=d.useRef(null);d.useEffect(()=>()=>{B.current!=null&&(clearTimeout(B.current),B.current=null)},[]);const[F,u]=d.useState(!1),[p,w]=d.useState(!1),o=ae.getSignedInUser();if(o==null)throw Error("Can't access onboarding card page without signing in...");const P=y(U=>ie(U)),{configValue:E}=f(Re.zeniCardsConfig),O=y(U=>Fr(U)),{tenantEmailDomain:I}=P,b=y(U=>U.settingsViewState.profile.fetchState),x=y(U=>U.chargeCardListState.fetchState),i=y(U=>U.settingsViewState.profile.userId),C=y(U=>U.chargeCardConfigState.fetchState);d.useEffect(()=>{h===!1&&b!=="In-Progress"&&b!=="Completed"&&(t(Br()),g(!0)),D===!1&&C!=="In-Progress"&&C!=="Completed"&&(t(Ma()),c(!0)),l===!1&&x==="Not-Started"&&(v(!0),t(Pe()))},[h,l,x,D,C]),d.useEffect(()=>{b==="Completed"&&F===!1&&i!=null&&x==="Completed"&&O.cards.length>0&&(t(xr({userId:i})),t(on({cardId:O.cards[O.cards.length-1].id})),u(!0))},[b,F,i,x]),d.useEffect(()=>{if(!S&&O.fetchState==="Completed"&&O.cards.length===0){const U=Ue(n.state?.pathnameStackToGoBack),ne=U.poppedPathname??Ge(I);r(ne,{state:{pathnameStackToGoBack:U.newStack}})}},[O.fetchState,O.cards,S]);const j=y(U=>Na(U)),M=yt(j.updateStatus.fetchState),L=j.currentDisplayedCardId,{useFeatureGate:T}=oe(),{isFeatureEnabled:$}=T(Y.isChargeCardFeatureEnabled),Q=!!P.companyChargeCardInfo?.info?.isChargeCardEnabled,H=!P.userRole.includes("charge_card_user")&&$&&Q,A=y(U=>L!=null?dn(U.chargeCardState,L):null),G=()=>{L!=null&&(R.current=!0,B.current!=null&&clearTimeout(B.current),B.current=setTimeout(()=>{R.current=!1,B.current=null},5e3),t(da(L,H,!0)),t(Pe(!0)),m(!0))},W=$e(P);At({events:sa(W,Ln),onSubscribed:()=>{t(Pe(!0))},onEvent:(U,ne)=>{if(!cc.has(U))return;const J=vt(ne),_=R.current;if(U===ra){const X=ce(J?.card_id)??L;if(X!=null){const ee=Tt(J,X);if(ee!=null)return t(Ct(ee)),void(X!==L||_||G())}}if(U===Ja)return void t(Pe(!0));const z=ce(J?.card_id)??L;(L==null||z===L)&&L!=null?_||G():t(Pe(!0))}}),d.useEffect(()=>{if(S&&L!=null&&A!=null&&A.status.code!=="request_on_hold"){const U=he(P.tenantEmailDomain,L,o,A),ne=Se(n.state?.pathnameStackToGoBack,n.pathname);t(Lr()),A?.type.code==="business_virtual_credit_card"&&t($a()),r(U,{state:{pathnameStackToGoBack:ne},replace:!0}),R.current=!1,B.current!=null&&(clearTimeout(B.current),B.current=null)}},[S,A?.status.code]),d.useEffect(()=>{M==="In-Progress"&&j.updateStatus.fetchState==="Completed"&&setTimeout(G,3e3)},[M,j.updateStatus.fetchState]);const k=U=>{w(U)};if(b!=="Completed"||O.cards.length===0)return s.jsxs(jt,{children:[s.jsx(Xe,{isAppContentDrawerOpen:p,handleDrawerToggle:k}),s.jsx(ps,{})]});if(i==null)throw Error("Can't access my userId.");return s.jsxs(jt,{children:[s.jsx(Xe,{isAppContentDrawerOpen:p,handleDrawerToggle:k}),s.jsx(dc,{chargeCardListView:O,cardUserOnboardingView:j,navigate:r,currentTenant:P,myUserId:i,location:n,chargeCardCashbackRatePerTransaction:E.charge_card_cashback_rate_per_transaction!=null?E.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{k(!0)}}),e!=null?s.jsx(lc,{windowSize:a,children:e}):null]})},dc=fe(function(e,{currentTenant:a,cardUserOnboardingView:t,chargeCardListView:r,myUserId:n}){const f=na(e,!1,!1,!1);let h=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(h=!0),{cards:r.cards,showMenuIcon:h,companyLegalName:a.companyName,twoFAView:t.twoFAView,cardUserOnboardingLocalData:t.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:t.isDOBPresent,onboardingProgressStatus:t.onboardingProgressStatus}},function(e,a){const{navigate:t,cardUserOnboardingView:r,location:n,currentTenant:f}=a,{tenantEmailDomain:h}=f;return{updateCardUserOnboardingLocalData:g=>{e(Bt({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const D={...r.cardUserOnboardingLocalData,phone:g};e(Bt({localData:D}))}e(Qa(g,"CardUserOnboarding"))},onResendOtp:g=>{e(za(g,"CardUserOnboarding"))},onVerifyOtp:(g,D)=>{e(Ga(g,D,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(Rr()),g!=null&&ae.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(on({cardId:g}))},onBackClick:()=>{const g=Ue(n.state?.pathnameStackToGoBack),D=g.poppedPathname??Ge(h);t(D,{state:{pathnameStackToGoBack:g.newStack}})}}})(hs),lc=ve.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
width: ${e=>`${oc.containerWidth.value(e.windowSize)}%`};
|
|
38
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
-
`,jt=ve.div`
|
|
40
|
-
display: flex;
|
|
41
|
-
min-height: 100%;
|
|
42
|
-
width: 100%;
|
|
43
|
-
flex: 1 1 auto;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
align-items: center;
|
|
46
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
47
|
-
`,uc={containerWidth:new wa(100,58)},mc=({appContent:e})=>{const a=Da(),t=Ce(),r=me(),{cardId:n}=Aa(),f=Ie(),{useDynamicConfig:h,useFeatureGate:g}=oe(),[D,c]=d.useState(!1),[l,v]=d.useState(!1),[S,m]=d.useState(!1),[R,B]=d.useState(!1),F=ae.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const u=y(H=>ie(H));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=h(Re.zeniCardsConfig),w=y(H=>Ur(H,n)),{isFeatureEnabled:o}=g(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:P}=g(Y.isDebitCardFeatureEnabled),E=ke(P,u),O=_e({isDebitCardFeatureEnabled:P,isBankingOnlyTenant:E}),I=Ee(u),b=Ae(u),x=u.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=De({isCardsOnlyTenant:I,isChargeCardFeatureEnabled:o,isBookKeepingTenant:b,isDebitCardProductVisible:O,chargeCardsCreditAccountLimit:x}),C=w.chargeCard,j=y(H=>H.chargeCardConfigState.fetchState);d.useEffect(()=>{D===!1&&j!=="In-Progress"&&j!=="Completed"&&(t(Ma()),c(!0)),l===!1&&w.fetchState==="Not-Started"&&(v(!0),t(da(n,!1,i)))},[l,w.fetchState,D,j]);const M=C?.type.code==="business_physical_debit_card"||C?.type.code==="business_virtual_debit_card";d.useEffect(()=>{if(w.fetchState==="Completed"){if(S===!1&&(M===!1||M&&C.status?.code!=="active"||M&&C.status.code==="active"&&C.isPinSet||C.cardHolderUserId!==F.userId)){const H=he(u.tenantEmailDomain,n,F,C,!0),A=Se(f.state?.pathnameStackToGoBack,f.pathname);r(H,{state:{pathnameStackToGoBack:A}})}else if(S&&w.isRefreshingViewInBackground===!1&&C?.isPinSet===!0){t(Or({chargeCardId:n}));const H=he(u.tenantEmailDomain,n,F,C,!0),A=Se(f.state?.pathnameStackToGoBack,f.pathname);t($a()),r(H,{state:{pathnameStackToGoBack:A}})}}},[w.fetchState,C?.type.code,S,w.isRefreshingViewInBackground]);const L=ae.getZeniOtpTokenForCardHolder(n),T=y(H=>Nt(H.userState,F.userId)),$=()=>{C?.isPinSet!==!0&&t(ca(n,!0))};d.useEffect(()=>{w.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout($,3e3),m(!0))},[w.updateDebitCardPinAttemptFetchState.fetchState]);const Q=H=>{B(H)};if(j!=="Completed"||C==null)return s.jsx(_a,{fetchState:"In-Progress"});if(T?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(hc,{children:[s.jsx(Xe,{isAppContentDrawerOpen:R,handleDrawerToggle:Q}),s.jsx(Cc,{cardId:n,card:C,phone:T.phone,signedInUser:F,isSandboxEnv:ft(),debitCardDetailState:w,signedInUserToken:L,navigate:r,currentTenant:u,location:f,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Q(!0)}}),e!=null?s.jsx(pc,{windowSize:a,children:e}):null]})},Cc=fe(function(e,{debitCardDetailState:a,cardId:t}){const r=Mt(e,t),n=a.updateStatus,f=na(e,!1,!1,!1);let h=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(h=!0),{showMenuIcon:h,vgsVaultId:Ka.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,debitCardDetailState:h}=a,g=h.chargeCard?.cardProviderID,{tenantEmailDomain:D}=f;return{onGetOtp:c=>{g!=null&&e(Qa(c,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:c=>{e(Kt(r,c))},onResendOtp:c=>{g!=null&&e(za(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ga(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ae.saveZeniOtpTokenForCardHolder(c,r)},onSetPinSuccess:()=>{e(jr({chargeCardId:r}))},onBackClick:()=>{const c=Ue(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("activate")===!0?Ge(D):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(fs),pc=ve.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
width: ${e=>`${uc.containerWidth.value(e.windowSize)}%`};
|
|
51
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
-
box-shadow: ${e=>`${ja.sp0} 2px ${ja.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
-
`,hc=ve.div`
|
|
54
|
-
display: flex;
|
|
55
|
-
min-height: 100%;
|
|
56
|
-
width: 100%;
|
|
57
|
-
flex: 1 1 auto;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
align-items: center;
|
|
60
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
61
|
-
box-shadow: ${e=>`${ja.sp0} 2px ${ja.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
-
`,fc={overlayWidth:new wa(tt[12],tt[12],tt[9])},gc=fe(function(e,a){const t=ht(e,!1,!1),r=a.lineId,n=t.customAddress[r],f=t.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:a.googleAPIKey,customAddress:n,customAddressStatus:f,lineId:r}},function(e,a){const{newCustomAddressId:t,lineId:r,chargeCardTypeOption:n}=a;return{onSubmitHandler:f=>{t!=null&&e(ln(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const h=Fs(f);e(Nr({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:h})),e(Mr(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{a.onDismissClick(),t!=null&&e(Hr({addressId:t,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(gs),bc=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:t})=>{const r=gt(),n=Da(),f=()=>{a()},h=y(g=>Vr(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(fn,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:fc.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,D)=>(D==="backdropClick"||D==="escapeKeyDown")&&f(),children:s.jsx(gc,{googleAPIKey:Ka.googleMapsAPIKey,onDismissClick:f,lineId:e,chargeCardTypeOption:t,newCustomAddressId:h})})},yc=fe(function(e,a){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isChargeCardSetupEnabled:h,isDebitCardSetupEnabled:g}=a,D=ht(e,t&&h,r&&g);return{issueChargeCards:D,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:h,isDebitCardSetupEnabled:g,cardHolderCandidates:D.userList.map(c=>c.user).filter(Boolean),allRoles:D.userList.map(c=>c.userRole),allAccountingClasses:D.allAccountingClasses,userList:D.userList}},function(e,a){return{onIssueCardClick:()=>{e(zr())},onSaveChangesToLocalStore:t=>{e(Gr(t))},onDismissClick:()=>{e(un()),a.navigate("../")},resetCustomAddressByLineID:(t,r)=>{e(ln(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}})(Ss);function Sc(){const e=ae.getSignedInUser(),a=me(),t=Ce(),r=bs(),[n]=Vt(),f=n.get("cardType"),{useFeatureGate:h}=oe(),{isFeatureEnabled:g}=h(Y.isIssuePhysicalCardEnabled),{isFeatureEnabled:D}=h(Y.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:c}=h(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=h(Y.isChargeCardFeatureEnabled),v=y($=>ie($)),S=ke(c,v),m=_e({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:S}),R=Ee(v),B=Ae(v),F=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,u=De({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:l,isBookKeepingTenant:B,isDebitCardProductVisible:m,chargeCardsCreditAccountLimit:F}),[p,w]=d.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");d.useEffect(()=>{p||(w(!0),t($r(m&&P,u&&o,!1)))},[p,w,t]);const o=!!v.companyChargeCardInfo?.info?.isChargeCardEnabled,P=!!v.companyDebitCardInfo?.info?.isDebitCardEnabled,E=y($=>ht($,u&&o,m&&P)),O=E.fetchState,I=E.issueCardStatus.fetchState,b=E.lastSelfIssuedDebitCardId,x=y($=>b!=null?dn($.chargeCardState,b):void 0),[i,C]=d.useState(null),[j,M]=d.useState(null),L=()=>{C(null)},T=($,Q)=>{C($),M(Q)};return d.useEffect(()=>{if(I==="Completed"){if(b!=null&&x?.type.code==="business_virtual_debit_card"){let $;$=x?.status.code==="request_on_hold"&&e.userId===x.cardHolderUserId?Sn(v.tenantEmailDomain):he(v.tenantEmailDomain,b,e,x),a($)}else a("../");t(un())}},[I,b]),O==="Completed"?s.jsxs(s.Fragment,{children:[i!==null&&j!==null?s.jsx(bc,{closeDrawerHandler:L,lineId:i,chargeCardTypeOption:j}):null,s.jsx(yc,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:D,isDebitCardFeatureEnabled:m,isChargeCardFeatureEnabled:u,isChargeCardSetupEnabled:o,isDebitCardSetupEnabled:P,navigate:a,fetchState:E.fetchState,openAddAddressDrawerHandler:T,defaultCardType:f==="creditCard"||f==="debitCard"?f:void 0})]}):O==="Error"?s.jsx(qa,{}):s.jsx(ys,{})}const Rn=[ra,Ja],Ic=new Set(Rn),Ec=ve.div`
|
|
63
|
-
display: flex;
|
|
64
|
-
height: 100vh;
|
|
65
|
-
width: 100%;
|
|
66
|
-
flex: 1 1 auto;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
overflow: auto;
|
|
69
|
-
align-items: center;
|
|
70
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
71
|
-
`,Ac=fe(function(e,a){const{myPendingActivationChargeCardListState:t}=a;return{myPendingActivationChargeCardListView:t,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigate:t,currentTenant:r,location:n,signedInUser:f,myPendingActivationChargeCardListState:h}=a,{tenantEmailDomain:g}=r,{cards:D}=h;return{onChargeCardRowClick:c=>{const l=yn(D,c),v=he(g,c,f,l),S=Se(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(c,l)=>{e(ct({uiState:{sortKey:c,sortOrder:l}}))},onReloadCards:()=>{e(Pe())},onBackClick:()=>{const c=r.userRole.includes("charge_card_user");e(ct({uiState:{sortKey:c?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(Is);function kc(){const e=me(),a=Ce(),t=Ie(),r=gt(),[n,f]=d.useState(!1),h=y(T=>Qr(T)),g=y(T=>ie(T)),D=y(T=>Je(T,g.companyId)),c=ea(D.controllers),{useFeatureGate:l}=oe(),{isFeatureEnabled:v}=l(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=l(Y.isDebitCardFeatureEnabled),m=ke(S,g),R=_e({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),B=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,F=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,u=Me(),p=Ee(g),w=Ae(g),o=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,P=De({isCardsOnlyTenant:p,isChargeCardFeatureEnabled:v,isBookKeepingTenant:w,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:o}),E=He(u?.loggedInUserRoleMap),O=y(T=>ta(T)),{creditAccount:I,creditAccountRepayment:b}=y(T=>aa(T)),x=y(T=>sn(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),i=[...new Set(x)],C=y(T=>Ya(T,i));d.useEffect(()=>{n||h.fetchState==="Completed"||h.fetchState==="In-Progress"||(f(!0),a(Pe()),a(Ma()))},[n,a,h.fetchState]),d.useEffect(()=>{if(h.fetchState==="Completed"&&h.cards.length===1&&j!=null){const T=he(g.tenantEmailDomain,h.cards[0].id,j,h.cards[0]);e(T,{state:{message:t.state?.message}})}},[h.fetchState,h.cards]);const j=ae.getSignedInUser();d.useEffect(()=>{I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&P&&F&&E&&a(Ve()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&E&&a(mt()),C.fetchState!=="Completed"&&C.fetchState!=="In-Progress"&&R&&B&&E&&a(cn())},[I.fetchState,b.fetchState,a,C.fetchState,R,B,E,P,F]);const M=$e(g);if(At({events:sa(M,Rn),onEvent:(T,$)=>{if(!Ic.has(T))return;const Q=vt($);if(T===ra){const H=ce(Q?.card_id);if(H!=null){const A=Tt(Q,H);if(A!=null)return void a(Ct(A))}}a(Pe(!0))},onSubscribed:()=>{a(Pe(!0))}}),j==null)throw Error("Can't access address page without signing in...");const L=h.cards!=null&&h.cards.length>0;if(h.fetchState==="Completed"||L){const T=Ne(P,R,B,F);return s.jsx(Ec,{children:s.jsx(Ac,{navigate:e,currentTenant:g,signedInUser:j,productInformation:T,myPendingActivationChargeCardListState:h,isChargeCardFeatureEnabled:P,isDebitCardFeatureEnabled:R,isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:F,chargeCardCashbackDetailState:O,creditAccount:I,creditAccountRepayment:b,depositAccountListWithDebitCardIssued:C,controllerEmails:c,location:t})})}return s.jsx(_a,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})}const _c=fe(function(e,a){const{companyId:t,companyLegalName:r}=a;return{chargeCardSetupView:ka(e,t),admins:a.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,a){const{navigate:t,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:f,isChargeCardSetupEnabled:h,signedInUser:g,location:D,productInformation:c,isEarlyPayEnabled:l,controllerEmails:v,chargeCardsCreditAccountLimit:S}=a;return{onSetupButtonClick:m=>{if(g!=null&&q.trackCardsPromoPageClicked("enable cards"),n)switch(q.trackCardsEnableCardsClick(v,c,"Cards Promo"),m){case"credit":e(je(r,!0,"charge_cards",l,!1));break;case"debit":e(je(r,!0,"debit_cards",l,!1));break;case"debit_and_credit":e(S===0?je(r,!0,"debit_cards",l,!0):je(r,!0,"charge_cards__debit_cards",l,!1))}else switch(q.trackCardsSetupCardsClick(v,c,"Cards Promo"),m){case"credit":e(je(r,!1,"charge_cards",l,!1));break;case"debit":e(je(r,!1,"debit_cards",l,!1));break;case"debit_and_credit":e(S===0?je(r,!1,"debit_cards",l,!0):je(r,!1,"charge_cards__debit_cards",l,!1))}},onBackClick:()=>{const m=Ue(D.state?.pathnameStackToGoBack);let R=m.poppedPathname;R==null&&(R=f||h?"..":"../.."),t(R,{state:{pathnameStackToGoBack:m.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{n?(e($a()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Kr(r))}}})(As),Dc=()=>{const e=me(),{tenantEmailDomain:a}=Aa(),[t]=Vt(),r=t.get("cardPromoType"),n=Ce(),{useDynamicConfig:f,useFeatureGate:h}=oe(),[g,D]=d.useState(!1),{isFeatureEnabled:c}=h(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=h(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:v}=h(Y.isChargeCardFeatureEnabled),{configValue:S}=f(Re.zeniCardsConfig),m=y(te=>ie(te)),R=y(te=>Je(te,m.companyId)),B=ea(R.controllers),F=S.charge_card_cashback_rate_per_transaction!=null?S.charge_card_cashback_rate_per_transaction:.0175,u=Ie(),p=ae.getSignedInUserTenant(a)?.companyId??m.companyId,w=y(te=>ka(te,p)),o=w.primaryFundingAccount,P=m.companyBillPayInfo?.info,E=Ee(m),O=Ae(m),I=ke(c,m),b=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=_e({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:I}),i=De({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:v,isBookKeepingTenant:O,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:b}),C=bn({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:v,isBookKeepingTenant:O}),j=x&&i===!1,M=P?.businessVerificationStatus?.code==="verified"&&(j||o?.accType==="depositAccount"||Yr(o?.providerVerificationStatus?.code??"")),L=ae.getSignedInUser(),T=!!m.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=!!m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Q=!!m.company?.companyChargeCardInfo?.isChargeCardEnabled,H=!!m.company?.companyDebitCardInfo?.isDebitCardEnabled,A=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,G=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,W=!!m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,k=te=>{D(te)},U=y(te=>te.chargeCardSetupViewState.fetchState);if(L==null)throw Error("Can't access Charge Card promo page without signing in...");const ne=Me(),J=He(ne?.loggedInUserRoleMap),_=pt(ne?.loggedInUserRoleMap),[z,X]=d.useState(!1),[ee,Z]=d.useState(!1),[re,Te]=d.useState(!1);d.useEffect(()=>{z===!1&&u.state?.message==="activation"&&X(!0)},[u.state]),d.useEffect(()=>{ee||U!=="Not-Started"||p==null||(Z(!0),n(Ia(p,!0)))},[ee,U,p,n]);const ge=m.companyChargeCardInfo?.info!=null&&ia({cardInfo:m.companyChargeCardInfo.info,isProductVisible:C&&Q,isTOSAccepted:$,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:J,isUserHasCardsAccess:_}),be=m.companyDebitCardInfo?.info!=null&&ia({cardInfo:m.companyDebitCardInfo.info,isProductVisible:x&&H,isTOSAccepted:W,isSetupEnabled:G,isUserHasCardsAdminLevelAccess:J,isUserHasCardsAccess:_}),ze=x&&be&&C&&b>=0&&ge?"debit_and_credit":x&&be?"debit":"credit",K=vs(r,ze),ye=w?.chargeCardTermsDetails?.fetchStatus?.fetchState,Oe=d.useRef(null);d.useEffect(()=>{ye==="In-Progress"?Oe.current=K:ye!=="Error"&&ye!=="Not-Started"||(Oe.current=null)},[ye,K]);const Fe=ye!=="In-Progress"&&ye!=="Completed"||Oe.current==null?K:Oe.current;d.useEffect(()=>{K==="credit"&&(A||C===!1&&G)||K==="debit"&&G||K==="debit_and_credit"&&G&&A?e("../"):(K==="debit_and_credit"&&$===!0&&W===!0||K==="credit"&&($===!0||C===!1&&W===!0)||K==="debit"&&W===!0)&&J===!0&&e("../setup")},[M,A,G,K,$,W]),d.useEffect(()=>{re||(n(Zr("cardAdmin")),Te(!0))},[re]);const pe=y(te=>nn(te.userState,te.userRoleState,te.userListViewState,"cardAdmin")),Be=Ne(C,x,G,A);return(te=>{switch(te){case"credit":return Q;case"debit":return H;case"debit_and_credit":return Q&&H;default:return!1}})(Fe)?(ge||be)&&U==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(St,{analytics:q,onLoad:()=>{if(q.trackPageLoaded(hn.Event.cardsPromoPage),!!C&&!A||!!x&&!G||!!C&&!!x&&!G&&!A){const te=wc({isDebitCardSetupEnabled:G,isChargeCardSetupEnabled:A,isCreditCardProductVisibleForExpressInterest:C,isDebitCardProductVisible:x});q.trackCardsPromoView(B,Be,"Page",te,"Promo Page")}}}),s.jsx(Za,{showConfetti:z}),s.jsx(Xe,{isAppContentDrawerOpen:g,handleDrawerToggle:k}),s.jsx(_c,{signedInUser:L,location:u,showEnableCardButton:M,isCompanyBusinessVerificationAndPaymentSetUpDone:M,isChargeCardSetupEnabled:A,isDebitCardSetupEnabled:G,companyLegalName:m.companyName,adminList:pe.users,isCheckingEnabled:T,navigate:e,companyId:p,cardPromoType:Fe,controllerEmails:B,productInformation:Be,isCreditCardProductVisible:i,isDebitCardFeatureEnabled:c,isEarlyPayEnabled:l,cashbackRate:F,chargeCardsCreditAccountLimit:b,onClickMenuIcon:()=>{k(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Xe,{isAppContentDrawerOpen:g,handleDrawerToggle:k}),s.jsx(Es,{})]}):s.jsx(Sa,{to:"../",replace:!0})},wc=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:a,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:r})=>t&&r&&!e&&!a?"Credit & Debit Card":t&&!a?"Credit Card":r&&!e?"Debit Card":"";function Xc(){const e=Ie(),a=y(U=>ie(U)),{useFeatureGate:t}=oe(),{isFeatureEnabled:r}=t(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=t(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=t(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:h}=t(Y.isChargeCardPaymentHistoryFeatureEnabled),g=ke(n,a),D=_e({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),c=ks(a,r,n),l=!!a.company?.companyChargeCardInfo.isChargeCardTOSAccepted,v=!!a.company?.companyDebitCardInfo.isDebitCardTOSAccepted,S=!!a.company?.companyChargeCardInfo?.isChargeCardEnabled,m=!!a.company?.companyDebitCardInfo?.isDebitCardEnabled,R=!!a.companyChargeCardInfo?.info?.isChargeCardEnabled,B=!!a.companyDebitCardInfo?.info?.isDebitCardEnabled,F=Me(),u=He(F?.loggedInUserRoleMap),p=pt(F?.loggedInUserRoleMap),{isFeatureEnabled:w}=t(Y.isCashbackFeatureEnabled),o=a.userRole.includes("charge_card_user"),P=!o,E=!o&&R,O=a?.userRole!=null&&Wr(a?.userRole),I=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O)&&qr(F?.loggedInUserRoleMap),b=Xr(F?.loggedInUserRoleMap),x=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O)&&Jr(F?.loggedInUserRoleMap),{isFeatureEnabled:i}=t(Y.isDepositAccountsFeatureEnabled),C=i&&!O&&Gt(F?.loggedInUserRoleMap),j=R&&S&&!O,M=B&&m&&!O,L=c&&!O&&He(F?.loggedInUserRoleMap),T=es(F?.loggedInUserRoleMap),$=Ee(a),Q=Ae(a),H=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=De({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:r,isBookKeepingTenant:Q,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:H}),G=a.companyChargeCardInfo?.info!=null&&ia({cardInfo:a.companyChargeCardInfo.info,isProductVisible:A&&S,isTOSAccepted:l,isSetupEnabled:R,isUserHasCardsAdminLevelAccess:u,isUserHasCardsAccess:p}),W=a.companyDebitCardInfo?.info!=null&&ia({cardInfo:a.companyDebitCardInfo.info,isProductVisible:D&&m,isTOSAccepted:v,isSetupEnabled:B,isUserHasCardsAdminLevelAccess:u,isUserHasCardsAccess:p}),k=G||W;return s.jsxs(Un,{children:[u?s.jsx(se,{path:"setup",element:s.jsx(xt,{isBillPayAdminLevelAccess:I,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:L,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:b,productType:"charge_cards",type:"setup"})}):null,u?s.jsx(se,{path:"verification",element:s.jsx(xt,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:b,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:L,isUserHasOnlyCardAccess:T,productType:"charge_cards",type:"verification"})}):null,s.jsx(se,{path:"promo",element:s.jsx(Dc,{})}),j||M?s.jsxs(s.Fragment,{children:[s.jsx(se,{path:"/",element:s.jsx(Rt,{isPaymentDrawerOpen:!1})}),L&&f?s.jsx(se,{path:"payment",element:s.jsx(Rt,{isPaymentDrawerOpen:!0})}):null,s.jsx(se,{path:"activate",element:s.jsx(kc,{})}),s.jsx(se,{path:"onboard",element:s.jsx(ic,{})}),u?s.jsx(se,{path:"new",element:s.jsx(Sc,{})}):null,w&&P?s.jsx(se,{path:"cashback",element:s.jsx(Us,{})}):null,E?s.jsx(se,{path:"statements",element:s.jsx(sc,{})}):null,L&&h&&R?s.jsx(se,{path:"payment-history",element:s.jsx(rc,{})}):null,s.jsx(se,{path:":cardId/activate",element:s.jsx(Vs,{})}),s.jsx(se,{path:":cardId/setPin",element:s.jsx(mc,{})}),s.jsx(se,{path:":cardId/addToWallet",element:s.jsx(Bs,{})}),s.jsx(se,{path:":cardId/*",element:s.jsx(Ks,{})}),s.jsx(se,{path:"*",element:s.jsx(qa,{})})]}):(l||v)&&u?s.jsx(se,{path:"*",element:s.jsx(Sa,{to:"../setup"})}):k?s.jsx(se,{path:"*",element:s.jsx(Sa,{to:"../promo",state:e.state})}):s.jsx(se,{path:"*",element:null})]})}export{Xc as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-OUACL7Sm.js";import{a}from"./sentry-COtwFETz.js";import{u as D,g as v,j as m,N as w}from"./core-CvVQwh-G.js";import{JY as A,eS as O,fr as _,nh as j,fS as h,fq as U,eZ as L,K3 as F}from"./zeni-epic-state-CECAZYIg.js";import{u as $,z as p,L as g,D as k,o as H}from"./index-LzTRB_X0.js";import{n as z}from"./mui-B_sWk5no.js";import{t as R}from"./getLocaleForTenant-BKpCR6Mg.js";import{g as P,Q as q}from"./QBOConnectionScreen-YQRuxVuF.js";import"./recharts-ScPc1hFQ.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";import"./empty-CqdRwXT0.js";import"./pdf-lib-B6zbzfIK.js";import"./index-DkXdrecr.js";import"./url-DgoPdzhF.js";import"./index-6ei8cz0C.js";import"./decodeURIComponentSafe-C_ttRntx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="12781307-110a-4794-9625-50caba831efa",t._sentryDebugIdIdentifier="sentry-dbid-12781307-110a-4794-9625-50caba831efa")}catch{}})();const G=z.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex: 1 1 auto;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100vh;
|
|
9
|
-
background-color: ${t=>t.theme.colors.background};
|
|
10
|
-
box-shadow: ${t=>`0px 2px ${H.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function fe(){const t=D(),d=v(),{setLoading:i,clearAllLoading:x}=$(),f=a.useRef(!1),c=a.useRef(!1),{code:S,realmId:b,state:T}=P(d.search),y=S!==""&&b!==""&&T!=="",I=m(l=>A(l)),e=m(l=>O(l)),n=m(l=>l.tenantState.fetchState),r=m(l=>l.tenantState.activeTenantFetchState.fetchState),o=p.getSignedInUser(),u=p.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,N=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{i(g.CONNECTION_AUTH)},[i]),a.useEffect(()=>{f.current||o==null||u==null||(f.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(i(g.TENANT_FETCHING),t(_(o.userId,u))))},[f,n,i]),a.useEffect(()=>{e.tenantId==null&&!c.current&&o!=null&&(c.current=!0,!(u==null||u!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(j(o.userId)))},[c,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(i(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(U(e.tenantId)),p.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),k.updateAppLocaleID(R(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&p.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||x()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:y||N===!1?C.jsx(G,{children:C.jsx(q,{})}):C.jsx(w,{to:"/",replace:!0})}export{fe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-OUACL7Sm.js";import{z as n}from"./index-LzTRB_X0.js";import{g as d}from"./QBOConnectionScreen-YQRuxVuF.js";import"./sentry-COtwFETz.js";import{g as p,N as a}from"./core-CvVQwh-G.js";import"./zeni-epic-state-CECAZYIg.js";import"./recharts-ScPc1hFQ.js";import"./mui-B_sWk5no.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";import"./empty-CqdRwXT0.js";import"./pdf-lib-B6zbzfIK.js";import"./index-DkXdrecr.js";import"./url-DgoPdzhF.js";import"./index-6ei8cz0C.js";import"./decodeURIComponentSafe-C_ttRntx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-OUACL7Sm.js";import{t as $e,A as Ce}from"./AddressScreen-DLTJPBtB.js";import Ke from"./NotFoundScreen-BXgaohYF.js";import{a as g}from"./sentry-COtwFETz.js";import{h as oe,g as se,u as ie,i as re,j,N as D,n as ce,l as ze,o as Me,p as K}from"./core-CvVQwh-G.js";import{K as de,I as le,z as V,a as ue,m as qe,G as _,k as Qe,q as U,s as H,d as G,B as we,f as X,ap as Ze,X as He,aq as Ie,j as te,ar as We,as as ke,o as Xe,at as Ye,au as Te,av as Je}from"./index-LzTRB_X0.js";import{eS as J,fj as et,f1 as pe,e$ as me,bs as tt,nf as at,ff as nt,bO as ot,jl as ae,jo as ve,Ks as st,bT as it,c1 as ge,sS as fe,sD as rt,KY as Y,sT as _e,Ik as ct,kp as Ue,KZ as Ve,K_ as dt,K$ as lt,L0 as ut,jj as pt,jm as mt,sF as Be,sR as gt,bE as xe,cu as ft,t3 as Ee,qM as ht,qA as yt,kh as St,fH as bt,fG as Ct,fF as It,L1 as kt,sx as Tt,t4 as xt,t7 as Et,ta as Ot,tg as Pt,cT as Dt}from"./zeni-epic-state-CECAZYIg.js";import{n as he}from"./mui-B_sWk5no.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-YQRuxVuF.js";import"./recharts-ScPc1hFQ.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";import"./empty-CqdRwXT0.js";import"./pdf-lib-B6zbzfIK.js";import"./index-DkXdrecr.js";import"./url-DgoPdzhF.js";import"./index-6ei8cz0C.js";import"./decodeURIComponentSafe-C_ttRntx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="f116ee6c-fa47-4a52-91ff-dd4a353be113",t._sentryDebugIdIdentifier="sentry-dbid-f116ee6c-fa47-4a52-91ff-dd4a353be113")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const d=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(d.reportsInOrder.map(c=>({fetchState:c.fetchState,error:c.error}))).fetchState}},function(t,o){const{themeState:s,navigate:d,location:c}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=U(c.state?.pathnameStackToGoBack,c.pathname);d("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ze),wt=()=>{const t=oe(),o=se(),s=ie(),d=de(),[c,r]=g.useState(!1),[p,y]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=V.getSignedInUser(),{useFeatureGate:l}=ue(),C=qe(),{isFeatureEnabled:x}=l(_.isApAgingFeatureEnabled),{isFeatureEnabled:A}=l(_.isArAgingFeatureEnabled),{isFeatureEnabled:E}=l(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:k}=l(_.isReferralFeatureEnabled),{isFeatureEnabled:S}=l(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:v}=l(_.isDebitCardFeatureEnabled),I=Qe(),f=j(u=>J(u)),{isFeatureEnabled:R}=l(_.isTreasuryEnabled),m=f.company!=null&&et(f.company),B=R&&m,T=j(u=>u.onboardingCustomerViewState.fetchState),F=f.excludedResources,L=f.companyId??V.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const b=pe(v,f),O=me(f),P=[],N=F?.resources?.find(u=>u.resource==="/reports/top_expenses")==null,q=F?.resources?.find(u=>u.resource==="/reports/task_card")==null,Q=f?.userRole!=null&&tt(f?.userRole),$=F?.resources?.find(u=>u.resource==="/bills")==null&&!Q,z=F?.resources?.find(u=>u.resource==="/reimbursements")==null;if(N===!1&&P.push("top_expenses"),q===!1&&P.push("task_card"),$===!1&&P.push("bill_pay_card","bill_pay_promo_card"),z===!1&&P.push("reimbursement_card","reimbursement_promo_card"),E===!1&&P.push("zeni_accounts_promo_card"),k===!1&&P.push("rewards_card"),g.useEffect(()=>{T!=="Completed"||c||b||O||(r(!0),s(at(i.userId,L,f.tenantId,!0,!1,P)))},[c,T,b,O,i,f.tenantId,s]),g.useEffect(()=>{(b||O)&&setTimeout(()=>{y(!0)},5e3)},[b,O]),T!=="Completed")return a.jsx(D,{to:"../"});if(T==="Completed"&&p){const u=U(o.state?.pathnameStackToGoBack,o.pathname);if(b)return a.jsx(D,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:u,message:"activation"}});if(O)return a.jsx(D,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:u,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:G,onLoad:u=>(M=>M.trackPageLoaded(X.Event.onboardingDashboardActivation))(u)}),a.jsx(jt,{navigate:t,location:o,themeState:d,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:A,shouldFetchZeniAccountsPromoCard:E,shouldFetchRewardsPlanCard:k,isExpenseAutomationEnabledForUser:I,isExpenseAutomationFeatureEnabledV2:S,isTreasuryEnabled:B,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:C.colors.grey5}})},Oe=he.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
5
|
-
`,Pe=he.div`
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
align-items: center;
|
|
9
|
-
min-width: calc(100% - ${ke}px);
|
|
10
|
-
padding-left: ${ke}px;
|
|
11
|
-
flex: 1;
|
|
12
|
-
|
|
13
|
-
${t=>t.theme.breakpoints.down("md")} {
|
|
14
|
-
width: 100%;
|
|
15
|
-
padding-left: ${Xe.sp0};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
-
`,De=ce(function(t,o){const{companyId:s,isAdmin:d,currentTenant:c,isOnAddressPage:r}=o,p=V.getSignedInUser(),y=c.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:y??""},n=J(t),i=fe(t,s),l=Ve(t),C=ge(c?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",x=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:G,isRefreshingViewInBackground:!1,isDisabled:C,companyTitles:x.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Ye.fileMicroServiceBaseUrl,authParams:e},signedInUser:V.getSignedInUser(),currentTenant:c,isAdmin:d,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:l,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:d,themeState:c,navigate:r,location:p}=o,{tenantEmailDomain:y}=d;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Et(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Tt(s,!0,!1))},handleOnConnectClick:()=>{G.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:l,userId:C,name:x,email:A,ssn:E,nationalityCountryCode:k,dob:S,phone:v,syncToken:I,selectDocument:f,role:R,ownership:m,isSelectedForVerification:B,userVerificationStatus:T,fileIds:F,isPhoneVerified:L}=i;let b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:l,userId:C,firstName:x.firstName,lastName:x.lastName,email:A,ssn:E,nationalityCountryCode:k?.selectedOption!=null?Te(k.selectedOption):void 0,phone:v,birthday:S!=null?xe(S?.toString()):S,syncToken:I,titleAtCompany:R.selectedOption,ownershipInCompany:m,documentTypeSelectedForVerification:b,isSelectedForVerification:B,userVerificationStatus:T,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:L}});t(Ee({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:l,companyLegalName:C,companyTaxId:x,companyWebsite:A,companyPhone:E,primaryContactEmail:k,primaryContactName:S,primaryContactUserId:v,primaryContactSyncToken:I,syncToken:f,fileIds:R,typeOfIncorporation:m,stateOfIncorporation:B,incDate:T,companySourceOfFunds:F,companySourceOfFundsDescription:L,companySubIndustry:b,countriesOfOperations:O,purposeOfAccount:P,purposeOfAccountDescription:N,regulatedStatus:q,regulatedStatusDescription:Q,transactionVolume:$,transactionVolumeDescription:z,usNexus:u,usNexusTypes:M}=e,w={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:l?.selectedOption??"",companyLegalName:C,taxIdOrEIN:x,website:A!=""&&A!=null?ft(A):void 0,phone:E,syncToken:f,fileIds:R,incDate:T!=null?xe(T?.toString()):T,typeOfIncorporation:m?.selectedOption??"",stateOfIncorporation:B?.selectedOption??"",companySourceOfFunds:F?.selectedOption??"",companySourceOfFundsDescription:L,companySubIndustry:b?.selectedOption??"",countriesOfOperations:O?.selectedOptions.map(Z=>Z.length===2?Z:Te(Z))??[],purposeOfAccount:P?.selectedOption??"",purposeOfAccountDescription:N,regulatedStatus:q??"",regulatedStatusDescription:Q,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:z,usNexus:u,usNexusTypes:M?.selectedOptions??[]},ee={userId:v,firstName:S.firstName,lastName:S.lastName,email:k,syncToken:I};t(Ee({companyDetails:w,primaryContactDetails:ee}))},onAddressClick:(e,n)=>{const i=Ae(y,e,n),l=U(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:l}})},onRegisteredAddressClick:(e,n)=>{const i=Ae(y,e,n),l=U(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:l}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=U(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{c.toggle()},handleLogOutClick:()=>{const e=U(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=U(p.state?.pathnameStackToGoBack,p.pathname);r(`/${y}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(We),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const d=oe(),c=se(),r=ie(),p=He(),y=de(),[e,n]=g.useState(!1),[i,l]=g.useState(!1),[C,x]=g.useState(!1),{tenantEmailDomain:A}=re(),E=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:S}=k(_.isDebitCardFeatureEnabled),v=ze("/:tenantEmailDomain/onboarding")!==null&&c.search?.includes("code"),I=j(h=>h.onboardingCustomerViewState.fetchState),f=j(h=>h.onboardingCustomerViewState.currentStep),R=j(h=>h.onboardingCustomerViewState.uiState),m=j(h=>J(h)),B=j(h=>h.userRoleConfigState.fetchState),T=j(h=>h.cardPaymentViewState),F=Ie(T.addCardPaymentSourceStatus.fetchState),L=T.addCardPaymentSourceStatus.fetchState,{code:b,realmId:O,state:P}=At(c.search),N=m.externalConnections?.accounting[0],q=N?.connectionType,Q=N?.connectionName,$=N?.connectionId??"",z=V.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(l(!0),r(ae()))},[i,r]),g.useEffect(()=>{C||(ve(["card"]),x(!0))},[C]),g.useEffect(()=>{F==="In-Progress"&&L==="Completed"&&r(ae())},[F,L]),g.useEffect(()=>{Ft(b,O,P,$,z)===!0&&m.externalConnections?.saveConnectionState!=="In-Progress"&&I==="Completed"&&(r(st(m.tenantId,{connection_type:q??"accounting",connection_name:Q??"quickbooks_online",authorization_code:b,realm_id:O,connection_id:$,user_id:z},it(window.location.origin+"/onboarding/auth"))),G.trackOnboardingSaveQBOConnection(O,$),d(c.pathname))},[b,O,P,c.pathname,I]),g.useEffect(()=>{ne.isInitiated===!1&&I==="Completed"&&ne.init("/onboarding/auth",m.tenantEmailDomain)},[I]);const u=m.companyId??V.getSignedInUserTenant(A)?.companyId,M=ge(m?.userRole??[]),w=j(h=>fe(h,u));g.useEffect(()=>{e||I!=="Not-Started"||u==null||(n(!0),r(rt(u,!0,!v)))},[e,I,u]),g.useEffect(()=>{m.externalConnections?.saveConnectionState!=="Completed"&&m.externalConnections?.saveConnectionState!=="Error"||!R.isQBOPopupOpen||f!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[m.externalConnections?.saveConnectionState]),g.useEffect(()=>{I==="Completed"&&v&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[v,I]),g.useEffect(()=>{B==="Not-Started"&&r(ct(!0))},[B,r]);const ee=Ie(w.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{w.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&w.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&ee==null&&r(Ue({addressType:"company_registered_address",addressToCreate:w.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[w.companyDetailsLocalData?.addressStatus?.addressToCreate,w.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=w.isInterimEmailSent;if(V.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(S,m),Ge=me(m),ye=m.company?.companyOnboardingInfo.isOnboardingCompleted,Se=h=>h.trackPageLoaded(X.Event.onboardingPage),be=m.productSettings.isOtherProductsEnabled,Re=m.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Re?a.jsx(D,{to:"../../treasury"}):Le?a.jsx(D,{to:"../../checking"}):Ge?a.jsx(D,{to:"../../cards"}):a.jsx(D,{to:"../../dashboard"});const h=w.updateStatus.fetchState==="In-Progress";if(be&&!h)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:G,onLoad:Ne=>Se(Ne)}),a.jsx(De,{navigate:d,location:c,companyId:u,currentTenant:m,isAdmin:M,isOnAddressPage:o,themeState:y,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(D,{to:"../../onboarding/thankyou"})}else if(ye===!1&&E?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(D,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:G,onLoad:h=>Se(h)}),a.jsx(De,{navigate:d,location:c,companyId:u,currentTenant:m,isAdmin:M,isOnAddressPage:o,themeState:y,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function Ae(t,o,s){let d=`/${t}/onboarding/address`;return d=s!=null?d.concat(`/edit/${o}/${encodeURIComponent(s)}`):d.concat(`/new/${o}`),d}const Fe=he.div`
|
|
20
|
-
display: flex;
|
|
21
|
-
height: 100vh;
|
|
22
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
-
`,je=ce(function(t,o){const{companyId:s,currentTenant:d}=o,c=fe(t,s),r=Ve(t);return{hasVerifiedBankAccount:(c.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(d?.userRole??[])&&c.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:V.getSignedInUser(),currentTenant:d,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:d,navigate:c,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const y=U(r.state?.pathnameStackToGoBack,r.pathname);c("/signout",{replace:!0,state:{pathnameStackToGoBack:y,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const y=U(r.state?.pathnameStackToGoBack,r.pathname);c(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:y,message:"UpdatePaymentAddressDetail"}})}}})(Je),vt=()=>{const t=oe(),o=ie(),s=se(),d=de(),{useFeatureGate:c}=ue(),{isFeatureEnabled:r}=c(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),y=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=j(S=>J(S)),l=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(C,!1,!l))},[]);const C=i.companyId??V.getSignedInUserTenant(p)?.companyId;if(y.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const x=pe(r,i),A=me(i),E=j(S=>S.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||l?E==="Completed"&&k===!0&&l&&y?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:G,onLoad:S=>{S.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",Dt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:l,location:s,companyId:C,currentTenant:i,themeState:d,isVisitingFirstTime:e})]}):E==="Completed"&&k===!1&&y?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:G,onLoad:S=>{S.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:l,location:s,companyId:C,currentTenant:i,themeState:d,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:E}):x?a.jsx(D,{to:"../../checking"}):A?a.jsx(D,{to:"../../cards"}):a.jsx(D,{to:"../../dashboard"})};function oa(){return a.jsxs(Me,{children:[a.jsx(K,{path:"/",element:a.jsx(W,{})}),a.jsx(K,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(K,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(K,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(K,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(K,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(K,{path:"*",element:a.jsx(Ke,{})})]})}export{oa as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-OUACL7Sm.js";import{a as u}from"./sentry-COtwFETz.js";import{u as y,j as b,n as w,g as A,N}from"./core-CvVQwh-G.js";import{JY as U,eS as _,fr as k,JZ as L,nh as R,J_ as z}from"./zeni-epic-state-CECAZYIg.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-LzTRB_X0.js";import"./mui-B_sWk5no.js";import{t as P}from"./getLocaleForTenant-BKpCR6Mg.js";import"./recharts-ScPc1hFQ.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d8c18027-f87f-475a-9369-f0aec64ece7c",t._sentryDebugIdIdentifier="sentry-dbid-d8c18027-f87f-475a-9369-f0aec64ece7c")}catch{}})();const J=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(J,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-OUACL7Sm.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-CvVQwh-G.js";import{N_ as k,O5 as q,fH as L,fG as W,fF as J,iG as K,L6 as M,qD as Q,eS as V,Nw as D,iE as G,N$ as S,O8 as F,iC as T,iZ as j}from"./zeni-epic-state-CECAZYIg.js";import{bw as X,X as N,a as R,z as O,m as U,p,G as v,B as Z,bx as Y,o as _,by as ee,q as te}from"./index-LzTRB_X0.js";import{n as H}from"./mui-B_sWk5no.js";import"./sentry-COtwFETz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="877da16c-9bd1-4604-95c2-0fa6afa15764",e._sentryDebugIdIdentifier="sentry-dbid-877da16c-9bd1-4604-95c2-0fa6afa15764")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(M("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(W(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(L(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(T(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??$();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(G({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,{useFeatureGate:r}=R(),c=O.getSignedInUser(),b=h(u=>V(u)),g=U(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(z,{vendorId:d,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return E(e,"ach",t,n)}function ve(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
height: 100vh;
|
|
12
|
-
width: 100%;
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
box-shadow: ${e=>`0px 2px ${_.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
-
`,ie=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:i}=t,{tenantEmailDomain:d}=i;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(T(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(F({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??P();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(G({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),c=r.poppedPathname??P(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,r=O.getSignedInUser(),{useFeatureGate:c}=R(),b=U(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${_.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(z,{vendorId:d,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-OUACL7Sm.js";import{X as f,w as l,m as c}from"./index-LzTRB_X0.js";import{D as p}from"./mui-B_sWk5no.js";import"./sentry-COtwFETz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="a54850f2-6a1e-4978-b1f7-5253f7b0064a",e._sentryDebugIdIdentifier="sentry-dbid-a54850f2-6a1e-4978-b1f7-5253f7b0064a")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=f(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),i=c();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{m as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-OUACL7Sm.js";import{a as d}from"./sentry-COtwFETz.js";import{h as B,u as G,g as q,i as L,j as c,N as F,n as M,o as N,p as O}from"./core-CvVQwh-G.js";import{Me as _,eS as J,LC as R,kJ as W,Ic as k,Mj as Y,L5 as $,jJ as z,Id as S,LH as H,LI as V,L7 as K,L6 as Q}from"./zeni-epic-state-CECAZYIg.js";import{aS as U,d as X,p as Z,q as tt}from"./index-LzTRB_X0.js";import"./mui-B_sWk5no.js";import{d as I}from"./decodeURIComponentSafe-C_ttRntx.js";import{w as et}from"./withTransactionSidePanel-CNv0kM7W.js";import{f as at,c as nt}from"./routePaths-CCOmiobh.js";import"./recharts-ScPc1hFQ.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";import"./useAskAiCfoHostNavButtonProps-CT6wQzQG.js";import"./TransactionDetailScreen-DY5IcfRV.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="a5b3981a-5692-4629-996e-ca76cc1f5019",a._sentryDebugIdIdentifier="sentry-dbid-a5b3981a-5692-4629-996e-ca76cc1f5019")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(K({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=B(),o=G(),l=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:x}=L(),r=I(j??""),p=I(x??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=c(n=>J(n).company?.companyInfo.firstMonthOfFY??1),f=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const E=c(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-OUACL7Sm.js";import aa from"./NotFoundScreen-BXgaohYF.js";import{a as o,b as Nt}from"./sentry-COtwFETz.js";import{n as Fe,S as oa}from"./mui-B_sWk5no.js";import{u as pe,h as Jt,g as Ye,j as w,n as sa,i as wt,o as ca,p as qe}from"./core-CvVQwh-G.js";import{eS as xe,QH as ia,nr as Ee,fm as la,re as ra,nJ as Yt,o2 as Kt,QI as Ht,oc as da,QJ as Wt,nC as ua,qM as ma,f6 as Ie,QK as De,td as Xt,Cz as Zt,QL as en,QM as pa,qk as Ke,Mf as Pt,Mh as ha,jM as ga,Mi as Ca,jT as Sa,cV as fa,ur as He,nP as tn,oh as Ue,nH as re,QN as Ia,L7 as xt,L6 as Re,QO as Dt,k8 as Ea,QP as ka,QQ as ya,QR as ba,QS as Ta,nW as va,ok as we,QT as Aa,QU as Ra,QV as wa,or as Pa,jX as xa,jO as Da,QW as Ua,jW as Ut,Mp as Fa,QX as Ba,QY as Va,qg as Oa,pU as Ma,oi as me,pT as Ge,QZ as _a,Q_ as za,Q$ as ja,lr as La,bo as $a,lm as Ft,l8 as Qa,R0 as qa,gW as Bt,fX as Ga,lj as Na,wk as Ja,R1 as Ya,oS as Ka,oN as Ha,oR as Wa,oC as Xa,R2 as Za,f9 as nn,o5 as eo,nS as to,fn as Vt,om as no,R3 as ao,R4 as oo,oj as an,R5 as so,R6 as co,R7 as io,R8 as lo,R9 as Ot,qs as ro,pL as uo,L5 as mo,Ra as po,Rb as ho,jV as go,Rc as Co,Hd as So,jU as fo,jJ as Io,f8 as Eo,pi as on,pD as ko,og as Mt,ol as yo,bE as bo,lg as To,ld as vo,Rd as Ao,oB as _t,pz as zt,px as Ro,Re as wo,p3 as Po,p1 as xo,pA as Do,Rf as Uo,Rg as Fo,p7 as Bo,Rh as Vo,oX as Oo,p6 as Mo,p4 as _o,pG as zo}from"./zeni-epic-state-CECAZYIg.js";import{a as sn,G as ae,d as Q,q as ne,Y as cn,$ as ln,cG as jo,z as Be,cH as Lo,at as Pe,cI as $o,aU as jt,B as rn,cJ as Qo,aq as Ne,D as qo,a8 as Go,cK as No,a3 as Jo,cL as Yo,U as Ko,cM as Ho,cN as Wo,K as Xo,I as Zo,aN as es,cO as ts,cP as ns,b9 as as,w as os,aQ as ss}from"./index-LzTRB_X0.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-CT6wQzQG.js";import{f as Lt,a as cs,b as is,g as ls,C as rs}from"./TransactionDetailScreen-DY5IcfRV.js";import{w as ds}from"./withTransactionSidePanel-CNv0kM7W.js";import{h as us,v as ms}from"./routePaths-CCOmiobh.js";import{g as Je}from"./accountMappingHelper-C2f8hGo7.js";import{D as ps}from"./DrawerScreen-C1-3TQnN.js";import"./recharts-ScPc1hFQ.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";import"./decodeURIComponentSafe-C_ttRntx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="e4a2671a-ddc4-4c56-bb75-5210041a4fd2",t._sentryDebugIdIdentifier="sentry-dbid-e4a2671a-ddc4-4c56-bb75-5210041a4fd2")}catch{}})();const hs=()=>{const t=pe(),l=Jt(),B=Ye(),f=w(d=>xe(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:S}=T(ae.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(ae.aiAuditScorePercentage),I=w(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=w(d=>ia(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,q,Z=!1)=>{t(Ee({tenantId:q,period:{month:d.month,year:d.year},refreshViewInBackground:Z}))},[]),v=o.useCallback(d=>{const q=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,q??null),t(la(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(g,f.tenantId,!0)},[k,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ne(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(q=>q.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(g,f.tenantId)},[k,g,s.fetchState,f.tenantId,y]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(ra(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;Q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Fe.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
-
`,Cs=Nt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:T})=>{const S=pe(),r=Be.getSignedInUser(),I=w(e=>xe(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,g=u[l],m=g?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{S(ma(e,n.split(".")[0]))},E=e=>{m!=null&&S(ua({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},y=()=>{S(Ht({statementUploadChosen:!1}))},d=e=>{S(da({accountId:l,selectedPeriod:k,payload:e}))},q=e=>{S(Wt({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},Z=o.useCallback(()=>{S(Yt({accountId:l}))},[S,l]),_=o.useCallback(()=>{S(Kt({accountId:l}))},[S,l]),O=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return g!=null?h.jsx($t,{children:h.jsx(Qt,{children:h.jsx(Lo,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:g,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:P,onDeleteFile:E,onSelectSourceType:q,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:Z})})}):O!=null?h.jsx($t,{children:h.jsx(Qt,{children:h.jsx($o,{excludedAccountReconciliation:O,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:_})})}):null}),$t=Fe.div`
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
height: 100%;
|
|
12
|
-
`,Qt=Fe.div`
|
|
13
|
-
flex: 1;
|
|
14
|
-
min-height: 0;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
min-width: 0;
|
|
19
|
-
overflow-x: hidden;
|
|
20
|
-
overflow-y: auto;
|
|
21
|
-
`;function Ss({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const T=Be.getSignedInUser();if(T==null)throw Error("Can't access Customer Request page without signing in...");const S=w(r=>pa(r,t,T));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Qo,{onCloseClick:l,addCustomerRequest:B,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const fs=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Is,comma:qt,space:Es}},dateFormat:pn}=qo.getLocalizedStrings(),Gt=zo,ks=sa(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:S,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:g}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Jo}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:g,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:S,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:g,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:q}=p.jeSchedules,Z=tn(E),_=Ue(Z.start),O=Ue(Z.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{Q.trackMissingReceiptAttached(E.month,E.year),t(uo(e))},onUploadTransactionReceipt:(e,n,c,i,b,C)=>{t(Ot(e,n,{fetchState:"In-Progress"}));const A=()=>t(Ot(e,n,{fetchState:"Error"}));Yo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,C,n,c,i,b).then(V=>{V!=null?t(ro(e,V)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(lo(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(io(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?Es+Is+i+qt:qt}]}))},onUpdateJESchedulesUIState:e=>{t(co(e))},onUpdateMissingReceiptsUIState:e=>{t(so(e))},onFetchMissingReceiptsList:()=>{O!=null&&_!=null&&t(an({start:_,end:O},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(_o(e))},onBulkUploadProgress:e=>{t(Mo(e))},onBulkUploadSuccess:e=>{t(Oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Vo(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(Bo(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Fo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Do(e))},onSetBulkUploadSortConfig:(e,n)=>{t(zt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(xo())},onSearchTransactionsForManualMatch:(e,n)=>{t(Gt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Gt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Po(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(wo())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(Ro())},onResetBulkUploadSort:()=>{t(zt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(oo())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ge({selectedTab:c,uiState:{searchString:e}})),O!=null&&_!=null&&t(me(c,{start:_,end:O},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(ao({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(no(S))},onClose:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0})),v("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(to(e))},onSaveReconciliationReview:e=>{t(eo(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ne(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,C=Je(q.prepaidExpensesAccountList,c.selectedOptions),A=Je(q.fixedAssetsAccountList,i.selectedOptions),V=Je(q.accruedExpensesAccountList,b.selectedOptions),x={selectedPrepaidExpensesAccountIds:C.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:V.map(D=>D.accountId)};t(Za({data:x}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:C,vendor:A}=n,{allAccountList:V,allClassList:x,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(N=>N.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(N=>N.value===A?.selectedOption)?.label??"",logo:j?.logo},se=C?.selectedOption!=null?V.find(N=>N.qboId===C.selectedOption):void 0,Ve=b?.selectedOption!=null?x.find(N=>N.classId===b.selectedOption):void 0,Oe=i?.selectedOption!=null?D.find(N=>N.qboId===i.selectedOption):void 0;t(Wa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Ve?.classId,updatedAccumulatedDepreciationCategoryID:Oe?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ha(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(xt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Re("common"))},onCancelAutoComplete:()=>{t(Re("common"))}},onPostJESchedule(e,n){t(Ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Ya())},handleJeScheduleClick:(e,n,c)=>{t(Ja({selectedJEScheduleKey:n}));const i=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Na(e,u.companyId,u.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ga())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(qa(e))},onUpdateFileAttachment:e=>{t(Qa({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ft(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ft(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t(La(u.companyId,e,u.tenantId)),Q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,$a().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,C,A,V,x,D,j,oe,se)=>{t(ja(e,n,c,i,k,b,C,A,V,x,D,j,oe,se))},onCancelAutoComplete:()=>{t(Re("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),O!=null&&_!=null&&(t(me(e,{start:_,end:O},!1,!1)),t(za(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),O!=null&&_!=null&&(t(_a(e)),t(me("autoCategorized",{start:_,end:O},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ge({selectedTab:e,uiState:n})),O!=null&&_!=null&&t(me(e,{start:_,end:O},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ge({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,C,A)=>{O!=null&&_!=null&&t(me(e,{start:_,end:O},!0,c,n,i,b,C,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,C,A,V)=>{t(Ma(e,n,c,i,V??null,b,C,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ut({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?Q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):Q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Oa(e,n,c,S))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Va({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,C,A)=>{const{transactionId:V,transaction:x,lineIds:D}=n;C!=null&&t(Fa({transactionId:V,customerUpdates:C})),t(Ba({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:x,uncategorizedAccounts:k,updatedCustomer:C,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(He({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,C,A)=>{const{transactionId:V,transaction:x,lineIds:D}=n;C!=null&&(t(xa({transactionId:V,vendorUpdates:{name:C.name,id:C.id?C.id:void 0}})),t(Da({vendorId:C.id?C.id:void 0,localData:{vendorName:C.name,vendorId:C.id?C.id:void 0}}))),C?.id?(t(Ut({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:x,uncategorizedAccounts:k,updatedVendor:C,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(He({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:V.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{Q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Pa(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(wa(e))},updateOperatingExpensesIdsForReview:e=>{t(Ra({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ms(e.id,e.qboId,l.tenantEmailDomain),c=ne(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Aa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(we(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(re(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Xt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Zt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Wt({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Ht({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(re(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(va({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Ta({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(ba({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ya({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(Ea(i)),t(ka({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ke("bill"));const n=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(xt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Re("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ia({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Yt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Kt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(re(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(S,r,I){return{...S,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,S.authParams)}}}(t,l,T)})(Go(No)),ys=ds(function(t){const l=t.displayName??t.name??"Component",B=Nt.memo(t),f=T=>{const S=pe(),r=function(){const P=pe(),E=w(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(y=>{P(De({selectedDrawerAccountId:y}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=w(P=>Ie(P).reconciliation),s=w(P=>xe(P)),p=o.useCallback((P,E)=>{S(Xt("expense_automation_reconcile",P,E))},[S]),u=o.useCallback((P,E)=>{const y=s?.companyId;y!=null&&(S(Zt(P,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),S(en({accountId:E,connectionInProgress:!0})))},[S,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Cs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),g=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:g,[r.isOpen,r.closePanel,r.selectedAccountId,g]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...T,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:T,reconPanelContent:S,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Ko(),u=Ho(),{isOpen:k}=Wo(),v=Jt(),g=Ye(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{T===!0&&f!==!0&&t?.()},[t,T,f]),{areTenantIdsInSync:d}=cn(),q=(()=>{const a=w(G=>Ie(G)),F=Ye(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:R}=a,W=Ne($),J=Ne(L.fetchState),H=o.useCallback(G=>{const X=F.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?Q.trackTransactionsReviewPage(R.month,R.year,a.transactionView.totalCountByTab.review,0,G,X??null):Q.trackTransactionsAutoCategorisedPage(R.month,R.year,a.transactionView.totalCountByTab.autoCategorized,0,G,X??null)),$==="missing_receipts"&&Q.trackMissingReceiptsPage(R.month,R.year,G,a.missingReceipts.transactions.length,X??null),$==="je_schedules"&&Q.trackMonthCloseScheduleListPage(R.month,R.year,G,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,X??null),$==="flux_analysis"&&Q.trackFluxAnalysisPage(R.month,R.year,G,fs(a.fluxAnalysis),X??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&Q.trackInsightsEmailPage(R.month,R.year,G,"draft",a.auditSummary.auditScorePercentage,null,X??null)},[R,a]);return o.useEffect(()=>{J===L.fetchState&&$===W||L.fetchState!=="Completed"||H(!1)},[$,L.fetchState,W]),H})(),Z=Xo(),[_,O]=o.useState(!1),e=w(a=>Pt(a)),n=w(a=>xe(a)),[c,i]=o.useState(!1),[b,C]=o.useState(!1),[A,V]=o.useState([]),[x,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=x?.contentType==="activity"?x.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(F=>F?.contentType==="activity"?null:F)},[y,s,u,p]),Ve=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),Oe=o.useCallback(()=>{u(),j(),y(),E()},[y,j,E,u]),N=o.useRef(s);o.useEffect(()=>{s===!0&&N.current===!1&&(u(),j(),y()),N.current=s},[y,j,s,u]);const We=o.useRef(k);o.useEffect(()=>{k===!0&&We.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),We.current=k},[j,t,k,s,p,f,T]);const ke=T===!0&&f!==!0,Xe=o.useRef(ke);o.useEffect(()=>{ke&&!Xe.current&&(s&&p(!1),u(),j()),Xe.current=ke},[j,s,ke,u,p]);const[Ze,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=wt(),{tenantEmailDomain:gn}=wt(),[Me,nt]=o.useState(g.state?.message==="comingFromTransactionDetail"),at=g.state?.message==="comingFromOverview",Cn=Zo(),_e=Be.getSignedInUser(),{useDynamicConfig:Sn,useFeatureGate:de}=sn(),{configValue:fn}=Sn(es.enableUncategorizedExpenseCategory),ee=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=de(ae.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=de(ae.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:ze}=de(ae.isTransactionActivityEnabled),{isFeatureEnabled:st}=de(ae.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=de(ae.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=de(ae.isProjectsTransactionsEnabled),kn=o.useCallback(a=>{const F=Ke(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,F)},[l]),yn=w(a=>mo(a,"common")),z=w(a=>Ie(a)),{categoryOptions:bn,paymentAccountNames:Tn}=w(a=>po(a.accountState)),vn=w(a=>ho(a.classState)),{monthEndCloseChecksView:K,currentSelectedView:U,selectedPeriod:M,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:An,currentSelectedViewFetchState:ce,jeSchedules:Le,reconciliation:Rn}=z;cs(U==="transaction_categorization");const wn=z.transactionView.saveStatus.fetchState,ct=z.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=w(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=w(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const te=is(wn,()=>{const a=[],F=ut.current,L=dt.current,$=L!=null&&F!=null?L[F]:void 0;if($?.transactionReviewLocalDataById!=null)for(const W of Object.values($.transactionReviewLocalDataById)){const J=W?.transactionReviewLocalData?.lineItemById;if(J!=null)for(const H of Object.values(J)){const G=H?.account;G?.accountId!=null&&a.push(G.accountId)}}const R=it.current;for(const W of R)for(const J of W.lines??[])"account"in J&&J.account?.accountId!=null&&a.push(J.account.accountId);return a});o.useEffect(()=>{U==="transaction_categorization"&&T!==!0||se(void 0)},[U,se,T]);const Pn=z.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Pn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,U==="transaction_categorization"&&j()):be.current=ye},[j,U,ye]);const xn=w(a=>oe==null?void 0:go(a.transactionState,oe)),ie=xn?.qboId,mt=w(a=>ie==null?void 0:Co(a,ie));o.useEffect(()=>{ie!=null&&m(So(ie))},[m,ie]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:gt}=z.transactionView,Ct=o.useCallback(a=>ls(m,a),[m]),St=o.useMemo(()=>U!=="transaction_categorization"||x==null?null:x.contentType==="activity"?ze===!0?h.jsx(ts,{activityLogView:mt,qboId:ie,onClose:()=>D(null),selectedTransactionId:x.detail.transactionId,isQuickViewCardStyle:!0},String(x.detail.transactionId)):null:x.contentType==="transfer"?h.jsx(ns,{createTransferEntryStatus:pt,transaction:x.detail,transferAccounts:x.detail.transactionType==="credit_card_payment"?ht:gt,onClose:()=>D(null),onCreateTransfer:Ct,isQuickViewCardStyle:!0},String(x.detail.transactionId)):null,[U,x,ze,mt,ie,pt,ht,gt,Ct]),Dn=St!=null,{selectedAccountId:ge}=Rn,ft=Ne(Le.accountSettingsView.saveState.fetchState),Un=w(a=>fo(a.accountState,a.accountListState,"accountList")),Fn=w(a=>Io(a)),Ce=tt!=null?Eo(tt):U,Bn=w(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ce.fetchState==="Completed"}),_e==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(M),Se=Ue(It.start),fe=Ue(It.end);if(Se==null||fe==null)throw Error(`Invalid start - ${Se} and end - ${fe} period from given ${M}`);const Vn=o.useCallback(()=>{i(!1)},[]),On=o.useCallback(()=>{C(!0)},[]),Mn=o.useCallback(a=>{V(a),C(!1)},[]),_n=o.useCallback(()=>{V([])},[]),Te=z.missingReceipts.bulkUpload.phase,Et=z.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&U==="missing_receipts"&&Te==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,U,Te,Et,m]);const kt=_e?.userId,zn=M.month,jn=M.year,yt=n?.tenantId;o.useEffect(()=>{U==="missing_receipts"&&he!==!1&&Te==="idle"&&kt!=null&&yt!=null&&m(ko())},[U,he,Te,kt,yt,zn,jn,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?O(!0):O(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{Ce!=null&&U!==Ce&&m(nn(Ce))},[Ce]),o.useEffect(()=>{Ze!==!1||ce.fetchState!=="Completed"&&ce.fetchState!=="Error"||!d||(hn(!0),m(Mt(!1,!1,ee)))},[Ze,ce,d,ee]),o.useEffect(()=>{!at&&d&&(m(Mt(!1,!1,ee)),m(re(M,ge,!1,!1)))},[M.month,M.year,d,ee]);const bt=o.useCallback((a=!1,F=!1)=>{const L={start:Se,end:fe};switch(U){case"transaction_categorization":m(me(je,L,a,!Me,void 0,void 0,F,void 0,ee)),nt(!1);break;case"flux_analysis":m(we(M,a,F,null));break;case"month_end_insights":if(F===!1){const $=new Date(M.year,M.month,0),R=bo($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(To(!0,n.companyId,n.tenantId,R)),m(vo(n.companyId,n.tenantId))}break;case"je_schedules":m(yo(L,F));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,F));break;default:m(re(M,ge,a,F))}},[U,Se,fe,n.companyId,n.tenantId,je,M,ge,Me,nt,ee]);o.useEffect(()=>{U===Ce&&ce.fetchState==="Not-Started"&&d&&bt(!0)},[ce,Se,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Me||et.current||An.fetchState==="In-Progress"||ce.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{K.fetchState!=="In-Progress"&&K.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:M,refreshViewInBackground:!1}))},[K.fetchState,n.tenantId]),o.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:M,refreshViewInBackground:!0})),m(Ao({companyId:n.companyId})),v("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,M,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{K.fetchState!=="In-Progress"&&K.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:M,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[K.fetchState,n.tenantId,M,m]),o.useEffect(()=>{const a=setInterval(()=>{U==="reconciliation"&&ge==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(re(M,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[U,m,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,re,ge,M]);const Ln=Lt();o.useEffect(()=>{const a=(K.monthEndCloseChecks?.monthEndCloseCheckList.find(F=>F.id==="month_end_insights")?.isDisabled??!1)&&!ot;U!=="month_end_insights"||!a&&K.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[U,K.monthEndCloseChecks]);const $n=r===!0?S:B,Qn=r===!0||T===!0,qn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(_t())},[ft,Le.accountSettingsView.saveState.fetchState,_t]);const{transactionId:Tt,onSaveVendor:Gn,onSaveSuccess:Nn,onCancel:Jn,vendorViewDetails:Yn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:F,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const R=pe();let W,J,H;const G=Lt(),X=a.transactionView;let vt=()=>{};const{transactions:Hn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Wn}=X;if(L==="transaction_categorization"){const $e=Wn.find(le=>le.transactionId===ue),Y=Hn.find(le=>le.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,Rt=At?.account;J=At?.class?.classId,W=["Uncategorized Income","Uncategorized Expense"].includes(Rt?.accountName??"")?void 0:Rt?.accountId;const Zn=us(ue,Y?.typeOfTransaction);Y!=null&&Zn&&(H={id:ue,type:Ke(Y.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&Y!=null){const le=X.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(le!=null&&Y.lines!=null&&Y.lines.length>0){const Ae=le.lineItemById[ve];let Qe=le.selectedEntity;if(fa(Y)||(Qe=Ae.selectedEntityLine),Qe!=null){const ea=Qe,ta={transactionId:{id:Y.id,type:Y.type},transaction:Y,lineIds:Y.lines.map(na=>na.id)??[]};R(He({entity:ea,amount:Ae.amount.amount,transactionDetails:ta,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:G,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=w($e=>Pt($e,void 0,W,J));return{transactionId:H,onSaveVendor:()=>{R(Sa(H,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{H!=null&&R(ha({transactionId:H})),R(ga()),R(Ca()),F()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{O(!1)},currentSelectedView:U,isUncategorizedExpenseCategoryEnabled:ee}),Kn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,F,L)=>{L.onReconciliationPusherEventReceived(a)}};return Cn?.loggedInUserRoleMap==null?K.fetchState==="Error"?h.jsx(as,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(ps,{isOpen:b,drawerLeftMargin:new os(0,0,300,650),onClose:()=>{C(!1)},children:h.jsx(bs,{onClick:a=>a.stopPropagation(),children:h.jsx(Ss,{companyId:n.companyId,closeCustomerRequestDrawer:()=>C(!1),addCustomerRequest:Mn,resetCustomerRequest:_n})})}),Tt!=null&&_&&h.jsx(rs,{isOpen:_,transactionId:Tt,onSaveVendor:Gn,onSaveSuccess:Nn,onCancel:Jn,vendorViewDetails:Yn}),h.jsx(ks,{...Kn,navigate:v,location:g,themeState:Z,categoryOptions:bn,classesForFilters:vn,accountsForFilters:Tn,vendorSearchAutoCompleteData:{autoCompleteText:Bn,entityAutoCompleteView:yn},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:ee,isAccountingClassesEnabled:Fn,isProjectsTransactionsEnabled:En,isCOTEnabled:Ln,currentTenant:n,companyId:n.companyId,signedInUser:_e,isTransactionActivityEnabled:ze,isRightPanelOpen:Dn,rightSidePanel:St,onOpenTransferRightPanel:st===!0?Ve:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:On,handleEditClick:Vn,tenantEmailDomain:gn,trackExpenseAutomationTabAnalytics:q,setActivityLogTransactionId:se,closeSidePanel:qn,openTransactionPanel:l,sidePanelIsOpen:Qn,sidePanelIsFullView:r!==!0&&f,panelContent:$n,isAiCfoAccessEnabled:P,onAskAiCfoClick:Oe,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:kn,sidePanelListPercent:r===!0?66:void 0}),te.showPopup&&te.popupType!=null&&h.jsx(ss,{popupType:te.popupType,currencySymbol:te.currencySymbol,accountId:te.popupAccountId??"",accountName:te.popupAccountName??"",onSubmit:te.handleSubmit,onDismiss:te.handleDismiss})]})})),bs=Fe(oa)`
|
|
22
|
-
display: flex;
|
|
23
|
-
min-height: 100%;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
`;function Js(){return h.jsxs(ca,{children:[h.jsx(qe,{path:"*",element:h.jsx(hs,{})}),h.jsx(qe,{path:"/:selectedTab/:selectedPeriod/*",element:h.jsx(ys,{})}),h.jsx(qe,{path:"*",element:h.jsx(aa,{})})]})}export{Js as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-OUACL7Sm.js";import{a as r}from"./sentry-COtwFETz.js";import{a4 as l,a5 as p,a6 as c,p as f}from"./index-LzTRB_X0.js";import"./mui-B_sWk5no.js";import m from"./NotFoundScreen-BXgaohYF.js";import{h as b,g as u}from"./core-CvVQwh-G.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="255b448f-3621-45de-b702-4185b08c00e3",e._sentryDebugIdIdentifier="sentry-dbid-255b448f-3621-45de-b702-4185b08c00e3")}catch{}})();const _=()=>{const e=b(),t=u(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=f(t.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(t.pathname);return o!=null?s.jsx(p,{menuItem:c(o),onDemoClick:a,onGoBack:i}):s.jsx(m,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{_ as F};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./sentry-COtwFETz.js";import{u as d,h as l,g as m}from"./core-CvVQwh-G.js";import{gD as p,Kk as g,Kl as _}from"./zeni-epic-state-CECAZYIg.js";import{u as b,L as h,z as y}from"./index-LzTRB_X0.js";import"./liveblocks-OUACL7Sm.js";import"./recharts-ScPc1hFQ.js";import"./mui-B_sWk5no.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9c8704a1-a2f6-455c-8889-e317a6e748ff",e._sentryDebugIdIdentifier="sentry-dbid-9c8704a1-a2f6-455c-8889-e317a6e748ff")}catch{}})();function K(){const e=d(),n=l(),o=m(),{setLoading:i,clearAllLoading:f}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}f();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{K as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-OUACL7Sm.js";import{a as g}from"./sentry-COtwFETz.js";import{u as O,g as _,h as w,s as M,j as l,N as T}from"./core-CvVQwh-G.js";import{z as r,m as P,D as V,e as A,d as K,f as N,n as J,R,g as $}from"./index-LzTRB_X0.js";import{eS as q,J_ as W,K8 as Z,J$ as B,eZ as G,fq as H,K4 as Q,fO as X,cT as Y,K9 as ee,Ka as te}from"./zeni-epic-state-CECAZYIg.js";import{n as ne}from"./mui-B_sWk5no.js";import{u as se}from"./useDeviceId-FKP5CkBV.js";import{f as ae}from"./analyticsHelper-Cw9lxNal.js";import{t as ie}from"./getLocaleForTenant-BKpCR6Mg.js";import"./recharts-ScPc1hFQ.js";import"./analytics-BYlEHy--.js";import"./plaid-BeX18ubU.js";import"./dnd-DNR-B7xM.js";import"./stripe-DMRn4zHo.js";import"./lottie-CtoJzpCG.js";import"./lexical-DEMTOP18.js";import"./pdf-Bd_BBdKz.js";import"./utils-B-68Nh7i.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="ee6bfb78-6883-43b7-89cc-ba4de8c58348",t._sentryDebugIdIdentifier="sentry-dbid-ee6bfb78-6883-43b7-89cc-ba4de8c58348")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),b=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),h=l(e=>W(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Z(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(h.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,h.tenantsInOrder),X().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{K.trackLogin(N.Event.loginSuccess,"email",Y(o.productSettings))},2e3))},[I,S,y,s,o,h,v,a.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(b==="Completed"&&d!=null)return u.jsx(J,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||f==null||b==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||b==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
z-index: 9999;
|
|
11
|
-
background-color: ${t=>t.theme.colors.background};
|
|
12
|
-
`;export{De as default};
|