@zeniai/web-app-ui 5.1.65-prod → 5.1.66-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-DEXYkqV1.js +1 -0
- package/dist/assets/{AddressScreen-DBh2kopg.js → AddressScreen-D8kv1hF_.js} +2 -2
- package/dist/assets/AiCfoScreen-BrNLceCE.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-CvKgF8Ok.js +1 -0
- package/dist/assets/BillPayRoutes-DYswIHAT.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-YVk91Fzz.js +9 -0
- package/dist/assets/CardsAiCfoScreen-BO5V838O.js +14 -0
- package/dist/assets/ChargeCardRoutes-BZOF502-.js +71 -0
- package/dist/assets/CompanyPassportScreen-CPKfXmmb.js +1 -0
- package/dist/assets/ConnectionAuthScreen-Cv-HiaYb.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DdX8BaLn.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-CKdlHWlk.js +30 -0
- package/dist/assets/{DashboardRoutes-CvxLfoR-.js → DashboardRoutes-CopaUmWi.js} +4 -4
- package/dist/assets/DefaultTenantHome-eT4t7R06.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-Cbmuyang.js +18 -0
- package/dist/assets/DrawerScreen-CCxq1yzF.js +1 -0
- package/dist/assets/EntityDetailRoutes-DK7l7FnA.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-C3RWrFV-.js +25 -0
- package/dist/assets/FeaturePreviewScreen-BuXd4W0P.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-D1enkInm.js +1 -0
- package/dist/assets/MagicLinkRoutes-BSRFSffK.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BSh1nXKM.js +12 -0
- package/dist/assets/{MobileAppDrawer-qPZdyrO4.js → MobileAppDrawer-BIP1MEKX.js} +1 -1
- package/dist/assets/NotFoundScreen-DY1Wwus4.js +1 -0
- package/dist/assets/NotificationRoutes-6rN7RQjW.js +1 -0
- package/dist/assets/OAuthConsentScreen-BqL6PD1E.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-AcF3aqCk.js +1 -0
- package/dist/assets/PeopleRoutes-DPUTbQp_.js +22 -0
- package/dist/assets/PerformanceRoutes-Cn4Ovnir.js +1 -0
- package/dist/assets/{Preview-Dk_ia_hl.js → Preview-DDPGc7EO.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DMhJk96k.js → QBOConnectionScreen-BEQPddK1.js} +1 -1
- package/dist/assets/ReferralListScreen-CQycV-0F.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-Ch3sYOOh.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-BJZRYRum.js +1 -0
- package/dist/assets/ReimbursementRoutes-CgQPRNMh.js +68 -0
- package/dist/assets/ReportsRoutes-CQztdl9E.js +1 -0
- package/dist/assets/RewardsRoutes-B0jOOo8W.js +1 -0
- package/dist/assets/ScreenRoutes-D7kpFxVk.js +2 -0
- package/dist/assets/SettingsRoutes-CdvEgvyN.js +57 -0
- package/dist/assets/SetupPagesScreen-Dh6d6vu-.js +29 -0
- package/dist/assets/SignInScreen-FuVo71JP.js +1 -0
- package/dist/assets/SignOutScreen-DJh4f2Aj.js +9 -0
- package/dist/assets/TaskListScreen-CnT3FhwB.js +9 -0
- package/dist/assets/TaskRoutes-BlDolQ3c.js +9 -0
- package/dist/assets/TransactionDetailRoutes-C2XNyTUH.js +1 -0
- package/dist/assets/TransactionDetailScreen-Ch_kEoMB.js +5 -0
- package/dist/assets/TransactionListRoutes-CAZZrQj-.js +1 -0
- package/dist/assets/TreasuryRoutes-BQCtQUx_.js +37 -0
- package/dist/assets/{VendorsRoutes-Hio5Sfl7.js → VendorsRoutes-BGB3F2EZ.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-BSryCvdh.js +12 -0
- package/dist/assets/ZeniAccountRoutes-D-szpn5h.js +73 -0
- package/dist/assets/ZeniAccountStatementScreen-BORtLhU4.js +9 -0
- package/dist/assets/{accountMappingHelper-BJc8FF-F.js → accountMappingHelper-SrHoNEDL.js} +1 -1
- package/dist/assets/{analytics-7_b07CgE.js → analytics-CkLW7NeW.js} +1 -1
- package/dist/assets/{analyticsHelper-DGI02sYS.js → analyticsHelper-BsiU5y2K.js} +1 -1
- package/dist/assets/{core-C1GB7aB-.js → core-Crl6eqZl.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-okum9C8e.js → decodeURIComponentSafe-DwYiSzjo.js} +1 -1
- package/dist/assets/dnd-tE28jHT7.js +6 -0
- package/dist/assets/{empty-DcVAbZV4.js → empty-BpRPQOis.js} +1 -1
- package/dist/assets/{index-D934ejNp.js → empty-C7ggsb2s.js} +1 -1
- package/dist/assets/{emptyVideoElement-2r8hCQGV.js → emptyVideoElement-BvjVfzOS.js} +1 -1
- package/dist/assets/epic-Qgvh4PH7.js +2 -0
- package/dist/assets/getLocaleForTenant-DiFaMSxg.js +1 -0
- package/dist/assets/{index-CJkoGhEu.js → index-B5it1rE5.js} +1 -1
- package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
- package/dist/assets/index-BdlPaglK.js +1 -0
- package/dist/assets/{index-DwUJQ44f.js → index-Bs_5Wou0.js} +2 -2
- package/dist/assets/{index-D4_FYu1h.js → index-CJknvk0s.js} +33673 -28214
- package/dist/assets/index-CZNTdKXM.js +1 -0
- package/dist/assets/{index-DgOeAv6K.js → index-Cg0vsa8G.js} +1 -1
- package/dist/assets/{index-Cgq5e8kx.js → index-D5ItYKRr.js} +1 -1
- package/dist/assets/{index-DcSDyNQG.js → index-Dvok4kj_.js} +1 -1
- package/dist/assets/{lexical-Dcuk4Yua.js → lexical-Bm_vZOjC.js} +1 -1
- package/dist/assets/{liveblocks-Dx9GJaKJ.js → liveblocks-B5ZW-VBI.js} +1 -1
- package/dist/assets/{lottie-MYbVFail.js → lottie-hSeCd_VX.js} +1 -1
- package/dist/assets/{mui-S6TXegyD.js → mui-U77PQnc2.js} +1 -1
- package/dist/assets/{pathToGoBack-CYxRwoYN.js → pathToGoBack-BWWNiH76.js} +1 -1
- package/dist/assets/{pdf-BijcgxIK.js → pdf-DDcPh2pm.js} +4 -4
- package/dist/assets/{pdf-lib-DXIgr0ip.js → pdf-lib-ImawEH2S.js} +1 -1
- package/dist/assets/{plaid-nqaFvQD8.js → plaid-TCRHScH1.js} +1 -1
- package/dist/assets/{pusher-Dwxn49q9.js → pusher-CimMrDFu.js} +1 -1
- package/dist/assets/{react-0X27mp_1.js → react-BUcjX1FU.js} +1 -1
- package/dist/assets/{react-BKDInzaa.js → react-BghKQeK_.js} +1 -1
- package/dist/assets/{react-ClmE3BGe.js → react-DdRuig8o.js} +1 -1
- package/dist/assets/{react-CtohstEB.js → react-DyFf3w8Z.js} +1 -1
- package/dist/assets/{react-BmdAxlR-.js → react-DzBjlQkv.js} +1 -1
- package/dist/assets/{react-BK9aeab9.js → react-z5kfbX38.js} +1 -1
- package/dist/assets/{recharts-DgDFrpbv.js → recharts-e5u-LCPv.js} +3 -3
- package/dist/assets/{routePaths-dZ-9-pnI.js → routePaths-jWP9zfXs.js} +1 -1
- package/dist/assets/{sentry-i8uQ0afM.js → sentry-BxWyF9h9.js} +1 -1
- package/dist/assets/{url-B7pK2_FE.js → url-DTS3WRFG.js} +1 -1
- package/dist/assets/{url-DUqjNyjV.js → url-jBDeguac.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CgykUI65.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-BAtYgUWq.js +1 -0
- package/dist/assets/useCashManagementBanner-CRbG3Xtj.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-Dq1SGHUY.js +1 -0
- package/dist/assets/{useDeviceId-AH1KsB1z.js → useDeviceId-BZa5m-bZ.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-CiGW-Jar.js +1 -0
- package/dist/assets/useInitialThreadRequest-DZr1J4rc.js +1 -0
- package/dist/assets/{utils-BGTnhJzp.js → utils-BjvWDnmB.js} +2 -2
- package/dist/assets/withTransactionSidePanel-DKnep6Xn.js +21 -0
- package/dist/assets/zeni-epic-state-DTyrT1Ga.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-CaAZUR1d.js +0 -1
- package/dist/assets/AiCfoScreen-0P2uyYnp.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-Bf6ESEC4.js +0 -1
- package/dist/assets/BillPayRoutes-JaK42ohp.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-yN_GrrFh.js +0 -9
- package/dist/assets/ChargeCardRoutes-DIGTV0Mu.js +0 -71
- package/dist/assets/CompanyPassportScreen-ioZCXwD_.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BjfktFq2.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Dzpz1U1f.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-Br-Z1BtF.js +0 -23
- package/dist/assets/DefaultTenantHome-GIFjQHwa.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DM1m923S.js +0 -18
- package/dist/assets/DrawerScreen-Bw0Jl3tu.js +0 -1
- package/dist/assets/EntityDetailRoutes-DpkUcZ1b.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-D1H-vOTZ.js +0 -25
- package/dist/assets/FeaturePreviewScreen-RdL9x4ht.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-ChOR5mQ9.js +0 -1
- package/dist/assets/MagicLinkRoutes-B0Bm7tIZ.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BSGPgcvY.js +0 -12
- package/dist/assets/NotFoundScreen-CLwfUXdC.js +0 -1
- package/dist/assets/NotificationRoutes-CsG2sL7b.js +0 -1
- package/dist/assets/OAuthConsentScreen-y-MvR-GE.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DhJIPrDf.js +0 -1
- package/dist/assets/PeopleRoutes-Bj5rMpkn.js +0 -22
- package/dist/assets/PerformanceRoutes-Dh41RQnX.js +0 -1
- package/dist/assets/ReferralListScreen-BTezTn63.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DMZ_8HxF.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-D4-WsBma.js +0 -1
- package/dist/assets/ReimbursementRoutes-CEmvBqU2.js +0 -68
- package/dist/assets/ReportsRoutes-DHk4zguu.js +0 -1
- package/dist/assets/RewardsRoutes-a_wmpytf.js +0 -1
- package/dist/assets/ScreenRoutes-DRJIZt7d.js +0 -2
- package/dist/assets/SettingsRoutes-C70whJIl.js +0 -57
- package/dist/assets/SetupPagesScreen-BN4AuJYP.js +0 -29
- package/dist/assets/SignInScreen-l-2YMbZy.js +0 -1
- package/dist/assets/SignOutScreen-Yt1oM0Fq.js +0 -9
- package/dist/assets/TaskListScreen-DHIOYmiB.js +0 -9
- package/dist/assets/TaskRoutes-PlhqIOO4.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Da9AxMSb.js +0 -1
- package/dist/assets/TransactionDetailScreen-DT8xA3x1.js +0 -5
- package/dist/assets/TransactionListRoutes-BukrAqP2.js +0 -1
- package/dist/assets/TreasuryRoutes-CoolddxK.js +0 -37
- package/dist/assets/WiseConfirmationScreen-CvwI66d8.js +0 -12
- package/dist/assets/ZeniAccountRoutes-Bdh4wUlu.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-C1LlIbPZ.js +0 -9
- package/dist/assets/dnd-BKLSY4Qp.js +0 -6
- package/dist/assets/empty-BAGbIBoq.js +0 -1
- package/dist/assets/epic-BFBt-3XZ.js +0 -2
- package/dist/assets/getLocaleForTenant-COPdXUFc.js +0 -1
- package/dist/assets/index-DFPmY4t1.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-zin4AQfk.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Zz8eSFW2.js +0 -1
- package/dist/assets/useInitialThreadRequest-BKY0Q6gT.js +0 -1
- package/dist/assets/withTransactionSidePanel-yGfWimRu.js +0 -21
- package/dist/assets/zeni-epic-state-BJXbyZuT.js +0 -13
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-Dx9GJaKJ.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Fa,s as jt,o as Rn,p as se}from"./core-C1GB7aB-.js";import{eR as de,bt as He,PM as ja,e_ as Ie,e$ as Ae,f0 as Ee,fV as Ke,cr as qe,PN as Xe,PO as lt,tS as Ba,jQ as xa,PP as La,gV as pa,Au as ca,Aw as Ne,Ax as ut,jG as Vt,PQ as Je,Ai as ha,PR as On,PS as Un,Al as Va,PT as jn,O9 as Na,s2 as Nt,Ar as na,h4 as Vn,PU as Ht,PV as ea,bo as Nn,PW as Hn,fG as Ha,fF as Ma,A$ as Mn,fE as Ga,NR as Gn,PX as Mt,ck as Gt,cL as $n,O8 as ya,BB as $t,PY as Tt,Bb as fa,PZ as zt,BC as zn,OB as Qn,BD as Zn,Cx as Yn,tc as Wn,Cr as Kn,P_ as qn,Av as Ze,P$ as Xn,Q0 as Jn,Q1 as er,Q2 as ar,Q3 as tr,Q4 as mt,Q5 as nr,AM as Qt,AF as rr,Q6 as sr,fX as cr,AV as Zt,AZ as Yt,fW as or,Q7 as ir,Bn as Wt,Q8 as dr,Q9 as lr,Qa as ur,AX as Kt,AI as qt,Ao as Xt,AR as Jt,AP as en,AT as mr,Qb as an,Qc as $a,B8 as ga,KR as tn,cM as Ct,Qd as Cr,Qe as pr,Qf as hr,Qg as fr,B5 as st,Bu as gr,Bq as br,B1 as yr,Bs as Sr,Bi as Ir,Bk as Ar,Qh as nn,BA as Ta,Ie as Er,Qi as kr,Qj as _r,Qk as Dr,Ql as rn,Qm as wr,BX as Pr,Ba as sn,B4 as ve,B9 as vr,Qn as Tr,Qo as Fr,Af as Br,Qp as cn,Qq as on,Qr as xr,Ah as Lr,Ag as Ft,Qs as Rr,Qt as Or,Qu as Ur,KN as jr,Qv as pt,Qw as Vr,wS as dn,ko as Nr,gW as Hr,C0 as Mr,Qx as ln,Qy as Gr,C1 as $r,Qz as zr,de as Qr,tM as Zr,BS as Yr,BM as Ve,bs as Wr,bF as Kr,cw as qr,bG as Xr,J_ as Jr}from"./zeni-epic-state-BJXbyZuT.js";import{z as ee,k as Ge,a as oe,G as Q,B as Sa,c4 as za,cf as es,cg as as,ch as ts,p as Re,ci as ns,cj as rs,J as Ia,aN as Le,q as ye,bo as ht,ck as ss,y as Aa,h as Qa,m as ft,d as K,D as gt,a7 as Za,cl as cs,W as un,aq as bt,bA as ra,cm as ct,cn as os,v as yt,co as is,at as mn,a2 as ot,U as Cn,f as pn,cp as ds,cq as ls,cr as us,cs as ms,ct as Cs,cu as ps,o as Ra,cv as hs,cw as fs,cx as at,Q as gs,cy as bs,cz as ys,cA as Ss,cB as Is,cC as As,a9 as Es}from"./index-D4_FYu1h.js";import{n as Te,D as hn,S as ks}from"./mui-S6TXegyD.js";import{a as d}from"./sentry-i8uQ0afM.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as $e,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as Ye,m as bn,n as ws,o as yn,p as Ps,S as Bt}from"./SetupPagesScreen-BN4AuJYP.js";import{u as Sn}from"./useInitialThreadRequest-BKY0Q6gT.js";import Ya from"./NotFoundScreen-CLwfUXdC.js";import{M as We}from"./MobileAppDrawer-qPZdyrO4.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-Zz8eSFW2.js";import{v as xt}from"./utils-BGTnhJzp.js";import{d as vs}from"./recharts-DgDFrpbv.js";import{t as Ts}from"./AddressScreen-DBh2kopg.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./analyticsHelper-DGI02sYS.js";import"./routePaths-dZ-9-pnI.js";import"./BusinessVerificationPageScreen-yN_GrrFh.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]="372b6297-39c7-44eb-acff-ad1b08594dd3",e._sentryDebugIdIdentifier="sentry-dbid-372b6297-39c7-44eb-acff-ad1b08594dd3")}catch{}})();function Fs(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(Y=>de(Y)),f=Ge(),p=He(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(Y=>ja(Y).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Q.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:x}=g(Q.isDebitCardFeatureEnabled),F=Ie(n),L=Ae(n),C=Ee(x,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:x,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:y,isBookKeepingTenant:L,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(Y=>Ke(Y,n.companyId)),j=qe(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(Y=>Xe(Y)),B=S(Y=>Y.classListState.fetchState),i=!v&&o&&h,m=S(Y=>lt(Y,a,i,o)),[O,M]=d.useState(!1),R=m.chargeCard,T=R?.cardCreatedByUser?.userId,G=S(Y=>T!=null?Ba(Y.userRoleState,T):void 0),$=G?.accountingClassIDs[0],V=S(Y=>$!=null?xa(Y.classState,{classId:$,reportId:"class_list"}):void 0),w=R?.cardHolderUser?.userId,Z=S(Y=>w!=null?Ba(Y.userRoleState,w):void 0),q=Z?.accountingClassIDs[0],P=S(Y=>q!=null?xa(Y.classState,{classId:q,reportId:"class_list"}):void 0),U=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&U&&(c(!0),setTimeout(()=>{t(La()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,U,te]),d.useEffect(()=>{O||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[O,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(U===!1||U&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const Y=pe(n.tenantEmailDomain,a,r,R,l);e(Y)}},[m.fetchState,l,U]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),B!=="Completed"&&B!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,B]);const ae=()=>{if(r!=null&&a!=null){t(La());const Y=pe(n.tenantEmailDomain,a,r);e(Y)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),X=Ea(o,h,p,E,b),J=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:X,debitAccountInformation:J,chargeCardDetailView:m,creditAccount:E,classListFetchState:B,creditAccountRepayment:b,cardIssuedByRoles:G?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:P?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,x]=ts(y);if(x==="")return;const F=n.channel(h),L=u=>{f.current(x,u)};let C;if(F?.subscribed===!0)C=F,C.bind(x,L),l.has(h)||(l.add(h),v()),c.push(()=>{F.unbind(x,L)});else{if(C=F??n.subscribe(h),C.bind(x,L),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(x,L)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Wa="credit-account-balance-updated",Ka="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",Bs="charge-card-department-updated",wn="charge-card-repayment-completed",Pn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),xs=[_a,ka],Ls=he(function(e){const a=Je(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}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(x=>de(x)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Q.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(x=>Je(x)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const x=Re(t.state?.pathnameStackToGoBack),F=x.poppedPathname??Os(n.tenantEmailDomain);e(F,{state:{pathnameStackToGoBack:x.newStack}})},[e,t,n.tenantEmailDomain]),y=$e(n);if(At({events:ta(y,xs),onEvent:x=>{switch(x){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Ya,{}):s.jsx(Ls,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Os=e=>`/${e}/cards`,Us={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,x]=d.useState(!1),F=ee.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const L=S(P=>de(P));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(Le.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(P=>Un(P,n)),o=D.chargeCard,I=S(P=>P.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Q.isDebitCardFeatureEnabled),b=Ee(E,L),B=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,m=L.userRole.includes("charge_card_user"),O=Ie(L),M=Ae(L),R=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:R}),G=!m&&T&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,G,T)))},[c,D.fetchState,g,I]);const $=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&($===!1||$&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==F.userId)){const P=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);r(P,{state:{pathnameStackToGoBack:U}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const P=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(P,{state:{pathnameStackToGoBack:U}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),w=S(P=>Nt(P.userState,F.userId)),Z=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(P=>P.statusCode==="success")===!0&&v===!1&&(setTimeout(Z,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const q=P=>{x(P)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(w?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Hs,{children:[s.jsx(We,{isAppContentDrawerOpen:h,handleDrawerToggle:q}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:w.phone,signedInUser:F,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:L,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{q(!0)}}),e!=null?s.jsx(Ns,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Ht(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.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:Qa.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e(Ga(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Hn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Ns=Te.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: ${e=>`${Us.containerWidth.value(e.windowSize)}%`};
|
|
5
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
-
`,Hs=Te.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
|
-
`,Oa=gt.getLocalizedStrings().dateFormat,Ms={overlayWidth:new Aa(100,100,58)},vn=[wn,Wa],Gs=new Set(vn),$s=he(function(e,a){const t=a.currentTenant?.companyId;return{plaidConnectionDetails:Qn(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:p,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:_,controllerEmails:c,paymentDetails:l,productInformation:v,cashbackInformation:y,paymentSourceInformation:h,creditAccountInformation:x,debitAccountInformation:F,paymentInitiatedDate:L,sourcePage:C}=a,{tenantEmailDomain:u}=r,D=()=>{e($t(!0));const o=$e(r);o!=null&&o!==""&&e(fa(o,!0,!0)),e(Ne(!0))};return{onBackNavigation:()=>{if(p&&g&&_&&y!=null&&K.trackCardsPayEarlyFormClick(c,v,y,"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:L?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:L?.format(Oa.visual.MMMDCommaYYYYformat)},h,x,F),C==="cardPaymentHistory")a.closeDrawerHandler(!0),e(zt());else{const o=ze(u);t(o)}},onUpdatePaymentAccountStatus:(o,I,A)=>{e(Kn(o,I,"bill_pay","bill_pay_detail",A))},onEstablishConnectionSuccess:()=>{e(fa(r.companyId,!0))},onFetchLinkTokenClick:o=>{e(Wn("external_account",o))},onEstablishConnectionClick:o=>{e(Yn(o,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${u}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{f?window.open(`/${u}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onEventReceived:o=>{Gs.has(o)&&D()},onPusherSubscribed:D}})(Za(cs)),wt=({isPaymentDrawerOpen:e,closeDrawerHandler:a,pageName:t,creditAccountSpentAmount:r,productInformation:n,sourcePage:f,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isDebitCardInfoFetchStateCompleted:c,isCreditCardInfoFetchStateCompleted:l,isCashbackInfoFetchStateCompleted:v,paymentInitiatedDate:y,retryRepayment:h})=>{const x=me(),{useDynamicConfig:F}=oe(),{configValue:L}=F(Le.zeniAccountsConfig),C=Gn(L),u=S(z=>Mt(z)),{creditAccount:D}=S(z=>Xe(z)),o=S(z=>de(z)),I=ft(),A=Ia(),j=Ce(),E=ee.getSignedInUser(),b=Ge(),[B,i]=d.useState(!1),[m,O]=d.useState(!1),{configValue:M}=F(Le.zeniCardsConfig),R=M.credit_card_auto_pay_threshold_by_company_id?.[o.companyId]??M.default_credit_card_auto_pay_threshold??_s,T=Gt(b?.loggedInUserRoleMap),G=$n(b?.loggedInUserRoleMap),$=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=S(z=>ya(z,o.companyId)),w=V.companyChargeCardInfo?.primaryFundingAccount,Z=V.allFundingAccounts.find(z=>z.id===w?.accountId),q=S(z=>Ke(z,o.companyId)),P=qe(q.controllers);d.useEffect(()=>{if(u.fetchState!=="Completed"&&u.fetchState!=="In-Progress"&&j($t()),u.fetchState==="Completed"&&!m){const z=o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,X=u.transferFromAccounts.find(Y=>Y.id===z);let J;if(f==="cardPaymentHistory"&&h){const Y=h.paymentAccountId!=null?u.transferFromAccounts.find(re=>re.id===h.paymentAccountId):void 0;J={amount:h.amount,isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:xt(),transferFrom:Y??X}}else J={amount:{amount:D.balance.amount+D.hold.amount,currencyCode:D.balance.currencyCode,currencySymbol:D.balance.currencySymbol},isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:xt(),transferFrom:X};j(Tt(J)),O(!0)}},[u.fetchState,m,f,h,u.transferFromAccounts,o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,o.companyChargeCardInfo?.info?.isAutoPayEnabled,D.balance.amount,D.balance.currencyCode,D.balance.currencySymbol,D.hold.amount,j]);const U={isZeniCheckingEnabled:o.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:Z?.accType==="depositAccount",creditCardPaymentSourceAccountName:Z?.label,creditCardPaymentSourceAccountType:Z?.accType,creditCardPaymentSourceLastFourDigits:Z?.accountLast4,creditCardPaymentSourceBalance:Z?.accountBalance?.available?.amount??0};if(d.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&j(fa(o.companyId,!0))},[V.fetchState]),d.useEffect(()=>{u.updateStatus==="Completed"&&_!=null&&v&&l&&c&&K.trackCardsPayEarlyPayNowClick(P,n,_,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:y?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:y?.format(Oa.visual.MMMDCommaYYYYformat)},U,p,g)},[u.updateStatus,_,v,l,c,y]),d.useEffect(()=>{u.fetchState==="Completed"&&_!=null&&v&&l&&c&&!B&&e&&m&&_!=null&&(K.trackCardsPayEarlyFormView(P,n,_,t,o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,D.balance.amount,U,p,g),i(!0))},[u,v,l,c,B,e,m]),E==null)throw Error("Can't access invite people page without signing in...");const te=()=>{a(!0),j(zt())},ae=$e(o),k={events:e?ta(ae,vn):[],eventCallback:(z,X,J)=>{J.onEventReceived(z)},onSubscribed:z=>{z.onPusherSubscribed()}};return s.jsx(s.Fragment,{children:s.jsx(hn,{onClose:()=>{te()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Ms.overlayWidth.valuePercentage(A),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:I.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(zs,{onClick:z=>z.stopPropagation(),children:s.jsx($s,{...k,closeDrawerHandler:a,navigate:x,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{v&&l&&c&&_!=null&&K.trackCardsPayEarlyFormClick(P,n,_,"Pay Now",u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},U,p,g),j(zn({companyId:o.companyId}))},onDismissClick:te,onSaveChangesToLocalStore:z=>{j(Tt(z))},currentTenant:o,hasZeniAccountsAdminAccess:T,isZeniAccountsUser:G,isZeniAccountSetupEnabled:$,productInformation:n,sourcePage:f,controllerEmails:P,autoPayThreshold:R,paymentSourceInformation:U,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isCashbackInfoFetchStateCompleted:v,isCreditCardInfoFetchStateCompleted:l,isDebitCardInfoFetchStateCompleted:c,paymentInitiatedDate:y,maxInsuredAmount:C.maxInsuredAmount})})})})},zs=Te(ks)`
|
|
15
|
-
display: flex;
|
|
16
|
-
min-height: 100%;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
`,Pt=e=>e!=null&&typeof e=="object"?e:null,ce=e=>typeof e=="string"?e:void 0,Pe=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Ua=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",tt=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"&&!!Ua(a.transaction_status)&&!!Ua(a.transaction_type)},vt=(e,a)=>{const t=e?.card_status;if(!Ua(t))return null;const r=e?.is_locked_by_admin;return{cardId:a,cardStatus:t,isLockedByAdmin:typeof r=="boolean"?r:void 0}},it=[An,En,kn,_n,Dn,aa,Et,Wa,kt,_t,Dt],Tn=[_a,ka],Qs=new Set([...it,...Tn]),nt=gt.getLocalizedStrings().dateFormat,Zs=he(function(e,a){const{includeCreditAccountInfo:t,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:f}=a,p=ee.getSignedInUser(),g=e.tenantState.currentTenantId,_={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:g??""},c=lt(e,r,t,f),l=sr(e,r),v=cr(e);return{chargeCardDetailView:c,chargeCardsRecurringExpensesState:l,vgsVaultId:Qa.cardVaultId,transactionAttachmentsEndpointToFetch:`${ot}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${ot}/card_transaction_attachment`,authParams:_,isSnackbarOpen:v.isSnackbarOpen,cardsEndPoint:`${mn.cardMicroServiceBaseUrl}`,signedInUserToken:c.twoFAView.token??n}},function(e,a){const{cardId:t,currentTenant:r,navigate:n,location:f,cardProviderId:p,includeCreditAccountInfo:g,setIsPaymentOpen:_,controllerEmails:c,productInformation:l,cashbackInformation:v,primaryFundingAccountDetails:y,creditAccountInformation:h,debitAccountInformation:x,isChargeCardFeatureEnabled:F}=a,{tenantEmailDomain:L}=r;return{onEventReceived:(C,u)=>{(({event:D,data:o,cardId:I,dispatch:A,subscribedEvents:j})=>{const E=Pt(o);switch(D){case _a:case ka:return void A(ha(!0));case An:{const b=ce(E?.card_id);if(b==null||b!==I)return;const B=ce(E?.transaction_id),i=E?.transaction_status;return B!=null&&Ua(i)?void A(nr({transactionId:B,transactionStatus:i})):void A(Ze(I,null,null,!0))}case aa:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=vt(E,b);return B!=null?void A(mt(B)):void A(na(I,!0))}case Et:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=ce(E?.currency_code),i=ce(E?.currency_symbol),m=Pe(E?.balance);return B!=null&&i!=null&&m!=null?(A(tr({cardId:b,currencyCode:B,currencySymbol:i,balance:m,hold:Pe(E?.hold),dailyPurchaseSpends:Pe(E?.daily_purchase_spends),monthlyPurchaseSpends:Pe(E?.monthly_purchase_spends),dailyWithdrawals:Pe(E?.daily_withdrawals),monthlyWithdrawals:Pe(E?.monthly_withdrawals)})),void A(Ne(!0))):(A(na(I,!0)),void A(Ne(!0)))}case Wa:{const b=ce(E?.currency_code),B=ce(E?.currency_symbol),i=Pe(E?.available_amount),m=Pe(E?.balance_amount);return b!=null&&B!=null&&i!=null&&m!=null?void A(ar({currencyCode:b,currencySymbol:B,available:i,balance:m,hold:Pe(E?.hold_amount),cashback:Pe(E?.cashback_amount)})):void A(Ne(!0))}case En:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=E?.transaction;return tt(B)?void A(er({cardId:b,transaction:B})):void A(Ze(I,null,null,!0))}case kn:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=E?.transaction;return tt(B)?void A(Jn({cardId:b,declineReason:ce(E?.decline_reason),transaction:B})):void A(Ze(I,null,null,!0))}case _n:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=E?.transaction;return tt(B)?void A(Xn({cardId:b,transaction:B})):void A(Ze(I,null,null,!0))}case Dn:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=ce(E?.transaction_id),i=E?.attachment_file_paths;return B!=null&&Array.isArray(i)&&i.every(m=>typeof m=="string")?void A(qn({cardId:b,transactionId:B,attachmentFilePaths:i})):void A(Ze(I,null,null,!0))}case kt:case _t:case Dt:{const b=ce(E?.card_id);if(b==null||b!==I)return;A(na(I,!0))}}})({event:C,data:u,cardId:t,dispatch:e,subscribedEvents:Qs})},onPusherSubscribed:()=>{e(na(t,!0)),e(Ze(t,null,null,!0)),e(Ne(!0))},onReloadTransactions:()=>{e(ca(t,g,F))},onFetchChargeCardTransactionList:(C,u)=>{e(Ze(t,C,u))},onUpdateScrollYOffset:C=>{},onGetOtp:C=>{p!=null&&e(Ga(C,"ChargeCardHolder",t))},onResendOtp:C=>{p!=null&&e(Ma(C,"ChargeCardHolder",t))},onVerifyOtp:(C,u)=>{p!=null&&e(Ha(C,u,"ChargeCardHolder",t))},onVerifyOtpSuccess:C=>{C!=null&&ee.saveZeniOtpTokenForCardHolder(C,t)},onColorCodeChange:C=>{e(mr(t,C))},onLockChargeCard:(C,u)=>{e(en(C,t,u))},onUnlockChargeCard:C=>{e(Jt(C,t))},onCloseChargeCard:C=>{e(Xt(t,C))},onFetchChargeCardsRecurringExpenses:()=>{e(qt([t]))},updateChargeCardName:(C,u)=>{e(Kt(C,t,u))},updateChargeCardTransactionAttachments:(C,u)=>{u!=null&&e(ur({transactionId:C,data:u}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(C,u,D,o)=>{e(lr({chargeCardId:u,transactionId:C,fetchState:D,error:o}))},updateChargeCardTransactionReceiptsShowTick:(C,u,D)=>{e(dr({chargeCardId:u,transactionId:C,shouldShowTick:D}))},onChargeCardRevokeInviteClick:()=>{e(Wt(t))},updateChargeCardTransactionIsViewReceiptClicked:(C,u,D)=>{e(ir({chargeCardId:u,transactionId:C,isViewReceiptClicked:D}))},onChargeCardTransactionRowClick:(C,u)=>{const D=ye(f.state?.pathnameStackToGoBack,f.pathname);n(`../../transaction/${C}/${u}`,{state:{pathnameStackToGoBack:D}})},onBackClick:()=>{const C=Re(f.state?.pathnameStackToGoBack),u=ze(L);n(u,{state:{pathnameStackToGoBack:C.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(or())},onUpdateDebitCardPinAttempt:C=>{e(Yt(t,C)),C==="success"&&e(pa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(C,u)=>{C?e(pa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):u!=null&&e(pa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:u.message}]}))},updateSpendLimit(C,u,D,o){e(Zt(C,u,D.code,o))},shouldOpenCreditCardPaymentDrawer(C){C&&v!=null&&K.trackCardsPayEarlyClick(c,l,v,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:y?.accType==="depositAccount",creditCardPaymentSourceAccountName:y?.label,creditCardPaymentSourceAccountType:y?.accType,creditCardPaymentSourceLastFourDigits:y?.accountLast4,creditCardPaymentSourceBalance:y?.accountBalance?.available?.amount??0},h,x),_(C)}}})(Za(is));function Ys(){const e=me(),a=Ce(),t=Se(),{cardId:r}=ba(),[n,f]=d.useState(!1),[p,g]=d.useState(!1),{useDynamicConfig:_}=oe(),c=ee.getSignedInUser(),l=S(H=>de(H)),v=S(H=>ja(H).firstViewAfterActivation),y=S(H=>H.classListState.fetchState),{configValue:h}=_(Le.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:x}=_(Le.zeniCardsConfig),F=x.enable_card_controls_for_company_ids,L=x.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(l.companyId),[C,u]=d.useState(!1),[D,o]=d.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:A}=I(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=I(Q.isDebitCardFeatureEnabled),E=Ee(j,l),b=ke({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:E}),{isFeatureEnabled:B}=I(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=I(Q.isCardsCommentingEnabled),m=Ae(l),O=Ie(l),M=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:A,isBookKeepingTenant:m,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:M}),T=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,G=!!l.companyChargeCardInfo?.info?.isChargeCardEnabled,$=!l.userRole.includes("charge_card_user")&&R&&G;if(r==null)throw Error("Empty card id is not valid...");const V=S(H=>ya(H,l.companyId)),{creditAccount:w,creditAccountRepayment:Z}=S(H=>Xe(H)),q=ee.getZeniOtpTokenForCardHolder(r),P=S(H=>lt(H,r,$,R)),{isAiCfoAccessEnabled:U,onAskAiCfoClick:te}=In({mobileExploreReferrer:"Card Detail"});un({isDataReady:P.fetchState==="Completed"});const ae=S(H=>Je(H)),k=P.chargeCard,z=Ge(),X=He(z?.loggedInUserRoleMap),J=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_virtual_debit_card",Y=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_physical_credit_card",re=k?.type.code==="business_virtual_debit_card"||k?.type.code==="business_virtual_credit_card",De=k?.type.code==="business_virtual_debit_card",Oe=Ea(R,G,X,w,Z),W=fn(J,P),fe=St(X,ae),we=Me(R,b,T,G),Ue=P.depositAccountLimitFetchState.fetchState!=="Completed"&&P.depositAccountLimitFetchState.fetchState!=="In-Progress",Fe=S(H=>Ke(H,l.companyId)),Be=qe(Fe.controllers),ne=S(H=>k?.cardCreatedByUser?.userId!=null?Ba(H.userRoleState,k?.cardCreatedByUser?.userId):void 0),Da=S(H=>ne?.accountingClassIDs[0]!=null?xa(H.classState,{classId:ne?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=S(H=>k?.cardHolderUser?.userId!=null?Ba(H.userRoleState,k?.cardHolderUser?.userId):void 0),oa=S(H=>ie?.accountingClassIDs[0]!=null?xa(H.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),le=l?.userRole,je=S(H=>ea(H,!1,b,A).revokeCardInvite),ia=bt(je.saveStatus.fetchState);if(d.useEffect(()=>{if(ia==="In-Progress"&&je.saveStatus.fetchState==="Completed"){const H=ze(l.tenantEmailDomain);e(H)}},[ia,je.saveStatus.fetchState,e,l.tenantEmailDomain]),d.useEffect(()=>{v&&n===!1&&re&&(f(!0),setTimeout(()=>{a(La()),De&&a(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[v,n,re,De]),d.useEffect(()=>{C||P.fetchState==="Completed"||P.fetchState==="In-Progress"||r==null||(u(!0),a(ca(r,$,R,!1)))},[C,P,r,a]),d.useEffect(()=>{!D&&P.fetchState==="Completed"&&P.chargeCard?.connectedAccountId!=null&&J&&Ue&&X&&(o(!0),a(Qt({depositAccountId:P.chargeCard?.connectedAccountId})))},[D,P,a,Ue,X]),d.useEffect(()=>{ae.fetchState!=="Completed"&&ae.fetchState!=="In-Progress"&&X&&a(ha()),y!=="Completed"&&y!=="In-Progress"&&a(Vt()),P.transactionStatistics.fetchState!=="Completed"&&P.transactionStatistics.fetchState!=="In-Progress"&&a(rr({chargeCardId:r})),V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&a(fa(l.companyId,!0))},[ae.fetchState,a,X,y,P.transactionStatistics.fetchState,V.fetchState]),d.useEffect(()=>{if(!(P.fetchState!=="Completed"||R&&w.fetchState!=="Completed"||k==null||P.transactionStatistics.fetchState!=="Completed"||J&&X&&P.depositAccountLimitFetchState.fetchState!=="Completed")){const H=k.type.code.includes("physical"),ue=H?k.cardActivationAttemptHistory[0]?.timestamp:k.createTime;K.trackCardsCardDetailView(Be,we,{cardId:r,cardName:k.cardName,cardType:k.type.code.includes("credit")?"credit":"debit",cardCategory:H?"physical":"virtual",cardLimit:ra(k.limit.amount),cardLastFourDigits:k.accountLast4,cardStatus:k.status.code,cardAssignedDate:k.createTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:k.providerCardCreateTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:ue?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:k.creditLimitFrequency.name,cardSpentAmount:ra(k.balance.amount),cardAvailableLimit:ra(k.available.amount),cardUtilizationPercent:k.limit.amount>0?Math.round((k.limit.amount-k.available.amount)/k.limit.amount*100):0,cardUtilizationAmount:ra(k.limit.amount-k.available.amount),totalNumberOfDeclinedTransactions:P.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:P.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:P.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:P.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:P.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:P.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:ct(k.cardCreatedByUser,!1),cardIssuedByEmail:k.cardCreatedByUser?.email,cardIssuedByUserId:k.cardCreatedByUser?.userId,cardIssuedByRole:ne?.userRoles,cardIssuedByDepartment:Da?.className},{cardholderName:ct(k.cardHolderUser,!1),cardholderEmail:k.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:k.cardHolderUser?.userId,cardholderDepartment:oa?.className},Oe,W)}},[P.fetchState,P.depositAccountLimitFetchState.fetchState,P.transactionStatistics.fetchState,w.fetchState,X]),c==null)throw Error("Can't access card detail page without signing in...");const da=$e(l),la=X?[...it,...Tn]:it,ua={events:ta(da,la),eventCallback:(H,ue,xe)=>{xe.onEventReceived(H,ue)},onSubscribed:H=>{H.onPusherSubscribed()}},ma=()=>{if(r!=null&&k!=null){const{ownerName:H,cardName:ue,utilisation:xe,limit:Qe,frequency:N,cardColor:ge}=rt(k),be=k.cardHolderUserId===c.userId;K.trackCardsDetailPageViewed(r,H,ue,xe,Qe,N,ge,be)}};d.useEffect(()=>{if(P.fetchState==="Completed"){const H=P.chargeCard;if(H?.status.code==="inactive"||J&&H?.isPinSet===!1||Y&&v){const ue=pe(l.tenantEmailDomain,r,c,k,v);e(ue)}}},[P.fetchState]);const Ca=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:xe,cardName:Qe,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;K.trackCardsDetailPageClicked(r,xe,Qe,N,ge,be,H,et,ue)}},qa=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:xe,cardName:Qe,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;K.trackCardsVerifyPopUpClick(r,xe,Qe,N,ge,be,H,et,ue)}},wa=w.balance.amount+w.hold.amount,Pa=l.companyChargeCardInfo?.info?.primaryFundingAccount,Xa=V.allFundingAccounts.find(H=>H.id===Pa?.accountId),va=P.chargeCard!=null,Ja=P.depositAccountLimit!=null;return P.fetchState!=="Error"||va?!va&&(P.fetchState==="In-Progress"||P.fetchState==="Not-Started")||je.saveStatus.fetchState==="In-Progress"||!Ja&&J&&X&&P.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(os,{}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:v}),P.fetchState==="Completed"?s.jsx(yt,{analytics:K,onLoad:ma}):null,p===!0?s.jsx(wt,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:p,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:we,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,creditAccountSpentAmount:wa,isDebitCardInfoFetchStateCompleted:!J||!X||P.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!R||w.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!X||ae.fetchState==="Completed",paymentInitiatedDate:Z.initiatedRepaymentDate}):null,s.jsx(Zs,{...ua,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:qa,onFireOnClickAnalytics:Ca,isSandboxEnv:ht(),signedInUser:c,location:t,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ne?.userRoles,cardIssuedByDepartmentName:Da?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:oa?.className,loggedInUserRole:le,isChargeCardFeatureEnabled:R,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:G,isCardControlsEnabled:L,isEarlyPayEnabled:B,controllerEmails:Be,chargeCardCashbackDetailState:ae,productInformation:we,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,classListFetchState:y,primaryFundingAccountDetails:Xa,currentTenant:l,cardProviderId:P.chargeCard?.cardProviderID,cardId:r,creditAccount:w,creditAccountRepayment:Z,includeCreditAccountInfo:$,signedInUserToken:q,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:U,onAskAiCfoClick:te,isCardsCommentingEnabled:i})]}):s.jsx(Ya,{})}const rt=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}},Fn=[aa,Wa,Pn,ka,_a,Ka,Dt,Bs,kt,_t,Et],Ws=new Set(Fn),dt=vs((e,a,t,r)=>{e(ga(a,t,r,!0))},400),Ks=Te.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
|
-
`,qs=he(function(e,a){const t=ea(e,a.includeCreditAccountDebitSummaryAndCashbackInfo,a.isDebitCardFeatureEnabled&&a.isDebitCardSetupEnabled,a.isChargeCardFeatureEnabled&&a.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:Cr(e),bulkActionView:pr(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:p,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:_,isCreditCardProductVisibleForExpressInterest:c,isChargeCardSetupEnabled:l,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:y,isDebitCardTOSAccepted:h,isChargeCardTOSAccepted:x,controllerEmails:F,depositAccountListWithDebitCardIssued:L,primaryFundingAccountDetails:C,chargeCardSetUpViewFetchState:u,productInformation:D,cashbackInformation:o,creditAccountInformation:I,debitAccountInformation:A,updatePayNowInfoTooltip:j,isUserHasCardsAdminLevelAccess:E}=a,{tenantEmailDomain:b}=r,{cards:B}=p;return{onChargeCardRowClick:(i,m)=>{const O=bn(B,i);let M;O!=null&&((T=>{const G=T.limit.amount-T.available.amount,$=`${T.cardHolderUser?.firstName.toLowerCase()} ${T.cardHolderUser?.lastName.toLowerCase()}`,V=T.cardName,w=T.department?.className??"",Z=T.limit.amount,q=T.creditLimitFrequency.name;K.trackCardsListRowClicked($,V,w,G,Z,q,f.userId===T.cardHolderUserId)})(O),Ye(v,y,L)&&K.trackCardsCardListRowClick(F,D,"Card Row Item","row_clicked",m+1,{cardOwner:ct(O.cardHolderUser,!1),cardName:O.cardName,cardType:O.type.code.includes("credit")?"credit":"debit",cardStatus:O.status.code,cardUtilizationAmount:ra(O.limit.amount-O.available.amount),cardUtilizationPercent:O.limit.amount>0?Math.round((O.limit.amount-O.available.amount)/O.limit.amount*100):0,cardLimit:ra(O.limit.amount)},o,I,A)),M=O?.status.code==="request_on_hold"&&f.userId===O.cardHolderUserId?yn(b):pe(b,i,f,O);const R=ye(n.state?.pathnameStackToGoBack,n.pathname);t(M,{state:{pathnameStackToGoBack:R}})},onFetchChargeCardsRecurringExpenses:i=>{e(qt(i))},onFetchDepositAccountLimit:i=>{e(Qt({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Ar(i))},onChargeCardRevokeInviteClick:i=>{e(Wt(i))},onLockChargeCardList:(i,m)=>{e(Ir(i,m))},onUnlockChargeCardList:i=>{e(Sr(i))},onCloseChargeCardList:(i,m)=>{e(yr(i,m))},onRevokeChargeCardList:i=>{e(br(i))},updateChargeCardListSpendLimit(i,m,O){e(gr(i,m,O.code))},onLockChargeCard:(i,m)=>{e(en(E,i,m))},onUnlockChargeCard:i=>{e(Jt(E,i))},onCloseChargeCard:(i,m)=>{e(Xt(i,m))},onUpdateSpendLimit(i,m,O,M){e(Zt(i,m,O.code,M))},updateChargeCardName:(i,m)=>{e(Kt(E,i,m))},onClickSetupIcon:()=>{K.trackCardsListPageClicked("settings"),Ye(v,y,L)&&o!=null&&K.trackCardsSettingsClick(F,D,o,I,A);const i=ws(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onIssueCardClick:()=>{K.trackCardsListPageClicked("new card"),Ye(v,y,L)&&o!=null&&K.trackCardsNewCardClick(F,D,o,"New Button","card_creation_initiated","Card List",I,A);const i=Xs(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onColumnSortConfigChanged:(i,m)=>{Ye(v,y,L)&&o!=null&&K.trackCardsCardListSortClick(F,D,o,"Sort Icon","sort",i,m==="ascending"?"ASC":"DESC","Cards List",I,A),e(st({uiState:{sortKey:i,sortOrder:m}}))},onSearchTextChanged:i=>{e(fr(i))},onReloadCards:()=>{e(ga(g,v&&y,_&&l,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{Ye(v,y,L)&&o!=null&&K.trackCardsCashbackOverviewClick(F,D,o,"Cashback Overview","cashback_details_viewed",I,A),t("./cashback")},onClickStatementsIcon:()=>{Ye(v,y,L)&&o!=null&&K.trackCardsStatementsClick(F,D,o,I,A),t("./statements")},onCreateNowClick:i=>{Ye(v,y,L)&&o!=null&&K.trackCardsNewCardClick(F,D,o,"Promo Banner","card_creation_initiated","Card List",I,A),t(`./new?cardType=${i}`)},onPromoCardClick:i=>{t(i==="debit"&&v&&!h||i==="credit"&&c&&!x?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,m)=>{u==="Completed"&&r.company!=null&&o!=null&&K.trackCardsPayEarlyClick(F,D,o,"Card List",i,m,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:C?.accType==="depositAccount",creditCardPaymentSourceAccountName:C?.label,creditCardPaymentSourceAccountType:C?.accType,creditCardPaymentSourceLastFourDigits:C?.accountLast4,creditCardPaymentSourceBalance:C?.accountBalance?.available?.amount??0},I,A);const O=Js(b);t(O)},navigateToCreditCardPaymentHistoryPage:()=>{const i=ec(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},shouldShowPayNowInfoTooltip:j,onSetRowActionCardId:i=>{e(hr(i))},onSetBulkActionCardIds:i=>{e(an(i))},onEventReceived:i=>{Ws.has(i)&&dt(e,g,v&&y,_&&l)},onPusherSubscribed:()=>{dt(e,g,v&&y,_&&l)}}})(Za(ds));function Lt({isPaymentDrawerOpen:e}){const a=me(),t=Ce(),r=Se(),n=d.useCallback((N,ge)=>{t(an([])),a(N,ge)},[t,a]),[f,p]=d.useState(!1),[g,_]=d.useState(ee.getPayNowInfoTooltip()??!1),c=N=>{ee.savePayNowInfoTooltip(N),_(N)},[l,v]=d.useState(!1),y=ee.getSignedInUser(),h=S(N=>de(N)),[x,F]=d.useState(!1),[L,C]=d.useState(!1),{isAiCfoAccessEnabled:u,onAskAiCfoClick:D}=In({mobileExploreReferrer:"Cards"}),o=h.userRole.includes("charge_card_user"),I=!o,A=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:j,useDynamicConfig:E}=oe(),{isFeatureEnabled:b}=j(Q.isCashbackFeatureEnabled),{isFeatureEnabled:B}=j(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=j(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=j(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:O}=j(Q.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:M}=j(Q.isCardsCommentingEnabled),R=Ee(i,h),T=ke({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:R}),G=Ie(h),$=Ae(h),V=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=_e({isCardsOnlyTenant:G,isChargeCardFeatureEnabled:B,isBookKeepingTenant:$,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:V}),Z=gn({isCardsOnlyTenant:G,isChargeCardFeatureEnabled:B,isBookKeepingTenant:$}),{configValue:q}=E(Le.zeniCardsConfig),P=Ge(),U=He(P?.loggedInUserRoleMap),te=S(N=>Ke(N,h.companyId)),ae=qe(te.controllers),k=q.charge_card_cashback_rate_per_transaction!=null?q.charge_card_cashback_rate_per_transaction:.0175,z=q.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??q.default_credit_card_pay_now_threshold??Ds,X=q.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(q.enable_card_controls_for_company_ids)&&q.enable_card_controls_for_company_ids.includes(h.companyId),J=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Y=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,De=S(N=>Mt(N)),Oe=bt(De.updateStatus),W=S(N=>ea(N,I,T&&A,w&&re)),fe=W.cards.filter(N=>N.type.code.includes("debit")).map(N=>N.connectedAccountId),we=[...new Set(fe)],Ue=S(N=>Je(N)),Fe=S(N=>$a(N,we)),Be=S(N=>ya(N,h.companyId)),ne=Be.companyChargeCardInfo?.primaryFundingAccount,Da=Be.allFundingAccounts.find(N=>N.id===ne?.accountId),ie=W.fetchState,oa=W.creditAccount;un({isDataReady:ie==="Completed"});const{creditAccountRepayment:le}=S(N=>Xe(N)),je=S(N=>ja(N).firstViewAfterActivation),{areTenantIdsInSync:ia}=Cn(),da=St(U,Ue),la=Ea(w,re,U,oa,le),ua=It(T,A,U,Fe,W.debitCardSummary),ma=Me(w,T,A,re),Ca=W.creditAccount.balance.amount+W.creditAccount.hold.amount;if(d.useEffect(()=>{ie==="Completed"&&(ee.getPayNowInfoTooltip()==null||Ca<z*W.creditAccount.limit.amount/100)&&c(!0)},[ie,z,Ca,W.creditAccount.limit.amount]),d.useEffect(()=>{if(e!=null&&e===!0&&le.initiatedRepayments.amount===0&&le.fetchState==="Completed"||Oe==="In-Progress"&&De.updateStatus==="Completed")c(!1),p(!0);else if(le.initiatedRepayments.amount>0&&le.fetchState==="Completed"){p(!1),document.body.style.overflow="auto";const N=ze(h.tenantEmailDomain);n(N)}},[e,le.initiatedRepayments.amount,le.fetchState,Oe,De.updateStatus,n,h.tenantEmailDomain]),d.useEffect(()=>{!x&&(re||A)&&ia&&(F(!0),t(ga(I,T&&A,w&&re,!1)))},[x,I,t,ia]),d.useEffect(()=>{je&&l===!1&&(v(!0),setTimeout(()=>{t(La())},5e3))},[je,l]),d.useEffect(()=>()=>{dt.flush()},[]),d.useEffect(()=>{ie==="Completed"&&o&&W.cards.length===1&&(W.cards[0].status.code==="inactive"&&W.cards[0].type.code==="business_physical_credit_card"?n(`./${W.cards[0].id}/activate`):W.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${W.cards[0].id}`)))},[ie,o,r.state,n,W.cards]),d.useEffect(()=>{if(ie==="Completed"&&o){const N=W.cards.length,ge=W.cards.filter(be=>be.cardHolderUserId===y?.userId).filter(be=>be.status.code==="request_on_hold");ge.length>0&&N===ge.length&&n("./onboard")}},[ie,W.cards,o,n,y?.userId]),d.useEffect(()=>{ie!=="Completed"||w&&le.fetchState!=="Completed"||T&&A&&U&&Fe.fetchState!=="Completed"||K.trackCardsCardListView(ae,ma,da,la,ua)},[ie,oa,le.fetchState,Fe.fetchState,U]),y==null)throw Error("Can't access charge card list page without signing in...");const qa=S(N=>tn(N.userState,N.userRoleState,N.userListViewState,"cardAdmin")),wa=Ct(P?.loggedInUserRoleMap),Pa=N=>{C(N)},Xa=W.creditAccount.limit,va=()=>{p(!1),n("..")},Ja=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:w,isTOSAccepted:J,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:wa}),H=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:T,isTOSAccepted:Y,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:wa}),ue=Ja||H,xe=$e(h),Qe={events:ta(xe,Fn),eventCallback:(N,ge,be)=>{be.onEventReceived(N)},onSubscribed:N=>{N.onPusherSubscribed()}};return re||A?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:K,onLoad:()=>{K.trackPageLoaded(pn.Event.cardsListPage),(w&&!re||T&&!A)&&K.trackCardsPromoView(ae,{isCreditCardOffered:w,isDebitCardOffered:T,isDebitCardEnabled:A,isCreditCardEnabled:re},"Banner",T&&!A?"Debit Card":w&&!re?"Credit Card":"","Card List")}}),s.jsx(za,{showConfetti:je})]}):null,f===!0?s.jsx(wt,{closeDrawerHandler:va,isPaymentDrawerOpen:f,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ca,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isDebitCardInfoFetchStateCompleted:!(T&&A&&U)||Fe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!w||le.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!U||Ue.fetchState==="Completed",paymentInitiatedDate:le.initiatedRepaymentDate}):null,s.jsxs(Ks,{children:[s.jsx(We,{isAppContentDrawerOpen:L,handleDrawerToggle:Pa}),s.jsx(qs,{...Qe,isCashbackFeatureEnabled:b,isChargeCardFeatureEnabled:w,isDebitCardFeatureEnabled:T,isCreditCardProductVisibleForExpressInterest:Z,updatePayNowInfoTooltip:c,showPayNowInfoTooltip:g,creditCardPayNowThreshold:z,signedInUser:y,chargeCardListState:W,location:r,admins:qa.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:X,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:U,includeCreditAccountDebitSummaryAndCashbackInfo:I,onClickMenuIcon:()=>{Pa(!0)},creditLimit:Xa,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:A,isEarlyPayEnabled:m,isChargeCardPaymentHistoryFeatureEnabled:O,cashbackRate:k,controllerEmails:ae,chargeCardCashbackDetailState:Ue,depositAccountListWithDebitCardIssued:Fe,isChargeCardTOSAccepted:J,isDebitCardTOSAccepted:Y,primaryFundingAccountDetails:Da,chargeCardSetUpViewFetchState:Be.fetchState,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isAiCfoAccessEnabled:u,onAskAiCfoClick:D,isCardsCommentingEnabled:M})]})]}):(J||Y)&&U===!0?s.jsx(Fa,{to:"../setup"}):ue?s.jsx(Fa,{to:"../promo"}):s.jsx(Sa,{fetchState:ie})}const Xs=e=>`/${e}/cards/new`,Js=e=>`/${e}/cards/payment`,ec=e=>`/${e}/cards/payment-history`,Bn=[wn,Pn],ac=new Set(Bn),tc=he(function(e){const a=ee.getSignedInUser(),t=de(e),r=e.tenantState.currentTenantId,n=nn(e),f={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:r??""},p=t?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:Er(t),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:f,companyName:p,spendManagementEndPoint:`${ot}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,a){const{location:t,navigate:r}=a;return{onBackClick:()=>{const n=Re(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(_r({filters:n}))},onReloadPayments:()=>{e(Ta(!0))},onEventReceived:n=>{ac.has(n)&&e(Ta(!0))},onPusherSubscribed:()=>{e(Ta(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(kr({uiState:{downloadState:n}}))}}})(Za(ls));function nc(){const e=me(),a=Se(),t=Ce(),{areTenantIdsInSync:r}=Cn(),{useFeatureGate:n}=oe();if(ee.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const f=S(k=>de(k)),p=S(k=>nn(k)),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,x]=d.useState(null),F=!f.userRole.includes("charge_card_user"),L=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:C}=n(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Q.isDebitCardFeatureEnabled),D=Ee(u,f),o=ke({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:D}),I=Ie(f),A=Ae(f),j=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=_e({isCardsOnlyTenant:I,isChargeCardFeatureEnabled:C,isBookKeepingTenant:A,isDebitCardProductVisible:o,chargeCardsCreditAccountLimit:j}),b=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,B=Ge(),i=He(B?.loggedInUserRoleMap),m=S(k=>ea(k,F,o&&L,E&&b)),O=d.useMemo(()=>{const k=m.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(k.map(z=>z.connectedAccountId))]},[m.cards]),M=S(k=>Je(k)),R=S(k=>$a(k,O)),{creditAccountRepayment:T}=S(k=>Xe(k)),G=d.useMemo(()=>St(i,M),[i,M]),$=d.useMemo(()=>Ea(E,b,i,m.creditAccount,T),[E,b,i,m.creditAccount,T]),V=d.useMemo(()=>It(o,L,i,R,m.debitCardSummary),[o,L,i,R,m.debitCardSummary]),w=d.useMemo(()=>Me(E,o,L,b),[E,o,L,b]),Z=m.creditAccount.balance.amount+m.creditAccount.hold.amount,q=d.useMemo(()=>h!=null?p.repaymentHistory.find(k=>k.cardRepaymentId===h):void 0,[h,p.repaymentHistory]),P=d.useCallback(k=>{x(k),t(ga(F,o&&L,E&&b,!1)),y(!0)},[t,F,o,L,E,b]),U=d.useCallback(()=>{y(!1),x(null),document.body.style.overflow="auto"},[]);d.useEffect(()=>{g||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(_(!0),t(Ta()))},[g,t,p.fetchState]),d.useEffect(()=>{!c&&(b||L)&&r&&(l(!0),t(ga(F,!1,E&&b,!1)))},[c,b,L,r,t,F,E]);const te=$e(f),ae={events:ta(te,Bn),eventCallback:(k,z,X)=>{X.onEventReceived(k)},onSubscribed:k=>{k.onPusherSubscribed()}};return s.jsxs(s.Fragment,{children:[v?s.jsx(wt,{closeDrawerHandler:U,isPaymentDrawerOpen:v,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:Z,productInformation:w,creditAccountInformation:$,debitAccountInformation:V,cashbackInformation:G,isDebitCardInfoFetchStateCompleted:!(o&&L&&i)||R.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||T.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||M.fetchState==="Completed",paymentInitiatedDate:T.initiatedRepaymentDate,retryRepayment:q}):null,s.jsx(tc,{...ae,location:a,navigate:e,accountInfoByAccountId:p.accountInfoByAccountId,onRetryPaymentClick:P})]})}const Rt=Te.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=gt.getLocalizedStrings().months;function rc(){const e=me(),a=Ce(),t=Se(),{creditAccount:r,creditAccountRepayment:n}=S(w=>Xe(w)),f=`${mn.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[p,g]=d.useState(!1),[_,c]=d.useState(!1),l=S(w=>Dr(w)),{useFeatureGate:v}=oe(),y=S(w=>de(w)),{isFeatureEnabled:h}=v(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=v(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=v(Q.isCardsCommentingEnabled),L=Sn(F?y.companyId:void 0,{clearParams:F&&l.fetchState==="Completed"}),C=Ee(x,y),u=ke({isDebitCardFeatureEnabled:x,isBankingOnlyTenant:C}),D=Ie(y),o=Ae(y),I=y.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=_e({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:h,isBookKeepingTenant:o,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:I}),j=!!y.companyDebitCardInfo?.info?.isDebitCardEnabled,E=!!y.companyChargeCardInfo?.info?.isChargeCardEnabled,b=S(w=>Ke(w,y.companyId)),B=qe(b.controllers),i=S(w=>rn(w)),m=i.cards.filter(w=>w.type.code.includes("debit")).map(w=>w.connectedAccountId),O=[...new Set(m)],M=S(w=>$a(w,O)),R=S(w=>wr(w));d.useEffect(()=>{_||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),a(Ne()))},[p,a,r.fetchState]),d.useEffect(()=>{_||r.fetchState!=="Completed"||r.id==null||l.fetchState==="Completed"||l.fetchState==="In-Progress"||(c(!0),a(Pr(r.id)))},[_,a,r.fetchState,r.id,l.fetchState]),d.useEffect(()=>{M.fetchState!=="Completed"&&M.fetchState!=="In-Progress"&&u&&j&&a(sn()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a(ve()),R.fetchState!=="Completed"&&R.fetchState!=="In-Progress"&&u&&j&&a(vr()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&A&&E&&a(ut())},[M.fetchState,u,j,i.fetchState,R.fetchState,n.fetchState,A,E]),d.useEffect(()=>{if(l.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&i.fetchState==="Completed"&&(!u||!j||M.fetchState==="Completed"&&R.fetchState==="Completed")){let w="",Z="";if(l.statements.length>0){const te=l.statements[l.statements.length-1].period,[ae,k]=te.split("-"),z=l.statements[0].period,[X,J]=z.split("-");w=`${Ot[parseInt(k)-1]} ${ae}`,Z=`${Ot[parseInt(J)-1]} ${X}`}const q=Me(A,u,j,E),P=Ea(A,E,!0,r,n),U=It(u,j,!0,M,R);K.trackCardsCreditCardStatementsView(B,q,{numberOfStatements:l.statements.length,oldestStatementMonthYear:w,latestStatementMonthYear:Z},P,U)}},[l.fetchState,r.fetchState,n.fetchState,M.fetchState,i.fetchState,R.fetchState]);const T=()=>{const w=Re(t.state?.pathnameStackToGoBack),Z=w.poppedPathname??"..";e(Z,{state:{pathnameStackToGoBack:w.newStack}})},G=S(w=>Je(w)),$=ee.getSignedInUser(),V={userId:$?.userId??"",sessionId:$?.zeniSessionId??"",tenantId:y.tenantId??""};if($==null)throw Error("Can't access address page without signing in...");if(l.fetchState!=="Completed")return s.jsx(Rt,{children:s.jsx(us,{onBackClick:T})});{const w=Me(A,u,j,E);return s.jsx(Rt,{children:s.jsx(ms,{currentTenantCompanyName:y.companyName,statementListView:l,productInformation:w,onBackClick:T,authParams:V,controllerEmails:B,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:E,isCardsCommentingEnabled:F,initialOpenThreadRequest:L,chargeCardCashbackDetailState:G,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:M,debitCardSummary:R,downloadEndPoint:f})})}}const xn=[aa,Ka],sc=new Set(xn),cc={containerWidth:new Aa(100,58)},oc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),n=Se(),{useDynamicConfig:f}=oe(),[p,g]=d.useState(!1),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),x=d.useRef(!1),F=d.useRef(null);d.useEffect(()=>()=>{F.current!=null&&(clearTimeout(F.current),F.current=null)},[]);const[L,C]=d.useState(!1),[u,D]=d.useState(!1),o=ee.getSignedInUser();if(o==null)throw Error("Can't access onboarding card page without signing in...");const I=S(U=>de(U)),{configValue:A}=f(Le.zeniCardsConfig),j=S(U=>Tr(U)),{tenantEmailDomain:E}=I,b=S(U=>U.settingsViewState.profile.fetchState),B=S(U=>U.chargeCardListState.fetchState),i=S(U=>U.settingsViewState.profile.userId),m=S(U=>U.chargeCardConfigState.fetchState);d.useEffect(()=>{p===!1&&b!=="In-Progress"&&b!=="Completed"&&(t(Fr()),g(!0)),_===!1&&m!=="In-Progress"&&m!=="Completed"&&(t(Va()),c(!0)),l===!1&&B==="Not-Started"&&(v(!0),t(ve()))},[p,l,B,_,m]),d.useEffect(()=>{b==="Completed"&&L===!1&&i!=null&&B==="Completed"&&j.cards.length>0&&(t(Br({userId:i})),t(cn({cardId:j.cards[j.cards.length-1].id})),C(!0))},[b,L,i,B]),d.useEffect(()=>{if(!y&&j.fetchState==="Completed"&&j.cards.length===0){const U=Re(n.state?.pathnameStackToGoBack),te=U.poppedPathname??ze(E);r(te,{state:{pathnameStackToGoBack:U.newStack}})}},[j.fetchState,j.cards,y]);const O=S(U=>ja(U)),M=bt(O.updateStatus.fetchState),R=O.currentDisplayedCardId,{useFeatureGate:T}=oe(),{isFeatureEnabled:G}=T(Q.isChargeCardFeatureEnabled),$=!!I.companyChargeCardInfo?.info?.isChargeCardEnabled,V=!I.userRole.includes("charge_card_user")&&G&&$,w=S(U=>R!=null?on(U.chargeCardState,R):null),Z=()=>{R!=null&&(x.current=!0,F.current!=null&&clearTimeout(F.current),F.current=setTimeout(()=>{x.current=!1,F.current=null},5e3),t(ca(R,V,!0)),t(ve(!0)),h(!0))},q=$e(I);At({events:ta(q,xn),onSubscribed:()=>{t(ve(!0))},onEvent:(U,te)=>{if(!sc.has(U))return;const ae=Pt(te),k=x.current;if(U===aa){const X=ce(ae?.card_id)??R;if(X!=null){const J=vt(ae,X);if(J!=null)return t(mt(J)),void(X!==R||k||Z())}}if(U===Ka)return void t(ve(!0));const z=ce(ae?.card_id)??R;(R==null||z===R)&&R!=null?k||Z():t(ve(!0))}}),d.useEffect(()=>{if(y&&R!=null&&w!=null&&w.status.code!=="request_on_hold"){const U=pe(I.tenantEmailDomain,R,o,w),te=ye(n.state?.pathnameStackToGoBack,n.pathname);t(xr()),w?.type.code==="business_virtual_credit_card"&&t(Na()),r(U,{state:{pathnameStackToGoBack:te},replace:!0}),x.current=!1,F.current!=null&&(clearTimeout(F.current),F.current=null)}},[y,w?.status.code]),d.useEffect(()=>{M==="In-Progress"&&O.updateStatus.fetchState==="Completed"&&setTimeout(Z,3e3)},[M,O.updateStatus.fetchState]);const P=U=>{D(U)};if(b!=="Completed"||j.cards.length===0)return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:P}),s.jsx(Cs,{})]});if(i==null)throw Error("Can't access my userId.");return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:P}),s.jsx(ic,{chargeCardListView:j,cardUserOnboardingView:O,navigate:r,currentTenant:I,myUserId:i,location:n,chargeCardCashbackRatePerTransaction:A.charge_card_cashback_rate_per_transaction!=null?A.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{P(!0)}}),e!=null?s.jsx(dc,{windowSize:a,children:e}):null]})},ic=he(function(e,{currentTenant:a,cardUserOnboardingView:t,chargeCardListView:r,myUserId:n}){const f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{cards:r.cards,showMenuIcon:p,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:p}=f;return{updateCardUserOnboardingLocalData:g=>{e(Ft({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const _={...r.cardUserOnboardingLocalData,phone:g};e(Ft({localData:_}))}e(Ga(g,"CardUserOnboarding"))},onResendOtp:g=>{e(Ma(g,"CardUserOnboarding"))},onVerifyOtp:(g,_)=>{e(Ha(g,_,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(Lr()),g!=null&&ee.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(cn({cardId:g}))},onBackClick:()=>{const g=Re(n.state?.pathnameStackToGoBack),_=g.poppedPathname??ze(p);t(_,{state:{pathnameStackToGoBack:g.newStack}})}}})(ps),dc=Te.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
width: ${e=>`${cc.containerWidth.value(e.windowSize)}%`};
|
|
38
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
-
`,Ut=Te.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
|
-
`,lc={containerWidth:new Aa(100,58)},uc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p,useFeatureGate:g}=oe(),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),[x,F]=d.useState(!1),L=ee.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const C=S(V=>de(V));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=p(Le.zeniCardsConfig),D=S(V=>Rr(V,n)),{isFeatureEnabled:o}=g(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=g(Q.isDebitCardFeatureEnabled),A=Ee(I,C),j=ke({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:A}),E=Ie(C),b=Ae(C),B=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=_e({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:o,isBookKeepingTenant:b,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:B}),m=D.chargeCard,O=S(V=>V.chargeCardConfigState.fetchState);d.useEffect(()=>{_===!1&&O!=="In-Progress"&&O!=="Completed"&&(t(Va()),c(!0)),l===!1&&D.fetchState==="Not-Started"&&(v(!0),t(ca(n,!1,i)))},[l,D.fetchState,_,O]);const M=m?.type.code==="business_physical_debit_card"||m?.type.code==="business_virtual_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(y===!1&&(M===!1||M&&m.status?.code!=="active"||M&&m.status.code==="active"&&m.isPinSet||m.cardHolderUserId!==L.userId)){const V=pe(C.tenantEmailDomain,n,L,m,!0),w=ye(f.state?.pathnameStackToGoBack,f.pathname);r(V,{state:{pathnameStackToGoBack:w}})}else if(y&&D.isRefreshingViewInBackground===!1&&m?.isPinSet===!0){t(Or({chargeCardId:n}));const V=pe(C.tenantEmailDomain,n,L,m,!0),w=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(V,{state:{pathnameStackToGoBack:w}})}}},[D.fetchState,m?.type.code,y,D.isRefreshingViewInBackground]);const R=ee.getZeniOtpTokenForCardHolder(n),T=S(V=>Nt(V.userState,L.userId)),G=()=>{m?.isPinSet!==!0&&t(na(n,!0))};d.useEffect(()=>{D.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(G,3e3),h(!0))},[D.updateDebitCardPinAttemptFetchState.fetchState]);const $=V=>{F(V)};if(O!=="Completed"||m==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(T?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(pc,{children:[s.jsx(We,{isAppContentDrawerOpen:x,handleDrawerToggle:$}),s.jsx(mc,{cardId:n,card:m,phone:T.phone,signedInUser:L,isSandboxEnv:ht(),debitCardDetailState:D,signedInUserToken:R,navigate:r,currentTenant:C,location:f,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{$(!0)}}),e!=null?s.jsx(Cc,{windowSize:a,children:e}):null]})},mc=he(function(e,{debitCardDetailState:a,cardId:t}){const r=Ht(e,t),n=a.updateStatus,f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{showMenuIcon:p,vgsVaultId:Qa.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,debitCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e(Ga(c,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:c=>{e(Yt(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onSetPinSuccess:()=>{e(Ur({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("activate")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(hs),Cc=Te.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
width: ${e=>`${lc.containerWidth.value(e.windowSize)}%`};
|
|
51
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
-
box-shadow: ${e=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
-
`,pc=Te.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=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
-
`,hc={overlayWidth:new Aa(at[12],at[12],at[9])},fc=he(function(e,a){const t=pt(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(dn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const p=Ts(f);e(Nr({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:p})),e(Hr(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{a.onDismissClick(),t!=null&&e(Vr({addressId:t,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(fs),gc=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:t})=>{const r=ft(),n=Ia(),f=()=>{a()},p=S(g=>jr(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(hn,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:hc.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,_)=>(_==="backdropClick"||_==="escapeKeyDown")&&f(),children:s.jsx(fc,{googleAPIKey:Qa.googleMapsAPIKey,onDismissClick:f,lineId:e,chargeCardTypeOption:t,newCustomAddressId:p})})},bc=he(function(e,a){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g}=a,_=pt(e,t&&p,r&&g);return{issueChargeCards:_,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g,cardHolderCandidates:_.userList.map(c=>c.user).filter(Boolean),allRoles:_.userList.map(c=>c.userRole),allAccountingClasses:_.allAccountingClasses,userList:_.userList}},function(e,a){return{onIssueCardClick:()=>{e($r())},onSaveChangesToLocalStore:t=>{e(Gr(t))},onDismissClick:()=>{e(ln()),a.navigate("../")},resetCustomAddressByLineID:(t,r)=>{e(dn(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}})(ys);function yc(){const e=ee.getSignedInUser(),a=me(),t=Ce(),r=gs(),[n]=jt(),f=n.get("cardType"),{useFeatureGate:p}=oe(),{isFeatureEnabled:g}=p(Q.isIssuePhysicalCardEnabled),{isFeatureEnabled:_}=p(Q.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:c}=p(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Q.isChargeCardFeatureEnabled),v=S(G=>de(G)),y=Ee(c,v),h=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:y}),x=Ie(v),F=Ae(v),L=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,C=_e({isCardsOnlyTenant:x,isChargeCardFeatureEnabled:l,isBookKeepingTenant:F,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:L}),[u,D]=d.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");d.useEffect(()=>{u||(D(!0),t(Mr(h&&I,C&&o,!1)))},[u,D,t]);const o=!!v.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!!v.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(G=>pt(G,C&&o,h&&I)),j=A.fetchState,E=A.issueCardStatus.fetchState,b=A.lastSelfIssuedDebitCardId,B=S(G=>b!=null?on(G.chargeCardState,b):void 0),[i,m]=d.useState(null),[O,M]=d.useState(null),R=()=>{m(null)},T=(G,$)=>{m(G),M($)};return d.useEffect(()=>{if(E==="Completed"){if(b!=null&&B?.type.code==="business_virtual_debit_card"){let G;G=B?.status.code==="request_on_hold"&&e.userId===B.cardHolderUserId?yn(v.tenantEmailDomain):pe(v.tenantEmailDomain,b,e,B),a(G)}else a("../");t(ln())}},[E,b]),j==="Completed"?s.jsxs(s.Fragment,{children:[i!==null&&O!==null?s.jsx(gc,{closeDrawerHandler:R,lineId:i,chargeCardTypeOption:O}):null,s.jsx(bc,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:_,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:C,isChargeCardSetupEnabled:o,isDebitCardSetupEnabled:I,navigate:a,fetchState:A.fetchState,openAddAddressDrawerHandler:T,defaultCardType:f==="creditCard"||f==="debitCard"?f:void 0})]}):j==="Error"?s.jsx(Ya,{}):s.jsx(bs,{})}const Ln=[aa,Ka],Sc=new Set(Ln),Ic=Te.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=he(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:p}=a,{tenantEmailDomain:g}=r,{cards:_}=p;return{onChargeCardRowClick:c=>{const l=bn(_,c),v=pe(g,c,f,l),y=ye(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,l)=>{e(st({uiState:{sortKey:c,sortOrder:l}}))},onReloadCards:()=>{e(ve())},onBackClick:()=>{const c=r.userRole.includes("charge_card_user");e(st({uiState:{sortKey:c?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(Ss);function Ec(){const e=me(),a=Ce(),t=Se(),r=ft(),[n,f]=d.useState(!1),p=S(T=>zr(T)),g=S(T=>de(T)),_=S(T=>Ke(T,g.companyId)),c=qe(_.controllers),{useFeatureGate:l}=oe(),{isFeatureEnabled:v}=l(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(Q.isDebitCardFeatureEnabled),h=Ee(y,g),x=ke({isDebitCardFeatureEnabled:y,isBankingOnlyTenant:h}),F=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,L=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,C=Ge(),u=Ie(g),D=Ae(g),o=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=_e({isCardsOnlyTenant:u,isChargeCardFeatureEnabled:v,isBookKeepingTenant:D,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:o}),A=He(C?.loggedInUserRoleMap),j=S(T=>Je(T)),{creditAccount:E,creditAccountRepayment:b}=S(T=>Xe(T)),B=S(T=>rn(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),i=[...new Set(B)],m=S(T=>$a(T,i));d.useEffect(()=>{n||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(f(!0),a(ve()),a(Va()))},[n,a,p.fetchState]),d.useEffect(()=>{if(p.fetchState==="Completed"&&p.cards.length===1&&O!=null){const T=pe(g.tenantEmailDomain,p.cards[0].id,O,p.cards[0]);e(T,{state:{message:t.state?.message}})}},[p.fetchState,p.cards]);const O=ee.getSignedInUser();d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&I&&L&&A&&a(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&A&&a(ut()),m.fetchState!=="Completed"&&m.fetchState!=="In-Progress"&&x&&F&&A&&a(sn())},[E.fetchState,b.fetchState,a,m.fetchState,x,F,A,I,L]);const M=$e(g);if(At({events:ta(M,Ln),onEvent:(T,G)=>{if(!Sc.has(T))return;const $=Pt(G);if(T===aa){const V=ce($?.card_id);if(V!=null){const w=vt($,V);if(w!=null)return void a(mt(w))}}a(ve(!0))},onSubscribed:()=>{a(ve(!0))}}),O==null)throw Error("Can't access address page without signing in...");const R=p.cards!=null&&p.cards.length>0;if(p.fetchState==="Completed"||R){const T=Me(I,x,F,L);return s.jsx(Ic,{children:s.jsx(Ac,{navigate:e,currentTenant:g,signedInUser:O,productInformation:T,myPendingActivationChargeCardListState:p,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:x,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:L,chargeCardCashbackDetailState:j,creditAccount:E,creditAccountRepayment:b,depositAccountListWithDebitCardIssued:m,controllerEmails:c,location:t})})}return s.jsx(Sa,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})}const kc=he(function(e,a){const{companyId:t,companyLegalName:r}=a;return{chargeCardSetupView:ya(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:p,signedInUser:g,location:_,productInformation:c,isEarlyPayEnabled:l,controllerEmails:v,chargeCardsCreditAccountLimit:y}=a;return{onSetupButtonClick:h=>{if(g!=null&&K.trackCardsPromoPageClicked("enable cards"),n)switch(K.trackCardsEnableCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!0,"charge_cards",l,!1));break;case"debit":e(Ve(r,!0,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!0,"debit_cards",l,!0):Ve(r,!0,"charge_cards__debit_cards",l,!1))}else switch(K.trackCardsSetupCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!1,"charge_cards",l,!1));break;case"debit":e(Ve(r,!1,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!1,"debit_cards",l,!0):Ve(r,!1,"charge_cards__debit_cards",l,!1))}},onBackClick:()=>{const h=Re(_.state?.pathnameStackToGoBack);let x=h.poppedPathname;x==null&&(x=f||p?"..":"../.."),t(x,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(Na()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Yr(r))}}})(As),_c=()=>{const e=me(),{tenantEmailDomain:a}=ba(),[t]=jt(),r=t.get("cardPromoType"),n=Ce(),{useDynamicConfig:f,useFeatureGate:p}=oe(),[g,_]=d.useState(!1),{isFeatureEnabled:c}=p(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:v}=p(Q.isChargeCardFeatureEnabled),{configValue:y}=f(Le.zeniCardsConfig),h=S(ne=>de(ne)),x=S(ne=>Ke(ne,h.companyId)),F=qe(x.controllers),L=y.charge_card_cashback_rate_per_transaction!=null?y.charge_card_cashback_rate_per_transaction:.0175,C=Se(),u=ee.getSignedInUserTenant(a)?.companyId??h.companyId,D=S(ne=>ya(ne,u)),o=D.primaryFundingAccount,I=h.companyBillPayInfo?.info,A=Ie(h),j=Ae(h),E=Ee(c,h),b=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:E}),i=_e({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:b}),m=gn({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j}),O=B&&i===!1,M=I?.businessVerificationStatus?.code==="verified"&&(O||o?.accType==="depositAccount"||Qr(o?.providerVerificationStatus?.code??"")),R=ee.getSignedInUser(),T=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,$=!!h.company?.companyChargeCardInfo.isChargeCardEnabled,V=!!h.company?.companyDebitCardInfo.isDebitCardEnabled,w=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,Z=ne=>{_(ne)},q=S(ne=>ne.chargeCardSetupViewState.fetchState);if(R==null)throw Error("Can't access Charge Card promo page without signing in...");const P=Ge(),U=He(P?.loggedInUserRoleMap),te=Ct(P?.loggedInUserRoleMap),[ae,k]=d.useState(!1),[z,X]=d.useState(!1),[J,Y]=d.useState(!1);d.useEffect(()=>{ae===!1&&C.state?.message==="activation"&&k(!0)},[C.state]),d.useEffect(()=>{z||q!=="Not-Started"||u==null||(X(!0),n(fa(u,!0)))},[z,q,u,n]);const re=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:m,isTOSAccepted:G,isSetupEnabled:$,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),De=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:B,isTOSAccepted:w,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),Oe=B&&De&&m&&b>=0&&re?"debit_and_credit":B&&De?"debit":"credit",W=Ps(r,Oe),fe=D?.chargeCardTermsDetails?.fetchStatus?.fetchState,we=d.useRef(null);d.useEffect(()=>{fe==="In-Progress"?we.current=W:fe!=="Error"&&fe!=="Not-Started"||(we.current=null)},[fe,W]);const Ue=fe!=="In-Progress"&&fe!=="Completed"||we.current==null?W:we.current;d.useEffect(()=>{W==="credit"&&($||m===!1&&V)||W==="debit"&&V||W==="debit_and_credit"&&V&&$?e("../"):(W==="debit_and_credit"&&G===!0&&w===!0||W==="credit"&&(G===!0||m===!1&&w===!0)||W==="debit"&&w===!0)&&U===!0&&e("../setup")},[M,$,V,W,G,w]),d.useEffect(()=>{J||(n(Zr("cardAdmin")),Y(!0))},[J]);const Fe=S(ne=>tn(ne.userState,ne.userRoleState,ne.userListViewState,"cardAdmin")),Be=Me(m,B,V,$);return(re||De)&&q==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:K,onLoad:()=>{if(K.trackPageLoaded(pn.Event.cardsPromoPage),!!m&&!$||!!B&&!V||!!m&&!!B&&!V&&!$){const ne=Dc({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:$,isCreditCardProductVisibleForExpressInterest:m,isDebitCardProductVisible:B});K.trackCardsPromoView(F,Be,"Page",ne,"Promo Page")}}}),s.jsx(za,{showConfetti:ae}),s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(kc,{signedInUser:R,location:C,showEnableCardButton:M,isCompanyBusinessVerificationAndPaymentSetUpDone:M,isChargeCardSetupEnabled:$,isDebitCardSetupEnabled:V,companyLegalName:h.companyName,adminList:Fe.users,isCheckingEnabled:T,navigate:e,companyId:u,cardPromoType:Ue,controllerEmails:F,productInformation:Be,isCreditCardProductVisible:i,isDebitCardFeatureEnabled:c,isEarlyPayEnabled:l,cashbackRate:L,chargeCardsCreditAccountLimit:b,onClickMenuIcon:()=>{Z(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(Is,{})]})},Dc=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:a,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:r})=>t&&r&&!e&&!a?"Credit & Debit Card":t&&!a?"Credit Card":r&&!e?"Debit Card":"";function qc(){const e=Se(),a=S(q=>de(q)),{useFeatureGate:t}=oe(),{isFeatureEnabled:r}=t(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=t(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=t(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:p}=t(Q.isChargeCardPaymentHistoryFeatureEnabled),g=Ee(n,a),_=ke({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),c=Es(a,r,n),l=!!a.company?.companyChargeCardInfo.isChargeCardTOSAccepted,v=!!a.company?.companyDebitCardInfo.isDebitCardTOSAccepted,y=!!a.company?.companyChargeCardInfo.isChargeCardEnabled,h=!!a.company?.companyDebitCardInfo.isDebitCardEnabled,x=Ge(),F=He(x?.loggedInUserRoleMap),L=Ct(x?.loggedInUserRoleMap),{isFeatureEnabled:C}=t(Q.isCashbackFeatureEnabled),u=a.userRole.includes("charge_card_user"),D=!u,o=!u&&y,I=a?.userRole!=null&&Wr(a?.userRole),A=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!I)&&Kr(x?.loggedInUserRoleMap),j=qr(x?.loggedInUserRoleMap),E=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!I)&&Xr(x?.loggedInUserRoleMap),{isFeatureEnabled:b}=t(Q.isDepositAccountsFeatureEnabled),B=b&&!I&&Gt(x?.loggedInUserRoleMap),i=y&&!I,m=h&&!I,O=c&&!I&&He(x?.loggedInUserRoleMap),M=Jr(x?.loggedInUserRoleMap),R=Ie(a),T=Ae(a),G=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,$=_e({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:r,isBookKeepingTenant:T,isDebitCardProductVisible:_,chargeCardsCreditAccountLimit:G}),V=a.companyChargeCardInfo?.info!=null&&sa({cardInfo:a.companyChargeCardInfo.info,isProductVisible:$,isTOSAccepted:l,isSetupEnabled:y,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),w=a.companyDebitCardInfo?.info!=null&&sa({cardInfo:a.companyDebitCardInfo.info,isProductVisible:_,isTOSAccepted:v,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),Z=V||w;return s.jsxs(Rn,{children:[F?s.jsx(se,{path:"setup",element:s.jsx(Bt,{isBillPayAdminLevelAccess:A,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:B,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,isUserHasOnlyBillPayAccess:j,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(se,{path:"verification",element:s.jsx(Bt,{isBillPayAdminLevelAccess:A,isUserHasOnlyBillPayAccess:j,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:B,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,productType:"charge_cards",type:"verification"})}):null,s.jsx(se,{path:"promo",element:s.jsx(_c,{})}),i||m?s.jsxs(s.Fragment,{children:[s.jsx(se,{path:"/",element:s.jsx(Lt,{isPaymentDrawerOpen:!1})}),O&&f?s.jsx(se,{path:"payment",element:s.jsx(Lt,{isPaymentDrawerOpen:!0})}):null,s.jsx(se,{path:"activate",element:s.jsx(Ec,{})}),s.jsx(se,{path:"onboard",element:s.jsx(oc,{})}),F?s.jsx(se,{path:"new",element:s.jsx(yc,{})}):null,C&&D?s.jsx(se,{path:"cashback",element:s.jsx(Rs,{})}):null,o?s.jsx(se,{path:"statements",element:s.jsx(rc,{})}):null,O&&p&&y?s.jsx(se,{path:"payment-history",element:s.jsx(nc,{})}):null,s.jsx(se,{path:":cardId/activate",element:s.jsx(js,{})}),s.jsx(se,{path:":cardId/setPin",element:s.jsx(uc,{})}),s.jsx(se,{path:":cardId/addToWallet",element:s.jsx(Fs,{})}),s.jsx(se,{path:":cardId/*",element:s.jsx(Ys,{})}),s.jsx(se,{path:"*",element:s.jsx(Ya,{})})]}):(l||v)&&F?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../setup"})}):Z?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../promo",state:e.state})}):s.jsx(se,{path:"*",element:null})]})}export{qc as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-Dx9GJaKJ.js";import{a as g}from"./sentry-i8uQ0afM.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-C1GB7aB-.js";import{z as b,b9 as F,v as P,d as V,f as L,af as N,ba as j,at as A,au as U,q as M}from"./index-D4_FYu1h.js";import{eR as C,fI as B,sD as R,fD as _,c1 as z,Ne as q,bn as G,qL as Y,qz as H,kg as X,lM as S,Nf as Z,bE as $,cu as D,lU as J,lX as K}from"./zeni-epic-state-BJXbyZuT.js";import"./mui-S6TXegyD.js";import{d as Q}from"./routePaths-dZ-9-pnI.js";import{M as W}from"./MobileAppDrawer-qPZdyrO4.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]="9f1f86c2-f36b-4674-821e-369177050eba",t._sentryDebugIdIdentifier="sentry-dbid-9f1f86c2-f36b-4674-821e-369177050eba")}catch{}})();const ee=E(function(t){const a=_(t),i=b.getSignedInUser(),l=C(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=q(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:G(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=Q(f,e),o=M(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(Z(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(X({files:e}))},onDeleteFile:e=>{t(H(e))},onEditFileName:(e,n)=>{t(Y(e,n.split(".")[0]))}}})(j);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>C(s)),d=r.companyId??b.getSignedInUserTenant(l)?.companyId;if(b.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(R())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(L.Event.companyPassport,N(i)?"Settings":"Company Passport")}),N(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:N(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-Dx9GJaKJ.js";import{a}from"./sentry-i8uQ0afM.js";import{u as D,g as v,j as c,N as w}from"./core-C1GB7aB-.js";import{JW as A,eR as O,fq as _,ng as j,fR as h,fp as U,eY as L,K1 as F}from"./zeni-epic-state-BJXbyZuT.js";import{u as R,z as m,L as g,D as $,o as k}from"./index-D4_FYu1h.js";import{n as H}from"./mui-S6TXegyD.js";import{t as z}from"./getLocaleForTenant-COPdXUFc.js";import{g as P,Q as q}from"./QBOConnectionScreen-DMhJk96k.js";import"./recharts-DgDFrpbv.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./utils-BGTnhJzp.js";import"./empty-DcVAbZV4.js";import"./pdf-lib-DXIgr0ip.js";import"./index-Cgq5e8kx.js";import"./url-DUqjNyjV.js";import"./index-DFPmY4t1.js";import"./decodeURIComponentSafe-okum9C8e.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="f10c3328-1d53-41c5-bd07-4d8aa4b90ecf",t._sentryDebugIdIdentifier="sentry-dbid-f10c3328-1d53-41c5-bd07-4d8aa4b90ecf")}catch{}})();const G=H.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 ${k.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function fe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:b}=R(),f=a.useRef(!1),p=a.useRef(!1),{code:x,realmId:T,state:y}=P(i.search),N=x!==""&&T!==""&&y!=="",I=c(l=>A(l)),e=c(l=>O(l)),n=c(l=>l.tenantState.fetchState),r=c(l=>l.tenantState.activeTenantFetchState.fetchState),o=m.getSignedInUser(),u=m.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{f.current||o==null||u==null||(f.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(_(o.userId,u))))},[f,n,d]),a.useEffect(()=>{e.tenantId==null&&!p.current&&o!=null&&(p.current=!0,!(u==null||u!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(j(o.userId)))},[p,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(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)),m.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),$.updateAppLocaleID(z(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"&&m.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!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-Dx9GJaKJ.js";import{z as n}from"./index-D4_FYu1h.js";import{g as d}from"./QBOConnectionScreen-DMhJk96k.js";import"./sentry-i8uQ0afM.js";import{g as p,N as a}from"./core-C1GB7aB-.js";import"./zeni-epic-state-BJXbyZuT.js";import"./recharts-DgDFrpbv.js";import"./mui-S6TXegyD.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./utils-BGTnhJzp.js";import"./empty-DcVAbZV4.js";import"./pdf-lib-DXIgr0ip.js";import"./index-Cgq5e8kx.js";import"./url-DUqjNyjV.js";import"./index-DFPmY4t1.js";import"./decodeURIComponentSafe-okum9C8e.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-Dx9GJaKJ.js";import{t as Ke,A as Ce}from"./AddressScreen-DBh2kopg.js";import $e from"./NotFoundScreen-CLwfUXdC.js";import{a as g}from"./sentry-i8uQ0afM.js";import{h as oe,g as se,u as ie,i as re,j as w,N as D,n as ce,l as ze,o as qe,p as $}from"./core-C1GB7aB-.js";import{Q as de,k as le,z as V,a as ue,m as Me,G as _,_ as Qe,q as U,v as W,d as R,B as je,f as J,ap as Ze,J as We,aq as Ie,h as te,ar as He,as as ke,o as Je,at as Xe,au as Ee,av as Ye}from"./index-D4_FYu1h.js";import{eR as Y,fi as et,f0 as pe,e_ as me,bs as tt,ne as at,fe as nt,bO as ot,jk as ae,jn as ve,Kq as st,bT as it,c1 as ge,sR as fe,sC as rt,KW as X,sS as _e,Ii as ct,ko as Ue,KX as Ve,KY as dt,KZ as lt,K_ as ut,ji as pt,jl as mt,sE as Be,sQ as gt,bE as xe,cu as ft,t2 as Te,qL as ht,qz as yt,kg as St,fG as bt,fF as Ct,fE as It,K$ as kt,sw as Et,t3 as xt,t6 as Tt,t9 as Ot,tf as Pt,cS as Dt}from"./zeni-epic-state-BJXbyZuT.js";import{n as he}from"./mui-S6TXegyD.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-DMhJk96k.js";import"./recharts-DgDFrpbv.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./utils-BGTnhJzp.js";import"./empty-DcVAbZV4.js";import"./pdf-lib-DXIgr0ip.js";import"./index-Cgq5e8kx.js";import"./url-DUqjNyjV.js";import"./index-DFPmY4t1.js";import"./decodeURIComponentSafe-okum9C8e.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]="fdb0321d-0b43-4ac5-a32c-3af712232419",t._sentryDebugIdIdentifier="sentry-dbid-fdb0321d-0b43-4ac5-a32c-3af712232419")}catch{}})();const wt=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),jt=()=>{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=Me(),{isFeatureEnabled:x}=l(_.isApAgingFeatureEnabled),{isFeatureEnabled:A}=l(_.isArAgingFeatureEnabled),{isFeatureEnabled:T}=l(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:k}=l(_.isReferralFeatureEnabled),{isFeatureEnabled:S}=l(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:v}=l(_.isDebitCardFeatureEnabled),I=Qe(),f=w(u=>Y(u)),{isFeatureEnabled:G}=l(_.isTreasuryEnabled),m=f.company!=null&&et(f.company),B=G&&m,E=w(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,M=F?.resources?.find(u=>u.resource==="/reports/task_card")==null,Q=f?.userRole!=null&&tt(f?.userRole),K=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"),M===!1&&P.push("task_card"),K===!1&&P.push("bill_pay_card","bill_pay_promo_card"),z===!1&&P.push("reimbursement_card","reimbursement_promo_card"),T===!1&&P.push("zeni_accounts_promo_card"),k===!1&&P.push("rewards_card"),g.useEffect(()=>{E!=="Completed"||c||b||O||(r(!0),s(at(i.userId,L,f.tenantId,!0,!1,P)))},[c,E,b,O,i,f.tenantId,s]),g.useEffect(()=>{(b||O)&&setTimeout(()=>{y(!0)},5e3)},[b,O]),E!=="Completed")return a.jsx(D,{to:"../"});if(E==="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(W,{analytics:R,onLoad:u=>(q=>q.trackPageLoaded(J.Event.onboardingDashboardActivation))(u)}),a.jsx(wt,{navigate:t,location:o,themeState:d,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:A,shouldFetchZeniAccountsPromoCard:T,shouldFetchRewardsPlanCard:k,isExpenseAutomationEnabledForUser:I,isExpenseAutomationFeatureEnabledV2:S,isTreasuryEnabled:B,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{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: ${Je.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=Y(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:R,isRefreshingViewInBackground:!1,isDisabled:C,companyTitles:x.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Xe.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(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{R.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:l,userId:C,name:x,email:A,ssn:T,nationalityCountryCode:k,dob:S,phone:v,syncToken:I,selectDocument:f,role:G,ownership:m,isSelectedForVerification:B,userVerificationStatus:E,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:T,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:v,birthday:S!=null?xe(S?.toString()):S,syncToken:I,titleAtCompany:G.selectedOption,ownershipInCompany:m,documentTypeSelectedForVerification:b,isSelectedForVerification:B,userVerificationStatus:E,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:L}});t(Te({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:T,primaryContactEmail:k,primaryContactName:S,primaryContactUserId:v,primaryContactSyncToken:I,syncToken:f,fileIds:G,typeOfIncorporation:m,stateOfIncorporation:B,incDate:E,companySourceOfFunds:F,companySourceOfFundsDescription:L,companySubIndustry:b,countriesOfOperations:O,purposeOfAccount:P,purposeOfAccountDescription:N,regulatedStatus:M,regulatedStatusDescription:Q,transactionVolume:K,transactionVolumeDescription:z,usNexus:u,usNexusTypes:q}=e,j={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:l?.selectedOption??"",companyLegalName:C,taxIdOrEIN:x,website:A!=""&&A!=null?ft(A):void 0,phone:T,syncToken:f,fileIds:G,incDate:E!=null?xe(E?.toString()):E,typeOfIncorporation:m?.selectedOption??"",stateOfIncorporation:B?.selectedOption??"",companySourceOfFunds:F?.selectedOption??"",companySourceOfFundsDescription:L,companySubIndustry:b?.selectedOption??"",countriesOfOperations:O?.selectedOptions.map(Z=>Z.length===2?Z:Ee(Z))??[],purposeOfAccount:P?.selectedOption??"",purposeOfAccountDescription:N,regulatedStatus:M??"",regulatedStatusDescription:Q,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:z,usNexus:u,usNexusTypes:q?.selectedOptions??[]},ee={userId:v,firstName:S.firstName,lastName:S.lastName,email:k,syncToken:I};t(Te({companyDetails:j,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=Ke(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(X({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})}}})(He),H=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const d=oe(),c=se(),r=ie(),p=We(),y=de(),[e,n]=g.useState(!1),[i,l]=g.useState(!1),[C,x]=g.useState(!1),{tenantEmailDomain:A}=re(),T=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:S}=k(_.isDebitCardFeatureEnabled),v=ze("/:tenantEmailDomain/onboarding")!==null&&c.search?.includes("code"),I=w(h=>h.onboardingCustomerViewState.fetchState),f=w(h=>h.onboardingCustomerViewState.currentStep),G=w(h=>h.onboardingCustomerViewState.uiState),m=w(h=>Y(h)),B=w(h=>h.userRoleConfigState.fetchState),E=w(h=>h.cardPaymentViewState),F=Ie(E.addCardPaymentSourceStatus.fetchState),L=E.addCardPaymentSourceStatus.fetchState,{code:b,realmId:O,state:P}=At(c.search),N=m.externalConnections?.accounting[0],M=N?.connectionType,Q=N?.connectionName,K=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,K,z)===!0&&m.externalConnections?.saveConnectionState!=="In-Progress"&&I==="Completed"&&(r(st(m.tenantId,{connection_type:M??"accounting",connection_name:Q??"quickbooks_online",authorization_code:b,realm_id:O,connection_id:K,user_id:z},it(window.location.origin+"/onboarding/auth"))),R.trackOnboardingSaveQBOConnection(O,K),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,q=ge(m?.userRole??[]),j=w(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"||!G.isQBOPopupOpen||f!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[m.externalConnections?.saveConnectionState]),g.useEffect(()=>{I==="Completed"&&v&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[v,I]),g.useEffect(()=>{B==="Not-Started"&&r(ct(!0))},[B,r]);const ee=Ie(j.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{j.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&j.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&ee==null&&r(Ue({addressType:"company_registered_address",addressToCreate:j.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[j.companyDetailsLocalData?.addressStatus?.addressToCreate,j.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=j.isInterimEmailSent;if(V.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(S,m),Re=me(m),ye=m.company?.companyOnboardingInfo.isOnboardingCompleted,Se=h=>h.trackPageLoaded(J.Event.onboardingPage),be=m.productSettings.isOtherProductsEnabled,Ge=m.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Ge?a.jsx(D,{to:"../../treasury"}):Le?a.jsx(D,{to:"../../checking"}):Re?a.jsx(D,{to:"../../cards"}):a.jsx(D,{to:"../../dashboard"});const h=j.updateStatus.fetchState==="In-Progress";if(be&&!h)return t?a.jsxs(Oe,{children:[a.jsx(W,{analytics:R,onLoad:Ne=>Se(Ne)}),a.jsx(De,{navigate:d,location:c,companyId:u,currentTenant:m,isAdmin:q,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&&T?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(D,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(W,{analytics:R,onLoad:h=>Se(h)}),a.jsx(De,{navigate:d,location:c,companyId:u,currentTenant:m,isAdmin:q,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
|
-
`,we=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"}})}}})(Ye),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=w(S=>Y(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),T=w(S=>S.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||l?T==="Completed"&&k===!0&&l&&y?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:R,onLoad:S=>{S.trackPageLoaded(J.Event.onboardingLandingPage,"Onboarding",Dt(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:l,location:s,companyId:C,currentTenant:i,themeState:d,isVisitingFirstTime:e})]}):T==="Completed"&&k===!1&&y?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:R,onLoad:S=>{S.trackPageLoaded(J.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:l,location:s,companyId:C,currentTenant:i,themeState:d,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:T}):x?a.jsx(D,{to:"../../checking"}):A?a.jsx(D,{to:"../../cards"}):a.jsx(D,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx($,{path:"/",element:a.jsx(H,{})}),a.jsx($,{path:"/billing/edit",element:a.jsx(H,{taxCFOCustomer:!0})}),a.jsx($,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx($,{path:"/activation",element:a.jsx(jt,{})}),a.jsx($,{path:"/address/edit/:addressType/:addressId",element:a.jsx(H,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx($,{path:"/address/new/:addressType",element:a.jsx(H,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx($,{path:"*",element:a.jsx($e,{})})]})}export{oa as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-Dx9GJaKJ.js";import{a as u}from"./sentry-i8uQ0afM.js";import{u as y,j as p,n as w,g as A,N}from"./core-C1GB7aB-.js";import{JW as R,eR as _,fq as U,JX as k,ng as L,JY as z}from"./zeni-epic-state-BJXbyZuT.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-D4_FYu1h.js";import"./mui-S6TXegyD.js";import{t as P}from"./getLocaleForTenant-COPdXUFc.js";import"./recharts-DgDFrpbv.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./utils-BGTnhJzp.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]="4f090bb4-cfb6-4be7-936a-27cdbd832b5e",t._sentryDebugIdIdentifier="sentry-dbid-4f090bb4-cfb6-4be7-936a-27cdbd832b5e")}catch{}})();const q=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(),m=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let b="";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}`,b="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=m.get("question")?.replace(/^["']|["']$/g,"")??null,e=m.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}`,b="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,m);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:b,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),m=u.useRef(null),b=p(e=>R(e)),n=p(e=>e.tenantState.fetchState),i=p(e=>e.tenantState.error),a=p(e=>e.tenantState.activeTenantFetchState.fetchState),c=p(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;m.current!==e&&(m.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(U(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"&&!k(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&b.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(b.tenantsCoreDetailsInOrder),o())},[b.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(q,{})}const J=["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 J)if(t.toLocaleLowerCase().includes(s))return Q[s]}export{oe as default};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-Dx9GJaKJ.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-C1GB7aB-.js";import{NX as k,O2 as q,fG as Y,fF as J,fE as L,iF as W,L4 as X,qC as K,eR as V,Nt as D,iD as F,NY as S,O5 as G,iB as T,iY as j}from"./zeni-epic-state-BJXbyZuT.js";import{bw as M,J as N,a as R,z as O,m as U,p,G as v,B as Z,bx as Q,o as z,by as ee,q as te}from"./index-D4_FYu1h.js";import{n as H}from"./mui-S6TXegyD.js";import"./sentry-i8uQ0afM.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]="7de054d0-27d3-4d95-988e-6d86d10352cb",e._sentryDebugIdIdentifier="sentry-dbid-7de054d0-27d3-4d95-988e-6d86d10352cb")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(X("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(L(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(Y(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(M);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,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),r=s.poppedPathname??B();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(G({data:r}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??B(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Q);function me({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=P(),c=e??s,{useFeatureGate:d}=R(),i=O.getSignedInUser(),b=h(u=>V(u)),g=U(),x=p(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,c)),{isFeatureEnabled:I}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:c,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:c,currentTenant:b,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const B=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},fe=(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},de=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 ${z.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
-
`,re=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:r}=t,{tenantEmailDomain:c}=r;return{onFetchBankName:d=>{e(j(d))},onSaveHandler:d=>{e(T(t.bankAccountContext,d,"us-domestic",s))},onWireDetailsUpdated:d=>{const{bankAccountSection:i}=d;e(G({data:i}))},onCancel:()=>{(()=>{const d=p(o.state?.pathnameStackToGoBack),i=d.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:d.newStack}})})(),e(S())},onAddressClick:d=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(c,d,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const d=p(t.location.state?.pathnameStackToGoBack),i=d.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:d.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=P(),c=e??s,d=O.getSignedInUser(),{useFeatureGate:i}=R(),b=U(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,c)),{isFeatureEnabled:I}=i(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(de,{windowSize:o,children:[l.jsx(_,{vendorId:c,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:c,currentTenant:g,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{me as A,xe as D,_ as V,fe 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-Dx9GJaKJ.js";import{J as l,y as c,m as f}from"./index-D4_FYu1h.js";import{D as b}from"./mui-S6TXegyD.js";import"./sentry-i8uQ0afM.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]="793cfb95-c09a-4b69-beab-9f863397b87e",e._sentryDebugIdIdentifier="sentry-dbid-793cfb95-c09a-4b69-beab-9f863397b87e")}catch{}})();const p={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),i=f();return d.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{m as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-Dx9GJaKJ.js";import{a as d}from"./sentry-i8uQ0afM.js";import{h as A,u as B,g as L,i as q,j as c,N as F,n as M,o as N,p as O}from"./core-C1GB7aB-.js";import{Mb as _,eR as R,LA as W,kI as Y,Ia as I,Mg as $,L3 as z,jI as V,Ib as P,LF as H,LG as J,L5 as K,L4 as Q}from"./zeni-epic-state-BJXbyZuT.js";import{aS as U,d as X,p as Z,q as tt}from"./index-D4_FYu1h.js";import"./mui-S6TXegyD.js";import{d as S}from"./decodeURIComponentSafe-okum9C8e.js";import{w as et}from"./withTransactionSidePanel-yGfWimRu.js";import{f as at,c as nt}from"./routePaths-dZ-9-pnI.js";import"./recharts-DgDFrpbv.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./utils-BGTnhJzp.js";import"./useAskAiCfoHostNavButtonProps-Zz8eSFW2.js";import"./TransactionDetailScreen-DT8xA3x1.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]="46fb9796-fcb9-4c4b-b2c2-7b4f0495620d",a._sentryDebugIdIdentifier="sentry-dbid-46fb9796-fcb9-4c4b-b2c2-7b4f0495620d")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(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(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??k();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(P(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(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(P(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=L(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=q(),r=S(j??""),p=S(w??""),f=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=c(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=c(n=>R(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>W(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))},[m,f,i]);const b=c(n=>n.trendState.fetchState),E=u?.selectedPeriod?.timePeriod??D,G=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&b==="Completed"&&(g(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,b]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:G,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(F,{to:k(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,k=(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-Dx9GJaKJ.js";import aa from"./NotFoundScreen-CLwfUXdC.js";import{a as o,b as Nt}from"./sentry-i8uQ0afM.js";import{n as Fe,S as oa}from"./mui-S6TXegyD.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-C1GB7aB-.js";import{eR as xe,QF as ia,nq as ye,fl as la,rd as ra,nI as Yt,o1 as Kt,QG as Wt,ob as da,QH as Ht,nB as ua,qL as ma,f5 as Ie,QI as De,tc as Zt,Cx as Xt,QJ as en,QK as pa,qj as Ke,Mc as Pt,Me as ha,jL as ga,Mf as Ca,jS as Sa,cU as fa,up as We,nO as tn,og as Ue,nG as le,QL as Ia,L5 as xt,L4 as Re,QM as Dt,k7 as ya,QN as Ea,QO as ka,QP as ba,QQ as Ta,nV as va,oj as we,QR as Aa,QS as Ra,QT as wa,oq as Pa,jW as xa,jN as Da,QU as Ua,jV as Ut,Mm as Fa,QV as Ba,QW as Va,qf as Oa,pT as _a,oh as me,pS as Ge,QX as Ma,QY as za,QZ as ja,lq as La,bo as $a,ll as Ft,l7 as Qa,Q_ as qa,gV as Bt,fW as Ga,li as Na,wi as Ja,Q$ as Ya,oR as Ka,oM as Wa,oQ as Ha,oB as Za,R0 as Xa,f8 as nn,o4 as eo,nR as to,fm as Vt,ol as no,R1 as ao,R2 as oo,oi as an,R3 as so,R4 as co,R5 as io,R6 as lo,R7 as Ot,qr as ro,pK as uo,L3 as mo,R8 as po,R9 as ho,jU as go,Ra as Co,Hb as So,jT as fo,jI as Io,f7 as yo,ph as on,pC as Eo,of as _t,ok as ko,bE as bo,lf as To,lc as vo,Rb as Ao,oA as Mt,py as zt,pw as Ro,Rc as wo,p2 as Po,p0 as xo,pz as Do,Rd as Uo,Re as Fo,p6 as Bo,Rf as Vo,oW as Oo,p5 as _o,p3 as Mo,pF as zo}from"./zeni-epic-state-BJXbyZuT.js";import{a as sn,G as ne,d as Q,q as te,U as cn,W 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,a7 as Go,cK as No,a2 as Jo,cL as Yo,N as Ko,cM as Wo,cN as Ho,Q as Zo,k as Xo,aN as es,cO as ts,cP as ns,b9 as as,y as os,aQ as ss}from"./index-D4_FYu1h.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-Zz8eSFW2.js";import{f as Lt,a as cs,b as is,g as ls,C as rs}from"./TransactionDetailScreen-DT8xA3x1.js";import{w as ds}from"./withTransactionSidePanel-yGfWimRu.js";import{h as us,v as ms}from"./routePaths-dZ-9-pnI.js";import{g as Je}from"./accountMappingHelper-BJc8FF-F.js";import{D as ps}from"./DrawerScreen-Bw0Jl3tu.js";import"./recharts-DgDFrpbv.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./utils-BGTnhJzp.js";import"./decodeURIComponentSafe-okum9C8e.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]="e7dea5ee-fef6-4aab-a05d-24d45b57846d",t._sentryDebugIdIdentifier="sentry-dbid-e7dea5ee-fef6-4aab-a05d-24d45b57846d")}catch{}})();const hs=()=>{const t=pe(),l=Jt(),B=Ye(),f=w(d=>xe(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:S}=T(ne.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(ne.aiAuditScorePercentage),I=w(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=w(d=>ia(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,q,X=!1)=>{t(ye({tenantId:q,period:{month:d.month,year:d.year},refreshViewInBackground:X}))},[]),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),E(g,f.tenantId,!0)},[E,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=te(B.state?.pathnameStackToGoBack,B.pathname),y=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:k}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&k&&E(g,f.tenantId)},[E,g,s.fetchState,f.tenantId,k]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&k&&t(ra(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,k]),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:y,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:E,statementUploadChosen:v}=t,g=u[l],m=g?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{S(ma(e,n.split(".")[0]))},y=e=>{m!=null&&S(ua({accountId:l,selectedPeriod:E,fileId:e,statementUploadId:m}))},k=()=>{S(Wt({statementUploadChosen:!1}))},d=e=>{S(da({accountId:l,selectedPeriod:E,payload:e}))},q=e=>{S(Ht({accountId:l,selectedPeriod:E,localData:{accountSource:e}}))},X=o.useCallback(()=>{S(Yt({accountId:l}))},[S,l]),M=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:E,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:P,onDeleteFile:y,onSelectSourceType:q,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:k,onExcludeFromReconciliation:X})})}):O!=null?h.jsx($t,{children:h.jsx(Qt,{children:h.jsx($o,{excludedAccountReconciliation:O,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:M})})}):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:ys}},dateFormat:pn}=qo.getLocalizedStrings(),Gt=zo,Es=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,E={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:E,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:E,navigate:v,onClickCustomerRequest:g,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:y,currentSelectedView:k,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:q}=p.jeSchedules,X=tn(y),M=Ue(X.start),O=Ue(X.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{Q.trackMissingReceiptAttached(y.month,y.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=te(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(ye({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?ys+Is+i+qt:qt}]}))},onUpdateJESchedulesUIState:e=>{t(co(e))},onUpdateMissingReceiptsUIState:e=>{t(so(e))},onFetchMissingReceiptsList:()=>{O!=null&&M!=null&&t(an({start:M,end:O},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(_o(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&&M!=null&&t(me(c,{start:M,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:()=>{k==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0})),v("../")},onBack:()=>{k==="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=te(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=te(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(Xa({data:x}))},onSaveJeAccountSettingsClick:()=>{t(Za())},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,ae={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(N=>N.value===A?.selectedOption)?.label??"",logo:j?.logo},oe=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(Ha({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:oe?.accountId,updatedClassId:Ve?.classId,updatedAccumulatedDepreciationCategoryID:Oe?.accountId,updatedVendor:{id:ae.id,name:ae.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Wa(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=te(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=te(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,ae,oe)=>{t(ja(e,n,c,i,E,b,C,A,V,x,D,j,ae,oe))},onCancelAutoComplete:()=>{t(Re("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),O!=null&&M!=null&&(t(me(e,{start:M,end:O},!1,!1)),t(za(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),O!=null&&M!=null&&(t(Ma(e)),t(me("autoCategorized",{start:M,end:O},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ge({selectedTab:e,uiState:n})),O!=null&&M!=null&&t(me(e,{start:M,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&&M!=null&&t(me(e,{start:M,end:O},!0,c,n,i,b,C,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,C,A,V)=>{t(_a(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:E,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?Q.trackTransactionsAutoCategorisedPage(y.month,y.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):Q.trackTransactionsReviewPage(y.month,y.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:E,updatedCustomer:C,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({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:E,updatedVendor:C,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({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(y,!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:y}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ms(e.id,e.qboId,l.tenantEmailDomain),c=te(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:y}))},onFetchReimbursementView:(e,n,c)=>{t(we(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(le(y,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Zt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(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(Ht({accountId:e,selectedPeriod:y,localData:{accountSource:"bank_statement"}})),t(Wt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(le(y,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(ka({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ya(i)),t(Ea({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ke("bill"));const n=te(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||k!=="reconciliation"||t(le(y,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(S,r,I){return{...S,...r,...I,onUploadTransactionReceipt:(s,p,u,E,v)=>{r.onUploadTransactionReceipt(s,p,u,E,v,S.authParams)}}}(t,l,T)})(Go(No)),ks=ds(function(t){const l=t.displayName??t.name??"Component",B=Nt.memo(t),f=T=>{const S=pe(),r=function(){const P=pe(),y=w(k=>Ie(k).reconciliation.selectedDrawerAccountId);return{isOpen:y!=null,selectedAccountId:y,openPanel:o.useCallback(k=>{P(De({selectedDrawerAccountId:k}))},[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,y)=>{S(Zt("expense_automation_reconcile",P,y))},[S]),u=o.useCallback((P,y)=>{const k=s?.companyId;k!=null&&(S(Xt(P,k,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",y)),S(en({accountId:y,connectionInProgress:!0})))},[S,s?.companyId]),E=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:E,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[E,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=Wo(),{isOpen:E}=Ho(),v=Jt(),g=Ye(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:y}=dn({mobileExploreReferrer:"Transaction categorization"}),k=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,H=Ne($),J=Ne(L.fetchState),W=o.useCallback(G=>{const Z=F.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?Q.trackTransactionsReviewPage(R.month,R.year,a.transactionView.totalCountByTab.review,0,G,Z??null):Q.trackTransactionsAutoCategorisedPage(R.month,R.year,a.transactionView.totalCountByTab.autoCategorized,0,G,Z??null)),$==="missing_receipts"&&Q.trackMissingReceiptsPage(R.month,R.year,G,a.missingReceipts.transactions.length,Z??null),$==="je_schedules"&&Q.trackMonthCloseScheduleListPage(R.month,R.year,G,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,Z??null),$==="flux_analysis"&&Q.trackFluxAnalysisPage(R.month,R.year,G,fs(a.fluxAnalysis),Z??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&Q.trackInsightsEmailPage(R.month,R.year,G,"draft",a.auditSummary.auditScorePercentage,null,Z??null)},[R,a]);return o.useEffect(()=>{J===L.fetchState&&$===H||L.fetchState!=="Completed"||W(!1)},[$,L.fetchState,H]),W})(),X=Zo(),[M,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)},[]),ae=x?.contentType==="activity"?x.detail.transactionId:void 0,oe=o.useCallback(a=>{a!=null?(s&&p(!1),u(),k(),D({contentType:"activity",detail:{transactionId:a}})):D(F=>F?.contentType==="activity"?null:F)},[k,s,u,p]),Ve=o.useCallback(a=>{s&&p(!1),u(),k(),D({contentType:"transfer",detail:a})},[k,s,u,p]),Oe=o.useCallback(()=>{u(),j(),k(),y()},[k,j,y,u]),N=o.useRef(s);o.useEffect(()=>{s===!0&&N.current===!1&&(u(),j(),k()),N.current=s},[k,j,s,u]);const He=o.useRef(E);o.useEffect(()=>{E===!0&&He.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),He.current=E},[j,t,E,s,p,f,T]);const Ee=T===!0&&f!==!0,Ze=o.useRef(Ee);o.useEffect(()=>{Ee&&!Ze.current&&(s&&p(!1),u(),j()),Ze.current=Ee},[j,s,Ee,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=wt(),{tenantEmailDomain:gn}=wt(),[_e,nt]=o.useState(g.state?.message==="comingFromTransactionDetail"),at=g.state?.message==="comingFromOverview",Cn=Xo(),Me=Be.getSignedInUser(),{useDynamicConfig:Sn,useFeatureGate:re}=sn(),{configValue:fn}=Sn(es.enableUncategorizedExpenseCategory),ee=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=re(ne.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=re(ne.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:ze}=re(ne.isTransactionActivityEnabled),{isFeatureEnabled:st}=re(ne.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=re(ne.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:yn}=re(ne.isProjectsTransactionsEnabled),En=o.useCallback(a=>{const F=Ke(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,F)},[l]),kn=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:_,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:An,currentSelectedViewFetchState:se,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 de=is(wn,()=>{const a=[],F=ut.current,L=dt.current,$=L!=null&&F!=null?L[F]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const J=H?.transactionReviewLocalData?.lineItemById;if(J!=null)for(const W of Object.values(J)){const G=W?.account;G?.accountId!=null&&a.push(G.accountId)}}const R=it.current;for(const H of R)for(const J of H.lines??[])"account"in J&&J.account?.accountId!=null&&a.push(J.account.accountId);return a});o.useEffect(()=>{U==="transaction_categorization"&&T!==!0||oe(void 0)},[U,oe,T]);const Pn=z.transactionView.selectedTransactionCategorizationCompletedSubTab,ke=`${je}|${Pn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ke&&(be.current=ke,U==="transaction_categorization"&&j()):be.current=ke},[j,U,ke]);const xn=w(a=>ae==null?void 0:go(a.transactionState,ae)),ce=xn?.qboId,mt=w(a=>ce==null?void 0:Co(a,ce));o.useEffect(()=>{ce!=null&&m(So(ce))},[m,ce]);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:ce,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,ce,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?yo(tt):U,Bn=w(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:se.fetchState==="Completed"}),Me==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(_),Se=Ue(It.start),fe=Ue(It.end);if(Se==null||fe==null)throw Error(`Invalid start - ${Se} and end - ${fe} period from given ${_}`);const Vn=o.useCallback(()=>{i(!1)},[]),On=o.useCallback(()=>{C(!0)},[]),_n=o.useCallback(a=>{V(a),C(!1)},[]),Mn=o.useCallback(()=>{V([])},[]),Te=z.missingReceipts.bulkUpload.phase,yt=z.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&U==="missing_receipts"&&Te==="matching"&&yt!=null&&m(on({cacheOverride:!0}))},[he,U,Te,yt,m]);const Et=Me?.userId,zn=_.month,jn=_.year,kt=n?.tenantId;o.useEffect(()=>{U==="missing_receipts"&&he!==!1&&Te==="idle"&&Et!=null&&kt!=null&&m(Eo())},[U,he,Te,Et,kt,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(()=>{Xe!==!1||se.fetchState!=="Completed"&&se.fetchState!=="Error"||!d||(hn(!0),m(_t(!1,!1,ee)))},[Xe,se,d,ee]),o.useEffect(()=>{!at&&d&&(m(_t(!1,!1,ee)),m(le(_,ge,!1,!1)))},[_.month,_.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,!_e,void 0,void 0,F,void 0,ee)),nt(!1);break;case"flux_analysis":m(we(_,a,F,null));break;case"month_end_insights":if(F===!1){const $=new Date(_.year,_.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(ko(L,F));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,F));break;default:m(le(_,ge,a,F))}},[U,Se,fe,n.companyId,n.tenantId,je,_,ge,_e,nt,ee]);o.useEffect(()=>{U===Ce&&se.fetchState==="Not-Started"&&d&&bt(!0)},[se,Se,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||_e||et.current||An.fetchState==="In-Progress"||se.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{K.fetchState!=="In-Progress"&&K.fetchState!=="Completed"&&m(ye({tenantId:n.tenantId,period:_,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(ye({tenantId:n.tenantId,period:_,refreshViewInBackground:!0})),m(Ao({companyId:n.companyId})),v("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,_,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{K.fetchState!=="In-Progress"&&K.fetchState==="Completed"&&m(ye({tenantId:n.tenantId,period:_,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[K.fetchState,n.tenantId,_,m]),o.useEffect(()=>{const a=setInterval(()=>{U==="reconciliation"&&ge==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(le(_,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[U,m,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,le,ge,_]);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(Mt())},[ft,Le.accountSettingsView.saveState.fetchState,Mt]);const{transactionId:Tt,onSaveVendor:Gn,onSaveSuccess:Nn,onCancel:Jn,vendorViewDetails:Yn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:F,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const R=pe();let H,J,W;const G=Lt(),Z=a.transactionView;let vt=()=>{};const{transactions:Wn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Hn}=Z;if(L==="transaction_categorization"){const $e=Hn.find(ie=>ie.transactionId===ue),Y=Wn.find(ie=>ie.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,Rt=At?.account;J=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(Rt?.accountName??"")?void 0:Rt?.accountId;const Xn=us(ue,Y?.typeOfTransaction);Y!=null&&Xn&&(W={id:ue,type:Ke(Y.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&Y!=null){const ie=Z.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(ie!=null&&Y.lines!=null&&Y.lines.length>0){const Ae=ie.lineItemById[ve];let Qe=ie.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(We({entity:ea,amount:Ae.amount.amount,transactionDetails:ta,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:G,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Zn=w($e=>Pt($e,void 0,H,J));return{transactionId:W,onSaveVendor:()=>{R(Sa(W,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{W!=null&&R(ha({transactionId:W})),R(ga()),R(Ca()),F()},vendorViewDetails:Zn}})({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:_n,resetCustomerRequest:Mn})})}),Tt!=null&&M&&h.jsx(rs,{isOpen:M,transactionId:Tt,onSaveVendor:Gn,onSaveSuccess:Nn,onCancel:Jn,vendorViewDetails:Yn}),h.jsx(Es,{...Kn,navigate:v,location:g,themeState:X,categoryOptions:bn,classesForFilters:vn,accountsForFilters:Tn,vendorSearchAutoCompleteData:{autoCompleteText:Bn,entityAutoCompleteView:kn},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:ee,isAccountingClassesEnabled:Fn,isProjectsTransactionsEnabled:yn,isCOTEnabled:Ln,currentTenant:n,companyId:n.companyId,signedInUser:Me,isTransactionActivityEnabled:ze,isRightPanelOpen:Dn,rightSidePanel:St,onOpenTransferRightPanel:st===!0?Ve:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:On,handleEditClick:Vn,tenantEmailDomain:gn,trackExpenseAutomationTabAnalytics:q,setActivityLogTransactionId:oe,closeSidePanel:qn,openTransactionPanel:l,sidePanelIsOpen:Qn,sidePanelIsFullView:r!==!0&&f,panelContent:$n,isAiCfoAccessEnabled:P,onAskAiCfoClick:Oe,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:En,sidePanelListPercent:r===!0?66:void 0}),de.showPopup&&de.popupType!=null&&h.jsx(ss,{popupType:de.popupType,currencySymbol:de.currencySymbol,onSubmit:de.handleSubmit,onDismiss:de.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(ks,{})}),h.jsx(qe,{path:"*",element:h.jsx(aa,{})})]})}export{Js as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-Dx9GJaKJ.js";import{a as r}from"./sentry-i8uQ0afM.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-D4_FYu1h.js";import"./mui-S6TXegyD.js";import c from"./NotFoundScreen-CLwfUXdC.js";import{h as u,g as b}from"./core-C1GB7aB-.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./sentry-i8uQ0afM.js";import{u as d,h as l,g as m}from"./core-C1GB7aB-.js";import{gC as p,Ki as g,Kj as b}from"./zeni-epic-state-BJXbyZuT.js";import{u as _,L as h,z as y}from"./index-D4_FYu1h.js";import"./liveblocks-Dx9GJaKJ.js";import"./recharts-DgDFrpbv.js";import"./mui-S6TXegyD.js";import"./analytics-7_b07CgE.js";import"./plaid-nqaFvQD8.js";import"./dnd-BKLSY4Qp.js";import"./stripe-DMRn4zHo.js";import"./lottie-MYbVFail.js";import"./lexical-Dcuk4Yua.js";import"./pdf-BijcgxIK.js";import"./utils-BGTnhJzp.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]="0974b3ee-928b-4ffb-8e8e-f6fe1b69009e",e._sentryDebugIdIdentifier="sentry-dbid-0974b3ee-928b-4ffb-8e8e-f6fe1b69009e")}catch{}})();function K(){const e=d(),n=l(),r=m(),{setLoading:o,clearAllLoading:c}=_(),s=i.useRef(!1);return i.useLayoutEffect(()=>{o(h.CONNECTION_AUTH)},[o]),i.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const f=y.getActiveTenantForUser();n(f?.tenantEmailDomain!=null?`/${f.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{K as default};
|