@zeniai/web-app-ui 5.3.41-qa → 5.3.42-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 (151) hide show
  1. package/dist/assets/AccountMappingScreen-5txeuTng.js +9 -0
  2. package/dist/assets/ActualMatchingMatchDetailScreen-BvCTHIwN.js +1 -0
  3. package/dist/assets/AddressRoutes-CysroEs-.js +1 -0
  4. package/dist/assets/AddressScreen-C1CfOA8k.js +9 -0
  5. package/dist/assets/{AiCfoScreen-BjMYvl6E.js → AiCfoScreen-C0gnDsXr.js} +5 -5
  6. package/dist/assets/{AppDrawer-ByoXxMIV.js → AppDrawer-CZ5MsAyB.js} +2 -2
  7. package/dist/assets/{BillPayApprovalRoutes-Z4uvf0-n.js → BillPayApprovalRoutes-Dba8jEIY.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-8zmFRoA_.js → BillPayRoutes-BInjoPbL.js} +11 -11
  9. package/dist/assets/BusinessVerificationPageScreen-BmHKq1LL.js +9 -0
  10. package/dist/assets/{CardsAiCfoScreen-B7sfpD2b.js → CardsAiCfoScreen-C6Rnq8nD.js} +1 -1
  11. package/dist/assets/ChargeCardRoutes-P239JK-b.js +71 -0
  12. package/dist/assets/{CompanyPassportScreen-DDKosLEE.js → CompanyPassportScreen-yPmE04_9.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-6-1bG5gz.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-C__JnnR_.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-CbzzxK0y.js +30 -0
  16. package/dist/assets/{DashboardRoutes-B5yb7VGD.js → DashboardRoutes-DhWNQvqz.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-DXPTZTHs.js → DefaultTenantHome-Fsi_QjM5.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-CuBtrLRo.js +18 -0
  19. package/dist/assets/{DrawerScreen--7ksii2j.js → DrawerScreen-o43C4sHm.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-Vj0NPJut.js +1 -0
  21. package/dist/assets/ExpenseAutomationRoutes-faxOwOvi.js +38 -0
  22. package/dist/assets/FeaturePreviewScreen-CEOFkjIy.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-CnHqx1ge.js +1 -0
  24. package/dist/assets/{InboxNotificationsProvider-D007v5X6.js → InboxNotificationsProvider-Cf5DQSg3.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-6Wikj2BP.js → InvoicingRoutes--kNvLDpX.js} +2 -2
  26. package/dist/assets/{MagicLinkRoutes-D0y8ZbiR.js → MagicLinkRoutes-_oMvrXOe.js} +8 -8
  27. package/dist/assets/MagicLinkSignInScreen-D2yfAbuX.js +12 -0
  28. package/dist/assets/MobileAppDrawer-Q8q8ssn0.js +1 -0
  29. package/dist/assets/NotFoundScreen-3YmbDG-O.js +1 -0
  30. package/dist/assets/{NotificationRoutes-La5Ef0Sp.js → NotificationRoutes-BFjfuaHE.js} +1 -1
  31. package/dist/assets/OAuthConsentScreen-Ce7q6w-7.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-Cb8E55Qo.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-C3veO1_u.js → PaymentLinkScreen-CN69RRr9.js} +1 -1
  34. package/dist/assets/PeopleRoutes-DNCzXaoC.js +22 -0
  35. package/dist/assets/PerformanceRoutes-DyNYMyLi.js +1 -0
  36. package/dist/assets/{Preview-DA8U2xpZ.js → Preview-BCwFnEAM.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-BbB3FEE8.js → QBOConnectionScreen-DX5rBjLM.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-DifzmUQS.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-lW1DSyNO.js → ReimbursementApprovalRuleDetailScreen-6W7aXQIv.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-03Hgu3V3.js → ReimbursementRoutes-Caztwlhg.js} +9 -9
  41. package/dist/assets/{ReportsRoutes-B9cy_-f4.js → ReportsRoutes-CfScWyxA.js} +1 -1
  42. package/dist/assets/RewardsRoutes-BaqYIdkd.js +1 -0
  43. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DuraGGsO.js +33 -0
  44. package/dist/assets/ScreenRoutes-QNvqH_bZ.js +2 -0
  45. package/dist/assets/{SettingsRoutes-BAJmUy_d.js → SettingsRoutes-DzQurTcP.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-CNVeqnHU.js → SetupPagesScreen-CsSP_P2k.js} +5 -5
  47. package/dist/assets/SignInScreen-CRymVKij.js +1 -0
  48. package/dist/assets/SignOutScreen-B0U7u8Hy.js +9 -0
  49. package/dist/assets/{TaskListScreen-B_HBW--i.js → TaskListScreen-CXn6czhu.js} +2 -2
  50. package/dist/assets/TaskRoutes-0Yfh5AkX.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-BiIqbu_-.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-BISRvrnZ.js → TransactionDetailScreen-Cxl44PLi.js} +2 -2
  53. package/dist/assets/TransactionListRoutes-CBLSrFS8.js +1 -0
  54. package/dist/assets/{TreasuryRoutes-DQeUZ7RQ.js → TreasuryRoutes-a3UpD3kR.js} +6 -6
  55. package/dist/assets/{VendorsRoutes-AD9AzaGF.js → VendorsRoutes-DlFjWODu.js} +18 -18
  56. package/dist/assets/WiseConfirmationScreen-BJ1TyqgG.js +12 -0
  57. package/dist/assets/ZeniAccountRoutes-C0xgRuTa.js +57 -0
  58. package/dist/assets/ZeniAccountStatementScreen-C8J1M6mP.js +9 -0
  59. package/dist/assets/{accountMappingHelper-qlU24D2s.js → accountMappingHelper-2xXLJj4S.js} +1 -1
  60. package/dist/assets/{analytics-BvodL4nJ.js → analytics-CvsRIk3B.js} +1 -1
  61. package/dist/assets/{analyticsHelper-BBEm35nD.js → analyticsHelper-tF6p2yRC.js} +1 -1
  62. package/dist/assets/{core-gUqdW_kq.js → core-DGLzDXWl.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-Cst3Y24b.js → decodeURIComponentSafe-k3ZAUeWI.js} +1 -1
  64. package/dist/assets/{dnd-YSyN45zY.js → dnd-SnD389s6.js} +1 -1
  65. package/dist/assets/{empty-BAVoovBk.js → empty-BfBfVq50.js} +1 -1
  66. package/dist/assets/{empty-CkcqWk4Z.js → empty-BjVnPUF5.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-DMVtoCOe.js → emptyVideoElement-Bb1KlJXy.js} +1 -1
  68. package/dist/assets/epic-CPuRNynX.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-DWDIPthN.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-BFGbVplK.js → getLocaleForTenant-CZIO6uAG.js} +1 -1
  71. package/dist/assets/{index-70FTEc4H.js → index-B2CKeHlo.js} +1 -1
  72. package/dist/assets/{index-ChcsxO47.js → index-BMI1TT7Z.js} +1 -1
  73. package/dist/assets/{index-1WLkQfLs.js → index-Buyjnqrt.js} +1 -1
  74. package/dist/assets/{index-BhZ9H0Qw.js → index-C54xa34r.js} +1 -1
  75. package/dist/assets/index-CQFc7TiS.js +1 -0
  76. package/dist/assets/{index-BzFSQsxk.js → index-CzPkUTbT.js} +2 -2
  77. package/dist/assets/{index-DRDpUzzs.js → index-DGjciFPC.js} +16718 -15885
  78. package/dist/assets/{index-6dqseRo4.js → index-DPcuwgM-.js} +1 -1
  79. package/dist/assets/{lexical-Euc6kCJG.js → lexical-CMBMntF_.js} +1 -1
  80. package/dist/assets/{liveblocks-B3m51ZRo.js → liveblocks-DRsJ0YIJ.js} +1 -1
  81. package/dist/assets/{lottie-DLBd_qLT.js → lottie-DEqUWUd5.js} +1 -1
  82. package/dist/assets/{mui-DCW4m3lZ.js → mui-BuJ3P0FU.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Ds-XNEX3.js → pathToGoBack-BzjHaNqp.js} +1 -1
  84. package/dist/assets/{pdf-BDXl9G7N.js → pdf-B_v4zyN7.js} +3 -3
  85. package/dist/assets/{pdf-lib-Bku26ZcE.js → pdf-lib-DxbyphS9.js} +1 -1
  86. package/dist/assets/{plaid-BrXe9xNf.js → plaid-i7y7YD6O.js} +1 -1
  87. package/dist/assets/{pusher-BzxZmWnS.js → pusher-BYBfYYCn.js} +1 -1
  88. package/dist/assets/{react-DtuhKjd8.js → react-B90rw7na.js} +1 -1
  89. package/dist/assets/{react-pusavzWL.js → react-C2HSs5Iu.js} +1 -1
  90. package/dist/assets/{react-C43HbBFY.js → react-CAYYQ7Si.js} +1 -1
  91. package/dist/assets/{react-Db0eqcPH.js → react-CAr2Hff_.js} +1 -1
  92. package/dist/assets/{react-Cp8yT8Rr.js → react-Dm85ZpZj.js} +1 -1
  93. package/dist/assets/{react-FxzlmTOI.js → react-leqbcToB.js} +1 -1
  94. package/dist/assets/{recharts-HpXoq1DR.js → recharts-CJlXFxhv.js} +1 -1
  95. package/dist/assets/{routePaths-BlnN04aI.js → routePaths-COaM8xFB.js} +1 -1
  96. package/dist/assets/{sentry-DI7gLUjw.js → sentry-G4ZANa8Z.js} +1 -1
  97. package/dist/assets/stripSplatSuffix-BTaD_7hZ.js +1 -0
  98. package/dist/assets/{url-BVmez_R2.js → url--ciz_Nq8.js} +1 -1
  99. package/dist/assets/{url-qyBRakHR.js → url-CtF92dYM.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-Dtg-Odjs.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C8tiJ4-s.js → useAiCfoDashboardSuggestedQuestionsChips-DXgID2ue.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-DY2m50un.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-K7_8wfj8.js → useChargeCardPusherEvents-C-hT_5jI.js} +1 -1
  104. package/dist/assets/{useDeviceId-kl-tdydV.js → useDeviceId-C9MUyzJJ.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-B7XzuZ4T.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-TMWlbA40.js → useInitialThreadRequest-Cdwnj1Ib.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-i7vk79Wr.js +1 -0
  108. package/dist/assets/{utils-8Dv5nUFZ.js → utils-Bz8wuSWM.js} +1 -1
  109. package/dist/assets/withTransactionSidePanel-_ek7stLz.js +25 -0
  110. package/dist/assets/{zeni-epic-state-C-d25VTi.js → zeni-epic-state-Dm2vDWXH.js} +6 -6
  111. package/dist/index.html +1 -1
  112. package/package.json +4 -4
  113. package/dist/assets/AccountMappingScreen-C3HFW5Ij.js +0 -9
  114. package/dist/assets/AddressRoutes-Bt5wsDb7.js +0 -1
  115. package/dist/assets/AddressScreen-CSJE0p29.js +0 -9
  116. package/dist/assets/BusinessVerificationPageScreen-CmhKA9oQ.js +0 -9
  117. package/dist/assets/ChargeCardRoutes-C7bJJS3x.js +0 -71
  118. package/dist/assets/ConnectionAuthScreen-tllRDLdE.js +0 -11
  119. package/dist/assets/CustomerOnboardingAuthScreen-BtQtr6Oc.js +0 -1
  120. package/dist/assets/CustomerOnboardingRoutes-zfeAaUV5.js +0 -30
  121. package/dist/assets/DomesticWireDetailScreen-Bl1py3nW.js +0 -18
  122. package/dist/assets/EntityDetailRoutes-Cjc6zlA1.js +0 -1
  123. package/dist/assets/ExpenseAutomationRoutes-Dg2fewAy.js +0 -38
  124. package/dist/assets/FeaturePreviewScreen-CaIMasua.js +0 -1
  125. package/dist/assets/HubSpotOAuthCallbackScreen-y0UiA1as.js +0 -1
  126. package/dist/assets/MagicLinkSignInScreen-CYMk4ubj.js +0 -12
  127. package/dist/assets/MobileAppDrawer-Bh8VAeHB.js +0 -1
  128. package/dist/assets/NotFoundScreen-BFfoIcMt.js +0 -1
  129. package/dist/assets/OAuthConsentScreen-qHtuiZOo.js +0 -1
  130. package/dist/assets/PandLWithForecastRoutes-AChf_KvX.js +0 -1
  131. package/dist/assets/PeopleRoutes-Dx-0mEVQ.js +0 -22
  132. package/dist/assets/PerformanceRoutes-3JW12kzP.js +0 -1
  133. package/dist/assets/ReimbursementApprovalRoutes-CvLfwozC.js +0 -1
  134. package/dist/assets/RewardsRoutes-DQIZ8X-t.js +0 -1
  135. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-D9k6A3OE.js +0 -33
  136. package/dist/assets/ScreenRoutes-DBgMcdH4.js +0 -2
  137. package/dist/assets/SignInScreen-_6ovFcIG.js +0 -1
  138. package/dist/assets/SignOutScreen-DQot6FAh.js +0 -9
  139. package/dist/assets/TaskRoutes-CIgfsl6U.js +0 -9
  140. package/dist/assets/TransactionDetailRoutes-CEwE4Bbf.js +0 -1
  141. package/dist/assets/TransactionListRoutes-DHaTXNgW.js +0 -1
  142. package/dist/assets/WiseConfirmationScreen-DnPfMtVh.js +0 -12
  143. package/dist/assets/ZeniAccountRoutes-BKcFRSlc.js +0 -57
  144. package/dist/assets/ZeniAccountStatementScreen-Cn72q1Zx.js +0 -9
  145. package/dist/assets/epic-DHyjKhvW.js +0 -2
  146. package/dist/assets/expenseAutomationHelper-DDRCXr7k.js +0 -1
  147. package/dist/assets/index-DhQKJDfi.js +0 -1
  148. package/dist/assets/useAskAiCfoHostNavButtonProps-DNzUy0g0.js +0 -1
  149. package/dist/assets/useEmailConnectResultRefresh-BJXmlYiy.js +0 -1
  150. package/dist/assets/useTaskManagerAccess-BJoTHFNB.js +0 -1
  151. package/dist/assets/withTransactionSidePanel-ZShW5IUX.js +0 -25
package/dist/index.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-DRDpUzzs.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-DI7gLUjw.js"><link rel="modulepreload" crossorigin href="/assets/core-gUqdW_kq.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-C-d25VTi.js"><link rel="modulepreload" crossorigin href="/assets/mui-DCW4m3lZ.js"><link rel="modulepreload" crossorigin href="/assets/analytics-BvodL4nJ.js"><link rel="modulepreload" crossorigin href="/assets/utils-8Dv5nUFZ.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-DGjciFPC.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-G4ZANa8Z.js"><link rel="modulepreload" crossorigin href="/assets/core-DGLzDXWl.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-Dm2vDWXH.js"><link rel="modulepreload" crossorigin href="/assets/mui-BuJ3P0FU.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CvsRIk3B.js"><link rel="modulepreload" crossorigin href="/assets/utils-Bz8wuSWM.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/web-app-ui",
3
- "version": "5.3.41-qa",
3
+ "version": "5.3.42-dev",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],
@@ -28,9 +28,9 @@
28
28
  "@sentry/core": "^9.42.1",
29
29
  "@sentry/react": "^9.42.1",
30
30
  "@stripe/stripe-js": "^4.4.0",
31
- "@zeniai/client-analytics": "2.0.89",
32
- "@zeniai/client-epic-state": "5.2.41",
33
- "@zeniai/web-components": "4.3.76",
31
+ "@zeniai/client-analytics": "2.0.91",
32
+ "@zeniai/client-epic-state": "5.2.42",
33
+ "@zeniai/web-components": "4.3.78",
34
34
  "color": "3.1.3",
35
35
  "crypto-js": "4.2.0",
36
36
  "dnd-core": "^16.0.1",
@@ -1,9 +0,0 @@
1
- import{j as U}from"./liveblocks-B3m51ZRo.js";import{a as o}from"./sentry-DI7gLUjw.js";import{h as Y,g as Z,u as H,j as m,s as q,l as K}from"./core-gUqdW_kq.js";import{ai as W,M as ee,y as $,z as te,q as G,aj as ne,k as ae,U as ce}from"./index-DRDpUzzs.js";import{bn as se,fE as oe,gU as ie,oA as Q,TX as re,i7 as J,gg as le,or as ue,TY as de,TZ as pe,tA as ge,l_ as me,op as Ae,ol as be,ow as ye,i9 as Ie,T_ as fe,T$ as Se}from"./zeni-epic-state-C-d25VTi.js";import{n as he}from"./mui-DCW4m3lZ.js";import{M as Ee}from"./MobileAppDrawer-Bh8VAeHB.js";import{q as R}from"./QBOConnectionScreen-BbB3FEE8.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-qlU24D2s.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="ed786ba6-3948-431c-bd9a-561d34aeab73",a._sentryDebugIdIdentifier="sentry-dbid-ed786ba6-3948-431c-bd9a-561d34aeab73")}catch{}})();const l="zeni_pending_projects_enable",u={pending:"pending",ready:"ready"},we=he.div`
2
- display: flex;
3
- height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${a=>a.theme.colors.grey4};
9
- `,ve=K((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(l),c=i===u.pending||i===u.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:A}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:w,vendorsAccountSection:v,filing1099Section:C}=r,{incomeAccount:x,expenseAccount:T}=d,{billPayAccount:s}=z,{reimbursementsAccount:F}=w,{prepaidExpensesAccount:p,fixedAssetsAccount:V,accruedExpensesAccount:M}=v,{bankAccount:O,expenseCategory1099:_}=C,b=h(e.accountMappingView.incomeAccountList,x.selectedOption),j=h(e.accountMappingView.expenseAccountList,T.selectedOption),y=h(e.accountMappingView.billPayAccountList,s.selectedOption),k=h(e.accountMappingView.reimbursementsAccountList,F.selectedOption),P=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),L=E(e.accountMappingView.fixedAssetsAccountList,V.selectedOptions),I=E(e.accountMappingView.accruedExpensesAccountList,M.selectedOptions),D=E(e.accountMappingView.bankAccounts1099FilingAccountList,O.selectedOptions),f=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,_),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:j?.accountId,selectedBillPayAccountId:y?.accountId,selectedReimbursementsAccountId:k?.accountId,selectedPrepaidExpensesAccountIds:P.map((n=>n.accountId)),selectedFixedAssetsAccountIds:L.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:I.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:D.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:f};a(Se({data:t}))},onBackClick:()=>{G(c)===!1?(i("../../dashboard"),a(fe())):a(J())},onSaveClick:()=>{a(Ie()),A&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(ye(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(l);d===u.pending||d===u.ready||a(r?Ae(e.currentTenant.companyId):be(e.currentTenant.companyId))}}}))(ne),ke=()=>{const a=W(),e=Y(),i=Z(),c=H(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A($.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A($.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:w,isDynamicConfigLoading:v}=r("transaction_categorization_config"),C=!v&&w?.capitalization_enabled===!0,x=te.getSignedInUser(),T=se(x),s=m((t=>oe(t))),{capitalizableAccounts:F,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:V,currencySymbol:M}=m((t=>{const n=t.tenantState.currentTenantId,g=n!=null?t.tenantState.tenantsById[n]:void 0,S=ie(t.companyState,s.companyId);return{capitalizableAccounts:g?.capitalizableAccounts??null,capitalizableAccountOverrides:g?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),q),O=o.useCallback(((t,n)=>{c(Q(s.companyId,t,n))}),[c,s.companyId]),_=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[B,N]of g)N===null?delete n[B]:n[B]=N;const[S,X]=g[0]??[];S!=null&&c(Q(s.companyId,S,X,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),q),j=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[y,k]=o.useState(!1),[P,L]=o.useState(!1);o.useEffect((()=>{y===!1&&(c(J()),k(!0))}),[y]);const I=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(l)===u.pending&&(sessionStorage.removeItem(l),c(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(l)===u.ready&&s?.companyId!=null&&(sessionStorage.removeItem(l),c(ue(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{I&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),R.init("/connection/auth",s.tenantEmailDomain),R.handleClick())}),[I,s?.tenantEmailDomain,c]);const D=m((t=>pe(t))),f=t=>{L(t)};return U.jsxs(we,{children:[U.jsx(Ee,{isAppContentDrawerOpen:P,handleDrawerToggle:f}),U.jsx(ve,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:D,isFiling1099FeatureEnabled:d&&T,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:C,capitalizableAccounts:F,accountNamesById:j,capitalizableAccountOverrides:p,currencySymbol:M,isCapitalizationThresholdSaving:V,onSaveCapitalizationAccountThreshold:O,onSaveCapitalizationAccountThresholds:_,location:i,isSettings:G(i),onClickMenuIcon:()=>f(!0)})]})};export{l as P,ke as U,u as a};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-B3m51ZRo.js";import{A as o}from"./AddressScreen-CSJE0p29.js";import i from"./NotFoundScreen-BFfoIcMt.js";import"./sentry-DI7gLUjw.js";import{n as s,o as r}from"./core-gUqdW_kq.js";import"./zeni-epic-state-C-d25VTi.js";import"./recharts-HpXoq1DR.js";import"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="31d0e0e8-dcf1-419d-b2be-6dc359df28c9",t._sentryDebugIdIdentifier="sentry-dbid-31d0e0e8-dcf1-419d-b2be-6dc359df28c9")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(o,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(o,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,9 +0,0 @@
1
- import{j as n}from"./liveblocks-B3m51ZRo.js";import{a as h}from"./sentry-DI7gLUjw.js";import{h as T,u as P,g as E,i as j,j as U,l as D}from"./core-gUqdW_kq.js";import{a1 as B,E as M,z as $,Q as L,a7 as K,a8 as z,k as C,U as S,a3 as F,X as b,a4 as G}from"./index-DRDpUzzs.js";import{UC as _,io as R,fE as N,UD as O,c8 as V,UE as q,mG as H}from"./zeni-epic-state-C-d25VTi.js";import{n as Q}from"./mui-DCW4m3lZ.js";import X from"./NotFoundScreen-BFfoIcMt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="d427742e-55f6-4025-a36d-624afa83c035",e._sentryDebugIdIdentifier="sentry-dbid-d427742e-55f6-4025-a36d-624afa83c035")}catch{}})();const J=Q.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,W=D((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=N(e),a=s.roleMap!=null&&O(s.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=_(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=G(d?.pathnameStackToGoBack);let t=r.poppedPathname??v();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(t=`${t}?${g}`)}o(t,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(F);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=P(),r=E(),{addressId:t,addressType:u}=j(),g=B(),I=M(),k=$.getSignedInUser(),[f,w]=h.useState(t==null),p=U((m=>t!=null?_(m,t).fetchState:"Not-Started")),x=L();if(k==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(t!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect((()=>{f||t==null||(w(!0),d(R(t,!1)))}),[f,t,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?n.jsx(K,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):t!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(z,{analytics:C,onLoad:A}),n.jsx(J,{windowSize:g,children:n.jsx(W,{location:r,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(X,{})}const v=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{ne as A,Y as t};
@@ -1,9 +0,0 @@
1
- import{a as V}from"./sentry-DI7gLUjw.js";import{u as Y,j as b,h as ne,g as se,i as oe,N as ie,l as re}from"./core-gUqdW_kq.js";import{fE as U,GU as ce,Yn as ue,AY as de,RA as pe,H6 as le,Kh as me,N4 as fe,NK as ye,Oz as Se,Yo as ge,Yp as Ie,Yq as he,Yr as be,Ys as Te,UD as De,Xt as Oe,US as Ce,Ll as ke,UT as Ve,Lp as Ae,mG as we,gF as Ne,gE as Fe,gD as _e,ul as ve,uc as Ee,u9 as xe,my as Be,B5 as Ue,B3 as z,bE as R,Bh as L,cE as ze}from"./zeni-epic-state-C-d25VTi.js";import{bS as Re,Q as Le,M as Pe,bi as Me,z as B,a8 as je,k as P,q as E,U as x,bU as Ge,ae as Ye,p as M,aG as j}from"./index-DRDpUzzs.js";import{n as qe}from"./mui-DCW4m3lZ.js";import{j as k}from"./liveblocks-B3m51ZRo.js";import{d as G}from"./routePaths-BlnN04aI.js";import{M as Ke}from"./MobileAppDrawer-Bh8VAeHB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="f65e24f1-6801-427d-a5e3-96b8a14afe96",t._sentryDebugIdIdentifier="sentry-dbid-f65e24f1-6801-427d-a5e3-96b8a14afe96")}catch{}})();function nt(){const t=Y(),u=b((r=>U(r))),n=u?.tenantId,{isApprovalRulesV3Enabled:i,isLoading:d}=Re(n),p=b((r=>r.billPaySetupApproverViewState.fetchState));V.useEffect((()=>{n==null||d||p==="Not-Started"&&t(ce(!0,!0,i))}),[n,d,i,p,t])}const Ze=qe.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${t=>t.theme.colors.grey4};
9
- `,$e=re((function(t,u){const{businessVerificationDetails:n}=u,i=U(t),d=B.getSignedInUser(),p=i.tenantId,r={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:p??""},T=De(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Oe(t.companyConfigState),s=Ce(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${Ye.fileMicroServiceBaseUrl}`,authParams:r,isDisabled:T,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:d,navigate:p,location:r}=u,{tenantEmailDomain:T}=d;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:m,companyIndustryType:O,companyLegalName:C,companyTaxId:g,companyWebsite:y,companyPhone:I,primaryContactEmail:c,primaryContactName:o,primaryContactUserId:l,primaryContactSyncToken:D,syncToken:S,fileIds:a,incDate:f,typeOfIncorporation:A,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:K,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:H,purposeOfAccountDescription:Q,regulatedStatus:W,regulatedStatusDescription:X,usNexus:J,usNexusTypes:ee}=e,_=O?.selectedOption,te={companyId:n,companyDescription:s,companyIndustry:m.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:C,taxIdOrEIN:g,website:y!=""&&y!=null?ze(y):void 0,phone:I,syncToken:S,fileIds:a,incDate:f!=null?R(f?.toString()):f,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map((v=>v.length===2?v:j(v)))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:H?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:W??"",regulatedStatusDescription:X,usNexus:J,usNexusTypes:ee?.selectedOptions??[]},ae={userId:l,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:D};t(L({companyDetails:te,primaryContactDetails:ae}))},onCompanyOfficerUpdated:e=>{const s=e.map((m=>{const{officerType:O,userId:C,name:g,email:y,nationalityCountryCode:I,ssn:c,dob:o,phone:l,syncToken:D,selectDocument:S,role:a,ownership:f,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=m;let h;return S.selectDocumentType==="driverLicense"?h="driving_license":S.selectDocumentType==="passport"?h="passport":S.selectDocumentType==="stateId"?h="id_document":S.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:C,firstName:g.firstName,lastName:g.lastName,email:y,ssn:c,nationalityCountryCode:I?.selectedOption!=null?j(I.selectedOption):void 0,phone:l,birthday:o!=null?R(o?.toString()):o,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:f,documentTypeSelectedForVerification:h,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(L({officers:s}))},onSaveDetailsClick:e=>{t(z(n,e,i))},onSendForVerificationClick:e=>{t(z(n,e,i,!0))},onAddressClick:e=>{const s=G(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:e=>{const s=G(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{t(Ue({companyId:n})),p("../setup")},updateFilesEntity:e=>{t(Be({files:e}))},onDeleteFile:e=>{t(xe(e))},onDeleteFileList:e=>{t(Ee(e))},onEditFileName:(e,s)=>{t(ve(e,s.split(".")[0]))},onGetOtp:e=>{t(_e(e,"SpendManagementSetup"))},onResendOtp:e=>{t(Fe(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(Ne(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(we({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=Ve(e.documentType);s!=null&&t(Ae({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(ke({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(Ge),st=({productType:t})=>{const u=ne(),n=se(),i=Y(),[d,p]=V.useState(!1),[r,T]=V.useState(!1),{tenantEmailDomain:e}=oe(),s=Le(),{useDynamicConfig:m}=Pe(),{configValue:O}=m(Me.zeniAccountsConfig),C=ue(O),g=b((a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}})),y=b((a=>a.companyConfigState.fetchState)),I=b((a=>a.userRoleConfigState.fetchState)),c=b((a=>U(a))),o=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(V.useEffect((()=>{y==="Not-Started"&&i(de()),I==="Not-Started"&&i(pe(!0))}),[y,I,i]),V.useEffect((()=>{if(!d&&g==="Not-Started"&&o!=null)switch(p(!0),t){case"zeni_accounts":i(Se(o,!0));break;case"zeni_treasury":i(ye(o,!0));break;case"reimbursement":i(fe(o,!0));break;case"charge_cards":i(me(o,!0));break;default:i(le(o,!0))}}),[d,g,o,i]),B.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let l;switch(t){case"zeni_accounts":l=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":l=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":l=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":l=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:l=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{T(a)},S=b((a=>{switch(t){case"zeni_accounts":return Te(a,o);case"zeni_treasury":return be(a,o);case"charge_cards":return he(a,o);case"reimbursement":return Ie(a,o);default:return ge(a,o)}}));return l===!1?k.jsx(ie,{to:"../promo"}):k.jsxs(Ze,{children:[k.jsx(je,{analytics:P,onLoad:a=>(f=>{switch(t){case"zeni_accounts":return f.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return f.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return f.trackPageLoaded(x.Event.billPayBusinessVerification,E(n)?"Settings":void 0)}})(a)}),E(n)?k.jsx(Ke,{isAppContentDrawerOpen:r,handleDrawerToggle:D}):null,k.jsx($e,{businessVerificationDetails:S,navigate:u,location:n,companyId:o,analytics:P,currentTenant:c,productType:t,isSettings:E(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:C.maxInsuredAmount})]})};export{st as B,nt as u};
@@ -1,71 +0,0 @@
1
- import{j as o}from"./liveblocks-B3m51ZRo.js";import{u as me,j as d,h as de,g as he,i as Me,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-gUqdW_kq.js";import{fR as Pt,$9 as is,g1 as wt,bt as ve,$a as ds,$b as ls,fG as fn,$c as Pn,fP as wn,$d as Tn,$e as vn,$f as Fn,$g as xn,fQ as Bn,g0 as Ln,$h as Rn,$i as us,fW as ms,fV as Cs,$j as ps,Jm as On,g3 as ia,$k as hs,$l as fs,fI as gs,fH as bs,gg as ze,fY as Un,fX as jn,$m as Ss,fZ as ys,IU as Is,IT as ks,IX as Es,IZ as As,g9 as Ds,fD as $n,$n as _s,$o as Ps,ge as Mn,$p as ws,gf as yt,J3 as Ts,J0 as vs,fE as fe,$q as qa,dX as Fe,dh as xe,dY as Be,gZ as da,cB as la,$r as ua,$s as Tt,Ch as Ga,m6 as Ka,$t as za,JC as ka,g4 as qe,JE as vt,lY as Nn,$u as ma,Jq as _a,$v as Fs,$w as xs,Jt as Ja,$x as Bs,Yk as Qa,f$ as Vn,Jz as ba,ip as Ls,$y as Hn,fS as Ca,br as Rs,$z as Os,gF as Xa,gE as et,K6 as Us,gD as at,$A as Gn,cu as Kn,d9 as js,Yj as wa,KH as zn,$B as gn,Kh as Pa,$C as Yn,KI as $s,YJ as Ms,KJ as Ns,LO as Vs,Bx as Hs,LI as Gs,$D as Ks,JD as oa,$E as zs,$F as Ys,$G as Ws,$H as Zs,$I as qs,$J as Ft,$K as Js,JT as Wn,JM as Qs,$L as Xs,g$ as eo,$M as Zn,K0 as qn,K4 as Jn,g_ as ao,$N as to,Kt as Qn,$O as no,$P as ro,$Q as so,K2 as Xn,JP as er,Jw as ar,JY as tr,JW as nr,J_ as oo,$R as rr,$S as co,gb as io,gc as lo,gd as uo,$T as tt,g5 as sr,db as xt,$U as mo,$V as Co,$W as po,$X as ho,Kc as It,KA as fo,Kw as go,K8 as bo,Ky as So,Ko as yo,Kq as Io,$Y as or,KG as Ha,Rx as ko,$Z as Eo,$_ as Ao,$$ as Do,a00 as cr,a01 as _o,L1 as Po,Kg as ir,Kb as $e,Kf as wo,a02 as To,a03 as vo,Jn as Fo,a04 as dr,f_ as lr,a05 as xo,Jp as Bo,Jo as bn,a06 as Lo,a07 as Ro,a08 as Oo,UE as Uo,a09 as Bt,a0a as jo,Fo as ur,mG as $o,id as Mo,L6 as No,a0b as mr,fM as Vo,fN as Ho,a0c as Go,dM as Ko,g2 as zo,KY as Yo,KS as Ze,bq as Wo,bJ as Zo,cG as qo,bK as Jo,Tw as Qo}from"./zeni-epic-state-C-d25VTi.js";import{Q as Le,df as Cr,a4 as we,dg as pr,dh as hr,di as Xo,G as ea,as as Lt,dj as ec,dk as ac,a as fr,e as gr,ar as br,p as ke,M as le,y as W,j as ya,dl as Sr,dm as tc,dn as nc,z as te,a7 as Ta,d4 as nt,dp as rc,dq as sc,dr as oc,a1 as va,bi as Qe,bE as Rt,ds as cc,ab as Fa,X as rt,E as Ot,k as ae,w as st,dt as ic,bQ as Sa,du as kt,dv as dc,a8 as Ut,dw as lc,ae as yr,av as Et,dx as uc,aq as Ir,P as kr,U as Er,dy as mc,dz as Cc,dA as pc,dB as hc,dC as fc,dD as gc,dE as bc,J as Ya,dF as Sc,dG as yc,m as ht,c as Ic,dH as kc,dI as Ec,dJ as Ac,ai as Dc,dK as _c,dL as Pc,g as wc}from"./index-DRDpUzzs.js";import{n as Ne,D as Ar,S as Tc}from"./mui-DCW4m3lZ.js";import{a as r}from"./sentry-DI7gLUjw.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-DNzUy0g0.js";import{M as Ee}from"./MobileAppDrawer-Bh8VAeHB.js";import{d as jt}from"./recharts-HpXoq1DR.js";import{g as _e,a as Ba,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as vc,i as $t,P as Fc,j as Mt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Bc,S as Sn}from"./SetupPagesScreen-CNVeqnHU.js";import{u as Tr}from"./useInitialThreadRequest-TMWlbA40.js";import ot from"./NotFoundScreen-BFfoIcMt.js";import{u as Nt}from"./useChargeCardPusherEvents-K7_8wfj8.js";import{n as yn}from"./utils-8Dv5nUFZ.js";import{t as Lc}from"./AddressScreen-CSJE0p29.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./InboxNotificationsProvider-D007v5X6.js";import"./useTaskManagerAccess-BJoTHFNB.js";import"./BusinessVerificationPageScreen-CmhKA9oQ.js";import"./routePaths-BlnN04aI.js";import"./analyticsHelper-BBEm35nD.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="aa1ab88e-517b-40ee-bb28-dfdefc3d8222",e._sentryDebugIdIdentifier="sentry-dbid-aa1ab88e-517b-40ee-bb28-dfdefc3d8222")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},vr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Me(),t=me(),s=Le(),g=ve(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),v=d((O=>Tn(O.cardPolicyState))),L=d((O=>vn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Bn(O.cardPolicyState))),B=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Ln())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),$=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(vr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:v,suggestedBlockMerchants:L,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,v,L,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),V=D.fetchState,T=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??T;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,T]),K=r.useCallback((()=>{e(T)}),[e,T]),Z=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),M=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),N=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(V);r.useEffect((()=>{const O=Q.current;Q.current=V,V==="Completed"&&O!=="Completed"&&$!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(T))}),[t,V,$,e,T]);const c=V==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:B==="In-Progress",onVendorSearchTextChange:z,submitState:V,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:Z,onSubmit:I,onUploadDocument:M,onRemoveDocument:N})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:$c}}}=ea.getLocalizedStrings(),Mc=e=>Un(e,!1),Nc=e=>jn(e.name,!1);function Vc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Me(),s=me(),g=Le(),b=ve(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),v=d((c=>Pn(c.cardPolicyState))),L=d((c=>wn(c.cardPolicyState))),S=d((c=>Tn(c.cardPolicyState))),l=d((c=>vn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),B=d((c=>xn(c.cardPolicyState))),k=d((c=>Bn(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),$=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:$!=null?Is($):void 0),[p.templateId,p.formDraft,$,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||$!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,$]),r.useEffect((()=>{v!=="Completed"&&v!=="In-Progress"&&s(Ln())}),[s,v]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>L.map(Mc)),[L]),i=r.useMemo((()=>k.map(Nc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(vr)),[D.cards]);Lt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:B})}),[E,f,R,i,y,S,l,C,B]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),V=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{V.cancel()}),[V]);const T=r.useCallback((c=>{V(c)}),[V]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",Z=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),M=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),N=r.useRef(P);r.useEffect((()=>{const c=N.current;N.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??$c.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&v==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:T,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:Z,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:M})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:Z,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Br(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Hc,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Me(),t=me(),s=Le(),g=ve(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((T=>{h(T)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(W.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(W.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:v}=xa({mobileExploreReferrer:"Card Policy"}),L=d((T=>_s(T))),S=d((T=>Rn(T.createCardPolicyState))),l=d((T=>Ps(T.createCardPolicyState))),C=d((T=>l==null?[]:Mn(T.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),B=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((T=>ws(T.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((T=>{t(yt({chatSessionId:l,id:T.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const T=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:T}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=L.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(Ts())}),[t,D]);const $=L.archiveFetchState.fetchState,E=ya($);r.useEffect((()=>{E==="In-Progress"&&$==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[$,t,E]);const y=r.useMemo((()=>L.templates.map(zc)),[L.templates]);Lt({isDataReady:L.fetchState.fetchState==="Completed"});const R=y.length>0||B>0,i=(function(T){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:Z}=T,I=de(),M=he(),{tenantEmailDomain:N}=Me(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>$n(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:Ve}=Br("card_policy"),Ae=r.useMemo((()=>xr(X,Ve,3)),[X,Ve]),[ge,re]=r.useState(""),be=q&&O&&N!=null&&!Q,ue=r.useCallback((J=>{if(N==null)return;const fa=ke(M.state?.pathnameStackToGoBack,M.pathname);I(`/${N}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[M.pathname,M.state,I,N]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),Te=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:Hc,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:Z,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:Te,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,Z,se,De,Ce,Te,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const T=we(a.state?.pathnameStackToGoBack),P=T.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:T.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((T=>{n!=null&&e(`/${n}/cards/policy/${T}/edit`)}),[e,n]),z=r.useCallback((T=>{t(vs(T))}),[t]),V=L.fetchState.fetchState;return!R&&V!=="Completed"&&V!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:v})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:L.archiveTargetTemplateId,pendingCreationCount:B,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})]})}function Wc(){const e=de(),{cardId:a}=Me(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Le(),b=ve(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(W.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:v}=h(W.isDebitCardFeatureEnabled),L=Fe(s),S=xe(s),l=Be(v,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Re({isDebitCardFeatureEnabled:v,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),$=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>Tt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),V=z?.accountingClassIDs[0],T=d((X=>V!=null?Ka(X.classState,{classId:V,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),Z=K?.accountingClassIDs[0],I=d((X=>Z!=null?Ka(X.classState,{classId:Z,reportId:"class_list"}):void 0)),M=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",N=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&M&&(u(!0),setTimeout((()=>{n(za()),N&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,M,N]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(M===!1||M&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,M]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(vt()),R!=="Completed"&&R!=="In-Progress"&&n(Nn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,B,_,p),q=Ba(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(Ta,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:$,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:B,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:T?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Lr="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Vt="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",Ht="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Zc="charge-card-department-updated",$r="charge-card-repayment-completed",Mr="charge-card-payment-date-updated",La="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,La],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((v=>fe(v))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(W.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((v=>ma(v))),m=Tr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const v=we(n.state?.pathnameStackToGoBack),L=v.poppedPathname??Xc(s.tenantEmailDomain);e(L,{state:{pathnameStackToGoBack:v.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Nt({events:ha(w,qc),onEvent:v=>{switch(v){case Ra:case La:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=va(),n=me(),t=de(),{cardId:s}=Me(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,v]=r.useState(!1),L=te.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,B=d((I=>xs(I,s))),k=B.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:$}=D(W.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(W.isDebitCardFeatureEnabled),y=Be(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:$,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&B.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,B.fetchState,h,_]);const V=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(B.fetchState==="Completed"){if(F===!1&&(V===!1||V&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==L.userId)){const I=_e(S.tenantEmailDomain,s,L,k,!0),M=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:M}})}else if(F&&B.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Bs({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,L,k,!0),M=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:M}})}}}),[B.fetchState,k?.type.code,F,B.isRefreshingViewInBackground]);const T=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Vn(I.userState,L.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{B.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[B.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const Z=I=>{v(I)};if(_!=="Completed"||k==null)return o.jsx(Ta,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:Z}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:L,isSandboxEnv:Rt(),chargeCardDetailState:B,signedInUserToken:T,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Ls(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=Hn(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ne.div`
2
- display: flex;
3
- flex-direction: column;
4
- width: ${e=>`${ei.containerWidth.value(e.windowSize)}%`};
5
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
6
- `,ri=Ne.div`
7
- display: flex;
8
- min-height: 100%;
9
- width: 100%;
10
- flex: 1 1 auto;
11
- flex-direction: column;
12
- align-items: center;
13
- background-color: ${e=>e.theme.colors.grey4};
14
- `,Wa=ea.getLocalizedStrings().dateFormat,si={overlayWidth:new Fa(100,100,58)},Nr=[$r,ct],oi=new Set(Nr),ci=Pe((function(e,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ms(e,n,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Ns(e.depositAccountState,e.depositAccountListState)}}),(function(e,a){const{navigate:n,currentTenant:t,isCashbackInfoFetchStateCompleted:s,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:b,controllerEmails:h,paymentDetails:A,productInformation:u,cashbackInformation:m,paymentSourceInformation:F,creditAccountInformation:w,debitAccountInformation:p,paymentInitiatedDate:v,sourcePage:L}=a,{tenantEmailDomain:S}=t,l=()=>{e(zn(!0));const C=aa(t);C!=null&&C!==""&&e(Pa(C,!0,!0)),e(qe(!0))};return{onBackNavigation:()=>{if(s&&g&&b&&m!=null&&ae.trackCardsPayEarlyFormClick(h,u,m,"Back",A.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:A.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:A.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:A.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:A.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:v?.add(3,"day").format(Wa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:v?.format(Wa.visual.MMMDCommaYYYYformat)},F,w,p),L==="cardPaymentHistory")a.closeDrawerHandler(!0),e(Yn());else{const C=ta(S);n(C)}},onUpdatePaymentAccountStatus:(C,B,k)=>{e(Gs(C,B,"bill_pay","bill_pay_detail",k))},onEstablishConnectionSuccess:()=>{e(Pa(t.companyId,!0))},onFetchLinkTokenClick:C=>{e(Hs("external_account",C))},onEstablishConnectionClick:C=>{e(Vs(C,t.companyId,"charge_card_payment","charge_cards"))},onEventReceived:C=>{oi.has(C)&&l()},onPusherSubscribed:l}}))(st(ic)),zt=({isPaymentDrawerOpen:e,closeDrawerHandler:a,pageName:n,creditAccountSpentAmount:t,productInformation:s,sourcePage:g,creditAccountInformation:b,debitAccountInformation:h,cashbackInformation:A,isDebitCardInfoFetchStateCompleted:u,isCreditCardInfoFetchStateCompleted:m,isCashbackInfoFetchStateCompleted:F,paymentInitiatedDate:w,retryRepayment:p})=>{const v=de(),{useDynamicConfig:L}=le(),S=d((N=>Gn(N))),{creditAccount:l}=d((N=>ua(N))),C=d((N=>fe(N))),B=Ot(),k=va(),_=me(),D=te.getSignedInUser(),$=Le(),[E,y]=r.useState(!1),[R,i]=r.useState(!1),{configValue:f}=L(Qe.zeniCardsConfig),j=f.credit_card_auto_pay_threshold_by_company_id?.[C.companyId]??f.default_credit_card_auto_pay_threshold??vc,G=Kn($?.loggedInUserRoleMap),U=js($?.loggedInUserRoleMap),x=d((N=>wa(N,C.companyId))),z=x.companyChargeCardInfo?.primaryFundingAccount,V=x.allFundingAccounts.find((N=>N.id===z?.accountId)),T=d((N=>da(N,C.companyId))),P=la(T.controllers);r.useEffect((()=>{if(S.fetchState!=="Completed"&&S.fetchState!=="In-Progress"&&_(zn()),S.fetchState==="Completed"&&!R){const N=C.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,Q=S.transferFromAccounts.find((O=>O.id===N));let c;if(g==="cardPaymentHistory"&&p){const O=p.paymentAccountId!=null?S.transferFromAccounts.find((q=>q.id===p.paymentAccountId)):void 0;c={amount:p.amount,isAutoRepayment:C.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:yn(),transferFrom:O??Q}}else c={amount:{amount:l.balance.amount+l.hold.amount,currencyCode:l.balance.currencyCode,currencySymbol:l.balance.currencySymbol},isAutoRepayment:C.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:yn(),transferFrom:Q};_(gn(c)),i(!0)}}),[S.fetchState,R,g,p,S.transferFromAccounts,C.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,C.companyChargeCardInfo?.info?.isAutoPayEnabled,l.balance.amount,l.balance.currencyCode,l.balance.currencySymbol,l.hold.amount,_]);const K={isZeniCheckingEnabled:C.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:V?.accType==="depositAccount",creditCardPaymentSourceAccountName:V?.label,creditCardPaymentSourceAccountType:V?.accType,creditCardPaymentSourceLastFourDigits:V?.accountLast4,creditCardPaymentSourceBalance:V?.accountBalance?.available?.amount??0};if(r.useEffect((()=>{x.fetchState!=="Completed"&&x.fetchState!=="In-Progress"&&_(Pa(C.companyId,!0))}),[x.fetchState]),r.useEffect((()=>{S.updateStatus==="Completed"&&A!=null&&F&&m&&u&&ae.trackCardsPayEarlyPayNowClick(P,s,A,S.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:S.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:S.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:S.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:S.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:w?.add(3,"day").format(Wa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:w?.format(Wa.visual.MMMDCommaYYYYformat)},K,b,h)}),[S.updateStatus,A,F,m,u,w]),r.useEffect((()=>{S.fetchState==="Completed"&&A!=null&&F&&m&&u&&!E&&e&&R&&A!=null&&(ae.trackCardsPayEarlyFormView(P,s,A,n,C.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,l.balance.amount,K,b,h),y(!0))}),[S,F,m,u,E,e,R]),D==null)throw Error("Can't access invite people page without signing in...");const Z=()=>{a(!0),_(Yn())},I=aa(C),M={events:e?ha(I,Nr):[],eventCallback:(N,Q,c)=>{c.onEventReceived(N)},onSubscribed:N=>{N.onPusherSubscribed()}};return o.jsx(o.Fragment,{children:o.jsx(Ar,{onClose:()=>{Z()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:si.overlayWidth.valuePercentage(k),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:B.colors.black,opacity:.75,cursor:"pointer"}}},children:o.jsx(ii,{onClick:N=>N.stopPropagation(),children:o.jsx(ci,{...M,closeDrawerHandler:a,navigate:v,paymentDetails:S,creditAccountSpentAmount:t,onTransferClick:()=>{F&&m&&u&&A!=null&&ae.trackCardsPayEarlyFormClick(P,s,A,"Pay Now",S.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:S.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:S.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:S.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:S.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},K,b,h),_($s({companyId:C.companyId}))},onDismissClick:Z,onSaveChangesToLocalStore:N=>{_(gn(N))},currentTenant:C,hasZeniAccountsAdminAccess:G,isZeniAccountsUser:U,productInformation:s,sourcePage:g,controllerEmails:P,autoPayThreshold:j,paymentSourceInformation:K,creditAccountInformation:b,debitAccountInformation:h,cashbackInformation:A,isCashbackInfoFetchStateCompleted:F,isCreditCardInfoFetchStateCompleted:m,isDebitCardInfoFetchStateCompleted:u,paymentInitiatedDate:w})})})})},ii=Ne(Tc)`
15
- display: flex;
16
- min-height: 100%;
17
- flex-direction: column;
18
- `,Yt=e=>e!=null&&typeof e=="object"?e:null,ie=e=>typeof e=="string"?e:void 0,je=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Za=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",gt=e=>{if(e==null||typeof e!="object")return!1;const a=e;return typeof a.transaction_id=="string"&&typeof a.amount=="number"&&typeof a.currency_code=="string"&&typeof a.currency_symbol=="string"&&typeof a.direction=="string"&&!!Za(a.transaction_status)&&!!Za(a.transaction_type)},Wt=(e,a)=>{const n=e?.card_status;if(!Za(n))return null;const t=e?.is_locked_by_admin;return{cardId:a,cardStatus:n,isLockedByAdmin:typeof t=="boolean"?t:void 0}},At=[Lr,Rr,Or,Ur,jr,pa,Vt,ct,Ht,Gt,Kt],Vr=[Ra,La],di=new Set([...At,...Vr]),bt=ea.getLocalizedStrings().dateFormat,li=Pe((function(e,a){const{includeCreditAccountInfo:n,cardId:t,signedInUserToken:s,isChargeCardFeatureEnabled:g}=a,b=te.getSignedInUser(),h=e.tenantState.currentTenantId,A={userId:b?.userId??"",sessionId:b?.zeniSessionId??"",tenantId:h??""},u=Tt(e,t,n,g),m=Xs(e,t),F=eo(e);return{chargeCardDetailView:u,chargeCardsRecurringExpensesState:m,vgsVaultId:rt.cardVaultId,transactionAttachmentsEndpointToFetch:`${Et}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Et}/card_transaction_attachment`,authParams:A,isSnackbarOpen:F.isSnackbarOpen,cardsEndPoint:`${yr.cardMicroServiceBaseUrl}`,signedInUserToken:u.twoFAView.token??s,receiptsEmail:Zn(e.tenantState,h)}}),(function(e,a){const{cardId:n,currentTenant:t,navigate:s,location:g,cardProviderId:b,includeCreditAccountInfo:h,setIsPaymentOpen:A,controllerEmails:u,productInformation:m,cashbackInformation:F,primaryFundingAccountDetails:w,creditAccountInformation:p,debitAccountInformation:v,isChargeCardFeatureEnabled:L}=a,{tenantEmailDomain:S}=t;return{onEventReceived:(l,C)=>{(({event:B,data:k,cardId:_,dispatch:D,subscribedEvents:$})=>{const E=Yt(k);switch(B){case Ra:case La:return void D(_a(!0));case Lr:{const y=ie(E?.card_id);if(y==null||y!==_)return;const R=ie(E?.transaction_id),i=E?.transaction_status;return R!=null&&Za(i)?void D(Js({transactionId:R,transactionStatus:i})):void D(oa(_,null,null,!0))}case pa:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=Wt(E,y);return R!=null?void D(Ft(R)):void D(ba(_,!0))}case Vt:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=ie(E?.currency_code),i=ie(E?.currency_symbol),f=je(E?.balance);return R!=null&&i!=null&&f!=null?(D(qs({cardId:y,currencyCode:R,currencySymbol:i,balance:f,hold:je(E?.hold),dailyPurchaseSpends:je(E?.daily_purchase_spends),monthlyPurchaseSpends:je(E?.monthly_purchase_spends),dailyWithdrawals:je(E?.daily_withdrawals),monthlyWithdrawals:je(E?.monthly_withdrawals)})),void D(qe(!0))):(D(ba(_,!0)),void D(qe(!0)))}case ct:{const y=ie(E?.currency_code),R=ie(E?.currency_symbol),i=je(E?.available_amount),f=je(E?.balance_amount);return y!=null&&R!=null&&i!=null&&f!=null?void D(Zs({currencyCode:y,currencySymbol:R,available:i,balance:f,hold:je(E?.hold_amount),cashback:je(E?.cashback_amount)})):void D(qe(!0))}case Rr:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=E?.transaction;return gt(R)?void D(Ws({cardId:y,transaction:R})):void D(oa(_,null,null,!0))}case Or:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=E?.transaction;return gt(R)?void D(Ys({cardId:y,declineReason:ie(E?.decline_reason),transaction:R})):void D(oa(_,null,null,!0))}case Ur:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=E?.transaction;return gt(R)?void D(zs({cardId:y,transaction:R})):void D(oa(_,null,null,!0))}case jr:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=ie(E?.transaction_id),i=E?.attachment_file_paths;return R!=null&&Array.isArray(i)&&i.every((f=>typeof f=="string"))?void D(Ks({cardId:y,transactionId:R,attachmentFilePaths:i})):void D(oa(_,null,null,!0))}case Ht:case Gt:case Kt:{const y=ie(E?.card_id);if(y==null||y!==_)return;D(ba(_,!0))}}})({event:l,data:C,cardId:n,dispatch:e,subscribedEvents:di})},onPusherSubscribed:()=>{e(ba(n,!0)),e(oa(n,null,null,!0)),e(qe(!0))},onReloadTransactions:()=>{e(ka(n,h,L))},onFetchChargeCardTransactionList:(l,C)=>{e(oa(n,l,C))},onUpdateScrollYOffset:l=>{},onGetOtp:l=>{b!=null&&e(at(l,"ChargeCardHolder",n))},onResendOtp:l=>{b!=null&&e(et(l,"ChargeCardHolder",n))},onVerifyOtp:(l,C)=>{b!=null&&e(Xa(l,C,"ChargeCardHolder",n))},onVerifyOtpSuccess:l=>{l!=null&&te.saveZeniOtpTokenForCardHolder(l,n)},onColorCodeChange:l=>{e(oo(n,l))},onLockChargeCard:(l,C)=>{e(nr(l,n,C))},onUnlockChargeCard:l=>{e(tr(l,n))},onCloseChargeCard:l=>{e(ar(n,l))},onFetchChargeCardsRecurringExpenses:()=>{e(er([n]))},updateChargeCardName:(l,C)=>{e(Xn(l,n,C))},updateChargeCardTransactionAttachments:(l,C)=>{C!=null&&e(so({transactionId:l,data:C}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(l,C,B,k)=>{e(ro({chargeCardId:C,transactionId:l,fetchState:B,error:k}))},updateChargeCardTransactionReceiptsShowTick:(l,C,B)=>{e(no({chargeCardId:C,transactionId:l,shouldShowTick:B}))},onChargeCardRevokeInviteClick:()=>{e(Qn(n))},updateChargeCardTransactionIsViewReceiptClicked:(l,C,B)=>{e(to({chargeCardId:C,transactionId:l,isViewReceiptClicked:B}))},onChargeCardTransactionRowClick:(l,C)=>{const B=ke(g.state?.pathnameStackToGoBack,g.pathname);s(`../../transaction/${l}/${C}`,{state:{pathnameStackToGoBack:B}})},onBackClick:()=>{const l=we(g.state?.pathnameStackToGoBack),C=ta(S);s(C,{state:{pathnameStackToGoBack:l.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(ao())},onUpdateDebitCardPinAttempt:l=>{e(Jn(n,l)),l==="success"&&e(ze({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(l,C)=>{l?e(ze({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):C!=null&&e(ze({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:C.message}]}))},updateSpendLimit(l,C,B,k){e(qn(l,C,B.code,k))},shouldOpenCreditCardPaymentDrawer(l){l&&F!=null&&ae.trackCardsPayEarlyClick(u,m,F,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:t.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:w?.accType==="depositAccount",creditCardPaymentSourceAccountName:w?.label,creditCardPaymentSourceAccountType:w?.accType,creditCardPaymentSourceLastFourDigits:w?.accountLast4,creditCardPaymentSourceBalance:w?.accountBalance?.available?.amount??0},p,v),A(l)}}}))(st(lc));function ui(){const e=de(),a=me(),n=he(),{cardId:t}=Me(),[s,g]=r.useState(!1),[b,h]=r.useState(!1),{useDynamicConfig:A}=le(),u=te.getSignedInUser(),m=d((Y=>fe(Y))),F=d((Y=>qa(Y).firstViewAfterActivation)),w=d((Y=>Y.classListState.fetchState)),{configValue:p}=A(Qe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:v}=A(Qe.zeniCardsConfig),L=v.enable_card_controls_for_company_ids,S=v.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(L)&&L.includes(m.companyId),[l,C]=r.useState(!1),[B,k]=r.useState(!1),{useFeatureGate:_}=le(),{isFeatureEnabled:D}=_(W.isChargeCardFeatureEnabled),{isFeatureEnabled:$}=_(W.isDebitCardFeatureEnabled),E=Be($,m),y=Re({isDebitCardFeatureEnabled:$,isBankingOnlyTenant:E}),{isFeatureEnabled:R}=_(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=_(W.isCardsCommentingEnabled),f=xe(m),j=Fe(m),G=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:D,isBookKeepingTenant:f,isDebitCardProductVisible:y,chargeCardsCreditAccountLimit:G}),x=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,z=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,V=!m.userRole.includes("charge_card_user")&&U&&z;if(t==null)throw Error("Empty card id is not valid...");const T=d((Y=>wa(Y,m.companyId))),{creditAccount:P,creditAccountRepayment:K}=d((Y=>ua(Y))),Z=te.getZeniOtpTokenForCardHolder(t),I=d((Y=>Tt(Y,t,V,U))),{isAiCfoAccessEnabled:M,onAskAiCfoClick:N}=xa({mobileExploreReferrer:"Card Detail"});Lt({isDataReady:I.fetchState==="Completed"});const Q=d((Y=>ma(Y))),c=I.chargeCard,O=Le(),q=ve(O?.loggedInUserRoleMap),se=c?.type.code==="business_physical_debit_card"||c?.type.code==="business_virtual_debit_card",X=c?.type.code==="business_physical_debit_card"||c?.type.code==="business_physical_credit_card",Ve=c?.type.code==="business_virtual_debit_card"||c?.type.code==="business_virtual_credit_card",Ae=c?.type.code==="business_virtual_debit_card",ge=Ba(U,z,q,P,K),re=Dr(se,I),be=$t(q,Q),ue=Xe(U,y,x,z),oe=I.depositAccountLimitFetchState.fetchState!=="Completed"&&I.depositAccountLimitFetchState.fetchState!=="In-Progress",Se=d((Y=>da(Y,m.companyId))),ee=la(Se.controllers),De=d((Y=>c?.cardCreatedByUser?.userId!=null?Ga(Y.userRoleState,c?.cardCreatedByUser?.userId):void 0)),Te=d((Y=>De?.accountingClassIDs[0]!=null?Ka(Y.classState,{classId:De?.accountingClassIDs[0],reportId:"class_list"}):void 0)),Ce=d((Y=>c?.cardHolderUser?.userId!=null?Ga(Y.userRoleState,c?.cardHolderUser?.userId):void 0)),J=d((Y=>Ce?.accountingClassIDs[0]!=null?Ka(Y.classState,{classId:Ce?.accountingClassIDs[0],reportId:"class_list"}):void 0)),fa=m?.userRole,na=d((Y=>Ca(Y,!1,y,D).revokeCardInvite)),Oa=ya(na.saveStatus.fetchState);if(r.useEffect((()=>{if(Oa==="In-Progress"&&na.saveStatus.fetchState==="Completed"){const Y=ta(m.tenantEmailDomain);e(Y)}}),[Oa,na.saveStatus.fetchState,e,m.tenantEmailDomain]),r.useEffect((()=>{F&&s===!1&&Ve&&(g(!0),setTimeout((()=>{a(za()),Ae&&a(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[F,s,Ve,Ae]),r.useEffect((()=>{l||I.fetchState==="Completed"||I.fetchState==="In-Progress"||t==null||(C(!0),a(ka(t,V,U,!1)))}),[l,I,t,a]),r.useEffect((()=>{!B&&I.fetchState==="Completed"&&I.chargeCard?.connectedAccountId!=null&&se&&oe&&q&&(k(!0),a(Wn({depositAccountId:I.chargeCard?.connectedAccountId})))}),[B,I,a,oe,q]),r.useEffect((()=>{Q.fetchState!=="Completed"&&Q.fetchState!=="In-Progress"&&q&&a(_a()),w!=="Completed"&&w!=="In-Progress"&&a(Nn()),I.transactionStatistics.fetchState!=="Completed"&&I.transactionStatistics.fetchState!=="In-Progress"&&a(Qs({chargeCardId:t})),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&a(Pa(m.companyId,!0))}),[Q.fetchState,a,q,w,I.transactionStatistics.fetchState,T.fetchState]),r.useEffect((()=>{if(!(I.fetchState!=="Completed"||U&&P.fetchState!=="Completed"||c==null||I.transactionStatistics.fetchState!=="Completed"||se&&q&&I.depositAccountLimitFetchState.fetchState!=="Completed")){const Y=c.type.code.includes("physical"),ye=Y?c.cardActivationAttemptHistory[0]?.timestamp:c.createTime;ae.trackCardsCardDetailView(ee,ue,{cardId:t,cardName:c.cardName,cardType:c.type.code.includes("credit")?"credit":"debit",cardCategory:Y?"physical":"virtual",cardLimit:Sa(c.limit.amount),cardLastFourDigits:c.accountLast4,cardStatus:c.status.code,cardAssignedDate:c.createTime?.format(bt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:c.providerCardCreateTime?.format(bt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:ye?.format(bt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:c.creditLimitFrequency.name,cardSpentAmount:Sa(c.balance.amount),cardAvailableLimit:Sa(c.available.amount),cardUtilizationPercent:c.limit.amount>0?Math.round((c.limit.amount-c.available.amount)/c.limit.amount*100):0,cardUtilizationAmount:Sa(c.limit.amount-c.available.amount),totalNumberOfDeclinedTransactions:I.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:I.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:I.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:I.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:I.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:I.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:kt(c.cardCreatedByUser,!1),cardIssuedByEmail:c.cardCreatedByUser?.email,cardIssuedByUserId:c.cardCreatedByUser?.userId,cardIssuedByRole:De?.userRoles,cardIssuedByDepartment:Te?.className},{cardholderName:kt(c.cardHolderUser,!1),cardholderEmail:c.cardHolderUser?.email,cardholderRole:Ce?.userRoles,cardholderUserId:c.cardHolderUser?.userId,cardholderDepartment:J?.className},ge,re)}}),[I.fetchState,I.depositAccountLimitFetchState.fetchState,I.transactionStatistics.fetchState,P.fetchState,q]),u==null)throw Error("Can't access card detail page without signing in...");const dt=aa(m),Ea=q?[...At,...Vr]:At,ra={events:ha(dt,Ea),eventCallback:(Y,ye,ce)=>{ce.onEventReceived(Y,ye)},onSubscribed:Y=>{Y.onPusherSubscribed()}},Aa=()=>{if(t!=null&&c!=null){const{ownerName:Y,cardName:ye,utilisation:ce,limit:He,frequency:Ye,cardColor:Ge}=St(c),Ke=c.cardHolderUserId===u.userId;ae.trackCardsDetailPageViewed(t,Y,ye,ce,He,Ye,Ge,Ke)}};r.useEffect((()=>{if(I.fetchState==="Completed"){const Y=I.chargeCard;if(Y?.status.code==="inactive"||se&&Y?.isPinSet===!1||X&&F){const ye=_e(m.tenantEmailDomain,t,u,c,F);e(ye)}}}),[I.fetchState]);const lt=(Y,ye)=>{if(t!=null&&c!=null){const{ownerName:ce,cardName:He,utilisation:Ye,limit:Ge,frequency:Ke}=St(c),sa=c.cardHolderUserId===u.userId;ae.trackCardsDetailPageClicked(t,ce,He,Ye,Ge,Ke,Y,sa,ye)}},ut=(Y,ye)=>{if(t!=null&&c!=null){const{ownerName:ce,cardName:He,utilisation:Ye,limit:Ge,frequency:Ke}=St(c),sa=c.cardHolderUserId===u.userId;ae.trackCardsVerifyPopUpClick(t,ce,He,Ye,Ge,Ke,Y,sa,ye)}},pe=P.balance.amount+P.hold.amount,Ua=m.companyChargeCardInfo?.info?.primaryFundingAccount,Da=T.allFundingAccounts.find((Y=>Y.id===Ua?.accountId)),ja=I.chargeCard!=null,$a=I.depositAccountLimit!=null;return I.fetchState!=="Error"||ja?!ja&&(I.fetchState==="In-Progress"||I.fetchState==="Not-Started")||na.saveStatus.fetchState==="In-Progress"||!$a&&se&&q&&I.depositAccountLimitFetchState.fetchState!=="Completed"?o.jsx(dc,{}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:F}),I.fetchState==="Completed"?o.jsx(Ut,{analytics:ae,onLoad:Aa}):null,b===!0?o.jsx(zt,{closeDrawerHandler:()=>h(!1),isPaymentDrawerOpen:b,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ue,creditAccountInformation:ge,debitAccountInformation:re,cashbackInformation:be,creditAccountSpentAmount:pe,isDebitCardInfoFetchStateCompleted:!se||!q||I.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!U||P.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!q||Q.fetchState==="Completed",paymentInitiatedDate:K.initiatedRepaymentDate}):null,o.jsx(li,{...ra,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:ut,onFireOnClickAnalytics:lt,isSandboxEnv:Rt(),signedInUser:u,location:n,navigate:e,setIsPaymentOpen:h,cardIssuedByRoles:De?.userRoles,cardIssuedByDepartmentName:Te?.className,cardHolderRoles:Ce?.userRoles,cardHolderDepartmentName:J?.className,loggedInUserRole:fa,isChargeCardFeatureEnabled:U,isDebitCardFeatureEnabled:y,isDebitCardSetupEnabled:x,isChargeCardSetupEnabled:z,isCardControlsEnabled:S,isEarlyPayEnabled:R,controllerEmails:ee,chargeCardCashbackDetailState:Q,productInformation:ue,creditAccountInformation:ge,debitAccountInformation:re,cashbackInformation:be,classListFetchState:w,primaryFundingAccountDetails:Da,currentTenant:m,cardProviderId:I.chargeCard?.cardProviderID,cardId:t,creditAccount:P,creditAccountRepayment:K,includeCreditAccountInfo:V,signedInUserToken:Z,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:p.documentAiReceiptMaxSizeLimitBytes!=null?p.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:M,onAskAiCfoClick:N,isCardsCommentingEnabled:i})]}):o.jsx(ot,{})}const St=e=>{const a=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,n=e.cardName,t=(e.limit.amount??0)-(e.available.amount??0),s=e.limit.amount,g=e.creditLimitFrequency.name;return{ownerName:a,cardName:n,utilisation:t,cardColor:e.cardColorCode??"",frequency:g,limit:s}},{spendManagement:{chargeCard:{cardsAiCfoHero:{headline:mi,subheadline:Ci,pageTitle:pi}}}}=ea.getLocalizedStrings(),Hr=[pa,ct,Mr,La,Ra,it,Kt,Zc,Ht,Gt,Vt],hi=new Set(Hr),Dt=jt(((e,a,n,t)=>{e(ia(a,n,t,!0))}),400),fi=Ne.div`
19
- display: flex;
20
- width: 100%;
21
- flex: 1 1 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,gi=Pe((function(e,a){const n=Ca(e,a.includeCreditAccountDebitSummaryAndCashbackInfo,a.isDebitCardFeatureEnabled&&a.isDebitCardSetupEnabled,a.isChargeCardFeatureEnabled&&a.isChargeCardSetupEnabled);return{chargeCardListView:n,rowActionView:mo(e),bulkActionView:Co(e),companyLegalName:a.currentTenant.companyName,admins:a.admins,searchText:n.searchText,uiState:n.uiState,signedInUser:a.signedInUser,receiptsEmail:Zn(e.tenantState,a.currentTenant.tenantId)}}),(function(e,a){const{navigateAndClearBulkSelection:n,currentTenant:t,location:s,signedInUser:g,chargeCardListState:b,includeCreditAccountDebitSummaryAndCashbackInfo:h,isChargeCardFeatureEnabled:A,isCreditCardProductVisibleForExpressInterest:u,isChargeCardSetupEnabled:m,isDebitCardFeatureEnabled:F,isDebitCardSetupEnabled:w,isDebitCardTOSAccepted:p,isChargeCardTOSAccepted:v,controllerEmails:L,depositAccountListWithDebitCardIssued:S,primaryFundingAccountDetails:l,chargeCardSetUpViewFetchState:C,productInformation:B,cashbackInformation:k,creditAccountInformation:_,debitAccountInformation:D,updatePayNowInfoTooltip:$,isUserHasCardsAdminLevelAccess:E}=a,{tenantEmailDomain:y}=t,{cards:R}=b;return{onChargeCardRowClick:(i,f)=>{const j=Pr(R,i);let G;j!=null&&((x=>{const z=x.limit.amount-x.available.amount,V=`${x.cardHolderUser?.firstName.toLowerCase()} ${x.cardHolderUser?.lastName.toLowerCase()}`,T=x.cardName,P=x.department?.className??"",K=x.limit.amount,Z=x.creditLimitFrequency.name;ae.trackCardsListRowClicked(V,T,P,z,K,Z,g.userId===x.cardHolderUserId)})(j),ca(F,w,S)&&ae.trackCardsCardListRowClick(L,B,"Card Row Item","row_clicked",f+1,{cardOwner:kt(j.cardHolderUser,!1),cardName:j.cardName,cardType:j.type.code.includes("credit")?"credit":"debit",cardStatus:j.status.code,cardUtilizationAmount:Sa(j.limit.amount-j.available.amount),cardUtilizationPercent:j.limit.amount>0?Math.round((j.limit.amount-j.available.amount)/j.limit.amount*100):0,cardLimit:Sa(j.limit.amount)},k,_,D)),G=j?.status.code==="request_on_hold"&&g.userId===j.cardHolderUserId?wr(y):_e(y,i,g,j);const U=ke(s.state?.pathnameStackToGoBack,s.pathname);n(G,{state:{pathnameStackToGoBack:U}})},onFetchChargeCardsRecurringExpenses:i=>{e(er(i))},onFetchDepositAccountLimit:i=>{e(Wn({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Io(i))},onChargeCardRevokeInviteClick:i=>{e(Qn(i))},onLockChargeCardList:(i,f)=>{e(yo(i,f))},onUnlockChargeCardList:i=>{e(So(i))},onCloseChargeCardList:(i,f)=>{e(bo(i,f))},onRevokeChargeCardList:i=>{e(go(i))},updateChargeCardListSpendLimit(i,f,j){e(fo(i,f,j.code))},onLockChargeCard:(i,f)=>{e(nr(E,i,f))},onUnlockChargeCard:i=>{e(tr(E,i))},onCloseChargeCard:(i,f)=>{e(ar(i,f))},onUpdateSpendLimit(i,f,j,G){e(qn(i,f,j.code,G))},updateChargeCardName:(i,f)=>{e(Xn(E,i,f))},onClickSetupIcon:()=>{ae.trackCardsListPageClicked("settings"),ca(F,w,S)&&k!=null&&ae.trackCardsSettingsClick(L,B,k,_,D);const i=xc(y),f=ke(s.state?.pathnameStackToGoBack,s.pathname);n(i,{state:{pathnameStackToGoBack:f}})},onIssueCardClick:()=>{ae.trackCardsListPageClicked("new card"),ca(F,w,S)&&k!=null&&ae.trackCardsNewCardClick(L,B,k,"New Button","card_creation_initiated","Card List",_,D);const i=bi(y),f=ke(s.state?.pathnameStackToGoBack,s.pathname);n(i,{state:{pathnameStackToGoBack:f}})},onColumnSortConfigChanged:(i,f)=>{ca(F,w,S)&&k!=null&&ae.trackCardsCardListSortClick(L,B,k,"Sort Icon","sort",i,f==="ascending"?"ASC":"DESC","Cards List",_,D),e(It({uiState:{sortKey:i,sortOrder:f}}))},onSearchTextChanged:i=>{e(ho(i))},onReloadCards:()=>{e(ia(h,F&&w,A&&m,!0))},onLetsGoClick:()=>{n("./onboard")},onBackClick:()=>{n("../../")},onTotalCashbackClick:()=>{ca(F,w,S)&&k!=null&&ae.trackCardsCashbackOverviewClick(L,B,k,"Cashback Overview","cashback_details_viewed",_,D),n("./cashback")},onClickStatementsIcon:()=>{ca(F,w,S)&&k!=null&&ae.trackCardsStatementsClick(L,B,k,_,D),n("./statements")},onCreateNowClick:i=>{ca(F,w,S)&&k!=null&&ae.trackCardsNewCardClick(L,B,k,"Promo Banner","card_creation_initiated","Card List",_,D),n(`./new?cardType=${i}`)},onPromoCardClick:i=>{n(i==="debit"&&F&&!p||i==="credit"&&u&&!v?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,f)=>{C==="Completed"&&t.company!=null&&k!=null&&ae.trackCardsPayEarlyClick(L,B,k,"Card List",i,f,{isZeniCheckingEnabled:t.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:l?.accType==="depositAccount",creditCardPaymentSourceAccountName:l?.label,creditCardPaymentSourceAccountType:l?.accType,creditCardPaymentSourceLastFourDigits:l?.accountLast4,creditCardPaymentSourceBalance:l?.accountBalance?.available?.amount??0},_,D);const j=Si(y);n(j)},navigateToCreditCardPaymentHistoryPage:()=>{const i=yi(y),f=ke(s.state?.pathnameStackToGoBack,s.pathname);n(i,{state:{pathnameStackToGoBack:f}})},shouldShowPayNowInfoTooltip:$,onSetRowActionCardId:i=>{e(po(i))},onSetBulkActionCardIds:i=>{e(rr(i))},onEventReceived:i=>{hi.has(i)&&Dt(e,h,F&&w,A&&m)},onPusherSubscribed:()=>{Dt(e,h,F&&w,A&&m)}}}))(st(Cc));function kn({isPaymentDrawerOpen:e}){const a=de(),n=me(),t=he(),s=r.useCallback(((H,Ue)=>{n(rr([])),a(H,Ue)}),[n,a]),[g,b]=r.useState(!1),[h,A]=r.useState(te.getPayNowInfoTooltip()??!1),u=H=>{te.savePayNowInfoTooltip(H),A(H)},[m,F]=r.useState(!1),w=te.getSignedInUser(),p=d((H=>fe(H))),[v,L]=r.useState(!1),[S,l]=r.useState(!1),{isAiCfoAccessEnabled:C,onAskAiCfoClick:B}=xa({mobileExploreReferrer:"Cards"}),k=p.userRole.includes("charge_card_user"),_=!k,D=!!p.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:$,useDynamicConfig:E}=le(),{isFeatureEnabled:y}=$(W.isCashbackFeatureEnabled),{isFeatureEnabled:R}=$(W.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=$(W.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=$(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:j}=$(W.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:G}=$(W.isCardsCommentingEnabled),{isFeatureEnabled:U}=$(W.isAiCfoFileUploadEnabled),{isFeatureEnabled:x}=$(W.isCardPolicyEnabled),{isFeatureEnabled:z}=$(W.isAiCardCreationEnabled),V=Be(i,p),T=Re({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:V}),P=Fe(p),K=xe(p),Z=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Oe({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:K,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:Z}),M=_r({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:K}),{configValue:N}=E(Qe.zeniCardsConfig),Q=Le(),c=ve(Q?.loggedInUserRoleMap),O=d((H=>da(H,p.companyId))),q=la(O.controllers),se=N.charge_card_cashback_rate_per_transaction!=null?N.charge_card_cashback_rate_per_transaction:.0175,X=N.credit_card_pay_now_threshold_by_company_id?.[p.companyId]??N.default_credit_card_pay_now_threshold??Fc,Ve=N.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(N.enable_card_controls_for_company_ids)&&N.enable_card_controls_for_company_ids.includes(p.companyId),Ae=!!p.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,ge=!!p.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!p.companyChargeCardInfo?.info?.isChargeCardEnabled,be=!!p.company?.companyChargeCardInfo?.isChargeCardEnabled,ue=!!p.company?.companyDebitCardInfo?.isDebitCardEnabled,oe=d((H=>Gn(H))),Se=ya(oe.updateStatus),ee=d((H=>Ca(H,_,T&&D,I&&re))),De=d((H=>co(H))),Te=d((H=>io(H))),Ce=d((H=>lo(H))),J=d((H=>uo(H))),fa=d((H=>Ce==null?[]:Mn(H.aiCfoState,Ce).filter((Ue=>Ue.kind==="creating_cards"))),_t),na=ya(Te.fetchState);r.useEffect((()=>{na==="In-Progress"&&Te.fetchState==="Completed"&&Ce!=null&&fa.forEach((H=>{n(yt({chatSessionId:Ce,id:H.id,entityIds:J,kind:"created_cards"}))}))}),[n,Te.fetchState,Ce,J,fa,na]);const Oa=ee.cards.filter((H=>H.type.code.includes("debit"))).map((H=>H.connectedAccountId)),dt=[...new Set(Oa)],Ea=d((H=>ma(H))),ra=d((H=>tt(H,dt))),Aa=d((H=>wa(H,p.companyId))),lt=Aa.companyChargeCardInfo?.primaryFundingAccount,ut=Aa.allFundingAccounts.find((H=>H.id===lt?.accountId)),pe=ee.fetchState,Ua=ee.creditAccount,Da=r.useCallback((()=>c===!0&&x===!0&&pe==="Completed"&&te.getCardPolicyPopupSeen(p.tenantEmailDomain??"")!==!0),[c,x,pe,p.tenantEmailDomain]),[ja,$a]=r.useState(Da);r.useEffect((()=>{$a(Da())}),[Da]);const Y=()=>{te.saveCardPolicyPopupSeen(p.tenantEmailDomain??"",!0),$a(!1)},ye=pe==="Completed"&&!ee.hasCreditCard&&!ee.hasDebitCard;uc({isDataReady:pe==="Completed",pageContext:ye?"cards_creation":"cards"});const{creditAccountRepayment:ce}=d((H=>ua(H))),He=d((H=>qa(H).firstViewAfterActivation)),{areTenantIdsInSync:Ye}=Ir(),Ge=$t(c,Ea),Ke=Ba(I,re,c,Ua,ce),sa=Mt(T,D,c,ra,ee.debitCardSummary),mt=Xe(I,T,D,re),Ct=ee.creditAccount.balance.amount+ee.creditAccount.hold.amount;if(r.useEffect((()=>{pe==="Completed"&&(te.getPayNowInfoTooltip()==null||Ct<X*ee.creditAccount.limit.amount/100)&&u(!0)}),[pe,X,Ct,ee.creditAccount.limit.amount]),r.useEffect((()=>{if(e!=null&&e===!0&&ce.initiatedRepayments.amount===0&&ce.fetchState==="Completed"||Se==="In-Progress"&&oe.updateStatus==="Completed")u(!1),b(!0);else if(ce.initiatedRepayments.amount>0&&ce.fetchState==="Completed"){b(!1),document.body.style.overflow="auto";const H=ta(p.tenantEmailDomain);s(H)}}),[e,ce.initiatedRepayments.amount,ce.fetchState,Se,oe.updateStatus,s,p.tenantEmailDomain]),r.useEffect((()=>{!v&&(re||D)&&(be||ue)&&Ye&&(L(!0),n(ia(_,T&&D,I&&re,!1)))}),[v,_,n,Ye,be,ue]),r.useEffect((()=>{He&&m===!1&&(F(!0),setTimeout((()=>{n(za())}),5e3))}),[He,m]),r.useEffect((()=>()=>{Dt.flush()}),[]),r.useEffect((()=>{pe==="Completed"&&k&&ee.cards.length===1&&(ee.cards[0].status.code==="inactive"&&ee.cards[0].type.code==="business_physical_credit_card"?s(`./${ee.cards[0].id}/activate`):ee.cards[0].status.code!=="request_on_hold"&&(t.state?.message==="comingFromCardDetail"?s("../../"):s(`./${ee.cards[0].id}`)))}),[pe,k,t.state,s,ee.cards]),r.useEffect((()=>{if(pe==="Completed"&&k){const H=ee.cards.length,Ue=ee.cards.filter((We=>We.cardHolderUserId===w?.userId)).filter((We=>We.status.code==="request_on_hold"));Ue.length>0&&H===Ue.length&&s("./onboard")}}),[pe,ee.cards,k,s,w?.userId]),r.useEffect((()=>{pe!=="Completed"||I&&ce.fetchState!=="Completed"||T&&D&&c&&ra.fetchState!=="Completed"||ae.trackCardsCardListView(q,mt,Ge,Ke,sa)}),[pe,Ua,ce.fetchState,ra.fetchState,c]),w==null)throw Error("Can't access charge card list page without signing in...");const Yr=d((H=>sr(H.userState,H.userRoleState,H.userListViewState,"cardAdmin"))),Zt=xt(Q?.loggedInUserRoleMap),qt=H=>{l(H)},Wr=ee.creditAccount.limit,Zr=()=>{b(!1),s("..")},qr=p.companyChargeCardInfo?.info!=null&&Ia({cardInfo:p.companyChargeCardInfo.info,isProductVisible:I&&be,isTOSAccepted:Ae,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:Zt}),Jr=p.companyDebitCardInfo?.info!=null&&Ia({cardInfo:p.companyDebitCardInfo.info,isProductVisible:T&&ue,isTOSAccepted:ge,isSetupEnabled:D,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:Zt}),Qr=qr||Jr,Jt=(function(H){const{isEmptyCardsState:Ue,isChargeCardAdmin:We,isFileUploadEnabled:an}=H,tn=de(),Ma=he(),{tenantEmailDomain:Na}=Me(),{isAiCfoOpen:ns,setIsAiCfoOpen:nn}=fr(),rs=gr(),ss=br(),rn=d((Ie=>$n(Ie))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:sn,isResolved:on}=Br("cards_creation"),cn=r.useMemo((()=>xr(sn,on,3)),[sn,on]),[Va,pt]=r.useState(""),dn=ss&&rs&&Na!=null&&!ns,ga=r.useCallback((Ie=>{if(Na==null)return;const os=ke(Ma.state?.pathnameStackToGoBack,Ma.pathname);tn(`/${Na}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:os,referrer:"cards_hero",aiCfoInitialQuestion:Ie,aiCfoShouldSubmit:Ie!=null&&Ie.trim().length>0}})}),[Ma.pathname,Ma.state,tn,Na]),ln=r.useCallback((Ie=>{Ie.trim().length!==0&&(pt(""),ga(Ie))}),[ga]),un=r.useCallback((()=>{const Ie=Va.trim();Ie.length!==0&&(pt(""),ga(Ie))}),[Va,ga]),mn=r.useCallback((()=>{}),[]),Cn=r.useCallback((Ie=>{pt(Ie)}),[]),pn=r.useCallback((()=>{nn(!0)}),[nn]),hn=r.useCallback((()=>{ga(void 0)}),[ga]);return r.useMemo((()=>{if(dn&&Ue&&We)return{aiAgentName:pi,headline:mi,subheadline:Ci,promptChips:cn,composer:{currentInput:Va,isSubmitting:rn,isFileUploadEnabled:an,onInputChange:Cn,onSubmit:un,onStopSubmit:mn},onPromptClick:ln,onOpenSidePanel:pn,onOpenFullView:hn,dataTestIdPrefix:"cards-ai-cfo-hero"}}),[Va,dn,We,Ue,an,rn,Cn,hn,pn,ln,mn,un,cn])})({isEmptyCardsState:ye,isChargeCardAdmin:c,isFileUploadEnabled:U}),Qt=z&&Jt!=null?o.jsx(Sr,{...Jt}):null,{isCardsShuttingDown:Xt,shutdownContent:en}=kr(p.tenantId,p.company?.managementInfo?.receiverEmails),Xr=Xt===!0&&en!=null?o.jsx(mc,{shutdownContent:en}):null,es=C&&Qt==null,as=aa(p),ts={events:ha(as,Hr),eventCallback:(H,Ue,We)=>{We.onEventReceived(H)},onSubscribed:H=>{H.onPusherSubscribed()}};return re||D?o.jsxs(o.Fragment,{children:[pe==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ut,{analytics:ae,onLoad:()=>{ae.trackPageLoaded(Er.Event.cardsListPage),(I&&!re||T&&!D)&&ae.trackCardsPromoView(q,{isCreditCardOffered:I,isDebitCardOffered:T,isDebitCardEnabled:D,isCreditCardEnabled:re},"Banner",T&&!D?"Debit Card":I&&!re?"Credit Card":"","Card List")}}),o.jsx(nt,{showConfetti:He})]}):null,g===!0?o.jsx(zt,{closeDrawerHandler:Zr,isPaymentDrawerOpen:g,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ct,productInformation:mt,creditAccountInformation:Ke,debitAccountInformation:sa,cashbackInformation:Ge,isDebitCardInfoFetchStateCompleted:!(T&&D&&c)||ra.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!I||ce.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!c||Ea.fetchState==="Completed",paymentInitiatedDate:ce.initiatedRepaymentDate}):null,o.jsxs(fi,{children:[o.jsx(Ee,{isAppContentDrawerOpen:S,handleDrawerToggle:qt}),o.jsx(gi,{...ts,isCashbackFeatureEnabled:y,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:T,isCreditCardProductVisibleForExpressInterest:M,updatePayNowInfoTooltip:u,showPayNowInfoTooltip:h,creditCardPayNowThreshold:X,signedInUser:w,chargeCardListState:ee,location:t,admins:Yr.users,navigateAndClearBulkSelection:s,currentTenant:p,isCardControlsEnabled:Ve,companyChargeCardInfoCreditAccountLimit:p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:p.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:c,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{qt(!0)},creditLimit:Wr,isChargeCardSetupEnabled:re,isChargeCardEnabledOnCompany:be,isDebitCardSetupEnabled:D,isDebitCardEnabledOnCompany:ue,isEarlyPayEnabled:f,isChargeCardPaymentHistoryFeatureEnabled:j,cashbackRate:se,controllerEmails:q,chargeCardCashbackDetailState:Ea,depositAccountListWithDebitCardIssued:ra,isChargeCardTOSAccepted:Ae,isDebitCardTOSAccepted:ge,primaryFundingAccountDetails:ut,chargeCardSetUpViewFetchState:Aa.fetchState,productInformation:mt,creditAccountInformation:Ke,debitAccountInformation:sa,cashbackInformation:Ge,isAiCfoAccessEnabled:es,onAskAiCfoClick:B,isCardsCommentingEnabled:G,cardsAiCfoHero:Qt,cardsShutdownBanner:Xr,isCardsShuttingDown:Xt,onClickPolicyIcon:c&&x?()=>a(Ii(p.tenantEmailDomain)):void 0,isPolicyIntroTooltipVisible:ja,onPolicyIntroTooltipClose:Y,pendingCreationCount:De})]})]}):(Ae||ge)&&c===!0?o.jsx(Je,{to:"../setup"}):Qr?o.jsx(Je,{to:"../promo"}):o.jsx(Ta,{fetchState:pe})}const bi=e=>`/${e}/cards/new`,Si=e=>`/${e}/cards/payment`,yi=e=>`/${e}/cards/payment-history`,Ii=e=>`/${e}/cards/policy`,Gr=[$r,Mr],ki=new Set(Gr),Ei=Pe((function(e){const a=te.getSignedInUser(),n=fe(e),t=e.tenantState.currentTenantId,s=or(e),g={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:t??""},b=n?.companyName??"",h=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:s.fetchState,filters:s.filters,isZeniTenant:ko(n),repaymentList:s.repaymentHistory,searchText:s.searchText,repaymentHistoryUsers:s.repaymentHistoryUsers,sortConfig:{sortKey:s.uiState.sortKey,sortOrder:s.uiState.sortOrder},downloadParams:{authParams:g,companyName:b,spendManagementEndPoint:`${Et}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:h}}),(function(e,a){const{location:n,navigate:t}=a;return{onBackClick:()=>{const s=we(n.state?.pathnameStackToGoBack),g=s.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:s.newStack}})},onColumnSortConfigChanged:(s,g)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:s,sortOrder:g}}})},onFiltersChange:s=>{e(Ao({filters:s}))},onReloadPayments:()=>{e(Ha(!0))},onEventReceived:s=>{ki.has(s)&&e(Ha(!0))},onPusherSubscribed:()=>{e(Ha(!0))},onSearchTextChanged:s=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:s})},updateDownloadStateHandler:s=>{e(Eo({uiState:{downloadState:s}}))}}}))(st(pc));function Ai(){const e=de(),a=he(),n=me(),{areTenantIdsInSync:t}=Ir(),{useFeatureGate:s}=le();if(te.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const g=d((c=>fe(c))),b=d((c=>or(c))),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,v]=r.useState(null),L=!g.userRole.includes("charge_card_user"),S=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:l}=s(W.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=s(W.isDebitCardFeatureEnabled),B=Be(C,g),k=Re({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:B}),_=Fe(g),D=xe(g),$=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=Oe({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:l,isBookKeepingTenant:D,isDebitCardProductVisible:k,chargeCardsCreditAccountLimit:$}),y=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,R=Le(),i=ve(R?.loggedInUserRoleMap),f=d((c=>Ca(c,L,k&&S,E&&y))),j=r.useMemo((()=>{const c=f.cards.filter((O=>O.type.code.includes("debit")));return[...new Set(c.map((O=>O.connectedAccountId)))]}),[f.cards]),G=d((c=>ma(c))),U=d((c=>tt(c,j))),{creditAccountRepayment:x}=d((c=>ua(c))),z=r.useMemo((()=>$t(i,G)),[i,G]),V=r.useMemo((()=>Ba(E,y,i,f.creditAccount,x)),[E,y,i,f.creditAccount,x]),T=r.useMemo((()=>Mt(k,S,i,U,f.debitCardSummary)),[k,S,i,U,f.debitCardSummary]),P=r.useMemo((()=>Xe(E,k,S,y)),[E,k,S,y]),K=f.creditAccount.balance.amount+f.creditAccount.hold.amount,Z=r.useMemo((()=>p!=null?b.repaymentHistory.find((c=>c.cardRepaymentId===p)):void 0),[p,b.repaymentHistory]),I=r.useCallback((c=>{v(c),n(ia(L,k&&S,E&&y,!1)),w(!0)}),[n,L,k,S,E,y]),M=r.useCallback((()=>{w(!1),v(null),document.body.style.overflow="auto"}),[]);r.useEffect((()=>{h||b.fetchState==="Completed"||b.fetchState==="In-Progress"||(A(!0),n(Ha()))}),[h,n,b.fetchState]),r.useEffect((()=>{!u&&(y||S)&&t&&(m(!0),n(ia(L,!1,E&&y,!1)))}),[u,y,S,t,n,L,E]);const N=aa(g),Q={events:ha(N,Gr),eventCallback:(c,O,q)=>{q.onEventReceived(c)},onSubscribed:c=>{c.onPusherSubscribed()}};return o.jsxs(o.Fragment,{children:[F?o.jsx(zt,{closeDrawerHandler:M,isPaymentDrawerOpen:F,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:K,productInformation:P,creditAccountInformation:V,debitAccountInformation:T,cashbackInformation:z,isDebitCardInfoFetchStateCompleted:!(k&&S&&i)||U.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||x.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||G.fetchState==="Completed",paymentInitiatedDate:x.initiatedRepaymentDate,retryRepayment:Z}):null,o.jsx(Ei,{...Q,location:a,navigate:e,accountInfoByAccountId:b.accountInfoByAccountId,onRetryPaymentClick:I})]})}const En=Ne.div`
26
- display: flex;
27
- height: 100vh;
28
- width: 100%;
29
- flex: 1 1 auto;
30
- flex-direction: column;
31
- overflow: auto;
32
- align-items: center;
33
- background-color: ${e=>e.theme.colors.grey4};
34
- `,An=ea.getLocalizedStrings().months;function Di(){const e=de(),a=me(),n=he(),{creditAccount:t,creditAccountRepayment:s}=d((P=>ua(P))),g=`${yr.cardMicroServiceBaseUrl}/1.0/credit-accounts/${t.id}`,[b,h]=r.useState(!1),[A,u]=r.useState(!1),m=d((P=>Do(P))),{useFeatureGate:F}=le(),w=d((P=>fe(P))),{isFeatureEnabled:p}=F(W.isChargeCardFeatureEnabled),{isFeatureEnabled:v}=F(W.isDebitCardFeatureEnabled),{isFeatureEnabled:L}=F(W.isCardsCommentingEnabled),S=Tr(L?w.companyId:void 0,{clearParams:L&&m.fetchState==="Completed"}),l=Be(v,w),C=Re({isDebitCardFeatureEnabled:v,isBankingOnlyTenant:l}),B=Fe(w),k=xe(w),_=w.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=Oe({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:p,isBookKeepingTenant:k,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:_}),$=!!w.companyDebitCardInfo?.info?.isDebitCardEnabled,E=!!w.companyChargeCardInfo?.info?.isChargeCardEnabled,y=d((P=>da(P,w.companyId))),R=la(y.controllers),i=d((P=>cr(P))),f=i.cards.filter((P=>P.type.code.includes("debit"))).map((P=>P.connectedAccountId)),j=[...new Set(f)],G=d((P=>tt(P,j))),U=d((P=>_o(P)));r.useEffect((()=>{A||t.fetchState==="Completed"||t.fetchState==="In-Progress"||(h(!0),a(qe()))}),[b,a,t.fetchState]),r.useEffect((()=>{A||t.fetchState!=="Completed"||t.id==null||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(u(!0),a(Po(t.id)))}),[A,a,t.fetchState,t.id,m.fetchState]),r.useEffect((()=>{G.fetchState!=="Completed"&&G.fetchState!=="In-Progress"&&C&&$&&a(ir()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a($e()),U.fetchState!=="Completed"&&U.fetchState!=="In-Progress"&&C&&$&&a(wo()),s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&D&&E&&a(vt())}),[G.fetchState,C,$,i.fetchState,U.fetchState,s.fetchState,D,E]),r.useEffect((()=>{if(m.fetchState==="Completed"&&t.fetchState==="Completed"&&s.fetchState==="Completed"&&i.fetchState==="Completed"&&(!C||!$||G.fetchState==="Completed"&&U.fetchState==="Completed")){let P="",K="";if(m.statements.length>0){const N=m.statements[m.statements.length-1].period,[Q,c]=N.split("-"),O=m.statements[0].period,[q,se]=O.split("-");P=`${An[parseInt(c)-1]} ${Q}`,K=`${An[parseInt(se)-1]} ${q}`}const Z=Xe(D,C,$,E),I=Ba(D,E,!0,t,s),M=Mt(C,$,!0,G,U);ae.trackCardsCreditCardStatementsView(R,Z,{numberOfStatements:m.statements.length,oldestStatementMonthYear:P,latestStatementMonthYear:K},I,M)}}),[m.fetchState,t.fetchState,s.fetchState,G.fetchState,i.fetchState,U.fetchState]);const x=()=>{const P=we(n.state?.pathnameStackToGoBack),K=P.poppedPathname??"..";e(K,{state:{pathnameStackToGoBack:P.newStack}})},z=d((P=>ma(P))),V=te.getSignedInUser(),T={userId:V?.userId??"",sessionId:V?.zeniSessionId??"",tenantId:w.tenantId??""};if(V==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return o.jsx(En,{children:o.jsx(hc,{onBackClick:x})});{const P=Xe(D,C,$,E);return o.jsx(En,{children:o.jsx(fc,{currentTenantCompanyName:w.companyName,statementListView:m,productInformation:P,onBackClick:x,authParams:T,controllerEmails:R,isChargeCardFeatureEnabled:D,isDebitCardFeatureEnabled:C,isDebitCardSetupEnabled:$,isChargeCardSetupEnabled:E,isCardsCommentingEnabled:L,initialOpenThreadRequest:S,chargeCardCashbackDetailState:z,creditAccount:t,creditAccountRepayment:s,depositAccountListWithDebitCardIssued:G,debitCardSummary:U,downloadEndPoint:g})})}}const Kr=[pa,it],_i=new Set(Kr),Pi={containerWidth:new Fa(100,58)},wi=({appContent:e})=>{const a=va(),n=me(),t=de(),s=he(),{useDynamicConfig:g}=le(),[b,h]=r.useState(!1),[A,u]=r.useState(!1),[m,F]=r.useState(!1),[w,p]=r.useState(!1),v=r.useRef(!1),L=r.useRef(null);r.useEffect((()=>()=>{L.current!=null&&(clearTimeout(L.current),L.current=null)}),[]);const[S,l]=r.useState(!1),[C,B]=r.useState(!1),k=te.getSignedInUser();if(k==null)throw Error("Can't access onboarding card page without signing in...");const _=d((M=>fe(M))),{configValue:D}=g(Qe.zeniCardsConfig),$=d((M=>To(M))),{tenantEmailDomain:E}=_,y=d((M=>M.settingsViewState.profile.fetchState)),R=d((M=>M.chargeCardListState.fetchState)),i=d((M=>M.settingsViewState.profile.userId)),f=d((M=>M.chargeCardConfigState.fetchState));r.useEffect((()=>{b===!1&&y!=="In-Progress"&&y!=="Completed"&&(n(vo()),h(!0)),A===!1&&f!=="In-Progress"&&f!=="Completed"&&(n(Ja()),u(!0)),m===!1&&R==="Not-Started"&&(F(!0),n($e()))}),[b,m,R,A,f]),r.useEffect((()=>{y==="Completed"&&S===!1&&i!=null&&R==="Completed"&&$.cards.length>0&&(n(Fo({userId:i})),n(dr({cardId:$.cards[$.cards.length-1].id})),l(!0))}),[y,S,i,R]),r.useEffect((()=>{if(!w&&$.fetchState==="Completed"&&$.cards.length===0){const M=we(s.state?.pathnameStackToGoBack),N=M.poppedPathname??ta(E);t(N,{state:{pathnameStackToGoBack:M.newStack}})}}),[$.fetchState,$.cards,w]);const j=d((M=>qa(M))),G=ya(j.updateStatus.fetchState),U=j.currentDisplayedCardId,{useFeatureGate:x}=le(),{isFeatureEnabled:z}=x(W.isChargeCardFeatureEnabled),V=!!_.companyChargeCardInfo?.info?.isChargeCardEnabled,T=!_.userRole.includes("charge_card_user")&&z&&V,P=d((M=>U!=null?lr(M.chargeCardState,U):null)),K=()=>{U!=null&&(v.current=!0,L.current!=null&&clearTimeout(L.current),L.current=setTimeout((()=>{v.current=!1,L.current=null}),5e3),n(ka(U,T,!0)),n($e(!0)),p(!0))},Z=aa(_);Nt({events:ha(Z,Kr),onSubscribed:()=>{n($e(!0))},onEvent:(M,N)=>{if(!_i.has(M))return;const Q=Yt(N),c=v.current;if(M===pa){const q=ie(Q?.card_id)??U;if(q!=null){const se=Wt(Q,q);if(se!=null)return n(Ft(se)),void(q!==U||c||K())}}if(M===it)return void n($e(!0));const O=ie(Q?.card_id)??U;(U==null||O===U)&&U!=null?c||K():n($e(!0))}}),r.useEffect((()=>{if(w&&U!=null&&P!=null&&P.status.code!=="request_on_hold"){const M=_e(_.tenantEmailDomain,U,k,P),N=ke(s.state?.pathnameStackToGoBack,s.pathname);n(xo()),P?.type.code==="business_virtual_credit_card"&&n(Qa()),t(M,{state:{pathnameStackToGoBack:N},replace:!0}),v.current=!1,L.current!=null&&(clearTimeout(L.current),L.current=null)}}),[w,P?.status.code]),r.useEffect((()=>{G==="In-Progress"&&j.updateStatus.fetchState==="Completed"&&setTimeout(K,3e3)}),[G,j.updateStatus.fetchState]);const I=M=>{B(M)};if(y!=="Completed"||$.cards.length===0)return o.jsxs(Dn,{children:[o.jsx(Ee,{isAppContentDrawerOpen:C,handleDrawerToggle:I}),o.jsx(gc,{})]});if(i==null)throw Error("Can't access my userId.");return o.jsxs(Dn,{children:[o.jsx(Ee,{isAppContentDrawerOpen:C,handleDrawerToggle:I}),o.jsx(Ti,{chargeCardListView:$,cardUserOnboardingView:j,navigate:t,currentTenant:_,myUserId:i,location:s,chargeCardCashbackRatePerTransaction:D.charge_card_cashback_rate_per_transaction!=null?D.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?o.jsx(vi,{windowSize:a,children:e}):null]})},Ti=Pe((function(e,{currentTenant:a,cardUserOnboardingView:n,chargeCardListView:t,myUserId:s}){const g=Ca(e,!1,!1,!1);let b=!1;return g.fetchState==="Completed"&&g.cards.length<=1&&(b=!0),{cards:t.cards,showMenuIcon:b,companyLegalName:a.companyName,twoFAView:n.twoFAView,cardUserOnboardingLocalData:n.cardUserOnboardingLocalData??{userId:s},isDOBDisabled:n.isDOBPresent,onboardingProgressStatus:n.onboardingProgressStatus}}),(function(e,a){const{navigate:n,cardUserOnboardingView:t,location:s,currentTenant:g}=a,{tenantEmailDomain:b}=g;return{updateCardUserOnboardingLocalData:h=>{e(bn({localData:h}))},onGetOtp:h=>{if(t.cardUserOnboardingLocalData!=null){const A={...t.cardUserOnboardingLocalData,phone:h};e(bn({localData:A}))}e(at(h,"CardUserOnboarding"))},onResendOtp:h=>{e(et(h,"CardUserOnboarding"))},onVerifyOtp:(h,A)=>{e(Xa(h,A,"CardUserOnboarding"))},onVerifyOtpSuccess:h=>{e(Bo()),h!=null&&te.saveZeniOtpToken(h)},setCurrentDisplayedCardId:h=>{e(dr({cardId:h}))},onBackClick:()=>{const h=we(s.state?.pathnameStackToGoBack),A=h.poppedPathname??ta(b);n(A,{state:{pathnameStackToGoBack:h.newStack}})}}}))(bc),vi=Ne.div`
35
- display: flex;
36
- flex-direction: column;
37
- width: ${e=>`${Pi.containerWidth.value(e.windowSize)}%`};
38
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
39
- `,Dn=Ne.div`
40
- display: flex;
41
- min-height: 100%;
42
- width: 100%;
43
- flex: 1 1 auto;
44
- flex-direction: column;
45
- align-items: center;
46
- background-color: ${e=>e.theme.colors.grey4};
47
- `,Fi={containerWidth:new Fa(100,58)},xi=({appContent:e})=>{const a=va(),n=me(),t=de(),{cardId:s}=Me(),g=he(),{useDynamicConfig:b,useFeatureGate:h}=le(),[A,u]=r.useState(!1),[m,F]=r.useState(!1),[w,p]=r.useState(!1),[v,L]=r.useState(!1),S=te.getSignedInUser();if(S==null)throw Error("Can't access onboarding card page without signing in...");const l=d((T=>fe(T)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:C}=b(Qe.zeniCardsConfig),B=d((T=>Lo(T,s))),{isFeatureEnabled:k}=h(W.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=h(W.isDebitCardFeatureEnabled),D=Be(_,l),$=Re({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:D}),E=Fe(l),y=xe(l),R=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=Oe({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:k,isBookKeepingTenant:y,isDebitCardProductVisible:$,chargeCardsCreditAccountLimit:R}),f=B.chargeCard,j=d((T=>T.chargeCardConfigState.fetchState));r.useEffect((()=>{A===!1&&j!=="In-Progress"&&j!=="Completed"&&(n(Ja()),u(!0)),m===!1&&B.fetchState==="Not-Started"&&(F(!0),n(ka(s,!1,i)))}),[m,B.fetchState,A,j]);const G=f?.type.code==="business_physical_debit_card"||f?.type.code==="business_virtual_debit_card";r.useEffect((()=>{if(B.fetchState==="Completed"){if(w===!1&&(G===!1||G&&f.status?.code!=="active"||G&&f.status.code==="active"&&f.isPinSet||f.cardHolderUserId!==S.userId)){const T=_e(l.tenantEmailDomain,s,S,f,!0),P=ke(g.state?.pathnameStackToGoBack,g.pathname);t(T,{state:{pathnameStackToGoBack:P}})}else if(w&&B.isRefreshingViewInBackground===!1&&f?.isPinSet===!0){n(Ro({chargeCardId:s}));const T=_e(l.tenantEmailDomain,s,S,f,!0),P=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(T,{state:{pathnameStackToGoBack:P}})}}}),[B.fetchState,f?.type.code,w,B.isRefreshingViewInBackground]);const U=te.getZeniOtpTokenForCardHolder(s),x=d((T=>Vn(T.userState,S.userId))),z=()=>{f?.isPinSet!==!0&&n(ba(s,!0))};r.useEffect((()=>{B.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(z,3e3),p(!0))}),[B.updateDebitCardPinAttemptFetchState.fetchState]);const V=T=>{L(T)};if(j!=="Completed"||f==null)return o.jsx(Ta,{fetchState:"In-Progress"});if(x?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(Ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:v,handleDrawerToggle:V}),o.jsx(Bi,{cardId:s,card:f,phone:x.phone,signedInUser:S,isSandboxEnv:Rt(),debitCardDetailState:B,signedInUserToken:U,navigate:t,currentTenant:l,location:g,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{V(!0)}}),e!=null?o.jsx(Li,{windowSize:a,children:e}):null]})},Bi=Pe((function(e,{debitCardDetailState:a,cardId:n}){const t=Hn(e,n),s=a.updateStatus,g=Ca(e,!1,!1,!1);let b=!1;return g.fetchState==="Completed"&&g.cards.length<=1&&(b=!0),{showMenuIcon:b,vgsVaultId:rt.cardVaultId,twoFAView:t,setPinWaitStatus:s}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,debitCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdateDebitCardPinAttempt:u=>{e(Jn(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onSetPinSuccess:()=>{e(Oo({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("activate")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(Sc),Li=Ne.div`
48
- display: flex;
49
- flex-direction: column;
50
- width: ${e=>`${Fi.containerWidth.value(e.windowSize)}%`};
51
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
52
- box-shadow: ${e=>`${Ya.sp0} 2px ${Ya.sp1} ${e.theme.colors.dropShadowNormal}`};
53
- `,Ri=Ne.div`
54
- display: flex;
55
- min-height: 100%;
56
- width: 100%;
57
- flex: 1 1 auto;
58
- flex-direction: column;
59
- align-items: center;
60
- background-color: ${e=>e.theme.colors.grey4};
61
- box-shadow: ${e=>`${Ya.sp0} 2px ${Ya.sp1} ${e.theme.colors.dropShadowNormal}`};
62
- `,Oi={overlayWidth:new Fa(ht[12],ht[12],ht[9])},Ui=Pe((function(e,a){const n=Bt(e,!1,!1),t=a.lineId,s=n.customAddress[t],g=n.customAddressStatus[t]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:a.googleAPIKey,customAddress:s,customAddressStatus:g,lineId:t}}),(function(e,a){const{newCustomAddressId:n,lineId:t,chargeCardTypeOption:s}=a;return{onSubmitHandler:g=>{n!=null&&e(ur(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`));const b=Lc(g);e($o({addressType:`${s==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`,addressToCreate:b})),e(Mo(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},onDismissClick:()=>{a.onDismissClick(),n!=null&&e(jo({addressId:n,cardLineId:t,cardType:s==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}}))(yc),ji=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:n})=>{const t=Ot(),s=va(),g=()=>{a()},b=d((h=>Uo(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,h)))?.newAddressId;return o.jsx(Ar,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:Oi.overlayWidth.valuePercentage(s),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:t.colors.black,cursor:"pointer"}}},onClose:(h,A)=>(A==="backdropClick"||A==="escapeKeyDown")&&g(),children:o.jsx(Ui,{googleAPIKey:rt.googleMapsAPIKey,onDismissClick:g,lineId:e,chargeCardTypeOption:n,newCustomAddressId:b})})},$i=Pe((function(e,a){const{isChargeCardFeatureEnabled:n,isDebitCardFeatureEnabled:t,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:g,isChargeCardSetupEnabled:b,isDebitCardSetupEnabled:h}=a,A=Bt(e,n&&b,t&&h);return{issueChargeCards:A,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:g,isDebitCardFeatureEnabled:t,isChargeCardFeatureEnabled:n,isChargeCardSetupEnabled:b,isDebitCardSetupEnabled:h,cardHolderCandidates:A.userList.map((u=>u.user)).filter(Boolean),allRoles:A.userList.map((u=>u.userRole)),allAccountingClasses:A.allAccountingClasses,userList:A.userList}}),(function(e,a){return{onIssueCardClick:()=>{e(Ho())},onSaveChangesToLocalStore:n=>{e(Vo(n))},onDismissClick:()=>{e(mr()),a.navigate("../")},resetCustomAddressByLineID:(n,t)=>{e(ur(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${n}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}}))(Ec);function Mi(){const e=te.getSignedInUser(),a=de(),n=me(),t=Ic(),[s]=_n(),g=s.get("cardType"),{useFeatureGate:b}=le(),{isFeatureEnabled:h}=b(W.isIssuePhysicalCardEnabled),{isFeatureEnabled:A}=b(W.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:u}=b(W.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=b(W.isChargeCardFeatureEnabled),F=d((z=>fe(z))),w=Be(u,F),p=Re({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:w}),v=Fe(F),L=xe(F),S=F.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,l=Oe({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:m,isBookKeepingTenant:L,isDebitCardProductVisible:p,chargeCardsCreditAccountLimit:S}),[C,B]=r.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");r.useEffect((()=>{C||(B(!0),n(No(p&&_,l&&k,!1)))}),[C,B,n]);const k=!!F.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!F.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((z=>Bt(z,l&&k,p&&_))),$=D.fetchState,E=D.issueCardStatus.fetchState,y=D.lastSelfIssuedDebitCardId,R=d((z=>y!=null?lr(z.chargeCardState,y):void 0)),[i,f]=r.useState(null),[j,G]=r.useState(null),U=()=>{f(null)},x=(z,V)=>{f(z),G(V)};return r.useEffect((()=>{if(E==="Completed"){if(y!=null&&R?.type.code==="business_virtual_debit_card"){let z;z=R?.status.code==="request_on_hold"&&e.userId===R.cardHolderUserId?wr(F.tenantEmailDomain):_e(F.tenantEmailDomain,y,e,R),a(z)}else a("../");n(mr())}}),[E,y]),$==="Completed"?o.jsxs(o.Fragment,{children:[i!==null&&j!==null?o.jsx(ji,{closeDrawerHandler:U,lineId:i,chargeCardTypeOption:j}):null,o.jsx($i,{themeState:t,isIssuePhysicalCardEnabled:h,isIssuePhysicalDebitCardEnabled:A,isDebitCardFeatureEnabled:p,isChargeCardFeatureEnabled:l,isChargeCardSetupEnabled:k,isDebitCardSetupEnabled:_,navigate:a,fetchState:D.fetchState,openAddAddressDrawerHandler:x,defaultCardType:g==="creditCard"||g==="debitCard"?g:void 0})]}):$==="Error"?o.jsx(ot,{}):o.jsx(kc,{})}const zr=[pa,it],Ni=new Set(zr),Vi=Ne.div`
63
- display: flex;
64
- height: 100vh;
65
- width: 100%;
66
- flex: 1 1 auto;
67
- flex-direction: column;
68
- overflow: auto;
69
- align-items: center;
70
- background-color: ${e=>e.theme.colors.grey4};
71
- `,Hi=Pe((function(e,a){const{myPendingActivationChargeCardListState:n}=a;return{myPendingActivationChargeCardListView:n,uiState:n.uiState,signedInUser:a.signedInUser}}),(function(e,a){const{navigate:n,currentTenant:t,location:s,signedInUser:g,myPendingActivationChargeCardListState:b}=a,{tenantEmailDomain:h}=t,{cards:A}=b;return{onChargeCardRowClick:u=>{const m=Pr(A,u),F=_e(h,u,g,m),w=ke(s.state?.pathnameStackToGoBack,s.pathname);n(F,{state:{pathnameStackToGoBack:w}})},onColumnSortConfigChanged:(u,m)=>{e(It({uiState:{sortKey:u,sortOrder:m}}))},onReloadCards:()=>{e($e())},onBackClick:()=>{const u=t.userRole.includes("charge_card_user");e(It({uiState:{sortKey:u?"cardName":"owner",sortOrder:"ascending"}})),n("../")}}}))(Ac);function Gi(){const e=de(),a=me(),n=he(),t=Ot(),[s,g]=r.useState(!1),b=d((x=>Go(x))),h=d((x=>fe(x))),A=d((x=>da(x,h.companyId))),u=la(A.controllers),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(W.isChargeCardFeatureEnabled),{isFeatureEnabled:w}=m(W.isDebitCardFeatureEnabled),p=Be(w,h),v=Re({isDebitCardFeatureEnabled:w,isBankingOnlyTenant:p}),L=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,S=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,l=Le(),C=Fe(h),B=xe(h),k=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Oe({isCardsOnlyTenant:C,isChargeCardFeatureEnabled:F,isBookKeepingTenant:B,isDebitCardProductVisible:v,chargeCardsCreditAccountLimit:k}),D=ve(l?.loggedInUserRoleMap),$=d((x=>ma(x))),{creditAccount:E,creditAccountRepayment:y}=d((x=>ua(x))),R=d((x=>cr(x))).cards.filter((x=>x.type.code.includes("debit"))).map((x=>x.connectedAccountId)),i=[...new Set(R)],f=d((x=>tt(x,i)));r.useEffect((()=>{s||b.fetchState==="Completed"||b.fetchState==="In-Progress"||(g(!0),a($e()),a(Ja()))}),[s,a,b.fetchState]),r.useEffect((()=>{if(b.fetchState==="Completed"&&b.cards.length===1&&j!=null){const x=_e(h.tenantEmailDomain,b.cards[0].id,j,b.cards[0]);e(x,{state:{message:n.state?.message}})}}),[b.fetchState,b.cards]);const j=te.getSignedInUser();r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&_&&S&&D&&a(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&D&&a(vt()),f.fetchState!=="Completed"&&f.fetchState!=="In-Progress"&&v&&L&&D&&a(ir())}),[E.fetchState,y.fetchState,a,f.fetchState,v,L,D,_,S]);const G=aa(h);if(Nt({events:ha(G,zr),onEvent:(x,z)=>{if(!Ni.has(x))return;const V=Yt(z);if(x===pa){const T=ie(V?.card_id);if(T!=null){const P=Wt(V,T);if(P!=null)return void a(Ft(P))}}a($e(!0))},onSubscribed:()=>{a($e(!0))}}),j==null)throw Error("Can't access address page without signing in...");const U=b.cards!=null&&b.cards.length>0;if(b.fetchState==="Completed"||U){const x=Xe(_,v,L,S);return o.jsx(Vi,{children:o.jsx(Hi,{navigate:e,currentTenant:h,signedInUser:j,productInformation:x,myPendingActivationChargeCardListState:b,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:L,isChargeCardSetupEnabled:S,chargeCardCashbackDetailState:$,creditAccount:E,creditAccountRepayment:y,depositAccountListWithDebitCardIssued:f,controllerEmails:u,location:n})})}return o.jsx(Ta,{fetchState:"In-Progress",style:{backgroundColor:t.colors.grey5}})}const Ki=Pe((function(e,a){const{companyId:n,companyLegalName:t}=a;return{chargeCardSetupView:wa(e,n),admins:a.adminList,companyLegalName:t}}),(function(e,a){const{navigate:n,companyId:t,isCompanyBusinessVerificationAndPaymentSetUpDone:s,isDebitCardSetupEnabled:g,isChargeCardSetupEnabled:b,signedInUser:h,location:A,productInformation:u,isEarlyPayEnabled:m,controllerEmails:F,chargeCardsCreditAccountLimit:w}=a;return{onSetupButtonClick:p=>{if(h!=null&&ae.trackCardsPromoPageClicked("enable cards"),s)switch(ae.trackCardsEnableCardsClick(F,u,"Cards Promo"),p){case"credit":e(Ze(t,!0,"charge_cards",m,!1));break;case"debit":e(Ze(t,!0,"debit_cards",m,!1));break;case"debit_and_credit":e(w===0?Ze(t,!0,"debit_cards",m,!0):Ze(t,!0,"charge_cards__debit_cards",m,!1))}else switch(ae.trackCardsSetupCardsClick(F,u,"Cards Promo"),p){case"credit":e(Ze(t,!1,"charge_cards",m,!1));break;case"debit":e(Ze(t,!1,"debit_cards",m,!1));break;case"debit_and_credit":e(w===0?Ze(t,!1,"debit_cards",m,!0):Ze(t,!1,"charge_cards__debit_cards",m,!1))}},onBackClick:()=>{const p=we(A.state?.pathnameStackToGoBack);let v=p.poppedPathname;v==null&&(v=g||b?"..":"../.."),n(v,{state:{pathnameStackToGoBack:p.newStack}})},onLetsGoClick:()=>{n("./onboard")},onSetupChargeCardSuccess:()=>{s?(e(Qa()),n("../",{relative:"path"})):n("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Yo(t))}}}))(Pc),zi=()=>{const e=Dc(),a=de(),{tenantEmailDomain:n}=Me(),[t]=_n(),s=t.get("cardPromoType"),g=me(),{useDynamicConfig:b,useFeatureGate:h}=le(),[A,u]=r.useState(!1),{isFeatureEnabled:m}=h(W.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=h(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:w}=h(W.isChargeCardFeatureEnabled),{configValue:p}=b(Qe.zeniCardsConfig),v=d((J=>fe(J))),L=d((J=>da(J,v.companyId))),S=la(L.controllers),l=p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,C=he(),B=te.getSignedInUserTenant(n)?.companyId??v.companyId,k=d((J=>wa(J,B))),_=k.primaryFundingAccount,D=v.companyBillPayInfo?.info,$=Fe(v),E=xe(v),y=Be(m,v),R=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=Re({isDebitCardFeatureEnabled:m,isBankingOnlyTenant:y}),f=Oe({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:w,isBookKeepingTenant:E,isDebitCardProductVisible:i,chargeCardsCreditAccountLimit:R}),j=_r({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:w,isBookKeepingTenant:E}),G=i&&f===!1,U=D?.businessVerificationStatus?.code==="verified"&&(G||_?.accType==="depositAccount"||Ko(_?.providerVerificationStatus?.code??"")),x=te.getSignedInUser(),z=!!v.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=!!v.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,T=!!v.company?.companyChargeCardInfo?.isChargeCardEnabled,P=!!v.company?.companyDebitCardInfo?.isDebitCardEnabled,K=!!v.companyChargeCardInfo?.info?.isChargeCardEnabled,Z=!!v.companyDebitCardInfo?.info?.isDebitCardEnabled,I=!!v.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,M=J=>{u(J)},N=d((J=>J.chargeCardSetupViewState.fetchState));if(x==null)throw Error("Can't access Charge Card promo page without signing in...");const Q=Le(),c=ve(Q?.loggedInUserRoleMap),O=xt(Q?.loggedInUserRoleMap),[q,se]=r.useState(!1),[X,Ve]=r.useState(!1),[Ae,ge]=r.useState(!1);r.useEffect((()=>{q===!1&&C.state?.message==="activation"&&se(!0)}),[C.state]),r.useEffect((()=>{X||N!=="Not-Started"||B==null||(Ve(!0),g(Pa(B,!0)))}),[X,N,B,g]);const re=v.companyChargeCardInfo?.info!=null&&Ia({cardInfo:v.companyChargeCardInfo.info,isProductVisible:j&&T,isTOSAccepted:V,isSetupEnabled:K,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:O}),be=v.companyDebitCardInfo?.info!=null&&Ia({cardInfo:v.companyDebitCardInfo.info,isProductVisible:i&&P,isTOSAccepted:I,isSetupEnabled:Z,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:O}),ue=i&&be&&j&&R>=0&&re?"debit_and_credit":i&&be?"debit":"credit",oe=Bc(s,ue),Se=k?.chargeCardTermsDetails?.fetchStatus?.fetchState,ee=r.useRef(null);r.useEffect((()=>{Se==="In-Progress"?ee.current=oe:Se!=="Error"&&Se!=="Not-Started"||(ee.current=null)}),[Se,oe]);const De=Se!=="In-Progress"&&Se!=="Completed"||ee.current==null?oe:ee.current;r.useEffect((()=>{oe==="credit"&&(K||j===!1&&Z)||oe==="debit"&&Z||oe==="debit_and_credit"&&Z&&K?a("../"):(oe==="debit_and_credit"&&V===!0&&I===!0||oe==="credit"&&(V===!0||j===!1&&I===!0)||oe==="debit"&&I===!0)&&c===!0&&a("../setup")}),[U,K,Z,oe,V,I]),r.useEffect((()=>{Ae||(g(zo("cardAdmin")),ge(!0))}),[Ae]);const Te=d((J=>sr(J.userState,J.userRoleState,J.userListViewState,"cardAdmin"))),Ce=Xe(j,i,Z,K);return(J=>{switch(J){case"credit":return T;case"debit":return P;case"debit_and_credit":return T&&P;default:return!1}})(De)?(re||be)&&N==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ut,{analytics:ae,onLoad:()=>{if(ae.trackPageLoaded(Er.Event.cardsPromoPage),!!j&&!K||!!i&&!Z||!!j&&!!i&&!Z&&!K){const J=Yi({isDebitCardSetupEnabled:Z,isChargeCardSetupEnabled:K,isCreditCardProductVisibleForExpressInterest:j,isDebitCardProductVisible:i});ae.trackCardsPromoView(S,Ce,"Page",J,"Promo Page")}}}),o.jsx(nt,{showConfetti:q}),o.jsx(Ee,{isAppContentDrawerOpen:A,handleDrawerToggle:M}),o.jsx(Ki,{signedInUser:x,location:C,meetingUrl:e("charge_card_promo"),showEnableCardButton:U,isCompanyBusinessVerificationAndPaymentSetUpDone:U,isChargeCardSetupEnabled:K,isDebitCardSetupEnabled:Z,companyLegalName:v.companyName,adminList:Te.users,isCheckingEnabled:z,navigate:a,companyId:B,cardPromoType:De,controllerEmails:S,productInformation:Ce,isCreditCardProductVisible:f,isDebitCardFeatureEnabled:m,isEarlyPayEnabled:F,cashbackRate:l,chargeCardsCreditAccountLimit:R,onClickMenuIcon:()=>{M(!0)}})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:A,handleDrawerToggle:M}),o.jsx(_c,{})]}):o.jsx(Je,{to:"../",replace:!0})},Yi=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:a,isCreditCardProductVisibleForExpressInterest:n,isDebitCardProductVisible:t})=>n&&t&&!e&&!a?"Credit & Debit Card":n&&!a?"Credit Card":t&&!e?"Debit Card":"";function Id(){const e=he(),a=d((Q=>fe(Q))),{useFeatureGate:n}=le(),{isFeatureEnabled:t}=n(W.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(W.isDebitCardFeatureEnabled),{isFeatureEnabled:g}=n(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:b}=n(W.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:h}=n(W.isCardPolicyEnabled),A=Be(s,a),u=Re({isDebitCardFeatureEnabled:s,isBankingOnlyTenant:A}),m=wc(a,t,s),F=!!a.company?.companyChargeCardInfo.isChargeCardTOSAccepted,w=!!a.company?.companyDebitCardInfo.isDebitCardTOSAccepted,p=!!a.company?.companyChargeCardInfo?.isChargeCardEnabled,v=!!a.company?.companyDebitCardInfo?.isDebitCardEnabled,L=!!a.companyChargeCardInfo?.info?.isChargeCardEnabled,S=!!a.companyDebitCardInfo?.info?.isDebitCardEnabled,l=Le(),C=ve(l?.loggedInUserRoleMap),{isCardsShuttingDown:B}=kr(a.tenantId,a.company?.managementInfo?.receiverEmails),k=xt(l?.loggedInUserRoleMap),{isFeatureEnabled:_}=n(W.isCashbackFeatureEnabled),D=a.userRole.includes("charge_card_user"),$=!D,E=!D&&L,y=a?.userRole!=null&&Wo(a?.userRole),R=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!y)&&Zo(l?.loggedInUserRoleMap),i=qo(l?.loggedInUserRoleMap),f=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!y)&&Jo(l?.loggedInUserRoleMap),{isFeatureEnabled:j}=n(W.isDepositAccountsFeatureEnabled),G=j&&!y&&Kn(l?.loggedInUserRoleMap),U=L&&p&&!y,x=S&&v&&!y,z=m&&!y&&ve(l?.loggedInUserRoleMap),V=Qo(l?.loggedInUserRoleMap),T=Fe(a),P=xe(a),K=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,Z=Oe({isCardsOnlyTenant:T,isChargeCardFeatureEnabled:t,isBookKeepingTenant:P,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:K}),I=a.companyChargeCardInfo?.info!=null&&Ia({cardInfo:a.companyChargeCardInfo.info,isProductVisible:Z&&p,isTOSAccepted:F,isSetupEnabled:L,isUserHasCardsAdminLevelAccess:C,isUserHasCardsAccess:k}),M=a.companyDebitCardInfo?.info!=null&&Ia({cardInfo:a.companyDebitCardInfo.info,isProductVisible:u&&v,isTOSAccepted:w,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:C,isUserHasCardsAccess:k}),N=I||M;return o.jsxs(cs,{children:[C?o.jsx(ne,{path:"setup",element:o.jsx(Sn,{isBillPayAdminLevelAccess:R,isReimbursementAdminLevelAccess:f,isZeniAccountAdminLevelAccess:G,isChargeCardAdminLevelAccess:z,isUserHasOnlyCardAccess:V,isUserHasOnlyBillPayAccess:i,productType:"charge_cards",type:"setup"})}):null,C?o.jsx(ne,{path:"verification",element:o.jsx(Sn,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:f,isZeniAccountAdminLevelAccess:G,isChargeCardAdminLevelAccess:z,isUserHasOnlyCardAccess:V,productType:"charge_cards",type:"verification"})}):null,C&&h?o.jsxs(o.Fragment,{children:[o.jsx(ne,{path:"policy",element:o.jsx(Yc,{})}),o.jsx(ne,{path:"policy/new",element:o.jsx(jc,{})}),o.jsx(ne,{path:"policy/:templateId/edit",element:o.jsx(Vc,{})})]}):null,o.jsx(ne,{path:"promo",element:o.jsx(zi,{})}),U||x?o.jsxs(o.Fragment,{children:[o.jsx(ne,{path:"/",element:o.jsx(kn,{isPaymentDrawerOpen:!1})}),z&&g?o.jsx(ne,{path:"payment",element:o.jsx(kn,{isPaymentDrawerOpen:!0})}):null,o.jsx(ne,{path:"activate",element:o.jsx(Gi,{})}),o.jsx(ne,{path:"onboard",element:o.jsx(wi,{})}),C&&B!==!0?o.jsx(ne,{path:"new",element:o.jsx(Mi,{})}):C?o.jsx(ne,{path:"new",element:o.jsx(Je,{to:"..",replace:!0})}):null,_&&$?o.jsx(ne,{path:"cashback",element:o.jsx(Qc,{})}):null,E?o.jsx(ne,{path:"statements",element:o.jsx(Di,{})}):null,z&&b&&L?o.jsx(ne,{path:"payment-history",element:o.jsx(Ai,{})}):null,o.jsx(ne,{path:":cardId/activate",element:o.jsx(ai,{})}),o.jsx(ne,{path:":cardId/setPin",element:o.jsx(xi,{})}),o.jsx(ne,{path:":cardId/addToWallet",element:o.jsx(Wc,{})}),o.jsx(ne,{path:":cardId/*",element:o.jsx(ui,{})}),o.jsx(ne,{path:"*",element:o.jsx(ot,{})})]}):(F||w)&&C?o.jsx(ne,{path:"*",element:o.jsx(Je,{to:"../setup"})}):N?o.jsx(ne,{path:"*",element:o.jsx(Je,{to:"../promo",state:e.state})}):o.jsx(ne,{path:"*",element:null})]})}export{Id as default};
@@ -1,11 +0,0 @@
1
- import{j as I}from"./liveblocks-B3m51ZRo.js";import{a as o}from"./sentry-DI7gLUjw.js";import{u as F,h as P,g as z,j as C,N as w}from"./core-gUqdW_kq.js";import{T9 as H,fE as q,gk as G,pR as J,gL as A,gj as Q,gh as V,Tz as B,gg as O}from"./zeni-epic-state-C-d25VTi.js";import{u as K,z as E,L as D,G as M,J as W}from"./index-DRDpUzzs.js";import{n as X}from"./mui-DCW4m3lZ.js";import{P as h,a as _}from"./AccountMappingScreen-C3HFW5Ij.js";import{t as Y}from"./getLocaleForTenant-BFGbVplK.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-BbB3FEE8.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./MobileAppDrawer-Bh8VAeHB.js";import"./InboxNotificationsProvider-D007v5X6.js";import"./useTaskManagerAccess-BJoTHFNB.js";import"./accountMappingHelper-qlU24D2s.js";import"./empty-CkcqWk4Z.js";import"./pdf-lib-Bku26ZcE.js";import"./index-70FTEc4H.js";import"./url-qyBRakHR.js";import"./index-DhQKJDfi.js";import"./decodeURIComponentSafe-Cst3Y24b.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]="dd58fabc-8b1f-4d6e-8616-d8ac9a1aff9f",t._sentryDebugIdIdentifier="sentry-dbid-dd58fabc-8b1f-4d6e-8616-d8ac9a1aff9f")}catch{}})();const te=X.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 ${W.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function we(){const t=F(),i=P(),v=z(),{setLoading:c,clearAllLoading:m}=K(),S=o.useRef(!1),b=o.useRef(!1),N=o.useRef(!1),f=o.useRef(!1),{code:L,realmId:U,state:$}=Z(v.search),p=L!==""&&U!==""&&$!=="";p&&(N.current=!0);const j=sessionStorage.getItem(h),u=j===_.pending,R=j===_.ready,x=C((s=>H(s))),e=C((s=>q(s))),n=C((s=>s.tenantState.fetchState)),r=C((s=>s.tenantState.activeTenantFetchState.fetchState)),a=E.getSignedInUser(),g=E.getActiveTenantForUser()?.tenantId,l=e?.externalConnections?.fetchState,d=e?.externalConnections?.saveConnectionState,y=e.externalConnections?.accounting[0]?.isValid;o.useLayoutEffect((()=>{c(D.CONNECTION_AUTH)}),[c]),o.useEffect((()=>{S.current||a==null||g==null||(S.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(c(D.TENANT_FETCHING),t(G(a.userId,g))))}),[S,n,c]),o.useEffect((()=>{e.tenantId==null&&!b.current&&a!=null&&(b.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(J(a.userId)))}),[b,n,r]),o.useEffect((()=>{a==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||d!=="Error"||(c(D.CONNECTION_AUTH),t(A(a.userId,e.tenantId)))}),[d]),o.useEffect((()=>{n!=="Completed"&&r!=="Completed"||a==null||e?.tenantId==null||(t(Q(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),V(a?.userId,a?.zeniSessionId,e.tenantId),M.updateAppLocaleID(Y(B(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||a==null||e==null||t(A(a.userId,e.tenantId)))}),[n,r,l]),o.useEffect((()=>{x.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&E.saveSignedInUserTenants(x.tenantsCoreDetailsInOrder)}),[x.tenantsCoreDetailsInOrder.length,n]);const T=e==null||n!=="Completed"&&r!=="Completed"||l!=="Completed";if(o.useEffect((()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||l!=="Completed"&&l!=="Error"||m()}),[n,r,l]),o.useEffect((()=>{u&&d==="In-Progress"&&(f.current=!0)}),[u,d]),o.useEffect((()=>{if(!u||T)return;const s=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return f.current&&d==="Completed"?(sessionStorage.setItem(h,_.ready),m(),void i(s,{replace:!0})):f.current&&d==="Error"?(sessionStorage.removeItem(h),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),void i(s,{replace:!0})):void(p||N.current||f.current||y!==!0||(sessionStorage.removeItem(h),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),i(s,{replace:!0})))}),[u,T,d,p,y,e.tenantEmailDomain,m,t,i]),T)return null;if(p||y!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const k=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return R?I.jsx(w,{to:k,replace:!0}):I.jsx(w,{to:"/",replace:!0})}export{we as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-B3m51ZRo.js";import{z as a}from"./index-DRDpUzzs.js";import{g as n}from"./QBOConnectionScreen-BbB3FEE8.js";import"./sentry-DI7gLUjw.js";import{g as p,N as s}from"./core-gUqdW_kq.js";import"./zeni-epic-state-C-d25VTi.js";import"./recharts-HpXoq1DR.js";import"./mui-DCW4m3lZ.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./empty-CkcqWk4Z.js";import"./pdf-lib-Bku26ZcE.js";import"./index-70FTEc4H.js";import"./url-qyBRakHR.js";import"./index-DhQKJDfi.js";import"./decodeURIComponentSafe-Cst3Y24b.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]="c18cd95e-770d-4ff7-92bf-3374948ea538",t._sentryDebugIdIdentifier="sentry-dbid-c18cd95e-770d-4ff7-92bf-3374948ea538")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,30 +0,0 @@
1
- import{j as s}from"./liveblocks-B3m51ZRo.js";import{t as An,A as $e}from"./AddressScreen-CSJE0p29.js";import wn from"./NotFoundScreen-BFfoIcMt.js";import{a as d,t as Me}from"./sentry-DI7gLUjw.js";import{h as _e,g as Te,u as se,i as Ee,j as x,N as Q,q as Pn,l as cn,n as Dn,o as H}from"./core-gUqdW_kq.js";import{fE as Y,dY as xe,dX as Ae,bq as Un,Tq as jn,bR as Bn,pP as Fn,AI as Rn,AL as Vn,UM as Ln,UN as Nn,lt as Oe,lw as dn,U0 as Gn,b$ as $n,c8 as fe,Ba as we,AX as Mn,UO as me,Bb as un,RA as Qn,mG as ln,dh as pn,UP as Kn,UQ as zn,u2 as qn,TQ as Ce,hU as Hn,TP as be,hR as Jn,FA as Xn,u6 as Zn,hJ as Wn,hM as Qe,UR as mn,US as Yn,Ll as et,UT as nt,Lp as tt,AO as at,UU as ot,UV as st,lr as rt,lu as it,Bn as ct,AZ as gn,B9 as dt,bE as Ke,cE as ut,Bm as ze,ul as lt,u9 as pt,my as mt,gF as gt,gE as ft,gD as yt,UW as ht,AR as Ct,Bo as bt,Br as St,Bu as It,BA as kt,di as Ot}from"./zeni-epic-state-C-d25VTi.js";import{z,M as Pe,y as Z,s as vt,p as q,a8 as re,k as g,aE as _t,ai as fn,a1 as Tt,c as yn,Q as hn,j as W,X as ge,U as ve,aF as Et,J as qe,x as He,ae as xt,aG as Je,aH as At,aI as wt}from"./index-DRDpUzzs.js";import{n as De}from"./mui-DCW4m3lZ.js";import{g as Pt,h as Dt,q as ie}from"./QBOConnectionScreen-BbB3FEE8.js";import{u as Ut,a as jt}from"./useEmailConnectResultRefresh-BJXmlYiy.js";import{u as Bt}from"./useChargeCardPusherEvents-K7_8wfj8.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./empty-CkcqWk4Z.js";import"./pdf-lib-Bku26ZcE.js";import"./index-70FTEc4H.js";import"./url-qyBRakHR.js";import"./index-DhQKJDfi.js";import"./decodeURIComponentSafe-Cst3Y24b.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="dce4b7ba-374e-4111-ac0f-df7aa1e094ec",e._sentryDebugIdIdentifier="sentry-dbid-dce4b7ba-374e-4111-ac0f-df7aa1e094ec")}catch{}})();const Xe=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Ft=()=>{const e=_e(),l=Te(),i=se(),[a,p]=d.useState(!1),[u,c]=d.useState(!1),{tenantEmailDomain:v}=Ee(),n=z.getSignedInUser(),{useFeatureGate:t}=Pe(),{isFeatureEnabled:C}=t(Z.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(Z.isArAgingFeatureEnabled),{isFeatureEnabled:w}=t(Z.isReferralFeatureEnabled),{isFeatureEnabled:A}=t(Z.isDebitCardFeatureEnabled),k=vt(),O=x((S=>Y(S))),P=x((S=>S.onboardingCustomerViewState.fetchState)),_=O.excludedResources,B=O.companyId??z.getSignedInUserTenant(v)?.companyId;if(n==null)throw Error("Can't access onboarding flow without signing in...");const m=xe(A,O),b=Ae(O),D=[],R=_?.resources?.find((S=>S.resource==="/reports/top_expenses"))==null,h=_?.resources?.find((S=>S.resource==="/reports/task_card"))==null,r=O?.userRole!=null&&Un(O?.userRole),T=_?.resources?.find((S=>S.resource==="/bills"))==null&&!r,E=_?.resources?.find((S=>S.resource==="/reimbursements"))==null;R===!1&&D.push("top_expenses"),h===!1&&D.push("task_card"),T===!1&&D.push("bill_pay_card","bill_pay_promo_card"),E===!1&&D.push("reimbursement_card","reimbursement_promo_card"),D.push("zeni_accounts_promo_card","treasury_promo_card"),w===!1&&D.push("rewards_card");const f=x((S=>{const F=[];C===!1&&F.push("accounts_payable_aging"),o===!1&&F.push("accounts_receivable_aging"),F.push("zeni_accounts_promo_card","treasury_promo_card"),w===!1&&F.push("rewards_card"),k===!1&&F.push("expense_automation_card");const J=jn(S,F);return Bn(J.reportsInOrder.map(($=>({fetchState:$.fetchState,error:$.error})))).fetchState}));d.useEffect((()=>{P!=="Completed"||a||m||b||(p(!0),i(Fn(n.userId,B,O.tenantId,!0,!1,D)))}),[a,P,m,b,n,O.tenantId,i]);const U=d.useRef(!1),N=d.useCallback((()=>{const S={pathnameStackToGoBack:q(l.state?.pathnameStackToGoBack,l.pathname),message:"activation"};e(m?"../../checking":b?"../../cards":"../../dashboard",{state:S})}),[e,l,m,b]),G=d.useCallback((()=>{U.current||(U.current=!0,N())}),[N]);if(d.useEffect((()=>{const S=setTimeout((()=>c(!0)),3e3);return()=>clearTimeout(S)}),[]),d.useEffect((()=>{const S=setTimeout(G,6e3);return()=>clearTimeout(S)}),[G]),d.useEffect((()=>{m||b||!u||f!=="Completed"&&f!=="Error"||G()}),[u,f,m,b,G]),P!=="Completed")return s.jsx(Q,{to:"../"});const L=O.company?.companyOnboardingInfo?.onboardingInfo,ee={timeSinceQuoteSign:L?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:L?.onboardingToQuoteSignMinutes??0,isKybDone:Xe(L?.businessVerified?.status),isKycDone:Xe(L?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:L?.accountingConnectionCreationMode??""};return s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:g,onLoad:S=>S.trackOnboardingDashboardActivation(ee)}),s.jsx(_t,{show:!0,onComplete:G})]})},Se=["reading_books","finance_graph","reconciliation","cfo_foundation"],Ie=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],Ze=(e,l)=>{const i=new Map(e.map((a=>[a.key,a])));return l.map((a=>{return p=i.get(a)?.status,p==="starting"||p==="building"?p:"idle";var p}))},We=(e,l)=>{if(e.length===0)return!1;const i=new Map(e.map((a=>[a.key,a])));return l.every((a=>i.get(a)?.status==="ready"))},Ye=De.div`
2
- display: flex;
3
- height: 100vh;
4
- background-color: ${e=>e.theme.colors.grey4};
5
- `,en=De.div`
6
- display: flex;
7
- flex-direction: column;
8
- align-items: center;
9
- flex: 1;
10
- min-width: 0;
11
-
12
- ${e=>e.skipLegacyDrawerOffset?`
13
- width: 100%;
14
- padding-left: ${qe.sp0};
15
- `:`
16
- min-width: calc(100% - ${He}px);
17
- padding-left: ${He}px;
18
- `}
19
-
20
- ${e=>e.theme.breakpoints.down("md")} {
21
- width: 100%;
22
- padding-left: ${qe.sp0};
23
- }
24
-
25
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
26
- `,nn=cn((function(e,l){const{companyId:i,isAdmin:a,currentTenant:p,isOnAddressPage:u}=l,c=z.getSignedInUser(),v=p.tenantId,n={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:v??""},t=Y(e),C=we(e,i),o=mn(e),w=fe(p?.userRole??[])&&C.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",A=Yn(e.userRoleConfigState);return{onboardingCustomerView:C,analytics:g,isRefreshingViewInBackground:!1,isDisabled:w,companyTitles:A.companyTitles,connectedAccountProvider:t.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:xt.fileMicroServiceBaseUrl,authParams:n},signedInUser:z.getSignedInUser(),currentTenant:t,isAdmin:a,isOnAddressPage:u,cardPaymentView:o,isCardPaymentPopupOpen:!1,stripeKey:ge.stripeKey}}),(function(e,l){const{companyId:i,currentTenant:a,themeState:p,navigate:u,location:c}=l,{tenantEmailDomain:v}=a;return{onFetchLinkTokenClick:(n,t)=>{e(kt(n,t))},onEstablishConnectionClick:(n,t)=>{e(It(n,t))},onUpdatePaymentAccountStatus:(n,t,C)=>{e(St(n,t,C))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(bt(!1,n,t))},onEstablishConnectionSuccess:()=>{e(Ct(i,!0,!1))},handleOnConnectClick:()=>{g.trackOnboardingConnectQBO(),ie.handleClick()},updateQBOPopupState:n=>{e(me({isQBOPopupOpen:n}))},onCompanyOfficerUpdated:n=>{const t=n.map((C=>{const{officerType:o,userId:w,name:A,email:k,ssn:O,nationalityCountryCode:P,dob:_,phone:B,syncToken:m,selectDocument:b,role:D,ownership:R,isSelectedForVerification:h,userVerificationStatus:r,fileIds:T,isPhoneVerified:E}=C;let f;return b.selectDocumentType==="driverLicense"?f="driving_license":b.selectDocumentType==="passport"?f="passport":b.selectDocumentType==="stateId"?f="id_document":b.selectDocumentType==="ssnCard"&&(f="social_security_card"),{officerType:o,userId:w,firstName:A.firstName,lastName:A.lastName,email:k,ssn:O,nationalityCountryCode:P?.selectedOption!=null?Je(P.selectedOption):void 0,phone:B,birthday:_!=null?Ke(_?.toString()):_,syncToken:m,titleAtCompany:D.selectedOption,ownershipInCompany:R,documentTypeSelectedForVerification:f,isSelectedForVerification:h,userVerificationStatus:r,fileIds:T,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:E}}));e(ze({officers:t}))},onGetOtp:(n,t)=>{e(yt(n,"CustomerOnboarding")),t!=null&&e(ht({officerType:t,phone:n}))},onResendOtp:n=>{e(ft(n,"CustomerOnboarding"))},onVerifyOtp:(n,t)=>{g.trackOnboardingPhoneVerified(),e(gt(n,t,"CustomerOnboarding"))},updateFilesEntity:n=>{e(mt({files:n}))},onDeleteFile:n=>{e(pt(n))},onEditFileName:(n,t)=>{e(lt(n,t.split(".")[0]))},onCompanyDetailsChanged:n=>{const{companyDescription:t,companyIndustry:C,companyIndustryType:o,companyLegalName:w,companyTaxId:A,companyWebsite:k,companyPhone:O,primaryContactEmail:P,primaryContactName:_,primaryContactUserId:B,primaryContactSyncToken:m,syncToken:b,fileIds:D,typeOfIncorporation:R,stateOfIncorporation:h,incDate:r,companySourceOfFunds:T,companySourceOfFundsDescription:E,companySubIndustry:f,countriesOfOperations:U,purposeOfAccount:N,purposeOfAccountDescription:G,regulatedStatus:L,regulatedStatusDescription:ee,transactionVolume:S,transactionVolumeDescription:F,usNexus:J,usNexusTypes:$}=n,M={companyId:i,companyDescription:t,companyIndustry:C.selectedOption,companyIndustryType:o?.selectedOption??"",companyLegalName:w,taxIdOrEIN:A,website:k!=""&&k!=null?ut(k):void 0,phone:O,syncToken:b,fileIds:D,incDate:r!=null?Ke(r?.toString()):r,typeOfIncorporation:R?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",companySourceOfFunds:T?.selectedOption??"",companySourceOfFundsDescription:E,companySubIndustry:f?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map((V=>V.length===2?V:Je(V)))??[],purposeOfAccount:N?.selectedOption??"",purposeOfAccountDescription:G,regulatedStatus:L??"",regulatedStatusDescription:ee,transactionVolume:S?.selectedOption??"",transactionVolumeDescription:F,usNexus:J,usNexusTypes:$?.selectedOptions??[]},ce={userId:B,firstName:_.firstName,lastName:_.lastName,email:P,syncToken:m};e(ze({companyDetails:M,primaryContactDetails:ce}))},onAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onRegisteredAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onUpdateCustomerView:(n,t,C)=>{e(dt(i,!1,t,C,n))},onAddressEditHandler:n=>{if(n!=null){const t=An(n);e(ln({addressType:"subscription_billing_address",addressToCreate:t}))}},onSkipSetupClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);e(gn(i,!1,!1)),u("./activation",{state:{pathnameStackToGoBack:n}})},onUpdateStep:n=>{e(un({step:n}))},onUpdateSubStep:n=>{e(ct({subStep:n}))},onZeniLogoClick:()=>{p.toggle()},handleLogOutClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);u("/signout",{replace:!0,state:{pathnameStackToGoBack:n,message:"logout"}})},handleCockpitClick:()=>{g.trackOnboardingFlowExited("cockpit"),window.open("/cockpit")},handleReferralsClick:()=>{u(`/${v}/rewards`)},handleCreateCardSetupIntent:n=>{e(dn(n))},handleConfirmCardSetupIntent:n=>{e(it(n))},updateCardPaymentModalState:n=>{e(me({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,C)=>{e(rt(n,t,C))},handleFetchPaymentSources:()=>{e(Oe())},resetCardPaymentViewState:()=>{e(st())},handleResetCardPaymentErrorStatuses:()=>{e(ot())},redirectToProductSuitePage:()=>{g.trackOnboardingFlowExited("product_suite");const n=q(c.state?.pathnameStackToGoBack,c.pathname);u(`/${v}/onboarding/thankyou`,{state:{pathnameStackToGoBack:n,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(g.trackOnboardingAiFinanceTeamAcknowledged(),e(at(i)))},onIdentityDocumentUploadedForAutofill:n=>{if(i==null)return;const t=nt(n.documentType);t!=null&&(g.trackOnboardingDocumentUploaded("kyc",t),e(tt({target:"onboarding",companyId:i,officerType:n.officerType,fileId:n.fileId,documentType:t})))},onCompanyDocumentUploadedForAutofill:n=>{i!=null&&(g.trackOnboardingDocumentUploaded("kyb",n.documentType),e(et({target:"onboarding",companyId:i,fileId:n.fileId,documentType:n.documentType})))}}}))(Et),le=({taxCFOCustomer:e=!1,isOnAddressPage:l=!1,appContent:i})=>{const a=fn(),p=_e(),u=Te(),c=se(),v=Tt(),n=yn(),[t,C]=d.useState(!1),[o,w]=d.useState(!1),[A,k]=d.useState(!1),{tenantEmailDomain:O}=Ee(),P=hn(),{useFeatureGate:_}=Pe(),{isFeatureEnabled:B}=_(Z.isDebitCardFeatureEnabled),m=Pn("/:tenantEmailDomain/onboarding")!==null&&u.search?.includes("code"),b=x((y=>y.onboardingCustomerViewState.fetchState)),D=x((y=>y.onboardingCustomerViewState.currentStep)),R=x((y=>y.onboardingCustomerViewState.uiState)),h=x((y=>Y(y))),r=x((y=>y.userRoleConfigState.fetchState)),T=x((y=>y.cardPaymentViewState)),E=W(T.addCardPaymentSourceStatus.fetchState),f=T.addCardPaymentSourceStatus.fetchState,{code:U,realmId:N,state:G}=Pt(u.search),L=h.externalConnections?.accounting[0],ee=L?.connectionType,S=L?.connectionName,F=L?.connectionId??"",J=z.getSignedInUser()?.userId??"",$=d.useRef({realmId:"",connectionId:""});d.useEffect((()=>{o||(w(!0),c(Oe()))}),[o,c]),d.useEffect((()=>{A||(dn(["card"]),k(!0))}),[A]),d.useEffect((()=>{E==="In-Progress"&&f==="Completed"&&c(Oe())}),[E,f]),d.useEffect((()=>{Dt(U,N,G,F,J)===!0&&h.externalConnections?.saveConnectionState!=="In-Progress"&&b==="Completed"&&(c(Gn(h.tenantId,{connection_type:ee??"accounting",connection_name:S??"quickbooks_online",authorization_code:U,realm_id:N,connection_id:F,user_id:J},$n(window.location.origin+"/onboarding/auth"))),$.current={realmId:N,connectionId:F},g.trackOnboardingSaveQBOConnection(N,F),p(u.pathname))}),[U,N,G,u.pathname,b]),d.useEffect((()=>{ie.isInitiated===!1&&b==="Completed"&&ie.init("/onboarding/auth",h.tenantEmailDomain)}),[b]);const M=h.companyId??z.getSignedInUserTenant(O)?.companyId,ce=fe(h?.userRole??[]),V=x((y=>we(y,M)));d.useEffect((()=>{t||b!=="Not-Started"||M==null||(C(!0),c(Mn(M,!0,!m)))}),[t,b,M]);const ne=h.externalConnections?.saveConnectionState,Ue=W(ne);d.useEffect((()=>{Ue==="In-Progress"&&(ne==="Completed"||ne==="Error")&&R.isQBOPopupOpen&&D==="connect_ledger"&&(ne==="Completed"?g.trackOnboardingQBOConnectionSuccess($.current.realmId,$.current.connectionId):g.trackOnboardingQBOConnectionFailed($.current.realmId,$.current.connectionId,h.externalConnections?.saveOAuthConnectionError?.message??""),c(me({isQBOPopupOpen:!1})))}),[ne,Ue,R.isQBOPopupOpen,D,g,c]),d.useEffect((()=>{b==="Completed"&&m&&(c(un({step:"connect_ledger"})),c(me({isQBOPopupOpen:!0})))}),[m,b]),d.useEffect((()=>{r==="Not-Started"&&c(Qn(!0))}),[r,c]);const Cn=W(V.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{V.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&V.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Cn==null&&c(ln({addressType:"company_registered_address",addressToCreate:V.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[V.companyDetailsLocalData?.addressStatus?.addressToCreate,V.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const bn=V.isInterimEmailSent,je=z.getSignedInUser();if(je==null)throw Error("Can't access onboarding flow without signing in...");const Sn=xe(B,h),In=Ae(h),Be=h.company?.companyOnboardingInfo.isOnboardingCompleted,Fe=y=>y.trackPageLoaded(ve.Event.onboardingPage),ye=h.productSettings.isOtherProductsEnabled,kn=ye===!0&&!pn(h),On=h.productSettings.isTreasuryEnabled,Re=Rt({tenantEmailDomain:O??"",signedInUserEmail:je.userEmail??"",companyId:M}),Ve=(({companyId:y})=>{const K=se(),de=x((j=>j.onboardingCustomerViewState?.aiAgentsActivation)),te=x((j=>Y(j).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),he=d.useCallback((()=>{K(Rn())}),[K]);d.useEffect((()=>{he()}),[he]);const Le=d.useCallback((()=>{y==null||y===""||te||K(Vn(y))}),[y,te,K]),vn=d.useMemo((()=>{if(y==null||y==="")return[];const j=`private-encrypted-${y}`;return[`${j}.ledger-ingestion.counts-updated`,`${j}.ai-agents-activation.phase-changed`]}),[y]),_n=d.useCallback(((j,ae)=>{if(ae==null||typeof ae!="object")return;const I=ae;if(j!=="ledger-ingestion.counts-updated"){if(j==="ai-agents-activation.phase-changed"){const ue=typeof I.phase_key=="string"?I.phase_key:typeof I.key=="string"?I.key:"",X=typeof I.status=="string"?I.status:"idle";if(ue==="")return;K(Nn({key:ue,status:X==="starting"||X==="building"||X==="ready"?X:"idle",startedAt:typeof I.started_at=="string"?I.started_at:void 0,completedAt:typeof I.completed_at=="string"?I.completed_at:void 0}))}}else K(Ln({customerCount:typeof I.customer_count=="number"?I.customer_count:void 0,glAccountCount:typeof I.gl_account_count=="number"?I.gl_account_count:void 0,targetTransactionCount:typeof I.target_transaction_count=="number"?I.target_transaction_count:void 0,transactionCount:typeof I.transaction_count=="number"?I.transaction_count:void 0,vendorCount:typeof I.vendor_count=="number"?I.vendor_count:void 0}))}),[K]);return Bt({events:vn,onEvent:_n,onSubscribed:he}),d.useMemo((()=>{const j=de?.phases??[],ae=Ze(j,Se),I=Ze(j,Ie),ue=We(j,Se),X=We(j,Ie),Ne=j.some((xn=>xn.status!=="idle")),oe=!te&&!Ne,Ge=te&&!Ne,Tn=Ge?Se.map((()=>"building")):ae,En=Ge?Ie.map((()=>"building")):I;return{ledgerRowStatuses:oe?void 0:Tn,backgroundRowStatuses:oe?void 0:En,showLedgerReadyInLabel:oe?void 0:ue,showBackgroundReadyInLabel:oe?void 0:X,forceContinueEnabled:!oe||void 0,counts:de?.counts,onContinueClicked:Le}}),[de?.phases,de?.counts,te,Le])})({companyId:M});if(Be===!0){if(!ye)return On?s.jsx(Q,{to:"../../treasury"}):Sn?s.jsx(Q,{to:"../../checking"}):In?s.jsx(Q,{to:"../../cards"}):s.jsx(Q,{to:"../../dashboard"});const y=V.updateStatus.fetchState==="In-Progress";if(ye&&!y)return e?s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:K=>Fe(K)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Re,aiAgentsActivationProps:Ve,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):s.jsx(Q,{to:"../../onboarding/thankyou"})}else if(Be===!1&&P?.loggedInUserRoleMap!=null)return bn===!0&&kn?s.jsx(Q,{to:"../../onboarding/thankyou"}):s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:y=>Fe(y)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Re,aiAgentsActivationProps:Ve,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ke="external_integrations",Rt=({tenantEmailDomain:e,signedInUserEmail:l,companyId:i})=>{const a=se(),{pendingAutoFocusTabId:p}=Ut(),{plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v}=jt({companyId:i}),n=x((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=x((r=>Y(r))),C=x((r=>r.tenantState.fetchState)),o=x((r=>Kn(r,i))),w=x((r=>zn(r,ke))),A=d.useMemo((()=>new Set(w.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[w]),k=t.tenantId,O=fe(t.userRole??[]);d.useEffect((()=>{a(qn(ke))}),[a]);const P=o.externalConnections?.saveAPIKeyConnectionState,_=o.externalConnections?.saveAPIKeyConnectionError?.message,B=W(P);d.useEffect((()=>{B==="In-Progress"&&(P==="Completed"?g.trackIntegrationConnected("chargebee","Onboarding","revenue"):P==="Error"&&g.trackIntegrationConnectFailed("chargebee","Onboarding","revenue",_??""))}),[P,B,_]);const m=o.externalConnections?.saveOAuthConnectionState,b=o.externalConnections?.saveOAuthConnectionError?.message,D=W(m);d.useEffect((()=>{D==="In-Progress"&&(m==="Completed"?g.trackIntegrationConnected("hubspot","Onboarding","revenue"):m==="Error"&&g.trackIntegrationConnectFailed("hubspot","Onboarding","revenue",b??""))}),[m,D,b]);const R=o.externalConnections?.saveConnectorCredentialsStateBySlug,h=W(R);return d.useEffect((()=>{const r=R??{},T=h??{},E=o.externalConnections?.saveConnectorCredentialsErrorBySlug??{};Object.keys(r).forEach((f=>{if(T[f]!=="In-Progress")return;let U;try{U=Ce(f)}catch{return}r[f]==="Completed"?g.trackIntegrationConnected(U,"Onboarding","payments"):r[f]==="Error"&&g.trackIntegrationConnectFailed(U,"Onboarding","payments",E[f]?.message??"")}))}),[R,h,o]),d.useMemo((()=>({isAdmin:O,analytics:g,referrer:"Onboarding",integrationsView:o,isLoading:C==="In-Progress",notifyMeRegisteredSlugs:A,autoFocusTabId:p??void 0,saveChargeBeeState:o.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:o.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:o.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:o.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:o.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(o.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,T])=>[r,T?.message]))),deleteConnectionState:o.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:o.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{g.trackIntegrationConnectClicked("gmail","Onboarding","email"),a(Qe(k,"gmail",tn()))},onConnectOutlook:()=>{g.trackIntegrationConnectClicked("outlook","Onboarding","email"),a(Qe(k,"outlook",tn()))},onConnectHubSpot:(r,T)=>{const E=o.externalConnections?.revenue?.find((U=>U.connectionName==="hubspot"))?.connectionId;if(E==null)return;g.trackIntegrationCredentialsSubmitted("hubspot","Onboarding","revenue");const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:T,connection_id:E,redirect_uri:f,tenant_id:k})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(f)}`},onDisconnect:(r,T)=>{const E=[...o.externalConnections?.accounting??[],...o.externalConnections?.payments??[],...o.externalConnections?.revenue??[]].find((U=>U.connectionId===r))?.connectionName;let f;try{f=E!=null?Ce(E):void 0}catch{f=void 0}f!=null&&g.trackIntegrationDisconnected(f,"Onboarding",T),a(Wn(k,r,be(T)))},onNotifyMe:r=>{g.trackIntegrationsNotifyMeClicked("Onboarding",r),a(Zn(ke,r,l))},onReconnectQBO:()=>{ie.init("/onboarding/auth",e),ie.handleClick()},onRefreshClick:()=>{o.integrations.refreshQBO.fetchState!=="In-Progress"&&a(Xn())},onSaveChargeBeeCredentials:(r,T)=>{const E=o.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;E!=null&&(g.trackIntegrationCredentialsSubmitted("chargebee","Onboarding","revenue"),a(Jn(k,E,be("revenue"),Ce("chargebee"),{api_key:r,site:T})))},onSaveConnectorCredentials:r=>{g.trackIntegrationCredentialsSubmitted(r.connectionName,"Onboarding","payments"),a(Hn(k,be("payments"),r))},plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v,plaidConnectionDetails:n})),[O,o,C,A,p,k,l,e,a,u,c,v,n])};function tn(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function an(e,l,i){let a=`/${e}/onboarding/address`;return a=i!=null?a.concat(`/edit/${l}/${encodeURIComponent(i)}`):a.concat(`/new/${l}`),a}const on=De.div`
27
- display: flex;
28
- height: 100vh;
29
- background-color: ${e=>e.theme.colors.grey4};
30
- `,sn=cn((function(e,l){const{companyId:i,currentTenant:a}=l,p=we(e,i),u=mn(e);return{hasVerifiedBankAccount:(p.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(u.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:fe(a?.userRole??[])&&p.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:z.getSignedInUser(),currentTenant:a}}),(function(e,l){const{currentTenant:i,themeState:a,navigate:p,location:u}=l,{tenantEmailDomain:c}=i;return{onZeniLogoClick:()=>{a.toggle()},handleLogOutClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p("/signout",{replace:!0,state:{pathnameStackToGoBack:v,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{p(`/${c}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p(`/${c}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:v,message:"UpdatePaymentAddressDetail"}})}}}))(wt),Vt=()=>{const e=fn(),l=_e(),i=se(),a=Te(),p=yn(),{useFeatureGate:u}=Pe(),{isFeatureEnabled:c}=u(Z.isDebitCardFeatureEnabled),{tenantEmailDomain:v}=Ee(),n=hn(),[t,C]=d.useState(!1);d.useEffect((()=>{t===!1&&a.state?.message==="OnboardingThankyou"&&C(!0)}),[a.state]);const o=x((m=>Y(m))),w=o.productSettings.isOtherProductsEnabled,A=w===!0&&!pn(o);d.useEffect((()=>{i(gn(k,!1,!A))}),[]);const k=o.companyId??z.getSignedInUserTenant(v)?.companyId;if(n.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const O=xe(c,o),P=Ae(o),_=x((m=>m.onboardingCustomerViewState.updateStatus.fetchState)),B=o.company?.companyOnboardingInfo.isOnboardingCompleted;if(B!==!0||A)return _==="Completed"&&B===!0&&A&&n?.loggedInUserRoleMap!=null?s.jsxs(on,{children:[s.jsx(re,{analytics:g,onLoad:m=>{m.trackPageLoaded(ve.Event.onboardingLandingPage,"Onboarding",Ot(o.productSettings))}}),s.jsx(sn,{navigate:l,showUpdatePaymentDetailButton:w,location:a,companyId:k,currentTenant:o,themeState:p,isVisitingFirstTime:t,meetingUrl:e("onboarding_overview")})]}):_==="Completed"&&B===!1&&n?.loggedInUserRoleMap!=null?s.jsxs(on,{children:[s.jsx(re,{analytics:g,onLoad:m=>{m.trackPageLoaded(ve.Event.onboardingInterimPage)}}),s.jsx(sn,{navigate:l,showUpdatePaymentDetailButton:w,location:a,companyId:k,currentTenant:o,themeState:p,isVisitingFirstTime:t,meetingUrl:e("onboarding_overview")})]}):s.jsx(At,{});{const m={pathnameStackToGoBack:a.state?.pathnameStackToGoBack,message:"activation"};return O?s.jsx(Q,{to:"../../checking",state:m,replace:!0}):P?s.jsx(Q,{to:"../../cards",state:m,replace:!0}):s.jsx(Q,{to:"../../dashboard",state:m,replace:!0})}};function rn(){return typeof Me=="function"?Me():void 0}let pe=0;function Lt(){d.useEffect((()=>{if(!ge.sentryDsn?.trim())return;let e,l=!1,i=0;const a=()=>{e!==void 0&&(clearInterval(e),e=void 0)},p=()=>{const u=rn();return u!==void 0&&(u.flush(),!0)};return pe+=1,p()||(e=setInterval((()=>{i+=1,(l||p()||i>=10)&&a()}),1e3)),()=>{l=!0,a(),pe-=1,queueMicrotask((()=>{pe===0&&(function(){const u=rn();if(u===void 0)return;const c=()=>{if(pe===0)try{u.startBuffering()}catch{}};u.stop().then(c,c)})()}))}}),[])}function pa(){return Lt(),s.jsxs(Dn,{children:[s.jsx(H,{path:"/",element:s.jsx(le,{})}),s.jsx(H,{path:"/billing/edit",element:s.jsx(le,{taxCFOCustomer:!0})}),s.jsx(H,{path:"/thankyou",element:s.jsx(Vt,{})}),s.jsx(H,{path:"/activation",element:s.jsx(Ft,{})}),s.jsx(H,{path:"/address/edit/:addressType/:addressId",element:s.jsx(le,{isOnAddressPage:!0,appContent:s.jsx($e,{})})}),s.jsx(H,{path:"/address/new/:addressType",element:s.jsx(le,{isOnAddressPage:!0,appContent:s.jsx($e,{})})}),s.jsx(H,{path:"*",element:s.jsx(wn,{})})]})}export{pa as default};