@zeniai/web-app-ui 5.1.43-prod → 5.1.44-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 (144) hide show
  1. package/dist/assets/AddressRoutes-8gRhHPlq.js +1 -0
  2. package/dist/assets/AddressScreen-DPs7jKyd.js +9 -0
  3. package/dist/assets/AiCfoScreen-Bp7iBQCF.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-DwElFGIC.js +1 -0
  5. package/dist/assets/{BillPayRoutes-CABVTdLx.js → BillPayRoutes-CcQHQh3Z.js} +33 -33
  6. package/dist/assets/BusinessVerificationPageScreen-CRI_zbAG.js +9 -0
  7. package/dist/assets/CardsAiCfoScreen-Cn4K24os.js +14 -0
  8. package/dist/assets/ChargeCardRoutes-D8Tom0l5.js +71 -0
  9. package/dist/assets/{CompanyPassportScreen-C6gLiJEX.js → CompanyPassportScreen-DPJK2btv.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-DDGywryh.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-DnJWeWwh.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-C4lgpv0w.js → CustomerOnboardingRoutes-CAThwW9P.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-Ds1VJh16.js → DashboardRoutes-CafL1C3x.js} +4 -4
  14. package/dist/assets/DefaultTenantHome-BDsIXAxj.js +1 -0
  15. package/dist/assets/DomesticWireDetailScreen-DdvB-Hbh.js +18 -0
  16. package/dist/assets/DrawerScreen-BMmlRoqi.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-CnMM1wvf.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-V-R3AFJQ.js +25 -0
  19. package/dist/assets/FeaturePreviewScreen-CBC6jNb-.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-CPP6O7Kt.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-BVmPAQoY.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-COv9DoLZ.js +12 -0
  23. package/dist/assets/MobileAppDrawer-BpbByRGV.js +1 -0
  24. package/dist/assets/NotFoundScreen-CiwLb5Sm.js +1 -0
  25. package/dist/assets/{NotificationRoutes-BicBvFpF.js → NotificationRoutes-DeCoRUH5.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-C5rnSpaM.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-CgREv28H.js +1 -0
  28. package/dist/assets/PeopleRoutes-Cvh7SESL.js +22 -0
  29. package/dist/assets/PerformanceRoutes-DZB5u4lB.js +1 -0
  30. package/dist/assets/{Preview-HCW9KT4G.js → Preview-CFdBsxvl.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-D4OG7t2D.js → QBOConnectionScreen-L9petFDu.js} +1 -1
  32. package/dist/assets/ReferralListScreen-Cz3Ll36o.js +5 -0
  33. package/dist/assets/ReimbursementApprovalRoutes-DcR9SJt8.js +1 -0
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CYZx-pOj.js → ReimbursementApprovalRuleDetailScreen-BdjIgOOJ.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-Cbj0yPvh.js → ReimbursementRoutes-BOGqzYA3.js} +9 -9
  36. package/dist/assets/ReportsRoutes-tKvN7scu.js +1 -0
  37. package/dist/assets/RewardsRoutes-DUkSJAe0.js +1 -0
  38. package/dist/assets/ScreenRoutes-DvorYiQN.js +2 -0
  39. package/dist/assets/{SettingsRoutes-DNlIqi8U.js → SettingsRoutes-BdrupBKM.js} +8 -8
  40. package/dist/assets/{SetupPagesScreen-DbOwsJcn.js → SetupPagesScreen-C1DrVmba.js} +5 -5
  41. package/dist/assets/SignInScreen-BcivZgMD.js +1 -0
  42. package/dist/assets/SignOutScreen-x33X8VDG.js +9 -0
  43. package/dist/assets/TaskListScreen-CKfjqqhC.js +9 -0
  44. package/dist/assets/TaskRoutes-BNGauwWr.js +9 -0
  45. package/dist/assets/TransactionDetailRoutes-DoEO9RhU.js +1 -0
  46. package/dist/assets/{TransactionDetailScreen-BNfcRS7-.js → TransactionDetailScreen-BabZW4yC.js} +2 -2
  47. package/dist/assets/TransactionListRoutes-73dX3i3x.js +1 -0
  48. package/dist/assets/TreasuryRoutes-BXTQGc91.js +37 -0
  49. package/dist/assets/{VendorsRoutes-DJKzNMQ6.js → VendorsRoutes-CgVxrKP3.js} +27 -27
  50. package/dist/assets/WiseConfirmationScreen-egcHJS2j.js +12 -0
  51. package/dist/assets/ZeniAccountRoutes-CtmM7uy-.js +57 -0
  52. package/dist/assets/ZeniAccountStatementScreen-BiD6-8br.js +9 -0
  53. package/dist/assets/{accountMappingHelper-CLvfs1fS.js → accountMappingHelper-CUOH4oaZ.js} +1 -1
  54. package/dist/assets/{analytics-BKFxkJXq.js → analytics-CVef-z80.js} +1 -1
  55. package/dist/assets/{analyticsHelper-C_957RQ-.js → analyticsHelper-BLGte-6z.js} +1 -1
  56. package/dist/assets/{core-CGRh988K.js → core-BZimyUuM.js} +2 -2
  57. package/dist/assets/{decodeURIComponentSafe-DRCpTHJs.js → decodeURIComponentSafe-CfH0YvB4.js} +1 -1
  58. package/dist/assets/{dnd-CcFi9V4s.js → dnd-Ck7mLEKI.js} +1 -1
  59. package/dist/assets/{empty-BLKSJ8th.js → empty-B1O8rDIf.js} +1 -1
  60. package/dist/assets/{index-qFAlJqK8.js → empty-CDMj19T8.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-B6zaIZAB.js → emptyVideoElement-DHeCITuJ.js} +1 -1
  62. package/dist/assets/epic-C8TvJLbh.js +2 -0
  63. package/dist/assets/{getLocaleForTenant-DSIXvqfH.js → getLocaleForTenant-D-xlVXss.js} +1 -1
  64. package/dist/assets/{index-DcyVSbFf.js → index-B4buEPtI.js} +1 -1
  65. package/dist/assets/{index-BqXlfVbs.js → index-BHYDqIxo.js} +1 -1
  66. package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
  67. package/dist/assets/{index-CWCg3ysA.js → index-BX9FlrZ4.js} +2 -2
  68. package/dist/assets/{index-C1fXgMBF.js → index-CGgy5RAo.js} +1 -1
  69. package/dist/assets/{index-KKxEmb4f.js → index-CWDdvACz.js} +19408 -17074
  70. package/dist/assets/{index-lIh5CJP-.js → index-DUwckqJX.js} +1 -1
  71. package/dist/assets/index-W-rD4OTh.js +1 -0
  72. package/dist/assets/index-ky9cAsxd.js +1 -0
  73. package/dist/assets/{lexical-BWfctdSX.js → lexical-D_s6IbSB.js} +1 -1
  74. package/dist/assets/{liveblocks-CxQyVdmp.js → liveblocks-PtDFv95_.js} +1 -1
  75. package/dist/assets/{lottie-qTKXNt7n.js → lottie-D7iBAvwy.js} +1 -1
  76. package/dist/assets/{mui-DOOgBswz.js → mui-BcLZDyi8.js} +1 -1
  77. package/dist/assets/{pathToGoBack-BQIWsyT2.js → pathToGoBack-Bmk3vSys.js} +1 -1
  78. package/dist/assets/{pdf-CyJbH3RK.js → pdf-CPbk6pQ4.js} +3 -3
  79. package/dist/assets/{pdf-lib-THwzU8fF.js → pdf-lib-DYmF-pgM.js} +1 -1
  80. package/dist/assets/{plaid-DKuuSvS9.js → plaid-CooQT--5.js} +1 -1
  81. package/dist/assets/{pusher-Wb1pOJq6.js → pusher-KpZt7gt8.js} +1 -1
  82. package/dist/assets/{react-Fad2Hu7W.js → react-1GR8h5rv.js} +1 -1
  83. package/dist/assets/{react-69Rr4xY2.js → react-BByj9tRX.js} +1 -1
  84. package/dist/assets/{react-C_U_8cVl.js → react-C5ff31Q5.js} +1 -1
  85. package/dist/assets/{react-DWl5FCLz.js → react-CgKzDvVo.js} +1 -1
  86. package/dist/assets/{react-D6BkGmxx.js → react-jDouMY6r.js} +1 -1
  87. package/dist/assets/{react-D_7wtJBz.js → react-xjRx_xkd.js} +1 -1
  88. package/dist/assets/{recharts-AypxxmWa.js → recharts-Nefi66IQ.js} +1 -1
  89. package/dist/assets/{routePaths-CVVAujpk.js → routePaths-BrOGk8hR.js} +1 -1
  90. package/dist/assets/{sentry-Na2f7K9i.js → sentry-mCXLUbmc.js} +1 -1
  91. package/dist/assets/{url-bf_4McGL.js → url-DwL5mRAv.js} +1 -1
  92. package/dist/assets/{url-DQ4rUOLf.js → url-V8qFg-31.js} +1 -1
  93. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BCEQb-nY.js → useAiCfoDashboardSuggestedQuestionsChips-CRuBS_0m.js} +1 -1
  94. package/dist/assets/useAskAiCfoHostNavButtonProps-0ZlblxUj.js +1 -0
  95. package/dist/assets/{useDeviceId-CAzyx53z.js → useDeviceId-r7OfXqIX.js} +1 -1
  96. package/dist/assets/useInitialThreadRequest-DE3A7e2N.js +1 -0
  97. package/dist/assets/{utils-BeAkRe29.js → utils-C9yOAUzR.js} +2 -2
  98. package/dist/assets/{withTransactionSidePanel-C3g8adFN.js → withTransactionSidePanel-3L4TkBmm.js} +4 -4
  99. package/dist/assets/{zeni-epic-state-D9GkJt4v.js → zeni-epic-state-D1RAQ_Ab.js} +6 -6
  100. package/dist/index.html +1 -1
  101. package/package.json +4 -4
  102. package/dist/assets/AddressRoutes-D4Y4x9kR.js +0 -1
  103. package/dist/assets/AddressScreen-CughVKg_.js +0 -9
  104. package/dist/assets/AiCfoScreen-HE295a-_.js +0 -22
  105. package/dist/assets/BillPayApprovalRoutes-sbMU2srX.js +0 -1
  106. package/dist/assets/BusinessVerificationPageScreen-B7LMMYY1.js +0 -9
  107. package/dist/assets/ChargeCardRoutes-D9_qV36B.js +0 -71
  108. package/dist/assets/ConnectionAuthScreen-CJrkgtaR.js +0 -11
  109. package/dist/assets/CustomerOnboardingAuthScreen-D73GJc_0.js +0 -1
  110. package/dist/assets/DefaultTenantHome-hmhSj8g7.js +0 -1
  111. package/dist/assets/DomesticWireDetailScreen-CW-q-iqR.js +0 -18
  112. package/dist/assets/DrawerScreen-GSshtI9d.js +0 -1
  113. package/dist/assets/EntityDetailRoutes-XWIFhwoq.js +0 -1
  114. package/dist/assets/ExpenseAutomationRoutes-CYkKEWzx.js +0 -25
  115. package/dist/assets/FeaturePreviewScreen-DaCa8aF6.js +0 -1
  116. package/dist/assets/HubSpotOAuthCallbackScreen-DSel3SsR.js +0 -1
  117. package/dist/assets/MagicLinkRoutes-o7-mPz5q.js +0 -72
  118. package/dist/assets/MagicLinkSignInScreen-BKNo3Qz6.js +0 -12
  119. package/dist/assets/MobileAppDrawer-DIjtpAlT.js +0 -1
  120. package/dist/assets/NotFoundScreen-CrA2LAEq.js +0 -1
  121. package/dist/assets/OAuthConsentScreen-BJUvK7tX.js +0 -1
  122. package/dist/assets/PandLWithForecastRoutes-D5Ro3R2V.js +0 -1
  123. package/dist/assets/PeopleRoutes-DYohYPwZ.js +0 -22
  124. package/dist/assets/PerformanceRoutes-TKbX1tOZ.js +0 -1
  125. package/dist/assets/ReferralListScreen-Da_v7gq-.js +0 -5
  126. package/dist/assets/ReimbursementApprovalRoutes-3BZPnXZP.js +0 -1
  127. package/dist/assets/ReportsRoutes-YuzBVy-K.js +0 -1
  128. package/dist/assets/RewardsRoutes-DJ7oiYk4.js +0 -1
  129. package/dist/assets/ScreenRoutes-D6yE76Vl.js +0 -2
  130. package/dist/assets/SignInScreen-wvz0ZwNq.js +0 -1
  131. package/dist/assets/SignOutScreen-DZHt0mdi.js +0 -9
  132. package/dist/assets/TaskListScreen-B2a0o2nk.js +0 -9
  133. package/dist/assets/TaskRoutes-C75AaxUo.js +0 -9
  134. package/dist/assets/TransactionDetailRoutes-IavqEdLQ.js +0 -1
  135. package/dist/assets/TransactionListRoutes-DZicTnrI.js +0 -1
  136. package/dist/assets/TreasuryRoutes-X7Ye4Vdv.js +0 -37
  137. package/dist/assets/WiseConfirmationScreen-W2cCVdKk.js +0 -12
  138. package/dist/assets/ZeniAccountRoutes-C8gYK62n.js +0 -57
  139. package/dist/assets/ZeniAccountStatementScreen-CokeC_qF.js +0 -9
  140. package/dist/assets/empty-C68Cemde.js +0 -1
  141. package/dist/assets/epic-Cia04k_k.js +0 -2
  142. package/dist/assets/index-CzUY5640.js +0 -1
  143. package/dist/assets/useAskAiCfoHostNavButtonProps-CqIT8mNx.js +0 -1
  144. package/dist/assets/useInitialThreadRequest-C7-YEavN.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-KKxEmb4f.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-Na2f7K9i.js"><link rel="modulepreload" crossorigin href="/assets/core-CGRh988K.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-D9GkJt4v.js"><link rel="modulepreload" crossorigin href="/assets/mui-DOOgBswz.js"><link rel="modulepreload" crossorigin href="/assets/analytics-BKFxkJXq.js"><link rel="modulepreload" crossorigin href="/assets/utils-BeAkRe29.js"><link rel="stylesheet" crossorigin href="/assets/index-R6GjjTB3.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-CWDdvACz.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-mCXLUbmc.js"><link rel="modulepreload" crossorigin href="/assets/core-BZimyUuM.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-D1RAQ_Ab.js"><link rel="modulepreload" crossorigin href="/assets/mui-BcLZDyi8.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CVef-z80.js"><link rel="modulepreload" crossorigin href="/assets/utils-C9yOAUzR.js"><link rel="stylesheet" crossorigin href="/assets/index-BUmr5maU.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.1.43-prod",
3
+ "version": "5.1.44-dev",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],
@@ -27,9 +27,9 @@
27
27
  "@sentry/core": "^9.42.1",
28
28
  "@sentry/react": "^9.42.1",
29
29
  "@stripe/stripe-js": "^4.4.0",
30
- "@zeniai/client-analytics": "2.0.22",
31
- "@zeniai/client-epic-state": "5.0.91",
32
- "@zeniai/web-components": "4.1.60",
30
+ "@zeniai/client-analytics": "2.0.21",
31
+ "@zeniai/client-epic-state": "5.0.93",
32
+ "@zeniai/web-components": "4.1.61",
33
33
  "color": "3.1.3",
34
34
  "cross-fetch": "^4.0.0",
35
35
  "crypto-js": "4.2.0",
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-CxQyVdmp.js";import{A as d}from"./AddressScreen-CughVKg_.js";import i from"./NotFoundScreen-CrA2LAEq.js";import"./sentry-Na2f7K9i.js";import{o as s,p as r}from"./core-CGRh988K.js";import"./zeni-epic-state-D9GkJt4v.js";import"./recharts-AypxxmWa.js";import"./index-KKxEmb4f.js";import"./mui-DOOgBswz.js";import"./analytics-BKFxkJXq.js";import"./plaid-DKuuSvS9.js";import"./dnd-CcFi9V4s.js";import"./stripe-DMRn4zHo.js";import"./lottie-qTKXNt7n.js";import"./lexical-BWfctdSX.js";import"./pdf-CyJbH3RK.js";import"./utils-BeAkRe29.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,9 +0,0 @@
1
- import{j as r}from"./liveblocks-CxQyVdmp.js";import{a as h}from"./sentry-Na2f7K9i.js";import{h as T,u as _,g as j,i as E,j as B,n as K}from"./core-CGRh988K.js";import{J as M,m as L,z as $,k as D,B as R,A as N,c as C,f as S,q as z,j as b,v as F}from"./index-KKxEmb4f.js";import{KL as k,h3 as U,eR as q,KM as G,c2 as O,KN as V,ko as H}from"./zeni-epic-state-D9GkJt4v.js";import{n as J}from"./mui-DOOgBswz.js";import Q from"./NotFoundScreen-CrA2LAEq.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]="24ad5648-073e-4259-914a-c236d357b7aa",e._sentryDebugIdIdentifier="sentry-dbid-24ad5648-073e-4259-914a-c236d357b7aa")}catch{}})();const W=J.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=K(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=q(e),a=t.roleMap!=null&&G(t.roleMap),d=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=F(d?.pathnameStackToGoBack);let s=n.poppedPathname??v();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=j(),{addressId:s,addressType:u}=E(),g=M(),w=L(),A=$.getSignedInUser(),[f,I]=h.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),x=D();if(A==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(I(!0),d(U(s,!1)))},[f,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(R,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(N,{analytics:C,onLoad:P}),r.jsx(W,{windowSize:g,children:r.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):r.jsx(Q,{})}const v=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},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{re as A,Y as t};
@@ -1,22 +0,0 @@
1
- import{j as c}from"./liveblocks-CxQyVdmp.js";import{a as r}from"./sentry-Na2f7K9i.js";import{u as ge,h as Ce,g as be,j as J,i as Ie,n as ke}from"./core-CGRh988K.js";import{T as we,z as xe,J as Pe,cU as Ee,cV as Te,b6 as Y,cW as ve,b5 as Z,v as D,A as L,c as b,cX as F,cY as ye,cZ as Qe,a1 as _e,f as Ae,a7 as Oe,c_ as Ue,a2 as je,w as Le,b1 as Fe,c$ as Re}from"./index-KKxEmb4f.js";import{fK as De,eQ as ee,eR as Be,hJ as Me,Ry as Ve,eU as Ge,hT as $e,hP as Ne,eS as R,fv as qe,fo as ze,fs as X,fw as He,fx as We,fy as Je,fz as Ye,fA as Xe}from"./zeni-epic-state-D9GkJt4v.js";import{D as Ke,n as I,S as Ze,P as et}from"./mui-DOOgBswz.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-BCEQb-nY.js";import{p as st}from"./pathToGoBack-BQIWsyT2.js";import"./recharts-AypxxmWa.js";import"./analytics-BKFxkJXq.js";import"./plaid-DKuuSvS9.js";import"./dnd-CcFi9V4s.js";import"./stripe-DMRn4zHo.js";import"./lottie-qTKXNt7n.js";import"./lexical-BWfctdSX.js";import"./pdf-CyJbH3RK.js";import"./utils-BeAkRe29.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="bdaf91dc-5fec-4fbd-9d1c-d50bb4dfa769",a._sentryDebugIdIdentifier="sentry-dbid-bdaf91dc-5fec-4fbd-9d1c-d50bb4dfa769")}catch{}})();const te="chat-response-generated",ot=ke(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:h,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:u,setIsAiCfoOpen:S}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,d=We(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:T}=Z(u,t);d!=="answer"?b.trackAICFOChatResponseGenerated(d,k?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):b.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Je(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Ye({chatSessionId:o.metadata.chat_session_id,responseType:d,fetchState:{fetchState:"Completed",error:void 0}})),a(Xe({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,d)=>{e&&Fe(a,e,p,f,u,l,d,o)},updateCurrentInput:e=>{a(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(He(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{h(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);h(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(X(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;h(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),S(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{h(-1)},onNewChatClick:()=>{f!=null&&a(ze());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);h(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Oe(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=we(),s=ge(),m=Ce(),l=be(),[h,f]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const u=J(n=>ee(n)),S=xe.getSignedInUser(),{session_id:e}=Ie(),p=Pe(),o=_e(p),d=J(n=>Be(n)),t=u.uiState.currentChatSessionId,E=d.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:d,currentChatSessionId:t,aiCfoView:u}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=l.state,x=w?.aiCfoInitialQuestion,B=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[Y]!==!0)return;f(!0);const g={...n};delete g[Y],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,A]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const n=l.state;y(x),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;A(typeof g=="number"?g:void 0),M.current=!0}},[x,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),A(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??w?.aiCfoRef,O=V.get("emailRefId")??w?.aiCfoEmailRefId,$=r.useRef(!1);r.useEffect(()=>{$.current||G!=="month-end-email"||O==null||t!=null||S==null||(s(Me("controller",S.userId,O,"MONTH_END_EMAIL")),$.current=!0)},[G,O,t,s,S]);const P=u.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),A(void 0),s(Ve()))},[P,t,s]);const ce=d.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:N}=ve(t),U=u.fetchState,j=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,q=t!=null?u.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",z=t==null||(u.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),H=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:de}=Z(H,t),ue=de.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=d.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[d.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:N.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,Se)=>Se.onEventReceived(n,g)}),[N]);r.useEffect(()=>{U!=="In-Progress"&&j&&s($e())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&z&&S!=null&&U==="Completed"&&!j&&s(Ne(t,S.userId))},[q,z,t,S,s]);const W=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(S==null||e==null)throw Error("Can't access AI Controller page without signing in...");const fe=t!=null&&u.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:b,onLoad:W}),v.drawerElement,c.jsx(it,{children:c.jsx(K,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{d.userRoleId!=null&&s(R(d.userRoleId))}})})})]});const he=c.jsxs(c.Fragment,{children:[h&&!C?c.jsx(L,{analytics:b,onLoad:W}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:u.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>f(!1):void 0,onCloseClick:()=>f(!1),onCompleteClick:()=>{C||d.userRoleId==null||s(R(d.userRoleId)),f(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:b,onLoad:n=>n.trackPageLoaded(Ae.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:H,openOnboardingPage:()=>f(!0),userId:S.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:fe,isEmptyChatWithSession:ue,currentTenant:d,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),h&&o?c.jsx(Ke,{anchor:"right",open:h,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:c.jsx(K,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:()=>f(!1),onCompleteClick:()=>{C||d.userRoleId==null||s(R(d.userRoleId)),f(!1)}})})}):null]}),h&&!o?c.jsx(ye,{open:h,onClose:()=>f(!1),children:c.jsx(Qe,{children:he})}):null]})},K=I(Ze)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,at=I.div`
6
- height: 100vh;
7
- width: 100%;
8
- `,nt=I.div`
9
- height: 100vh;
10
- width: 100%;
11
- display: flex;
12
- flex-direction: column;
13
- min-height: 0;
14
- `,it=I.div`
15
- flex: 1;
16
- min-height: 0;
17
- display: flex;
18
- flex-direction: column;
19
- `,rt=I(et)`
20
- box-shadow: ${({theme:a})=>a.colors.elevation2};
21
- color: ${({theme:a})=>a.colors.grey4};
22
- `;export{Et as default};
@@ -1 +0,0 @@
1
- import{j as l}from"./liveblocks-CxQyVdmp.js";import{a as y}from"./sentry-Na2f7K9i.js";import{h as B,g as U,u as j,j as v,N,n as T,i as O,o as $,p as h}from"./core-CGRh988K.js";import{eR as L,O1 as A,NJ as b,yp as I,yj as F,yn as w,yc as q,NL as W,yf as z,yr as H,yq as C}from"./zeni-epic-state-D9GkJt4v.js";import{m as P,z as k,B as V,a7 as J,bH as G,af as _,bI as K}from"./index-KKxEmb4f.js";import"./mui-DOOgBswz.js";import{i as M}from"./ReimbursementApprovalRuleDetailScreen-CYZx-pOj.js";import Q from"./NotFoundScreen-CrA2LAEq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d51299f7-24d7-421d-917a-b959648e7f5c",e._sentryDebugIdIdentifier="sentry-dbid-d51299f7-24d7-421d-917a-b959648e7f5c")}catch{}})();const R="bill-approval-rule-update",X=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a))},onEditRuleClick:a=>{a!=null?(e(w(a)),t(`./${a}/edit`)):(e(w()),t("./new"))}}})(J(G)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(I())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(w())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=f.actors.selectedNonUsers.map(S=>{const E=!!M(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(x);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(z(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
@@ -1,9 +0,0 @@
1
- import{j as k}from"./liveblocks-CxQyVdmp.js";import{a as V}from"./sentry-Na2f7K9i.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-CGRh988K.js";import{k as ce,s as ue,aN as de,z,A as pe,c as B,af as E,f as x,bD as le,at as me,w as R,au as M}from"./index-KKxEmb4f.js";import{NR as fe,eR as G,sD as ye,Ii as Se,yu as ge,Bb as Ie,DK as be,En as he,Fo as Oe,Oc as De,Od as Te,Oe as ke,Of as Ce,Og as Ve,KM as we,Ne,KY as Ae,ko as Fe,fG as _e,fF as ve,fE as Ee,qL as xe,qC as ze,qz as Be,kg as Re,sM as Me,sK as P,bE as L,sY as U,cv as Pe}from"./zeni-epic-state-D9GkJt4v.js";import{n as Le}from"./mui-DOOgBswz.js";import{d as j}from"./routePaths-CVVAujpk.js";import{M as Ue}from"./MobileAppDrawer-DIjtpAlT.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="ffb62d74-14ba-49dd-a9a5-39f0ab8755ed",e._sentryDebugIdIdentifier="sentry-dbid-ffb62d74-14ba-49dd-a9a5-39f0ab8755ed")}catch{}})();const je=Le.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ne(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:h,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:h}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:D,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:F,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:K,transactionVolume:Y,transactionVolumeDescription:Z,purposeOfAccount:$,purposeOfAccountDescription:W,regulatedStatus:H,regulatedStatusDescription:J,usNexus:Q,usNexusTypes:X}=t,_=D?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(v=>v.length===2?v:M(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:Y?.selectedOption??"",transactionVolumeDescription:Z,purposeOfAccount:$?.selectedOption??"",purposeOfAccountDescription:W,regulatedStatus:H??"",regulatedStatusDescription:J,usNexus:Q,usNexusTypes:X?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:D,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:F}=p;let b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:D,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?M(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=j(h,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(h,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Me({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Re({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(xe(t,s.split(".")[0]))},onGetOtp:t=>{e(Ee(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(_e(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(Fe({addressType:t,addressToCreate:s}))}}})(le),Qe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,h]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:D}=p(de.zeniAccountsConfig),T=fe(D),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(Oe(n,!0));break;case"zeni_treasury":r(he(n,!0));break;case"reimbursement":r(be(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const O=a=>{h(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=De(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(je,{children:[k.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(x.Event.billPayBusinessVerification,E(i)?"Settings":void 0)}})(a)}),E(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:E(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Qe as B};
@@ -1,71 +0,0 @@
1
- import{j as s}from"./liveblocks-CxQyVdmp.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Fa,s as jt,o as Rn,p as se}from"./core-CGRh988K.js";import{eR as de,bs as He,PM as ja,e_ as Ie,e$ as Ae,f0 as Ee,fV as Ke,cs as qe,PN as Xe,PO as lt,tS as Ba,jQ as xa,PP as La,gV as pa,Au as ca,Aw as Ne,Ax as ut,jG as Vt,PQ as Je,Ai as ha,PR as Un,PS as On,Al as Va,PT as jn,O9 as Na,s2 as Nt,Ar as na,h4 as Vn,PU as Ht,PV as ea,bq as Nn,PW as Hn,fG as Ha,fF as Ma,A$ as Mn,fE as $a,NR as $n,PX as Mt,cl as $t,cM as Gn,O8 as ya,BB as Gt,PY as Tt,Bb as fa,PZ as zt,BC as zn,OB as Qn,BD as Zn,Cx as Yn,tc as Wn,Cr as Kn,P_ as qn,Av as Ze,P$ as Xn,Q0 as Jn,Q1 as er,Q2 as ar,Q3 as tr,Q4 as mt,Q5 as nr,AM as Qt,AF as rr,Q6 as sr,fX as cr,AV as Zt,AZ as Yt,fW as or,Q7 as ir,Bn as Wt,Q8 as dr,Q9 as lr,Qa as ur,AX as Kt,AI as qt,Ao as Xt,AR as Jt,AP as en,AT as mr,Qb as an,Qc as Ga,B8 as ga,KR as tn,cN as Ct,Qd as Cr,Qe as pr,Qf as hr,Qg as fr,B5 as st,Bu as gr,Bq as br,B1 as yr,Bs as Sr,Bi as Ir,Bk as Ar,Qh as nn,BA as Ta,Ie as Er,Qi as kr,Qj as _r,Qk as Dr,Ql as rn,Qm as wr,BX as Pr,Ba as sn,B4 as ve,B9 as vr,Qn as Tr,Qo as Fr,Af as Br,Qp as cn,Qq as on,Qr as xr,Ah as Lr,Ag as Ft,Qs as Rr,Qt as Ur,Qu as Or,KN as jr,Qv as pt,Qw as Vr,wS as dn,ko as Nr,gW as Hr,C0 as Mr,Qx as ln,Qy as $r,C1 as Gr,Qz as zr,de as Qr,tM as Zr,BS as Yr,BM as Ve,bt as Wr,bF as Kr,cx as qr,bG as Xr,J_ as Jr}from"./zeni-epic-state-D9GkJt4v.js";import{z as ee,k as $e,s as oe,d as Q,B as Sa,c4 as za,cf as es,cg as as,ch as ts,v as Re,ci as ns,cj as rs,J as Ia,aN as Le,w as ye,bo as ht,ck as ss,E as Aa,j as Qa,m as ft,c as K,D as gt,a7 as Za,cl as cs,Z as un,aq as bt,bA as ra,cm as ct,cn as os,A as yt,co as is,at as mn,a2 as ot,X as Cn,f as pn,cp as ds,cq as ls,cr as us,cs as ms,ct as Cs,cu as ps,o as Ra,cv as hs,cw as fs,cx as at,x as gs,cy as bs,cz as ys,cA as Ss,cB as Is,cC as As,a9 as Es}from"./index-KKxEmb4f.js";import{n as Te,D as hn,S as ks}from"./mui-DOOgBswz.js";import{a as d}from"./sentry-Na2f7K9i.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as Ge,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as Ye,m as bn,n as ws,o as yn,p as Ps,S as Bt}from"./SetupPagesScreen-DbOwsJcn.js";import{u as Sn}from"./useInitialThreadRequest-C7-YEavN.js";import Ya from"./NotFoundScreen-CrA2LAEq.js";import{M as We}from"./MobileAppDrawer-DIjtpAlT.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-CqIT8mNx.js";import{v as xt}from"./utils-BeAkRe29.js";import{d as vs}from"./recharts-AypxxmWa.js";import{t as Ts}from"./AddressScreen-CughVKg_.js";import"./analytics-BKFxkJXq.js";import"./plaid-DKuuSvS9.js";import"./dnd-CcFi9V4s.js";import"./stripe-DMRn4zHo.js";import"./lottie-qTKXNt7n.js";import"./lexical-BWfctdSX.js";import"./pdf-CyJbH3RK.js";import"./analyticsHelper-C_957RQ-.js";import"./routePaths-CVVAujpk.js";import"./BusinessVerificationPageScreen-B7LMMYY1.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]="be16f730-ecd7-4f2f-9e1c-927e6c734521",e._sentryDebugIdIdentifier="sentry-dbid-be16f730-ecd7-4f2f-9e1c-927e6c734521")}catch{}})();function Fs(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(Y=>de(Y)),f=$e(),p=He(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(Y=>ja(Y).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Q.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:x}=g(Q.isDebitCardFeatureEnabled),F=Ie(n),L=Ae(n),C=Ee(x,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:x,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:y,isBookKeepingTenant:L,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(Y=>Ke(Y,n.companyId)),j=qe(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(Y=>Xe(Y)),B=S(Y=>Y.classListState.fetchState),i=!v&&o&&h,m=S(Y=>lt(Y,a,i,o)),[U,M]=d.useState(!1),R=m.chargeCard,T=R?.cardCreatedByUser?.userId,$=S(Y=>T!=null?Ba(Y.userRoleState,T):void 0),G=$?.accountingClassIDs[0],V=S(Y=>G!=null?xa(Y.classState,{classId:G,reportId:"class_list"}):void 0),w=R?.cardHolderUser?.userId,Z=S(Y=>w!=null?Ba(Y.userRoleState,w):void 0),q=Z?.accountingClassIDs[0],P=S(Y=>q!=null?xa(Y.classState,{classId:q,reportId:"class_list"}):void 0),O=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&O&&(c(!0),setTimeout(()=>{t(La()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,O,te]),d.useEffect(()=>{U||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[U,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(O===!1||O&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const Y=pe(n.tenantEmailDomain,a,r,R,l);e(Y)}},[m.fetchState,l,O]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),B!=="Completed"&&B!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,B]);const ae=()=>{if(r!=null&&a!=null){t(La());const Y=pe(n.tenantEmailDomain,a,r);e(Y)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),X=Ea(o,h,p,E,b),J=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:X,debitAccountInformation:J,chargeCardDetailView:m,creditAccount:E,classListFetchState:B,creditAccountRepayment:b,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:P?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,x]=ts(y);if(x==="")return;const F=n.channel(h),L=u=>{f.current(x,u)};let C;if(F?.subscribed===!0)C=F,C.bind(x,L),l.has(h)||(l.add(h),v()),c.push(()=>{F.unbind(x,L)});else{if(C=F??n.subscribe(h),C.bind(x,L),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(x,L)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Wa="credit-account-balance-updated",Ka="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",Bs="charge-card-department-updated",wn="charge-card-repayment-completed",Pn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),xs=[_a,ka],Ls=he(function(e){const a=Je(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(Un({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(x=>de(x)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Q.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(x=>Je(x)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const x=Re(t.state?.pathnameStackToGoBack),F=x.poppedPathname??Us(n.tenantEmailDomain);e(F,{state:{pathnameStackToGoBack:x.newStack}})},[e,t,n.tenantEmailDomain]),y=Ge(n);if(At({events:ta(y,xs),onEvent:x=>{switch(x){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Ya,{}):s.jsx(Ls,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Us=e=>`/${e}/cards`,Os={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,x]=d.useState(!1),F=ee.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const L=S(P=>de(P));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(Le.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(P=>On(P,n)),o=D.chargeCard,I=S(P=>P.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Q.isDebitCardFeatureEnabled),b=Ee(E,L),B=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,m=L.userRole.includes("charge_card_user"),U=Ie(L),M=Ae(L),R=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=_e({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:R}),$=!m&&T&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,$,T)))},[c,D.fetchState,g,I]);const G=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&(G===!1||G&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==F.userId)){const P=pe(L.tenantEmailDomain,n,F,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);r(P,{state:{pathnameStackToGoBack:O}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const P=pe(L.tenantEmailDomain,n,F,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(P,{state:{pathnameStackToGoBack:O}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),w=S(P=>Nt(P.userState,F.userId)),Z=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(P=>P.statusCode==="success")===!0&&v===!1&&(setTimeout(Z,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const q=P=>{x(P)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(w?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Hs,{children:[s.jsx(We,{isAppContentDrawerOpen:h,handleDrawerToggle:q}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:w.phone,signedInUser:F,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:L,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{q(!0)}}),e!=null?s.jsx(Ns,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Ht(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Nn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Qa.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Hn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Ns=Te.div`
2
- display: flex;
3
- flex-direction: column;
4
- width: ${e=>`${Os.containerWidth.value(e.windowSize)}%`};
5
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
6
- `,Hs=Te.div`
7
- display: flex;
8
- min-height: 100%;
9
- width: 100%;
10
- flex: 1 1 auto;
11
- flex-direction: column;
12
- align-items: center;
13
- background-color: ${e=>e.theme.colors.grey4};
14
- `,Ua=gt.getLocalizedStrings().dateFormat,Ms={overlayWidth:new Aa(100,100,58)},vn=[wn,Wa],$s=new Set(vn),Gs=he(function(e,a){const t=a.currentTenant?.companyId;return{plaidConnectionDetails:Qn(e,t,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Zn(e.depositAccountState,e.depositAccountListState)}},function(e,a){const{navigate:t,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:f,isCashbackInfoFetchStateCompleted:p,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:_,controllerEmails:c,paymentDetails:l,productInformation:v,cashbackInformation:y,paymentSourceInformation:h,creditAccountInformation:x,debitAccountInformation:F,paymentInitiatedDate:L,sourcePage:C}=a,{tenantEmailDomain:u}=r,D=()=>{e(Gt(!0));const o=Ge(r);o!=null&&o!==""&&e(fa(o,!0,!0)),e(Ne(!0))};return{onBackNavigation:()=>{if(p&&g&&_&&y!=null&&K.trackCardsPayEarlyFormClick(c,v,y,"Back",l.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:l.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:l.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:l.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:l.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:L?.add(3,"day").format(Ua.visual.MMMDCommaYYYYformat),paymentInitiatedDate:L?.format(Ua.visual.MMMDCommaYYYYformat)},h,x,F),C==="cardPaymentHistory")a.closeDrawerHandler(!0),e(zt());else{const o=ze(u);t(o)}},onUpdatePaymentAccountStatus:(o,I,A)=>{e(Kn(o,I,"bill_pay","bill_pay_detail",A))},onEstablishConnectionSuccess:()=>{e(fa(r.companyId,!0))},onFetchLinkTokenClick:o=>{e(Wn("external_account",o))},onEstablishConnectionClick:o=>{e(Yn(o,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${u}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{f?window.open(`/${u}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onEventReceived:o=>{$s.has(o)&&D()},onPusherSubscribed:D}})(Za(cs)),wt=({isPaymentDrawerOpen:e,closeDrawerHandler:a,pageName:t,creditAccountSpentAmount:r,productInformation:n,sourcePage:f,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isDebitCardInfoFetchStateCompleted:c,isCreditCardInfoFetchStateCompleted:l,isCashbackInfoFetchStateCompleted:v,paymentInitiatedDate:y,retryRepayment:h})=>{const x=me(),{useDynamicConfig:F}=oe(),{configValue:L}=F(Le.zeniAccountsConfig),C=$n(L),u=S(z=>Mt(z)),{creditAccount:D}=S(z=>Xe(z)),o=S(z=>de(z)),I=ft(),A=Ia(),j=Ce(),E=ee.getSignedInUser(),b=$e(),[B,i]=d.useState(!1),[m,U]=d.useState(!1),{configValue:M}=F(Le.zeniCardsConfig),R=M.credit_card_auto_pay_threshold_by_company_id?.[o.companyId]??M.default_credit_card_auto_pay_threshold??_s,T=$t(b?.loggedInUserRoleMap),$=Gn(b?.loggedInUserRoleMap),G=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=S(z=>ya(z,o.companyId)),w=V.companyChargeCardInfo?.primaryFundingAccount,Z=V.allFundingAccounts.find(z=>z.id===w?.accountId),q=S(z=>Ke(z,o.companyId)),P=qe(q.controllers);d.useEffect(()=>{if(u.fetchState!=="Completed"&&u.fetchState!=="In-Progress"&&j(Gt()),u.fetchState==="Completed"&&!m){const z=o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,X=u.transferFromAccounts.find(Y=>Y.id===z);let J;if(f==="cardPaymentHistory"&&h){const Y=h.paymentAccountId!=null?u.transferFromAccounts.find(re=>re.id===h.paymentAccountId):void 0;J={amount:h.amount,isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:xt(),transferFrom:Y??X}}else J={amount:{amount:D.balance.amount+D.hold.amount,currencyCode:D.balance.currencyCode,currencySymbol:D.balance.currencySymbol},isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:xt(),transferFrom:X};j(Tt(J)),U(!0)}},[u.fetchState,m,f,h,u.transferFromAccounts,o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,o.companyChargeCardInfo?.info?.isAutoPayEnabled,D.balance.amount,D.balance.currencyCode,D.balance.currencySymbol,D.hold.amount,j]);const O={isZeniCheckingEnabled:o.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:Z?.accType==="depositAccount",creditCardPaymentSourceAccountName:Z?.label,creditCardPaymentSourceAccountType:Z?.accType,creditCardPaymentSourceLastFourDigits:Z?.accountLast4,creditCardPaymentSourceBalance:Z?.accountBalance?.available?.amount??0};if(d.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&j(fa(o.companyId,!0))},[V.fetchState]),d.useEffect(()=>{u.updateStatus==="Completed"&&_!=null&&v&&l&&c&&K.trackCardsPayEarlyPayNowClick(P,n,_,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:y?.add(3,"day").format(Ua.visual.MMMDCommaYYYYformat),paymentInitiatedDate:y?.format(Ua.visual.MMMDCommaYYYYformat)},O,p,g)},[u.updateStatus,_,v,l,c,y]),d.useEffect(()=>{u.fetchState==="Completed"&&_!=null&&v&&l&&c&&!B&&e&&m&&_!=null&&(K.trackCardsPayEarlyFormView(P,n,_,t,o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,D.balance.amount,O,p,g),i(!0))},[u,v,l,c,B,e,m]),E==null)throw Error("Can't access invite people page without signing in...");const te=()=>{a(!0),j(zt())},ae=Ge(o),k={events:e?ta(ae,vn):[],eventCallback:(z,X,J)=>{J.onEventReceived(z)},onSubscribed:z=>{z.onPusherSubscribed()}};return s.jsx(s.Fragment,{children:s.jsx(hn,{onClose:()=>{te()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Ms.overlayWidth.valuePercentage(A),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:I.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(zs,{onClick:z=>z.stopPropagation(),children:s.jsx(Gs,{...k,closeDrawerHandler:a,navigate:x,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{v&&l&&c&&_!=null&&K.trackCardsPayEarlyFormClick(P,n,_,"Pay Now",u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},O,p,g),j(zn({companyId:o.companyId}))},onDismissClick:te,onSaveChangesToLocalStore:z=>{j(Tt(z))},currentTenant:o,hasZeniAccountsAdminAccess:T,isZeniAccountsUser:$,isZeniAccountSetupEnabled:G,productInformation:n,sourcePage:f,controllerEmails:P,autoPayThreshold:R,paymentSourceInformation:O,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isCashbackInfoFetchStateCompleted:v,isCreditCardInfoFetchStateCompleted:l,isDebitCardInfoFetchStateCompleted:c,paymentInitiatedDate:y,maxInsuredAmount:C.maxInsuredAmount})})})})},zs=Te(ks)`
15
- display: flex;
16
- min-height: 100%;
17
- flex-direction: column;
18
- `,Pt=e=>e!=null&&typeof e=="object"?e:null,ce=e=>typeof e=="string"?e:void 0,Pe=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Oa=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",tt=e=>{if(e==null||typeof e!="object")return!1;const a=e;return typeof a.transaction_id=="string"&&typeof a.amount=="number"&&typeof a.currency_code=="string"&&typeof a.currency_symbol=="string"&&typeof a.direction=="string"&&!!Oa(a.transaction_status)&&!!Oa(a.transaction_type)},vt=(e,a)=>{const t=e?.card_status;if(!Oa(t))return null;const r=e?.is_locked_by_admin;return{cardId:a,cardStatus:t,isLockedByAdmin:typeof r=="boolean"?r:void 0}},it=[An,En,kn,_n,Dn,aa,Et,Wa,kt,_t,Dt],Tn=[_a,ka],Qs=new Set([...it,...Tn]),nt=gt.getLocalizedStrings().dateFormat,Zs=he(function(e,a){const{includeCreditAccountInfo:t,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:f}=a,p=ee.getSignedInUser(),g=e.tenantState.currentTenantId,_={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:g??""},c=lt(e,r,t,f),l=sr(e,r),v=cr(e);return{chargeCardDetailView:c,chargeCardsRecurringExpensesState:l,vgsVaultId:Qa.cardVaultId,transactionAttachmentsEndpointToFetch:`${ot}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${ot}/card_transaction_attachment`,authParams:_,isSnackbarOpen:v.isSnackbarOpen,cardsEndPoint:`${mn.cardMicroServiceBaseUrl}`,signedInUserToken:c.twoFAView.token??n}},function(e,a){const{cardId:t,currentTenant:r,navigate:n,location:f,cardProviderId:p,includeCreditAccountInfo:g,setIsPaymentOpen:_,controllerEmails:c,productInformation:l,cashbackInformation:v,primaryFundingAccountDetails:y,creditAccountInformation:h,debitAccountInformation:x,isChargeCardFeatureEnabled:F}=a,{tenantEmailDomain:L}=r;return{onEventReceived:(C,u)=>{(({event:D,data:o,cardId:I,dispatch:A,subscribedEvents:j})=>{const E=Pt(o);switch(D){case _a:case ka:return void A(ha(!0));case An:{const b=ce(E?.card_id);if(b==null||b!==I)return;const B=ce(E?.transaction_id),i=E?.transaction_status;return B!=null&&Oa(i)?void A(nr({transactionId:B,transactionStatus:i})):void A(Ze(I,null,null,!0))}case aa:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=vt(E,b);return B!=null?void A(mt(B)):void A(na(I,!0))}case Et:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=ce(E?.currency_code),i=ce(E?.currency_symbol),m=Pe(E?.balance);return B!=null&&i!=null&&m!=null?(A(tr({cardId:b,currencyCode:B,currencySymbol:i,balance:m,hold:Pe(E?.hold),dailyPurchaseSpends:Pe(E?.daily_purchase_spends),monthlyPurchaseSpends:Pe(E?.monthly_purchase_spends),dailyWithdrawals:Pe(E?.daily_withdrawals),monthlyWithdrawals:Pe(E?.monthly_withdrawals)})),void A(Ne(!0))):(A(na(I,!0)),void A(Ne(!0)))}case Wa:{const b=ce(E?.currency_code),B=ce(E?.currency_symbol),i=Pe(E?.available_amount),m=Pe(E?.balance_amount);return b!=null&&B!=null&&i!=null&&m!=null?void A(ar({currencyCode:b,currencySymbol:B,available:i,balance:m,hold:Pe(E?.hold_amount),cashback:Pe(E?.cashback_amount)})):void A(Ne(!0))}case En:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=E?.transaction;return tt(B)?void A(er({cardId:b,transaction:B})):void A(Ze(I,null,null,!0))}case kn:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=E?.transaction;return tt(B)?void A(Jn({cardId:b,declineReason:ce(E?.decline_reason),transaction:B})):void A(Ze(I,null,null,!0))}case _n:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=E?.transaction;return tt(B)?void A(Xn({cardId:b,transaction:B})):void A(Ze(I,null,null,!0))}case Dn:{const b=ce(E?.card_id)??I;if(b!==I)return;const B=ce(E?.transaction_id),i=E?.attachment_file_paths;return B!=null&&Array.isArray(i)&&i.every(m=>typeof m=="string")?void A(qn({cardId:b,transactionId:B,attachmentFilePaths:i})):void A(Ze(I,null,null,!0))}case kt:case _t:case Dt:{const b=ce(E?.card_id);if(b==null||b!==I)return;A(na(I,!0))}}})({event:C,data:u,cardId:t,dispatch:e,subscribedEvents:Qs})},onPusherSubscribed:()=>{e(na(t,!0)),e(Ze(t,null,null,!0)),e(Ne(!0))},onReloadTransactions:()=>{e(ca(t,g,F))},onFetchChargeCardTransactionList:(C,u)=>{e(Ze(t,C,u))},onUpdateScrollYOffset:C=>{},onGetOtp:C=>{p!=null&&e($a(C,"ChargeCardHolder",t))},onResendOtp:C=>{p!=null&&e(Ma(C,"ChargeCardHolder",t))},onVerifyOtp:(C,u)=>{p!=null&&e(Ha(C,u,"ChargeCardHolder",t))},onVerifyOtpSuccess:C=>{C!=null&&ee.saveZeniOtpTokenForCardHolder(C,t)},onColorCodeChange:C=>{e(mr(t,C))},onLockChargeCard:(C,u)=>{e(en(C,t,u))},onUnlockChargeCard:C=>{e(Jt(C,t))},onCloseChargeCard:C=>{e(Xt(t,C))},onFetchChargeCardsRecurringExpenses:()=>{e(qt([t]))},updateChargeCardName:(C,u)=>{e(Kt(C,t,u))},updateChargeCardTransactionAttachments:(C,u)=>{u!=null&&e(ur({transactionId:C,data:u}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(C,u,D,o)=>{e(lr({chargeCardId:u,transactionId:C,fetchState:D,error:o}))},updateChargeCardTransactionReceiptsShowTick:(C,u,D)=>{e(dr({chargeCardId:u,transactionId:C,shouldShowTick:D}))},onChargeCardRevokeInviteClick:()=>{e(Wt(t))},updateChargeCardTransactionIsViewReceiptClicked:(C,u,D)=>{e(ir({chargeCardId:u,transactionId:C,isViewReceiptClicked:D}))},onChargeCardTransactionRowClick:(C,u)=>{const D=ye(f.state?.pathnameStackToGoBack,f.pathname);n(`../../transaction/${C}/${u}`,{state:{pathnameStackToGoBack:D}})},onBackClick:()=>{const C=Re(f.state?.pathnameStackToGoBack),u=ze(L);n(u,{state:{pathnameStackToGoBack:C.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(or())},onUpdateDebitCardPinAttempt:C=>{e(Yt(t,C)),C==="success"&&e(pa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(C,u)=>{C?e(pa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):u!=null&&e(pa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:u.message}]}))},updateSpendLimit(C,u,D,o){e(Zt(C,u,D.code,o))},shouldOpenCreditCardPaymentDrawer(C){C&&v!=null&&K.trackCardsPayEarlyClick(c,l,v,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:y?.accType==="depositAccount",creditCardPaymentSourceAccountName:y?.label,creditCardPaymentSourceAccountType:y?.accType,creditCardPaymentSourceLastFourDigits:y?.accountLast4,creditCardPaymentSourceBalance:y?.accountBalance?.available?.amount??0},h,x),_(C)}}})(Za(is));function Ys(){const e=me(),a=Ce(),t=Se(),{cardId:r}=ba(),[n,f]=d.useState(!1),[p,g]=d.useState(!1),{useDynamicConfig:_}=oe(),c=ee.getSignedInUser(),l=S(H=>de(H)),v=S(H=>ja(H).firstViewAfterActivation),y=S(H=>H.classListState.fetchState),{configValue:h}=_(Le.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:x}=_(Le.zeniCardsConfig),F=x.enable_card_controls_for_company_ids,L=x.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(l.companyId),[C,u]=d.useState(!1),[D,o]=d.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:A}=I(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=I(Q.isDebitCardFeatureEnabled),E=Ee(j,l),b=ke({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:E}),{isFeatureEnabled:B}=I(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=I(Q.isCardsCommentingEnabled),m=Ae(l),U=Ie(l),M=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=_e({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:A,isBookKeepingTenant:m,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:M}),T=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!l.companyChargeCardInfo?.info?.isChargeCardEnabled,G=!l.userRole.includes("charge_card_user")&&R&&$;if(r==null)throw Error("Empty card id is not valid...");const V=S(H=>ya(H,l.companyId)),{creditAccount:w,creditAccountRepayment:Z}=S(H=>Xe(H)),q=ee.getZeniOtpTokenForCardHolder(r),P=S(H=>lt(H,r,G,R)),{isAiCfoAccessEnabled:O,onAskAiCfoClick:te}=In({mobileExploreReferrer:"Card Detail"});un({isDataReady:P.fetchState==="Completed"});const ae=S(H=>Je(H)),k=P.chargeCard,z=$e(),X=He(z?.loggedInUserRoleMap),J=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_virtual_debit_card",Y=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_physical_credit_card",re=k?.type.code==="business_virtual_debit_card"||k?.type.code==="business_virtual_credit_card",De=k?.type.code==="business_virtual_debit_card",Ue=Ea(R,$,X,w,Z),W=fn(J,P),fe=St(X,ae),we=Me(R,b,T,$),Oe=P.depositAccountLimitFetchState.fetchState!=="Completed"&&P.depositAccountLimitFetchState.fetchState!=="In-Progress",Fe=S(H=>Ke(H,l.companyId)),Be=qe(Fe.controllers),ne=S(H=>k?.cardCreatedByUser?.userId!=null?Ba(H.userRoleState,k?.cardCreatedByUser?.userId):void 0),Da=S(H=>ne?.accountingClassIDs[0]!=null?xa(H.classState,{classId:ne?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=S(H=>k?.cardHolderUser?.userId!=null?Ba(H.userRoleState,k?.cardHolderUser?.userId):void 0),oa=S(H=>ie?.accountingClassIDs[0]!=null?xa(H.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),le=l?.userRole,je=S(H=>ea(H,!1,b,A).revokeCardInvite),ia=bt(je.saveStatus.fetchState);if(d.useEffect(()=>{if(ia==="In-Progress"&&je.saveStatus.fetchState==="Completed"){const H=ze(l.tenantEmailDomain);e(H)}},[ia,je.saveStatus.fetchState,e,l.tenantEmailDomain]),d.useEffect(()=>{v&&n===!1&&re&&(f(!0),setTimeout(()=>{a(La()),De&&a(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[v,n,re,De]),d.useEffect(()=>{C||P.fetchState==="Completed"||P.fetchState==="In-Progress"||r==null||(u(!0),a(ca(r,G,R,!1)))},[C,P,r,a]),d.useEffect(()=>{!D&&P.fetchState==="Completed"&&P.chargeCard?.connectedAccountId!=null&&J&&Oe&&X&&(o(!0),a(Qt({depositAccountId:P.chargeCard?.connectedAccountId})))},[D,P,a,Oe,X]),d.useEffect(()=>{ae.fetchState!=="Completed"&&ae.fetchState!=="In-Progress"&&X&&a(ha()),y!=="Completed"&&y!=="In-Progress"&&a(Vt()),P.transactionStatistics.fetchState!=="Completed"&&P.transactionStatistics.fetchState!=="In-Progress"&&a(rr({chargeCardId:r})),V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&a(fa(l.companyId,!0))},[ae.fetchState,a,X,y,P.transactionStatistics.fetchState,V.fetchState]),d.useEffect(()=>{if(!(P.fetchState!=="Completed"||R&&w.fetchState!=="Completed"||k==null||P.transactionStatistics.fetchState!=="Completed"||J&&X&&P.depositAccountLimitFetchState.fetchState!=="Completed")){const H=k.type.code.includes("physical"),ue=H?k.cardActivationAttemptHistory[0]?.timestamp:k.createTime;K.trackCardsCardDetailView(Be,we,{cardId:r,cardName:k.cardName,cardType:k.type.code.includes("credit")?"credit":"debit",cardCategory:H?"physical":"virtual",cardLimit:ra(k.limit.amount),cardLastFourDigits:k.accountLast4,cardStatus:k.status.code,cardAssignedDate:k.createTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:k.providerCardCreateTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:ue?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:k.creditLimitFrequency.name,cardSpentAmount:ra(k.balance.amount),cardAvailableLimit:ra(k.available.amount),cardUtilizationPercent:k.limit.amount>0?Math.round((k.limit.amount-k.available.amount)/k.limit.amount*100):0,cardUtilizationAmount:ra(k.limit.amount-k.available.amount),totalNumberOfDeclinedTransactions:P.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:P.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:P.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:P.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:P.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:P.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:P.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:ct(k.cardCreatedByUser,!1),cardIssuedByEmail:k.cardCreatedByUser?.email,cardIssuedByUserId:k.cardCreatedByUser?.userId,cardIssuedByRole:ne?.userRoles,cardIssuedByDepartment:Da?.className},{cardholderName:ct(k.cardHolderUser,!1),cardholderEmail:k.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:k.cardHolderUser?.userId,cardholderDepartment:oa?.className},Ue,W)}},[P.fetchState,P.depositAccountLimitFetchState.fetchState,P.transactionStatistics.fetchState,w.fetchState,X]),c==null)throw Error("Can't access card detail page without signing in...");const da=Ge(l),la=X?[...it,...Tn]:it,ua={events:ta(da,la),eventCallback:(H,ue,xe)=>{xe.onEventReceived(H,ue)},onSubscribed:H=>{H.onPusherSubscribed()}},ma=()=>{if(r!=null&&k!=null){const{ownerName:H,cardName:ue,utilisation:xe,limit:Qe,frequency:N,cardColor:ge}=rt(k),be=k.cardHolderUserId===c.userId;K.trackCardsDetailPageViewed(r,H,ue,xe,Qe,N,ge,be)}};d.useEffect(()=>{if(P.fetchState==="Completed"){const H=P.chargeCard;if(H?.status.code==="inactive"||J&&H?.isPinSet===!1||Y&&v){const ue=pe(l.tenantEmailDomain,r,c,k,v);e(ue)}}},[P.fetchState]);const Ca=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:xe,cardName:Qe,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;K.trackCardsDetailPageClicked(r,xe,Qe,N,ge,be,H,et,ue)}},qa=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:xe,cardName:Qe,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;K.trackCardsVerifyPopUpClick(r,xe,Qe,N,ge,be,H,et,ue)}},wa=w.balance.amount+w.hold.amount,Pa=l.companyChargeCardInfo?.info?.primaryFundingAccount,Xa=V.allFundingAccounts.find(H=>H.id===Pa?.accountId),va=P.chargeCard!=null,Ja=P.depositAccountLimit!=null;return P.fetchState!=="Error"||va?!va&&(P.fetchState==="In-Progress"||P.fetchState==="Not-Started")||je.saveStatus.fetchState==="In-Progress"||!Ja&&J&&X&&P.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(os,{}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:v}),P.fetchState==="Completed"?s.jsx(yt,{analytics:K,onLoad:ma}):null,p===!0?s.jsx(wt,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:p,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:we,creditAccountInformation:Ue,debitAccountInformation:W,cashbackInformation:fe,creditAccountSpentAmount:wa,isDebitCardInfoFetchStateCompleted:!J||!X||P.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!R||w.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!X||ae.fetchState==="Completed",paymentInitiatedDate:Z.initiatedRepaymentDate}):null,s.jsx(Zs,{...ua,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:qa,onFireOnClickAnalytics:Ca,isSandboxEnv:ht(),signedInUser:c,location:t,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ne?.userRoles,cardIssuedByDepartmentName:Da?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:oa?.className,loggedInUserRole:le,isChargeCardFeatureEnabled:R,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:$,isCardControlsEnabled:L,isEarlyPayEnabled:B,controllerEmails:Be,chargeCardCashbackDetailState:ae,productInformation:we,creditAccountInformation:Ue,debitAccountInformation:W,cashbackInformation:fe,classListFetchState:y,primaryFundingAccountDetails:Xa,currentTenant:l,cardProviderId:P.chargeCard?.cardProviderID,cardId:r,creditAccount:w,creditAccountRepayment:Z,includeCreditAccountInfo:G,signedInUserToken:q,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:O,onAskAiCfoClick:te,isCardsCommentingEnabled:i})]}):s.jsx(Ya,{})}const rt=e=>{const a=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,t=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,f=e.creditLimitFrequency.name;return{ownerName:a,cardName:t,utilisation:r,cardColor:e.cardColorCode??"",frequency:f,limit:n}},Fn=[aa,Wa,Pn,ka,_a,Ka,Dt,Bs,kt,_t,Et],Ws=new Set(Fn),dt=vs((e,a,t,r)=>{e(ga(a,t,r,!0))},400),Ks=Te.div`
19
- display: flex;
20
- width: 100%;
21
- flex: 1 1 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,qs=he(function(e,a){const t=ea(e,a.includeCreditAccountDebitSummaryAndCashbackInfo,a.isDebitCardFeatureEnabled&&a.isDebitCardSetupEnabled,a.isChargeCardFeatureEnabled&&a.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:Cr(e),bulkActionView:pr(e),companyLegalName:a.currentTenant.companyName,admins:a.admins,searchText:t.searchText,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigateAndClearBulkSelection:t,currentTenant:r,location:n,signedInUser:f,chargeCardListState:p,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:_,isCreditCardProductVisibleForExpressInterest:c,isChargeCardSetupEnabled:l,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:y,isDebitCardTOSAccepted:h,isChargeCardTOSAccepted:x,controllerEmails:F,depositAccountListWithDebitCardIssued:L,primaryFundingAccountDetails:C,chargeCardSetUpViewFetchState:u,productInformation:D,cashbackInformation:o,creditAccountInformation:I,debitAccountInformation:A,updatePayNowInfoTooltip:j,isUserHasCardsAdminLevelAccess:E}=a,{tenantEmailDomain:b}=r,{cards:B}=p;return{onChargeCardRowClick:(i,m)=>{const U=bn(B,i);let M;U!=null&&((T=>{const $=T.limit.amount-T.available.amount,G=`${T.cardHolderUser?.firstName.toLowerCase()} ${T.cardHolderUser?.lastName.toLowerCase()}`,V=T.cardName,w=T.department?.className??"",Z=T.limit.amount,q=T.creditLimitFrequency.name;K.trackCardsListRowClicked(G,V,w,$,Z,q,f.userId===T.cardHolderUserId)})(U),Ye(v,y,L)&&K.trackCardsCardListRowClick(F,D,"Card Row Item","row_clicked",m+1,{cardOwner:ct(U.cardHolderUser,!1),cardName:U.cardName,cardType:U.type.code.includes("credit")?"credit":"debit",cardStatus:U.status.code,cardUtilizationAmount:ra(U.limit.amount-U.available.amount),cardUtilizationPercent:U.limit.amount>0?Math.round((U.limit.amount-U.available.amount)/U.limit.amount*100):0,cardLimit:ra(U.limit.amount)},o,I,A)),M=U?.status.code==="request_on_hold"&&f.userId===U.cardHolderUserId?yn(b):pe(b,i,f,U);const R=ye(n.state?.pathnameStackToGoBack,n.pathname);t(M,{state:{pathnameStackToGoBack:R}})},onFetchChargeCardsRecurringExpenses:i=>{e(qt(i))},onFetchDepositAccountLimit:i=>{e(Qt({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Ar(i))},onChargeCardRevokeInviteClick:i=>{e(Wt(i))},onLockChargeCardList:(i,m)=>{e(Ir(i,m))},onUnlockChargeCardList:i=>{e(Sr(i))},onCloseChargeCardList:(i,m)=>{e(yr(i,m))},onRevokeChargeCardList:i=>{e(br(i))},updateChargeCardListSpendLimit(i,m,U){e(gr(i,m,U.code))},onLockChargeCard:(i,m)=>{e(en(E,i,m))},onUnlockChargeCard:i=>{e(Jt(E,i))},onCloseChargeCard:(i,m)=>{e(Xt(i,m))},onUpdateSpendLimit(i,m,U,M){e(Zt(i,m,U.code,M))},updateChargeCardName:(i,m)=>{e(Kt(E,i,m))},onClickSetupIcon:()=>{K.trackCardsListPageClicked("settings"),Ye(v,y,L)&&o!=null&&K.trackCardsSettingsClick(F,D,o,I,A);const i=ws(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onIssueCardClick:()=>{K.trackCardsListPageClicked("new card"),Ye(v,y,L)&&o!=null&&K.trackCardsNewCardClick(F,D,o,"New Button","card_creation_initiated","Card List",I,A);const i=Xs(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onColumnSortConfigChanged:(i,m)=>{Ye(v,y,L)&&o!=null&&K.trackCardsCardListSortClick(F,D,o,"Sort Icon","sort",i,m==="ascending"?"ASC":"DESC","Cards List",I,A),e(st({uiState:{sortKey:i,sortOrder:m}}))},onSearchTextChanged:i=>{e(fr(i))},onReloadCards:()=>{e(ga(g,v&&y,_&&l,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{Ye(v,y,L)&&o!=null&&K.trackCardsCashbackOverviewClick(F,D,o,"Cashback Overview","cashback_details_viewed",I,A),t("./cashback")},onClickStatementsIcon:()=>{Ye(v,y,L)&&o!=null&&K.trackCardsStatementsClick(F,D,o,I,A),t("./statements")},onCreateNowClick:i=>{Ye(v,y,L)&&o!=null&&K.trackCardsNewCardClick(F,D,o,"Promo Banner","card_creation_initiated","Card List",I,A),t(`./new?cardType=${i}`)},onPromoCardClick:i=>{t(i==="debit"&&v&&!h||i==="credit"&&c&&!x?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,m)=>{u==="Completed"&&r.company!=null&&o!=null&&K.trackCardsPayEarlyClick(F,D,o,"Card List",i,m,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:C?.accType==="depositAccount",creditCardPaymentSourceAccountName:C?.label,creditCardPaymentSourceAccountType:C?.accType,creditCardPaymentSourceLastFourDigits:C?.accountLast4,creditCardPaymentSourceBalance:C?.accountBalance?.available?.amount??0},I,A);const U=Js(b);t(U)},navigateToCreditCardPaymentHistoryPage:()=>{const i=ec(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},shouldShowPayNowInfoTooltip:j,onSetRowActionCardId:i=>{e(hr(i))},onSetBulkActionCardIds:i=>{e(an(i))},onEventReceived:i=>{Ws.has(i)&&dt(e,g,v&&y,_&&l)},onPusherSubscribed:()=>{dt(e,g,v&&y,_&&l)}}})(Za(ds));function Lt({isPaymentDrawerOpen:e}){const a=me(),t=Ce(),r=Se(),n=d.useCallback((N,ge)=>{t(an([])),a(N,ge)},[t,a]),[f,p]=d.useState(!1),[g,_]=d.useState(ee.getPayNowInfoTooltip()??!1),c=N=>{ee.savePayNowInfoTooltip(N),_(N)},[l,v]=d.useState(!1),y=ee.getSignedInUser(),h=S(N=>de(N)),[x,F]=d.useState(!1),[L,C]=d.useState(!1),{isAiCfoAccessEnabled:u,onAskAiCfoClick:D}=In({mobileExploreReferrer:"Cards"}),o=h.userRole.includes("charge_card_user"),I=!o,A=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:j,useDynamicConfig:E}=oe(),{isFeatureEnabled:b}=j(Q.isCashbackFeatureEnabled),{isFeatureEnabled:B}=j(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=j(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=j(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:U}=j(Q.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:M}=j(Q.isCardsCommentingEnabled),R=Ee(i,h),T=ke({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:R}),$=Ie(h),G=Ae(h),V=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=_e({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:B,isBookKeepingTenant:G,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:V}),Z=gn({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:B,isBookKeepingTenant:G}),{configValue:q}=E(Le.zeniCardsConfig),P=$e(),O=He(P?.loggedInUserRoleMap),te=S(N=>Ke(N,h.companyId)),ae=qe(te.controllers),k=q.charge_card_cashback_rate_per_transaction!=null?q.charge_card_cashback_rate_per_transaction:.0175,z=q.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??q.default_credit_card_pay_now_threshold??Ds,X=q.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(q.enable_card_controls_for_company_ids)&&q.enable_card_controls_for_company_ids.includes(h.companyId),J=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Y=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,De=S(N=>Mt(N)),Ue=bt(De.updateStatus),W=S(N=>ea(N,I,T&&A,w&&re)),fe=W.cards.filter(N=>N.type.code.includes("debit")).map(N=>N.connectedAccountId),we=[...new Set(fe)],Oe=S(N=>Je(N)),Fe=S(N=>Ga(N,we)),Be=S(N=>ya(N,h.companyId)),ne=Be.companyChargeCardInfo?.primaryFundingAccount,Da=Be.allFundingAccounts.find(N=>N.id===ne?.accountId),ie=W.fetchState,oa=W.creditAccount;un({isDataReady:ie==="Completed"});const{creditAccountRepayment:le}=S(N=>Xe(N)),je=S(N=>ja(N).firstViewAfterActivation),{areTenantIdsInSync:ia}=Cn(),da=St(O,Oe),la=Ea(w,re,O,oa,le),ua=It(T,A,O,Fe,W.debitCardSummary),ma=Me(w,T,A,re),Ca=W.creditAccount.balance.amount+W.creditAccount.hold.amount;if(d.useEffect(()=>{ie==="Completed"&&(ee.getPayNowInfoTooltip()==null||Ca<z*W.creditAccount.limit.amount/100)&&c(!0)},[ie,z,Ca,W.creditAccount.limit.amount]),d.useEffect(()=>{if(e!=null&&e===!0&&le.initiatedRepayments.amount===0&&le.fetchState==="Completed"||Ue==="In-Progress"&&De.updateStatus==="Completed")c(!1),p(!0);else if(le.initiatedRepayments.amount>0&&le.fetchState==="Completed"){p(!1),document.body.style.overflow="auto";const N=ze(h.tenantEmailDomain);n(N)}},[e,le.initiatedRepayments.amount,le.fetchState,Ue,De.updateStatus,n,h.tenantEmailDomain]),d.useEffect(()=>{!x&&(re||A)&&ia&&(F(!0),t(ga(I,T&&A,w&&re,!1)))},[x,I,t,ia]),d.useEffect(()=>{je&&l===!1&&(v(!0),setTimeout(()=>{t(La())},5e3))},[je,l]),d.useEffect(()=>()=>{dt.flush()},[]),d.useEffect(()=>{ie==="Completed"&&o&&W.cards.length===1&&(W.cards[0].status.code==="inactive"&&W.cards[0].type.code==="business_physical_credit_card"?n(`./${W.cards[0].id}/activate`):W.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${W.cards[0].id}`)))},[ie,o,r.state,n,W.cards]),d.useEffect(()=>{if(ie==="Completed"&&o){const N=W.cards.length,ge=W.cards.filter(be=>be.cardHolderUserId===y?.userId).filter(be=>be.status.code==="request_on_hold");ge.length>0&&N===ge.length&&n("./onboard")}},[ie,W.cards,o,n,y?.userId]),d.useEffect(()=>{ie!=="Completed"||w&&le.fetchState!=="Completed"||T&&A&&O&&Fe.fetchState!=="Completed"||K.trackCardsCardListView(ae,ma,da,la,ua)},[ie,oa,le.fetchState,Fe.fetchState,O]),y==null)throw Error("Can't access charge card list page without signing in...");const qa=S(N=>tn(N.userState,N.userRoleState,N.userListViewState,"cardAdmin")),wa=Ct(P?.loggedInUserRoleMap),Pa=N=>{C(N)},Xa=W.creditAccount.limit,va=()=>{p(!1),n("..")},Ja=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:w,isTOSAccepted:J,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:O,isUserHasCardsAccess:wa}),H=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:T,isTOSAccepted:Y,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:O,isUserHasCardsAccess:wa}),ue=Ja||H,xe=Ge(h),Qe={events:ta(xe,Fn),eventCallback:(N,ge,be)=>{be.onEventReceived(N)},onSubscribed:N=>{N.onPusherSubscribed()}};return re||A?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:K,onLoad:()=>{K.trackPageLoaded(pn.Event.cardsListPage),(w&&!re||T&&!A)&&K.trackCardsPromoView(ae,{isCreditCardOffered:w,isDebitCardOffered:T,isDebitCardEnabled:A,isCreditCardEnabled:re},"Banner",T&&!A?"Debit Card":w&&!re?"Credit Card":"","Card List")}}),s.jsx(za,{showConfetti:je})]}):null,f===!0?s.jsx(wt,{closeDrawerHandler:va,isPaymentDrawerOpen:f,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ca,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isDebitCardInfoFetchStateCompleted:!(T&&A&&O)||Fe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!w||le.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!O||Oe.fetchState==="Completed",paymentInitiatedDate:le.initiatedRepaymentDate}):null,s.jsxs(Ks,{children:[s.jsx(We,{isAppContentDrawerOpen:L,handleDrawerToggle:Pa}),s.jsx(qs,{...Qe,isCashbackFeatureEnabled:b,isChargeCardFeatureEnabled:w,isDebitCardFeatureEnabled:T,isCreditCardProductVisibleForExpressInterest:Z,updatePayNowInfoTooltip:c,showPayNowInfoTooltip:g,creditCardPayNowThreshold:z,signedInUser:y,chargeCardListState:W,location:r,admins:qa.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:X,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:O,includeCreditAccountDebitSummaryAndCashbackInfo:I,onClickMenuIcon:()=>{Pa(!0)},creditLimit:Xa,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:A,isEarlyPayEnabled:m,isChargeCardPaymentHistoryFeatureEnabled:U,cashbackRate:k,controllerEmails:ae,chargeCardCashbackDetailState:Oe,depositAccountListWithDebitCardIssued:Fe,isChargeCardTOSAccepted:J,isDebitCardTOSAccepted:Y,primaryFundingAccountDetails:Da,chargeCardSetUpViewFetchState:Be.fetchState,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isAiCfoAccessEnabled:u,onAskAiCfoClick:D,isCardsCommentingEnabled:M})]})]}):(J||Y)&&O===!0?s.jsx(Fa,{to:"../setup"}):ue?s.jsx(Fa,{to:"../promo"}):s.jsx(Sa,{fetchState:ie})}const Xs=e=>`/${e}/cards/new`,Js=e=>`/${e}/cards/payment`,ec=e=>`/${e}/cards/payment-history`,Bn=[wn,Pn],ac=new Set(Bn),tc=he(function(e){const a=ee.getSignedInUser(),t=de(e),r=e.tenantState.currentTenantId,n=nn(e),f={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:r??""},p=t?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:Er(t),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:f,companyName:p,spendManagementEndPoint:`${ot}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,a){const{location:t,navigate:r}=a;return{onBackClick:()=>{const n=Re(t.state?.pathnameStackToGoBack),f=n.poppedPathname??"..";r(f,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,f)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:f}}})},onFiltersChange:n=>{e(_r({filters:n}))},onReloadPayments:()=>{e(Ta(!0))},onEventReceived:n=>{ac.has(n)&&e(Ta(!0))},onPusherSubscribed:()=>{e(Ta(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(kr({uiState:{downloadState:n}}))}}})(Za(ls));function nc(){const e=me(),a=Se(),t=Ce(),{areTenantIdsInSync:r}=Cn(),{useFeatureGate:n}=oe();if(ee.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const f=S(k=>de(k)),p=S(k=>nn(k)),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,x]=d.useState(null),F=!f.userRole.includes("charge_card_user"),L=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:C}=n(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Q.isDebitCardFeatureEnabled),D=Ee(u,f),o=ke({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:D}),I=Ie(f),A=Ae(f),j=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=_e({isCardsOnlyTenant:I,isChargeCardFeatureEnabled:C,isBookKeepingTenant:A,isDebitCardProductVisible:o,chargeCardsCreditAccountLimit:j}),b=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,B=$e(),i=He(B?.loggedInUserRoleMap),m=S(k=>ea(k,F,o&&L,E&&b)),U=d.useMemo(()=>{const k=m.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(k.map(z=>z.connectedAccountId))]},[m.cards]),M=S(k=>Je(k)),R=S(k=>Ga(k,U)),{creditAccountRepayment:T}=S(k=>Xe(k)),$=d.useMemo(()=>St(i,M),[i,M]),G=d.useMemo(()=>Ea(E,b,i,m.creditAccount,T),[E,b,i,m.creditAccount,T]),V=d.useMemo(()=>It(o,L,i,R,m.debitCardSummary),[o,L,i,R,m.debitCardSummary]),w=d.useMemo(()=>Me(E,o,L,b),[E,o,L,b]),Z=m.creditAccount.balance.amount+m.creditAccount.hold.amount,q=d.useMemo(()=>h!=null?p.repaymentHistory.find(k=>k.cardRepaymentId===h):void 0,[h,p.repaymentHistory]),P=d.useCallback(k=>{x(k),t(ga(F,o&&L,E&&b,!1)),y(!0)},[t,F,o,L,E,b]),O=d.useCallback(()=>{y(!1),x(null),document.body.style.overflow="auto"},[]);d.useEffect(()=>{g||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(_(!0),t(Ta()))},[g,t,p.fetchState]),d.useEffect(()=>{!c&&(b||L)&&r&&(l(!0),t(ga(F,!1,E&&b,!1)))},[c,b,L,r,t,F,E]);const te=Ge(f),ae={events:ta(te,Bn),eventCallback:(k,z,X)=>{X.onEventReceived(k)},onSubscribed:k=>{k.onPusherSubscribed()}};return s.jsxs(s.Fragment,{children:[v?s.jsx(wt,{closeDrawerHandler:O,isPaymentDrawerOpen:v,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:Z,productInformation:w,creditAccountInformation:G,debitAccountInformation:V,cashbackInformation:$,isDebitCardInfoFetchStateCompleted:!(o&&L&&i)||R.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||T.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||M.fetchState==="Completed",paymentInitiatedDate:T.initiatedRepaymentDate,retryRepayment:q}):null,s.jsx(tc,{...ae,location:a,navigate:e,accountInfoByAccountId:p.accountInfoByAccountId,onRetryPaymentClick:P})]})}const Rt=Te.div`
26
- display: flex;
27
- height: 100vh;
28
- width: 100%;
29
- flex: 1 1 auto;
30
- flex-direction: column;
31
- overflow: auto;
32
- align-items: center;
33
- background-color: ${e=>e.theme.colors.grey4};
34
- `,Ut=gt.getLocalizedStrings().months;function rc(){const e=me(),a=Ce(),t=Se(),{creditAccount:r,creditAccountRepayment:n}=S(w=>Xe(w)),f=`${mn.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[p,g]=d.useState(!1),[_,c]=d.useState(!1),l=S(w=>Dr(w)),{useFeatureGate:v}=oe(),y=S(w=>de(w)),{isFeatureEnabled:h}=v(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=v(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=v(Q.isCardsCommentingEnabled),L=Sn(F?y.companyId:void 0,{clearParams:F&&l.fetchState==="Completed"}),C=Ee(x,y),u=ke({isDebitCardFeatureEnabled:x,isBankingOnlyTenant:C}),D=Ie(y),o=Ae(y),I=y.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=_e({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:h,isBookKeepingTenant:o,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:I}),j=!!y.companyDebitCardInfo?.info?.isDebitCardEnabled,E=!!y.companyChargeCardInfo?.info?.isChargeCardEnabled,b=S(w=>Ke(w,y.companyId)),B=qe(b.controllers),i=S(w=>rn(w)),m=i.cards.filter(w=>w.type.code.includes("debit")).map(w=>w.connectedAccountId),U=[...new Set(m)],M=S(w=>Ga(w,U)),R=S(w=>wr(w));d.useEffect(()=>{_||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),a(Ne()))},[p,a,r.fetchState]),d.useEffect(()=>{_||r.fetchState!=="Completed"||r.id==null||l.fetchState==="Completed"||l.fetchState==="In-Progress"||(c(!0),a(Pr(r.id)))},[_,a,r.fetchState,r.id,l.fetchState]),d.useEffect(()=>{M.fetchState!=="Completed"&&M.fetchState!=="In-Progress"&&u&&j&&a(sn()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a(ve()),R.fetchState!=="Completed"&&R.fetchState!=="In-Progress"&&u&&j&&a(vr()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&A&&E&&a(ut())},[M.fetchState,u,j,i.fetchState,R.fetchState,n.fetchState,A,E]),d.useEffect(()=>{if(l.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&i.fetchState==="Completed"&&(!u||!j||M.fetchState==="Completed"&&R.fetchState==="Completed")){let w="",Z="";if(l.statements.length>0){const te=l.statements[l.statements.length-1].period,[ae,k]=te.split("-"),z=l.statements[0].period,[X,J]=z.split("-");w=`${Ut[parseInt(k)-1]} ${ae}`,Z=`${Ut[parseInt(J)-1]} ${X}`}const q=Me(A,u,j,E),P=Ea(A,E,!0,r,n),O=It(u,j,!0,M,R);K.trackCardsCreditCardStatementsView(B,q,{numberOfStatements:l.statements.length,oldestStatementMonthYear:w,latestStatementMonthYear:Z},P,O)}},[l.fetchState,r.fetchState,n.fetchState,M.fetchState,i.fetchState,R.fetchState]);const T=()=>{const w=Re(t.state?.pathnameStackToGoBack),Z=w.poppedPathname??"..";e(Z,{state:{pathnameStackToGoBack:w.newStack}})},$=S(w=>Je(w)),G=ee.getSignedInUser(),V={userId:G?.userId??"",sessionId:G?.zeniSessionId??"",tenantId:y.tenantId??""};if(G==null)throw Error("Can't access address page without signing in...");if(l.fetchState!=="Completed")return s.jsx(Rt,{children:s.jsx(us,{onBackClick:T})});{const w=Me(A,u,j,E);return s.jsx(Rt,{children:s.jsx(ms,{currentTenantCompanyName:y.companyName,statementListView:l,productInformation:w,onBackClick:T,authParams:V,controllerEmails:B,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:E,isCardsCommentingEnabled:F,initialOpenThreadRequest:L,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:M,debitCardSummary:R,downloadEndPoint:f})})}}const xn=[aa,Ka],sc=new Set(xn),cc={containerWidth:new Aa(100,58)},oc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),n=Se(),{useDynamicConfig:f}=oe(),[p,g]=d.useState(!1),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),x=d.useRef(!1),F=d.useRef(null);d.useEffect(()=>()=>{F.current!=null&&(clearTimeout(F.current),F.current=null)},[]);const[L,C]=d.useState(!1),[u,D]=d.useState(!1),o=ee.getSignedInUser();if(o==null)throw Error("Can't access onboarding card page without signing in...");const I=S(O=>de(O)),{configValue:A}=f(Le.zeniCardsConfig),j=S(O=>Tr(O)),{tenantEmailDomain:E}=I,b=S(O=>O.settingsViewState.profile.fetchState),B=S(O=>O.chargeCardListState.fetchState),i=S(O=>O.settingsViewState.profile.userId),m=S(O=>O.chargeCardConfigState.fetchState);d.useEffect(()=>{p===!1&&b!=="In-Progress"&&b!=="Completed"&&(t(Fr()),g(!0)),_===!1&&m!=="In-Progress"&&m!=="Completed"&&(t(Va()),c(!0)),l===!1&&B==="Not-Started"&&(v(!0),t(ve()))},[p,l,B,_,m]),d.useEffect(()=>{b==="Completed"&&L===!1&&i!=null&&B==="Completed"&&j.cards.length>0&&(t(Br({userId:i})),t(cn({cardId:j.cards[j.cards.length-1].id})),C(!0))},[b,L,i,B]),d.useEffect(()=>{if(!y&&j.fetchState==="Completed"&&j.cards.length===0){const O=Re(n.state?.pathnameStackToGoBack),te=O.poppedPathname??ze(E);r(te,{state:{pathnameStackToGoBack:O.newStack}})}},[j.fetchState,j.cards,y]);const U=S(O=>ja(O)),M=bt(U.updateStatus.fetchState),R=U.currentDisplayedCardId,{useFeatureGate:T}=oe(),{isFeatureEnabled:$}=T(Q.isChargeCardFeatureEnabled),G=!!I.companyChargeCardInfo?.info?.isChargeCardEnabled,V=!I.userRole.includes("charge_card_user")&&$&&G,w=S(O=>R!=null?on(O.chargeCardState,R):null),Z=()=>{R!=null&&(x.current=!0,F.current!=null&&clearTimeout(F.current),F.current=setTimeout(()=>{x.current=!1,F.current=null},5e3),t(ca(R,V,!0)),t(ve(!0)),h(!0))},q=Ge(I);At({events:ta(q,xn),onSubscribed:()=>{t(ve(!0))},onEvent:(O,te)=>{if(!sc.has(O))return;const ae=Pt(te),k=x.current;if(O===aa){const X=ce(ae?.card_id)??R;if(X!=null){const J=vt(ae,X);if(J!=null)return t(mt(J)),void(X!==R||k||Z())}}if(O===Ka)return void t(ve(!0));const z=ce(ae?.card_id)??R;(R==null||z===R)&&R!=null?k||Z():t(ve(!0))}}),d.useEffect(()=>{if(y&&R!=null&&w!=null&&w.status.code!=="request_on_hold"){const O=pe(I.tenantEmailDomain,R,o,w),te=ye(n.state?.pathnameStackToGoBack,n.pathname);t(xr()),w?.type.code==="business_virtual_credit_card"&&t(Na()),r(O,{state:{pathnameStackToGoBack:te},replace:!0}),x.current=!1,F.current!=null&&(clearTimeout(F.current),F.current=null)}},[y,w?.status.code]),d.useEffect(()=>{M==="In-Progress"&&U.updateStatus.fetchState==="Completed"&&setTimeout(Z,3e3)},[M,U.updateStatus.fetchState]);const P=O=>{D(O)};if(b!=="Completed"||j.cards.length===0)return s.jsxs(Ot,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:P}),s.jsx(Cs,{})]});if(i==null)throw Error("Can't access my userId.");return s.jsxs(Ot,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:P}),s.jsx(ic,{chargeCardListView:j,cardUserOnboardingView:U,navigate:r,currentTenant:I,myUserId:i,location:n,chargeCardCashbackRatePerTransaction:A.charge_card_cashback_rate_per_transaction!=null?A.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{P(!0)}}),e!=null?s.jsx(dc,{windowSize:a,children:e}):null]})},ic=he(function(e,{currentTenant:a,cardUserOnboardingView:t,chargeCardListView:r,myUserId:n}){const f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{cards:r.cards,showMenuIcon:p,companyLegalName:a.companyName,twoFAView:t.twoFAView,cardUserOnboardingLocalData:t.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:t.isDOBPresent,onboardingProgressStatus:t.onboardingProgressStatus}},function(e,a){const{navigate:t,cardUserOnboardingView:r,location:n,currentTenant:f}=a,{tenantEmailDomain:p}=f;return{updateCardUserOnboardingLocalData:g=>{e(Ft({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const _={...r.cardUserOnboardingLocalData,phone:g};e(Ft({localData:_}))}e($a(g,"CardUserOnboarding"))},onResendOtp:g=>{e(Ma(g,"CardUserOnboarding"))},onVerifyOtp:(g,_)=>{e(Ha(g,_,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(Lr()),g!=null&&ee.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(cn({cardId:g}))},onBackClick:()=>{const g=Re(n.state?.pathnameStackToGoBack),_=g.poppedPathname??ze(p);t(_,{state:{pathnameStackToGoBack:g.newStack}})}}})(ps),dc=Te.div`
35
- display: flex;
36
- flex-direction: column;
37
- width: ${e=>`${cc.containerWidth.value(e.windowSize)}%`};
38
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
39
- `,Ot=Te.div`
40
- display: flex;
41
- min-height: 100%;
42
- width: 100%;
43
- flex: 1 1 auto;
44
- flex-direction: column;
45
- align-items: center;
46
- background-color: ${e=>e.theme.colors.grey4};
47
- `,lc={containerWidth:new Aa(100,58)},uc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p,useFeatureGate:g}=oe(),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),[x,F]=d.useState(!1),L=ee.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const C=S(V=>de(V));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=p(Le.zeniCardsConfig),D=S(V=>Rr(V,n)),{isFeatureEnabled:o}=g(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=g(Q.isDebitCardFeatureEnabled),A=Ee(I,C),j=ke({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:A}),E=Ie(C),b=Ae(C),B=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=_e({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:o,isBookKeepingTenant:b,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:B}),m=D.chargeCard,U=S(V=>V.chargeCardConfigState.fetchState);d.useEffect(()=>{_===!1&&U!=="In-Progress"&&U!=="Completed"&&(t(Va()),c(!0)),l===!1&&D.fetchState==="Not-Started"&&(v(!0),t(ca(n,!1,i)))},[l,D.fetchState,_,U]);const M=m?.type.code==="business_physical_debit_card"||m?.type.code==="business_virtual_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(y===!1&&(M===!1||M&&m.status?.code!=="active"||M&&m.status.code==="active"&&m.isPinSet||m.cardHolderUserId!==L.userId)){const V=pe(C.tenantEmailDomain,n,L,m,!0),w=ye(f.state?.pathnameStackToGoBack,f.pathname);r(V,{state:{pathnameStackToGoBack:w}})}else if(y&&D.isRefreshingViewInBackground===!1&&m?.isPinSet===!0){t(Ur({chargeCardId:n}));const V=pe(C.tenantEmailDomain,n,L,m,!0),w=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(V,{state:{pathnameStackToGoBack:w}})}}},[D.fetchState,m?.type.code,y,D.isRefreshingViewInBackground]);const R=ee.getZeniOtpTokenForCardHolder(n),T=S(V=>Nt(V.userState,L.userId)),$=()=>{m?.isPinSet!==!0&&t(na(n,!0))};d.useEffect(()=>{D.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout($,3e3),h(!0))},[D.updateDebitCardPinAttemptFetchState.fetchState]);const G=V=>{F(V)};if(U!=="Completed"||m==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(T?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(pc,{children:[s.jsx(We,{isAppContentDrawerOpen:x,handleDrawerToggle:G}),s.jsx(mc,{cardId:n,card:m,phone:T.phone,signedInUser:L,isSandboxEnv:ht(),debitCardDetailState:D,signedInUserToken:R,navigate:r,currentTenant:C,location:f,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{G(!0)}}),e!=null?s.jsx(Cc,{windowSize:a,children:e}):null]})},mc=he(function(e,{debitCardDetailState:a,cardId:t}){const r=Ht(e,t),n=a.updateStatus,f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{showMenuIcon:p,vgsVaultId:Qa.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,debitCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:c=>{e(Yt(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onSetPinSuccess:()=>{e(Or({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("activate")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(hs),Cc=Te.div`
48
- display: flex;
49
- flex-direction: column;
50
- width: ${e=>`${lc.containerWidth.value(e.windowSize)}%`};
51
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
52
- box-shadow: ${e=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
53
- `,pc=Te.div`
54
- display: flex;
55
- min-height: 100%;
56
- width: 100%;
57
- flex: 1 1 auto;
58
- flex-direction: column;
59
- align-items: center;
60
- background-color: ${e=>e.theme.colors.grey4};
61
- box-shadow: ${e=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
62
- `,hc={overlayWidth:new Aa(at[12],at[12],at[9])},fc=he(function(e,a){const t=pt(e,!1,!1),r=a.lineId,n=t.customAddress[r],f=t.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:a.googleAPIKey,customAddress:n,customAddressStatus:f,lineId:r}},function(e,a){const{newCustomAddressId:t,lineId:r,chargeCardTypeOption:n}=a;return{onSubmitHandler:f=>{t!=null&&e(dn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const p=Ts(f);e(Nr({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:p})),e(Hr(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{a.onDismissClick(),t!=null&&e(Vr({addressId:t,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(fs),gc=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:t})=>{const r=ft(),n=Ia(),f=()=>{a()},p=S(g=>jr(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(hn,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:hc.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,_)=>(_==="backdropClick"||_==="escapeKeyDown")&&f(),children:s.jsx(fc,{googleAPIKey:Qa.googleMapsAPIKey,onDismissClick:f,lineId:e,chargeCardTypeOption:t,newCustomAddressId:p})})},bc=he(function(e,a){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g}=a,_=pt(e,t&&p,r&&g);return{issueChargeCards:_,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g,cardHolderCandidates:_.userList.map(c=>c.user).filter(Boolean),allRoles:_.userList.map(c=>c.userRole),allAccountingClasses:_.allAccountingClasses,userList:_.userList}},function(e,a){return{onIssueCardClick:()=>{e(Gr())},onSaveChangesToLocalStore:t=>{e($r(t))},onDismissClick:()=>{e(ln()),a.navigate("../")},resetCustomAddressByLineID:(t,r)=>{e(dn(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}})(ys);function yc(){const e=ee.getSignedInUser(),a=me(),t=Ce(),r=gs(),[n]=jt(),f=n.get("cardType"),{useFeatureGate:p}=oe(),{isFeatureEnabled:g}=p(Q.isIssuePhysicalCardEnabled),{isFeatureEnabled:_}=p(Q.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:c}=p(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Q.isChargeCardFeatureEnabled),v=S($=>de($)),y=Ee(c,v),h=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:y}),x=Ie(v),F=Ae(v),L=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,C=_e({isCardsOnlyTenant:x,isChargeCardFeatureEnabled:l,isBookKeepingTenant:F,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:L}),[u,D]=d.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");d.useEffect(()=>{u||(D(!0),t(Mr(h&&I,C&&o,!1)))},[u,D,t]);const o=!!v.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!!v.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S($=>pt($,C&&o,h&&I)),j=A.fetchState,E=A.issueCardStatus.fetchState,b=A.lastSelfIssuedDebitCardId,B=S($=>b!=null?on($.chargeCardState,b):void 0),[i,m]=d.useState(null),[U,M]=d.useState(null),R=()=>{m(null)},T=($,G)=>{m($),M(G)};return d.useEffect(()=>{if(E==="Completed"){if(b!=null&&B?.type.code==="business_virtual_debit_card"){let $;$=B?.status.code==="request_on_hold"&&e.userId===B.cardHolderUserId?yn(v.tenantEmailDomain):pe(v.tenantEmailDomain,b,e,B),a($)}else a("../");t(ln())}},[E,b]),j==="Completed"?s.jsxs(s.Fragment,{children:[i!==null&&U!==null?s.jsx(gc,{closeDrawerHandler:R,lineId:i,chargeCardTypeOption:U}):null,s.jsx(bc,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:_,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:C,isChargeCardSetupEnabled:o,isDebitCardSetupEnabled:I,navigate:a,fetchState:A.fetchState,openAddAddressDrawerHandler:T,defaultCardType:f==="creditCard"||f==="debitCard"?f:void 0})]}):j==="Error"?s.jsx(Ya,{}):s.jsx(bs,{})}const Ln=[aa,Ka],Sc=new Set(Ln),Ic=Te.div`
63
- display: flex;
64
- height: 100vh;
65
- width: 100%;
66
- flex: 1 1 auto;
67
- flex-direction: column;
68
- overflow: auto;
69
- align-items: center;
70
- background-color: ${e=>e.theme.colors.grey4};
71
- `,Ac=he(function(e,a){const{myPendingActivationChargeCardListState:t}=a;return{myPendingActivationChargeCardListView:t,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigate:t,currentTenant:r,location:n,signedInUser:f,myPendingActivationChargeCardListState:p}=a,{tenantEmailDomain:g}=r,{cards:_}=p;return{onChargeCardRowClick:c=>{const l=bn(_,c),v=pe(g,c,f,l),y=ye(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,l)=>{e(st({uiState:{sortKey:c,sortOrder:l}}))},onReloadCards:()=>{e(ve())},onBackClick:()=>{const c=r.userRole.includes("charge_card_user");e(st({uiState:{sortKey:c?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(Ss);function Ec(){const e=me(),a=Ce(),t=Se(),r=ft(),[n,f]=d.useState(!1),p=S(T=>zr(T)),g=S(T=>de(T)),_=S(T=>Ke(T,g.companyId)),c=qe(_.controllers),{useFeatureGate:l}=oe(),{isFeatureEnabled:v}=l(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(Q.isDebitCardFeatureEnabled),h=Ee(y,g),x=ke({isDebitCardFeatureEnabled:y,isBankingOnlyTenant:h}),F=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,L=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,C=$e(),u=Ie(g),D=Ae(g),o=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=_e({isCardsOnlyTenant:u,isChargeCardFeatureEnabled:v,isBookKeepingTenant:D,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:o}),A=He(C?.loggedInUserRoleMap),j=S(T=>Je(T)),{creditAccount:E,creditAccountRepayment:b}=S(T=>Xe(T)),B=S(T=>rn(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),i=[...new Set(B)],m=S(T=>Ga(T,i));d.useEffect(()=>{n||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(f(!0),a(ve()),a(Va()))},[n,a,p.fetchState]),d.useEffect(()=>{if(p.fetchState==="Completed"&&p.cards.length===1&&U!=null){const T=pe(g.tenantEmailDomain,p.cards[0].id,U,p.cards[0]);e(T,{state:{message:t.state?.message}})}},[p.fetchState,p.cards]);const U=ee.getSignedInUser();d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&I&&L&&A&&a(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&A&&a(ut()),m.fetchState!=="Completed"&&m.fetchState!=="In-Progress"&&x&&F&&A&&a(sn())},[E.fetchState,b.fetchState,a,m.fetchState,x,F,A,I,L]);const M=Ge(g);if(At({events:ta(M,Ln),onEvent:(T,$)=>{if(!Sc.has(T))return;const G=Pt($);if(T===aa){const V=ce(G?.card_id);if(V!=null){const w=vt(G,V);if(w!=null)return void a(mt(w))}}a(ve(!0))},onSubscribed:()=>{a(ve(!0))}}),U==null)throw Error("Can't access address page without signing in...");const R=p.cards!=null&&p.cards.length>0;if(p.fetchState==="Completed"||R){const T=Me(I,x,F,L);return s.jsx(Ic,{children:s.jsx(Ac,{navigate:e,currentTenant:g,signedInUser:U,productInformation:T,myPendingActivationChargeCardListState:p,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:x,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:L,chargeCardCashbackDetailState:j,creditAccount:E,creditAccountRepayment:b,depositAccountListWithDebitCardIssued:m,controllerEmails:c,location:t})})}return s.jsx(Sa,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})}const kc=he(function(e,a){const{companyId:t,companyLegalName:r}=a;return{chargeCardSetupView:ya(e,t),admins:a.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,a){const{navigate:t,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:f,isChargeCardSetupEnabled:p,signedInUser:g,location:_,productInformation:c,isEarlyPayEnabled:l,controllerEmails:v,chargeCardsCreditAccountLimit:y}=a;return{onSetupButtonClick:h=>{if(g!=null&&K.trackCardsPromoPageClicked("enable cards"),n)switch(K.trackCardsEnableCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!0,"charge_cards",l,!1));break;case"debit":e(Ve(r,!0,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!0,"debit_cards",l,!0):Ve(r,!0,"charge_cards__debit_cards",l,!1))}else switch(K.trackCardsSetupCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!1,"charge_cards",l,!1));break;case"debit":e(Ve(r,!1,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!1,"debit_cards",l,!0):Ve(r,!1,"charge_cards__debit_cards",l,!1))}},onBackClick:()=>{const h=Re(_.state?.pathnameStackToGoBack);let x=h.poppedPathname;x==null&&(x=f||p?"..":"../.."),t(x,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(Na()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Yr(r))}}})(As),_c=()=>{const e=me(),{tenantEmailDomain:a}=ba(),[t]=jt(),r=t.get("cardPromoType"),n=Ce(),{useDynamicConfig:f,useFeatureGate:p}=oe(),[g,_]=d.useState(!1),{isFeatureEnabled:c}=p(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:v}=p(Q.isChargeCardFeatureEnabled),{configValue:y}=f(Le.zeniCardsConfig),h=S(ne=>de(ne)),x=S(ne=>Ke(ne,h.companyId)),F=qe(x.controllers),L=y.charge_card_cashback_rate_per_transaction!=null?y.charge_card_cashback_rate_per_transaction:.0175,C=Se(),u=ee.getSignedInUserTenant(a)?.companyId??h.companyId,D=S(ne=>ya(ne,u)),o=D.primaryFundingAccount,I=h.companyBillPayInfo?.info,A=Ie(h),j=Ae(h),E=Ee(c,h),b=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:E}),i=_e({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:b}),m=gn({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j}),U=B&&i===!1,M=I?.businessVerificationStatus?.code==="verified"&&(U||o?.accType==="depositAccount"||Qr(o?.providerVerificationStatus?.code??"")),R=ee.getSignedInUser(),T=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,G=!!h.company?.companyChargeCardInfo.isChargeCardEnabled,V=!!h.company?.companyDebitCardInfo.isDebitCardEnabled,w=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,Z=ne=>{_(ne)},q=S(ne=>ne.chargeCardSetupViewState.fetchState);if(R==null)throw Error("Can't access Charge Card promo page without signing in...");const P=$e(),O=He(P?.loggedInUserRoleMap),te=Ct(P?.loggedInUserRoleMap),[ae,k]=d.useState(!1),[z,X]=d.useState(!1),[J,Y]=d.useState(!1);d.useEffect(()=>{ae===!1&&C.state?.message==="activation"&&k(!0)},[C.state]),d.useEffect(()=>{z||q!=="Not-Started"||u==null||(X(!0),n(fa(u,!0)))},[z,q,u,n]);const re=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:m,isTOSAccepted:$,isSetupEnabled:G,isUserHasCardsAdminLevelAccess:O,isUserHasCardsAccess:te}),De=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:B,isTOSAccepted:w,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:O,isUserHasCardsAccess:te}),Ue=B&&De&&m&&b>=0&&re?"debit_and_credit":B&&De?"debit":"credit",W=Ps(r,Ue),fe=D?.chargeCardTermsDetails?.fetchStatus?.fetchState,we=d.useRef(null);d.useEffect(()=>{fe==="In-Progress"?we.current=W:fe!=="Error"&&fe!=="Not-Started"||(we.current=null)},[fe,W]);const Oe=fe!=="In-Progress"&&fe!=="Completed"||we.current==null?W:we.current;d.useEffect(()=>{W==="credit"&&(G||m===!1&&V)||W==="debit"&&V||W==="debit_and_credit"&&V&&G?e("../"):(W==="debit_and_credit"&&$===!0&&w===!0||W==="credit"&&($===!0||m===!1&&w===!0)||W==="debit"&&w===!0)&&O===!0&&e("../setup")},[M,G,V,W,$,w]),d.useEffect(()=>{J||(n(Zr("cardAdmin")),Y(!0))},[J]);const Fe=S(ne=>tn(ne.userState,ne.userRoleState,ne.userListViewState,"cardAdmin")),Be=Me(m,B,V,G);return(re||De)&&q==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:K,onLoad:()=>{if(K.trackPageLoaded(pn.Event.cardsPromoPage),!!m&&!G||!!B&&!V||!!m&&!!B&&!V&&!G){const ne=Dc({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:G,isCreditCardProductVisibleForExpressInterest:m,isDebitCardProductVisible:B});K.trackCardsPromoView(F,Be,"Page",ne,"Promo Page")}}}),s.jsx(za,{showConfetti:ae}),s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(kc,{signedInUser:R,location:C,showEnableCardButton:M,isCompanyBusinessVerificationAndPaymentSetUpDone:M,isChargeCardSetupEnabled:G,isDebitCardSetupEnabled:V,companyLegalName:h.companyName,adminList:Fe.users,isCheckingEnabled:T,navigate:e,companyId:u,cardPromoType:Oe,controllerEmails:F,productInformation:Be,isCreditCardProductVisible:i,isDebitCardFeatureEnabled:c,isEarlyPayEnabled:l,cashbackRate:L,chargeCardsCreditAccountLimit:b,onClickMenuIcon:()=>{Z(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(Is,{})]})},Dc=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:a,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:r})=>t&&r&&!e&&!a?"Credit & Debit Card":t&&!a?"Credit Card":r&&!e?"Debit Card":"";function qc(){const e=Se(),a=S(q=>de(q)),{useFeatureGate:t}=oe(),{isFeatureEnabled:r}=t(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=t(Q.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=t(Q.isEarlyPayFeatureEnabled),{isFeatureEnabled:p}=t(Q.isChargeCardPaymentHistoryFeatureEnabled),g=Ee(n,a),_=ke({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),c=Es(a,r,n),l=!!a.company?.companyChargeCardInfo.isChargeCardTOSAccepted,v=!!a.company?.companyDebitCardInfo.isDebitCardTOSAccepted,y=!!a.company?.companyChargeCardInfo.isChargeCardEnabled,h=!!a.company?.companyDebitCardInfo.isDebitCardEnabled,x=$e(),F=He(x?.loggedInUserRoleMap),L=Ct(x?.loggedInUserRoleMap),{isFeatureEnabled:C}=t(Q.isCashbackFeatureEnabled),u=a.userRole.includes("charge_card_user"),D=!u,o=!u&&y,I=a?.userRole!=null&&Wr(a?.userRole),A=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!I)&&Kr(x?.loggedInUserRoleMap),j=qr(x?.loggedInUserRoleMap),E=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!I)&&Xr(x?.loggedInUserRoleMap),{isFeatureEnabled:b}=t(Q.isDepositAccountsFeatureEnabled),B=b&&!I&&$t(x?.loggedInUserRoleMap),i=y&&!I,m=h&&!I,U=c&&!I&&He(x?.loggedInUserRoleMap),M=Jr(x?.loggedInUserRoleMap),R=Ie(a),T=Ae(a),$=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,G=_e({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:r,isBookKeepingTenant:T,isDebitCardProductVisible:_,chargeCardsCreditAccountLimit:$}),V=a.companyChargeCardInfo?.info!=null&&sa({cardInfo:a.companyChargeCardInfo.info,isProductVisible:G,isTOSAccepted:l,isSetupEnabled:y,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),w=a.companyDebitCardInfo?.info!=null&&sa({cardInfo:a.companyDebitCardInfo.info,isProductVisible:_,isTOSAccepted:v,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),Z=V||w;return s.jsxs(Rn,{children:[F?s.jsx(se,{path:"setup",element:s.jsx(Bt,{isBillPayAdminLevelAccess:A,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:B,isChargeCardAdminLevelAccess:U,isUserHasOnlyCardAccess:M,isUserHasOnlyBillPayAccess:j,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(se,{path:"verification",element:s.jsx(Bt,{isBillPayAdminLevelAccess:A,isUserHasOnlyBillPayAccess:j,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:B,isChargeCardAdminLevelAccess:U,isUserHasOnlyCardAccess:M,productType:"charge_cards",type:"verification"})}):null,s.jsx(se,{path:"promo",element:s.jsx(_c,{})}),i||m?s.jsxs(s.Fragment,{children:[s.jsx(se,{path:"/",element:s.jsx(Lt,{isPaymentDrawerOpen:!1})}),U&&f?s.jsx(se,{path:"payment",element:s.jsx(Lt,{isPaymentDrawerOpen:!0})}):null,s.jsx(se,{path:"activate",element:s.jsx(Ec,{})}),s.jsx(se,{path:"onboard",element:s.jsx(oc,{})}),F?s.jsx(se,{path:"new",element:s.jsx(yc,{})}):null,C&&D?s.jsx(se,{path:"cashback",element:s.jsx(Rs,{})}):null,o?s.jsx(se,{path:"statements",element:s.jsx(rc,{})}):null,U&&p&&y?s.jsx(se,{path:"payment-history",element:s.jsx(nc,{})}):null,s.jsx(se,{path:":cardId/activate",element:s.jsx(js,{})}),s.jsx(se,{path:":cardId/setPin",element:s.jsx(uc,{})}),s.jsx(se,{path:":cardId/addToWallet",element:s.jsx(Fs,{})}),s.jsx(se,{path:":cardId/*",element:s.jsx(Ys,{})}),s.jsx(se,{path:"*",element:s.jsx(Ya,{})})]}):(l||v)&&F?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../setup"})}):Z?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../promo",state:e.state})}):s.jsx(se,{path:"*",element:null})]})}export{qc as default};
@@ -1,11 +0,0 @@
1
- import{j as C}from"./liveblocks-CxQyVdmp.js";import{a}from"./sentry-Na2f7K9i.js";import{u as D,g as v,j as c,N as w}from"./core-CGRh988K.js";import{JW as A,eR as O,fq as _,ng as j,fR as h,fp as U,eY as L,K1 as F}from"./zeni-epic-state-D9GkJt4v.js";import{u as R,z as m,L as g,D as $,o as k}from"./index-KKxEmb4f.js";import{n as H}from"./mui-DOOgBswz.js";import{t as z}from"./getLocaleForTenant-DSIXvqfH.js";import{g as P,Q as q}from"./QBOConnectionScreen-D4OG7t2D.js";import"./recharts-AypxxmWa.js";import"./analytics-BKFxkJXq.js";import"./plaid-DKuuSvS9.js";import"./dnd-CcFi9V4s.js";import"./stripe-DMRn4zHo.js";import"./lottie-qTKXNt7n.js";import"./lexical-BWfctdSX.js";import"./pdf-CyJbH3RK.js";import"./utils-BeAkRe29.js";import"./empty-BLKSJ8th.js";import"./pdf-lib-THwzU8fF.js";import"./index-DcyVSbFf.js";import"./url-bf_4McGL.js";import"./index-CzUY5640.js";import"./decodeURIComponentSafe-DRCpTHJs.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="f10c3328-1d53-41c5-bd07-4d8aa4b90ecf",t._sentryDebugIdIdentifier="sentry-dbid-f10c3328-1d53-41c5-bd07-4d8aa4b90ecf")}catch{}})();const G=H.div`
2
- display: flex;
3
- flex: 1 1 auto;
4
- flex-direction: row;
5
- justify-content: center;
6
- align-items: center;
7
- width: 100%;
8
- height: 100vh;
9
- background-color: ${t=>t.theme.colors.background};
10
- box-shadow: ${t=>`0px 2px ${k.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function fe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:b}=R(),f=a.useRef(!1),p=a.useRef(!1),{code:x,realmId:T,state:y}=P(i.search),N=x!==""&&T!==""&&y!=="",I=c(l=>A(l)),e=c(l=>O(l)),n=c(l=>l.tenantState.fetchState),r=c(l=>l.tenantState.activeTenantFetchState.fetchState),o=m.getSignedInUser(),u=m.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{f.current||o==null||u==null||(f.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(_(o.userId,u))))},[f,n,d]),a.useEffect(()=>{e.tenantId==null&&!p.current&&o!=null&&(p.current=!0,!(u==null||u!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(j(o.userId)))},[p,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(U(e.tenantId)),m.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),$.updateAppLocaleID(z(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&m.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(G,{children:C.jsx(q,{})}):C.jsx(w,{to:"/",replace:!0})}export{fe as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-CxQyVdmp.js";import{z as n}from"./index-KKxEmb4f.js";import{g as d}from"./QBOConnectionScreen-D4OG7t2D.js";import"./sentry-Na2f7K9i.js";import{g as p,N as a}from"./core-CGRh988K.js";import"./zeni-epic-state-D9GkJt4v.js";import"./recharts-AypxxmWa.js";import"./mui-DOOgBswz.js";import"./analytics-BKFxkJXq.js";import"./plaid-DKuuSvS9.js";import"./dnd-CcFi9V4s.js";import"./stripe-DMRn4zHo.js";import"./lottie-qTKXNt7n.js";import"./lexical-BWfctdSX.js";import"./pdf-CyJbH3RK.js";import"./utils-BeAkRe29.js";import"./empty-BLKSJ8th.js";import"./pdf-lib-THwzU8fF.js";import"./index-DcyVSbFf.js";import"./url-bf_4McGL.js";import"./index-CzUY5640.js";import"./decodeURIComponentSafe-DRCpTHJs.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
@@ -1 +0,0 @@
1
- import{j as v}from"./liveblocks-CxQyVdmp.js";import{a as u}from"./sentry-Na2f7K9i.js";import{u as y,j as p,n as w,g as A,N}from"./core-CGRh988K.js";import{JW as R,eR as _,fq as U,JX as k,ng as L,JY as z}from"./zeni-epic-state-D9GkJt4v.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-KKxEmb4f.js";import"./mui-DOOgBswz.js";import{t as P}from"./getLocaleForTenant-DSIXvqfH.js";import"./recharts-AypxxmWa.js";import"./analytics-BKFxkJXq.js";import"./plaid-DKuuSvS9.js";import"./dnd-CcFi9V4s.js";import"./stripe-DMRn4zHo.js";import"./lottie-qTKXNt7n.js";import"./lexical-BWfctdSX.js";import"./pdf-CyJbH3RK.js";import"./utils-BeAkRe29.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="4f090bb4-cfb6-4be7-936a-27cdbd832b5e",t._sentryDebugIdIdentifier="sentry-dbid-4f090bb4-cfb6-4be7-936a-27cdbd832b5e")}catch{}})();const q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),m=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let b="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,b="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=m.get("question")?.replace(/^["']|["']$/g,"")??null,e=m.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,b="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,m);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:b,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),m=u.useRef(null),b=p(e=>R(e)),n=p(e=>e.tenantState.fetchState),i=p(e=>e.tenantState.error),a=p(e=>e.tenantState.activeTenantFetchState.fetchState),c=p(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;m.current!==e&&(m.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&b.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(b.tenantsCoreDetailsInOrder),o())},[b.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(q,{})}const J=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],Q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of J)if(t.toLocaleLowerCase().includes(s))return Q[s]}export{oe as default};
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-CxQyVdmp.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-CGRh988K.js";import{NX as k,O2 as Y,fG as q,fF as J,fE as L,iF as W,L4 as X,qC as K,eR as V,Nt as D,iD as F,NY as v,O5 as T,iB as G,iY as j}from"./zeni-epic-state-D9GkJt4v.js";import{bw as M,J as N,s as R,z as O,m as U,v as p,d as S,B as Z,bx as Q,o as z,by as ee,w as te}from"./index-KKxEmb4f.js";import{n as H}from"./mui-DOOgBswz.js";import"./sentry-Na2f7K9i.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]="e25575e6-8aa5-430c-8832-7c8c0e9b73b3",e._sentryDebugIdIdentifier="sentry-dbid-e25575e6-8aa5-430c-8832-7c8c0e9b73b3")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(X("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(L(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(Y(n,a,o))}}})(M);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),r=s.poppedPathname??B();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},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??B(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Q);function me({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=P(),d=e??s,{useFeatureGate:c}=R(),i=O.getSignedInUser(),b=h(u=>V(u)),g=U(),x=p(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,d)),{isFeatureEnabled:I}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:b,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const B=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},fe=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=H.div`
10
- display: flex;
11
- height: 100vh;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- box-shadow: ${e=>`0px 2px ${z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,re=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:d}=r;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(G(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:i}=c;e(T({data:i}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),i=c.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:c.newStack}})})(),e(v())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),i=c.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:c.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=P(),d=e??s,c=O.getSignedInUser(),{useFeatureGate:i}=R(),b=U(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,d)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:g,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{me as A,xe as D,_ as V,fe as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-CxQyVdmp.js";import{J as f,E as l,m as c}from"./index-KKxEmb4f.js";import{D as p}from"./mui-DOOgBswz.js";import"./sentry-Na2f7K9i.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="085d2278-ebaf-460b-8661-4493fef27612",e._sentryDebugIdIdentifier="sentry-dbid-085d2278-ebaf-460b-8661-4493fef27612")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=f(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CxQyVdmp.js";import{a as c}from"./sentry-Na2f7K9i.js";import{h as G,u as B,g as L,i as q,j as d,N as F,n as M,o as N,p as O}from"./core-CGRh988K.js";import{Mb as _,eR as R,LA as W,kI as Y,Ia as k,Mg as $,L3 as z,jI as V,Ib as S,LF as H,LG as J,L5 as K,L4 as Q}from"./zeni-epic-state-D9GkJt4v.js";import{aS as U,c as X,v as Z,w as tt}from"./index-KKxEmb4f.js";import"./mui-DOOgBswz.js";import{d as I}from"./decodeURIComponentSafe-DRCpTHJs.js";import{w as et}from"./withTransactionSidePanel-C3g8adFN.js";import{f as at,c as nt}from"./routePaths-CVVAujpk.js";import"./recharts-AypxxmWa.js";import"./analytics-BKFxkJXq.js";import"./plaid-DKuuSvS9.js";import"./dnd-CcFi9V4s.js";import"./stripe-DMRn4zHo.js";import"./lottie-qTKXNt7n.js";import"./lexical-BWfctdSX.js";import"./pdf-CyJbH3RK.js";import"./utils-BeAkRe29.js";import"./useAskAiCfoHostNavButtonProps-CqIT8mNx.js";import"./TransactionDetailScreen-BNfcRS7-.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]="4e2ec4ac-3ae9-4aa5-837f-e0f9c471aa30",a._sentryDebugIdIdentifier="sentry-dbid-4e2ec4ac-3ae9-4aa5-837f-e0f9c471aa30")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(K({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=G(),o=B(),l=L(),[m,T]=c.useState(!1),[h,g]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:w}=q(),r=I(j??""),p=I(w??""),f=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=d(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=d(n=>R(n).company?.companyInfo.firstMonthOfFY??1),u=d(n=>W(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))},[m,f,i]);const E=d(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??D,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return c.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(F,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};