@zeniai/web-app-ui 5.0.95-dev → 5.0.96-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.
Files changed (121) hide show
  1. package/dist/assets/AddressRoutes-DrJ0R4zA.js +1 -0
  2. package/dist/assets/{AddressScreen-C1kNIoFW.js → AddressScreen-Bg11cvW7.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-DiEWR7_7.js → AiCfoScreen-ttXGMdMj.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-BFuKAoJn.js → BillPayApprovalRoutes-DSmsDGfo.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-yYgD8ElZ.js → BillPayRoutes-DJZxWW5J.js} +34 -34
  6. package/dist/assets/{BusinessVerificationPageScreen-LVeN_2_9.js → BusinessVerificationPageScreen-Bgww5Eni.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-Dqh0dx38.js → ChargeCardRoutes-DBBIBX3p.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-CoCoQTkp.js → CompanyPassportScreen-BY6KqDn5.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-BBpw2AR4.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BwmSNWEA.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BeOSK0bV.js → CustomerOnboardingRoutes-CBskXxxc.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DeXVvCqq.js → DashboardRoutes-B7wfzxUf.js} +4 -4
  13. package/dist/assets/{DefaultTenantHome-DZiebdrx.js → DefaultTenantHome--GVn7qHn.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-CdWlbEyV.js +18 -0
  15. package/dist/assets/DrawerScreen-Cme8vixt.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-mC151u-W.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-hIKcsGeT.js → ExpenseAutomationRoutes-BI8ssrmn.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-CKIBiLol.js +1 -0
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-C_sETmGk.js → HubSpotOAuthCallbackScreen-BooPYq0F.js} +1 -1
  20. package/dist/assets/MagicLinkRoutes-6F4w3fCs.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-CBTOwBE4.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-CgbJlL9u.js → MobileAppDrawer-6SipHCGH.js} +1 -1
  23. package/dist/assets/NotFoundScreen-BbD7D-7R.js +1 -0
  24. package/dist/assets/{NotificationRoutes-HNy89jXR.js → NotificationRoutes-CZA_Ly2E.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-BQ6c6hkL.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-CFV6-GFH.js +1 -0
  27. package/dist/assets/{PeopleRoutes-B7-ewz69.js → PeopleRoutes-CQZMU4bx.js} +5 -5
  28. package/dist/assets/PerformanceRoutes-D4TOcMhX.js +1 -0
  29. package/dist/assets/{Preview-DVbW5PS-.js → Preview-De8DjXIQ.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-BRbkYHuP.js → QBOConnectionScreen-C6YL0sDk.js} +1 -1
  31. package/dist/assets/ReferralListScreen-pub9zNod.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-CtZYMXXf.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CO_HtFbP.js → ReimbursementApprovalRuleDetailScreen-Cyjo3GHG.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-pmb5ZMBe.js → ReimbursementRoutes-MFX8Bud0.js} +4 -4
  35. package/dist/assets/{ReportsRoutes-C9h_dCJo.js → ReportsRoutes-CFENeNIe.js} +1 -1
  36. package/dist/assets/RewardsRoutes-C9SyzdEY.js +1 -0
  37. package/dist/assets/{ScreenRoutes-DB3q5PNA.js → ScreenRoutes-BeA1lKqC.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-DEx1uOuX.js → SettingsRoutes-CeD2DwUh.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-DM0dhGt1.js → SetupPagesScreen-A0QZWQlp.js} +5 -5
  40. package/dist/assets/SignInScreen-BLRkAV-s.js +1 -0
  41. package/dist/assets/SignOutScreen-BmLBsLVz.js +9 -0
  42. package/dist/assets/{TaskListScreen-CQTVeDwe.js → TaskListScreen-oD_ucU4f.js} +2 -2
  43. package/dist/assets/{TaskRoutes-DzCuQY-E.js → TaskRoutes-DE3EZJLP.js} +2 -2
  44. package/dist/assets/{TransactionDetailRoutes-BjnNsU6t.js → TransactionDetailRoutes-DUjSaKyf.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-BSarw1vq.js → TransactionDetailScreen-B3uLE8LG.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-CXfUmvjI.js → TransactionListRoutes-BlbqsdwG.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-CDE_tE4t.js → TreasuryRoutes-BzlbCHr7.js} +6 -6
  48. package/dist/assets/{VendorsRoutes-Cz9uX3LH.js → VendorsRoutes-CW522oMp.js} +1 -1
  49. package/dist/assets/WiseConfirmationScreen-D-jXv9gV.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-DIt49_h_.js → ZeniAccountRoutes-CSBwxnuu.js} +10 -10
  51. package/dist/assets/ZeniAccountStatementScreen-Dmd7_0nF.js +9 -0
  52. package/dist/assets/{accountMappingHelper-DdryjbCH.js → accountMappingHelper-CoDQ683a.js} +1 -1
  53. package/dist/assets/{analytics-B35UERag.js → analytics-CztvM7Zo.js} +1 -1
  54. package/dist/assets/{analyticsHelper-D8sAsSDg.js → analyticsHelper-DidHWGct.js} +1 -1
  55. package/dist/assets/{core-B20PugrR.js → core-CAUatE6D.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-HZX6LUOb.js → decodeURIComponentSafe-M2sJXq9C.js} +1 -1
  57. package/dist/assets/{dnd-CTNaOehy.js → dnd-DoUvAW-O.js} +1 -1
  58. package/dist/assets/{empty-DbjE3Pml.js → empty-BtvkP3hw.js} +1 -1
  59. package/dist/assets/{empty-DqPV1QMu.js → empty-D8yvrubO.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-D5A8Alvf.js → emptyVideoElement-Bd8ec_3G.js} +1 -1
  61. package/dist/assets/{epic-C05Fn23e.js → epic-CGb2Dbds.js} +1 -1
  62. package/dist/assets/getLocaleForTenant-DjpfkvqM.js +1 -0
  63. package/dist/assets/{index-DODLcfP6.js → index--Cei8VXn.js} +1 -1
  64. package/dist/assets/{index-DwJt1swd.js → index-7hhSQ-_M.js} +1 -1
  65. package/dist/assets/{index-qbNk-Sh2.js → index-BBI_6CLT.js} +1 -1
  66. package/dist/assets/{index-BJUGjRvu.js → index-BRSfwvH4.js} +1 -1
  67. package/dist/assets/{index-DDN5QRfh.js → index-DklNZPEZ.js} +2 -2
  68. package/dist/assets/{index-Dh7l3Ca4.js → index-eEJDMus_.js} +1 -1
  69. package/dist/assets/{index-D8hCAHx9.js → index-ssCDruz8.js} +7428 -7430
  70. package/dist/assets/{index-Dx-tgz0s.js → index-uJrW53Lh.js} +1 -1
  71. package/dist/assets/{lexical-BDpP_OMn.js → lexical-B4m6CLZ0.js} +1 -1
  72. package/dist/assets/{liveblocks-BSDLCmF2.js → liveblocks-Do-nuGO9.js} +1 -1
  73. package/dist/assets/{lottie-DG71PfmK.js → lottie-DhqFkmtq.js} +1 -1
  74. package/dist/assets/{mui-BBkBdMVO.js → mui-Ee2kkUYC.js} +1 -1
  75. package/dist/assets/{pathToGoBack-BJj5tqvK.js → pathToGoBack-m6LhD1oT.js} +1 -1
  76. package/dist/assets/{pdf-Cp8DoYAG.js → pdf-DGClrODY.js} +4 -4
  77. package/dist/assets/{pdf-lib-BqwRJQ00.js → pdf-lib-QKmlG01y.js} +1 -1
  78. package/dist/assets/{plaid-DHvUog4a.js → plaid-BfqKUq3C.js} +1 -1
  79. package/dist/assets/{pusher-DsZLo3j0.js → pusher-D-t7eVeO.js} +1 -1
  80. package/dist/assets/{react-DpONCvOo.js → react-BJcwMgz5.js} +1 -1
  81. package/dist/assets/{react-BUTkVbbW.js → react-C1ZZYDEp.js} +1 -1
  82. package/dist/assets/{react-D4RyndA4.js → react-D7LvJpSs.js} +1 -1
  83. package/dist/assets/{react-zGcoIiO8.js → react-DNnZi339.js} +1 -1
  84. package/dist/assets/{react-Uu6ZW5p-.js → react-DWvyJqE6.js} +1 -1
  85. package/dist/assets/{react-BPL_4xi4.js → react-mujJLjaM.js} +1 -1
  86. package/dist/assets/{recharts-BzjcN9SN.js → recharts-DfwJcvGU.js} +1 -1
  87. package/dist/assets/{routePaths-XreQojZr.js → routePaths-C0HYOQUJ.js} +1 -1
  88. package/dist/assets/{sentry-67DqaLi1.js → sentry-CpVyi-77.js} +1 -1
  89. package/dist/assets/{url-DgheZiFv.js → url-Dj6kXEk9.js} +1 -1
  90. package/dist/assets/{url-D5ovKX_j.js → url-Dp0KhTaX.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CvDMoudE.js → useAiCfoDashboardSuggestedQuestionsChips-BymSQq_a.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-BiHuzfAQ.js +1 -0
  93. package/dist/assets/{useDeviceId-CZrGGxHD.js → useDeviceId-BXZMNB1t.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-BHiBt2ra.js → useInitialThreadRequest-DnRRNYgw.js} +1 -1
  95. package/dist/assets/{utils-C7uJ9upL.js → utils-Bgxe0MRZ.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-C7OFQuvJ.js → withTransactionSidePanel-DKaQybw-.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-B3AwsZqW.js → zeni-epic-state-Cb-J9Nxh.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +2 -2
  100. package/dist/assets/AddressRoutes-0Eyzeqmo.js +0 -1
  101. package/dist/assets/ConnectionAuthScreen-B7BFXXXS.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-D5Bh3dbO.js +0 -1
  103. package/dist/assets/DomesticWireDetailScreen-BU_VenPR.js +0 -18
  104. package/dist/assets/DrawerScreen-BbhUunYL.js +0 -1
  105. package/dist/assets/EntityDetailRoutes-DdiBSVG3.js +0 -1
  106. package/dist/assets/FeaturePreviewScreen-C1-h6LMu.js +0 -1
  107. package/dist/assets/MagicLinkRoutes-DZdU0REk.js +0 -72
  108. package/dist/assets/MagicLinkSignInScreen-BDghb4vk.js +0 -12
  109. package/dist/assets/NotFoundScreen-DjvK1NbN.js +0 -1
  110. package/dist/assets/OAuthConsentScreen-BRyPWMqe.js +0 -1
  111. package/dist/assets/PandLWithForecastRoutes-CBP1v8tZ.js +0 -1
  112. package/dist/assets/PerformanceRoutes-COR3BTZa.js +0 -1
  113. package/dist/assets/ReferralListScreen-C5_wj8jW.js +0 -5
  114. package/dist/assets/ReimbursementApprovalRoutes-DNyMDR4t.js +0 -1
  115. package/dist/assets/RewardsRoutes-COWJicvP.js +0 -1
  116. package/dist/assets/SignInScreen-BIF8y6r_.js +0 -1
  117. package/dist/assets/SignOutScreen-D0ouX99i.js +0 -9
  118. package/dist/assets/WiseConfirmationScreen-B9n09x9Y.js +0 -12
  119. package/dist/assets/ZeniAccountStatementScreen-Dafm8AUT.js +0 -9
  120. package/dist/assets/getLocaleForTenant-ht-6GSU5.js +0 -1
  121. package/dist/assets/useAskAiCfoHostNavButtonProps-CDnIxewv.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as le,i as ca,u as ue,j as y,g as fe,n as pe,N as fa,s as ut,o as Wt,p as te}from"./core-B20PugrR.js";import{eP as ce,bs as Re,Pa as ka,eY as be,eZ as ye,e_ as Se,fT as $e,cs as ze,Pb as Ye,Pc as Ma,tq as ba,jL as ya,Pd as Sa,gQ as oa,zW as Je,zY as Ga,zZ as $a,jB as mt,Pe as Ze,zK as Ct,Pf as qt,Pg as Qt,zN as Da,Ph as Xt,Nz as _a,rC as pt,zT as za,g$ as Jt,Pi as ht,Pj as Ke,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as gt,cl as ft,cM as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sM as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as gn,Pp as fn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cN as Ya,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Un,PD as xt,PE as Rn,Bn as On,AC as Bt,Aw as ia,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Ut,PJ as Mn,zJ as Gn,zI as rt,PK as $n,PL as zn,PM as Yn,Ka as Zn,PN as Za,PO as Kn,wi as Rt,kj as Wn,gR as qn,Bs as Qn,PP as Ot,PQ as Xn,Bt as Jn,PR as er,de as ar,tk as tr,Bi as nr,Bc as Ue,bt as rr,bF as sr,cx as or,bG as ir,Jn as cr}from"./zeni-epic-state-B3AwsZqW.js";import{z as J,k as je,w as se,I as z,x as la,c3 as xa,ce as dr,r as ve,cf as lr,cg as ur,p as ua,aN as Fe,s as ge,bm as Ka,ch as mr,y as ma,i as Ba,m as Wa,d as Q,O as qa,ci as Cr,_ as jt,aq as Qa,by as Qe,cj as Va,ck as pr,N as Xa,a7 as hr,cl as gr,at as Nt,a2 as Ha,Y as Vt,f as Ht,cm as fr,cn as br,co as yr,cp as Sr,cq as Ir,cr as Ar,o as Aa,cs as Er,ct as kr,cu as Ra,F as Dr,cv as _r,cw as Pr,cx as wr,cy as Tr,cz as Fr,a9 as vr}from"./index-D8hCAHx9.js";import{n as _e,D as Mt,S as xr}from"./mui-BBkBdMVO.js";import{a as c}from"./sentry-67DqaLi1.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Ja,P as Lr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Yt,p as Rr,S as st}from"./SetupPagesScreen-DM0dhGt1.js";import{u as Or}from"./useInitialThreadRequest-BHiBt2ra.js";import La from"./NotFoundScreen-DjvK1NbN.js";import{M as Ge}from"./MobileAppDrawer-CgbJlL9u.js";import{u as Zt}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import{v as ot}from"./utils-C7uJ9upL.js";import{t as jr}from"./AddressScreen-C1kNIoFW.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./analyticsHelper-D8sAsSDg.js";import"./routePaths-XreQojZr.js";import"./BusinessVerificationPageScreen-LVeN_2_9.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]="bd72aaa3-d51b-4102-984e-94194614ae6c",e._sentryDebugIdIdentifier="sentry-dbid-bd72aaa3-d51b-4102-984e-94194614ae6c")}catch{}})();function Nr(){const e=le(),{cardId:t}=ca(),a=ue(),r=J.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Re(C?.loggedInUserRoleMap),{useFeatureGate:g}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=g(z.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=g(z.isDebitCardFeatureEnabled),F=be(n),D=ye(n),p=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,f=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:p}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:b}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>$e(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),u=!E&&d&&h,l=y(X=>Ma(X,t,u,d)),[P,T]=c.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&A===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,A,Y,q]),c.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,u,!1)))},[P,l,t,a]),c.useEffect(()=>{if(l.fetchState==="Completed"&&(Y===!1||Y&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||i===!1&&A===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,i);e(X)}},[l.fetchState,i,Y]),c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&h&&m&&a(Ga()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&h&&m&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,h,m,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",oe=Oe(d,f,_,h),ae=Ca(d,h,m,L,w),ne=Gt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(dr,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:f,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:h,productInformation:oe,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:k?.className})]})}const Vr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Hr(){const e=le(),t=ue(),a=fe(),r=J.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(z.isCardsCommentingEnabled),[g,A]=c.useState(!1),o=y(S=>Ze(S)),i=Or(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),h=S.poppedPathname??Mr(n.tenantEmailDomain);e(h,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{g||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(A(!0),t(Ct()))},[g,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Vr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=fe(),{useDynamicConfig:m}=se(),[g,A]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,R]=c.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),b=p.max_charge_card_activation_attempts_by_card_id,f=y(k=>Qt(k,n)),d=f.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:v}=se(),{isFeatureEnabled:N}=v(z.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(z.isDebitCardFeatureEnabled),w=Se(L,D),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),u=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,l=D.userRole.includes("charge_card_user"),P=be(D),T=ye(D),H=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&u;c.useEffect(()=>{g===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),A(!0)),o===!1&&f.fetchState==="Not-Started"&&(i(!0),a(Je(n,K,U)))},[o,f.fetchState,g,_]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(f.fetchState==="Completed"){if(E===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const k=Ce(D.tenantEmailDomain,n,F,d,!0),Y=ge(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&f.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,F,d,!0),Y=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[f.fetchState,d?.type.code,E,f.isRefreshingViewInBackground]);const B=J.getZeniOtpTokenForCardHolder(n),j=y(k=>pt(k.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{f.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(O,3e3),S(!0))},[f.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=k=>{R(k)};if(_!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:h,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:f,signedInUserToken:B,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Yr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),g=t.updateStatus,A=Ke(e,!1,!1,!1);let o=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:g,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:A}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(A):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Yr=_e.div`
1
+ import{j as s}from"./liveblocks-Do-nuGO9.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as Wt,p as te}from"./core-CAUatE6D.js";import{eP as ce,bs as Re,Pa as ka,eY as be,eZ as ye,e_ as Se,fT as $e,cs as ze,Pb as Ye,Pc as Ma,tq as ba,jL as ya,Pd as Sa,gQ as oa,zW as Je,zY as Ga,zZ as $a,jB as mt,Pe as Ze,zK as Ct,Pf as qt,Pg as Qt,zN as Da,Ph as Xt,Nz as _a,rC as pt,zT as za,g$ as Jt,Pi as ht,Pj as Ke,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as ft,cl as gt,cM as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sM as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as fn,Pp as gn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cN as Ya,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Un,PD as xt,PE as Rn,Bn as On,AC as Bt,Aw as ia,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Ut,PJ as Mn,zJ as Gn,zI as rt,PK as $n,PL as zn,PM as Yn,Ka as Zn,PN as Za,PO as Kn,wi as Rt,kj as Wn,gR as qn,Bs as Qn,PP as Ot,PQ as Xn,Bt as Jn,PR as er,de as ar,tk as tr,Bi as nr,Bc as Ue,bt as rr,bF as sr,cx as or,bG as ir,Jn as cr}from"./zeni-epic-state-Cb-J9Nxh.js";import{z as J,k as je,w as se,I as z,B as la,c3 as xa,ce as dr,p as ve,cf as lr,cg as ur,K as ua,aN as Fe,m as fe,bm as Ka,ch as mr,r as ma,i as Ba,h as Wa,c as Q,D as qa,ci as Cr,Y as jt,aq as Qa,by as Qe,cj as Va,ck as pr,V as Xa,a7 as hr,cl as fr,at as Nt,a2 as Ha,W as Vt,e as Ht,cm as gr,cn as br,co as yr,cp as Sr,cq as Ir,cr as Ar,o as Aa,cs as Er,ct as kr,cu as Ra,F as Dr,cv as _r,cw as Pr,cx as wr,cy as Tr,cz as Fr,a9 as vr}from"./index-ssCDruz8.js";import{n as _e,D as Mt,S as xr}from"./mui-Ee2kkUYC.js";import{a as c}from"./sentry-CpVyi-77.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Ja,P as Lr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Yt,p as Rr,S as st}from"./SetupPagesScreen-A0QZWQlp.js";import{u as Or}from"./useInitialThreadRequest-DnRRNYgw.js";import La from"./NotFoundScreen-BbD7D-7R.js";import{M as Ge}from"./MobileAppDrawer-6SipHCGH.js";import{u as Zt}from"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import{v as ot}from"./utils-Bgxe0MRZ.js";import{t as jr}from"./AddressScreen-Bg11cvW7.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./analyticsHelper-DidHWGct.js";import"./routePaths-C0HYOQUJ.js";import"./BusinessVerificationPageScreen-Bgww5Eni.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]="c5a0cc8d-bfb2-4fd4-9d14-9afc4b45a05b",e._sentryDebugIdIdentifier="sentry-dbid-c5a0cc8d-bfb2-4fd4-9d14-9afc4b45a05b")}catch{}})();function Nr(){const e=le(),{cardId:t}=ca(),a=ue(),r=J.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Re(C?.loggedInUserRoleMap),{useFeatureGate:f}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=f(z.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=f(z.isDebitCardFeatureEnabled),F=be(n),D=ye(n),p=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:p}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>$e(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),u=!E&&d&&h,l=y(X=>Ma(X,t,u,d)),[P,T]=c.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&A===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,A,Y,q]),c.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,u,!1)))},[P,l,t,a]),c.useEffect(()=>{if(l.fetchState==="Completed"&&(Y===!1||Y&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||i===!1&&A===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,i);e(X)}},[l.fetchState,i,Y]),c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&h&&m&&a(Ga()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&h&&m&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,h,m,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",oe=Oe(d,g,_,h),ae=Ca(d,h,m,L,w),ne=Gt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(dr,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:h,productInformation:oe,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:k?.className})]})}const Vr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Hr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(z.isCardsCommentingEnabled),[f,A]=c.useState(!1),o=y(S=>Ze(S)),i=Or(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),h=S.poppedPathname??Mr(n.tenantEmailDomain);e(h,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{f||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(A(!0),t(Ct()))},[f,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Vr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m}=se(),[f,A]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,R]=c.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),b=p.max_charge_card_activation_attempts_by_card_id,g=y(k=>Qt(k,n)),d=g.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:v}=se(),{isFeatureEnabled:N}=v(z.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(z.isDebitCardFeatureEnabled),w=Se(L,D),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),u=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,l=D.userRole.includes("charge_card_user"),P=be(D),T=ye(D),H=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&u;c.useEffect(()=>{f===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),A(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(Je(n,K,U)))},[o,g.fetchState,f,_]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(E===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const k=Ce(D.tenantEmailDomain,n,F,d,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,F,d,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[g.fetchState,d?.type.code,E,g.isRefreshingViewInBackground]);const B=J.getZeniOtpTokenForCardHolder(n),j=y(k=>pt(k.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(O,3e3),S(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=k=>{R(k)};if(_!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:h,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Yr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),f=t.updateStatus,A=Ke(e,!1,!1,!1);let o=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:f,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,f=m.chargeCard?.cardProviderID,{tenantEmailDomain:A}=C;return{onGetOtp:o=>{f!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{f!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{f!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(A):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Yr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Gr.containerWidth.value(e.windowSize)}%`};
@@ -11,18 +11,18 @@ import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as le,i as ca,u as ue,j as
11
11
  flex-direction: column;
12
12
  align-items: center;
13
13
  background-color: ${e=>e.theme.colors.grey4};
14
- `,Ea=qa.getLocalizedStrings().dateFormat,Kr={overlayWidth:new ma(100,100,58)},Wr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:cn(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:dn(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:C,isCashbackInfoFetchStateCompleted:m,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:A,controllerEmails:o,paymentDetails:i,productInformation:E,cashbackInformation:S,paymentSourceInformation:h,creditAccountInformation:R,debitAccountInformation:F,paymentInitiatedDate:D,sourcePage:p}=t,{tenantEmailDomain:b}=r;return{onBackNavigation:()=>{if(m&&g&&A&&S!=null&&Q.trackCardsPayEarlyFormClick(o,E,S,"Back",i.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:i.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:i.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:i.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:i.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Ea.visual.MMMDCommaYYYYformat)},h,R,F),p==="cardPaymentHistory")t.closeDrawerHandler(!0),e(bt());else{const f=Ne(b);a(f)}},onUpdatePaymentAccountStatus:(f,d,_)=>{e(mn(f,d,"bill_pay","bill_pay_detail",_))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:f=>{e(un("external_account",f))},onEstablishConnectionClick:f=>{e(ln(f,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${b}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{C?window.open(`/${b}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Cr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:C,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:A,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:i,isCashbackInfoFetchStateCompleted:E,paymentInitiatedDate:S,retryRepayment:h})=>{const R=le(),{useDynamicConfig:F}=se(),{configValue:D}=F(Fe.zeniAccountsConfig),p=nn(D),b=y($=>gt($)),{creditAccount:f}=y($=>Ye($)),d=y($=>ce($)),_=Wa(),v=ua(),N=ue(),L=J.getSignedInUser(),w=je(),[V,u]=c.useState(!1),[l,P]=c.useState(!1),{configValue:T}=F(Fe.zeniCardsConfig),H=T.credit_card_auto_pay_threshold_by_company_id?.[d.companyId]??T.default_credit_card_auto_pay_threshold??Br,U=ft(w?.loggedInUserRoleMap),K=rn(w?.loggedInUserRoleMap),I=!!d.companyZeniAccountInfo?.info?.isZeniAccountEnabled,B=y($=>da($,d.companyId)),j=B.companyChargeCardInfo?.primaryFundingAccount,O=B.allFundingAccounts.find($=>$.id===j?.accountId),W=y($=>$e($,d.companyId)),k=ze(W.controllers);c.useEffect(()=>{if(b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&N(sn()),b.fetchState==="Completed"&&!l){const $=d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=b.transferFromAccounts.find(ae=>ae.id===$);let oe;if(C==="cardPaymentHistory"&&h){const ae=h.paymentAccountId!=null?b.transferFromAccounts.find(ne=>ne.id===h.paymentAccountId):void 0;oe={amount:h.amount,isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ae??x}}else oe={amount:{amount:f.balance.amount+f.hold.amount,currencyCode:f.balance.currencyCode,currencySymbol:f.balance.currencySymbol},isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};N(tt(oe)),P(!0)}},[b.fetchState,l,C,h,b.transferFromAccounts,d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,d.companyChargeCardInfo?.info?.isAutoPayEnabled,f.balance.amount,f.balance.currencyCode,f.balance.currencySymbol,f.hold.amount,N]);const Y={isZeniCheckingEnabled:d.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:O?.accType==="depositAccount",creditCardPaymentSourceAccountName:O?.label,creditCardPaymentSourceAccountType:O?.accType,creditCardPaymentSourceLastFourDigits:O?.accountLast4,creditCardPaymentSourceBalance:O?.accountBalance?.available?.amount??0};if(c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&N(Fa(d.companyId,!0))},[B.fetchState]),c.useEffect(()=>{b.updateStatus==="Completed"&&A!=null&&E&&i&&o&&Q.trackCardsPayEarlyPayNowClick(k,n,A,b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:S?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:S?.format(Ea.visual.MMMDCommaYYYYformat)},Y,m,g)},[b.updateStatus,A,E,i,o,S]),c.useEffect(()=>{b.fetchState==="Completed"&&A!=null&&E&&i&&o&&!V&&e&&l&&A!=null&&(Q.trackCardsPayEarlyFormView(k,n,A,a,d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,f.balance.amount,Y,m,g),u(!0))},[b,E,i,o,V,e,l]),L==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),N(bt())};return s.jsx(s.Fragment,{children:s.jsx(Mt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Kr.overlayWidth.valuePercentage(v),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:_.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(qr,{onClick:$=>$.stopPropagation(),children:s.jsx(Wr,{closeDrawerHandler:t,navigate:R,paymentDetails:b,creditAccountSpentAmount:r,onTransferClick:()=>{E&&i&&o&&A!=null&&Q.trackCardsPayEarlyFormClick(k,n,A,"Pay Now",b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},Y,m,g),N(on({companyId:d.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:$=>{N(tt($))},currentTenant:d,hasZeniAccountsAdminAccess:U,isZeniAccountsUser:K,isZeniAccountSetupEnabled:I,productInformation:n,sourcePage:C,controllerEmails:k,autoPayThreshold:H,paymentSourceInformation:Y,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:A,isCashbackInfoFetchStateCompleted:E,isCreditCardInfoFetchStateCompleted:i,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:S,maxInsuredAmount:p.maxInsuredAmount})})})})},qr=_e(xr)`
14
+ `,Ea=qa.getLocalizedStrings().dateFormat,Kr={overlayWidth:new ma(100,100,58)},Wr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:cn(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:dn(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:C,isCashbackInfoFetchStateCompleted:m,isCreditCardInfoFetchStateCompleted:f,isDebitCardInfoFetchStateCompleted:A,controllerEmails:o,paymentDetails:i,productInformation:E,cashbackInformation:S,paymentSourceInformation:h,creditAccountInformation:R,debitAccountInformation:F,paymentInitiatedDate:D,sourcePage:p}=t,{tenantEmailDomain:b}=r;return{onBackNavigation:()=>{if(m&&f&&A&&S!=null&&Q.trackCardsPayEarlyFormClick(o,E,S,"Back",i.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:i.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:i.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:i.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:i.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Ea.visual.MMMDCommaYYYYformat)},h,R,F),p==="cardPaymentHistory")t.closeDrawerHandler(!0),e(bt());else{const g=Ne(b);a(g)}},onUpdatePaymentAccountStatus:(g,d,_)=>{e(mn(g,d,"bill_pay","bill_pay_detail",_))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:g=>{e(un("external_account",g))},onEstablishConnectionClick:g=>{e(ln(g,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${b}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{C?window.open(`/${b}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Cr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:C,creditAccountInformation:m,debitAccountInformation:f,cashbackInformation:A,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:i,isCashbackInfoFetchStateCompleted:E,paymentInitiatedDate:S,retryRepayment:h})=>{const R=le(),{useDynamicConfig:F}=se(),{configValue:D}=F(Fe.zeniAccountsConfig),p=nn(D),b=y($=>ft($)),{creditAccount:g}=y($=>Ye($)),d=y($=>ce($)),_=Wa(),v=ua(),N=ue(),L=J.getSignedInUser(),w=je(),[V,u]=c.useState(!1),[l,P]=c.useState(!1),{configValue:T}=F(Fe.zeniCardsConfig),H=T.credit_card_auto_pay_threshold_by_company_id?.[d.companyId]??T.default_credit_card_auto_pay_threshold??Br,U=gt(w?.loggedInUserRoleMap),K=rn(w?.loggedInUserRoleMap),I=!!d.companyZeniAccountInfo?.info?.isZeniAccountEnabled,B=y($=>da($,d.companyId)),j=B.companyChargeCardInfo?.primaryFundingAccount,O=B.allFundingAccounts.find($=>$.id===j?.accountId),W=y($=>$e($,d.companyId)),k=ze(W.controllers);c.useEffect(()=>{if(b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&N(sn()),b.fetchState==="Completed"&&!l){const $=d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=b.transferFromAccounts.find(ae=>ae.id===$);let oe;if(C==="cardPaymentHistory"&&h){const ae=h.paymentAccountId!=null?b.transferFromAccounts.find(ne=>ne.id===h.paymentAccountId):void 0;oe={amount:h.amount,isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ae??x}}else oe={amount:{amount:g.balance.amount+g.hold.amount,currencyCode:g.balance.currencyCode,currencySymbol:g.balance.currencySymbol},isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};N(tt(oe)),P(!0)}},[b.fetchState,l,C,h,b.transferFromAccounts,d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,d.companyChargeCardInfo?.info?.isAutoPayEnabled,g.balance.amount,g.balance.currencyCode,g.balance.currencySymbol,g.hold.amount,N]);const Y={isZeniCheckingEnabled:d.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:O?.accType==="depositAccount",creditCardPaymentSourceAccountName:O?.label,creditCardPaymentSourceAccountType:O?.accType,creditCardPaymentSourceLastFourDigits:O?.accountLast4,creditCardPaymentSourceBalance:O?.accountBalance?.available?.amount??0};if(c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&N(Fa(d.companyId,!0))},[B.fetchState]),c.useEffect(()=>{b.updateStatus==="Completed"&&A!=null&&E&&i&&o&&Q.trackCardsPayEarlyPayNowClick(k,n,A,b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:S?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:S?.format(Ea.visual.MMMDCommaYYYYformat)},Y,m,f)},[b.updateStatus,A,E,i,o,S]),c.useEffect(()=>{b.fetchState==="Completed"&&A!=null&&E&&i&&o&&!V&&e&&l&&A!=null&&(Q.trackCardsPayEarlyFormView(k,n,A,a,d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,g.balance.amount,Y,m,f),u(!0))},[b,E,i,o,V,e,l]),L==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),N(bt())};return s.jsx(s.Fragment,{children:s.jsx(Mt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Kr.overlayWidth.valuePercentage(v),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:_.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(qr,{onClick:$=>$.stopPropagation(),children:s.jsx(Wr,{closeDrawerHandler:t,navigate:R,paymentDetails:b,creditAccountSpentAmount:r,onTransferClick:()=>{E&&i&&o&&A!=null&&Q.trackCardsPayEarlyFormClick(k,n,A,"Pay Now",b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},Y,m,f),N(on({companyId:d.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:$=>{N(tt($))},currentTenant:d,hasZeniAccountsAdminAccess:U,isZeniAccountsUser:K,isZeniAccountSetupEnabled:I,productInformation:n,sourcePage:C,controllerEmails:k,autoPayThreshold:H,paymentSourceInformation:Y,creditAccountInformation:m,debitAccountInformation:f,cashbackInformation:A,isCashbackInfoFetchStateCompleted:E,isCreditCardInfoFetchStateCompleted:i,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:S,maxInsuredAmount:p.maxInsuredAmount})})})})},qr=_e(xr)`
15
15
  display: flex;
16
16
  min-height: 100%;
17
17
  flex-direction: column;
18
- `,Kt="charge-card-transaction-update",Oa=qa.getLocalizedStrings().dateFormat,Qr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:C}=t,m=J.getSignedInUser(),g=e.tenantState.currentTenantId,A={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},o=Ma(e,r,a,C),i=pn(e,r),E=hn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:i,vgsVaultId:Ba.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:A,isSnackbarOpen:E.isSnackbarOpen,cardsEndPoint:`${Nt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:C,cardProviderId:m,includeCreditAccountInfo:g,setIsPaymentOpen:A,controllerEmails:o,productInformation:i,cashbackInformation:E,primaryFundingAccountDetails:S,creditAccountInformation:h,debitAccountInformation:R,isChargeCardFeatureEnabled:F}=t,{tenantEmailDomain:D}=r;return{onEventReceived:p=>{p===Kt&&(e(za(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Je(a,g,F))},onFetchChargeCardTransactionList:(p,b)=>{e(nt(a,p,b))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{m!=null&&e(Ta(p,"ChargeCardHolder",a))},onResendOtp:p=>{m!=null&&e(wa(p,"ChargeCardHolder",a))},onVerifyOtp:(p,b)=>{m!=null&&e(Pa(p,b,"ChargeCardHolder",a))},onVerifyOtpSuccess:p=>{p!=null&&J.saveZeniOtpTokenForCardHolder(p,a)},onColorCodeChange:p=>{e(In(a,p))},onLockChargeCard:(p,b)=>{e(Pt(p,a,b))},onUnlockChargeCard:p=>{e(_t(p,a))},onCloseChargeCard:p=>{e(Dt(a,p))},onFetchChargeCardsRecurringExpenses:()=>{e(kt([a]))},updateChargeCardName:(p,b)=>{e(Et(p,a,b))},updateChargeCardTransactionAttachments:(p,b)=>{b!=null&&e(Sn({transactionId:p,data:b}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,b,f,d)=>{e(yn({chargeCardId:b,transactionId:p,fetchState:f,error:d}))},updateChargeCardTransactionReceiptsShowTick:(p,b,f)=>{e(bn({chargeCardId:b,transactionId:p,shouldShowTick:f}))},onChargeCardRevokeInviteClick:()=>{e(At(a))},updateChargeCardTransactionIsViewReceiptClicked:(p,b,f)=>{e(fn({chargeCardId:b,transactionId:p,isViewReceiptClicked:f}))},onChargeCardTransactionRowClick:(p,b)=>{const f=ge(C.state?.pathnameStackToGoBack,C.pathname);n(`../../transaction/${p}/${b}`,{state:{pathnameStackToGoBack:f}})},onBackClick:()=>{const p=ve(C.state?.pathnameStackToGoBack),b=Ne(D);n(b,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(gn())},onUpdateDebitCardPinAttempt:p=>{e(It(a,p)),p==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,b)=>{p?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):b!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:b.message}]}))},updateSpendLimit(p,b,f,d){e(St(p,b,f.code,d))},shouldOpenCreditCardPaymentDrawer(p){p&&E!=null&&Q.trackCardsPayEarlyClick(o,i,E,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:S?.accType==="depositAccount",creditCardPaymentSourceAccountName:S?.label,creditCardPaymentSourceAccountType:S?.accType,creditCardPaymentSourceLastFourDigits:S?.accountLast4,creditCardPaymentSourceBalance:S?.accountBalance?.available?.amount??0},h,R),A(p)}}})(hr(gr));function Xr(){const e=le(),t=ue(),a=fe(),{cardId:r}=ca(),[n,C]=c.useState(!1),[m,g]=c.useState(!1),{useDynamicConfig:A}=se(),o=J.getSignedInUser(),i=y(M=>ce(M)),E=y(M=>ka(M).firstViewAfterActivation),S=y(M=>M.classListState.fetchState),{configValue:h}=A(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:R}=A(Fe.zeniCardsConfig),F=R.enable_card_controls_for_company_ids,D=R.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(i.companyId),[p,b]=c.useState(!1),[f,d]=c.useState(!1),{useFeatureGate:_}=se(),{isFeatureEnabled:v}=_(z.isChargeCardFeatureEnabled),{isFeatureEnabled:N}=_(z.isDebitCardFeatureEnabled),L=Se(N,i),w=Ie({isDebitCardFeatureEnabled:N,isBankingOnlyTenant:L}),{isFeatureEnabled:V}=_(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:u}=_(z.isCardsCommentingEnabled),l=ye(i),P=be(i),T=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:v,isBookKeepingTenant:l,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:T}),U=!!i.companyDebitCardInfo?.info?.isDebitCardEnabled,K=!!i.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!i.userRole.includes("charge_card_user")&&H&&K;if(r==null)throw Error("Empty card id is not valid...");const B=y(M=>da(M,i.companyId)),{creditAccount:j,creditAccountRepayment:O}=y(M=>Ye(M)),W=J.getZeniOtpTokenForCardHolder(r),k=y(M=>Ma(M,r,I,H)),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:q}=Zt({mobileExploreReferrer:"Card Detail"});jt({isDataReady:k.fetchState==="Completed"});const $=y(M=>Ze(M)),x=k.chargeCard,oe=je(),ae=Re(oe?.loggedInUserRoleMap),ne=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",X=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=Ca(H,K,ae,j,O),Z=Gt(ne,k),he=Ja(ae,$),ke=Oe(H,w,U,K),Be=k.depositAccountLimitFetchState.fetchState!=="Completed"&&k.depositAccountLimitFetchState.fetchState!=="In-Progress",Pe=y(M=>$e(M,i.companyId)),we=ze(Pe.controllers),ee=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ee?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ee?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>ie?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=i?.userRole,Le=y(M=>Ke(M,!1,w,v).revokeCardInvite),aa=Qa(Le.saveStatus.fetchState);if(c.useEffect(()=>{if(aa==="In-Progress"&&Le.saveStatus.fetchState==="Completed"){const M=Ne(i.tenantEmailDomain);e(M)}},[aa,Le.saveStatus.fetchState,e,i.tenantEmailDomain]),c.useEffect(()=>{E&&n===!1&&re&&(C(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[E,n,re,Ee]),c.useEffect(()=>{p||k.fetchState==="Completed"||k.fetchState==="In-Progress"||r==null||(b(!0),t(Je(r,I,H,!1)))},[p,k,r,t]),c.useEffect(()=>{!f&&k.fetchState==="Completed"&&k.chargeCard?.connectedAccountId!=null&&ne&&Be&&ae&&(d(!0),t(yt({depositAccountId:k.chargeCard?.connectedAccountId})))},[f,k,t,Be,ae]),c.useEffect(()=>{$.fetchState!=="Completed"&&$.fetchState!=="In-Progress"&&ae&&t(Ct()),S!=="Completed"&&S!=="In-Progress"&&t(mt()),k.transactionStatistics.fetchState!=="Completed"&&k.transactionStatistics.fetchState!=="In-Progress"&&t(Cn({chargeCardId:r})),B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&t(Fa(i.companyId,!0))},[$.fetchState,t,ae,S,k.transactionStatistics.fetchState,B.fetchState]),c.useEffect(()=>{if(!(k.fetchState!=="Completed"||H&&j.fetchState!=="Completed"||x==null||k.transactionStatistics.fetchState!=="Completed"||ne&&ae&&k.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;Q.trackCardsCardDetailView(we,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Qe(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Qe(x.balance.amount),cardAvailableLimit:Qe(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Qe(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:k.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:k.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:k.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:k.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:k.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:k.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Va(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ee?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Va(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,Z)}},[k.fetchState,k.depositAccountLimitFetchState.fetchState,k.transactionStatistics.fetchState,j.fetchState,ae]),o==null)throw Error("Can't access card detail page without signing in...");const We=i.companyId??J.getSignedInUserTenant(i.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-encrypted-${We}.${Kt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ve,frequency:qe,cardColor:G}=ja(x),De=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageViewed(r,M,me,Te,Ve,qe,G,De)}};c.useEffect(()=>{if(k.fetchState==="Completed"){const M=k.chargeCard;if(M?.status.code==="inactive"||ne&&M?.isPinSet===!1||X&&E){const me=Ce(i.tenantEmailDomain,r,o,x,E);e(me)}}},[k.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageClicked(r,Te,Ve,qe,G,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsVerifyPopUpClick(r,Te,Ve,qe,G,De,M,He,me)}},Ua=j.balance.amount+j.hold.amount,ha=i.companyChargeCardInfo?.info?.primaryFundingAccount,ga=B.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||k.fetchState==="Error"?s.jsx(La,{}):k.fetchState==="In-Progress"||k.fetchState==="Not-Started"||Le.saveStatus.fetchState==="In-Progress"||ne&&ae&&k.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(pr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:E}),k.fetchState==="Completed"?s.jsx(Xa,{analytics:Q,onLoad:na}):null,m===!0?s.jsx(at,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:m,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,creditAccountSpentAmount:Ua,isDebitCardInfoFetchStateCompleted:!ne||!ae||k.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!H||j.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ae||$.fetchState==="Completed",paymentInitiatedDate:O.initiatedRepaymentDate}):null,s.jsx(Qr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ee?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:H,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:U,isChargeCardSetupEnabled:K,isCardControlsEnabled:D,isEarlyPayEnabled:V,controllerEmails:we,chargeCardCashbackDetailState:$,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,classListFetchState:S,primaryFundingAccountDetails:ga,currentTenant:i,cardProviderId:k.chargeCard?.cardProviderID,cardId:r,creditAccount:j,creditAccountRepayment:O,includeCreditAccountInfo:I,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:Y,onAskAiCfoClick:q,isCardsCommentingEnabled:u})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,C=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:C,limit:n}},Jr=_e.div`
18
+ `,Kt="charge-card-transaction-update",Oa=qa.getLocalizedStrings().dateFormat,Qr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:C}=t,m=J.getSignedInUser(),f=e.tenantState.currentTenantId,A={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:f??""},o=Ma(e,r,a,C),i=pn(e,r),E=hn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:i,vgsVaultId:Ba.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:A,isSnackbarOpen:E.isSnackbarOpen,cardsEndPoint:`${Nt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:C,cardProviderId:m,includeCreditAccountInfo:f,setIsPaymentOpen:A,controllerEmails:o,productInformation:i,cashbackInformation:E,primaryFundingAccountDetails:S,creditAccountInformation:h,debitAccountInformation:R,isChargeCardFeatureEnabled:F}=t,{tenantEmailDomain:D}=r;return{onEventReceived:p=>{p===Kt&&(e(za(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Je(a,f,F))},onFetchChargeCardTransactionList:(p,b)=>{e(nt(a,p,b))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{m!=null&&e(Ta(p,"ChargeCardHolder",a))},onResendOtp:p=>{m!=null&&e(wa(p,"ChargeCardHolder",a))},onVerifyOtp:(p,b)=>{m!=null&&e(Pa(p,b,"ChargeCardHolder",a))},onVerifyOtpSuccess:p=>{p!=null&&J.saveZeniOtpTokenForCardHolder(p,a)},onColorCodeChange:p=>{e(In(a,p))},onLockChargeCard:(p,b)=>{e(Pt(p,a,b))},onUnlockChargeCard:p=>{e(_t(p,a))},onCloseChargeCard:p=>{e(Dt(a,p))},onFetchChargeCardsRecurringExpenses:()=>{e(kt([a]))},updateChargeCardName:(p,b)=>{e(Et(p,a,b))},updateChargeCardTransactionAttachments:(p,b)=>{b!=null&&e(Sn({transactionId:p,data:b}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,b,g,d)=>{e(yn({chargeCardId:b,transactionId:p,fetchState:g,error:d}))},updateChargeCardTransactionReceiptsShowTick:(p,b,g)=>{e(bn({chargeCardId:b,transactionId:p,shouldShowTick:g}))},onChargeCardRevokeInviteClick:()=>{e(At(a))},updateChargeCardTransactionIsViewReceiptClicked:(p,b,g)=>{e(gn({chargeCardId:b,transactionId:p,isViewReceiptClicked:g}))},onChargeCardTransactionRowClick:(p,b)=>{const g=fe(C.state?.pathnameStackToGoBack,C.pathname);n(`../../transaction/${p}/${b}`,{state:{pathnameStackToGoBack:g}})},onBackClick:()=>{const p=ve(C.state?.pathnameStackToGoBack),b=Ne(D);n(b,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(fn())},onUpdateDebitCardPinAttempt:p=>{e(It(a,p)),p==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,b)=>{p?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):b!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:b.message}]}))},updateSpendLimit(p,b,g,d){e(St(p,b,g.code,d))},shouldOpenCreditCardPaymentDrawer(p){p&&E!=null&&Q.trackCardsPayEarlyClick(o,i,E,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:S?.accType==="depositAccount",creditCardPaymentSourceAccountName:S?.label,creditCardPaymentSourceAccountType:S?.accType,creditCardPaymentSourceLastFourDigits:S?.accountLast4,creditCardPaymentSourceBalance:S?.accountBalance?.available?.amount??0},h,R),A(p)}}})(hr(fr));function Xr(){const e=le(),t=ue(),a=ge(),{cardId:r}=ca(),[n,C]=c.useState(!1),[m,f]=c.useState(!1),{useDynamicConfig:A}=se(),o=J.getSignedInUser(),i=y(M=>ce(M)),E=y(M=>ka(M).firstViewAfterActivation),S=y(M=>M.classListState.fetchState),{configValue:h}=A(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:R}=A(Fe.zeniCardsConfig),F=R.enable_card_controls_for_company_ids,D=R.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(i.companyId),[p,b]=c.useState(!1),[g,d]=c.useState(!1),{useFeatureGate:_}=se(),{isFeatureEnabled:v}=_(z.isChargeCardFeatureEnabled),{isFeatureEnabled:N}=_(z.isDebitCardFeatureEnabled),L=Se(N,i),w=Ie({isDebitCardFeatureEnabled:N,isBankingOnlyTenant:L}),{isFeatureEnabled:V}=_(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:u}=_(z.isCardsCommentingEnabled),l=ye(i),P=be(i),T=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:v,isBookKeepingTenant:l,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:T}),U=!!i.companyDebitCardInfo?.info?.isDebitCardEnabled,K=!!i.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!i.userRole.includes("charge_card_user")&&H&&K;if(r==null)throw Error("Empty card id is not valid...");const B=y(M=>da(M,i.companyId)),{creditAccount:j,creditAccountRepayment:O}=y(M=>Ye(M)),W=J.getZeniOtpTokenForCardHolder(r),k=y(M=>Ma(M,r,I,H)),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:q}=Zt({mobileExploreReferrer:"Card Detail"});jt({isDataReady:k.fetchState==="Completed"});const $=y(M=>Ze(M)),x=k.chargeCard,oe=je(),ae=Re(oe?.loggedInUserRoleMap),ne=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",X=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=Ca(H,K,ae,j,O),Z=Gt(ne,k),he=Ja(ae,$),ke=Oe(H,w,U,K),Be=k.depositAccountLimitFetchState.fetchState!=="Completed"&&k.depositAccountLimitFetchState.fetchState!=="In-Progress",Pe=y(M=>$e(M,i.companyId)),we=ze(Pe.controllers),ee=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ee?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ee?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>ie?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=i?.userRole,Le=y(M=>Ke(M,!1,w,v).revokeCardInvite),aa=Qa(Le.saveStatus.fetchState);if(c.useEffect(()=>{if(aa==="In-Progress"&&Le.saveStatus.fetchState==="Completed"){const M=Ne(i.tenantEmailDomain);e(M)}},[aa,Le.saveStatus.fetchState,e,i.tenantEmailDomain]),c.useEffect(()=>{E&&n===!1&&re&&(C(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[E,n,re,Ee]),c.useEffect(()=>{p||k.fetchState==="Completed"||k.fetchState==="In-Progress"||r==null||(b(!0),t(Je(r,I,H,!1)))},[p,k,r,t]),c.useEffect(()=>{!g&&k.fetchState==="Completed"&&k.chargeCard?.connectedAccountId!=null&&ne&&Be&&ae&&(d(!0),t(yt({depositAccountId:k.chargeCard?.connectedAccountId})))},[g,k,t,Be,ae]),c.useEffect(()=>{$.fetchState!=="Completed"&&$.fetchState!=="In-Progress"&&ae&&t(Ct()),S!=="Completed"&&S!=="In-Progress"&&t(mt()),k.transactionStatistics.fetchState!=="Completed"&&k.transactionStatistics.fetchState!=="In-Progress"&&t(Cn({chargeCardId:r})),B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&t(Fa(i.companyId,!0))},[$.fetchState,t,ae,S,k.transactionStatistics.fetchState,B.fetchState]),c.useEffect(()=>{if(!(k.fetchState!=="Completed"||H&&j.fetchState!=="Completed"||x==null||k.transactionStatistics.fetchState!=="Completed"||ne&&ae&&k.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;Q.trackCardsCardDetailView(we,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Qe(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Qe(x.balance.amount),cardAvailableLimit:Qe(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Qe(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:k.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:k.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:k.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:k.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:k.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:k.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Va(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ee?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Va(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,Z)}},[k.fetchState,k.depositAccountLimitFetchState.fetchState,k.transactionStatistics.fetchState,j.fetchState,ae]),o==null)throw Error("Can't access card detail page without signing in...");const We=i.companyId??J.getSignedInUserTenant(i.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-encrypted-${We}.${Kt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ve,frequency:qe,cardColor:G}=ja(x),De=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageViewed(r,M,me,Te,Ve,qe,G,De)}};c.useEffect(()=>{if(k.fetchState==="Completed"){const M=k.chargeCard;if(M?.status.code==="inactive"||ne&&M?.isPinSet===!1||X&&E){const me=Ce(i.tenantEmailDomain,r,o,x,E);e(me)}}},[k.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageClicked(r,Te,Ve,qe,G,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsVerifyPopUpClick(r,Te,Ve,qe,G,De,M,He,me)}},Ua=j.balance.amount+j.hold.amount,ha=i.companyChargeCardInfo?.info?.primaryFundingAccount,fa=B.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||k.fetchState==="Error"?s.jsx(La,{}):k.fetchState==="In-Progress"||k.fetchState==="Not-Started"||Le.saveStatus.fetchState==="In-Progress"||ne&&ae&&k.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(pr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:E}),k.fetchState==="Completed"?s.jsx(Xa,{analytics:Q,onLoad:na}):null,m===!0?s.jsx(at,{closeDrawerHandler:()=>f(!1),isPaymentDrawerOpen:m,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,creditAccountSpentAmount:Ua,isDebitCardInfoFetchStateCompleted:!ne||!ae||k.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!H||j.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ae||$.fetchState==="Completed",paymentInitiatedDate:O.initiatedRepaymentDate}):null,s.jsx(Qr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:f,cardIssuedByRoles:ee?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:H,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:U,isChargeCardSetupEnabled:K,isCardControlsEnabled:D,isEarlyPayEnabled:V,controllerEmails:we,chargeCardCashbackDetailState:$,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,classListFetchState:S,primaryFundingAccountDetails:fa,currentTenant:i,cardProviderId:k.chargeCard?.cardProviderID,cardId:r,creditAccount:j,creditAccountRepayment:O,includeCreditAccountInfo:I,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:Y,onAskAiCfoClick:q,isCardsCommentingEnabled:u})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,C=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:C,limit:n}},Jr=_e.div`
19
19
  display: flex;
20
20
  width: 100%;
21
21
  flex: 1 1 auto;
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,es=pe(function(e,t){const a=Ke(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:An(e),bulkActionView:En(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:C,chargeCardListState:m,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:A,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:i,isDebitCardFeatureEnabled:E,isDebitCardSetupEnabled:S,isDebitCardTOSAccepted:h,isChargeCardTOSAccepted:R,controllerEmails:F,depositAccountListWithDebitCardIssued:D,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:b,productInformation:f,cashbackInformation:d,creditAccountInformation:_,debitAccountInformation:v,updatePayNowInfoTooltip:N,isUserHasCardsAdminLevelAccess:L}=t,{tenantEmailDomain:w}=r,{cards:V}=m;return{onChargeCardRowClick:(u,l)=>{const P=zt(V,u);let T;P!=null&&((U=>{const K=U.limit.amount-U.available.amount,I=`${U.cardHolderUser?.firstName.toLowerCase()} ${U.cardHolderUser?.lastName.toLowerCase()}`,B=U.cardName,j=U.department?.className??"",O=U.limit.amount,W=U.creditLimitFrequency.name;Q.trackCardsListRowClicked(I,B,j,K,O,W,C.userId===U.cardHolderUserId)})(P),Me(E,S,D)&&Q.trackCardsCardListRowClick(F,f,"Card Row Item","row_clicked",l+1,{cardOwner:Va(P.cardHolderUser,!1),cardName:P.cardName,cardType:P.type.code.includes("credit")?"credit":"debit",cardStatus:P.status.code,cardUtilizationAmount:Qe(P.limit.amount-P.available.amount),cardUtilizationPercent:P.limit.amount>0?Math.round((P.limit.amount-P.available.amount)/P.limit.amount*100):0,cardLimit:Qe(P.limit.amount)},d,_,v)),T=P?.status.code==="request_on_hold"&&C.userId===P.cardHolderUserId?Yt(w):Ce(w,u,C,P);const H=ge(n.state?.pathnameStackToGoBack,n.pathname);a(T,{state:{pathnameStackToGoBack:H}})},onFetchChargeCardsRecurringExpenses:u=>{e(kt(u))},onFetchDepositAccountLimit:u=>{e(yt({depositAccountId:u}))},onChargeCardResendInviteClick:u=>{e(vn(u))},onChargeCardRevokeInviteClick:u=>{e(At(u))},onLockChargeCardList:(u,l)=>{e(Fn(u,l))},onUnlockChargeCardList:u=>{e(Tn(u))},onCloseChargeCardList:(u,l)=>{e(wn(u,l))},onRevokeChargeCardList:u=>{e(Pn(u))},updateChargeCardListSpendLimit(u,l,P){e(_n(u,l,P.code))},onLockChargeCard:(u,l)=>{e(Pt(L,u,l))},onUnlockChargeCard:u=>{e(_t(L,u))},onCloseChargeCard:(u,l)=>{e(Dt(u,l))},onUpdateSpendLimit(u,l,P,T){e(St(u,l,P.code,T))},updateChargeCardName:(u,l)=>{e(Et(L,u,l))},onClickSetupIcon:()=>{Q.trackCardsListPageClicked("settings"),Me(E,S,D)&&d!=null&&Q.trackCardsSettingsClick(F,f,d,_,v);const u=Ur(w),l=ge(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onIssueCardClick:()=>{Q.trackCardsListPageClicked("new card"),Me(E,S,D)&&d!=null&&Q.trackCardsNewCardClick(F,f,d,"New Button","card_creation_initiated","Card List",_,v);const u=as(w),l=ge(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onColumnSortConfigChanged:(u,l)=>{Me(E,S,D)&&d!=null&&Q.trackCardsCardListSortClick(F,f,d,"Sort Icon","sort",u,l==="ascending"?"ASC":"DESC","Cards List",_,v),e(Na({uiState:{sortKey:u,sortOrder:l}}))},onSearchTextChanged:u=>{e(Dn(u))},onReloadCards:()=>{e(Ia(g,E&&S,A&&i,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(E,S,D)&&d!=null&&Q.trackCardsCashbackOverviewClick(F,f,d,"Cashback Overview","cashback_details_viewed",_,v),a("./cashback")},onClickStatementsIcon:()=>{Me(E,S,D)&&d!=null&&Q.trackCardsStatementsClick(F,f,d,_,v),a("./statements")},onCreateNowClick:u=>{Me(E,S,D)&&d!=null&&Q.trackCardsNewCardClick(F,f,d,"Promo Banner","card_creation_initiated","Card List",_,v),a(`./new?cardType=${u}`)},onPromoCardClick:u=>{a(u==="debit"&&E&&!h||u==="credit"&&o&&!R?`../promo?cardPromoType=${u}`:"./setup")},navigateToCreditCardPaymentPage:(u,l)=>{b==="Completed"&&r.company!=null&&d!=null&&Q.trackCardsPayEarlyClick(F,f,d,"Card List",u,l,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},_,v);const P=ts(w);a(P)},navigateToCreditCardPaymentHistoryPage:()=>{const u=ns(w),l=ge(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},shouldShowPayNowInfoTooltip:N,onSetRowActionCardId:u=>{e(kn(u))},onSetBulkActionCardIds:u=>{e(wt(u))}}})(fr);function it({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=fe(),n=c.useCallback((G,De)=>{a(wt([])),t(G,De)},[a,t]),[C,m]=c.useState(!1),[g,A]=c.useState(J.getPayNowInfoTooltip()??!1),o=G=>{J.savePayNowInfoTooltip(G),A(G)},[i,E]=c.useState(!1),S=J.getSignedInUser(),h=y(G=>ce(G)),[R,F]=c.useState(!1),[D,p]=c.useState(!1),{isAiCfoAccessEnabled:b,onAskAiCfoClick:f}=Zt({mobileExploreReferrer:"Cards"}),d=h.userRole.includes("charge_card_user"),_=!d,v=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:N,useDynamicConfig:L}=se(),{isFeatureEnabled:w}=N(z.isCashbackFeatureEnabled),{isFeatureEnabled:V}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=N(z.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=N(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:P}=N(z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:T}=N(z.isCardsCommentingEnabled),H=Se(u,h),U=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:H}),K=be(h),I=ye(h),B=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I,isDebitCardProductVisible:U,chargeCardsCreditAccountLimit:B}),O=$t({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I}),{configValue:W}=L(Fe.zeniCardsConfig),k=je(),Y=Re(k?.loggedInUserRoleMap),q=y(G=>$e(G,h.companyId)),$=ze(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,oe=W.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??W.default_credit_card_pay_now_threshold??Lr,ae=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(h.companyId),ne=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,X=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(G=>gt(G)),xe=Qa(Ee.updateStatus),Z=y(G=>Ke(G,_,U&&v,j&&re)),he=Z.cards.filter(G=>G.type.code.includes("debit")).map(G=>G.connectedAccountId),ke=[...new Set(he)],Be=y(G=>Ze(G)),Pe=y(G=>va(G,ke)),we=y(G=>da(G,h.companyId)),ee=we.companyChargeCardInfo?.primaryFundingAccount,pa=we.allFundingAccounts.find(G=>G.id===ee?.accountId),ie=Z.fetchState,ea=Z.creditAccount;jt({isDataReady:ie==="Completed"});const{creditAccountRepayment:de}=y(G=>Ye(G)),Le=y(G=>ka(G).firstViewAfterActivation),{areTenantIdsInSync:aa}=Vt(),We=Ja(Y,Be),ta=Ca(j,re,Y,ea,de),na=et(U,v,Y,Pe,Z.debitCardSummary),ra=Oe(j,U,v,re),sa=Z.creditAccount.balance.amount+Z.creditAccount.hold.amount;if(c.useEffect(()=>{ie==="Completed"&&(J.getPayNowInfoTooltip()==null||sa<oe*Z.creditAccount.limit.amount/100)&&o(!0)},[ie,oe,sa,Z.creditAccount.limit.amount]),c.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),m(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){m(!1),document.body.style.overflow="auto";const G=Ne(h.tenantEmailDomain);n(G)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,h.tenantEmailDomain]),c.useEffect(()=>{!R&&(re||v)&&aa&&(F(!0),a(Ia(_,U&&v,j&&re,!1)))},[R,_,a,aa]),c.useEffect(()=>{Le&&i===!1&&(E(!0),setTimeout(()=>{a(Sa())},5e3))},[Le,i]),c.useEffect(()=>{ie==="Completed"&&d&&Z.cards.length===1&&(Z.cards[0].status.code==="inactive"&&Z.cards[0].type.code==="business_physical_credit_card"?n(`./${Z.cards[0].id}/activate`):Z.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${Z.cards[0].id}`)))},[ie,d,r.state,n,Z.cards]),c.useEffect(()=>{if(ie==="Completed"&&d){const G=Z.cards.length,De=Z.cards.filter(He=>He.cardHolderUserId===S?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&G===De.length&&n("./onboard")}},[ie,Z.cards,d,n,S?.userId]),c.useEffect(()=>{ie!=="Completed"||j&&de.fetchState!=="Completed"||U&&v&&Y&&Pe.fetchState!=="Completed"||Q.trackCardsCardListView($,ra,We,ta,na)},[ie,ea,de.fetchState,Pe.fetchState,Y]),S==null)throw Error("Can't access charge card list page without signing in...");const Ua=y(G=>Tt(G.userState,G.userRoleState,G.userListViewState,"cardAdmin")),ha=Ya(k?.loggedInUserRoleMap),ga=G=>{p(G)},M=Z.creditAccount.limit,me=()=>{m(!1),n("..")},Te=h.companyChargeCardInfo?.info!=null&&Xe({cardInfo:h.companyChargeCardInfo.info,isProductVisible:j,isTOSAccepted:ne,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha}),Ve=h.companyDebitCardInfo?.info!=null&&Xe({cardInfo:h.companyDebitCardInfo.info,isProductVisible:U,isTOSAccepted:X,isSetupEnabled:v,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha});return re||v?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{Q.trackPageLoaded(Ht.Event.cardsListPage),(j&&!re||U&&!v)&&Q.trackCardsPromoView($,{isCreditCardOffered:j,isDebitCardOffered:U,isDebitCardEnabled:v,isCreditCardEnabled:re},"Banner",U&&!v?"Debit Card":j&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Le})]}):null,C===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:C,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(U&&v&&Y)||Pe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!j||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!Y||Be.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Jr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:ga}),s.jsx(es,{isCashbackFeatureEnabled:w,isChargeCardFeatureEnabled:j,isDebitCardFeatureEnabled:U,isCreditCardProductVisibleForExpressInterest:O,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:g,creditCardPayNowThreshold:oe,signedInUser:S,chargeCardListState:Z,location:r,admins:Ua.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:ae,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:Y,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{ga(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:v,isEarlyPayEnabled:l,isChargeCardPaymentHistoryFeatureEnabled:P,cashbackRate:x,controllerEmails:$,chargeCardCashbackDetailState:Be,depositAccountListWithDebitCardIssued:Pe,isChargeCardTOSAccepted:ne,isDebitCardTOSAccepted:X,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:we.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:b,onAskAiCfoClick:f,isCardsCommentingEnabled:T})]})]}):(ne||X)&&Y===!0?s.jsx(fa,{to:"../setup"}):Te||Ve?s.jsx(fa,{to:"../promo"}):s.jsx(la,{fetchState:ie})}const as=e=>`/${e}/cards/new`,ts=e=>`/${e}/cards/payment`,ns=e=>`/${e}/cards/payment-history`,rs=pe(function(e){const t=J.getSignedInUser(),a=ce(e),r=e.tenantState.currentTenantId,n=Ft(e),C={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},m=a?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:xn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:C,companyName:m,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),C=n.poppedPathname??"..";r(C,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,C)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:C}}})},onFiltersChange:n=>{e(Ln({filters:n}))},onReloadPayments:()=>{e(vt(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(Bn({uiState:{downloadState:n}}))}}})(br);function ss(){const e=le(),t=fe(),a=ue(),{areTenantIdsInSync:r}=Vt(),{useFeatureGate:n}=se();if(J.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const C=y(q=>ce(q)),m=y(q=>Ft(q)),[g,A]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,R]=c.useState(null),F=!C.userRole.includes("charge_card_user"),D=!!C.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=n(z.isChargeCardFeatureEnabled),{isFeatureEnabled:b}=n(z.isDebitCardFeatureEnabled),f=Se(b,C),d=Ie({isDebitCardFeatureEnabled:b,isBankingOnlyTenant:f}),_=be(C),v=ye(C),N=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:p,isBookKeepingTenant:v,isDebitCardProductVisible:d,chargeCardsCreditAccountLimit:N}),w=!!C.companyChargeCardInfo?.info?.isChargeCardEnabled,V=je(),u=Re(V?.loggedInUserRoleMap),l=y(q=>Ke(q,F,d&&D,L&&w)),P=c.useMemo(()=>{const q=l.cards.filter($=>$.type.code.includes("debit"));return[...new Set(q.map($=>$.connectedAccountId))]},[l.cards]),T=y(q=>Ze(q)),H=y(q=>va(q,P)),{creditAccountRepayment:U}=y(q=>Ye(q)),K=c.useMemo(()=>Ja(u,T),[u,T]),I=c.useMemo(()=>Ca(L,w,u,l.creditAccount,U),[L,w,u,l.creditAccount,U]),B=c.useMemo(()=>et(d,D,u,H,l.debitCardSummary),[d,D,u,H,l.debitCardSummary]),j=c.useMemo(()=>Oe(L,d,D,w),[L,d,D,w]),O=l.creditAccount.balance.amount+l.creditAccount.hold.amount,W=c.useMemo(()=>h!=null?m.repaymentHistory.find(q=>q.cardRepaymentId===h):void 0,[h,m.repaymentHistory]),k=c.useCallback(q=>{R(q),a(Ia(F,d&&D,L&&w,!1)),S(!0)},[a,F,d,D,L,w]),Y=c.useCallback(()=>{S(!1),R(null),document.body.style.overflow="auto"},[]);return c.useEffect(()=>{g||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(A(!0),a(vt()))},[g,a,m.fetchState]),c.useEffect(()=>{!o&&(w||D)&&r&&(i(!0),a(Ia(F,!1,L&&w,!1)))},[o,w,D,r,a,F,L]),s.jsxs(s.Fragment,{children:[E?s.jsx(at,{closeDrawerHandler:Y,isPaymentDrawerOpen:E,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:O,productInformation:j,creditAccountInformation:I,debitAccountInformation:B,cashbackInformation:K,isDebitCardInfoFetchStateCompleted:!(d&&D&&u)||H.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!L||U.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!u||T.fetchState==="Completed",paymentInitiatedDate:U.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(rs,{location:t,navigate:e,accountInfoByAccountId:m.accountInfoByAccountId,onRetryPaymentClick:k})]})}const ct=_e.div`
25
+ `,es=pe(function(e,t){const a=Ke(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:An(e),bulkActionView:En(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:C,chargeCardListState:m,includeCreditAccountDebitSummaryAndCashbackInfo:f,isChargeCardFeatureEnabled:A,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:i,isDebitCardFeatureEnabled:E,isDebitCardSetupEnabled:S,isDebitCardTOSAccepted:h,isChargeCardTOSAccepted:R,controllerEmails:F,depositAccountListWithDebitCardIssued:D,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:b,productInformation:g,cashbackInformation:d,creditAccountInformation:_,debitAccountInformation:v,updatePayNowInfoTooltip:N,isUserHasCardsAdminLevelAccess:L}=t,{tenantEmailDomain:w}=r,{cards:V}=m;return{onChargeCardRowClick:(u,l)=>{const P=zt(V,u);let T;P!=null&&((U=>{const K=U.limit.amount-U.available.amount,I=`${U.cardHolderUser?.firstName.toLowerCase()} ${U.cardHolderUser?.lastName.toLowerCase()}`,B=U.cardName,j=U.department?.className??"",O=U.limit.amount,W=U.creditLimitFrequency.name;Q.trackCardsListRowClicked(I,B,j,K,O,W,C.userId===U.cardHolderUserId)})(P),Me(E,S,D)&&Q.trackCardsCardListRowClick(F,g,"Card Row Item","row_clicked",l+1,{cardOwner:Va(P.cardHolderUser,!1),cardName:P.cardName,cardType:P.type.code.includes("credit")?"credit":"debit",cardStatus:P.status.code,cardUtilizationAmount:Qe(P.limit.amount-P.available.amount),cardUtilizationPercent:P.limit.amount>0?Math.round((P.limit.amount-P.available.amount)/P.limit.amount*100):0,cardLimit:Qe(P.limit.amount)},d,_,v)),T=P?.status.code==="request_on_hold"&&C.userId===P.cardHolderUserId?Yt(w):Ce(w,u,C,P);const H=fe(n.state?.pathnameStackToGoBack,n.pathname);a(T,{state:{pathnameStackToGoBack:H}})},onFetchChargeCardsRecurringExpenses:u=>{e(kt(u))},onFetchDepositAccountLimit:u=>{e(yt({depositAccountId:u}))},onChargeCardResendInviteClick:u=>{e(vn(u))},onChargeCardRevokeInviteClick:u=>{e(At(u))},onLockChargeCardList:(u,l)=>{e(Fn(u,l))},onUnlockChargeCardList:u=>{e(Tn(u))},onCloseChargeCardList:(u,l)=>{e(wn(u,l))},onRevokeChargeCardList:u=>{e(Pn(u))},updateChargeCardListSpendLimit(u,l,P){e(_n(u,l,P.code))},onLockChargeCard:(u,l)=>{e(Pt(L,u,l))},onUnlockChargeCard:u=>{e(_t(L,u))},onCloseChargeCard:(u,l)=>{e(Dt(u,l))},onUpdateSpendLimit(u,l,P,T){e(St(u,l,P.code,T))},updateChargeCardName:(u,l)=>{e(Et(L,u,l))},onClickSetupIcon:()=>{Q.trackCardsListPageClicked("settings"),Me(E,S,D)&&d!=null&&Q.trackCardsSettingsClick(F,g,d,_,v);const u=Ur(w),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onIssueCardClick:()=>{Q.trackCardsListPageClicked("new card"),Me(E,S,D)&&d!=null&&Q.trackCardsNewCardClick(F,g,d,"New Button","card_creation_initiated","Card List",_,v);const u=as(w),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onColumnSortConfigChanged:(u,l)=>{Me(E,S,D)&&d!=null&&Q.trackCardsCardListSortClick(F,g,d,"Sort Icon","sort",u,l==="ascending"?"ASC":"DESC","Cards List",_,v),e(Na({uiState:{sortKey:u,sortOrder:l}}))},onSearchTextChanged:u=>{e(Dn(u))},onReloadCards:()=>{e(Ia(f,E&&S,A&&i,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(E,S,D)&&d!=null&&Q.trackCardsCashbackOverviewClick(F,g,d,"Cashback Overview","cashback_details_viewed",_,v),a("./cashback")},onClickStatementsIcon:()=>{Me(E,S,D)&&d!=null&&Q.trackCardsStatementsClick(F,g,d,_,v),a("./statements")},onCreateNowClick:u=>{Me(E,S,D)&&d!=null&&Q.trackCardsNewCardClick(F,g,d,"Promo Banner","card_creation_initiated","Card List",_,v),a(`./new?cardType=${u}`)},onPromoCardClick:u=>{a(u==="debit"&&E&&!h||u==="credit"&&o&&!R?`../promo?cardPromoType=${u}`:"./setup")},navigateToCreditCardPaymentPage:(u,l)=>{b==="Completed"&&r.company!=null&&d!=null&&Q.trackCardsPayEarlyClick(F,g,d,"Card List",u,l,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},_,v);const P=ts(w);a(P)},navigateToCreditCardPaymentHistoryPage:()=>{const u=ns(w),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},shouldShowPayNowInfoTooltip:N,onSetRowActionCardId:u=>{e(kn(u))},onSetBulkActionCardIds:u=>{e(wt(u))}}})(gr);function it({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=ge(),n=c.useCallback((G,De)=>{a(wt([])),t(G,De)},[a,t]),[C,m]=c.useState(!1),[f,A]=c.useState(J.getPayNowInfoTooltip()??!1),o=G=>{J.savePayNowInfoTooltip(G),A(G)},[i,E]=c.useState(!1),S=J.getSignedInUser(),h=y(G=>ce(G)),[R,F]=c.useState(!1),[D,p]=c.useState(!1),{isAiCfoAccessEnabled:b,onAskAiCfoClick:g}=Zt({mobileExploreReferrer:"Cards"}),d=h.userRole.includes("charge_card_user"),_=!d,v=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:N,useDynamicConfig:L}=se(),{isFeatureEnabled:w}=N(z.isCashbackFeatureEnabled),{isFeatureEnabled:V}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=N(z.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=N(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:P}=N(z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:T}=N(z.isCardsCommentingEnabled),H=Se(u,h),U=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:H}),K=be(h),I=ye(h),B=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I,isDebitCardProductVisible:U,chargeCardsCreditAccountLimit:B}),O=$t({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I}),{configValue:W}=L(Fe.zeniCardsConfig),k=je(),Y=Re(k?.loggedInUserRoleMap),q=y(G=>$e(G,h.companyId)),$=ze(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,oe=W.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??W.default_credit_card_pay_now_threshold??Lr,ae=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(h.companyId),ne=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,X=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(G=>ft(G)),xe=Qa(Ee.updateStatus),Z=y(G=>Ke(G,_,U&&v,j&&re)),he=Z.cards.filter(G=>G.type.code.includes("debit")).map(G=>G.connectedAccountId),ke=[...new Set(he)],Be=y(G=>Ze(G)),Pe=y(G=>va(G,ke)),we=y(G=>da(G,h.companyId)),ee=we.companyChargeCardInfo?.primaryFundingAccount,pa=we.allFundingAccounts.find(G=>G.id===ee?.accountId),ie=Z.fetchState,ea=Z.creditAccount;jt({isDataReady:ie==="Completed"});const{creditAccountRepayment:de}=y(G=>Ye(G)),Le=y(G=>ka(G).firstViewAfterActivation),{areTenantIdsInSync:aa}=Vt(),We=Ja(Y,Be),ta=Ca(j,re,Y,ea,de),na=et(U,v,Y,Pe,Z.debitCardSummary),ra=Oe(j,U,v,re),sa=Z.creditAccount.balance.amount+Z.creditAccount.hold.amount;if(c.useEffect(()=>{ie==="Completed"&&(J.getPayNowInfoTooltip()==null||sa<oe*Z.creditAccount.limit.amount/100)&&o(!0)},[ie,oe,sa,Z.creditAccount.limit.amount]),c.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),m(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){m(!1),document.body.style.overflow="auto";const G=Ne(h.tenantEmailDomain);n(G)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,h.tenantEmailDomain]),c.useEffect(()=>{!R&&(re||v)&&aa&&(F(!0),a(Ia(_,U&&v,j&&re,!1)))},[R,_,a,aa]),c.useEffect(()=>{Le&&i===!1&&(E(!0),setTimeout(()=>{a(Sa())},5e3))},[Le,i]),c.useEffect(()=>{ie==="Completed"&&d&&Z.cards.length===1&&(Z.cards[0].status.code==="inactive"&&Z.cards[0].type.code==="business_physical_credit_card"?n(`./${Z.cards[0].id}/activate`):Z.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${Z.cards[0].id}`)))},[ie,d,r.state,n,Z.cards]),c.useEffect(()=>{if(ie==="Completed"&&d){const G=Z.cards.length,De=Z.cards.filter(He=>He.cardHolderUserId===S?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&G===De.length&&n("./onboard")}},[ie,Z.cards,d,n,S?.userId]),c.useEffect(()=>{ie!=="Completed"||j&&de.fetchState!=="Completed"||U&&v&&Y&&Pe.fetchState!=="Completed"||Q.trackCardsCardListView($,ra,We,ta,na)},[ie,ea,de.fetchState,Pe.fetchState,Y]),S==null)throw Error("Can't access charge card list page without signing in...");const Ua=y(G=>Tt(G.userState,G.userRoleState,G.userListViewState,"cardAdmin")),ha=Ya(k?.loggedInUserRoleMap),fa=G=>{p(G)},M=Z.creditAccount.limit,me=()=>{m(!1),n("..")},Te=h.companyChargeCardInfo?.info!=null&&Xe({cardInfo:h.companyChargeCardInfo.info,isProductVisible:j,isTOSAccepted:ne,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha}),Ve=h.companyDebitCardInfo?.info!=null&&Xe({cardInfo:h.companyDebitCardInfo.info,isProductVisible:U,isTOSAccepted:X,isSetupEnabled:v,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha});return re||v?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{Q.trackPageLoaded(Ht.Event.cardsListPage),(j&&!re||U&&!v)&&Q.trackCardsPromoView($,{isCreditCardOffered:j,isDebitCardOffered:U,isDebitCardEnabled:v,isCreditCardEnabled:re},"Banner",U&&!v?"Debit Card":j&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Le})]}):null,C===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:C,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(U&&v&&Y)||Pe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!j||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!Y||Be.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Jr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:fa}),s.jsx(es,{isCashbackFeatureEnabled:w,isChargeCardFeatureEnabled:j,isDebitCardFeatureEnabled:U,isCreditCardProductVisibleForExpressInterest:O,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:f,creditCardPayNowThreshold:oe,signedInUser:S,chargeCardListState:Z,location:r,admins:Ua.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:ae,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:Y,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{fa(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:v,isEarlyPayEnabled:l,isChargeCardPaymentHistoryFeatureEnabled:P,cashbackRate:x,controllerEmails:$,chargeCardCashbackDetailState:Be,depositAccountListWithDebitCardIssued:Pe,isChargeCardTOSAccepted:ne,isDebitCardTOSAccepted:X,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:we.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:b,onAskAiCfoClick:g,isCardsCommentingEnabled:T})]})]}):(ne||X)&&Y===!0?s.jsx(ga,{to:"../setup"}):Te||Ve?s.jsx(ga,{to:"../promo"}):s.jsx(la,{fetchState:ie})}const as=e=>`/${e}/cards/new`,ts=e=>`/${e}/cards/payment`,ns=e=>`/${e}/cards/payment-history`,rs=pe(function(e){const t=J.getSignedInUser(),a=ce(e),r=e.tenantState.currentTenantId,n=Ft(e),C={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},m=a?.companyName??"",f=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:xn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:C,companyName:m,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:f}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),C=n.poppedPathname??"..";r(C,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,C)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:C}}})},onFiltersChange:n=>{e(Ln({filters:n}))},onReloadPayments:()=>{e(vt(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(Bn({uiState:{downloadState:n}}))}}})(br);function ss(){const e=le(),t=ge(),a=ue(),{areTenantIdsInSync:r}=Vt(),{useFeatureGate:n}=se();if(J.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const C=y(q=>ce(q)),m=y(q=>Ft(q)),[f,A]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,R]=c.useState(null),F=!C.userRole.includes("charge_card_user"),D=!!C.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=n(z.isChargeCardFeatureEnabled),{isFeatureEnabled:b}=n(z.isDebitCardFeatureEnabled),g=Se(b,C),d=Ie({isDebitCardFeatureEnabled:b,isBankingOnlyTenant:g}),_=be(C),v=ye(C),N=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:p,isBookKeepingTenant:v,isDebitCardProductVisible:d,chargeCardsCreditAccountLimit:N}),w=!!C.companyChargeCardInfo?.info?.isChargeCardEnabled,V=je(),u=Re(V?.loggedInUserRoleMap),l=y(q=>Ke(q,F,d&&D,L&&w)),P=c.useMemo(()=>{const q=l.cards.filter($=>$.type.code.includes("debit"));return[...new Set(q.map($=>$.connectedAccountId))]},[l.cards]),T=y(q=>Ze(q)),H=y(q=>va(q,P)),{creditAccountRepayment:U}=y(q=>Ye(q)),K=c.useMemo(()=>Ja(u,T),[u,T]),I=c.useMemo(()=>Ca(L,w,u,l.creditAccount,U),[L,w,u,l.creditAccount,U]),B=c.useMemo(()=>et(d,D,u,H,l.debitCardSummary),[d,D,u,H,l.debitCardSummary]),j=c.useMemo(()=>Oe(L,d,D,w),[L,d,D,w]),O=l.creditAccount.balance.amount+l.creditAccount.hold.amount,W=c.useMemo(()=>h!=null?m.repaymentHistory.find(q=>q.cardRepaymentId===h):void 0,[h,m.repaymentHistory]),k=c.useCallback(q=>{R(q),a(Ia(F,d&&D,L&&w,!1)),S(!0)},[a,F,d,D,L,w]),Y=c.useCallback(()=>{S(!1),R(null),document.body.style.overflow="auto"},[]);return c.useEffect(()=>{f||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(A(!0),a(vt()))},[f,a,m.fetchState]),c.useEffect(()=>{!o&&(w||D)&&r&&(i(!0),a(Ia(F,!1,L&&w,!1)))},[o,w,D,r,a,F,L]),s.jsxs(s.Fragment,{children:[E?s.jsx(at,{closeDrawerHandler:Y,isPaymentDrawerOpen:E,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:O,productInformation:j,creditAccountInformation:I,debitAccountInformation:B,cashbackInformation:K,isDebitCardInfoFetchStateCompleted:!(d&&D&&u)||H.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!L||U.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!u||T.fetchState==="Completed",paymentInitiatedDate:U.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(rs,{location:t,navigate:e,accountInfoByAccountId:m.accountInfoByAccountId,onRetryPaymentClick:k})]})}const ct=_e.div`
26
26
  display: flex;
27
27
  height: 100vh;
28
28
  width: 100%;
@@ -31,7 +31,7 @@ import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as le,i as ca,u as ue,j as
31
31
  overflow: auto;
32
32
  align-items: center;
33
33
  background-color: ${e=>e.theme.colors.grey4};
34
- `,dt=qa.getLocalizedStrings().months;function os(){const e=le(),t=ue(),a=fe(),{creditAccount:r,creditAccountRepayment:n}=y(I=>Ye(I)),C=`${Nt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[m,g]=c.useState(!1),[A,o]=c.useState(!1),i=y(I=>Un(I)),{useFeatureGate:E}=se(),S=y(I=>ce(I)),{isFeatureEnabled:h}=E(z.isChargeCardFeatureEnabled),{isFeatureEnabled:R}=E(z.isDebitCardFeatureEnabled),F=Se(R,S),D=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:F}),p=be(S),b=ye(S),f=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:p,isChargeCardFeatureEnabled:h,isBookKeepingTenant:b,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:f}),_=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,v=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,N=y(I=>$e(I,S.companyId)),L=ze(N.controllers),w=y(I=>xt(I)),V=w.cards.filter(I=>I.type.code.includes("debit")).map(I=>I.connectedAccountId),u=[...new Set(V)],l=y(I=>va(I,u)),P=y(I=>Rn(I));c.useEffect(()=>{A||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),t(Ga()))},[m,t,r.fetchState]),c.useEffect(()=>{A||r.fetchState!=="Completed"||r.id==null||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(o(!0),t(On(r.id)))},[A,t,r.fetchState,r.id,i.fetchState]),c.useEffect(()=>{l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&D&&_&&t(Bt()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&t(ia()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&D&&_&&t(jn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&d&&v&&t($a())},[l.fetchState,D,_,w.fetchState,P.fetchState,n.fetchState,d,v]),c.useEffect(()=>{if(i.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&w.fetchState==="Completed"&&(!D||!_||l.fetchState==="Completed"&&P.fetchState==="Completed")){let I="",B="";if(i.statements.length>0){const k=i.statements[i.statements.length-1].period,[Y,q]=k.split("-"),$=i.statements[0].period,[x,oe]=$.split("-");I=`${dt[parseInt(q)-1]} ${Y}`,B=`${dt[parseInt(oe)-1]} ${x}`}const j=Oe(d,D,_,v),O=Ca(d,v,!0,r,n),W=et(D,_,!0,l,P);Q.trackCardsCreditCardStatementsView(L,j,{numberOfStatements:i.statements.length,oldestStatementMonthYear:I,latestStatementMonthYear:B},O,W)}},[i.fetchState,r.fetchState,n.fetchState,l.fetchState,w.fetchState,P.fetchState]);const T=()=>{const I=ve(a.state?.pathnameStackToGoBack),B=I.poppedPathname??"..";e(B,{state:{pathnameStackToGoBack:I.newStack}})},H=y(I=>Ze(I)),U=J.getSignedInUser(),K={userId:U?.userId??"",sessionId:U?.zeniSessionId??"",tenantId:S.tenantId??""};if(U==null)throw Error("Can't access address page without signing in...");if(i.fetchState!=="Completed")return s.jsx(ct,{children:s.jsx(yr,{onBackClick:T})});{const I=Oe(d,D,_,v);return s.jsx(ct,{children:s.jsx(Sr,{currentTenantCompanyName:S.companyName,statementListView:i,productInformation:I,onBackClick:T,authParams:K,controllerEmails:L,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:v,chargeCardCashbackDetailState:H,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:l,debitCardSummary:P,downloadEndPoint:C})})}}const is={containerWidth:new ma(100,58)},cs=({appContent:e})=>{const t=ua(),a=ue(),r=le(),n=fe(),{useDynamicConfig:C}=se(),[m,g]=c.useState(!1),[A,o]=c.useState(!1),[i,E]=c.useState(!1),[S,h]=c.useState(!1),[R,F]=c.useState(!1),[D,p]=c.useState(!1),b=J.getSignedInUser();if(b==null)throw Error("Can't access onboarding card page without signing in...");const f=y(O=>ce(O)),{configValue:d}=C(Fe.zeniCardsConfig),_=y(O=>Nn(O)),{tenantEmailDomain:v}=f,N=y(O=>O.settingsViewState.profile.fetchState),L=y(O=>O.chargeCardListState.fetchState),w=y(O=>O.settingsViewState.profile.userId),V=y(O=>O.chargeCardConfigState.fetchState);c.useEffect(()=>{m===!1&&N!=="In-Progress"&&N!=="Completed"&&(a(Vn()),g(!0)),A===!1&&V!=="In-Progress"&&V!=="Completed"&&(a(Da()),o(!0)),i===!1&&L==="Not-Started"&&(E(!0),a(ia()))},[m,i,L,A,V]),c.useEffect(()=>{N==="Completed"&&R===!1&&w!=null&&L==="Completed"&&_.cards.length>0&&(a(Hn({userId:w})),a(Lt({cardId:_.cards[_.cards.length-1].id})),F(!0))},[N,R,w,L]),c.useEffect(()=>{if(!S&&_.fetchState==="Completed"&&_.cards.length===0){const O=ve(n.state?.pathnameStackToGoBack),W=O.poppedPathname??Ne(v);r(W,{state:{pathnameStackToGoBack:O.newStack}})}},[_.fetchState,_.cards,S]);const u=y(O=>ka(O)),l=Qa(u.updateStatus.fetchState),P=u.currentDisplayedCardId,{useFeatureGate:T}=se(),{isFeatureEnabled:H}=T(z.isChargeCardFeatureEnabled),U=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,K=!f.userRole.includes("charge_card_user")&&H&&U,I=y(O=>P!=null?Ut(O.chargeCardState,P):null),B=()=>{P!=null&&(a(Je(P,K,!0)),a(ia()),h(!0))};c.useEffect(()=>{if(S&&P!=null&&I!=null&&I.status.code!=="request_on_hold"){const O=Ce(f.tenantEmailDomain,P,b,I),W=ge(n.state?.pathnameStackToGoBack,n.pathname);a(Mn()),I?.type.code==="business_virtual_credit_card"&&a(_a()),r(O,{state:{pathnameStackToGoBack:W},replace:!0})}},[S,I?.status.code]),c.useEffect(()=>{l==="In-Progress"&&u.updateStatus.fetchState==="Completed"&&setTimeout(B,3e3)},[l,u.updateStatus.fetchState]);const j=O=>{p(O)};if(!S&&L!=="Completed"||N!=="Completed"||_.cards.length===0)return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:j}),s.jsx(Ir,{})]});if(w==null)throw Error("Can't access my userId.");return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:j}),s.jsx(ds,{chargeCardListView:_,cardUserOnboardingView:u,navigate:r,currentTenant:f,myUserId:w,location:n,chargeCardCashbackRatePerTransaction:d.charge_card_cashback_rate_per_transaction!=null?d.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{j(!0)}}),e!=null?s.jsx(ls,{windowSize:t,children:e}):null]})},ds=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{cards:r.cards,showMenuIcon:m,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:C}=t,{tenantEmailDomain:m}=C;return{updateCardUserOnboardingLocalData:g=>{e(rt({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const A={...r.cardUserOnboardingLocalData,phone:g};e(rt({localData:A}))}e(Ta(g,"CardUserOnboarding"))},onResendOtp:g=>{e(wa(g,"CardUserOnboarding"))},onVerifyOtp:(g,A)=>{e(Pa(g,A,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(Gn()),g!=null&&J.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(Lt({cardId:g}))},onBackClick:()=>{const g=ve(n.state?.pathnameStackToGoBack),A=g.poppedPathname??Ne(m);a(A,{state:{pathnameStackToGoBack:g.newStack}})}}})(Ar),ls=_e.div`
34
+ `,dt=qa.getLocalizedStrings().months;function os(){const e=le(),t=ue(),a=ge(),{creditAccount:r,creditAccountRepayment:n}=y(I=>Ye(I)),C=`${Nt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[m,f]=c.useState(!1),[A,o]=c.useState(!1),i=y(I=>Un(I)),{useFeatureGate:E}=se(),S=y(I=>ce(I)),{isFeatureEnabled:h}=E(z.isChargeCardFeatureEnabled),{isFeatureEnabled:R}=E(z.isDebitCardFeatureEnabled),F=Se(R,S),D=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:F}),p=be(S),b=ye(S),g=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:p,isChargeCardFeatureEnabled:h,isBookKeepingTenant:b,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:g}),_=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,v=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,N=y(I=>$e(I,S.companyId)),L=ze(N.controllers),w=y(I=>xt(I)),V=w.cards.filter(I=>I.type.code.includes("debit")).map(I=>I.connectedAccountId),u=[...new Set(V)],l=y(I=>va(I,u)),P=y(I=>Rn(I));c.useEffect(()=>{A||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(f(!0),t(Ga()))},[m,t,r.fetchState]),c.useEffect(()=>{A||r.fetchState!=="Completed"||r.id==null||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(o(!0),t(On(r.id)))},[A,t,r.fetchState,r.id,i.fetchState]),c.useEffect(()=>{l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&D&&_&&t(Bt()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&t(ia()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&D&&_&&t(jn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&d&&v&&t($a())},[l.fetchState,D,_,w.fetchState,P.fetchState,n.fetchState,d,v]),c.useEffect(()=>{if(i.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&w.fetchState==="Completed"&&(!D||!_||l.fetchState==="Completed"&&P.fetchState==="Completed")){let I="",B="";if(i.statements.length>0){const k=i.statements[i.statements.length-1].period,[Y,q]=k.split("-"),$=i.statements[0].period,[x,oe]=$.split("-");I=`${dt[parseInt(q)-1]} ${Y}`,B=`${dt[parseInt(oe)-1]} ${x}`}const j=Oe(d,D,_,v),O=Ca(d,v,!0,r,n),W=et(D,_,!0,l,P);Q.trackCardsCreditCardStatementsView(L,j,{numberOfStatements:i.statements.length,oldestStatementMonthYear:I,latestStatementMonthYear:B},O,W)}},[i.fetchState,r.fetchState,n.fetchState,l.fetchState,w.fetchState,P.fetchState]);const T=()=>{const I=ve(a.state?.pathnameStackToGoBack),B=I.poppedPathname??"..";e(B,{state:{pathnameStackToGoBack:I.newStack}})},H=y(I=>Ze(I)),U=J.getSignedInUser(),K={userId:U?.userId??"",sessionId:U?.zeniSessionId??"",tenantId:S.tenantId??""};if(U==null)throw Error("Can't access address page without signing in...");if(i.fetchState!=="Completed")return s.jsx(ct,{children:s.jsx(yr,{onBackClick:T})});{const I=Oe(d,D,_,v);return s.jsx(ct,{children:s.jsx(Sr,{currentTenantCompanyName:S.companyName,statementListView:i,productInformation:I,onBackClick:T,authParams:K,controllerEmails:L,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:v,chargeCardCashbackDetailState:H,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:l,debitCardSummary:P,downloadEndPoint:C})})}}const is={containerWidth:new ma(100,58)},cs=({appContent:e})=>{const t=ua(),a=ue(),r=le(),n=ge(),{useDynamicConfig:C}=se(),[m,f]=c.useState(!1),[A,o]=c.useState(!1),[i,E]=c.useState(!1),[S,h]=c.useState(!1),[R,F]=c.useState(!1),[D,p]=c.useState(!1),b=J.getSignedInUser();if(b==null)throw Error("Can't access onboarding card page without signing in...");const g=y(O=>ce(O)),{configValue:d}=C(Fe.zeniCardsConfig),_=y(O=>Nn(O)),{tenantEmailDomain:v}=g,N=y(O=>O.settingsViewState.profile.fetchState),L=y(O=>O.chargeCardListState.fetchState),w=y(O=>O.settingsViewState.profile.userId),V=y(O=>O.chargeCardConfigState.fetchState);c.useEffect(()=>{m===!1&&N!=="In-Progress"&&N!=="Completed"&&(a(Vn()),f(!0)),A===!1&&V!=="In-Progress"&&V!=="Completed"&&(a(Da()),o(!0)),i===!1&&L==="Not-Started"&&(E(!0),a(ia()))},[m,i,L,A,V]),c.useEffect(()=>{N==="Completed"&&R===!1&&w!=null&&L==="Completed"&&_.cards.length>0&&(a(Hn({userId:w})),a(Lt({cardId:_.cards[_.cards.length-1].id})),F(!0))},[N,R,w,L]),c.useEffect(()=>{if(!S&&_.fetchState==="Completed"&&_.cards.length===0){const O=ve(n.state?.pathnameStackToGoBack),W=O.poppedPathname??Ne(v);r(W,{state:{pathnameStackToGoBack:O.newStack}})}},[_.fetchState,_.cards,S]);const u=y(O=>ka(O)),l=Qa(u.updateStatus.fetchState),P=u.currentDisplayedCardId,{useFeatureGate:T}=se(),{isFeatureEnabled:H}=T(z.isChargeCardFeatureEnabled),U=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,K=!g.userRole.includes("charge_card_user")&&H&&U,I=y(O=>P!=null?Ut(O.chargeCardState,P):null),B=()=>{P!=null&&(a(Je(P,K,!0)),a(ia()),h(!0))};c.useEffect(()=>{if(S&&P!=null&&I!=null&&I.status.code!=="request_on_hold"){const O=Ce(g.tenantEmailDomain,P,b,I),W=fe(n.state?.pathnameStackToGoBack,n.pathname);a(Mn()),I?.type.code==="business_virtual_credit_card"&&a(_a()),r(O,{state:{pathnameStackToGoBack:W},replace:!0})}},[S,I?.status.code]),c.useEffect(()=>{l==="In-Progress"&&u.updateStatus.fetchState==="Completed"&&setTimeout(B,3e3)},[l,u.updateStatus.fetchState]);const j=O=>{p(O)};if(!S&&L!=="Completed"||N!=="Completed"||_.cards.length===0)return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:j}),s.jsx(Ir,{})]});if(w==null)throw Error("Can't access my userId.");return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:j}),s.jsx(ds,{chargeCardListView:_,cardUserOnboardingView:u,navigate:r,currentTenant:g,myUserId:w,location:n,chargeCardCashbackRatePerTransaction:d.charge_card_cashback_rate_per_transaction!=null?d.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{j(!0)}}),e!=null?s.jsx(ls,{windowSize:t,children:e}):null]})},ds=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{cards:r.cards,showMenuIcon:m,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:C}=t,{tenantEmailDomain:m}=C;return{updateCardUserOnboardingLocalData:f=>{e(rt({localData:f}))},onGetOtp:f=>{if(r.cardUserOnboardingLocalData!=null){const A={...r.cardUserOnboardingLocalData,phone:f};e(rt({localData:A}))}e(Ta(f,"CardUserOnboarding"))},onResendOtp:f=>{e(wa(f,"CardUserOnboarding"))},onVerifyOtp:(f,A)=>{e(Pa(f,A,"CardUserOnboarding"))},onVerifyOtpSuccess:f=>{e(Gn()),f!=null&&J.saveZeniOtpToken(f)},setCurrentDisplayedCardId:f=>{e(Lt({cardId:f}))},onBackClick:()=>{const f=ve(n.state?.pathnameStackToGoBack),A=f.poppedPathname??Ne(m);a(A,{state:{pathnameStackToGoBack:f.newStack}})}}})(Ar),ls=_e.div`
35
35
  display: flex;
36
36
  flex-direction: column;
37
37
  width: ${e=>`${is.containerWidth.value(e.windowSize)}%`};
@@ -44,7 +44,7 @@ import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as le,i as ca,u as ue,j as
44
44
  flex-direction: column;
45
45
  align-items: center;
46
46
  background-color: ${e=>e.theme.colors.grey4};
47
- `,us={containerWidth:new ma(100,58)},ms=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=fe(),{useDynamicConfig:m,useFeatureGate:g}=se(),[A,o]=c.useState(!1),[i,E]=c.useState(!1),[S,h]=c.useState(!1),[R,F]=c.useState(!1),D=J.getSignedInUser();if(D==null)throw Error("Can't access onboarding card page without signing in...");const p=y(B=>ce(B));if(n==null)throw Error("Empty card id is not valid...");const{configValue:b}=m(Fe.zeniCardsConfig),f=y(B=>$n(B,n)),{isFeatureEnabled:d}=g(z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=g(z.isDebitCardFeatureEnabled),v=Se(_,p),N=Ie({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:v}),L=be(p),w=ye(p),V=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,u=Ae({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:d,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:V}),l=f.chargeCard,P=y(B=>B.chargeCardConfigState.fetchState);c.useEffect(()=>{A===!1&&P!=="In-Progress"&&P!=="Completed"&&(a(Da()),o(!0)),i===!1&&f.fetchState==="Not-Started"&&(E(!0),a(Je(n,!1,u)))},[i,f.fetchState,A,P]);const T=l?.type.code==="business_physical_debit_card"||l?.type.code==="business_virtual_debit_card";c.useEffect(()=>{if(f.fetchState==="Completed"){if(S===!1&&(T===!1||T&&l.status?.code!=="active"||T&&l.status.code==="active"&&l.isPinSet||l.cardHolderUserId!==D.userId)){const B=Ce(p.tenantEmailDomain,n,D,l,!0),j=ge(C.state?.pathnameStackToGoBack,C.pathname);r(B,{state:{pathnameStackToGoBack:j}})}else if(S&&f.isRefreshingViewInBackground===!1&&l?.isPinSet===!0){a(zn({chargeCardId:n}));const B=Ce(p.tenantEmailDomain,n,D,l,!0),j=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(B,{state:{pathnameStackToGoBack:j}})}}},[f.fetchState,l?.type.code,S,f.isRefreshingViewInBackground]);const H=J.getZeniOtpTokenForCardHolder(n),U=y(B=>pt(B.userState,D.userId)),K=()=>{l?.isPinSet!==!0&&a(za(n,!0))};c.useEffect(()=>{f.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(K,3e3),h(!0))},[f.updateDebitCardPinAttemptFetchState.fetchState]);const I=B=>{F(B)};if(P!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(U?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(hs,{children:[s.jsx(Ge,{isAppContentDrawerOpen:R,handleDrawerToggle:I}),s.jsx(Cs,{cardId:n,card:l,phone:U.phone,signedInUser:D,isSandboxEnv:Ka(),debitCardDetailState:f,signedInUserToken:H,navigate:r,currentTenant:p,location:C,chargeCardCashbackRatePerTransaction:b.charge_card_cashback_rate_per_transaction!=null?b.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?s.jsx(ps,{windowSize:t,children:e}):null]})},Cs=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=ht(e,a),n=t.updateStatus,C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{showMenuIcon:m,vgsVaultId:Ba.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,debitCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:A}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(It(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Yn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ne(A):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Er),ps=_e.div`
47
+ `,us={containerWidth:new ma(100,58)},ms=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m,useFeatureGate:f}=se(),[A,o]=c.useState(!1),[i,E]=c.useState(!1),[S,h]=c.useState(!1),[R,F]=c.useState(!1),D=J.getSignedInUser();if(D==null)throw Error("Can't access onboarding card page without signing in...");const p=y(B=>ce(B));if(n==null)throw Error("Empty card id is not valid...");const{configValue:b}=m(Fe.zeniCardsConfig),g=y(B=>$n(B,n)),{isFeatureEnabled:d}=f(z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=f(z.isDebitCardFeatureEnabled),v=Se(_,p),N=Ie({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:v}),L=be(p),w=ye(p),V=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,u=Ae({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:d,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:V}),l=g.chargeCard,P=y(B=>B.chargeCardConfigState.fetchState);c.useEffect(()=>{A===!1&&P!=="In-Progress"&&P!=="Completed"&&(a(Da()),o(!0)),i===!1&&g.fetchState==="Not-Started"&&(E(!0),a(Je(n,!1,u)))},[i,g.fetchState,A,P]);const T=l?.type.code==="business_physical_debit_card"||l?.type.code==="business_virtual_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(S===!1&&(T===!1||T&&l.status?.code!=="active"||T&&l.status.code==="active"&&l.isPinSet||l.cardHolderUserId!==D.userId)){const B=Ce(p.tenantEmailDomain,n,D,l,!0),j=fe(C.state?.pathnameStackToGoBack,C.pathname);r(B,{state:{pathnameStackToGoBack:j}})}else if(S&&g.isRefreshingViewInBackground===!1&&l?.isPinSet===!0){a(zn({chargeCardId:n}));const B=Ce(p.tenantEmailDomain,n,D,l,!0),j=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(B,{state:{pathnameStackToGoBack:j}})}}},[g.fetchState,l?.type.code,S,g.isRefreshingViewInBackground]);const H=J.getZeniOtpTokenForCardHolder(n),U=y(B=>pt(B.userState,D.userId)),K=()=>{l?.isPinSet!==!0&&a(za(n,!0))};c.useEffect(()=>{g.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(K,3e3),h(!0))},[g.updateDebitCardPinAttemptFetchState.fetchState]);const I=B=>{F(B)};if(P!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(U?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(hs,{children:[s.jsx(Ge,{isAppContentDrawerOpen:R,handleDrawerToggle:I}),s.jsx(Cs,{cardId:n,card:l,phone:U.phone,signedInUser:D,isSandboxEnv:Ka(),debitCardDetailState:g,signedInUserToken:H,navigate:r,currentTenant:p,location:C,chargeCardCashbackRatePerTransaction:b.charge_card_cashback_rate_per_transaction!=null?b.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?s.jsx(ps,{windowSize:t,children:e}):null]})},Cs=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=ht(e,a),n=t.updateStatus,C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{showMenuIcon:m,vgsVaultId:Ba.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,debitCardDetailState:m}=t,f=m.chargeCard?.cardProviderID,{tenantEmailDomain:A}=C;return{onGetOtp:o=>{f!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(It(r,o))},onResendOtp:o=>{f!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{f!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Yn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ne(A):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Er),ps=_e.div`
48
48
  display: flex;
49
49
  flex-direction: column;
50
50
  width: ${e=>`${us.containerWidth.value(e.windowSize)}%`};
@@ -59,7 +59,7 @@ import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as le,i as ca,u as ue,j as
59
59
  align-items: center;
60
60
  background-color: ${e=>e.theme.colors.grey4};
61
61
  box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
62
- `,gs={overlayWidth:new ma(Ra[12],Ra[12],Ra[9])},fs=pe(function(e,t){const a=Za(e,!1,!1),r=t.lineId,n=a.customAddress[r],C=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:C,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:C=>{a!=null&&e(Rt(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const m=jr(C);e(Wn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:m})),e(qn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Kn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(kr),bs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=ua(),C=()=>{t()},m=y(g=>Zn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(Mt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:gs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,A)=>(A==="backdropClick"||A==="escapeKeyDown")&&C(),children:s.jsx(fs,{googleAPIKey:Ba.googleMapsAPIKey,onDismissClick:C,lineId:e,chargeCardTypeOption:a,newCustomAddressId:m})})},ys=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g}=t,A=Za(e,a&&m,r&&g);return{companyName:t.companyName,signedInUser:t.signedInUser,issueChargeCards:A,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g,cardHolderCandidates:A.userList.map(o=>o.user).filter(Boolean),allRoles:A.userList.map(o=>o.userRole),allAccountingClasses:A.allAccountingClasses,userList:A.userList}},function(e,t){return{onIssueCardClick:()=>{e(Jn())},onSaveChangesToLocalStore:a=>{e(Xn(a))},onDismissClick:()=>{e(Ot()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Rt(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(Pr);function Ss(){const e=J.getSignedInUser(),t=le(),a=ue(),r=Dr(),[n]=ut(),C=n.get("cardType"),{useFeatureGate:m}=se(),{isFeatureEnabled:g}=m(z.isIssuePhysicalCardEnabled),{isFeatureEnabled:A}=m(z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=m(z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(z.isChargeCardFeatureEnabled),E=y(I=>ce(I)),S=Se(o,E),h=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:S}),R=be(E),F=ye(E),D=E.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=Ae({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:i,isBookKeepingTenant:F,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:D}),[b,f]=c.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");c.useEffect(()=>{b||(f(!0),a(Qn(h&&_,p&&d,!1)))},[b,f,a]);const d=!!E.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!E.companyDebitCardInfo?.info?.isDebitCardEnabled,v=E.companyName,N=y(I=>Za(I,p&&d,h&&_)),L=N.fetchState,w=N.issueCardStatus.fetchState,V=N.lastSelfIssuedDebitCardId,u=y(I=>V!=null?Ut(I.chargeCardState,V):void 0),[l,P]=c.useState(null),[T,H]=c.useState(null),U=()=>{P(null)},K=(I,B)=>{P(I),H(B)};return c.useEffect(()=>{if(w==="Completed"){if(V!=null&&u?.type.code==="business_virtual_debit_card"){let I;I=u?.status.code==="request_on_hold"&&e.userId===u.cardHolderUserId?Yt(E.tenantEmailDomain):Ce(E.tenantEmailDomain,V,e,u),t(I)}else t("../");a(Ot())}},[w,V]),L==="Completed"?s.jsxs(s.Fragment,{children:[l!==null&&T!==null?s.jsx(bs,{closeDrawerHandler:U,lineId:l,chargeCardTypeOption:T}):null,s.jsx(ys,{companyName:v,signedInUser:e,themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:A,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:d,isDebitCardSetupEnabled:_,navigate:t,fetchState:N.fetchState,openAddAddressDrawerHandler:K,defaultCardType:C==="creditCard"||C==="debitCard"?C:void 0})]}):L==="Error"?s.jsx(La,{}):s.jsx(_r,{})}const Is=_e.div`
62
+ `,fs={overlayWidth:new ma(Ra[12],Ra[12],Ra[9])},gs=pe(function(e,t){const a=Za(e,!1,!1),r=t.lineId,n=a.customAddress[r],C=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:C,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:C=>{a!=null&&e(Rt(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const m=jr(C);e(Wn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:m})),e(qn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Kn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(kr),bs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=ua(),C=()=>{t()},m=y(f=>Zn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,f))?.newAddressId;return s.jsx(Mt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:fs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(f,A)=>(A==="backdropClick"||A==="escapeKeyDown")&&C(),children:s.jsx(gs,{googleAPIKey:Ba.googleMapsAPIKey,onDismissClick:C,lineId:e,chargeCardTypeOption:a,newCustomAddressId:m})})},ys=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:f}=t,A=Za(e,a&&m,r&&f);return{companyName:t.companyName,signedInUser:t.signedInUser,issueChargeCards:A,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:f,cardHolderCandidates:A.userList.map(o=>o.user).filter(Boolean),allRoles:A.userList.map(o=>o.userRole),allAccountingClasses:A.allAccountingClasses,userList:A.userList}},function(e,t){return{onIssueCardClick:()=>{e(Jn())},onSaveChangesToLocalStore:a=>{e(Xn(a))},onDismissClick:()=>{e(Ot()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Rt(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(Pr);function Ss(){const e=J.getSignedInUser(),t=le(),a=ue(),r=Dr(),[n]=ut(),C=n.get("cardType"),{useFeatureGate:m}=se(),{isFeatureEnabled:f}=m(z.isIssuePhysicalCardEnabled),{isFeatureEnabled:A}=m(z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=m(z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(z.isChargeCardFeatureEnabled),E=y(I=>ce(I)),S=Se(o,E),h=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:S}),R=be(E),F=ye(E),D=E.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=Ae({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:i,isBookKeepingTenant:F,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:D}),[b,g]=c.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");c.useEffect(()=>{b||(g(!0),a(Qn(h&&_,p&&d,!1)))},[b,g,a]);const d=!!E.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!E.companyDebitCardInfo?.info?.isDebitCardEnabled,v=E.companyName,N=y(I=>Za(I,p&&d,h&&_)),L=N.fetchState,w=N.issueCardStatus.fetchState,V=N.lastSelfIssuedDebitCardId,u=y(I=>V!=null?Ut(I.chargeCardState,V):void 0),[l,P]=c.useState(null),[T,H]=c.useState(null),U=()=>{P(null)},K=(I,B)=>{P(I),H(B)};return c.useEffect(()=>{if(w==="Completed"){if(V!=null&&u?.type.code==="business_virtual_debit_card"){let I;I=u?.status.code==="request_on_hold"&&e.userId===u.cardHolderUserId?Yt(E.tenantEmailDomain):Ce(E.tenantEmailDomain,V,e,u),t(I)}else t("../");a(Ot())}},[w,V]),L==="Completed"?s.jsxs(s.Fragment,{children:[l!==null&&T!==null?s.jsx(bs,{closeDrawerHandler:U,lineId:l,chargeCardTypeOption:T}):null,s.jsx(ys,{companyName:v,signedInUser:e,themeState:r,isIssuePhysicalCardEnabled:f,isIssuePhysicalDebitCardEnabled:A,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:d,isDebitCardSetupEnabled:_,navigate:t,fetchState:N.fetchState,openAddAddressDrawerHandler:K,defaultCardType:C==="creditCard"||C==="debitCard"?C:void 0})]}):L==="Error"?s.jsx(La,{}):s.jsx(_r,{})}const Is=_e.div`
63
63
  display: flex;
64
64
  height: 100vh;
65
65
  width: 100%;
@@ -68,4 +68,4 @@ import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as le,i as ca,u as ue,j as
68
68
  overflow: auto;
69
69
  align-items: center;
70
70
  background-color: ${e=>e.theme.colors.grey4};
71
- `,As=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:C,myPendingActivationChargeCardListState:m}=t,{tenantEmailDomain:g}=r,{cards:A}=m;return{onChargeCardRowClick:o=>{const i=zt(A,o),E=Ce(g,o,C,i),S=ge(n.state?.pathnameStackToGoBack,n.pathname);a(E,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(o,i)=>{e(Na({uiState:{sortKey:o,sortOrder:i}}))},onReloadCards:()=>{e(ia())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Na({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(wr);function Es(){const e=le(),t=ue(),a=fe(),r=Wa(),[n,C]=c.useState(!1),m=y(T=>er(T)),g=y(T=>ce(T)),A=y(T=>$e(T,g.companyId)),o=ze(A.controllers),{useFeatureGate:i}=se(),{isFeatureEnabled:E}=i(z.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=i(z.isDebitCardFeatureEnabled),h=Se(S,g),R=Ie({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:h}),F=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,D=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,p=je(),b=be(g),f=ye(g),d=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:E,isBookKeepingTenant:f,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:d}),v=Re(p?.loggedInUserRoleMap),N=y(T=>Ze(T)),{creditAccount:L,creditAccountRepayment:w}=y(T=>Ye(T)),V=y(T=>xt(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),u=[...new Set(V)],l=y(T=>va(T,u));c.useEffect(()=>{n||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(C(!0),t(ia()),t(Da()))},[n,t,m.fetchState]),c.useEffect(()=>{if(m.fetchState==="Completed"&&m.cards.length===1&&P!=null){const T=Ce(g.tenantEmailDomain,m.cards[0].id,P,m.cards[0]);e(T,{state:{message:a.state?.message}})}},[m.fetchState,m.cards]);const P=J.getSignedInUser();if(c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&_&&D&&v&&t(Ga()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&v&&t($a()),l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&R&&F&&v&&t(Bt())},[L.fetchState,w.fetchState,t,l.fetchState,R,F,v,_,D]),P==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return s.jsx(la,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const T=Oe(_,R,F,D);return s.jsx(Is,{children:s.jsx(As,{navigate:e,currentTenant:g,signedInUser:P,productInformation:T,myPendingActivationChargeCardListState:m,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:R,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:D,chargeCardCashbackDetailState:N,creditAccount:L,creditAccountRepayment:w,depositAccountListWithDebitCardIssued:l,controllerEmails:o,location:a})})}}const ks=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:C,isChargeCardSetupEnabled:m,signedInUser:g,location:A,productInformation:o,isEarlyPayEnabled:i,controllerEmails:E,chargeCardsCreditAccountLimit:S}=t;return{onSetupButtonClick:h=>{if(g!=null&&Q.trackCardsPromoPageClicked("enable cards"),n)switch(Q.trackCardsEnableCardsClick(E,o,"Cards Promo"),h){case"credit":e(Ue(r,!0,"charge_cards",i,!1));break;case"debit":e(Ue(r,!0,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Ue(r,!0,"debit_cards",i,!0):Ue(r,!0,"charge_cards__debit_cards",i,!1))}else switch(Q.trackCardsSetupCardsClick(E,o,"Cards Promo"),h){case"credit":e(Ue(r,!1,"charge_cards",i,!1));break;case"debit":e(Ue(r,!1,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Ue(r,!1,"debit_cards",i,!0):Ue(r,!1,"charge_cards__debit_cards",i,!1))}},onBackClick:()=>{const h=ve(A.state?.pathnameStackToGoBack);let R=h.poppedPathname;R==null&&(R=C||m?"..":"../.."),a(R,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(nr(r))}}})(Fr),Ds=()=>{const e=le(),{tenantEmailDomain:t}=ca(),[a]=ut(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:C,useFeatureGate:m}=se(),[g,A]=c.useState(!1),{isFeatureEnabled:o}=m(z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:E}=m(z.isChargeCardFeatureEnabled),{configValue:S}=C(Fe.zeniCardsConfig),h=y(ee=>ce(ee)),R=y(ee=>$e(ee,h.companyId)),F=ze(R.controllers),D=S.charge_card_cashback_rate_per_transaction!=null?S.charge_card_cashback_rate_per_transaction:.0175,p=fe(),b=J.getSignedInUserTenant(t)?.companyId??h.companyId,f=y(ee=>da(ee,b)),d=f.primaryFundingAccount,_=h.companyBillPayInfo?.info,v=be(h),N=ye(h),L=Se(o,h),w=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,V=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:L}),u=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:E,isBookKeepingTenant:N,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:w}),l=$t({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:E,isBookKeepingTenant:N}),P=V&&u===!1,T=_?.businessVerificationStatus?.code==="verified"&&(P||d?.accType==="depositAccount"||ar(d?.providerVerificationStatus?.code??"")),H=J.getSignedInUser(),U=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,K=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,I=!!h.company?.companyChargeCardInfo.isChargeCardEnabled,B=!!h.company?.companyDebitCardInfo.isDebitCardEnabled,j=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,O=ee=>{A(ee)},W=y(ee=>ee.chargeCardSetupViewState.fetchState);if(H==null)throw Error("Can't access Charge Card promo page without signing in...");const k=je(),Y=Re(k?.loggedInUserRoleMap),q=Ya(k?.loggedInUserRoleMap),[$,x]=c.useState(!1),[oe,ae]=c.useState(!1),[ne,X]=c.useState(!1);c.useEffect(()=>{$===!1&&p.state?.message==="activation"&&x(!0)},[p.state]),c.useEffect(()=>{oe||W!=="Not-Started"||b==null||(ae(!0),n(Fa(b,!0)))},[oe,W,b,n]);const re=h.companyChargeCardInfo?.info!=null&&Xe({cardInfo:h.companyChargeCardInfo.info,isProductVisible:l,isTOSAccepted:K,isSetupEnabled:I,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),Ee=h.companyDebitCardInfo?.info!=null&&Xe({cardInfo:h.companyDebitCardInfo.info,isProductVisible:V,isTOSAccepted:j,isSetupEnabled:B,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),xe=V&&Ee&&l&&w>=0&&re?"debit_and_credit":V&&Ee?"debit":"credit",Z=Rr(r,xe),he=f?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=c.useRef(null);c.useEffect(()=>{he==="In-Progress"?ke.current=Z:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,Z]);const Be=he!=="In-Progress"&&he!=="Completed"||ke.current==null?Z:ke.current;c.useEffect(()=>{Z==="credit"&&(I||l===!1&&B)||Z==="debit"&&B||Z==="debit_and_credit"&&B&&I?e("../"):(Z==="debit_and_credit"&&K===!0&&j===!0||Z==="credit"&&(K===!0||l===!1&&j===!0)||Z==="debit"&&j===!0)&&Y===!0&&e("../setup")},[T,I,B,Z,K,j]),c.useEffect(()=>{ne||(n(tr("cardAdmin")),X(!0))},[ne]);const Pe=y(ee=>Tt(ee.userState,ee.userRoleState,ee.userListViewState,"cardAdmin")),we=Oe(l,V,B,I);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{if(Q.trackPageLoaded(Ht.Event.cardsPromoPage),!!l&&!I||!!V&&!B||!!l&&!!V&&!B&&!I){const ee=_s({isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:I,isCreditCardProductVisibleForExpressInterest:l,isDebitCardProductVisible:V});Q.trackCardsPromoView(F,we,"Page",ee,"Promo Page")}}}),s.jsx(xa,{showConfetti:$}),s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:O}),s.jsx(ks,{signedInUser:H,location:p,showEnableCardButton:T,isCompanyBusinessVerificationAndPaymentSetUpDone:T,isChargeCardSetupEnabled:I,isDebitCardSetupEnabled:B,companyLegalName:h.companyName,adminList:Pe.users,isCheckingEnabled:U,navigate:e,companyId:b,cardPromoType:Be,controllerEmails:F,productInformation:we,isCreditCardProductVisible:u,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:i,cashbackRate:D,chargeCardsCreditAccountLimit:w,onClickMenuIcon:()=>{O(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:O}),s.jsx(Tr,{})]})},_s=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Qs(){const e=fe(),t=y(W=>ce(W)),{useFeatureGate:a}=se(),{isFeatureEnabled:r}=a(z.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(z.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=a(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:m}=a(z.isChargeCardPaymentHistoryFeatureEnabled),g=Se(n,t),A=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),o=vr(t,r,n),i=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,E=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,S=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,h=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,R=je(),F=Re(R?.loggedInUserRoleMap),D=Ya(R?.loggedInUserRoleMap),{isFeatureEnabled:p}=a(z.isCashbackFeatureEnabled),b=t.userRole.includes("charge_card_user"),f=!b,d=!b&&S,_=t?.userRole!=null&&rr(t?.userRole),v=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!_)&&sr(R?.loggedInUserRoleMap),N=or(R?.loggedInUserRoleMap),L=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!_)&&ir(R?.loggedInUserRoleMap),{isFeatureEnabled:w}=a(z.isDepositAccountsFeatureEnabled),V=w&&!_&&ft(R?.loggedInUserRoleMap),u=S&&!_,l=h&&!_,P=o&&!_&&Re(R?.loggedInUserRoleMap),T=cr(R?.loggedInUserRoleMap),H=be(t),U=ye(t),K=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Ae({isCardsOnlyTenant:H,isChargeCardFeatureEnabled:r,isBookKeepingTenant:U,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:K}),B=t.companyChargeCardInfo?.info!=null&&Xe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:I,isTOSAccepted:i,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:D}),j=t.companyDebitCardInfo?.info!=null&&Xe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:A,isTOSAccepted:E,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:D}),O=B||j;return s.jsxs(Wt,{children:[F?s.jsx(te,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:N,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(te,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isUserHasOnlyBillPayAccess:N,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:T,productType:"charge_cards",type:"verification"})}):null,s.jsx(te,{path:"promo",element:s.jsx(Ds,{})}),u||l?s.jsxs(s.Fragment,{children:[s.jsx(te,{path:"/",element:s.jsx(it,{isPaymentDrawerOpen:!1})}),P&&C?s.jsx(te,{path:"payment",element:s.jsx(it,{isPaymentDrawerOpen:!0})}):null,s.jsx(te,{path:"activate",element:s.jsx(Es,{})}),s.jsx(te,{path:"onboard",element:s.jsx(cs,{})}),F?s.jsx(te,{path:"new",element:s.jsx(Ss,{})}):null,p&&f?s.jsx(te,{path:"cashback",element:s.jsx(Hr,{})}):null,d?s.jsx(te,{path:"statements",element:s.jsx(os,{})}):null,P&&m&&S?s.jsx(te,{path:"payment-history",element:s.jsx(ss,{})}):null,s.jsx(te,{path:":cardId/activate",element:s.jsx($r,{})}),s.jsx(te,{path:":cardId/setPin",element:s.jsx(ms,{})}),s.jsx(te,{path:":cardId/addToWallet",element:s.jsx(Nr,{})}),s.jsx(te,{path:":cardId/*",element:s.jsx(Xr,{})}),s.jsx(te,{path:"*",element:s.jsx(La,{})})]}):(i||E)&&F?s.jsx(te,{path:"*",element:s.jsx(fa,{to:"../setup"})}):O?s.jsx(te,{path:"*",element:s.jsx(fa,{to:"../promo",state:e.state})}):s.jsx(te,{path:"*",element:null})]})}export{Qs as default};
71
+ `,As=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:C,myPendingActivationChargeCardListState:m}=t,{tenantEmailDomain:f}=r,{cards:A}=m;return{onChargeCardRowClick:o=>{const i=zt(A,o),E=Ce(f,o,C,i),S=fe(n.state?.pathnameStackToGoBack,n.pathname);a(E,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(o,i)=>{e(Na({uiState:{sortKey:o,sortOrder:i}}))},onReloadCards:()=>{e(ia())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Na({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(wr);function Es(){const e=le(),t=ue(),a=ge(),r=Wa(),[n,C]=c.useState(!1),m=y(T=>er(T)),f=y(T=>ce(T)),A=y(T=>$e(T,f.companyId)),o=ze(A.controllers),{useFeatureGate:i}=se(),{isFeatureEnabled:E}=i(z.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=i(z.isDebitCardFeatureEnabled),h=Se(S,f),R=Ie({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:h}),F=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,D=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,p=je(),b=be(f),g=ye(f),d=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:E,isBookKeepingTenant:g,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:d}),v=Re(p?.loggedInUserRoleMap),N=y(T=>Ze(T)),{creditAccount:L,creditAccountRepayment:w}=y(T=>Ye(T)),V=y(T=>xt(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),u=[...new Set(V)],l=y(T=>va(T,u));c.useEffect(()=>{n||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(C(!0),t(ia()),t(Da()))},[n,t,m.fetchState]),c.useEffect(()=>{if(m.fetchState==="Completed"&&m.cards.length===1&&P!=null){const T=Ce(f.tenantEmailDomain,m.cards[0].id,P,m.cards[0]);e(T,{state:{message:a.state?.message}})}},[m.fetchState,m.cards]);const P=J.getSignedInUser();if(c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&_&&D&&v&&t(Ga()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&v&&t($a()),l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&R&&F&&v&&t(Bt())},[L.fetchState,w.fetchState,t,l.fetchState,R,F,v,_,D]),P==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return s.jsx(la,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const T=Oe(_,R,F,D);return s.jsx(Is,{children:s.jsx(As,{navigate:e,currentTenant:f,signedInUser:P,productInformation:T,myPendingActivationChargeCardListState:m,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:R,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:D,chargeCardCashbackDetailState:N,creditAccount:L,creditAccountRepayment:w,depositAccountListWithDebitCardIssued:l,controllerEmails:o,location:a})})}}const ks=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:C,isChargeCardSetupEnabled:m,signedInUser:f,location:A,productInformation:o,isEarlyPayEnabled:i,controllerEmails:E,chargeCardsCreditAccountLimit:S}=t;return{onSetupButtonClick:h=>{if(f!=null&&Q.trackCardsPromoPageClicked("enable cards"),n)switch(Q.trackCardsEnableCardsClick(E,o,"Cards Promo"),h){case"credit":e(Ue(r,!0,"charge_cards",i,!1));break;case"debit":e(Ue(r,!0,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Ue(r,!0,"debit_cards",i,!0):Ue(r,!0,"charge_cards__debit_cards",i,!1))}else switch(Q.trackCardsSetupCardsClick(E,o,"Cards Promo"),h){case"credit":e(Ue(r,!1,"charge_cards",i,!1));break;case"debit":e(Ue(r,!1,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Ue(r,!1,"debit_cards",i,!0):Ue(r,!1,"charge_cards__debit_cards",i,!1))}},onBackClick:()=>{const h=ve(A.state?.pathnameStackToGoBack);let R=h.poppedPathname;R==null&&(R=C||m?"..":"../.."),a(R,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(nr(r))}}})(Fr),Ds=()=>{const e=le(),{tenantEmailDomain:t}=ca(),[a]=ut(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:C,useFeatureGate:m}=se(),[f,A]=c.useState(!1),{isFeatureEnabled:o}=m(z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:E}=m(z.isChargeCardFeatureEnabled),{configValue:S}=C(Fe.zeniCardsConfig),h=y(ee=>ce(ee)),R=y(ee=>$e(ee,h.companyId)),F=ze(R.controllers),D=S.charge_card_cashback_rate_per_transaction!=null?S.charge_card_cashback_rate_per_transaction:.0175,p=ge(),b=J.getSignedInUserTenant(t)?.companyId??h.companyId,g=y(ee=>da(ee,b)),d=g.primaryFundingAccount,_=h.companyBillPayInfo?.info,v=be(h),N=ye(h),L=Se(o,h),w=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,V=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:L}),u=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:E,isBookKeepingTenant:N,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:w}),l=$t({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:E,isBookKeepingTenant:N}),P=V&&u===!1,T=_?.businessVerificationStatus?.code==="verified"&&(P||d?.accType==="depositAccount"||ar(d?.providerVerificationStatus?.code??"")),H=J.getSignedInUser(),U=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,K=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,I=!!h.company?.companyChargeCardInfo.isChargeCardEnabled,B=!!h.company?.companyDebitCardInfo.isDebitCardEnabled,j=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,O=ee=>{A(ee)},W=y(ee=>ee.chargeCardSetupViewState.fetchState);if(H==null)throw Error("Can't access Charge Card promo page without signing in...");const k=je(),Y=Re(k?.loggedInUserRoleMap),q=Ya(k?.loggedInUserRoleMap),[$,x]=c.useState(!1),[oe,ae]=c.useState(!1),[ne,X]=c.useState(!1);c.useEffect(()=>{$===!1&&p.state?.message==="activation"&&x(!0)},[p.state]),c.useEffect(()=>{oe||W!=="Not-Started"||b==null||(ae(!0),n(Fa(b,!0)))},[oe,W,b,n]);const re=h.companyChargeCardInfo?.info!=null&&Xe({cardInfo:h.companyChargeCardInfo.info,isProductVisible:l,isTOSAccepted:K,isSetupEnabled:I,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),Ee=h.companyDebitCardInfo?.info!=null&&Xe({cardInfo:h.companyDebitCardInfo.info,isProductVisible:V,isTOSAccepted:j,isSetupEnabled:B,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),xe=V&&Ee&&l&&w>=0&&re?"debit_and_credit":V&&Ee?"debit":"credit",Z=Rr(r,xe),he=g?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=c.useRef(null);c.useEffect(()=>{he==="In-Progress"?ke.current=Z:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,Z]);const Be=he!=="In-Progress"&&he!=="Completed"||ke.current==null?Z:ke.current;c.useEffect(()=>{Z==="credit"&&(I||l===!1&&B)||Z==="debit"&&B||Z==="debit_and_credit"&&B&&I?e("../"):(Z==="debit_and_credit"&&K===!0&&j===!0||Z==="credit"&&(K===!0||l===!1&&j===!0)||Z==="debit"&&j===!0)&&Y===!0&&e("../setup")},[T,I,B,Z,K,j]),c.useEffect(()=>{ne||(n(tr("cardAdmin")),X(!0))},[ne]);const Pe=y(ee=>Tt(ee.userState,ee.userRoleState,ee.userListViewState,"cardAdmin")),we=Oe(l,V,B,I);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{if(Q.trackPageLoaded(Ht.Event.cardsPromoPage),!!l&&!I||!!V&&!B||!!l&&!!V&&!B&&!I){const ee=_s({isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:I,isCreditCardProductVisibleForExpressInterest:l,isDebitCardProductVisible:V});Q.trackCardsPromoView(F,we,"Page",ee,"Promo Page")}}}),s.jsx(xa,{showConfetti:$}),s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:O}),s.jsx(ks,{signedInUser:H,location:p,showEnableCardButton:T,isCompanyBusinessVerificationAndPaymentSetUpDone:T,isChargeCardSetupEnabled:I,isDebitCardSetupEnabled:B,companyLegalName:h.companyName,adminList:Pe.users,isCheckingEnabled:U,navigate:e,companyId:b,cardPromoType:Be,controllerEmails:F,productInformation:we,isCreditCardProductVisible:u,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:i,cashbackRate:D,chargeCardsCreditAccountLimit:w,onClickMenuIcon:()=>{O(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:O}),s.jsx(Tr,{})]})},_s=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Qs(){const e=ge(),t=y(W=>ce(W)),{useFeatureGate:a}=se(),{isFeatureEnabled:r}=a(z.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(z.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=a(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:m}=a(z.isChargeCardPaymentHistoryFeatureEnabled),f=Se(n,t),A=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:f}),o=vr(t,r,n),i=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,E=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,S=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,h=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,R=je(),F=Re(R?.loggedInUserRoleMap),D=Ya(R?.loggedInUserRoleMap),{isFeatureEnabled:p}=a(z.isCashbackFeatureEnabled),b=t.userRole.includes("charge_card_user"),g=!b,d=!b&&S,_=t?.userRole!=null&&rr(t?.userRole),v=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!_)&&sr(R?.loggedInUserRoleMap),N=or(R?.loggedInUserRoleMap),L=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!_)&&ir(R?.loggedInUserRoleMap),{isFeatureEnabled:w}=a(z.isDepositAccountsFeatureEnabled),V=w&&!_&&gt(R?.loggedInUserRoleMap),u=S&&!_,l=h&&!_,P=o&&!_&&Re(R?.loggedInUserRoleMap),T=cr(R?.loggedInUserRoleMap),H=be(t),U=ye(t),K=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Ae({isCardsOnlyTenant:H,isChargeCardFeatureEnabled:r,isBookKeepingTenant:U,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:K}),B=t.companyChargeCardInfo?.info!=null&&Xe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:I,isTOSAccepted:i,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:D}),j=t.companyDebitCardInfo?.info!=null&&Xe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:A,isTOSAccepted:E,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:D}),O=B||j;return s.jsxs(Wt,{children:[F?s.jsx(te,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:N,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(te,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isUserHasOnlyBillPayAccess:N,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:T,productType:"charge_cards",type:"verification"})}):null,s.jsx(te,{path:"promo",element:s.jsx(Ds,{})}),u||l?s.jsxs(s.Fragment,{children:[s.jsx(te,{path:"/",element:s.jsx(it,{isPaymentDrawerOpen:!1})}),P&&C?s.jsx(te,{path:"payment",element:s.jsx(it,{isPaymentDrawerOpen:!0})}):null,s.jsx(te,{path:"activate",element:s.jsx(Es,{})}),s.jsx(te,{path:"onboard",element:s.jsx(cs,{})}),F?s.jsx(te,{path:"new",element:s.jsx(Ss,{})}):null,p&&g?s.jsx(te,{path:"cashback",element:s.jsx(Hr,{})}):null,d?s.jsx(te,{path:"statements",element:s.jsx(os,{})}):null,P&&m&&S?s.jsx(te,{path:"payment-history",element:s.jsx(ss,{})}):null,s.jsx(te,{path:":cardId/activate",element:s.jsx($r,{})}),s.jsx(te,{path:":cardId/setPin",element:s.jsx(ms,{})}),s.jsx(te,{path:":cardId/addToWallet",element:s.jsx(Nr,{})}),s.jsx(te,{path:":cardId/*",element:s.jsx(Xr,{})}),s.jsx(te,{path:"*",element:s.jsx(La,{})})]}):(i||E)&&F?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../setup"})}):O?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../promo",state:e.state})}):s.jsx(te,{path:"*",element:null})]})}export{Qs as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-BSDLCmF2.js";import{a as g}from"./sentry-67DqaLi1.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-B20PugrR.js";import{z as N,b7 as P,N as F,d as V,f as j,af as b,b8 as A,at as L,au as M,s as U}from"./index-D8hCAHx9.js";import{eP as D,fG as B,sb as _,fB as G,c2 as R,ME as z,bn as q,qc as H,q0 as Y,kb as Z,lH as S,MF as $,bE as J,cv as C,lP as K,lS as Q}from"./zeni-epic-state-B3AwsZqW.js";import"./mui-BBkBdMVO.js";import{d as W}from"./routePaths-XreQojZr.js";import{M as X}from"./MobileAppDrawer-CgbJlL9u.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]="cd01da61-1b49-404d-80f7-a40131be4a29",a._sentryDebugIdIdentifier="sentry-dbid-cd01da61-1b49-404d-80f7-a40131be4a29")}catch{}})();const ee=E(function(a){const t=G(a),i=N.getSignedInUser(),l=D(a),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(a.companyConfigState),n=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(a,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{a(Q())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(K({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?C(u):void 0,meetingLink:y!=""&&y!=null?C(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:M(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?J(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]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(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=>{a($(e))},onCompanyOfficerUpdated:e=>{a(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=>{a(Z({files:e}))},onDeleteFile:e=>{a(Y(e))},onEditFileName:(e,n)=>{a(H(e,n.split(".")[0]))}}})(A);function de(){const a=w(),t=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=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,n,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);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(P,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-Do-nuGO9.js";import{a as g}from"./sentry-CpVyi-77.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-CAUatE6D.js";import{z as C,b7 as P,V as F,c as V,e as j,af as b,b8 as A,at as L,au as M,m as U}from"./index-ssCDruz8.js";import{eP as D,fG as B,sb as _,fB as G,c2 as R,ME as z,bn as q,qc as H,q0 as Y,kb as Z,lH as S,MF as $,bE as J,cv as N,lP as K,lS as Q}from"./zeni-epic-state-Cb-J9Nxh.js";import"./mui-Ee2kkUYC.js";import{d as W}from"./routePaths-C0HYOQUJ.js";import{M as X}from"./MobileAppDrawer-6SipHCGH.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]="2f92c9dc-e75d-413b-b508-dc3e12db1a0f",t._sentryDebugIdIdentifier="sentry-dbid-2f92c9dc-e75d-413b-b508-dc3e12db1a0f")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(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:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(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(Q())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({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?N(u):void 0,meetingLink:y!=""&&y!=null?N(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:M(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?J(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($(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(Z({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(A);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=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.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(_())},[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(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -0,0 +1,11 @@
1
+ import{j as C}from"./liveblocks-Do-nuGO9.js";import{a}from"./sentry-CpVyi-77.js";import{u as D,g as v,j as u,N as w}from"./core-CAUatE6D.js";import{Jj as j,eP as A,fo as O,mT as U,fP as E,fn as _,eW as L,Jq as F}from"./zeni-epic-state-Cb-J9Nxh.js";import{u as P,z as c,L as g,D as $,o as k}from"./index-ssCDruz8.js";import{n as H}from"./mui-Ee2kkUYC.js";import{t as z}from"./getLocaleForTenant-DjpfkvqM.js";import{g as R,Q as J}from"./QBOConnectionScreen-C6YL0sDk.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";import"./empty-BtvkP3hw.js";import"./pdf-lib-QKmlG01y.js";import"./index-BBI_6CLT.js";import"./url-Dp0KhTaX.js";import"./index-uJrW53Lh.js";import"./decodeURIComponentSafe-M2sJXq9C.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]="bbbec94e-dee1-40da-bca9-bd0dcfa95b0a",t._sentryDebugIdIdentifier="sentry-dbid-bbbec94e-dee1-40da-bca9-bd0dcfa95b0a")}catch{}})();const q=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 pe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:h}=P(),p=a.useRef(!1),f=a.useRef(!1),{code:x,realmId:T,state:y}=R(i.search),N=x!==""&&T!==""&&y!=="",I=u(l=>j(l)),e=u(l=>A(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=c.getSignedInUser(),m=c.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,b=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{p.current||o==null||m==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(O(o.userId,m))))},[p,n,d]),a.useEffect(()=>{e.tenantId==null&&!f.current&&o!=null&&(f.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(U(o.userId)))},[f,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||b!=="Error"||(d(g.CONNECTION_AUTH),t(E(o.userId,e.tenantId)))},[b]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(_(e.tenantId)),c.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(E(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&c.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||h()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(q,{children:C.jsx(J,{})}):C.jsx(w,{to:"/",replace:!0})}export{pe as default};
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-Do-nuGO9.js";import{z as n}from"./index-ssCDruz8.js";import{g as d}from"./QBOConnectionScreen-C6YL0sDk.js";import"./sentry-CpVyi-77.js";import{g as p,N as a}from"./core-CAUatE6D.js";import"./zeni-epic-state-Cb-J9Nxh.js";import"./recharts-DfwJcvGU.js";import"./mui-Ee2kkUYC.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";import"./empty-BtvkP3hw.js";import"./pdf-lib-QKmlG01y.js";import"./index-BBI_6CLT.js";import"./url-Dp0KhTaX.js";import"./index-uJrW53Lh.js";import"./decodeURIComponentSafe-M2sJXq9C.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,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BSDLCmF2.js";import{t as Ke,A as Ce}from"./AddressScreen-C1kNIoFW.js";import $e from"./NotFoundScreen-DjvK1NbN.js";import{a as g}from"./sentry-67DqaLi1.js";import{h as oe,g as se,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as qe,p as z}from"./core-B20PugrR.js";import{F as de,k as le,z as B,w as ue,m as Me,I as _,s as V,N as J,d as N,x as we,f as Y,ap as Qe,p as Ze,aq as ke,i as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Ye}from"./index-D8hCAHx9.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mR as at,fc as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sp as fe,sa as rt,Kj as X,sq as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sc as Be,so as gt,bE as Te,cv as ft,sC as xe,qc as ht,q0 as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s4 as Et,sD as Tt,sG as xt,sJ as Ot,sP as Pt,cT as Dt}from"./zeni-epic-state-B3AwsZqW.js";import{n as he}from"./mui-BBkBdMVO.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-BRbkYHuP.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./empty-DbjE3Pml.js";import"./pdf-lib-BqwRJQ00.js";import"./index-qbNk-Sh2.js";import"./url-D5ovKX_j.js";import"./index-Dx-tgz0s.js";import"./decodeURIComponentSafe-HZX6LUOb.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]="36ddb3ec-687c-4720-88eb-df85f94ddafb",t._sentryDebugIdIdentifier="sentry-dbid-36ddb3ec-687c-4720-88eb-df85f94ddafb")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=Me(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,M=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),$===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),M===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),h===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-Do-nuGO9.js";import{t as Ke,A as Ce}from"./AddressScreen-Bg11cvW7.js";import $e from"./NotFoundScreen-BbD7D-7R.js";import{a as g}from"./sentry-CpVyi-77.js";import{h as oe,g as se,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as qe,p as z}from"./core-CAUatE6D.js";import{F as de,k as le,z as B,w as ue,h as Me,I as _,m as V,V as J,c as N,B as we,e as Y,ap as Qe,K as Ze,aq as ke,i as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Ye}from"./index-ssCDruz8.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mR as at,fc as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sp as fe,sa as rt,Kj as X,sq as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sc as Be,so as gt,bE as Te,cv as ft,sC as xe,qc as ht,q0 as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s4 as Et,sD as Tt,sG as xt,sJ as Ot,sP as Pt,cT as Dt}from"./zeni-epic-state-Cb-J9Nxh.js";import{n as he}from"./mui-Ee2kkUYC.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-C6YL0sDk.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";import"./empty-BtvkP3hw.js";import"./pdf-lib-QKmlG01y.js";import"./index-BBI_6CLT.js";import"./url-Dp0KhTaX.js";import"./index-uJrW53Lh.js";import"./decodeURIComponentSafe-M2sJXq9C.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]="1fc55b6b-3f0c-4e48-a8bd-ed44f4754eb4",t._sentryDebugIdIdentifier="sentry-dbid-1fc55b6b-3f0c-4e48-a8bd-ed44f4754eb4")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=Me(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,M=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),$===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),M===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),h===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};