@zeniai/web-app-ui 5.1.14-qa → 5.1.15-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 (128) hide show
  1. package/dist/assets/AddressRoutes-B4CPHzP3.js +1 -0
  2. package/dist/assets/{AddressScreen-DSUmBeDi.js → AddressScreen-CzR_LrnW.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BOZ3U8iE.js → AiCfoScreen-DPZZ8ajD.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-BcrHy3_d.js → BillPayApprovalRoutes-Bm_XpBTH.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-YgBi3X8x.js → BillPayRoutes-D1GX5fXu.js} +18 -18
  6. package/dist/assets/{BusinessVerificationPageScreen-CWb716op.js → BusinessVerificationPageScreen-bE_ZDJAJ.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-BLLbAX9F.js +71 -0
  8. package/dist/assets/CompanyPassportScreen-SbNXr-Yc.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-MQo8QSWh.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-C75q1vSn.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-G4MKQ9R6.js → CustomerOnboardingRoutes-CLQqWT1U.js} +5 -5
  12. package/dist/assets/{DashboardRoutes-JxZvBYab.js → DashboardRoutes-Cbd-s4sZ.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-Dme3DP6J.js → DefaultTenantHome-BThka-Bo.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-CN2xy1Dg.js → DomesticWireDetailScreen-zzVpWVLi.js} +3 -3
  15. package/dist/assets/DrawerScreen-Gfrg1kSz.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-BgFQpu7B.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-BAse6mjP.js +25 -0
  18. package/dist/assets/{FeaturePreviewScreen-D4fzXiSu.js → FeaturePreviewScreen-uAIP-fYO.js} +1 -1
  19. package/dist/assets/HubSpotOAuthCallbackScreen-C0DZ619s.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-JfchsLuo.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-DPjrjxGJ.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-CACo4kMO.js → MobileAppDrawer-DIkQMB49.js} +1 -1
  23. package/dist/assets/NotFoundScreen-Da7ROUUQ.js +1 -0
  24. package/dist/assets/{NotificationRoutes-BWW1ON6g.js → NotificationRoutes-cGHIq347.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-CgPhgWbB.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-DtzPR2o7.js +1 -0
  27. package/dist/assets/PeopleRoutes-Cll4VO9B.js +22 -0
  28. package/dist/assets/PerformanceRoutes-DFm0I2dv.js +1 -0
  29. package/dist/assets/{Preview-DV7jcNJq.js → Preview-B6ablJhs.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-CEl_0cd_.js → QBOConnectionScreen-BbLUwFlj.js} +1 -1
  31. package/dist/assets/ReferralListScreen-DfwbFR5J.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-DCDF3NSX.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DGGsRmkG.js → ReimbursementApprovalRuleDetailScreen-D6KJ85nX.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DbdgfdZO.js → ReimbursementRoutes-5q91KW8o.js} +9 -9
  35. package/dist/assets/{ReportsRoutes-Bn5dyHsG.js → ReportsRoutes-Aeq5-eMG.js} +1 -1
  36. package/dist/assets/RewardsRoutes-f3XwDF6M.js +1 -0
  37. package/dist/assets/ScreenRoutes-DTL8yguT.js +2 -0
  38. package/dist/assets/{SettingsRoutes-TFYXXQvf.js → SettingsRoutes-BFSNSnIj.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-DQQMK2Pe.js → SetupPagesScreen-M65-gLmB.js} +5 -5
  40. package/dist/assets/SignInScreen-DD27pE2P.js +1 -0
  41. package/dist/assets/SignOutScreen-DRQLWZe-.js +9 -0
  42. package/dist/assets/TaskListScreen-BesFePXd.js +9 -0
  43. package/dist/assets/TaskRoutes-DIfZcYIv.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-DDq43332.js → TransactionDetailRoutes-Cc1Mpbvi.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-C-EmLt2t.js → TransactionDetailScreen-DZOVFjTd.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-0kJw-sSs.js → TransactionListRoutes-n6NAKkAr.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-MmngbaSb.js → TreasuryRoutes-DfOeL5SA.js} +6 -6
  48. package/dist/assets/{VendorsRoutes-l_Dx0YSI.js → VendorsRoutes-BkJbsbPW.js} +22 -22
  49. package/dist/assets/WiseConfirmationScreen-QumfI681.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-BuSSg7oM.js → ZeniAccountRoutes-DvXFiqdo.js} +11 -11
  51. package/dist/assets/ZeniAccountStatementScreen-K35ghEPz.js +9 -0
  52. package/dist/assets/{accountMappingHelper-olmW29yz.js → accountMappingHelper-jtc3uKxM.js} +1 -1
  53. package/dist/assets/{analytics-CaY7rw-O.js → analytics-DQbIsXyz.js} +1 -1
  54. package/dist/assets/analyticsHelper-DM466Z6a.js +1 -0
  55. package/dist/assets/{core-CZ9_x3uq.js → core-BFMTUSM0.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-COFNvK3Q.js → decodeURIComponentSafe-D0SUerS2.js} +1 -1
  57. package/dist/assets/{dnd-Zw_s-D7Q.js → dnd-Cql54npb.js} +1 -1
  58. package/dist/assets/{empty-7cyPspc8.js → empty-Bi9aSFCY.js} +1 -1
  59. package/dist/assets/{empty-9FZm-BqI.js → empty-YdjS7t9J.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-Btt4krqI.js → emptyVideoElement-SVYMv4gU.js} +1 -1
  61. package/dist/assets/epic-eSQDJDvX.js +2 -0
  62. package/dist/assets/{getLocaleForTenant-KiSPE8IK.js → getLocaleForTenant-Bb1D5XV3.js} +1 -1
  63. package/dist/assets/{index-Dddel4wm.js → index-B64Tv9qs.js} +1 -1
  64. package/dist/assets/{index-Bl5Gxo9i.js → index-CG-AdJzL.js} +10546 -10549
  65. package/dist/assets/{index-CL3xKt_a.js → index-DRcmIlgW.js} +1 -1
  66. package/dist/assets/{index-BlTI1Mt8.js → index-DRgRUsQa.js} +1 -1
  67. package/dist/assets/{index-DGuD8Ns6.js → index-Deo1jzfD.js} +1 -1
  68. package/dist/assets/{index-DK4X4Vk8.js → index-DhsG_xNf.js} +2 -2
  69. package/dist/assets/{index-G8xNq7rD.js → index-KP9GUOx-.js} +1 -1
  70. package/dist/assets/{index-CuxNhIGG.js → index-xzuInRc5.js} +1 -1
  71. package/dist/assets/{lexical-DW7Zgdoo.js → lexical-gkFF34rv.js} +1 -1
  72. package/dist/assets/{liveblocks-CA2qpkTt.js → liveblocks-BtPAMLyF.js} +1 -1
  73. package/dist/assets/{lottie-DW7v-RpQ.js → lottie-CzQDocEZ.js} +1 -1
  74. package/dist/assets/{mui-_CQ1MGrl.js → mui-CgK_bxa9.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DbVxA-Rx.js → pathToGoBack-ShY4gpuW.js} +1 -1
  76. package/dist/assets/{pdf-BRE_7-P-.js → pdf-BXjDreb1.js} +4 -4
  77. package/dist/assets/{pdf-lib-8meLjW9k.js → pdf-lib-Be477S51.js} +1 -1
  78. package/dist/assets/{plaid-bOhNZMPB.js → plaid-B4L2ZxXd.js} +1 -1
  79. package/dist/assets/{pusher-D5RDWDl8.js → pusher-BGiYOOA4.js} +1 -1
  80. package/dist/assets/{react-BkZq36aw.js → react-B-OmPLpG.js} +1 -1
  81. package/dist/assets/{react-lbjp65Wj.js → react-BOoigsqi.js} +1 -1
  82. package/dist/assets/{react-CFWgn4__.js → react-CQrePhu5.js} +1 -1
  83. package/dist/assets/{react-DnPEHWM7.js → react-DFFWPACY.js} +1 -1
  84. package/dist/assets/{react-E4pIjTga.js → react-D_ie4iVu.js} +1 -1
  85. package/dist/assets/{react-BH9weH58.js → react-DjfHbTT-.js} +1 -1
  86. package/dist/assets/{recharts-DG48H-3-.js → recharts-w48xCyfx.js} +1 -1
  87. package/dist/assets/{routePaths-DynLDVDN.js → routePaths-7eiiv5jz.js} +1 -1
  88. package/dist/assets/{sentry-C8Zmy8eq.js → sentry-D1h6Hser.js} +1 -1
  89. package/dist/assets/{url-DZj7kXcI.js → url-Bg8R3-BS.js} +1 -1
  90. package/dist/assets/{url-ByuQXOc6.js → url-DkdZFqOF.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BL6bbKBu.js → useAiCfoDashboardSuggestedQuestionsChips-rMC2fvV7.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-Dz4QpLa9.js +1 -0
  93. package/dist/assets/{useDeviceId-DA16gBd2.js → useDeviceId-DEMMIXK0.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-DyYfRVlJ.js → useInitialThreadRequest-wXxfQETp.js} +1 -1
  95. package/dist/assets/{utils-CmjIXJxz.js → utils-BJp9FPT3.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-CAqdAy8r.js → withTransactionSidePanel-NRwvOrhY.js} +2 -2
  97. package/dist/assets/{zeni-epic-state-CeRetUx9.js → zeni-epic-state-DlmAHa_t.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -5
  100. package/dist/assets/AddressRoutes-CTHJ7nga.js +0 -1
  101. package/dist/assets/ChargeCardRoutes-xCmOBvgL.js +0 -71
  102. package/dist/assets/CompanyPassportScreen-1-2hcUKs.js +0 -1
  103. package/dist/assets/ConnectionAuthScreen-DQW6eH4t.js +0 -11
  104. package/dist/assets/CustomerOnboardingAuthScreen-CDhsSOdf.js +0 -1
  105. package/dist/assets/DrawerScreen-DG4CCTYZ.js +0 -1
  106. package/dist/assets/EntityDetailRoutes-CbyVY3jc.js +0 -1
  107. package/dist/assets/ExpenseAutomationRoutes-BJi8fni-.js +0 -25
  108. package/dist/assets/HubSpotOAuthCallbackScreen-OAVaLhSF.js +0 -1
  109. package/dist/assets/MagicLinkRoutes-DhY4yijg.js +0 -72
  110. package/dist/assets/MagicLinkSignInScreen-C6j9YoZW.js +0 -12
  111. package/dist/assets/NotFoundScreen-D0aNQysK.js +0 -1
  112. package/dist/assets/OAuthConsentScreen-79vAyxp5.js +0 -1
  113. package/dist/assets/PandLWithForecastRoutes-BCT-glGf.js +0 -1
  114. package/dist/assets/PeopleRoutes-DSl60kI7.js +0 -22
  115. package/dist/assets/PerformanceRoutes-DO510pLR.js +0 -1
  116. package/dist/assets/ReferralListScreen-Cw5PnCdh.js +0 -5
  117. package/dist/assets/ReimbursementApprovalRoutes-COn4sGv0.js +0 -1
  118. package/dist/assets/RewardsRoutes-B2MJrs_o.js +0 -1
  119. package/dist/assets/ScreenRoutes-D9hZPo_a.js +0 -2
  120. package/dist/assets/SignInScreen-BTa5d-nx.js +0 -1
  121. package/dist/assets/SignOutScreen-oxyFxGQp.js +0 -9
  122. package/dist/assets/TaskListScreen-Emg8otmN.js +0 -9
  123. package/dist/assets/TaskRoutes-HhKys__h.js +0 -9
  124. package/dist/assets/WiseConfirmationScreen-Bw_aff0d.js +0 -12
  125. package/dist/assets/ZeniAccountStatementScreen-3EXJRXGT.js +0 -9
  126. package/dist/assets/analyticsHelper-BdzlNWvU.js +0 -1
  127. package/dist/assets/epic-DPPpA4p6.js +0 -2
  128. package/dist/assets/useAskAiCfoHostNavButtonProps-B695I2Ok.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-Bl5Gxo9i.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-C8Zmy8eq.js"><link rel="modulepreload" crossorigin href="/assets/core-CZ9_x3uq.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-CeRetUx9.js"><link rel="modulepreload" crossorigin href="/assets/mui-_CQ1MGrl.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CaY7rw-O.js"><link rel="modulepreload" crossorigin href="/assets/utils-CmjIXJxz.js"><link rel="stylesheet" crossorigin href="/assets/index-Bc34frN_.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-CG-AdJzL.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-D1h6Hser.js"><link rel="modulepreload" crossorigin href="/assets/core-BFMTUSM0.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-DlmAHa_t.js"><link rel="modulepreload" crossorigin href="/assets/mui-CgK_bxa9.js"><link rel="modulepreload" crossorigin href="/assets/analytics-DQbIsXyz.js"><link rel="modulepreload" crossorigin href="/assets/utils-BJp9FPT3.js"><link rel="stylesheet" crossorigin href="/assets/index-Bc34frN_.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.14-qa",
3
+ "version": "5.1.15-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.14",
31
- "@zeniai/client-epic-state": "5.0.66",
32
- "@zeniai/web-components": "4.1.24",
30
+ "@zeniai/client-analytics": "2.0.18",
31
+ "@zeniai/client-epic-state": "5.0.67",
32
+ "@zeniai/web-components": "4.1.26",
33
33
  "color": "3.1.3",
34
34
  "cross-fetch": "^4.0.0",
35
35
  "crypto-js": "4.2.0",
@@ -160,7 +160,6 @@
160
160
  "publish_mohali": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm lint && pnpm build_mohali && pnpm publish --tag mohali",
161
161
  "publish_next": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm lint && pnpm build_next && pnpm publish --tag next",
162
162
  "test": "pnpm vitest run",
163
- "test:pusher": "pnpm vitest run src/screens/pusher/tests src/screens/chargeCard/tests src/screens/chargeCard/constants/tests",
164
163
  "version": "pnpm format && git add -A src",
165
164
  "postversion": "git push && git push --tags",
166
165
  "check-dependencies": "node ./scripts/check_dependencies.js",
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-CA2qpkTt.js";import{A as d}from"./AddressScreen-DSUmBeDi.js";import i from"./NotFoundScreen-D0aNQysK.js";import"./sentry-C8Zmy8eq.js";import{o as s,p as r}from"./core-CZ9_x3uq.js";import"./zeni-epic-state-CeRetUx9.js";import"./recharts-DG48H-3-.js";import"./index-Bl5Gxo9i.js";import"./mui-_CQ1MGrl.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.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,71 +0,0 @@
1
- import{j as s}from"./liveblocks-CA2qpkTt.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-CZ9_x3uq.js";import{eP as de,bs as He,Pe as ja,eY as Ie,eZ as Ae,e_ as Ee,fT as qe,cs as Je,Pf as Xe,Pg as lt,tv as xa,jO as Ba,Ph as La,gT as pa,z$ as ca,A1 as Ne,A2 as ut,jE as Vt,Pi as Qe,zP as ha,Pj as On,Pk as Un,zS as Va,Pl as jn,NE as Na,rH as Nt,zY as na,h2 as Vn,Pm as Ht,Pn as ea,bq as Nn,Po as Hn,fE as Ha,fD as Ma,Aw as Mn,fC as $a,Nk as $n,Pp as Mt,cl as $t,cM as Gn,ND as ya,B6 as Gt,Pq as Tt,AI as fa,Pr as zt,B7 as zn,O3 as Yn,B8 as Zn,C2 as Kn,sR as Wn,BY as qn,Ps as Jn,A0 as Ze,Pt as Xn,Pu as Qn,Pv as er,Pw as ar,Px as tr,Py as mt,Pz as nr,Ah as Yt,Aa as rr,PA as sr,fV as cr,Aq as Zt,Au as Kt,fU as or,PB as ir,AU as Wt,PC as dr,PD as lr,PE as ur,As as qt,Ad as Jt,zV as Xt,Am as Qt,Ak as en,Ao as mr,PF as an,PG as Ga,AF as ga,Kj as tn,cN as Ct,PH as Cr,PI as pr,PJ as hr,PK as fr,AC as st,A$ as gr,AX as br,Ay as yr,AZ as Sr,AP as Ir,AR as Ar,PL as nn,B5 as Ta,HI as Er,PM as kr,PN as _r,PO as Dr,PP as rn,PQ as Pr,Bs as wr,AH as sn,AB as ve,AG as vr,PR as Tr,PS as Fr,zM as xr,PT as cn,PU as on,PV as Br,zO as Lr,zN as Ft,PW as Rr,PX as Or,PY as Ur,Kf as jr,PZ as pt,P_ as Vr,wn as dn,km as Nr,gU as Hr,Bx as Mr,P$ as ln,Q0 as $r,By as Gr,Q1 as zr,de as Yr,tp as Zr,Bn as Kr,Bh as Ve,bt as Wr,bF as qr,cx as Jr,bG as Xr,Js as Qr}from"./zeni-epic-state-CeRetUx9.js";import{z as ee,k as $e,v as oe,I as Y,B as Sa,c2 as za,cd as es,ce as as,cf as ts,p as Re,cg as ns,ch as rs,J as Ia,aN as Le,n as ye,bm as ht,ci as ss,s as Aa,i as Ya,h as ft,c as q,D as gt,a7 as Za,cj as cs,_ as un,aq as bt,by as ra,ck as ct,cl as os,K as yt,cm as is,at as mn,a2 as ot,Y as Cn,e as pn,cn as ds,co as ls,cp as us,cq as ms,cr as Cs,cs as ps,o as Ra,ct as hs,cu as fs,cv as at,O as gs,cw as bs,cx as ys,cy as Ss,cz as Is,cA as As,a9 as Es}from"./index-Bl5Gxo9i.js";import{n as Te,D as hn,S as ks}from"./mui-_CQ1MGrl.js";import{a as d}from"./sentry-C8Zmy8eq.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 Ke,m as bn,n as Ps,o as yn,p as ws,S as xt}from"./SetupPagesScreen-DQQMK2Pe.js";import{u as Sn}from"./useInitialThreadRequest-DyYfRVlJ.js";import Ka from"./NotFoundScreen-D0aNQysK.js";import{M as We}from"./MobileAppDrawer-CACo4kMO.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-B695I2Ok.js";import{v as Bt}from"./utils-CmjIXJxz.js";import{d as vs}from"./recharts-DG48H-3-.js";import{t as Ts}from"./AddressScreen-DSUmBeDi.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./analyticsHelper-BdzlNWvU.js";import"./routePaths-DynLDVDN.js";import"./BusinessVerificationPageScreen-CWb716op.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]="c9e90059-47c2-4e88-916f-bf1c41bae04a",e._sentryDebugIdIdentifier="sentry-dbid-c9e90059-47c2-4e88-916f-bf1c41bae04a")}catch{}})();function Fs(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(K=>de(K)),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(K=>ja(K).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Y.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=g(Y.isDebitCardFeatureEnabled),F=Ie(n),L=Ae(n),C=Ee(B,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:y,isBookKeepingTenant:L,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(K=>qe(K,n.companyId)),j=Je(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(K=>Xe(K)),x=S(K=>K.classListState.fetchState),i=!v&&o&&h,m=S(K=>lt(K,a,i,o)),[O,M]=d.useState(!1),R=m.chargeCard,T=R?.cardCreatedByUser?.userId,$=S(K=>T!=null?xa(K.userRoleState,T):void 0),G=$?.accountingClassIDs[0],V=S(K=>G!=null?Ba(K.classState,{classId:G,reportId:"class_list"}):void 0),P=R?.cardHolderUser?.userId,Z=S(K=>P!=null?xa(K.userRoleState,P):void 0),J=Z?.accountingClassIDs[0],w=S(K=>J!=null?Ba(K.classState,{classId:J,reportId:"class_list"}):void 0),U=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&U&&(c(!0),setTimeout(()=>{t(La()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,U,te]),d.useEffect(()=>{O||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[O,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(U===!1||U&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const K=pe(n.tenantEmailDomain,a,r,R,l);e(K)}},[m.fetchState,l,U]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),x!=="Completed"&&x!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,x]);const ae=()=>{if(r!=null&&a!=null){t(La());const K=pe(n.tenantEmailDomain,a,r);e(K)}},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),Q=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:Q,chargeCardDetailView:m,creditAccount:E,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:w?.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,B]=ts(y);if(B==="")return;const F=n.channel(h),L=u=>{f.current(B,u)};let C;if(F?.subscribed===!0)C=F,C.bind(B,L),l.has(h)||(l.add(h),v()),c.push(()=>{F.unbind(B,L)});else{if(C=F??n.subscribe(h),C.bind(B,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(B,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",qa="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",xs="charge-card-department-updated",Pn="charge-card-repayment-completed",wn="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}`),Bs=[_a,ka],Ls=he(function(e){const a=Qe(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(On({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(B=>de(B)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Y.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(B=>Qe(B)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const B=Re(t.state?.pathnameStackToGoBack),F=B.poppedPathname??Os(n.tenantEmailDomain);e(F,{state:{pathnameStackToGoBack:B.newStack}})},[e,t,n.tenantEmailDomain]),y=Ge(n);if(At({events:ta(y,Bs),onEvent:B=>{switch(B){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(Ka,{}):s.jsx(Ls,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Os=e=>`/${e}/cards`,Us={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,B]=d.useState(!1),F=ee.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const L=S(w=>de(w));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(w=>Un(w,n)),o=D.chargeCard,I=S(w=>w.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Y.isDebitCardFeatureEnabled),b=Ee(E,L),x=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,m=L.userRole.includes("charge_card_user"),O=Ie(L),M=Ae(L),R=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:x,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 w=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);r(w,{state:{pathnameStackToGoBack:U}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const w=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(w,{state:{pathnameStackToGoBack:U}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),P=S(w=>Nt(w.userState,F.userId)),Z=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(w=>w.statusCode==="success")===!0&&v===!1&&(setTimeout(Z,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const J=w=>{B(w)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Hs,{children:[s.jsx(We,{isAppContentDrawerOpen:h,handleDrawerToggle:J}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:P.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:()=>{J(!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:Ya.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=>`${Us.containerWidth.value(e.windowSize)}%`};
5
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
6
- `,Hs=Te.div`
7
- display: flex;
8
- min-height: 100%;
9
- width: 100%;
10
- flex: 1 1 auto;
11
- flex-direction: column;
12
- align-items: center;
13
- background-color: ${e=>e.theme.colors.grey4};
14
- `,Oa=gt.getLocalizedStrings().dateFormat,Ms={overlayWidth:new Aa(100,100,58)},vn=[Pn,Wa],$s=new Set(vn),Gs=he(function(e,a){const t=a.currentTenant?.companyId;return{plaidConnectionDetails:Yn(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:B,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&&q.trackCardsPayEarlyFormClick(c,v,y,"Back",l.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:l.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:l.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:l.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:l.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:L?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:L?.format(Oa.visual.MMMDCommaYYYYformat)},h,B,F),C==="cardPaymentHistory")a.closeDrawerHandler(!0),e(zt());else{const o=ze(u);t(o)}},onUpdatePaymentAccountStatus:(o,I,A)=>{e(qn(o,I,"bill_pay","bill_pay_detail",A))},onEstablishConnectionSuccess:()=>{e(fa(r.companyId,!0))},onFetchLinkTokenClick:o=>{e(Wn("external_account",o))},onEstablishConnectionClick:o=>{e(Kn(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)),Pt=({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 B=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(),[x,i]=d.useState(!1),[m,O]=d.useState(!1),{configValue:M}=F(Le.zeniCardsConfig),R=M.credit_card_auto_pay_threshold_by_company_id?.[o.companyId]??M.default_credit_card_auto_pay_threshold??_s,T=$t(b?.loggedInUserRoleMap),$=Gn(b?.loggedInUserRoleMap),G=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=S(z=>ya(z,o.companyId)),P=V.companyChargeCardInfo?.primaryFundingAccount,Z=V.allFundingAccounts.find(z=>z.id===P?.accountId),J=S(z=>qe(z,o.companyId)),w=Je(J.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(K=>K.id===z);let Q;if(f==="cardPaymentHistory"&&h){const K=h.paymentAccountId!=null?u.transferFromAccounts.find(re=>re.id===h.paymentAccountId):void 0;Q={amount:h.amount,isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Bt(),transferFrom:K??X}}else Q={amount:{amount:D.balance.amount+D.hold.amount,currencyCode:D.balance.currencyCode,currencySymbol:D.balance.currencySymbol},isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Bt(),transferFrom:X};j(Tt(Q)),O(!0)}},[u.fetchState,m,f,h,u.transferFromAccounts,o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,o.companyChargeCardInfo?.info?.isAutoPayEnabled,D.balance.amount,D.balance.currencyCode,D.balance.currencySymbol,D.hold.amount,j]);const U={isZeniCheckingEnabled:o.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:Z?.accType==="depositAccount",creditCardPaymentSourceAccountName:Z?.label,creditCardPaymentSourceAccountType:Z?.accType,creditCardPaymentSourceLastFourDigits:Z?.accountLast4,creditCardPaymentSourceBalance:Z?.accountBalance?.available?.amount??0};if(d.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&j(fa(o.companyId,!0))},[V.fetchState]),d.useEffect(()=>{u.updateStatus==="Completed"&&_!=null&&v&&l&&c&&q.trackCardsPayEarlyPayNowClick(w,n,_,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:y?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:y?.format(Oa.visual.MMMDCommaYYYYformat)},U,p,g)},[u.updateStatus,_,v,l,c,y]),d.useEffect(()=>{u.fetchState==="Completed"&&_!=null&&v&&l&&c&&!x&&e&&m&&_!=null&&(q.trackCardsPayEarlyFormView(w,n,_,t,o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,D.balance.amount,U,p,g),i(!0))},[u,v,l,c,x,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,Q)=>{Q.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:B,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{v&&l&&c&&_!=null&&q.trackCardsPayEarlyFormClick(w,n,_,"Pay Now",u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},U,p,g),j(zn({companyId:o.companyId}))},onDismissClick:te,onSaveChangesToLocalStore:z=>{j(Tt(z))},currentTenant:o,hasZeniAccountsAdminAccess:T,isZeniAccountsUser:$,isZeniAccountSetupEnabled:G,productInformation:n,sourcePage:f,controllerEmails:w,autoPayThreshold:R,paymentSourceInformation:U,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isCashbackInfoFetchStateCompleted:v,isCreditCardInfoFetchStateCompleted:l,isDebitCardInfoFetchStateCompleted:c,paymentInitiatedDate:y,maxInsuredAmount:C.maxInsuredAmount})})})})},zs=Te(ks)`
15
- display: flex;
16
- min-height: 100%;
17
- flex-direction: column;
18
- `,wt=e=>e!=null&&typeof e=="object"?e:null,ce=e=>typeof e=="string"?e:void 0,we=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Ua=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",tt=e=>{if(e==null||typeof e!="object")return!1;const a=e;return typeof a.transaction_id=="string"&&typeof a.amount=="number"&&typeof a.currency_code=="string"&&typeof a.currency_symbol=="string"&&typeof a.direction=="string"&&!!Ua(a.transaction_status)&&!!Ua(a.transaction_type)},vt=(e,a)=>{const t=e?.card_status;if(!Ua(t))return null;const r=e?.is_locked_by_admin;return{cardId:a,cardStatus:t,isLockedByAdmin:typeof r=="boolean"?r:void 0}},it=[An,En,kn,_n,Dn,aa,Et,Wa,kt,_t,Dt],Tn=[_a,ka],Ys=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:Ya.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:B,isChargeCardFeatureEnabled:F}=a,{tenantEmailDomain:L}=r;return{onEventReceived:(C,u)=>{(({event:D,data:o,cardId:I,dispatch:A,subscribedEvents:j})=>{const E=wt(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 x=ce(E?.transaction_id),i=E?.transaction_status;return x!=null&&Ua(i)?void A(nr({transactionId:x,transactionStatus:i})):void A(Ze(I,null,null,!0))}case aa:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=vt(E,b);return x!=null?void A(mt(x)):void A(na(I,!0))}case Et:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=ce(E?.currency_code),i=ce(E?.currency_symbol),m=we(E?.balance);return x!=null&&i!=null&&m!=null?(A(tr({cardId:b,currencyCode:x,currencySymbol:i,balance:m,hold:we(E?.hold),dailyPurchaseSpends:we(E?.daily_purchase_spends),monthlyPurchaseSpends:we(E?.monthly_purchase_spends),dailyWithdrawals:we(E?.daily_withdrawals),monthlyWithdrawals:we(E?.monthly_withdrawals)})),void A(Ne(!0))):(A(na(I,!0)),void A(Ne(!0)))}case Wa:{const b=ce(E?.currency_code),x=ce(E?.currency_symbol),i=we(E?.available_amount),m=we(E?.balance_amount);return b!=null&&x!=null&&i!=null&&m!=null?void A(ar({currencyCode:b,currencySymbol:x,available:i,balance:m,hold:we(E?.hold_amount),cashback:we(E?.cashback_amount)})):void A(Ne(!0))}case En:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(er({cardId:b,transaction:x})):void A(Ze(I,null,null,!0))}case kn:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(Qn({cardId:b,declineReason:ce(E?.decline_reason),transaction:x})):void A(Ze(I,null,null,!0))}case _n:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(Xn({cardId:b,transaction:x})):void A(Ze(I,null,null,!0))}case Dn:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=ce(E?.transaction_id),i=E?.attachment_file_paths;return x!=null&&Array.isArray(i)&&i.every(m=>typeof m=="string")?void A(Jn({cardId:b,transactionId:x,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:Ys})},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(Qt(C,t))},onCloseChargeCard:C=>{e(Xt(t,C))},onFetchChargeCardsRecurringExpenses:()=>{e(Jt([t]))},updateChargeCardName:(C,u)=>{e(qt(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(Kt(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&&q.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,B),_(C)}}})(Za(is));function Ks(){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:B}=_(Le.zeniCardsConfig),F=B.enable_card_controls_for_company_ids,L=B.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(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=I(Y.isDebitCardFeatureEnabled),E=Ee(j,l),b=ke({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:E}),{isFeatureEnabled:x}=I(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=I(Y.isCardsCommentingEnabled),m=Ae(l),O=Ie(l),M=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:A,isBookKeepingTenant:m,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:M}),T=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!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:P,creditAccountRepayment:Z}=S(H=>Xe(H)),J=ee.getZeniOtpTokenForCardHolder(r),w=S(H=>lt(H,r,G,R)),{isAiCfoAccessEnabled:U,onAskAiCfoClick:te}=In({mobileExploreReferrer:"Card Detail"});un({isDataReady:w.fetchState==="Completed"});const ae=S(H=>Qe(H)),k=w.chargeCard,z=$e(),X=He(z?.loggedInUserRoleMap),Q=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_virtual_debit_card",K=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_physical_credit_card",re=k?.type.code==="business_virtual_debit_card"||k?.type.code==="business_virtual_credit_card",De=k?.type.code==="business_virtual_debit_card",Oe=Ea(R,$,X,P,Z),W=fn(Q,w),fe=St(X,ae),Pe=Me(R,b,T,$),Ue=w.depositAccountLimitFetchState.fetchState!=="Completed"&&w.depositAccountLimitFetchState.fetchState!=="In-Progress",Fe=S(H=>qe(H,l.companyId)),xe=Je(Fe.controllers),ne=S(H=>k?.cardCreatedByUser?.userId!=null?xa(H.userRoleState,k?.cardCreatedByUser?.userId):void 0),Da=S(H=>ne?.accountingClassIDs[0]!=null?Ba(H.classState,{classId:ne?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=S(H=>k?.cardHolderUser?.userId!=null?xa(H.userRoleState,k?.cardHolderUser?.userId):void 0),oa=S(H=>ie?.accountingClassIDs[0]!=null?Ba(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||w.fetchState==="Completed"||w.fetchState==="In-Progress"||r==null||(u(!0),a(ca(r,G,R,!1)))},[C,w,r,a]),d.useEffect(()=>{!D&&w.fetchState==="Completed"&&w.chargeCard?.connectedAccountId!=null&&Q&&Ue&&X&&(o(!0),a(Yt({depositAccountId:w.chargeCard?.connectedAccountId})))},[D,w,a,Ue,X]),d.useEffect(()=>{ae.fetchState!=="Completed"&&ae.fetchState!=="In-Progress"&&X&&a(ha()),y!=="Completed"&&y!=="In-Progress"&&a(Vt()),w.transactionStatistics.fetchState!=="Completed"&&w.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,w.transactionStatistics.fetchState,V.fetchState]),d.useEffect(()=>{if(!(w.fetchState!=="Completed"||R&&P.fetchState!=="Completed"||k==null||w.transactionStatistics.fetchState!=="Completed"||Q&&X&&w.depositAccountLimitFetchState.fetchState!=="Completed")){const H=k.type.code.includes("physical"),ue=H?k.cardActivationAttemptHistory[0]?.timestamp:k.createTime;q.trackCardsCardDetailView(xe,Pe,{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:w.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:w.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:w.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:w.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:w.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:w.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:ct(k.cardCreatedByUser,!1),cardIssuedByEmail:k.cardCreatedByUser?.email,cardIssuedByUserId:k.cardCreatedByUser?.userId,cardIssuedByRole:ne?.userRoles,cardIssuedByDepartment:Da?.className},{cardholderName:ct(k.cardHolderUser,!1),cardholderEmail:k.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:k.cardHolderUser?.userId,cardholderDepartment:oa?.className},Oe,W)}},[w.fetchState,w.depositAccountLimitFetchState.fetchState,w.transactionStatistics.fetchState,P.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,Be)=>{Be.onEventReceived(H,ue)},onSubscribed:H=>{H.onPusherSubscribed()}},ma=()=>{if(r!=null&&k!=null){const{ownerName:H,cardName:ue,utilisation:Be,limit:Ye,frequency:N,cardColor:ge}=rt(k),be=k.cardHolderUserId===c.userId;q.trackCardsDetailPageViewed(r,H,ue,Be,Ye,N,ge,be)}};d.useEffect(()=>{if(w.fetchState==="Completed"){const H=w.chargeCard;if(H?.status.code==="inactive"||Q&&H?.isPinSet===!1||K&&v){const ue=pe(l.tenantEmailDomain,r,c,k,v);e(ue)}}},[w.fetchState]);const Ca=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:Be,cardName:Ye,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;q.trackCardsDetailPageClicked(r,Be,Ye,N,ge,be,H,et,ue)}},Ja=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:Be,cardName:Ye,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;q.trackCardsVerifyPopUpClick(r,Be,Ye,N,ge,be,H,et,ue)}},Pa=P.balance.amount+P.hold.amount,wa=l.companyChargeCardInfo?.info?.primaryFundingAccount,Xa=V.allFundingAccounts.find(H=>H.id===wa?.accountId),va=w.chargeCard!=null,Qa=w.depositAccountLimit!=null;return w.fetchState!=="Error"||va?!va&&(w.fetchState==="In-Progress"||w.fetchState==="Not-Started")||je.saveStatus.fetchState==="In-Progress"||!Qa&&Q&&X&&w.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(os,{}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:v}),w.fetchState==="Completed"?s.jsx(yt,{analytics:q,onLoad:ma}):null,p===!0?s.jsx(Pt,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:p,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:Pe,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,creditAccountSpentAmount:Pa,isDebitCardInfoFetchStateCompleted:!Q||!X||w.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!R||P.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!X||ae.fetchState==="Completed",paymentInitiatedDate:Z.initiatedRepaymentDate}):null,s.jsx(Zs,{...ua,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:Ja,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:x,controllerEmails:xe,chargeCardCashbackDetailState:ae,productInformation:Pe,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,classListFetchState:y,primaryFundingAccountDetails:Xa,currentTenant:l,cardProviderId:w.chargeCard?.cardProviderID,cardId:r,creditAccount:P,creditAccountRepayment:Z,includeCreditAccountInfo:G,signedInUserToken:J,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:U,onAskAiCfoClick:te,isCardsCommentingEnabled:i})]}):s.jsx(Ka,{})}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,wn,ka,_a,qa,Dt,xs,kt,_t,Et],Ws=new Set(Fn),dt=vs((e,a,t,r)=>{e(ga(a,t,r,!0))},400),qs=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
- `,Js=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:B,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:x}=p;return{onChargeCardRowClick:(i,m)=>{const O=bn(x,i);let M;O!=null&&((T=>{const $=T.limit.amount-T.available.amount,G=`${T.cardHolderUser?.firstName.toLowerCase()} ${T.cardHolderUser?.lastName.toLowerCase()}`,V=T.cardName,P=T.department?.className??"",Z=T.limit.amount,J=T.creditLimitFrequency.name;q.trackCardsListRowClicked(G,V,P,$,Z,J,f.userId===T.cardHolderUserId)})(O),Ke(v,y,L)&&q.trackCardsCardListRowClick(F,D,"Card Row Item","row_clicked",m+1,{cardOwner:ct(O.cardHolderUser,!1),cardName:O.cardName,cardType:O.type.code.includes("credit")?"credit":"debit",cardStatus:O.status.code,cardUtilizationAmount:ra(O.limit.amount-O.available.amount),cardUtilizationPercent:O.limit.amount>0?Math.round((O.limit.amount-O.available.amount)/O.limit.amount*100):0,cardLimit:ra(O.limit.amount)},o,I,A)),M=O?.status.code==="request_on_hold"&&f.userId===O.cardHolderUserId?yn(b):pe(b,i,f,O);const R=ye(n.state?.pathnameStackToGoBack,n.pathname);t(M,{state:{pathnameStackToGoBack:R}})},onFetchChargeCardsRecurringExpenses:i=>{e(Jt(i))},onFetchDepositAccountLimit:i=>{e(Yt({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Ar(i))},onChargeCardRevokeInviteClick:i=>{e(Wt(i))},onLockChargeCardList:(i,m)=>{e(Ir(i,m))},onUnlockChargeCardList:i=>{e(Sr(i))},onCloseChargeCardList:(i,m)=>{e(yr(i,m))},onRevokeChargeCardList:i=>{e(br(i))},updateChargeCardListSpendLimit(i,m,O){e(gr(i,m,O.code))},onLockChargeCard:(i,m)=>{e(en(E,i,m))},onUnlockChargeCard:i=>{e(Qt(E,i))},onCloseChargeCard:(i,m)=>{e(Xt(i,m))},onUpdateSpendLimit(i,m,O,M){e(Zt(i,m,O.code,M))},updateChargeCardName:(i,m)=>{e(qt(E,i,m))},onClickSetupIcon:()=>{q.trackCardsListPageClicked("settings"),Ke(v,y,L)&&o!=null&&q.trackCardsSettingsClick(F,D,o,I,A);const i=Ps(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onIssueCardClick:()=>{q.trackCardsListPageClicked("new card"),Ke(v,y,L)&&o!=null&&q.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)=>{Ke(v,y,L)&&o!=null&&q.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:()=>{Ke(v,y,L)&&o!=null&&q.trackCardsCashbackOverviewClick(F,D,o,"Cashback Overview","cashback_details_viewed",I,A),t("./cashback")},onClickStatementsIcon:()=>{Ke(v,y,L)&&o!=null&&q.trackCardsStatementsClick(F,D,o,I,A),t("./statements")},onCreateNowClick:i=>{Ke(v,y,L)&&o!=null&&q.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&&!B?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,m)=>{u==="Completed"&&r.company!=null&&o!=null&&q.trackCardsPayEarlyClick(F,D,o,"Card List",i,m,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:C?.accType==="depositAccount",creditCardPaymentSourceAccountName:C?.label,creditCardPaymentSourceAccountType:C?.accType,creditCardPaymentSourceLastFourDigits:C?.accountLast4,creditCardPaymentSourceBalance:C?.accountBalance?.available?.amount??0},I,A);const O=Qs(b);t(O)},navigateToCreditCardPaymentHistoryPage:()=>{const i=ec(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},shouldShowPayNowInfoTooltip:j,onSetRowActionCardId:i=>{e(hr(i))},onSetBulkActionCardIds:i=>{e(an(i))},onEventReceived:i=>{Ws.has(i)&&dt(e,g,v&&y,_&&l)},onPusherSubscribed:()=>{dt(e,g,v&&y,_&&l)}}})(Za(ds));function Lt({isPaymentDrawerOpen:e}){const a=me(),t=Ce(),r=Se(),n=d.useCallback((N,ge)=>{t(an([])),a(N,ge)},[t,a]),[f,p]=d.useState(!1),[g,_]=d.useState(ee.getPayNowInfoTooltip()??!1),c=N=>{ee.savePayNowInfoTooltip(N),_(N)},[l,v]=d.useState(!1),y=ee.getSignedInUser(),h=S(N=>de(N)),[B,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(Y.isCashbackFeatureEnabled),{isFeatureEnabled:x}=j(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=j(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=j(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:O}=j(Y.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:M}=j(Y.isCardsCommentingEnabled),R=Ee(i,h),T=ke({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:R}),$=Ie(h),G=Ae(h),V=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,P=_e({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:V}),Z=gn({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G}),{configValue:J}=E(Le.zeniCardsConfig),w=$e(),U=He(w?.loggedInUserRoleMap),te=S(N=>qe(N,h.companyId)),ae=Je(te.controllers),k=J.charge_card_cashback_rate_per_transaction!=null?J.charge_card_cashback_rate_per_transaction:.0175,z=J.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??J.default_credit_card_pay_now_threshold??Ds,X=J.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(J.enable_card_controls_for_company_ids)&&J.enable_card_controls_for_company_ids.includes(h.companyId),Q=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,K=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,De=S(N=>Mt(N)),Oe=bt(De.updateStatus),W=S(N=>ea(N,I,T&&A,P&&re)),fe=W.cards.filter(N=>N.type.code.includes("debit")).map(N=>N.connectedAccountId),Pe=[...new Set(fe)],Ue=S(N=>Qe(N)),Fe=S(N=>Ga(N,Pe)),xe=S(N=>ya(N,h.companyId)),ne=xe.companyChargeCardInfo?.primaryFundingAccount,Da=xe.allFundingAccounts.find(N=>N.id===ne?.accountId),ie=W.fetchState,oa=W.creditAccount;un({isDataReady:ie==="Completed"});const{creditAccountRepayment:le}=S(N=>Xe(N)),je=S(N=>ja(N).firstViewAfterActivation),{areTenantIdsInSync:ia}=Cn(),da=St(U,Ue),la=Ea(P,re,U,oa,le),ua=It(T,A,U,Fe,W.debitCardSummary),ma=Me(P,T,A,re),Ca=W.creditAccount.balance.amount+W.creditAccount.hold.amount;if(d.useEffect(()=>{ie==="Completed"&&(ee.getPayNowInfoTooltip()==null||Ca<z*W.creditAccount.limit.amount/100)&&c(!0)},[ie,z,Ca,W.creditAccount.limit.amount]),d.useEffect(()=>{if(e!=null&&e===!0&&le.initiatedRepayments.amount===0&&le.fetchState==="Completed"||Oe==="In-Progress"&&De.updateStatus==="Completed")c(!1),p(!0);else if(le.initiatedRepayments.amount>0&&le.fetchState==="Completed"){p(!1),document.body.style.overflow="auto";const N=ze(h.tenantEmailDomain);n(N)}},[e,le.initiatedRepayments.amount,le.fetchState,Oe,De.updateStatus,n,h.tenantEmailDomain]),d.useEffect(()=>{!B&&(re||A)&&ia&&(F(!0),t(ga(I,T&&A,P&&re,!1)))},[B,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"||P&&le.fetchState!=="Completed"||T&&A&&U&&Fe.fetchState!=="Completed"||q.trackCardsCardListView(ae,ma,da,la,ua)},[ie,oa,le.fetchState,Fe.fetchState,U]),y==null)throw Error("Can't access charge card list page without signing in...");const Ja=S(N=>tn(N.userState,N.userRoleState,N.userListViewState,"cardAdmin")),Pa=Ct(w?.loggedInUserRoleMap),wa=N=>{C(N)},Xa=W.creditAccount.limit,va=()=>{p(!1),n("..")},Qa=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:P,isTOSAccepted:Q,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:Pa}),H=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:T,isTOSAccepted:K,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:Pa}),ue=Qa||H,Be=Ge(h),Ye={events:ta(Be,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:q,onLoad:()=>{q.trackPageLoaded(pn.Event.cardsListPage),(P&&!re||T&&!A)&&q.trackCardsPromoView(ae,{isCreditCardOffered:P,isDebitCardOffered:T,isDebitCardEnabled:A,isCreditCardEnabled:re},"Banner",T&&!A?"Debit Card":P&&!re?"Credit Card":"","Card List")}}),s.jsx(za,{showConfetti:je})]}):null,f===!0?s.jsx(Pt,{closeDrawerHandler:va,isPaymentDrawerOpen:f,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ca,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isDebitCardInfoFetchStateCompleted:!(T&&A&&U)||Fe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!P||le.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!U||Ue.fetchState==="Completed",paymentInitiatedDate:le.initiatedRepaymentDate}):null,s.jsxs(qs,{children:[s.jsx(We,{isAppContentDrawerOpen:L,handleDrawerToggle:wa}),s.jsx(Js,{...Ye,isCashbackFeatureEnabled:b,isChargeCardFeatureEnabled:P,isDebitCardFeatureEnabled:T,isCreditCardProductVisibleForExpressInterest:Z,updatePayNowInfoTooltip:c,showPayNowInfoTooltip:g,creditCardPayNowThreshold:z,signedInUser:y,chargeCardListState:W,location:r,admins:Ja.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:X,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:U,includeCreditAccountDebitSummaryAndCashbackInfo:I,onClickMenuIcon:()=>{wa(!0)},creditLimit:Xa,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:A,isEarlyPayEnabled:m,isChargeCardPaymentHistoryFeatureEnabled:O,cashbackRate:k,controllerEmails:ae,chargeCardCashbackDetailState:Ue,depositAccountListWithDebitCardIssued:Fe,isChargeCardTOSAccepted:Q,isDebitCardTOSAccepted:K,primaryFundingAccountDetails:Da,chargeCardSetUpViewFetchState:xe.fetchState,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isAiCfoAccessEnabled:u,onAskAiCfoClick:D,isCardsCommentingEnabled:M})]})]}):(Q||K)&&U===!0?s.jsx(Fa,{to:"../setup"}):ue?s.jsx(Fa,{to:"../promo"}):s.jsx(Sa,{fetchState:ie})}const Xs=e=>`/${e}/cards/new`,Qs=e=>`/${e}/cards/payment`,ec=e=>`/${e}/cards/payment-history`,xn=[Pn,wn],ac=new Set(xn),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,B]=d.useState(null),F=!f.userRole.includes("charge_card_user"),L=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:C}=n(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Y.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,x=$e(),i=He(x?.loggedInUserRoleMap),m=S(k=>ea(k,F,o&&L,E&&b)),O=d.useMemo(()=>{const k=m.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(k.map(z=>z.connectedAccountId))]},[m.cards]),M=S(k=>Qe(k)),R=S(k=>Ga(k,O)),{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]),P=d.useMemo(()=>Me(E,o,L,b),[E,o,L,b]),Z=m.creditAccount.balance.amount+m.creditAccount.hold.amount,J=d.useMemo(()=>h!=null?p.repaymentHistory.find(k=>k.cardRepaymentId===h):void 0,[h,p.repaymentHistory]),w=d.useCallback(k=>{B(k),t(ga(F,o&&L,E&&b,!1)),y(!0)},[t,F,o,L,E,b]),U=d.useCallback(()=>{y(!1),B(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,xn),eventCallback:(k,z,X)=>{X.onEventReceived(k)},onSubscribed:k=>{k.onPusherSubscribed()}};return s.jsxs(s.Fragment,{children:[v?s.jsx(Pt,{closeDrawerHandler:U,isPaymentDrawerOpen:v,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:Z,productInformation:P,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:J}):null,s.jsx(tc,{...ae,location:a,navigate:e,accountInfoByAccountId:p.accountInfoByAccountId,onRetryPaymentClick:w})]})}const Rt=Te.div`
26
- display: flex;
27
- height: 100vh;
28
- width: 100%;
29
- flex: 1 1 auto;
30
- flex-direction: column;
31
- overflow: auto;
32
- align-items: center;
33
- background-color: ${e=>e.theme.colors.grey4};
34
- `,Ot=gt.getLocalizedStrings().months;function rc(){const e=me(),a=Ce(),t=Se(),{creditAccount:r,creditAccountRepayment:n}=S(P=>Xe(P)),f=`${mn.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[p,g]=d.useState(!1),[_,c]=d.useState(!1),l=S(P=>Dr(P)),{useFeatureGate:v}=oe(),y=S(P=>de(P)),{isFeatureEnabled:h}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=v(Y.isCardsCommentingEnabled),L=Sn(F?y.companyId:void 0,{clearParams:F&&l.fetchState==="Completed"}),C=Ee(B,y),u=ke({isDebitCardFeatureEnabled:B,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(P=>qe(P,y.companyId)),x=Je(b.controllers),i=S(P=>rn(P)),m=i.cards.filter(P=>P.type.code.includes("debit")).map(P=>P.connectedAccountId),O=[...new Set(m)],M=S(P=>Ga(P,O)),R=S(P=>Pr(P));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(wr(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 P="",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,Q]=z.split("-");P=`${Ot[parseInt(k)-1]} ${ae}`,Z=`${Ot[parseInt(Q)-1]} ${X}`}const J=Me(A,u,j,E),w=Ea(A,E,!0,r,n),U=It(u,j,!0,M,R);q.trackCardsCreditCardStatementsView(x,J,{numberOfStatements:l.statements.length,oldestStatementMonthYear:P,latestStatementMonthYear:Z},w,U)}},[l.fetchState,r.fetchState,n.fetchState,M.fetchState,i.fetchState,R.fetchState]);const T=()=>{const P=Re(t.state?.pathnameStackToGoBack),Z=P.poppedPathname??"..";e(Z,{state:{pathnameStackToGoBack:P.newStack}})},$=S(P=>Qe(P)),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 P=Me(A,u,j,E);return s.jsx(Rt,{children:s.jsx(ms,{currentTenantCompanyName:y.companyName,statementListView:l,productInformation:P,onBackClick:T,authParams:V,controllerEmails:x,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:E,isCardsCommentingEnabled:F,initialOpenThreadRequest:L,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:M,debitCardSummary:R,downloadEndPoint:f})})}}const Bn=[aa,qa],sc=new Set(Bn),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),B=d.useRef(!1),F=d.useRef(null);d.useEffect(()=>()=>{F.current!=null&&(clearTimeout(F.current),F.current=null)},[]);const[L,C]=d.useState(!1),[u,D]=d.useState(!1),o=ee.getSignedInUser();if(o==null)throw Error("Can't access onboarding card page without signing in...");const I=S(U=>de(U)),{configValue:A}=f(Le.zeniCardsConfig),j=S(U=>Tr(U)),{tenantEmailDomain:E}=I,b=S(U=>U.settingsViewState.profile.fetchState),x=S(U=>U.chargeCardListState.fetchState),i=S(U=>U.settingsViewState.profile.userId),m=S(U=>U.chargeCardConfigState.fetchState);d.useEffect(()=>{p===!1&&b!=="In-Progress"&&b!=="Completed"&&(t(Fr()),g(!0)),_===!1&&m!=="In-Progress"&&m!=="Completed"&&(t(Va()),c(!0)),l===!1&&x==="Not-Started"&&(v(!0),t(ve()))},[p,l,x,_,m]),d.useEffect(()=>{b==="Completed"&&L===!1&&i!=null&&x==="Completed"&&j.cards.length>0&&(t(xr({userId:i})),t(cn({cardId:j.cards[j.cards.length-1].id})),C(!0))},[b,L,i,x]),d.useEffect(()=>{if(!y&&j.fetchState==="Completed"&&j.cards.length===0){const U=Re(n.state?.pathnameStackToGoBack),te=U.poppedPathname??ze(E);r(te,{state:{pathnameStackToGoBack:U.newStack}})}},[j.fetchState,j.cards,y]);const O=S(U=>ja(U)),M=bt(O.updateStatus.fetchState),R=O.currentDisplayedCardId,{useFeatureGate:T}=oe(),{isFeatureEnabled:$}=T(Y.isChargeCardFeatureEnabled),G=!!I.companyChargeCardInfo?.info?.isChargeCardEnabled,V=!I.userRole.includes("charge_card_user")&&$&&G,P=S(U=>R!=null?on(U.chargeCardState,R):null),Z=()=>{R!=null&&(B.current=!0,F.current!=null&&clearTimeout(F.current),F.current=setTimeout(()=>{B.current=!1,F.current=null},5e3),t(ca(R,V,!0)),t(ve(!0)),h(!0))},J=Ge(I);At({events:ta(J,Bn),onSubscribed:()=>{t(ve(!0))},onEvent:(U,te)=>{if(!sc.has(U))return;const ae=wt(te),k=B.current;if(U===aa){const X=ce(ae?.card_id)??R;if(X!=null){const Q=vt(ae,X);if(Q!=null)return t(mt(Q)),void(X!==R||k||Z())}}if(U===qa)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&&P!=null&&P.status.code!=="request_on_hold"){const U=pe(I.tenantEmailDomain,R,o,P),te=ye(n.state?.pathnameStackToGoBack,n.pathname);t(Br()),P?.type.code==="business_virtual_credit_card"&&t(Na()),r(U,{state:{pathnameStackToGoBack:te},replace:!0}),B.current=!1,F.current!=null&&(clearTimeout(F.current),F.current=null)}},[y,P?.status.code]),d.useEffect(()=>{M==="In-Progress"&&O.updateStatus.fetchState==="Completed"&&setTimeout(Z,3e3)},[M,O.updateStatus.fetchState]);const w=U=>{D(U)};if(b!=="Completed"||j.cards.length===0)return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:w}),s.jsx(Cs,{})]});if(i==null)throw Error("Can't access my userId.");return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:w}),s.jsx(ic,{chargeCardListView:j,cardUserOnboardingView:O,navigate:r,currentTenant:I,myUserId:i,location:n,chargeCardCashbackRatePerTransaction:A.charge_card_cashback_rate_per_transaction!=null?A.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{w(!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
- `,Ut=Te.div`
40
- display: flex;
41
- min-height: 100%;
42
- width: 100%;
43
- flex: 1 1 auto;
44
- flex-direction: column;
45
- align-items: center;
46
- background-color: ${e=>e.theme.colors.grey4};
47
- `,lc={containerWidth:new Aa(100,58)},uc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p,useFeatureGate:g}=oe(),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),[B,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(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=g(Y.isDebitCardFeatureEnabled),A=Ee(I,C),j=ke({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:A}),E=Ie(C),b=Ae(C),x=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=_e({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:o,isBookKeepingTenant:b,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:x}),m=D.chargeCard,O=S(V=>V.chargeCardConfigState.fetchState);d.useEffect(()=>{_===!1&&O!=="In-Progress"&&O!=="Completed"&&(t(Va()),c(!0)),l===!1&&D.fetchState==="Not-Started"&&(v(!0),t(ca(n,!1,i)))},[l,D.fetchState,_,O]);const M=m?.type.code==="business_physical_debit_card"||m?.type.code==="business_virtual_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(y===!1&&(M===!1||M&&m.status?.code!=="active"||M&&m.status.code==="active"&&m.isPinSet||m.cardHolderUserId!==L.userId)){const V=pe(C.tenantEmailDomain,n,L,m,!0),P=ye(f.state?.pathnameStackToGoBack,f.pathname);r(V,{state:{pathnameStackToGoBack:P}})}else if(y&&D.isRefreshingViewInBackground===!1&&m?.isPinSet===!0){t(Or({chargeCardId:n}));const V=pe(C.tenantEmailDomain,n,L,m,!0),P=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(V,{state:{pathnameStackToGoBack:P}})}}},[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(O!=="Completed"||m==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(T?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(pc,{children:[s.jsx(We,{isAppContentDrawerOpen:B,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:Ya.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(Kt(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onSetPinSuccess:()=>{e(Ur({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("activate")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(hs),Cc=Te.div`
48
- display: flex;
49
- flex-direction: column;
50
- width: ${e=>`${lc.containerWidth.value(e.windowSize)}%`};
51
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
52
- box-shadow: ${e=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
53
- `,pc=Te.div`
54
- display: flex;
55
- min-height: 100%;
56
- width: 100%;
57
- flex: 1 1 auto;
58
- flex-direction: column;
59
- align-items: center;
60
- background-color: ${e=>e.theme.colors.grey4};
61
- box-shadow: ${e=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
62
- `,hc={overlayWidth:new Aa(at[12],at[12],at[9])},fc=he(function(e,a){const t=pt(e,!1,!1),r=a.lineId,n=t.customAddress[r],f=t.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:a.googleAPIKey,customAddress:n,customAddressStatus:f,lineId:r}},function(e,a){const{newCustomAddressId:t,lineId:r,chargeCardTypeOption:n}=a;return{onSubmitHandler:f=>{t!=null&&e(dn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const p=Ts(f);e(Nr({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:p})),e(Hr(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{a.onDismissClick(),t!=null&&e(Vr({addressId:t,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(fs),gc=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:t})=>{const r=ft(),n=Ia(),f=()=>{a()},p=S(g=>jr(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(hn,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:hc.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,_)=>(_==="backdropClick"||_==="escapeKeyDown")&&f(),children:s.jsx(fc,{googleAPIKey:Ya.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(Y.isIssuePhysicalCardEnabled),{isFeatureEnabled:_}=p(Y.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:c}=p(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Y.isChargeCardFeatureEnabled),v=S($=>de($)),y=Ee(c,v),h=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:y}),B=Ie(v),F=Ae(v),L=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,C=_e({isCardsOnlyTenant:B,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,x=S($=>b!=null?on($.chargeCardState,b):void 0),[i,m]=d.useState(null),[O,M]=d.useState(null),R=()=>{m(null)},T=($,G)=>{m($),M(G)};return d.useEffect(()=>{if(E==="Completed"){if(b!=null&&x?.type.code==="business_virtual_debit_card"){let $;$=x?.status.code==="request_on_hold"&&e.userId===x.cardHolderUserId?yn(v.tenantEmailDomain):pe(v.tenantEmailDomain,b,e,x),a($)}else a("../");t(ln())}},[E,b]),j==="Completed"?s.jsxs(s.Fragment,{children:[i!==null&&O!==null?s.jsx(gc,{closeDrawerHandler:R,lineId:i,chargeCardTypeOption:O}):null,s.jsx(bc,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:_,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:C,isChargeCardSetupEnabled:o,isDebitCardSetupEnabled:I,navigate:a,fetchState:A.fetchState,openAddAddressDrawerHandler:T,defaultCardType:f==="creditCard"||f==="debitCard"?f:void 0})]}):j==="Error"?s.jsx(Ka,{}):s.jsx(bs,{})}const Ln=[aa,qa],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=>qe(T,g.companyId)),c=Je(_.controllers),{useFeatureGate:l}=oe(),{isFeatureEnabled:v}=l(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(Y.isDebitCardFeatureEnabled),h=Ee(y,g),B=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:B,chargeCardsCreditAccountLimit:o}),A=He(C?.loggedInUserRoleMap),j=S(T=>Qe(T)),{creditAccount:E,creditAccountRepayment:b}=S(T=>Xe(T)),x=S(T=>rn(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),i=[...new Set(x)],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&&O!=null){const T=pe(g.tenantEmailDomain,p.cards[0].id,O,p.cards[0]);e(T,{state:{message:t.state?.message}})}},[p.fetchState,p.cards]);const O=ee.getSignedInUser();d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&I&&L&&A&&a(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&A&&a(ut()),m.fetchState!=="Completed"&&m.fetchState!=="In-Progress"&&B&&F&&A&&a(sn())},[E.fetchState,b.fetchState,a,m.fetchState,B,F,A,I,L]);const M=Ge(g);if(At({events:ta(M,Ln),onEvent:(T,$)=>{if(!Sc.has(T))return;const G=wt($);if(T===aa){const V=ce(G?.card_id);if(V!=null){const P=vt(G,V);if(P!=null)return void a(mt(P))}}a(ve(!0))},onSubscribed:()=>{a(ve(!0))}}),O==null)throw Error("Can't access address page without signing in...");const R=p.cards!=null&&p.cards.length>0;if(p.fetchState==="Completed"||R){const T=Me(I,B,F,L);return s.jsx(Ic,{children:s.jsx(Ac,{navigate:e,currentTenant:g,signedInUser:O,productInformation:T,myPendingActivationChargeCardListState:p,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:B,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&&q.trackCardsPromoPageClicked("enable cards"),n)switch(q.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(q.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 B=h.poppedPathname;B==null&&(B=f||p?"..":"../.."),t(B,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(Na()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Kr(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(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:v}=p(Y.isChargeCardFeatureEnabled),{configValue:y}=f(Le.zeniCardsConfig),h=S(ne=>de(ne)),B=S(ne=>qe(ne,h.companyId)),F=Je(B.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,x=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:E}),i=_e({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:b}),m=gn({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j}),O=x&&i===!1,M=I?.businessVerificationStatus?.code==="verified"&&(O||o?.accType==="depositAccount"||Yr(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,P=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,Z=ne=>{_(ne)},J=S(ne=>ne.chargeCardSetupViewState.fetchState);if(R==null)throw Error("Can't access Charge Card promo page without signing in...");const w=$e(),U=He(w?.loggedInUserRoleMap),te=Ct(w?.loggedInUserRoleMap),[ae,k]=d.useState(!1),[z,X]=d.useState(!1),[Q,K]=d.useState(!1);d.useEffect(()=>{ae===!1&&C.state?.message==="activation"&&k(!0)},[C.state]),d.useEffect(()=>{z||J!=="Not-Started"||u==null||(X(!0),n(fa(u,!0)))},[z,J,u,n]);const re=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:m,isTOSAccepted:$,isSetupEnabled:G,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),De=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:x,isTOSAccepted:P,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),Oe=x&&De&&m&&b>=0&&re?"debit_and_credit":x&&De?"debit":"credit",W=ws(r,Oe),fe=D?.chargeCardTermsDetails?.fetchStatus?.fetchState,Pe=d.useRef(null);d.useEffect(()=>{fe==="In-Progress"?Pe.current=W:fe!=="Error"&&fe!=="Not-Started"||(Pe.current=null)},[fe,W]);const Ue=fe!=="In-Progress"&&fe!=="Completed"||Pe.current==null?W:Pe.current;d.useEffect(()=>{W==="credit"&&(G||m===!1&&V)||W==="debit"&&V||W==="debit_and_credit"&&V&&G?e("../"):(W==="debit_and_credit"&&$===!0&&P===!0||W==="credit"&&($===!0||m===!1&&P===!0)||W==="debit"&&P===!0)&&U===!0&&e("../setup")},[M,G,V,W,$,P]),d.useEffect(()=>{Q||(n(Zr("cardAdmin")),K(!0))},[Q]);const Fe=S(ne=>tn(ne.userState,ne.userRoleState,ne.userListViewState,"cardAdmin")),xe=Me(m,x,V,G);return(re||De)&&J==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:q,onLoad:()=>{if(q.trackPageLoaded(pn.Event.cardsPromoPage),!!m&&!G||!!x&&!V||!!m&&!!x&&!V&&!G){const ne=Dc({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:G,isCreditCardProductVisibleForExpressInterest:m,isDebitCardProductVisible:x});q.trackCardsPromoView(F,xe,"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:Ue,controllerEmails:F,productInformation:xe,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 Jc(){const e=Se(),a=S(J=>de(J)),{useFeatureGate:t}=oe(),{isFeatureEnabled:r}=t(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=t(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=t(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:p}=t(Y.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,B=$e(),F=He(B?.loggedInUserRoleMap),L=Ct(B?.loggedInUserRoleMap),{isFeatureEnabled:C}=t(Y.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)&&qr(B?.loggedInUserRoleMap),j=Jr(B?.loggedInUserRoleMap),E=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!I)&&Xr(B?.loggedInUserRoleMap),{isFeatureEnabled:b}=t(Y.isDepositAccountsFeatureEnabled),x=b&&!I&&$t(B?.loggedInUserRoleMap),i=y&&!I,m=h&&!I,O=c&&!I&&He(B?.loggedInUserRoleMap),M=Qr(B?.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}),P=a.companyDebitCardInfo?.info!=null&&sa({cardInfo:a.companyDebitCardInfo.info,isProductVisible:_,isTOSAccepted:v,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),Z=V||P;return s.jsxs(Rn,{children:[F?s.jsx(se,{path:"setup",element:s.jsx(xt,{isBillPayAdminLevelAccess:A,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:x,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,isUserHasOnlyBillPayAccess:j,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(se,{path:"verification",element:s.jsx(xt,{isBillPayAdminLevelAccess:A,isUserHasOnlyBillPayAccess:j,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:x,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,productType:"charge_cards",type:"verification"})}):null,s.jsx(se,{path:"promo",element:s.jsx(_c,{})}),i||m?s.jsxs(s.Fragment,{children:[s.jsx(se,{path:"/",element:s.jsx(Lt,{isPaymentDrawerOpen:!1})}),O&&f?s.jsx(se,{path:"payment",element:s.jsx(Lt,{isPaymentDrawerOpen:!0})}):null,s.jsx(se,{path:"activate",element:s.jsx(Ec,{})}),s.jsx(se,{path:"onboard",element:s.jsx(oc,{})}),F?s.jsx(se,{path:"new",element:s.jsx(yc,{})}):null,C&&D?s.jsx(se,{path:"cashback",element:s.jsx(Rs,{})}):null,o?s.jsx(se,{path:"statements",element:s.jsx(rc,{})}):null,O&&p&&y?s.jsx(se,{path:"payment-history",element:s.jsx(nc,{})}):null,s.jsx(se,{path:":cardId/activate",element:s.jsx(js,{})}),s.jsx(se,{path:":cardId/setPin",element:s.jsx(uc,{})}),s.jsx(se,{path:":cardId/addToWallet",element:s.jsx(Fs,{})}),s.jsx(se,{path:":cardId/*",element:s.jsx(Ks,{})}),s.jsx(se,{path:"*",element:s.jsx(Ka,{})})]}):(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{Jc as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-CA2qpkTt.js";import{a as g}from"./sentry-C8Zmy8eq.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-CZ9_x3uq.js";import{z as N,b7 as P,K as F,c as V,e as j,af as C,b8 as A,at as L,au as M,n as U}from"./index-Bl5Gxo9i.js";import{eP as h,fG as B,sg as _,fB as G,c2 as R,MJ as z,bn as K,qh as q,q5 as Y,ke as H,lK as S,MK as J,bE as Z,cv as b,lS as $,lV as Q}from"./zeni-epic-state-CeRetUx9.js";import"./mui-_CQ1MGrl.js";import{d as W}from"./routePaths-DynLDVDN.js";import{M as X}from"./MobileAppDrawer-CACo4kMO.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="09aeb2d3-d2a8-423a-9c70-12a3d63aed7d",n._sentryDebugIdIdentifier="sentry-dbid-09aeb2d3-d2a8-423a-9c70-12a3d63aed7d")}catch{}})();const ee=E(function(n){const t=G(n),i=N.getSignedInUser(),l=h(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:K(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n($({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:D}=r,v={companyInfo:{...a,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?Z(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:D.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(J(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n(Y(e))},onEditFileName:(e,a)=>{n(q(e,a.split(".")[0]))}}})(A);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>h(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(P,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,11 +0,0 @@
1
- import{j as C}from"./liveblocks-CA2qpkTt.js";import{a}from"./sentry-C8Zmy8eq.js";import{u as D,g as v,j as m,N as w}from"./core-CZ9_x3uq.js";import{Jo as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jv as F}from"./zeni-epic-state-CeRetUx9.js";import{u as P,z as u,L as g,D as $,o as k}from"./index-Bl5Gxo9i.js";import{n as H}from"./mui-_CQ1MGrl.js";import{t as z}from"./getLocaleForTenant-KiSPE8IK.js";import{g as R,Q as J}from"./QBOConnectionScreen-CEl_0cd_.js";import"./recharts-DG48H-3-.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./empty-9FZm-BqI.js";import"./pdf-lib-8meLjW9k.js";import"./index-G8xNq7rD.js";import"./url-ByuQXOc6.js";import"./index-CuxNhIGG.js";import"./decodeURIComponentSafe-COFNvK3Q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="e44c546e-ff9e-499b-beb5-5fa29599332f",t._sentryDebugIdIdentifier="sentry-dbid-e44c546e-ff9e-499b-beb5-5fa29599332f")}catch{}})();const W=H.div`
2
- display: flex;
3
- flex: 1 1 auto;
4
- flex-direction: row;
5
- justify-content: center;
6
- align-items: center;
7
- width: 100%;
8
- height: 100vh;
9
- background-color: ${t=>t.theme.colors.background};
10
- box-shadow: ${t=>`0px 2px ${k.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function pe(){const t=D(),d=v(),{setLoading:i,clearAllLoading:b}=P(),p=a.useRef(!1),c=a.useRef(!1),{code:x,realmId:T,state:y}=R(d.search),N=x!==""&&T!==""&&y!=="",I=m(l=>A(l)),e=m(l=>O(l)),n=m(l=>l.tenantState.fetchState),r=m(l=>l.tenantState.activeTenantFetchState.fetchState),o=u.getSignedInUser(),f=u.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{i(g.CONNECTION_AUTH)},[i]),a.useEffect(()=>{p.current||o==null||f==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(i(g.TENANT_FETCHING),t(j(o.userId,f))))},[p,n,i]),a.useEffect(()=>{e.tenantId==null&&!c.current&&o!=null&&(c.current=!0,!(f==null||f!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(U(o.userId)))},[c,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(i(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(_(e.tenantId)),u.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"&&u.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(W,{children:C.jsx(J,{})}):C.jsx(w,{to:"/",replace:!0})}export{pe as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-CA2qpkTt.js";import{z as n}from"./index-Bl5Gxo9i.js";import{g as d}from"./QBOConnectionScreen-CEl_0cd_.js";import"./sentry-C8Zmy8eq.js";import{g as p,N as a}from"./core-CZ9_x3uq.js";import"./zeni-epic-state-CeRetUx9.js";import"./recharts-DG48H-3-.js";import"./mui-_CQ1MGrl.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./empty-9FZm-BqI.js";import"./pdf-lib-8meLjW9k.js";import"./index-G8xNq7rD.js";import"./url-ByuQXOc6.js";import"./index-CuxNhIGG.js";import"./decodeURIComponentSafe-COFNvK3Q.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 i}from"./liveblocks-CA2qpkTt.js";import{J as l,s as c,h as f}from"./index-Bl5Gxo9i.js";import{D as p}from"./mui-_CQ1MGrl.js";import"./sentry-C8Zmy8eq.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]="33e15337-9daa-4a10-ac68-a7ea0591c1e3",e._sentryDebugIdIdentifier="sentry-dbid-33e15337-9daa-4a10-ac68-a7ea0591c1e3")}catch{}})();const u={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=l(),s=o?.valuePx(a)??u.drawerLeftMargin.valuePx(a),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{h as D};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CA2qpkTt.js";import{a as c}from"./sentry-C8Zmy8eq.js";import{h as A,u as B,g as F,i as L,j as d,N as q,n as K,o as N,p as _}from"./core-CZ9_x3uq.js";import{LF as z,eP as O,L2 as R,kG as H,HE as I,LK as M,Kx as W,jG as Y,HF as S,L7 as $,L8 as V,Kz as J,Ky as Q}from"./zeni-epic-state-CeRetUx9.js";import{aR as U,c as X,p as Z,n as tt}from"./index-Bl5Gxo9i.js";import"./mui-_CQ1MGrl.js";import{d as k}from"./decodeURIComponentSafe-COFNvK3Q.js";import{w as et}from"./withTransactionSidePanel-CAqdAy8r.js";import{f as at,c as nt}from"./routePaths-DynLDVDN.js";import"./recharts-DG48H-3-.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./useAskAiCfoHostNavButtonProps-B695I2Ok.js";import"./TransactionDetailScreen-C-EmLt2t.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]="c4880209-29a4-4e63-8456-0c85f7a1033c",a._sentryDebugIdIdentifier="sentry-dbid-c4880209-29a4-4e63-8456-0c85f7a1033c")}catch{}})();const ot=K(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(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(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(V()),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(I(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=A(),o=B(),l=F(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:x,entityNameEncoded:j}=L(),r=k(x??""),p=k(j??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=d(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=d(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(H(i)))},[m,u,i]);const E=d(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return c.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:C(w.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 xt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,25 +0,0 @@
1
- import{j as C}from"./liveblocks-CA2qpkTt.js";import Rn from"./NotFoundScreen-D0aNQysK.js";import{a,b as wt}from"./sentry-C8Zmy8eq.js";import{n as Fe,S as Dn}from"./mui-_CQ1MGrl.js";import{u as de,h as Pt,g as Ge,j as F,n as Un,i as rt,o as Fn,p as ze}from"./core-CZ9_x3uq.js";import{eP as Re,Q7 as Bn,n4 as ke,fj as _n,qL as Vn,nm as xt,nH as Rt,Q8 as Dt,nR as Mn,Q9 as Ut,nf as jn,qh as On,f3 as fe,Qa as De,sR as Ft,C2 as Bt,Qb as _t,Qc as zn,pY as qe,LG as dt,LI as Ln,jJ as Qn,LJ as $n,jQ as Gn,cV as qn,tW as Je,ns as Vt,nW as Ue,Qd as Jn,Kz as ut,Ky as we,Qe as mt,k5 as Yn,Qf as Kn,Qg as Nn,Qh as Hn,Qi as Wn,nz as Zn,nk as ue,nZ as Pe,Qj as Xn,Qk as ea,Ql as ta,o4 as na,jU as aa,jL as oa,Qm as sa,jT as ht,LQ as ca,Qn as ia,Qo as la,pU as ra,pw as da,nX as le,pv as Le,Qp as ua,Qq as ma,Qr as ha,lo as pa,bq as ga,lj as pt,l5 as Ca,Qs as Sa,gT as gt,fU as Ia,lg as fa,vP as ka,Qt as Ea,ov as va,oq as ya,ou as ba,of as Aa,Qu as Ta,f6 as Mt,nK as wa,nv as Pa,fk as Ct,n$ as xa,Qv as Ra,nY as jt,Qw as Da,Qx as Ua,Qy as Fa,Qz as Ba,QA as St,q4 as _a,pm as Va,Kx as Ma,jS as ja,QB as Oa,GA as za,jR as La,jG as Qa,f5 as $a,oW as Ot,pe as Ga,nV as It,n_ as qa,bE as Ja,ld as Ya,la as Ka,QC as Na,oe as ft,pc as kt,pa as Ha,o$ as Wa,oG as Za,pd as Xa,QD as eo,QE as to,oK as no,QF as ao,oA as oo,oJ as so,oH as co,ph as io}from"./zeni-epic-state-CeRetUx9.js";import{v as zt,I as re,c as z,n as H,Y as Lt,_ as Qt,cE as lo,z as Be,cF as ro,at as xe,cG as uo,aT as Et,B as $t,cH as mo,aq as Qe,D as ho,cI as po,a2 as go,cJ as Co,V as So,cK as Io,cL as fo,O as ko,k as Eo,aN as vo,b7 as yo,s as bo,cM as Ao}from"./index-Bl5Gxo9i.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-B695I2Ok.js";import{c as vt,C as To}from"./TransactionDetailScreen-C-EmLt2t.js";import{w as wo}from"./withTransactionSidePanel-CAqdAy8r.js";import{h as Po,v as xo}from"./routePaths-DynLDVDN.js";import{g as $e}from"./accountMappingHelper-olmW29yz.js";import{D as Ro}from"./DrawerScreen-DG4CCTYZ.js";import"./recharts-DG48H-3-.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./decodeURIComponentSafe-COFNvK3Q.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]="cadc3b6b-7f4c-4e69-ab1f-866349e89dcc",t._sentryDebugIdIdentifier="sentry-dbid-cadc3b6b-7f4c-4e69-ab1f-866349e89dcc")}catch{}})();const Do=()=>{const t=de(),i=Pt(),A=Ge(),f=F(d=>Re(d)),{useFeatureGate:E}=zt(),{isFeatureEnabled:g}=E(re.isRealtimeInsightsFeatureEnabled),u=F(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=F(d=>Bn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],_=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=Lt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&_()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;z.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Uo,{children:C.jsx(lo,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:_,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Uo=Fe.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- background-color: ${t=>t.theme.colors.grey4};
8
- `,Fo=wt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=de(),u=Be.getSignedInUser(),o=F(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,_=m[i],h=_?.accountReconEntity.statementMetaData?.statementUploadId,T=(e,n)=>{g(On(e,n.split(".")[0]))},I=e=>{h!=null&&g(jn({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Mn({accountId:i,selectedPeriod:y,payload:e}))},K=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),V=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),D=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return _!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(ro,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:_,monthYearPeriod:y,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:T,onDeleteFile:I,onSelectSourceType:K,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):D!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(uo,{excludedAccountReconciliation:D,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:V})})}):null}),yt=Fe.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,bt=Fe.div`
13
- flex: 1;
14
- min-height: 0;
15
- display: flex;
16
- flex-direction: column;
17
- box-sizing: border-box;
18
- min-width: 0;
19
- overflow-x: hidden;
20
- overflow-y: auto;
21
- `;function Bo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=F(u=>zn(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(mo,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const _o=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Vo,comma:At,space:Mo}},dateFormat:qt}=ho.getLocalizedStrings(),Tt=io,jo=Un(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=fe(t),{selectedTransactionCategorizationTab:_}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${go}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:_,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:_,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:K}=S.jeSchedules,te=Vt(I),V=Ue(te.start),D=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(I.month,I.year),t(Va(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));Co(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(w=>{w!=null?t(_a(e,w)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ba(e,n)),m!=null&&t(ke({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Fa(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?Mo+Vo+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Ua(e))},onUpdateMissingReceiptsUIState:e=>{t(Da(e))},onFetchMissingReceiptsList:()=>{D!=null&&V!=null&&t(jt({start:V,end:D},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(co(e))},onBulkUploadProgress:e=>{t(so(e))},onBulkUploadSuccess:e=>{t(oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(ao(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(no(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(to())},onSetBulkUploadResultsTab:e=>{t(eo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Xa(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Wa(e,n))},onFetchBulkUploadBatches:e=>{t(Ot(e))},onFetchMoreBatchDetails:()=>{t(Ha())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Ra())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Le({selectedTab:s,uiState:{searchString:e}})),D!=null&&V!=null&&t(le(s,{start:V,end:D},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(xa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Pa(e))},onSaveReconciliationReview:e=>{t(wa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(K.prepaidExpensesAccountList,s.selectedOptions),b=$e(K.fixedAssetsAccountList,l.selectedOptions),w=$e(K.accruedExpensesAccountList,k.selectedOptions),M={selectedPrepaidExpensesAccountIds:p.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:w.map(P=>P.accountId)};t(Ta({data:M}))},onSaveJeAccountSettingsClick:()=>{t(Aa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:w,allClassList:M,allDepreciationAccountList:P}=S.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,ne={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},ae=p?.selectedOption!=null?w.find($=>$.qboId===p.selectedOption):void 0,Ee=k?.selectedOption!=null?M.find($=>$.classId===k.selectedOption):void 0,oe=l?.selectedOption!=null?P.find($=>$.qboId===l.selectedOption):void 0;t(ba({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:ae?.accountId,updatedClassId:Ee?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ne.id,name:ne.name}}}))},ignoreRecommendedJeSchedule(e,n){t(ya(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(va({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Ea())},handleJeScheduleClick:(e,n,s)=>{t(ka({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(fa(e,m.companyId,m.tenantId))},onClickCustomerRequest:_,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ia())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Sa(e))},onUpdateFileAttachment:e=>{t(Ca({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(pa(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ga().format(qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,w,M,P,Q,ne,ae)=>{t(ha(e,n,s,l,y,k,p,b,w,M,P,Q,ne,ae))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),D!=null&&V!=null&&(t(le(e,{start:V,end:D},!1,!1)),t(ma(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{i.closeSidePanel?.(),D!=null&&V!=null&&(t(ua(e)),t(le("autoCategorized",{start:V,end:D},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n})),D!=null&&V!=null&&t(le(e,{start:V,end:D},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{D!=null&&V!=null&&t(le(e,{start:V,end:D},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,w)=>{t(da(e,n,s,l,w??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?z.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):z.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(ra(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(la({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:w,transaction:M,lineIds:P}=n;p!=null&&t(ca({transactionId:w,customerUpdates:p})),t(ia({selectedTab:l,transactionId:w.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:w,transaction:M,lineIds:P}=n;p!=null&&(t(aa({transactionId:w,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(oa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:w.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))):t(sa({selectedTab:l,transactionId:w.id,lineId:P[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Pe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Pe(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{z.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(na(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ta(e))},updateOperatingExpensesIdsForReview:e=>{t(ea({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=xo(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Xn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(Pe(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ue(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ue(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Zn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Wn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Nn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Yn(l)),t(Kn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,qe("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(po),Oo=wo(function(t){const i=t.displayName??t.name??"Component",A=wt.memo(t),f=E=>{const g=de(),u=function(){const T=de(),I=F(d=>fe(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=F(T=>fe(T).reconciliation),v=F(T=>Re(T)),S=a.useCallback((T,I)=>{g(Ft("expense_automation_reconcile",T,I))},[g]),m=a.useCallback((T,I)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Fo,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),_=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:_,[u.isOpen,u.closePanel,u.selectedAccountId,_]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=So(),m=Io(),{isOpen:y}=fo(),r=Pt(),_=Ge(),h=de(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:I}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=Lt(),K=(()=>{const c=F(G=>fe(G)),O=Ge(),{currentSelectedViewFetchState:Y,currentSelectedView:j,selectedPeriod:B}=c,Ie=Qe(j),X=Qe(Y.fetchState),be=a.useCallback(G=>{const N=O.state?.referrer;j==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(B.month,B.year,c.transactionView.totalCountByTab.review,0,G,N??null):z.trackTransactionsAutoCategorisedPage(B.month,B.year,c.transactionView.totalCountByTab.autoCategorized,0,G,N??null)),j==="missing_receipts"&&z.trackMissingReceiptsPage(B.month,B.year,G,c.missingReceipts.transactions.length,N??null),j==="je_schedules"&&z.trackMonthCloseScheduleListPage(B.month,B.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,N??null),j==="flux_analysis"&&z.trackFluxAnalysisPage(B.month,B.year,G,_o(c.fluxAnalysis),N??null),j==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(B.month,B.year,G,"draft",c.auditSummary.auditScorePercentage,null,N??null)},[B,c]);return a.useEffect(()=>{X===Y.fetchState&&j===Ie||Y.fetchState!=="Completed"||be(!1)},[j,Y.fetchState,Ie]),be})(),te=ko(),[V,D]=a.useState(!1),e=F(c=>dt(c)),n=F(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,w]=a.useState([]),[M,P]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),P(c)},[d,v,m,S]),ne=a.useCallback(()=>{m(),P(void 0),d(),I()},[d,I,m]),ae=a.useRef(v);a.useEffect(()=>{v===!0&&ae.current===!1&&(m(),P(void 0),d()),ae.current=v},[d,v,m]);const Ee=a.useRef(y);a.useEffect(()=>{y===!0&&Ee.current===!1&&(v&&S(!1),P(void 0),E===!0&&f!==!0&&t?.()),Ee.current=y},[t,y,v,S,f,E]);const oe=E===!0&&f!==!0,$=a.useRef(oe);a.useEffect(()=>{oe&&!$.current&&(v&&S(!1),m(),P(void 0)),$.current=oe},[v,oe,m,S]);const[Ye,Jt]=a.useState(!1),Ke=a.useRef(!1),{selectedTab:Ne}=rt(),{tenantEmailDomain:Yt}=rt(),[_e,He]=a.useState(_.state?.message==="comingFromTransactionDetail"),We=_.state?.message==="comingFromOverview",Kt=Eo(),Ve=Be.getSignedInUser(),{useDynamicConfig:Nt,useFeatureGate:me}=zt(),{configValue:Ht}=Nt(vo.enableUncategorizedExpenseCategory),W=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ze}=me(re.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=me(re.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=me(re.isTransactionActivityEnabled),{isFeatureEnabled:Wt}=me(re.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Zt}=me(re.isProjectsTransactionsEnabled),Xt=a.useCallback(c=>{const O=qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,O)},[i]),en=F(c=>Ma(c,"common")),L=F(c=>fe(c)),{monthEndCloseChecksView:J,currentSelectedView:x,selectedPeriod:U,selectedTransactionCategorizationTab:se,currentSelectedViewBackgroundRefreshFetchState:tn,currentSelectedViewFetchState:Z,jeSchedules:Me,reconciliation:nn}=L;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||Q(void 0)},[x,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==se&&(ve.current=se,x==="transaction_categorization"&&Q(void 0)):ve.current=se},[x,se,Q]);const an=F(c=>M==null?void 0:ja(c.transactionState,M)),ce=an?.qboId,on=F(c=>ce==null?void 0:Oa(c,ce));a.useEffect(()=>{ce!=null&&h(za(ce))},[h,ce]);const{selectedAccountId:pe}=nn,et=Qe(Me.accountSettingsView.saveState.fetchState),sn=F(c=>La(c.accountState,c.accountListState,"accountList")),cn=F(c=>Qa(c)),ge=Ne!=null?$a(Ne):x,ln=F(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Qt({isDataReady:Z.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(U),Ce=Ue(tt.start),Se=Ue(tt.end);if(Ce==null||Se==null)throw Error(`Invalid start - ${Ce} and end - ${Se} period from given ${U}`);const rn=a.useCallback(()=>{l(!1)},[]),dn=a.useCallback(()=>{p(!0)},[]),un=a.useCallback(c=>{w(c),p(!1)},[]),mn=a.useCallback(()=>{w([])},[]),ye=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{he===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(Ot({cacheOverride:!0}))},[he,x,ye,nt,h]);const at=Ve?.userId,hn=U.month,pn=U.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&he!==!1&&ye==="idle"&&at!=null&&ot!=null&&h(Ga())},[x,he,ye,at,ot,hn,pn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{ge!=null&&x!==ge&&h(Mt(ge))},[ge]),a.useEffect(()=>{Ye!==!1||Z.fetchState!=="Completed"&&Z.fetchState!=="Error"||!R||(Jt(!0),h(It(!1,!1,W)))},[Ye,Z,R,W]),a.useEffect(()=>{!We&&R&&(h(It(!1,!1,W)),h(ue(U,pe,!1,!1)))},[U.month,U.year,R,W]);const st=a.useCallback((c=!1,O=!1)=>{const Y={start:Ce,end:Se};switch(x){case"transaction_categorization":h(le(se,Y,c,!_e,void 0,void 0,O,void 0,W)),He(!1);break;case"flux_analysis":h(Pe(U,c,O,null));break;case"month_end_insights":if(O===!1){const j=new Date(U.year,U.month,0),B=Ja(j.toDateString()).format(qt.analytics.YYYYDashMMDashDDFormat);h(Ya(!0,n.companyId,n.tenantId,B)),h(Ka(n.companyId,n.tenantId))}break;case"je_schedules":h(qa(Y,O));break;case"missing_receipts":h(jt(Y,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,O));break;default:h(ue(U,pe,c,O))}},[x,Ce,Se,n.companyId,n.tenantId,se,U,pe,_e,He,W]);a.useEffect(()=>{x===ge&&Z.fetchState==="Not-Started"&&R&&st(!0)},[Z,Ce,Se,n.companyId,n.tenantId,R]),a.useEffect(()=>{We||_e||Ke.current||tn.fetchState==="In-Progress"||Z.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),a.useEffect(()=>{J.fetchState!=="In-Progress"&&J.fetchState!=="Completed"&&h(ke({tenantId:n.tenantId,period:U,refreshViewInBackground:!1}))},[J.fetchState,n.tenantId]),a.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(ke({tenantId:n.tenantId,period:U,refreshViewInBackground:!0})),h(Na({companyId:n.companyId})),r("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,U,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{J.fetchState!=="In-Progress"&&J.fetchState==="Completed"&&h(ke({tenantId:n.tenantId,period:U,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[J.fetchState,n.tenantId,U,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&pe==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ue(U,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ue,pe,U]);const gn=vt();a.useEffect(()=>{const c=(J.monthEndCloseChecks?.monthEndCloseCheckList.find(O=>O.id==="month_end_insights")?.isDisabled??!1)&&!Ze;x!=="month_end_insights"||!c&&J.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,J.monthEndCloseChecks]);const Cn=u===!0?g:A,Sn=u===!0||E===!0,In=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Me.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Me.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:O,currentSelectedView:Y})=>{const j=de();let B,Ie,X;const be=vt(),G=c.transactionView;let N=()=>{};const{transactions:yn,selectedTransactionId:ie,selectedTransactionLineId:Ae,transactionLocalData:bn}=G;if(Y==="transaction_categorization"){const je=bn.find(ee=>ee.transactionId===ie),q=yn.find(ee=>ee.id===ie),it=Ae!=null?je?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;Ie=it?.class?.classId,B=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Tn=Po(ie,q?.typeOfTransaction);q!=null&&Tn&&(X={id:ie,type:qe(q.typeOfTransaction)}),N=()=>{if(ie!=null&&Ae!=null&&q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===ie)?.transactionReviewLocalData;if(ee!=null&&q.lines!=null&&q.lines.length>0){const Te=ee.lineItemById[Ae];let Oe=ee.selectedEntity;if(qn(q)||(Oe=Te.selectedEntityLine),Oe!=null){const wn=Oe,Pn={transactionId:{id:q.id,type:q.type},transaction:q,lineIds:q.lines.map(xn=>xn.id)??[]};j(Je(wn,Te.amount.amount,Pn,!1,!0,be))}}}}}const An=F(je=>dt(je,void 0,B,Ie));return{transactionId:X,onSaveVendor:()=>{j(Gn(X,void 0,!1,!0))},onSaveSuccess:N,onCancel:()=>{X!=null&&j(Ln({transactionId:X})),j(Qn()),j($n()),O()},vendorViewDetails:An}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{D(!1)},currentSelectedView:x});return Kt?.loggedInUserRoleMap==null?J.fetchState==="Error"?C.jsx(yo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(Ro,{isOpen:k,drawerLeftMargin:new bo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(zo,{onClick:c=>c.stopPropagation(),children:C.jsx(Bo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:un,resetCustomerRequest:mn})})}),ct!=null&&V&&C.jsx(To,{isOpen:V,transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}),C.jsx(jo,{navigate:r,location:_,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:ln,entityAutoCompleteView:en},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:Ze,isUncategorizedExpenseCategoryEnabled:W,isAccountingClassesEnabled:cn,isProjectsTransactionsEnabled:Zt,isCOTEnabled:gn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?M:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&M!=null?C.jsx(Ao,{activityLogView:on,qboId:ce,onClose:()=>Q(void 0),selectedTransactionId:M},String(M)):null,uncategorizedAccounts:sn,onClickCustomerRequest:dn,handleEditClick:rn,tenantEmailDomain:Yt,trackExpenseAutomationTabAnalytics:K,setActivityLogTransactionId:Q,closeSidePanel:In,openTransactionPanel:i,sidePanelIsOpen:Sn,sidePanelIsFullView:u!==!0&&f,panelContent:Cn,isAiCfoAccessEnabled:T,onAskAiCfoClick:ne,isExpenseAutomationCommentingEnabled:Wt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:u===!0?66:void 0})]})})),zo=Fe(Dn)`
22
- display: flex;
23
- min-height: 100%;
24
- flex-direction: column;
25
- `;function ds(){return C.jsxs(Fn,{children:[C.jsx(ze,{path:"*",element:C.jsx(Do,{})}),C.jsx(ze,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Oo,{})}),C.jsx(ze,{path:"*",element:C.jsx(Rn,{})})]})}export{ds as default};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-C8Zmy8eq.js";import{u as l,h as f,g as m}from"./core-CZ9_x3uq.js";import{gA as p,JM as g,JN as _}from"./zeni-epic-state-CeRetUx9.js";import{u as b,L as h,z as y}from"./index-Bl5Gxo9i.js";import"./liveblocks-CA2qpkTt.js";import"./recharts-DG48H-3-.js";import"./mui-_CQ1MGrl.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c3143327-0e0d-4fc6-83b3-9f591aea766a",e._sentryDebugIdIdentifier="sentry-dbid-c3143327-0e0d-4fc6-83b3-9f591aea766a")}catch{}})();function R(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};