@zeniai/web-app-ui 5.3.58-qa → 5.3.59-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 (142) hide show
  1. package/dist/assets/{AccountMappingScreen-CHe5ZDGP.js → AccountMappingScreen-DTTeREwj.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-C-SpCliN.js → ActualMatchingMatchDetailScreen--9Q2zWrD.js} +1 -1
  3. package/dist/assets/AddressRoutes-CpjgVbMa.js +1 -0
  4. package/dist/assets/AddressScreen-I8Rs-MIn.js +9 -0
  5. package/dist/assets/AiCfoScreen-xXGezaaX.js +22 -0
  6. package/dist/assets/{AppDrawer-DOUxHB1n.js → AppDrawer-B74W93Dx.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-B0Nta3_I.js → BillPayApprovalRoutes-DCL_JI3v.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-B9TIHh4P.js → BillPayRoutes-4uVHGBny.js} +10 -10
  9. package/dist/assets/{BusinessVerificationPageScreen-DrcWW1y2.js → BusinessVerificationPageScreen-Cp54FFZH.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-DlYyRzr9.js → CardsAiCfoScreen-6wFZ3h7n.js} +1 -1
  11. package/dist/assets/ChargeCardRoutes-kaYLfF_G.js +71 -0
  12. package/dist/assets/CompanyPassportScreen-CpTbm6Sc.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-BPhkvgwP.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-vcuV_rLb.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-CV-zX-f3.js → CustomerOnboardingRoutes-C2BUPvve.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-B4rPAFsp.js → DashboardRoutes-i732ENnt.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-D2yS26zu.js → DefaultTenantHome-Fr9STTcy.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-DldCKkMe.js +18 -0
  19. package/dist/assets/{DrawerScreen-DcAKkP88.js → DrawerScreen-DKrIxc45.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-Ci3OHQmT.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-2l3STf0l.js → ExpenseAutomationRoutes-D2Y0HhSl.js} +4 -4
  22. package/dist/assets/FeaturePreviewScreen-SWdUfPQt.js +1 -0
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-Doqpd6l9.js → HubSpotOAuthCallbackScreen-DDiR98eZ.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-zG7x1gLM.js → InboxNotificationsProvider-Cqk-hq7Y.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-BIKlKPOH.js +2 -0
  26. package/dist/assets/MagicLinkRoutes-BjSYWVoE.js +72 -0
  27. package/dist/assets/MagicLinkSignInScreen-CVVN5hX7.js +12 -0
  28. package/dist/assets/MobileAppDrawer-7ZhbRmu1.js +1 -0
  29. package/dist/assets/NotFoundScreen-DcVbM1H7.js +1 -0
  30. package/dist/assets/{NotificationRoutes-hJV6UzGh.js → NotificationRoutes-CjrMrdzi.js} +1 -1
  31. package/dist/assets/OAuthConsentScreen-DhHm1x32.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-fBT0Sc9A.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-DDprDsoQ.js → PaymentLinkScreen-CgUBBSzR.js} +9 -9
  34. package/dist/assets/{PeopleRoutes-BlO3KG08.js → PeopleRoutes-CwPbD29F.js} +5 -5
  35. package/dist/assets/{PerformanceRoutes-6Ca4X1Bq.js → PerformanceRoutes-DJaLpKq7.js} +1 -1
  36. package/dist/assets/{Preview-Crvq2j5W.js → Preview-DZpsneMy.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-ByT4Lz_O.js → QBOConnectionScreen-B-S6pmPF.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-BVIa8SJX.js → ReimbursementApprovalRoutes-NW-WKLny.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BmA4MWUa.js → ReimbursementApprovalRuleDetailScreen-D61HNZbO.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-CRFGQISM.js → ReimbursementRoutes-Df6Tud5L.js} +12 -12
  41. package/dist/assets/{ReportsRoutes-s6sDyTPD.js → ReportsRoutes-CuktTqMX.js} +1 -1
  42. package/dist/assets/RewardsRoutes-5Gqy0mIy.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CDMS-Kyu.js → ScheduleDetailsPrepaidExpensesScreen-DazVitQy.js} +5 -5
  44. package/dist/assets/{ScreenRoutes-DGSfHb9l.js → ScreenRoutes-BuhEV3h0.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-C_k-hnnr.js → SettingsRoutes-CEmnHqG6.js} +5 -5
  46. package/dist/assets/{SetupPagesScreen-DAfX5Gik.js → SetupPagesScreen-DdTVcR2_.js} +5 -5
  47. package/dist/assets/{SignInScreen-C5hV08WY.js → SignInScreen-BITRkzSC.js} +1 -1
  48. package/dist/assets/SignOutScreen-C5iuWq-z.js +9 -0
  49. package/dist/assets/{TaskListScreen-DKWXa0Uv.js → TaskListScreen-CwUzHwaA.js} +2 -2
  50. package/dist/assets/TaskRoutes-CFl1X2SM.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-DK4lWWF0.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-iW49SNvH.js +5 -0
  53. package/dist/assets/{TransactionListRoutes-CiDmnLCE.js → TransactionListRoutes-BsHwubWD.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-3zDhHaKN.js → TreasuryRoutes-CN9ZH5Gy.js} +5 -5
  55. package/dist/assets/{VendorsRoutes-BkvgN-45.js → VendorsRoutes-B3QNi1in.js} +10 -10
  56. package/dist/assets/WiseConfirmationScreen-adPXoaAz.js +12 -0
  57. package/dist/assets/ZeniAccountRoutes-CFTwFem2.js +57 -0
  58. package/dist/assets/ZeniAccountStatementScreen-D7D_AloB.js +9 -0
  59. package/dist/assets/{accountMappingHelper-Dr9MEF3a.js → accountMappingHelper-DPpfSFuE.js} +1 -1
  60. package/dist/assets/{analytics-Ckbn2qr2.js → analytics-VM2TTd1t.js} +1 -1
  61. package/dist/assets/{analyticsHelper-vNgRVJkc.js → analyticsHelper-DRQlG4Yk.js} +1 -1
  62. package/dist/assets/{core-C1MQ75FC.js → core-DuhHfvEc.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-BkSrHWOz.js → decodeURIComponentSafe-BuuGDiIq.js} +1 -1
  64. package/dist/assets/{dnd-64pfrglk.js → dnd-pjIs22E1.js} +1 -1
  65. package/dist/assets/{empty-CPYiU0XG.js → empty-CJJq6lBE.js} +1 -1
  66. package/dist/assets/{empty-DTjUxrNn.js → empty-DH6a4LIS.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-lIBGY-aq.js → emptyVideoElement-Buo10ELC.js} +1 -1
  68. package/dist/assets/epic-BrvjVRdN.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-B5_HDAxt.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-BAgQLN5V.js → getLocaleForTenant-pGR9Sol9.js} +1 -1
  71. package/dist/assets/{index-DheSTGi7.js → index-BSR6syxs.js} +12365 -12358
  72. package/dist/assets/{index-Dl0S4JM9.js → index-BnTSo1tz.js} +1 -1
  73. package/dist/assets/{index-BgIX2Tk5.js → index-CKIs26-I.js} +2 -2
  74. package/dist/assets/{index-RA90NjT0.js → index-DLhjtHx_.js} +1 -1
  75. package/dist/assets/{index-Dcy8EwAy.js → index-Da30M-mt.js} +1 -1
  76. package/dist/assets/{index-fx_VKS0e.js → index-DhX5ECiu.js} +1 -1
  77. package/dist/assets/{index-DBaQwW7d.js → index-iYJnyyes.js} +1 -1
  78. package/dist/assets/{index-DuTsLjcS.js → index-sDU_TgqD.js} +1 -1
  79. package/dist/assets/{lexical-TkcJlpM_.js → lexical-Db4_RNT4.js} +1 -1
  80. package/dist/assets/{liveblocks-BF-IiX2V.js → liveblocks-Bnd7TfEn.js} +1 -1
  81. package/dist/assets/{lottie-CWNAcXJv.js → lottie-DnzLxz4m.js} +1 -1
  82. package/dist/assets/{mui-D4JyxRuO.js → mui-CAtYecwm.js} +1 -1
  83. package/dist/assets/{pathToGoBack-wJzek_Cz.js → pathToGoBack-DaQqgjO2.js} +1 -1
  84. package/dist/assets/{pdf-Cj_veg-U.js → pdf-C4y-9f6g.js} +3 -3
  85. package/dist/assets/{pdf-lib-LgS50teK.js → pdf-lib-BWugleNz.js} +1 -1
  86. package/dist/assets/{plaid-CD2DDkpy.js → plaid-DQqtphHb.js} +1 -1
  87. package/dist/assets/{pusher-CgyD-8gi.js → pusher-HpTlXf8Y.js} +1 -1
  88. package/dist/assets/{react-DylygKQb.js → react-C6LG84CA.js} +1 -1
  89. package/dist/assets/{react-DW9umh8L.js → react-C6rP9W0h.js} +1 -1
  90. package/dist/assets/{react-LQ8ewR7F.js → react-Ci7GXtnj.js} +1 -1
  91. package/dist/assets/{react-BhEAmIaW.js → react-DxnB6A_E.js} +1 -1
  92. package/dist/assets/{react-BPkYL230.js → react-RcSRKvz2.js} +1 -1
  93. package/dist/assets/{react-CBd5YUO5.js → react-Zn4z9FkL.js} +1 -1
  94. package/dist/assets/{recharts-BEOxWuh3.js → recharts-Ax0XVvbk.js} +1 -1
  95. package/dist/assets/{routePaths-DrHt4RCx.js → routePaths-DY-fUoNb.js} +1 -1
  96. package/dist/assets/{sentry-DQv7eTqs.js → sentry-C4tTgPRE.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CF6NUsXZ.js → stripSplatSuffix-C2h79EC3.js} +1 -1
  98. package/dist/assets/{url-Eifk29FQ.js → url-Cf1wHOjT.js} +1 -1
  99. package/dist/assets/{url-BQJem0W5.js → url-oIafCeJQ.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-BS7hRXcn.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DRaJ3Gwb.js → useAiCfoDashboardSuggestedQuestionsChips-DS5PLjzx.js} +1 -1
  102. package/dist/assets/{useAskAiCfoHostNavButtonProps-DhY9V91R.js → useAskAiCfoHostNavButtonProps-BmrnfhUQ.js} +1 -1
  103. package/dist/assets/{useChargeCardPusherEvents-Cwq1bouz.js → useChargeCardPusherEvents-BgJc6X4f.js} +1 -1
  104. package/dist/assets/{useDeviceId-BrccfFDF.js → useDeviceId-D-PGNAnc.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-BiJOFAYU.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-Fj77Qh1B.js → useInitialThreadRequest-B6RfidGO.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-BOnqrzjJ.js → useTaskManagerAccess-CSigDKkg.js} +1 -1
  108. package/dist/assets/{useTaskManagerPusherEvents-jr7UAjj6.js → useTaskManagerPusherEvents-7vpYlql3.js} +1 -1
  109. package/dist/assets/{utils-G6VVxCSd.js → utils-BtDnAqMA.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-DdbBVvXc.js → withTransactionSidePanel-C37C2_tY.js} +4 -4
  111. package/dist/assets/{zeni-epic-state-Dmop9tB7.js → zeni-epic-state-B5FlPsWC.js} +6 -6
  112. package/dist/index.html +1 -1
  113. package/package.json +3 -3
  114. package/dist/assets/AddressRoutes-D1soVd7h.js +0 -1
  115. package/dist/assets/AddressScreen-Dsruahz2.js +0 -9
  116. package/dist/assets/AiCfoScreen-3zzxXdtv.js +0 -22
  117. package/dist/assets/ChargeCardRoutes-DZRPdI1Z.js +0 -71
  118. package/dist/assets/CompanyPassportScreen-DAYszi2A.js +0 -1
  119. package/dist/assets/ConnectionAuthScreen-BBBGS4jz.js +0 -11
  120. package/dist/assets/CustomerOnboardingAuthScreen-CZDOwYAs.js +0 -1
  121. package/dist/assets/DomesticWireDetailScreen-C3OQdqoM.js +0 -18
  122. package/dist/assets/EntityDetailRoutes-Cf2odala.js +0 -1
  123. package/dist/assets/FeaturePreviewScreen-B1Ivzvw1.js +0 -1
  124. package/dist/assets/InvoicingRoutes-CQVQ-Y38.js +0 -2
  125. package/dist/assets/MagicLinkRoutes-DcyXYSMX.js +0 -72
  126. package/dist/assets/MagicLinkSignInScreen-DSwu3x1a.js +0 -12
  127. package/dist/assets/MobileAppDrawer-CdDtqWOO.js +0 -1
  128. package/dist/assets/NotFoundScreen-ujna2tN5.js +0 -1
  129. package/dist/assets/OAuthConsentScreen-CC7ydiAB.js +0 -1
  130. package/dist/assets/PandLWithForecastRoutes-BlHGiHRN.js +0 -1
  131. package/dist/assets/RewardsRoutes-D_CDp-DT.js +0 -1
  132. package/dist/assets/SignOutScreen-BW3JHrQP.js +0 -9
  133. package/dist/assets/TaskRoutes-uwwC8_Az.js +0 -9
  134. package/dist/assets/TransactionDetailRoutes-9VQeLVZi.js +0 -1
  135. package/dist/assets/TransactionDetailScreen-D87lkTI9.js +0 -5
  136. package/dist/assets/WiseConfirmationScreen-Ca5i9ss6.js +0 -12
  137. package/dist/assets/ZeniAccountRoutes-BDqvTfgU.js +0 -57
  138. package/dist/assets/ZeniAccountStatementScreen-iAxQqIlV.js +0 -9
  139. package/dist/assets/epic-Sk9LU7p7.js +0 -2
  140. package/dist/assets/expenseAutomationHelper-VfFbXlTC.js +0 -1
  141. package/dist/assets/useActualMatchingMatchDetail-DXOytDvG.js +0 -1
  142. package/dist/assets/useEmailConnectResultRefresh-2DUe5mQi.js +0 -1
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-DheSTGi7.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-DQv7eTqs.js"><link rel="modulepreload" crossorigin href="/assets/core-C1MQ75FC.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-Dmop9tB7.js"><link rel="modulepreload" crossorigin href="/assets/mui-D4JyxRuO.js"><link rel="modulepreload" crossorigin href="/assets/analytics-Ckbn2qr2.js"><link rel="modulepreload" crossorigin href="/assets/utils-G6VVxCSd.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-BSR6syxs.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-C4tTgPRE.js"><link rel="modulepreload" crossorigin href="/assets/core-DuhHfvEc.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-B5FlPsWC.js"><link rel="modulepreload" crossorigin href="/assets/mui-CAtYecwm.js"><link rel="modulepreload" crossorigin href="/assets/analytics-VM2TTd1t.js"><link rel="modulepreload" crossorigin href="/assets/utils-BtDnAqMA.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.58-qa",
3
+ "version": "5.3.59-dev",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  "@sentry/react": "^9.42.1",
30
30
  "@stripe/stripe-js": "^4.4.0",
31
31
  "@zeniai/client-analytics": "2.0.92",
32
- "@zeniai/client-epic-state": "5.2.58",
33
- "@zeniai/web-components": "4.3.93",
32
+ "@zeniai/client-epic-state": "5.2.60",
33
+ "@zeniai/web-components": "4.3.96",
34
34
  "color": "3.1.3",
35
35
  "crypto-js": "4.2.0",
36
36
  "dnd-core": "^16.0.1",
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-BF-IiX2V.js";import{A as i}from"./AddressScreen-Dsruahz2.js";import s from"./NotFoundScreen-ujna2tN5.js";import"./sentry-DQv7eTqs.js";import{n as d,o as r}from"./core-C1MQ75FC.js";import"./zeni-epic-state-Dmop9tB7.js";import"./recharts-BEOxWuh3.js";import"./index-DheSTGi7.js";import"./mui-D4JyxRuO.js";import"./analytics-Ckbn2qr2.js";import"./plaid-CD2DDkpy.js";import"./dnd-64pfrglk.js";import"./stripe-cKAAJElX.js";import"./lottie-CWNAcXJv.js";import"./lexical-TkcJlpM_.js";import"./pdf-Cj_veg-U.js";import"./utils-G6VVxCSd.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]="81cbb5c1-1b56-4d87-a240-ae6c03b91825",t._sentryDebugIdIdentifier="sentry-dbid-81cbb5c1-1b56-4d87-a240-ae6c03b91825")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,9 +0,0 @@
1
- import{j as d}from"./liveblocks-BF-IiX2V.js";import{a as b}from"./sentry-DQv7eTqs.js";import{h as T,u as P,g as j,i as E,j as B,l as M}from"./core-C1MQ75FC.js";import{a2 as V,E as $,z as D,Q as L,a8 as K,a9 as F,l as _,V as S,a4 as z,_ as h,a5 as N}from"./index-DheSTGi7.js";import{Vn as C,ip as R,fF as U,Vo as G,c8 as H,Vp as O,mH as q}from"./zeni-epic-state-Dmop9tB7.js";import{n as Q}from"./mui-D4JyxRuO.js";import J from"./NotFoundScreen-ujna2tN5.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]="bb364d5a-6fa3-4aa5-bac7-1737fa2ad69a",e._sentryDebugIdIdentifier="sentry-dbid-bb364d5a-6fa3-4aa5-bac7-1737fa2ad69a")}catch{}})();const W=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
- `,X=M((function(e,a){const{addressId:o,isSubPage:i,addressType:c}=a,l=U(e),t=a.roleMap!=null&&G(a.roleMap),n=i||c==="user_address"||H(l?.userRole??[])||t?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:n,isSubPage:i,dontShowSaveConfirmationPopup:a.dontShowSaveConfirmation}}const r=C(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:n}}),(function(e,a){const{navigate:o,location:i,addressType:c}=a,l=t=>{if(t==="express-pay")o("../express-pay/add-wire");else{const n=i.state,r=N(n?.pathnameStackToGoBack);let s=r.poppedPathname??v();const u=n?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:t=>{const n=Y(t);e(q({addressType:c,addressToCreate:n})),_?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:t.street.addressString,city:t.city,state:t.state,country:t.country.selectedOption??"",postalCode:t.postalCode,suite:t.suite,secondaryInfo:t.secondaryInfo}),l(a.bankAccountContext)},onCancel:()=>{l(a.bankAccountContext)}}}))(z);function de({isSubPage:e,hideAddressSubTitle:a=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const t=T(),n=P(),r=j(),{addressId:s,addressType:u}=E(),g=V(),I=$(),k=D.getSignedInUser(),[p,w]=b.useState(s==null),f=B((m=>s!=null?C(m,s).fetchState:"Not-Started")),x=L();if(k==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect((()=>{p||s==null||(w(!0),n(R(s,!1)))}),[p,s,n]),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)?!p&&f==="Not-Started"||p&&f==="In-Progress"?d.jsx(K,{fetchState:f,style:{backgroundColor:I.colors.grey5}}):s!=null&&f==="Error"?(t(`${v(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(F,{analytics:_,onLoad:A}),d.jsx(W,{windowSize:g,children:d.jsx(X,{location:r,navigate:t,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:a,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):d.jsx(J,{})}const v=(e=2)=>{let a="../";for(let o=0;o<e;o++)a=`${a}../`;return a},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{de as A,Y as t};
@@ -1,22 +0,0 @@
1
- import{j as h}from"./liveblocks-BF-IiX2V.js";import{a}from"./sentry-DQv7eTqs.js";import{u as Ut,h as Dt,i as Lt,g as Bt,j as b,l as Ft}from"./core-C1MQ75FC.js";import{a as Mt,k as Vt,e7 as $t,z as Nt,a2 as qt,e8 as Gt,e9 as Ht,ea as zt,bq as Be,eb as We,ec as Wt,bp as Je,a5 as ge,a9 as ce,l as M,ed as me,ee as Jt,ef as Kt,av as Yt,V as Xt,w as Zt,eg as es,eh as ts,aw as ss,ei as as,ej as ns,ek as os,el as is,p as rs,bl as Fe,em as ls}from"./index-DheSTGi7.js";import{fE as F,gt as R,U5 as us,a2e as ds,a2f as cs,jM as ms,a2g as Ss,jJ as hs,a2h as Se,jp as W,jS as J,jv as Ie,jc as he,ja as ps,jU as fs,jE as Ke,Ue as Me,gv as V,gK as gs,Ud as Is,T_ as Ve,fF as Cs,j3 as ks,a2i as bs,g8 as vs,jl as Es,jh as Ps,fG as pe,gf as ys,a2j as ws,a2k as xs,a2l as Rs,gu as Ts,go as $e,k4 as Ne,gq as qe,gw as js,a2m as Ge,jV as Os,je as As,jy as _s,jQ as He,jB as Qs,gx as Us,gy as Ds,gz as Ls,gA as Bs}from"./zeni-epic-state-Dmop9tB7.js";import{D as Fs,n as $,S as Ms,P as Vs}from"./mui-D4JyxRuO.js";import{u as $s}from"./useAiCfoDashboardSuggestedQuestionsChips-DRaJ3Gwb.js";import{p as Ns}from"./pathToGoBack-wJzek_Cz.js";import{j as qs}from"./routePaths-DrHt4RCx.js";import{u as Gs}from"./useTaskManagerPusherEvents-jr7UAjj6.js";import"./recharts-BEOxWuh3.js";import"./analytics-Ckbn2qr2.js";import"./plaid-CD2DDkpy.js";import"./dnd-64pfrglk.js";import"./stripe-cKAAJElX.js";import"./lottie-CWNAcXJv.js";import"./lexical-TkcJlpM_.js";import"./pdf-Cj_veg-U.js";import"./utils-G6VVxCSd.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="3acf10cc-a6d5-46c4-9dac-a81c7b2b9d09",s._sentryDebugIdIdentifier="sentry-dbid-3acf10cc-a6d5-46c4-9dac-a81c7b2b9d09")}catch{}})();const Hs=["claimed","running","succeeded","failed","timeout"],fe=s=>typeof s=="string"&&s!=="",Ye="chat-response-generated";function zs(s,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const t=R(s).skills.find((l=>l.macroId===r.savedMacroId));return t==null?void 0:{status:"saved",command:t.name}}const Ws=Ft((function(s,r){const t=F(s),l=r.isSubmitting,c=t.uiState?.currentChatSessionId,i=c!=null?ys(s.aiCfoState,c):[],f=ts(s,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),p=ws(s),S=xs(s),A=Rs(s);return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:l,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ss}/tableDownload`,exportDownloadEndPoint:os(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:R(s).skills,skillSaveState:zs(s,A),skillsEnabled:R(s).skillsEnabled,skillsList:R(s).skills,skillsListError:R(s).fetchState==="Error",skillsListLoading:R(s).fetchState==="In-Progress",skillsCanPublish:R(s).canPublish,skillSaving:A.fetchState==="In-Progress",skillSaveError:A.fetchState==="Error",skillVersionHistory:p.macroId!=null?{macroId:p.macroId,versions:p.versions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillRestoreBody:S.macroId!=null&&S.version!=null?{macroId:S.macroId,version:S.version,instructions:S.instructions,error:S.fetchState==="Error",loading:S.fetchState==="In-Progress"}:void 0,skillDetail:J(s).detail,skillDetailError:J(s).fetchState==="Error",skillDetailLoading:J(s).fetchState==="In-Progress",syntheticAnswers:i,resolveSyntheticAnswerCardTile:ns(s),resolveSyntheticAnswerPolicyTile:as(s),...f}}),(function(s,r){const{location:t,currentTenant:l,userId:c,navigate:i,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:p,isAiCardCreationEnabled:S,isCardPolicyEnabled:A,setIsAiCfoOpen:D}=r,T=l.tenantEmailDomain;return{onEventReceived:(n,o)=>{if(n===Ye&&typeof o.text=="string"&&typeof o.metadata=="object"){const m=o,E=Us(m.type),v=m.metadata.chat_session_id??null,{currentChatSession:K,currentQuestionAnswer:j,currentQuestionAnswerSummary:Y}=Je(p,v);E!=="answer"?M.trackAICFOChatResponseGenerated(E,j?.question.questionText??"",m.text,v,ls(Y,K),m.metadata.message_id??null):M.trackAICFOChatAnswerGenerated(m.text,j?.question.questionText??"",(m.follow_up_questions?.length??0)>0,!!m.assumptions,!!m.insights,m.visualization!=null,Ds(m.visualization?.type??"")??null,v,m.summarized_title,m.metadata.message_id??null),s(Ls({chatSessionId:m.metadata.chat_session_id,responseType:E,fetchState:{fetchState:"Completed",error:void 0}})),s(Bs({chatSessionId:m.metadata.chat_session_id,answerPayload:m,userId:c}))}},onSubmit:(n,o,m,E,v)=>{n&&Fe(s,n,o,f,p,c,E,m,void 0,v)},onFetchSkills:()=>{s(Ke())},onOpenSkill:n=>{s(Ie({macroId:n})),s(Qs({macroId:n}))},onSaveSkill:(n,o)=>{s(He({draft:n,macroId:o}))},onSaveSkillDraft:n=>{const o=n.displayName?.trim()??"",m=n.name?.trim()??"";s(He({draft:{name:o.length>0?o:m,description:n.description?.trim()??null,instructions:n.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(n,o)=>{s(_s({macroId:n,version:o}))},onDeleteSkill:n=>{s(As({macroId:n}))},onSetSkillVisibility:(n,o)=>{s(Os({macroId:n,visibility:o}))},onCloseSkillDetail:()=>{s(Ge())},onRunSkill:(n,o)=>{s(V()),s($e()),Fe(s,o,"user_input",void 0,p,c,void 0,void 0,void 0,n),s(Ge())},updateCurrentInput:n=>{s(qe(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{s(js(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{i(-1)},onCloseClick:()=>{const n=ge(t.state?.pathnameStackToGoBack),o=n.poppedPathname??Ns(1);i(o,{state:{...t.state,pathnameStackToGoBack:n.newStack}}),s(qe(""))},togglePageView:()=>{const n=ge(t.state?.pathnameStackToGoBack),o=n.poppedPathname??`/${l.tenantEmailDomain}/dashboard`;i(o,{state:{...We(t.state),pathnameStackToGoBack:n.newStack,message:"open_ai_cfo_drawer"}}),D(!0)},onCopy:()=>{},onThumbsUp:(n,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(n,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{i(-1)},onNewChatClick:()=>{s(V()),f!=null&&s($e());const n=rs(t.state?.pathnameStackToGoBack,t.pathname);i(`/${l.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:n.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(n,o)=>{s(Ts({questionAnswerId:n,isCollapsed:o}))},onMenuClick:r.onMenuClick,...is(s,{isAiCardCreationEnabled:S,isCardPolicyEnabled:A,currentChatSessionId:f,onAfterCardsCreationSubmit:()=>{D(!0),i(`/${T}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{D(!0),i(`/${T}/cards/policy`,{state:{...t.state}})}})}}))(Zt(es)),Ia=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Mt(),t=Ut(),l=Dt(),{session_id:c}=Lt(),i=Bt(),f=new URLSearchParams(i.search).get("routine")??void 0,[p,S]=a.useState(!1),A=b((e=>F(e).uiState.isSkillsBrowserOpen===!0)),D=b((e=>R(e).skillsEnabled)),T=b((e=>F(e).uiState.isRoutinesBrowserOpen===!0)),n=b((e=>us(e))),o=b((e=>ds(e))),m=b((e=>cs(e))),[E,v]=a.useState(void 0),[K,j]=a.useState(!1),[Y,Ce]=a.useState(void 0),Xe=a.useCallback((()=>{Ce(void 0),v(void 0),j(!0)}),[]),Ze=a.useCallback((e=>{v(e),j(!0)}),[]),et=a.useCallback((()=>{v(void 0),j(!1)}),[]),tt=a.useCallback((e=>{t(ms({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),v(void 0),j(!1)}),[t,E]),P=f,ke=n.routines.find((e=>e.scheduleId===P)),I=b((e=>Ss(e))),st=a.useCallback((e=>{t(hs({scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{t(P!=null?W({scheduleId:P}):Se())}),[t,P]);const B=ke?.macroId,at=b((e=>J(e))),be=B!=null&&B!==""&&at.fetchState==="Not-Started";a.useEffect((()=>{be&&B!=null&&t(Ie({macroId:B}))}),[t,be,B]);const nt=b((e=>F(e).uiState.currentChatSessionId))??c,C=n.routines.find((e=>e.scheduleId===f))??n.routines.find((e=>e.scheduleId===Vt(nt))),O=C?.scheduleId??null,[ve,ot]=a.useState(!0);a.useEffect((()=>{O!=null&&t(W({scheduleId:O}))}),[t,O]);const Ee=I.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;a.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{t(W({scheduleId:P})),t(he())}),5e3);return()=>window.clearInterval(e)}),[t,Ee,P]);const it=a.useCallback((e=>{Ce(e),v(void 0),j(!0)}),[]),rt=a.useCallback((e=>{t(ps({scheduleId:e.scheduleId}))}),[t]),lt=a.useCallback(((e,d)=>{t(fs({enabled:d,scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{T&&t(he())}),[t,T]);const Pe=b((e=>R(e).skills)),X=a.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),ut=a.useCallback((e=>{t(Ie({macroId:e}))}),[t]),Z=a.useCallback((()=>{t(Ke()),t(Me())}),[t]),dt=a.useCallback((()=>{t(V())}),[t]),{allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,onCardPolicyVendorSearchTextChange:ht}=$t();a.useEffect((()=>{t(gs())}),[t]);const g=b((e=>F(e))),w=Nt.getSignedInUser();a.useEffect((()=>c==="routines"?(t(V()),void t(Is())):c==="skills"?(t(Se()),t(Ve()),void t(Me())):(O==null&&t(Se()),t(Ve()),void t(V()))),[t,O,f,c]);const pt=qt(),_=Yt(pt),k=b((e=>Cs(e))),u=g.uiState.currentChatSessionId,y=k.tenantEmailDomain,L=y!=null&&y!=="",ee=a.useCallback((e=>{L&&l(`/${y}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[L,l,y]),te=a.useCallback((()=>{L&&l(`/${y}/ai-cfo/routines`)}),[L,l,y]),se=a.useCallback(((e,d)=>{const Q=e.sessionId??I.sessionId;Q!=null&&L&&l(`/${y}/ai-cfo/${Q}?routine=${encodeURIComponent(d)}`)}),[L,l,I.sessionId,y]),ft=a.useMemo((()=>C==null?void 0:{error:I.fetchState==="Error",kind:"routineRuns",loading:I.fetchState==="In-Progress"||I.fetchState==="Not-Started",routineName:C.name,schedule:Gt(C),skillName:C.isAdHoc===!0?void 0:X.find((e=>e.macroId===C.macroId))?.name,onOpenSkill:C.isAdHoc===!0?void 0:Z,runs:I.runs,tzName:C.tzName,unreadCount:C.unreadRuns,open:ve,onToggle:()=>ot((e=>!e)),onOpenRun:e=>se(e,C.scheduleId),onOpenRoutine:()=>ee(C),onOpenRoutines:te}),[Z,te,ee,se,ve,C,I.fetchState,I.runs,X]),{handleUploadPromoClose:gt,isUploadPromoVisible:It}=Ht({isFileUploadEnabled:s,tenantEmailDomain:y}),ae=zt({currentTenant:k,currentChatSessionId:u,aiCfoView:g,skillsEnabled:D,onCloseSkills:dt,onOpenSkills:Z}),{isSuggestedQuestionsLoading:Ct,suggestedPromptQuestions:kt}=$s(),N=i.state,q=N?.aiCfoInitialQuestion,ye=!!N?.aiCfoShouldSubmit;a.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;S(!0);const d={...e};delete d[Be],l(i,{replace:!0,state:d})}),[i.pathname,i.search,i.state,l]);const[bt,ne]=a.useState(null),[vt,oe]=a.useState(!1),[Et,ie]=a.useState(void 0),[Pt,re]=a.useState(void 0),we=a.useRef(!1);a.useEffect((()=>{if(!we.current&&q!=null&&q!==""){const e=i.state;ne(q),oe(ye),ie(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const d=e?.aiCfoSuggestionIndex;re(typeof d=="number"?d:void 0),we.current=!0}}),[q,ye,i.state]);const yt=a.useCallback((()=>{ne(null),oe(!1),ie(void 0),re(void 0),l(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,l]),xe=a.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??N?.aiCfoRef,le=xe.get("emailRefId")??N?.aiCfoEmailRefId,Te=a.useRef(!1);a.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||w==null||(t(ks("controller",w.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,t,w]);const G=g.uiState.lastContextMessage;a.useEffect((()=>{G!=null&&G!==""&&u!=null&&(ne(G),oe(!0),ie(void 0),re(void 0),t(bs()))}),[G,u,t]);const wt=k.masterTOSInfo,x=wt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Wt(u),H=g.fetchState,z=g.uiState.chatSessionsNextPageToken.hasMore||!g.uiState.chatSessionsFirstPageFetched,Oe=u!=null?g.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(g.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),_e=g.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:xt}=Je(_e,u),Rt=xt.length===0;a.useEffect((()=>{x||_||l("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,_,l,i.state]);const Tt=a.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),d=k.tenantEmailDomain;l(e.poppedPathname??(d!=null?`/${d}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[k.tenantEmailDomain,i.state,l]),Qe=a.useRef(void 0),Ue=a.useRef(void 0);a.useEffect((()=>{const e=c!==Qe.current,d=u!==Ue.current;Qe.current=c,Ue.current=u,c!==u&&(!e||c==null||qs(c)?d&&u!=null&&l(`../ai-cfo/${u}`,{state:{...i.state}}):t(vs({sessionId:c,agentId:"controller"})))}),[u,c]);const jt=a.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Ye}`)),eventCallback:(e,d,Q)=>Q.onEventReceived(e,d)})),[je]);a.useEffect((()=>{H!=="In-Progress"&&z&&t(Es())}),[H,z,t]),a.useEffect((()=>{u!=null&&Oe!=="In-Progress"&&Ae&&w!=null&&(c===u||H==="Completed"&&!z)&&t(Ps(u,w.userId))}),[Oe,H,Ae,z,u,w,c,t]);const ue=w?.userId,Ot=a.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),De=a.useCallback((e=>{const d=e!=null&&(e===P||e===O);(T||d)&&t(he()),d&&t(W({scheduleId:e}))}),[t,T,O,P]);Gs({events:Ot,onSubscribed:()=>De(P??O),onEvent:(e,d)=>{const Q=(de=>{if(de==null||typeof de!="object")return null;const U=de;return fe(U.schedule_id)&&fe(U.run_id)?{scheduleId:U.schedule_id,runId:U.run_id,status:Hs.find((Qt=>Qt===U.status))??null,finishedAt:fe(U.finished_at)?U.finished_at:null}:null})(d);Q!=null&&De(Q.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(w==null||c==null)throw Error("Can't access AI Controller page without signing in...");const At=u!=null&&g.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&_)return h.jsxs(Ks,{children:[h.jsx(ce,{analytics:M,onLoad:Le}),ae.drawerElement,h.jsx(Ys,{children:h.jsx(ze,{children:h.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:Tt,onCompleteClick:()=>{k.userRoleId!=null&&t(pe(k.userRoleId))}})})})]});const _t=h.jsxs(h.Fragment,{children:[p&&!x?h.jsx(ce,{analytics:M,onLoad:Le}):null,h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})]});return h.jsxs(h.Fragment,{children:[h.jsxs(Js,{children:[h.jsx(ce,{analytics:M,onLoad:e=>e.trackPageLoaded(Xt.Event.aiCFOPage)}),_&&ae.drawerElement,h.jsx(Ws,{...jt,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:_e,allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,openOnboardingPage:()=>S(!0),userId:w.userId,setIsAiCfoOpen:r,navigate:l,sessionFromUrl:c,location:i,isSubmitting:At,isEmptyChatWithSession:Rt,currentTenant:k,emailLinkQuestion:bt??void 0,autoSubmitEmailLinkQuestion:vt,onEmailLinkQuestionProcessed:yt,routedInitialQuestionSource:Et,routedInitialQuestionSuggestionIndex:Pt,onCardPolicyVendorSearchTextChange:ht,onMenuClick:_?ae.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:It,onUploadPromoClose:gt,exploreSuggestedPromptQuestions:kt,exploreSuggestedPromptQuestionsLoading:Ct,isSkillsOpen:A,isRoutinesOpen:T,routineCanCreate:m,routineEditing:E,routineEditorOpen:K,routineListError:n.fetchState==="Error",routineListLoading:n.fetchState==="In-Progress",routineMaxRoutines:n.maxRoutines,routineSaveError:o.fetchState==="Error",routineSaving:o.fetchState==="In-Progress",routineSchedulableSkills:X,routines:n.routines,onRoutineCreate:Xe,onRoutineDelete:rt,routineHistoryError:I.fetchState==="Error",routineHistoryLoading:I.fetchState==="In-Progress",chatSidePanel:ft,routineDetail:ke,routineRunningScheduleId:o.runningScheduleId,routineRuns:I.runs,onRoutineEdit:Ze,onRoutineOpenRun:(e,d)=>se(d,e.scheduleId),onRoutineRun:st,onRoutineCloseDetail:te,onRoutineDraft:it,routineDraftPrompt:Y,onRoutineOpenDetail:ee,onRoutineEditorCancel:et,onRoutineLoadSkillInstructions:ut,onRoutineSave:tt,onRoutineSetEnabled:lt,isCreateSkillEnabled:D,promoDismissalScope:y}),p&&_?h.jsx(Fs,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:Xs,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:h.jsx(ze,{onClick:e=>e.stopPropagation(),children:h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})})}):null]}),p&&!_?h.jsx(Jt,{open:p,onClose:()=>S(!1),children:h.jsx(Kt,{children:_t})}):null]})},ze=$(Ms)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,Js=$.div`
6
- height: 100vh;
7
- width: 100%;
8
- `,Ks=$.div`
9
- height: 100vh;
10
- width: 100%;
11
- display: flex;
12
- flex-direction: column;
13
- min-height: 0;
14
- `,Ys=$.div`
15
- flex: 1;
16
- min-height: 0;
17
- display: flex;
18
- flex-direction: column;
19
- `,Xs=$(Vs)`
20
- box-shadow: ${({theme:s})=>s.colors.elevation2};
21
- color: ${({theme:s})=>s.colors.grey4};
22
- `;export{Ia as default};
@@ -1,71 +0,0 @@
1
- import{j as o}from"./liveblocks-BF-IiX2V.js";import{u as me,j as d,h as de,g as he,i as Ne,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-C1MQ75FC.js";import{fS as Pt,$U as is,g2 as wt,bt as Te,$V as ds,$W as ls,fH as fn,$X as Pn,fQ as wn,$Y as vn,$Z as Tn,$_ as Fn,$$ as xn,fR as Bn,g1 as Ln,a00 as Rn,a01 as us,fX as ms,fW as Cs,a02 as ps,K6 as On,g4 as ia,a03 as hs,a04 as fs,fJ as gs,fI as bs,gh as ze,fZ as Un,fY as jn,a05 as Ss,f_ as ys,JE as Is,JD as ks,JH as Es,JJ as As,ga as Ds,fE as Mn,a06 as _s,a07 as Ps,gf as Nn,a08 as ws,gg as yt,JP as vs,JM as Ts,fF as fe,a09 as qa,dZ as Fe,di as xe,d_ as Be,g_ as da,cB as la,a0a as ua,a0b as vt,CZ as Ga,m7 as Ka,a0c as za,Km as ka,g5 as qe,Ko as Tt,lZ as Vn,a0d as ma,Ka as _a,a0e as Fs,a0f as xs,Kd as Ja,a0g as Bs,Z5 as Qa,g0 as Hn,Kj as ba,iq as Ls,a0h as $n,fT as Ca,br as Rs,a0i as Os,gG as Xa,gF as et,KS as Us,gE as at,a0j as Gn,cu as Kn,da as js,Z4 as wa,Lr as zn,a0k as gn,L1 as Pa,a0l as Yn,Ls as Ms,Zu as Ns,Lt as Vs,My as Hs,Cd as $s,Ms as Gs,a0m as Ks,Kn as oa,a0n as zs,a0o as Ys,a0p as Zs,a0q as Ws,a0r as qs,a0s as Ft,a0t as Js,KD as Zn,Kw as Qs,a0u as Xs,h0 as eo,a0v as Wn,KM as qn,KQ as Jn,g$ as ao,a0w as to,Ld as Qn,a0x as no,a0y as ro,a0z as so,KO as Xn,Kz as er,Kg as ar,KI as tr,KG as nr,KK as oo,a0A as rr,a0B as co,gc as io,gd as lo,ge as uo,a0C as tt,g6 as sr,dc as xt,a0D as mo,a0E as Co,a0F as po,a0G as ho,KY as It,Lk as fo,Lg as go,KU as bo,Li as So,L8 as yo,La as Io,a0H as or,Lq as $a,Sh as ko,a0I as Eo,a0J as Ao,a0K as Do,a0L as cr,a0M as _o,LN as Po,L0 as ir,KX as Me,K$ as wo,a0N as vo,a0O as To,K7 as Fo,a0P as dr,f$ as lr,a0Q as xo,K9 as Bo,K8 as bn,a0R as Lo,a0S as Ro,a0T as Oo,Vp as Uo,a0U as Bt,a0V as jo,xj as ur,mH as Mo,ie as No,LS as Vo,a0W as mr,fN as Ho,fO as $o,a0X as Go,dO as Ko,g3 as zo,LI as Yo,LC as We,bq as Zo,bJ as Wo,cG as qo,bK as Jo,Ug as Qo}from"./zeni-epic-state-Dmop9tB7.js";import{Q as Le,df as Cr,a5 as we,dg as pr,dh as hr,di as Xo,G as ea,at as Lt,dj as ec,dk as ac,a as fr,d as gr,as as br,p as ke,o as le,S as Z,h as ya,dl as Sr,dm as tc,dn as nc,z as te,a8 as va,d4 as nt,dp as rc,dq as sc,dr as oc,a2 as Ta,bj as Qe,bG as Rt,ds as cc,ac as Fa,_ as rt,E as Ot,l as ae,w as st,dt as ic,bS as Sa,du as kt,dv as dc,a9 as Ut,dw as lc,af as yr,aw as Et,dx as uc,ar as Ir,M as kr,V as Er,bo as mc,dy as Cc,dz as pc,dA as hc,dB as fc,dC as gc,dD as bc,J as Ya,dE as Sc,dF as yc,m as ht,O as Ic,dG as kc,dH as Ec,dI as Ac,aj as Dc,dJ as _c,dK as Pc,g as wc}from"./index-DheSTGi7.js";import{n as Ve,D as Ar,S as vc}from"./mui-D4JyxRuO.js";import{a as r}from"./sentry-DQv7eTqs.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-DhY9V91R.js";import{M as Ee}from"./MobileAppDrawer-CdDtqWOO.js";import{d as jt}from"./recharts-BEOxWuh3.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 Tc,i as Mt,P as Fc,j as Nt,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-DAfX5Gik.js";import{u as vr}from"./useInitialThreadRequest-Fj77Qh1B.js";import ot from"./NotFoundScreen-ujna2tN5.js";import{u as Vt}from"./useChargeCardPusherEvents-Cwq1bouz.js";import{n as yn}from"./utils-G6VVxCSd.js";import{t as Lc}from"./AddressScreen-Dsruahz2.js";import"./analytics-Ckbn2qr2.js";import"./plaid-CD2DDkpy.js";import"./dnd-64pfrglk.js";import"./stripe-cKAAJElX.js";import"./lottie-CWNAcXJv.js";import"./lexical-TkcJlpM_.js";import"./pdf-Cj_veg-U.js";import"./InboxNotificationsProvider-zG7x1gLM.js";import"./useTaskManagerAccess-BOnqrzjJ.js";import"./BusinessVerificationPageScreen-DrcWW1y2.js";import"./routePaths-DrHt4RCx.js";import"./analyticsHelper-vNgRVJkc.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]="26fc8026-faa8-4a29-a754-b972e3f6045b",e._sentryDebugIdIdentifier="sentry-dbid-26fc8026-faa8-4a29-a754-b972e3f6045b")}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}},Tr=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}=Ne(),t=me(),s=Le(),g=Te(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))),T=d((O=>vn(O.cardPolicyState))),L=d((O=>Tn(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))),M=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(Tr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:T,suggestedBlockMerchants:L,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,T,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]),H=D.fetchState,v=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??v;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,v]),K=r.useCallback((()=>{e(v)}),[e,v]),W=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),N=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),V=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(H);r.useEffect((()=>{const O=Q.current;Q.current=H,H==="Completed"&&O!=="Completed"&&M!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(v))}),[t,H,M,e,v]);const c=H==="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:H,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:W,onSubmit:I,onUploadDocument:N,onRemoveDocument:V})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Mc}}}=ea.getLocalizedStrings(),Nc=e=>Un(e,!1),Vc=e=>jn(e.name,!1);function Hc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Ne(),s=me(),g=Le(),b=Te(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))),T=d((c=>Pn(c.cardPolicyState))),L=d((c=>wn(c.cardPolicyState))),S=d((c=>vn(c.cardPolicyState))),l=d((c=>Tn(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))),M=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:M!=null?Is(M):void 0),[p.templateId,p.formDraft,M,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||M!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,M]),r.useEffect((()=>{T!=="Completed"&&T!=="In-Progress"&&s(Ln())}),[s,T]),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(Nc)),[L]),i=r.useMemo((()=>k.map(Vc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(Tr)),[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)}),[]),H=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{H.cancel()}),[H]);const v=r.useCallback((c=>{H(c)}),[H]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",W=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]),N=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),V=r.useRef(P);r.useEffect((()=>{const c=V.current;V.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??Mc.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&T==="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:v,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:W,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:N})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:W,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:$c,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}=Ne(),t=me(),s=Le(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((v=>{h(v)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"}),L=d((v=>_s(v))),S=d((v=>Rn(v.createCardPolicyState))),l=d((v=>Ps(v.createCardPolicyState))),C=d((v=>l==null?[]:Nn(v.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),B=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((v=>ws(v.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((v=>{t(yt({chatSessionId:l,id:v.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 v=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:v}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=L.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(vs())}),[t,D]);const M=L.archiveFetchState.fetchState,E=ya(M);r.useEffect((()=>{E==="In-Progress"&&M==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[M,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(v){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:W}=v,I=de(),N=he(),{tenantEmailDomain:V}=Ne(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>Mn(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:He}=Br("card_policy"),Ae=r.useMemo((()=>xr(X,He,3)),[X,He]),[ge,re]=r.useState(""),be=q&&O&&V!=null&&!Q,ue=r.useCallback((J=>{if(V==null)return;const fa=ke(N.state?.pathnameStackToGoBack,N.pathname);I(`/${V}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[N.pathname,N.state,I,V]),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)}),[]),ve=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:$c,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:W,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:ve,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,W,se,De,Ce,ve,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 v=we(a.state?.pathnameStackToGoBack),P=v.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:v.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((v=>{n!=null&&e(`/${n}/cards/policy/${v}/edit`)}),[e,n]),z=r.useCallback((v=>{t(Ts(v))}),[t]),H=L.fetchState.fetchState;return!R&&H!=="Completed"&&H!=="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:T})]}):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:T})]})}function Zc(){const e=de(),{cardId:a}=Ne(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Le(),b=Te(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(Z.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:T}=h(Z.isDebitCardFeatureEnabled),L=Fe(s),S=xe(s),l=Be(T,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Re({isDebitCardFeatureEnabled:T,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))),M=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>vt(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)),H=z?.accountingClassIDs[0],v=d((X=>H!=null?Ka(X.classState,{classId:H,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),W=K?.accountingClassIDs[0],I=d((X=>W!=null?Ka(X.classState,{classId:W,reportId:"class_list"}):void 0)),N=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",V=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&N&&(u(!0),setTimeout((()=>{n(za()),V&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,N,V]),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"&&(N===!1||N&&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,N]),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(Tt()),R!=="Completed"&&R!=="In-Progress"&&n(Vn())}),[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(va,{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:M,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:v?.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",Ht="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",$t="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Wc="charge-card-department-updated",Mr="charge-card-repayment-completed",Nr="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((T=>fe(T))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(Z.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((T=>ma(T))),m=vr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const T=we(n.state?.pathnameStackToGoBack),L=T.poppedPathname??Xc(s.tenantEmailDomain);e(L,{state:{pathnameStackToGoBack:T.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,qc),onEvent:T=>{switch(T){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=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,T]=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:M}=D(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(Z.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:M,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 H=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(B.fetchState==="Completed"){if(F===!1&&(H===!1||H&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==L.userId)){const I=_e(S.tenantEmailDomain,s,L,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:N}})}else if(F&&B.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Bs({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,L,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:N}})}}}),[B.fetchState,k?.type.code,F,B.isRefreshingViewInBackground]);const v=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Hn(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 W=I=>{T(I)};if(_!=="Completed"||k==null)return o.jsx(va,{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:W}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:L,isSandboxEnv:Rt(),chargeCardDetailState:B,signedInUserToken:v,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:()=>{W(!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=$n(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=Ve.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=Ve.div`
7
- display: flex;
8
- min-height: 100%;
9
- width: 100%;
10
- flex: 1 1 auto;
11
- flex-direction: column;
12
- align-items: center;
13
- background-color: ${e=>e.theme.colors.grey4};
14
- `,Za=ea.getLocalizedStrings().dateFormat,si={overlayWidth:new Fa(100,100,58)},Vr=[Mr,ct],oi=new Set(Vr),ci=Pe((function(e,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ns(e,n,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Vs(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:T,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:T?.add(3,"day").format(Za.visual.MMMDCommaYYYYformat),paymentInitiatedDate:T?.format(Za.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($s("external_account",C))},onEstablishConnectionClick:C=>{e(Hs(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 T=de(),{useDynamicConfig:L}=le(),S=d((V=>Gn(V))),{creditAccount:l}=d((V=>ua(V))),C=d((V=>fe(V))),B=Ot(),k=Ta(),_=me(),D=te.getSignedInUser(),M=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??Tc,G=Kn(M?.loggedInUserRoleMap),U=js(M?.loggedInUserRoleMap),x=d((V=>wa(V,C.companyId))),z=x.companyChargeCardInfo?.primaryFundingAccount,H=x.allFundingAccounts.find((V=>V.id===z?.accountId)),v=d((V=>da(V,C.companyId))),P=la(v.controllers);r.useEffect((()=>{if(S.fetchState!=="Completed"&&S.fetchState!=="In-Progress"&&_(zn()),S.fetchState==="Completed"&&!R){const V=C.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,Q=S.transferFromAccounts.find((O=>O.id===V));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:H?.accType==="depositAccount",creditCardPaymentSourceAccountName:H?.label,creditCardPaymentSourceAccountType:H?.accType,creditCardPaymentSourceLastFourDigits:H?.accountLast4,creditCardPaymentSourceBalance:H?.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(Za.visual.MMMDCommaYYYYformat),paymentInitiatedDate:w?.format(Za.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 W=()=>{a(!0),_(Yn())},I=aa(C),N={events:e?ha(I,Vr):[],eventCallback:(V,Q,c)=>{c.onEventReceived(V)},onSubscribed:V=>{V.onPusherSubscribed()}};return o.jsx(o.Fragment,{children:o.jsx(Ar,{onClose:()=>{W()},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:V=>V.stopPropagation(),children:o.jsx(ci,{...N,closeDrawerHandler:a,navigate:T,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),_(Ms({companyId:C.companyId}))},onDismissClick:W,onSaveChangesToLocalStore:V=>{_(gn(V))},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=Ve(vc)`
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,Wa=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"&&!!Wa(a.transaction_status)&&!!Wa(a.transaction_type)},Zt=(e,a)=>{const n=e?.card_status;if(!Wa(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,Ht,ct,$t,Gt,Kt],Hr=[Ra,La],di=new Set([...At,...Hr]),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=vt(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:Wn(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:T,isChargeCardFeatureEnabled:L}=a,{tenantEmailDomain:S}=t;return{onEventReceived:(l,C)=>{(({event:B,data:k,cardId:_,dispatch:D,subscribedEvents:M})=>{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&&Wa(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=Zt(E,y);return R!=null?void D(Ft(R)):void D(ba(_,!0))}case Ht:{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(Ws({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(Zs({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 $t: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,T),A(l)}}}))(st(lc));function ui(){const e=de(),a=me(),n=he(),{cardId:t}=Ne(),[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:T}=A(Qe.zeniCardsConfig),L=T.enable_card_controls_for_company_ids,S=T.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}=_(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:M}=_(Z.isDebitCardFeatureEnabled),E=Be(M,m),y=Re({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:E}),{isFeatureEnabled:R}=_(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=_(Z.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,H=!m.userRole.includes("charge_card_user")&&U&&z;if(t==null)throw Error("Empty card id is not valid...");const v=d((Y=>wa(Y,m.companyId))),{creditAccount:P,creditAccountRepayment:K}=d((Y=>ua(Y))),W=te.getZeniOtpTokenForCardHolder(t),I=d((Y=>vt(Y,t,H,U))),{isAiCfoAccessEnabled:N,onAskAiCfoClick:V}=xa({mobileExploreReferrer:"Card Detail"});Lt({isDataReady:I.fetchState==="Completed"});const Q=d((Y=>ma(Y))),c=I.chargeCard,O=Le(),q=Te(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",He=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=Mt(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)),ve=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&&He&&(g(!0),setTimeout((()=>{a(za()),Ae&&a(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[F,s,He,Ae]),r.useEffect((()=>{l||I.fetchState==="Completed"||I.fetchState==="In-Progress"||t==null||(C(!0),a(ka(t,H,U,!1)))}),[l,I,t,a]),r.useEffect((()=>{!B&&I.fetchState==="Completed"&&I.chargeCard?.connectedAccountId!=null&&se&&oe&&q&&(k(!0),a(Zn({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(Vn()),I.transactionStatistics.fetchState!=="Completed"&&I.transactionStatistics.fetchState!=="In-Progress"&&a(Qs({chargeCardId:t})),v.fetchState!=="Completed"&&v.fetchState!=="In-Progress"&&a(Pa(m.companyId,!0))}),[Q.fetchState,a,q,w,I.transactionStatistics.fetchState,v.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:ve?.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,...Hr]: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:$e,frequency:Ye,cardColor:Ge}=St(c),Ke=c.cardHolderUserId===u.userId;ae.trackCardsDetailPageViewed(t,Y,ye,ce,$e,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:$e,utilisation:Ye,limit:Ge,frequency:Ke}=St(c),sa=c.cardHolderUserId===u.userId;ae.trackCardsDetailPageClicked(t,ce,$e,Ye,Ge,Ke,Y,sa,ye)}},ut=(Y,ye)=>{if(t!=null&&c!=null){const{ownerName:ce,cardName:$e,utilisation:Ye,limit:Ge,frequency:Ke}=St(c),sa=c.cardHolderUserId===u.userId;ae.trackCardsVerifyPopUpClick(t,ce,$e,Ye,Ge,Ke,Y,sa,ye)}},pe=P.balance.amount+P.hold.amount,Ua=m.companyChargeCardInfo?.info?.primaryFundingAccount,Da=v.allFundingAccounts.find((Y=>Y.id===Ua?.accountId)),ja=I.chargeCard!=null,Ma=I.depositAccountLimit!=null;return I.fetchState!=="Error"||ja?!ja&&(I.fetchState==="In-Progress"||I.fetchState==="Not-Started")||na.saveStatus.fetchState==="In-Progress"||!Ma&&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:ve?.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:H,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:p.documentAiReceiptMaxSizeLimitBytes!=null?p.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:N,onAskAiCfoClick:V,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(),$r=[pa,ct,Nr,La,Ra,it,Kt,Wc,$t,Gt,Ht],hi=new Set($r),Dt=jt(((e,a,n,t)=>{e(ia(a,n,t,!0))}),400),fi=Ve.div`
19
- display: flex;
20
- width: 100%;
21
- flex: 1 1 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,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:Wn(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:T,controllerEmails:L,depositAccountListWithDebitCardIssued:S,primaryFundingAccountDetails:l,chargeCardSetUpViewFetchState:C,productInformation:B,cashbackInformation:k,creditAccountInformation:_,debitAccountInformation:D,updatePayNowInfoTooltip:M,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,H=`${x.cardHolderUser?.firstName.toLowerCase()} ${x.cardHolderUser?.lastName.toLowerCase()}`,v=x.cardName,P=x.department?.className??"",K=x.limit.amount,W=x.creditLimitFrequency.name;ae.trackCardsListRowClicked(H,v,P,z,K,W,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(Zn({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&&!T?`../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:M,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((($,Ue)=>{n(rr([])),a($,Ue)}),[n,a]),[g,b]=r.useState(!1),[h,A]=r.useState(te.getPayNowInfoTooltip()??!1),u=$=>{te.savePayNowInfoTooltip($),A($)},[m,F]=r.useState(!1),w=te.getSignedInUser(),p=d(($=>fe($))),[T,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:M,useDynamicConfig:E}=le(),{isFeatureEnabled:y}=M(Z.isCashbackFeatureEnabled),{isFeatureEnabled:R}=M(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=M(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=M(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:j}=M(Z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:G}=M(Z.isCardsCommentingEnabled),{isFeatureEnabled:U}=M(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:x}=M(Z.isCardPolicyEnabled),{isFeatureEnabled:z}=M(Z.isAiCardCreationEnabled),H=Be(i,p),v=Re({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:H}),P=Fe(p),K=xe(p),W=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Oe({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:K,isDebitCardProductVisible:v,chargeCardsCreditAccountLimit:W}),N=_r({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:K}),{configValue:V}=E(Qe.zeniCardsConfig),Q=Le(),c=Te(Q?.loggedInUserRoleMap),O=d(($=>da($,p.companyId))),q=la(O.controllers),se=V.charge_card_cashback_rate_per_transaction!=null?V.charge_card_cashback_rate_per_transaction:.0175,X=V.credit_card_pay_now_threshold_by_company_id?.[p.companyId]??V.default_credit_card_pay_now_threshold??Fc,He=V.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(V.enable_card_controls_for_company_ids)&&V.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(($=>Gn($))),Se=ya(oe.updateStatus),ee=d(($=>Ca($,_,v&&D,I&&re))),De=d(($=>co($))),ve=d(($=>io($))),Ce=d(($=>lo($))),J=d(($=>uo($))),fa=d(($=>Ce==null?[]:Nn($.aiCfoState,Ce).filter((Ue=>Ue.kind==="creating_cards"))),_t),na=ya(ve.fetchState);r.useEffect((()=>{na==="In-Progress"&&ve.fetchState==="Completed"&&Ce!=null&&fa.forEach(($=>{n(yt({chatSessionId:Ce,id:$.id,entityIds:J,kind:"created_cards"}))}))}),[n,ve.fetchState,Ce,J,fa,na]);const Oa=ee.cards.filter(($=>$.type.code.includes("debit"))).map(($=>$.connectedAccountId)),dt=[...new Set(Oa)],Ea=d(($=>ma($))),ra=d(($=>tt($,dt))),Aa=d(($=>wa($,p.companyId))),lt=Aa.companyChargeCardInfo?.primaryFundingAccount,ut=Aa.allFundingAccounts.find(($=>$.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,Ma]=r.useState(Da);r.useEffect((()=>{Ma(Da())}),[Da]);const Y=()=>{te.saveCardPolicyPopupSeen(p.tenantEmailDomain??"",!0),Ma(!1)},ye=pe==="Completed"&&!ee.hasCreditCard&&!ee.hasDebitCard;uc({isDataReady:pe==="Completed",pageContext:ye?"cards_creation":"cards"});const{creditAccountRepayment:ce}=d(($=>ua($))),$e=d(($=>qa($).firstViewAfterActivation)),{areTenantIdsInSync:Ye}=Ir(),Ge=Mt(c,Ea),Ke=Ba(I,re,c,Ua,ce),sa=Nt(v,D,c,ra,ee.debitCardSummary),mt=Xe(I,v,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 $=ta(p.tenantEmailDomain);s($)}}),[e,ce.initiatedRepayments.amount,ce.fetchState,Se,oe.updateStatus,s,p.tenantEmailDomain]),r.useEffect((()=>{!T&&(re||D)&&(be||ue)&&Ye&&(L(!0),n(ia(_,v&&D,I&&re,!1)))}),[T,_,n,Ye,be,ue]),r.useEffect((()=>{$e&&m===!1&&(F(!0),setTimeout((()=>{n(za())}),5e3))}),[$e,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 $=ee.cards.length,Ue=ee.cards.filter((Ze=>Ze.cardHolderUserId===w?.userId)).filter((Ze=>Ze.status.code==="request_on_hold"));Ue.length>0&&$===Ue.length&&s("./onboard")}}),[pe,ee.cards,k,s,w?.userId]),r.useEffect((()=>{pe!=="Completed"||I&&ce.fetchState!=="Completed"||v&&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(($=>sr($.userState,$.userRoleState,$.userListViewState,"cardAdmin"))),Wt=xt(Q?.loggedInUserRoleMap),qt=$=>{l($)},Zr=ee.creditAccount.limit,Wr=()=>{b(!1),s("..")},qr=p.companyChargeCardInfo?.info!=null&&Ia({cardInfo:p.companyChargeCardInfo.info,isProductVisible:I&&be,isTOSAccepted:Ae,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:Wt}),Jr=p.companyDebitCardInfo?.info!=null&&Ia({cardInfo:p.companyDebitCardInfo.info,isProductVisible:v&&ue,isTOSAccepted:ge,isSetupEnabled:D,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:Wt}),Qr=qr||Jr,Jt=(function($){const{isEmptyCardsState:Ue,isChargeCardAdmin:Ze,isFileUploadEnabled:an}=$,tn=de(),Na=he(),{tenantEmailDomain:Va}=Ne(),{isAiCfoOpen:ns,setIsAiCfoOpen:nn}=fr(),rs=gr(),ss=br(),rn=d((Ie=>Mn(Ie))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:sn,isResolved:on}=Br("cards_creation"),cn=r.useMemo((()=>xr(sn,on,3)),[sn,on]),[Ha,pt]=r.useState(""),dn=ss&&rs&&Va!=null&&!ns,ga=r.useCallback((Ie=>{if(Va==null)return;const os=ke(Na.state?.pathnameStackToGoBack,Na.pathname);tn(`/${Va}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:os,referrer:"cards_hero",aiCfoInitialQuestion:Ie,aiCfoShouldSubmit:Ie!=null&&Ie.trim().length>0}})}),[Na.pathname,Na.state,tn,Va]),ln=r.useCallback((Ie=>{Ie.trim().length!==0&&(pt(""),ga(Ie))}),[ga]),un=r.useCallback((()=>{const Ie=Ha.trim();Ie.length!==0&&(pt(""),ga(Ie))}),[Ha,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&&Ze)return{aiAgentName:pi,headline:mi,subheadline:Ci,promptChips:cn,composer:{currentInput:Ha,isSubmitting:rn,isFileUploadEnabled:an,onInputChange:Cn,onSubmit:un,onStopSubmit:mn},onPromptClick:ln,onOpenSidePanel:pn,onOpenFullView:hn,dataTestIdPrefix:"cards-ai-cfo-hero"}}),[Ha,dn,Ze,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,$r),eventCallback:($,Ue,Ze)=>{Ze.onEventReceived($)},onSubscribed:$=>{$.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||v&&!D)&&ae.trackCardsPromoView(q,{isCreditCardOffered:I,isDebitCardOffered:v,isDebitCardEnabled:D,isCreditCardEnabled:re},"Banner",v&&!D?"Debit Card":I&&!re?"Credit Card":"","Card List")}}),o.jsx(nt,{showConfetti:$e})]}):null,g===!0?o.jsx(zt,{closeDrawerHandler:Wr,isPaymentDrawerOpen:g,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ct,productInformation:mt,creditAccountInformation:Ke,debitAccountInformation:sa,cashbackInformation:Ge,isDebitCardInfoFetchStateCompleted:!(v&&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:v,isCreditCardProductVisibleForExpressInterest:N,updatePayNowInfoTooltip:u,showPayNowInfoTooltip:h,creditCardPayNowThreshold:X,signedInUser:w,chargeCardListState:ee,location:t,admins:Yr.users,navigateAndClearBulkSelection:s,currentTenant:p,isCardControlsEnabled:He,companyChargeCardInfoCreditAccountLimit:p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:p.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:c,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{qt(!0)},creditLimit:Zr,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(va,{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=[Mr,Nr],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($a(!0))},onEventReceived:s=>{ki.has(s)&&e($a(!0))},onPusherSubscribed:()=>{e($a(!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,T]=r.useState(null),L=!g.userRole.includes("charge_card_user"),S=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:l}=s(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=s(Z.isDebitCardFeatureEnabled),B=Be(C,g),k=Re({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:B}),_=Fe(g),D=xe(g),M=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=Oe({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:l,isBookKeepingTenant:D,isDebitCardProductVisible:k,chargeCardsCreditAccountLimit:M}),y=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,R=Le(),i=Te(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((()=>Mt(i,G)),[i,G]),H=r.useMemo((()=>Ba(E,y,i,f.creditAccount,x)),[E,y,i,f.creditAccount,x]),v=r.useMemo((()=>Nt(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,W=r.useMemo((()=>p!=null?b.repaymentHistory.find((c=>c.cardRepaymentId===p)):void 0),[p,b.repaymentHistory]),I=r.useCallback((c=>{T(c),n(ia(L,k&&S,E&&y,!1)),w(!0)}),[n,L,k,S,E,y]),N=r.useCallback((()=>{w(!1),T(null),document.body.style.overflow="auto"}),[]);r.useEffect((()=>{h||b.fetchState==="Completed"||b.fetchState==="In-Progress"||(A(!0),n($a()))}),[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 V=aa(g),Q={events:ha(V,Gr),eventCallback:(c,O,q)=>{q.onEventReceived(c)},onSubscribed:c=>{c.onPusherSubscribed()}};return o.jsxs(o.Fragment,{children:[F?o.jsx(zt,{closeDrawerHandler:N,isPaymentDrawerOpen:F,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:K,productInformation:P,creditAccountInformation:H,debitAccountInformation:v,cashbackInformation:z,isDebitCardInfoFetchStateCompleted:!(k&&S&&i)||U.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||x.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||G.fetchState==="Completed",paymentInitiatedDate:x.initiatedRepaymentDate,retryRepayment:W}):null,o.jsx(Ei,{...Q,location:a,navigate:e,accountInfoByAccountId:b.accountInfoByAccountId,onRetryPaymentClick:I})]})}const En=Ve.div`
26
- display: flex;
27
- height: 100vh;
28
- width: 100%;
29
- flex: 1 1 auto;
30
- flex-direction: column;
31
- overflow: auto;
32
- align-items: center;
33
- background-color: ${e=>e.theme.colors.grey4};
34
- `,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(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=F(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:L}=F(Z.isCardsCommentingEnabled),S=vr(L?w.companyId:void 0,{clearParams:L&&m.fetchState==="Completed"}),l=Be(T,w),C=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:l}),B=Fe(w),k=xe(w),_=w.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=Oe({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:p,isBookKeepingTenant:k,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:_}),M=!!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&&M&&a(ir()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a(Me()),U.fetchState!=="Completed"&&U.fetchState!=="In-Progress"&&C&&M&&a(wo()),s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&D&&E&&a(Tt())}),[G.fetchState,C,M,i.fetchState,U.fetchState,s.fetchState,D,E]),r.useEffect((()=>{if(m.fetchState==="Completed"&&t.fetchState==="Completed"&&s.fetchState==="Completed"&&i.fetchState==="Completed"&&(!C||!M||G.fetchState==="Completed"&&U.fetchState==="Completed")){let P="",K="";if(m.statements.length>0){const V=m.statements[m.statements.length-1].period,[Q,c]=V.split("-"),O=m.statements[0].period,[q,se]=O.split("-");P=`${An[parseInt(c)-1]} ${Q}`,K=`${An[parseInt(se)-1]} ${q}`}const W=Xe(D,C,M,E),I=Ba(D,E,!0,t,s),N=Nt(C,M,!0,G,U);ae.trackCardsCreditCardStatementsView(R,W,{numberOfStatements:m.statements.length,oldestStatementMonthYear:P,latestStatementMonthYear:K},I,N)}}),[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))),H=te.getSignedInUser(),v={userId:H?.userId??"",sessionId:H?.zeniSessionId??"",tenantId:w.tenantId??""};if(H==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,M,E);return o.jsx(En,{children:o.jsx(fc,{currentTenantCompanyName:w.companyName,statementListView:m,productInformation:P,onBackClick:x,authParams:v,controllerEmails:R,isChargeCardFeatureEnabled:D,isDebitCardFeatureEnabled:C,isDebitCardSetupEnabled:M,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=Ta(),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),T=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((N=>fe(N))),{configValue:D}=g(Qe.zeniCardsConfig),M=d((N=>vo(N))),{tenantEmailDomain:E}=_,y=d((N=>N.settingsViewState.profile.fetchState)),R=d((N=>N.chargeCardListState.fetchState)),i=d((N=>N.settingsViewState.profile.userId)),f=d((N=>N.chargeCardConfigState.fetchState));r.useEffect((()=>{b===!1&&y!=="In-Progress"&&y!=="Completed"&&(n(To()),h(!0)),A===!1&&f!=="In-Progress"&&f!=="Completed"&&(n(Ja()),u(!0)),m===!1&&R==="Not-Started"&&(F(!0),n(Me()))}),[b,m,R,A,f]),r.useEffect((()=>{y==="Completed"&&S===!1&&i!=null&&R==="Completed"&&M.cards.length>0&&(n(Fo({userId:i})),n(dr({cardId:M.cards[M.cards.length-1].id})),l(!0))}),[y,S,i,R]),r.useEffect((()=>{if(!w&&M.fetchState==="Completed"&&M.cards.length===0){const N=we(s.state?.pathnameStackToGoBack),V=N.poppedPathname??ta(E);t(V,{state:{pathnameStackToGoBack:N.newStack}})}}),[M.fetchState,M.cards,w]);const j=d((N=>qa(N))),G=ya(j.updateStatus.fetchState),U=j.currentDisplayedCardId,{useFeatureGate:x}=le(),{isFeatureEnabled:z}=x(Z.isChargeCardFeatureEnabled),H=!!_.companyChargeCardInfo?.info?.isChargeCardEnabled,v=!_.userRole.includes("charge_card_user")&&z&&H,P=d((N=>U!=null?lr(N.chargeCardState,U):null)),K=()=>{U!=null&&(T.current=!0,L.current!=null&&clearTimeout(L.current),L.current=setTimeout((()=>{T.current=!1,L.current=null}),5e3),n(ka(U,v,!0)),n(Me(!0)),p(!0))},W=aa(_);Vt({events:ha(W,Kr),onSubscribed:()=>{n(Me(!0))},onEvent:(N,V)=>{if(!_i.has(N))return;const Q=Yt(V),c=T.current;if(N===pa){const q=ie(Q?.card_id)??U;if(q!=null){const se=Zt(Q,q);if(se!=null)return n(Ft(se)),void(q!==U||c||K())}}if(N===it)return void n(Me(!0));const O=ie(Q?.card_id)??U;(U==null||O===U)&&U!=null?c||K():n(Me(!0))}}),r.useEffect((()=>{if(w&&U!=null&&P!=null&&P.status.code!=="request_on_hold"){const N=_e(_.tenantEmailDomain,U,k,P),V=ke(s.state?.pathnameStackToGoBack,s.pathname);n(xo()),P?.type.code==="business_virtual_credit_card"&&n(Qa()),t(N,{state:{pathnameStackToGoBack:V},replace:!0}),T.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=N=>{B(N)};if(y!=="Completed"||M.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(vi,{chargeCardListView:M,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(Ti,{windowSize:a,children:e}):null]})},vi=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),Ti=Ve.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=Ve.div`
40
- display: flex;
41
- min-height: 100%;
42
- width: 100%;
43
- flex: 1 1 auto;
44
- flex-direction: column;
45
- align-items: center;
46
- background-color: ${e=>e.theme.colors.grey4};
47
- `,Fi={containerWidth:new Fa(100,58)},xi=({appContent:e})=>{const a=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b,useFeatureGate:h}=le(),[A,u]=r.useState(!1),[m,F]=r.useState(!1),[w,p]=r.useState(!1),[T,L]=r.useState(!1),S=te.getSignedInUser();if(S==null)throw Error("Can't access onboarding card page without signing in...");const l=d((v=>fe(v)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:C}=b(Qe.zeniCardsConfig),B=d((v=>Lo(v,s))),{isFeatureEnabled:k}=h(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=h(Z.isDebitCardFeatureEnabled),D=Be(_,l),M=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:M,chargeCardsCreditAccountLimit:R}),f=B.chargeCard,j=d((v=>v.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 v=_e(l.tenantEmailDomain,s,S,f,!0),P=ke(g.state?.pathnameStackToGoBack,g.pathname);t(v,{state:{pathnameStackToGoBack:P}})}else if(w&&B.isRefreshingViewInBackground===!1&&f?.isPinSet===!0){n(Ro({chargeCardId:s}));const v=_e(l.tenantEmailDomain,s,S,f,!0),P=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(v,{state:{pathnameStackToGoBack:P}})}}}),[B.fetchState,f?.type.code,w,B.isRefreshingViewInBackground]);const U=te.getZeniOtpTokenForCardHolder(s),x=d((v=>Hn(v.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 H=v=>{L(v)};if(j!=="Completed"||f==null)return o.jsx(va,{fetchState:"In-Progress"});if(x?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(Ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:T,handleDrawerToggle:H}),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:()=>{H(!0)}}),e!=null?o.jsx(Li,{windowSize:a,children:e}):null]})},Bi=Pe((function(e,{debitCardDetailState:a,cardId:n}){const t=$n(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=Ve.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=Ve.div`
54
- display: flex;
55
- min-height: 100%;
56
- width: 100%;
57
- flex: 1 1 auto;
58
- flex-direction: column;
59
- align-items: center;
60
- background-color: ${e=>e.theme.colors.grey4};
61
- box-shadow: ${e=>`${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(Mo({addressType:`${s==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`,addressToCreate:b})),e(No(`${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=Ta(),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})})},Mi=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($o())},onSaveChangesToLocalStore:n=>{e(Ho(n))},onDismissClick:()=>{e(mr()),a.navigate("../")},resetCustomAddressByLineID:(n,t)=>{e(ur(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${n}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}}))(Ec);function Ni(){const e=te.getSignedInUser(),a=de(),n=me(),t=Ic(),[s]=_n(),g=s.get("cardType"),{useFeatureGate:b}=le(),{isFeatureEnabled:h}=b(Z.isIssuePhysicalCardEnabled),{isFeatureEnabled:A}=b(Z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:u}=b(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=b(Z.isChargeCardFeatureEnabled),F=d((z=>fe(z))),w=Be(u,F),p=Re({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:w}),T=Fe(F),L=xe(F),S=F.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,l=Oe({isCardsOnlyTenant:T,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(Vo(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&&_))),M=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,H)=>{f(z),G(H)};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]),M==="Completed"?o.jsxs(o.Fragment,{children:[i!==null&&j!==null?o.jsx(ji,{closeDrawerHandler:U,lineId:i,chargeCardTypeOption:j}):null,o.jsx(Mi,{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})]}):M==="Error"?o.jsx(ot,{}):o.jsx(kc,{})}const zr=[pa,it],Vi=new Set(zr),Hi=Ve.div`
63
- display: flex;
64
- height: 100vh;
65
- width: 100%;
66
- flex: 1 1 auto;
67
- flex-direction: column;
68
- overflow: auto;
69
- align-items: center;
70
- background-color: ${e=>e.theme.colors.grey4};
71
- `,$i=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(Me())},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(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:w}=m(Z.isDebitCardFeatureEnabled),p=Be(w,h),T=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:T,chargeCardsCreditAccountLimit:k}),D=Te(l?.loggedInUserRoleMap),M=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(Me()),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(Tt()),f.fetchState!=="Completed"&&f.fetchState!=="In-Progress"&&T&&L&&D&&a(ir())}),[E.fetchState,y.fetchState,a,f.fetchState,T,L,D,_,S]);const G=aa(h);if(Vt({events:ha(G,zr),onEvent:(x,z)=>{if(!Vi.has(x))return;const H=Yt(z);if(x===pa){const v=ie(H?.card_id);if(v!=null){const P=Zt(H,v);if(P!=null)return void a(Ft(P))}}a(Me(!0))},onSubscribed:()=>{a(Me(!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(_,T,L,S);return o.jsx(Hi,{children:o.jsx($i,{navigate:e,currentTenant:h,signedInUser:j,productInformation:x,myPendingActivationChargeCardListState:b,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:T,isDebitCardSetupEnabled:L,isChargeCardSetupEnabled:S,chargeCardCashbackDetailState:M,creditAccount:E,creditAccountRepayment:y,depositAccountListWithDebitCardIssued:f,controllerEmails:u,location:n})})}return o.jsx(va,{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(We(t,!0,"charge_cards",m,!1));break;case"debit":e(We(t,!0,"debit_cards",m,!1));break;case"debit_and_credit":e(w===0?We(t,!0,"debit_cards",m,!0):We(t,!0,"charge_cards__debit_cards",m,!1))}else switch(ae.trackCardsSetupCardsClick(F,u,"Cards Promo"),p){case"credit":e(We(t,!1,"charge_cards",m,!1));break;case"debit":e(We(t,!1,"debit_cards",m,!1));break;case"debit_and_credit":e(w===0?We(t,!1,"debit_cards",m,!0):We(t,!1,"charge_cards__debit_cards",m,!1))}},onBackClick:()=>{const p=we(A.state?.pathnameStackToGoBack);let T=p.poppedPathname;T==null&&(T=g||b?"..":"../.."),n(T,{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}=Ne(),[t]=_n(),s=t.get("cardPromoType"),g=me(),{useDynamicConfig:b,useFeatureGate:h}=le(),[A,u]=r.useState(!1),{isFeatureEnabled:m}=h(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=h(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:w}=h(Z.isChargeCardFeatureEnabled),{configValue:p}=b(Qe.zeniCardsConfig),T=d((J=>fe(J))),L=d((J=>da(J,T.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??T.companyId,k=d((J=>wa(J,B))),_=k.primaryFundingAccount,D=T.companyBillPayInfo?.info,M=Fe(T),E=xe(T),y=Be(m,T),R=T.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=Re({isDebitCardFeatureEnabled:m,isBankingOnlyTenant:y}),f=Oe({isCardsOnlyTenant:M,isChargeCardFeatureEnabled:w,isBookKeepingTenant:E,isDebitCardProductVisible:i,chargeCardsCreditAccountLimit:R}),j=_r({isCardsOnlyTenant:M,isChargeCardFeatureEnabled:w,isBookKeepingTenant:E}),G=i&&f===!1,U=D?.businessVerificationStatus?.code==="verified"&&(G||_?.accType==="depositAccount"||Ko(_?.providerVerificationStatus?.code??"")),x=te.getSignedInUser(),z=!!T.companyZeniAccountInfo?.info?.isZeniAccountEnabled,H=!!T.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,v=!!T.company?.companyChargeCardInfo?.isChargeCardEnabled,P=!!T.company?.companyDebitCardInfo?.isDebitCardEnabled,K=!!T.companyChargeCardInfo?.info?.isChargeCardEnabled,W=!!T.companyDebitCardInfo?.info?.isDebitCardEnabled,I=!!T.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,N=J=>{u(J)},V=d((J=>J.chargeCardSetupViewState.fetchState));if(x==null)throw Error("Can't access Charge Card promo page without signing in...");const Q=Le(),c=Te(Q?.loggedInUserRoleMap),O=xt(Q?.loggedInUserRoleMap),[q,se]=r.useState(!1),[X,He]=r.useState(!1),[Ae,ge]=r.useState(!1);r.useEffect((()=>{q===!1&&C.state?.message==="activation"&&se(!0)}),[C.state]),r.useEffect((()=>{X||V!=="Not-Started"||B==null||(He(!0),g(Pa(B,!0)))}),[X,V,B,g]);const re=T.companyChargeCardInfo?.info!=null&&Ia({cardInfo:T.companyChargeCardInfo.info,isProductVisible:j&&v,isTOSAccepted:H,isSetupEnabled:K,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:O}),be=T.companyDebitCardInfo?.info!=null&&Ia({cardInfo:T.companyDebitCardInfo.info,isProductVisible:i&&P,isTOSAccepted:I,isSetupEnabled:W,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&&W)||oe==="debit"&&W||oe==="debit_and_credit"&&W&&K?a("../"):(oe==="debit_and_credit"&&H===!0&&I===!0||oe==="credit"&&(H===!0||j===!1&&I===!0)||oe==="debit"&&I===!0)&&c===!0&&a("../setup")}),[U,K,W,oe,H,I]),r.useEffect((()=>{Ae||(g(zo("cardAdmin")),ge(!0))}),[Ae]);const ve=d((J=>sr(J.userState,J.userRoleState,J.userListViewState,"cardAdmin"))),Ce=Xe(j,i,W,K);return(J=>{switch(J){case"credit":return v;case"debit":return P;case"debit_and_credit":return v&&P;default:return!1}})(De)?(re||be)&&V==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ut,{analytics:ae,onLoad:()=>{if(ae.trackPageLoaded(Er.Event.cardsPromoPage),!!j&&!K||!!i&&!W||!!j&&!!i&&!W&&!K){const J=Yi({isDebitCardSetupEnabled:W,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:N}),o.jsx(Ki,{signedInUser:x,location:C,meetingUrl:e("charge_card_promo"),showEnableCardButton:U,isCompanyBusinessVerificationAndPaymentSetUpDone:U,isChargeCardSetupEnabled:K,isDebitCardSetupEnabled:W,companyLegalName:T.companyName,adminList:ve.users,isCheckingEnabled:z,navigate:a,companyId:B,cardPromoType:De,controllerEmails:S,productInformation:Ce,isCreditCardProductVisible:f,isDebitCardFeatureEnabled:m,isEarlyPayEnabled:F,cashbackRate:l,chargeCardsCreditAccountLimit:R,onClickMenuIcon:()=>{N(!0)}})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:A,handleDrawerToggle:N}),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(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:g}=n(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:b}=n(Z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:h}=n(Z.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,T=!!a.company?.companyDebitCardInfo?.isDebitCardEnabled,L=!!a.companyChargeCardInfo?.info?.isChargeCardEnabled,S=!!a.companyDebitCardInfo?.info?.isDebitCardEnabled,l=Le(),C=Te(l?.loggedInUserRoleMap),{isCardsShuttingDown:B}=kr(a.tenantId,a.company?.managementInfo?.receiverEmails),k=xt(l?.loggedInUserRoleMap),{isFeatureEnabled:_}=n(Z.isCashbackFeatureEnabled),D=a.userRole.includes("charge_card_user"),M=!D,E=!D&&L,y=a?.userRole!=null&&Zo(a?.userRole),R=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!y)&&Wo(l?.loggedInUserRoleMap),i=qo(l?.loggedInUserRoleMap),f=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!y)&&Jo(l?.loggedInUserRoleMap),{isFeatureEnabled:j}=n(Z.isDepositAccountsFeatureEnabled),G=j&&!y&&Kn(l?.loggedInUserRoleMap),U=L&&p&&!y,x=S&&T&&!y,z=m&&!y&&Te(l?.loggedInUserRoleMap),H=Qo(l?.loggedInUserRoleMap),v=Fe(a),P=xe(a),K=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,W=Oe({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:t,isBookKeepingTenant:P,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:K}),I=a.companyChargeCardInfo?.info!=null&&Ia({cardInfo:a.companyChargeCardInfo.info,isProductVisible:W&&p,isTOSAccepted:F,isSetupEnabled:L,isUserHasCardsAdminLevelAccess:C,isUserHasCardsAccess:k}),N=a.companyDebitCardInfo?.info!=null&&Ia({cardInfo:a.companyDebitCardInfo.info,isProductVisible:u&&T,isTOSAccepted:w,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:C,isUserHasCardsAccess:k}),V=I||N;return o.jsxs(cs,{children:[C?o.jsx(ne,{path:"setup",element:o.jsx(Sn,{isBillPayAdminLevelAccess:R,isReimbursementAdminLevelAccess:f,isZeniAccountAdminLevelAccess:G,isChargeCardAdminLevelAccess:z,isUserHasOnlyCardAccess:H,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:H,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(Hc,{})})]}):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(Ni,{})}):C?o.jsx(ne,{path:"new",element:o.jsx(Je,{to:"..",replace:!0})}):null,_&&M?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(Zc,{})}),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"})}):V?o.jsx(ne,{path:"*",element:o.jsx(Je,{to:"../promo",state:e.state})}):o.jsx(ne,{path:"*",element:null})]})}export{Id as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-BF-IiX2V.js";import{a as g}from"./sentry-DQv7eTqs.js";import{h as w,u as x,g as T,i as k,j as O,l as E}from"./core-C1MQ75FC.js";import{z as C,bt as F,a9 as P,l as V,V as j,r as b,bu as L,af as A,aH as U,p as B}from"./index-DheSTGi7.js";import{fF as N,gI as M,BE as _,gD as z,c8 as R,Ye as Y,bn as G,uX as H,uL as X,mz as Z,o8 as S,Yf as $,bE as q,cE as D,oj as J,ot as K}from"./zeni-epic-state-Dmop9tB7.js";import"./mui-D4JyxRuO.js";import{d as Q}from"./routePaths-DrHt4RCx.js";import{M as W}from"./MobileAppDrawer-CdDtqWOO.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="db2a3d09-bddb-4c02-aefa-9312993ff6ad",t._sentryDebugIdIdentifier="sentry-dbid-db2a3d09-bddb-4c02-aefa-9312993ff6ad")}catch{}})();const ee=E((function(t){const n=z(t),i=C.getSignedInUser(),p=N(t),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(p?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Y(t.companyConfigState),a=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:l,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:G(i)}}),(function(t,n){const{companyId:i,currentTenant:p,navigate:c,location:l}=n,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const a=Q(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map((I=>I.length===2?I:U(I)))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?q(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(X(e))},onEditFileName:(e,a)=>{t(H(e,a.split(".")[0]))}}}))(L);function de(){const t=w(),n=x(),i=T(),{tenantEmailDomain:p}=k(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),a=O((s=>s.companyViewState.passportView.fetchState)),o=O((s=>s.companyConfigState.fetchState)),r=O((s=>N(s))),d=r.companyId??C.getSignedInUserTenant(p)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||a!=="Not-Started"||d==null||(l(!0),n(M(d)))}),[c,a,d,n]),g.useEffect((()=>{o==="Not-Started"&&n(_())}),[o,n]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,11 +0,0 @@
1
- import{j as I}from"./liveblocks-BF-IiX2V.js";import{a as o}from"./sentry-DQv7eTqs.js";import{u as P,h as R,g as H,j as C,N as w}from"./core-C1MQ75FC.js";import{TV as q,fF as z,gl as G,pS as V,gM as A,gk as J,gi as M,Uj as Q,gh as O}from"./zeni-epic-state-Dmop9tB7.js";import{u as B,z as E,L as D,G as K,J as W}from"./index-DheSTGi7.js";import{n as X}from"./mui-D4JyxRuO.js";import{P as b,a as _}from"./AccountMappingScreen-CHe5ZDGP.js";import{t as Y}from"./getLocaleForTenant-BAgQLN5V.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-ByT4Lz_O.js";import"./recharts-BEOxWuh3.js";import"./analytics-Ckbn2qr2.js";import"./plaid-CD2DDkpy.js";import"./dnd-64pfrglk.js";import"./stripe-cKAAJElX.js";import"./lottie-CWNAcXJv.js";import"./lexical-TkcJlpM_.js";import"./pdf-Cj_veg-U.js";import"./utils-G6VVxCSd.js";import"./MobileAppDrawer-CdDtqWOO.js";import"./InboxNotificationsProvider-zG7x1gLM.js";import"./useTaskManagerAccess-BOnqrzjJ.js";import"./accountMappingHelper-Dr9MEF3a.js";import"./empty-DTjUxrNn.js";import"./pdf-lib-LgS50teK.js";import"./index-DBaQwW7d.js";import"./url-Eifk29FQ.js";import"./index-RA90NjT0.js";import"./decodeURIComponentSafe-BkSrHWOz.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]="82c08a96-00e1-4cbb-b2ec-680ba39193a5",t._sentryDebugIdIdentifier="sentry-dbid-82c08a96-00e1-4cbb-b2ec-680ba39193a5")}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=P(),i=R(),v=H(),{setLoading:d,clearAllLoading:m}=B(),h=o.useRef(!1),S=o.useRef(!1),N=o.useRef(!1),p=o.useRef(!1),{code:U,realmId:$,state:F}=Z(v.search),f=U!==""&&$!==""&&F!=="";f&&(N.current=!0);const j=sessionStorage.getItem(b),u=j===_.pending,L=j===_.ready,x=C((s=>q(s))),e=C((s=>z(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,c=e?.externalConnections?.saveConnectionState,y=e.externalConnections?.accounting[0]?.isValid;o.useLayoutEffect((()=>{d(D.CONNECTION_AUTH)}),[d]),o.useEffect((()=>{h.current||a==null||g==null||(h.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(D.TENANT_FETCHING),t(G(a.userId,g))))}),[h,n,d]),o.useEffect((()=>{e.tenantId==null&&!S.current&&a!=null&&(S.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(V(a.userId)))}),[S,n,r]),o.useEffect((()=>{a==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||c!=="Error"||(d(D.CONNECTION_AUTH),t(A(a.userId,e.tenantId)))}),[c]),o.useEffect((()=>{n!=="Completed"&&r!=="Completed"||a==null||e?.tenantId==null||(t(J(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),M(a?.userId,a?.zeniSessionId,e.tenantId),K.updateAppLocaleID(Y(Q(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&&c==="In-Progress"&&(p.current=!0)}),[u,c]),o.useEffect((()=>{if(!u||T)return;const s=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return p.current&&c==="Completed"?(sessionStorage.setItem(b,_.ready),m(),void i(s,{replace:!0})):p.current&&c==="Error"?(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),void i(s,{replace:!0})):void(f||N.current||p.current||y!==!0||(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),i(s,{replace:!0})))}),[u,T,c,f,y,e.tenantEmailDomain,m,t,i]),T)return null;if(f||y!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const k=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return L?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-BF-IiX2V.js";import{z as m}from"./index-DheSTGi7.js";import{g as n}from"./QBOConnectionScreen-ByT4Lz_O.js";import"./sentry-DQv7eTqs.js";import{g as p,N as a}from"./core-C1MQ75FC.js";import"./zeni-epic-state-Dmop9tB7.js";import"./recharts-BEOxWuh3.js";import"./mui-D4JyxRuO.js";import"./analytics-Ckbn2qr2.js";import"./plaid-CD2DDkpy.js";import"./dnd-64pfrglk.js";import"./stripe-cKAAJElX.js";import"./lottie-CWNAcXJv.js";import"./lexical-TkcJlpM_.js";import"./pdf-Cj_veg-U.js";import"./utils-G6VVxCSd.js";import"./empty-DTjUxrNn.js";import"./pdf-lib-LgS50teK.js";import"./index-DBaQwW7d.js";import"./url-Eifk29FQ.js";import"./index-RA90NjT0.js";import"./decodeURIComponentSafe-BkSrHWOz.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]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-BF-IiX2V.js";import{h as w,g as C,j as h,l as E,i as V}from"./core-C1MQ75FC.js";import{YT as k,Y_ as H,gG as W,gF as q,gE as J,kP as L,WS as Q,uO as K,fF as B,Yq as D,kN as F,YU as S,Z1 as T,kL as G,l6 as j}from"./zeni-epic-state-Dmop9tB7.js";import{bO as M,a2 as N,o as R,z as U,E as O,a5 as p,S as v,a8 as Z,bP as X,J as _,bQ as ee,p as te}from"./index-DheSTGi7.js";import{n as Y}from"./mui-D4JyxRuO.js";import"./sentry-DQv7eTqs.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b3bf2812-110c-4cf7-9541-9dbbd9e7eb69",e._sentryDebugIdIdentifier="sentry-dbid-b3bf2812-110c-4cf7-9541-9dbbd9e7eb69")}catch{}})();const ne=E(null,(function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(Q("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(H(n,a,o))}}}))(M);function z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Y.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),r=s.poppedPathname??P();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(T({data:r}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(X);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,{useFeatureGate:c}=R(),d=U.getSignedInUser(),b=h((u=>B(u))),g=O(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(z,{vendorId:i,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},A=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return A(e,"ach",t,n)}function ve(e,t,n){return A(e,"domestic",t,n)}function ge(e,t,n){return A(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=Y.div`
10
- display: flex;
11
- height: 100vh;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- box-shadow: ${e=>`0px 2px ${_.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,re=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:i}=r;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(G(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:d}=c;e(T({data:d}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),d=c.poppedPathname??$();a(d,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const d=se(i,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(d,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),d=c.poppedPathname??$(0);t.navigate(d,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}}))(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,c=U.getSignedInUser(),{useFeatureGate:d}=R(),b=O(),g=h((u=>B(u))),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${_.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(z,{vendorId:i,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BF-IiX2V.js";import{a as d}from"./sentry-DQv7eTqs.js";import{h as A,u as B,g as G,i as $,j as l,N as F,l as q,n as N,o as R}from"./core-C1MQ75FC.js";import{WW as _,fF as O,Wc as M,m$ as Y,Sd as k,W$ as z,WR as V,l$ as H,Se as P,Wh as J,Wi as K,WT as L,WS as Q}from"./zeni-epic-state-Dmop9tB7.js";import{b9 as U,l as X,a5 as Z,p as tt}from"./index-DheSTGi7.js";import"./mui-D4JyxRuO.js";import{d as b}from"./decodeURIComponentSafe-BkSrHWOz.js";import{w as et}from"./withTransactionSidePanel-DdbBVvXc.js";import{f as at,c as nt}from"./routePaths-DrHt4RCx.js";import"./recharts-BEOxWuh3.js";import"./analytics-Ckbn2qr2.js";import"./plaid-CD2DDkpy.js";import"./dnd-64pfrglk.js";import"./stripe-cKAAJElX.js";import"./lottie-CWNAcXJv.js";import"./lexical-TkcJlpM_.js";import"./pdf-Cj_veg-U.js";import"./utils-G6VVxCSd.js";import"./useAskAiCfoHostNavButtonProps-DhY9V91R.js";import"./TransactionDetailScreen-D87lkTI9.js";import"./useInitialThreadRequest-Fj77Qh1B.js";import"./expenseAutomationHelper-VfFbXlTC.js";import"./stripSplatSuffix-CF6NUsXZ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="a1e604f4-96be-48ef-8a4a-17731988650b",a._sentryDebugIdIdentifier="sentry-dbid-a1e604f4-96be-48ef-8a4a-17731988650b")}catch{}})();const it=q((function(a,t){const e=t.entity,i=z(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:V(a,"common")},trendWithTransactionsReport:i,analytics:X,isAccountingClassesEnabled:H(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const i=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(i,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const i=at(e,t.tenantEmailDomain);a(J()),a(K()),t.resetTrendIsFetchedStates(),t.navigate(i,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),i=e.poppedPathname??I();t.navigate(i,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(P(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const i=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(P(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:i}))}}}}))(U),ot=et((function({entityType:a,...t}){const e=A(),i=B(),c=G(),[m,h]=d.useState(!1),[T,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:W,entityNameEncoded:x}=$(),r=b(W??""),p=b(x??""),f=rt(r,p),j=[r,p].filter((n=>n!=null)),o={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,o,"quarter"))),v=l((n=>O(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>M(n.trendWithTransactionsState,o,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(h(!0),i(Y(o)))}),[m,f,o]);const S=l((n=>n.trendState.fetchState)),E=u?.selectedPeriod?.timePeriod??g,w=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&T===!1&&S==="Completed"&&(D(!0),E!=null&&i(k(o,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,T,S]),f?s.jsx(it,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:o,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{h(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function vt({entityType:a}){return s.jsx(N,{children:s.jsx(R,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(ot,{entityType:a})})})}export{vt as EntityDetailRoutes,vt as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BF-IiX2V.js";import{a as r}from"./sentry-DQv7eTqs.js";import{ax as i,ay as c,B as l,a5 as p}from"./index-DheSTGi7.js";import"./mui-D4JyxRuO.js";import m from"./NotFoundScreen-ujna2tN5.js";import{h as u,g as b}from"./core-C1MQ75FC.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]="f21aec28-6d82-4b2e-9b2c-7366ffa240d2",e._sentryDebugIdIdentifier="sentry-dbid-f21aec28-6d82-4b2e-9b2c-7366ffa240d2")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=i(a.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};