@zeniai/web-app-ui 5.1.48-dev → 5.1.50-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.
- package/dist/assets/AddressRoutes-BO0Y1XuG.js +1 -0
- package/dist/assets/{AddressScreen-BdkkfpOD.js → AddressScreen-cCnouRSn.js} +2 -2
- package/dist/assets/{AiCfoScreen-CJ2jNf-v.js → AiCfoScreen-DuDTdplv.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-C9K9cwdL.js → BillPayApprovalRoutes-B_ArN4m-.js} +1 -1
- package/dist/assets/{BillPayRoutes-DI9tqZg4.js → BillPayRoutes-CeSWBsHw.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BvxrLE03.js → BusinessVerificationPageScreen-B8bnbJvI.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-7dPiCcoy.js → CardsAiCfoScreen-BFi-6bPY.js} +1 -1
- package/dist/assets/ChargeCardRoutes-3ZPc6bsC.js +71 -0
- package/dist/assets/CompanyPassportScreen--e7woif_.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DYP_9VcK.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-vzmXnBfR.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BgHk9KVG.js → CustomerOnboardingRoutes-DY7mGrS8.js} +4 -4
- package/dist/assets/{DashboardRoutes-BRz85PCY.js → DashboardRoutes-CWWt-YY9.js} +3 -3
- package/dist/assets/{DefaultTenantHome-BcFCHmoG.js → DefaultTenantHome-Bi_Nepv1.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BtjmG_jm.js +18 -0
- package/dist/assets/DrawerScreen-Bhvl5Bpw.js +1 -0
- package/dist/assets/EntityDetailRoutes-DWUflhpV.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-C-CBTBm8.js → ExpenseAutomationRoutes-5xMDqEkK.js} +3 -3
- package/dist/assets/{FeaturePreviewScreen-CeZNu_Vi.js → FeaturePreviewScreen-Cs1JStpc.js} +1 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-C2hS7TqE.js +1 -0
- package/dist/assets/{MagicLinkRoutes-7XFxi-_N.js → MagicLinkRoutes-DIheMWou.js} +5 -5
- package/dist/assets/MagicLinkSignInScreen-BhydWF2v.js +12 -0
- package/dist/assets/{MobileAppDrawer-D6Fu3M_x.js → MobileAppDrawer-bZsvcUIO.js} +1 -1
- package/dist/assets/NotFoundScreen-DkPaaWNr.js +1 -0
- package/dist/assets/{NotificationRoutes-DN56rmti.js → NotificationRoutes-Debt_KCq.js} +1 -1
- package/dist/assets/OAuthConsentScreen-BYk52B4_.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DvAao1a8.js +1 -0
- package/dist/assets/{PeopleRoutes-CVdNkMW2.js → PeopleRoutes-jjBWyySA.js} +9 -9
- package/dist/assets/PerformanceRoutes-K4zUr9LW.js +1 -0
- package/dist/assets/{Preview-BohCuc6u.js → Preview-CKm-UT5u.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CL_uJ9x0.js → QBOConnectionScreen-Bq-1t6Xi.js} +1 -1
- package/dist/assets/ReferralListScreen-_mz3EFDf.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-DrGF2MTj.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DGivgXWQ.js → ReimbursementApprovalRuleDetailScreen-BWFBxfUH.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CqFV9Upl.js → ReimbursementRoutes-DY21Vmvy.js} +5 -5
- package/dist/assets/{ReportsRoutes-iiURxm9r.js → ReportsRoutes-WmSJGW8t.js} +1 -1
- package/dist/assets/RewardsRoutes-BZ9NRCXj.js +1 -0
- package/dist/assets/{ScreenRoutes-BVYp-4m8.js → ScreenRoutes-Cf5Tsx0Z.js} +2 -2
- package/dist/assets/{SettingsRoutes-DOfAWDHL.js → SettingsRoutes-C9qtCzkG.js} +8 -8
- package/dist/assets/{SetupPagesScreen-Djxd17id.js → SetupPagesScreen-B_L42KP-.js} +5 -5
- package/dist/assets/SignInScreen-ChB2BnS8.js +1 -0
- package/dist/assets/SignOutScreen-BwwfTIGJ.js +9 -0
- package/dist/assets/{TaskListScreen-Dreq2LHj.js → TaskListScreen-DP-G56Cv.js} +2 -2
- package/dist/assets/TaskRoutes-B1qP8Ev_.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-Bs9ghT0l.js → TransactionDetailRoutes-q6akxnYr.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-s_jEo2WG.js → TransactionDetailScreen-BDokO385.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BgdTO4HR.js → TransactionListRoutes-4uU8xSo5.js} +1 -1
- package/dist/assets/{TreasuryRoutes-8u7u_9F8.js → TreasuryRoutes-Cwxw4OCX.js} +5 -5
- package/dist/assets/{VendorsRoutes-CYZmnwrv.js → VendorsRoutes-CYXZWLCR.js} +10 -10
- package/dist/assets/WiseConfirmationScreen-DFk6ctUo.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DO2fE8r2.js → ZeniAccountRoutes-Dkb3Uwio.js} +13 -13
- package/dist/assets/ZeniAccountStatementScreen-Cp587aU0.js +9 -0
- package/dist/assets/{accountMappingHelper-DwVJRdRo.js → accountMappingHelper-D75TOEDA.js} +1 -1
- package/dist/assets/{analytics-BUvTITrb.js → analytics-CkXhIYGA.js} +1 -1
- package/dist/assets/{analyticsHelper-DaDCazpC.js → analyticsHelper-DcxhhZJu.js} +1 -1
- package/dist/assets/{core-wjM80qIn.js → core-B5TeChD4.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-4aj60Fs2.js → decodeURIComponentSafe-DXB7OyA3.js} +1 -1
- package/dist/assets/{dnd-BK3JI-SF.js → dnd-CWnSyq9-.js} +1 -1
- package/dist/assets/{empty-CUF5cU17.js → empty-D1f-cCDu.js} +1 -1
- package/dist/assets/{empty-D8a3KaBg.js → empty-r-IKwqcp.js} +1 -1
- package/dist/assets/{emptyVideoElement-DDXARDvi.js → emptyVideoElement-B8V1wuPO.js} +1 -1
- package/dist/assets/epic-DuAKKq3W.js +2 -0
- package/dist/assets/{getLocaleForTenant-yX1iEbj2.js → getLocaleForTenant-Bixn6PX7.js} +1 -1
- package/dist/assets/{index-BVZpKi1S.js → index-B0QsCXA7.js} +2 -2
- package/dist/assets/{index-Det3Ki3b.js → index-B2U2XMzI.js} +13002 -12858
- package/dist/assets/{index-DApnMePi.js → index-BfRRBBMI.js} +1 -1
- package/dist/assets/{index-D3VvkPFN.js → index-CGTF1rlJ.js} +1 -1
- package/dist/assets/{index-CWHzFtd9.js → index-C_NwT3-k.js} +1 -1
- package/dist/assets/{index-D8Ajpofo.js → index-DDl-KBgR.js} +1 -1
- package/dist/assets/{index-DuIPJrPJ.js → index-Kq1a616O.js} +1 -1
- package/dist/assets/{index-DypTJFR1.js → index-R3BgB7Uo.js} +1 -1
- package/dist/assets/{lexical-DcicQSkI.js → lexical-D7c0ykAW.js} +1 -1
- package/dist/assets/{liveblocks-GsPfxkQ7.js → liveblocks-C-n95g0A.js} +1 -1
- package/dist/assets/{lottie-C5rIATv6.js → lottie-zNHYqEBz.js} +1 -1
- package/dist/assets/{mui-BSDa87ap.js → mui-Da8iY16Z.js} +1 -1
- package/dist/assets/{pathToGoBack-CAzQiLsh.js → pathToGoBack-nrN7wX5B.js} +1 -1
- package/dist/assets/{pdf-BLNuomMl.js → pdf-BM7gJkYi.js} +4 -4
- package/dist/assets/{pdf-lib-BR9HrRu8.js → pdf-lib-BVCnHm-C.js} +1 -1
- package/dist/assets/{plaid-50YvjniW.js → plaid-kqYG7b9d.js} +1 -1
- package/dist/assets/{pusher-DyWQA0RT.js → pusher-CLZoiBO8.js} +1 -1
- package/dist/assets/{react-BKGEXYtN.js → react-B40ow9gH.js} +1 -1
- package/dist/assets/{react-CrU6fZvx.js → react-BggCpRGR.js} +1 -1
- package/dist/assets/{react-Dj2j64JD.js → react-C-sHFsWu.js} +1 -1
- package/dist/assets/{react-uWUXgbgu.js → react-C3y2xvic.js} +1 -1
- package/dist/assets/{react-Ci53z-6c.js → react-CbGrXN5I.js} +1 -1
- package/dist/assets/{react-DmfWUkEA.js → react-zGBF6iFI.js} +1 -1
- package/dist/assets/{recharts-D4VpFd5q.js → recharts--v-RQjOV.js} +1 -1
- package/dist/assets/{routePaths-CbGdb8gZ.js → routePaths-BhCcxP1S.js} +1 -1
- package/dist/assets/{sentry-B2TzMFx9.js → sentry-lku8kjDH.js} +1 -1
- package/dist/assets/{url-CcjxrMLZ.js → url-ByXYagPi.js} +1 -1
- package/dist/assets/{url-D1xNpCnF.js → url-CRmtHtjd.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D8RjKLM8.js → useAiCfoDashboardSuggestedQuestionsChips-B4QfsEVQ.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Bt3rxiW7.js +1 -0
- package/dist/assets/useCashManagementBanner-BdFPdsZy.js +1 -0
- package/dist/assets/{useDeviceId-t80vtq4B.js → useDeviceId-bV7jqaoy.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-D9NRPlO5.js → useInitialThreadRequest-j8y2-Pa3.js} +1 -1
- package/dist/assets/{utils-BwzhiOdE.js → utils-Dw1Jg_v9.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-D8vEjelm.js → withTransactionSidePanel-BZm11u-w.js} +4 -4
- package/dist/assets/{zeni-epic-state-DrcliB1J.js → zeni-epic-state-BzDw8pi_.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-Cfx49so1.js +0 -1
- package/dist/assets/ChargeCardRoutes-BIha80p-.js +0 -71
- package/dist/assets/CompanyPassportScreen-CuQ-1lmT.js +0 -1
- package/dist/assets/ConnectionAuthScreen-CZ8o3YZi.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BnNax-8a.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BgEqXJEl.js +0 -18
- package/dist/assets/DrawerScreen-_1RQlY4y.js +0 -1
- package/dist/assets/EntityDetailRoutes-C7uFwXUz.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-C0pKe0vy.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CGIo0N71.js +0 -12
- package/dist/assets/NotFoundScreen-_JeeXwwE.js +0 -1
- package/dist/assets/OAuthConsentScreen-DCckgFNN.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DQXcPbfr.js +0 -1
- package/dist/assets/PerformanceRoutes-BFxcHJn-.js +0 -1
- package/dist/assets/ReferralListScreen-Cb-o7kTE.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-BV3UuxT_.js +0 -1
- package/dist/assets/RewardsRoutes-6b8h1meH.js +0 -1
- package/dist/assets/SignInScreen-D7gytnqh.js +0 -1
- package/dist/assets/SignOutScreen-C-j9YPM-.js +0 -9
- package/dist/assets/TaskRoutes-Dy3OoIyM.js +0 -9
- package/dist/assets/WiseConfirmationScreen-BiPmlGq6.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Cb_rEVWr.js +0 -9
- package/dist/assets/epic-sEosDzE-.js +0 -2
- package/dist/assets/useAskAiCfoHostNavButtonProps-BXGcqvyl.js +0 -1
- package/dist/assets/useCashManagementBanner-CdVrtcFk.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-
|
|
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-B2U2XMzI.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-lku8kjDH.js"><link rel="modulepreload" crossorigin href="/assets/core-B5TeChD4.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-BzDw8pi_.js"><link rel="modulepreload" crossorigin href="/assets/mui-Da8iY16Z.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CkXhIYGA.js"><link rel="modulepreload" crossorigin href="/assets/utils-Dw1Jg_v9.js"><link rel="stylesheet" crossorigin href="/assets/index-BUmr5maU.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/web-app-ui",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.50-dev",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/**/*"
|
|
6
6
|
],
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@sentry/react": "^9.42.1",
|
|
29
29
|
"@stripe/stripe-js": "^4.4.0",
|
|
30
30
|
"@zeniai/client-analytics": "2.0.21",
|
|
31
|
-
"@zeniai/client-epic-state": "5.0.
|
|
32
|
-
"@zeniai/web-components": "4.1.
|
|
31
|
+
"@zeniai/client-epic-state": "5.0.99",
|
|
32
|
+
"@zeniai/web-components": "4.1.69",
|
|
33
33
|
"color": "3.1.3",
|
|
34
34
|
"cross-fetch": "^4.0.0",
|
|
35
35
|
"crypto-js": "4.2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-GsPfxkQ7.js";import{A as d}from"./AddressScreen-BdkkfpOD.js";import i from"./NotFoundScreen-_JeeXwwE.js";import"./sentry-B2TzMFx9.js";import{o as s,p as r}from"./core-wjM80qIn.js";import"./zeni-epic-state-DrcliB1J.js";import"./recharts-D4VpFd5q.js";import"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.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]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}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 c}from"./liveblocks-GsPfxkQ7.js";import{h as de,g as Ce,i as Me,u as pe,j as o,N as Sa,s as At,n as De,t as yn,o as as,p as se}from"./core-wjM80qIn.js";import{bs as Pe,Rp as ts,Rq as ns,fP as ln,Rr as In,fI as kn,Rs as En,Rt as An,Ru as Dn,Rv as _n,fJ as Pn,fK as wn,Rw as vn,g4 as Tn,g5 as $a,Rx as Fn,Ry as rs,fO as ss,fN as cs,Rz as os,g7 as Rn,g8 as sa,RA as is,RB as ds,fR as ls,fQ as us,RC as xn,hF as Qe,g3 as Bn,g2 as Ln,RD as ms,eY as Cs,Bl as ps,Bk as hs,Bo as fs,Bq as gs,f2 as bs,eV as On,RE as Ss,RF as ys,f7 as Un,RG as Is,f8 as jn,Bw as ks,Bt as Es,eW as fe,RH as Qa,fb as we,fc as ve,fd as Te,gu as ca,cw as oa,RI as ia,RJ as Dt,uD as za,kA as Ya,RK as Za,C2 as ka,C4 as qe,C5 as _t,kq as Mn,RL as da,BS as _a,RM as As,RN as Ds,BV as Ja,RO as _s,PJ as Xa,e_ as Nn,B$ as ga,hQ as Ps,RP as Vn,RQ as la,bq as ws,RR as vs,gf as et,ge as at,Cz as Ts,gd as tt,Pp as Fs,RS as Hn,cp as Gn,cR as Rs,PI as wa,D8 as $n,RT as un,CK as Pa,RU as zn,D9 as xs,Q9 as Bs,Da as Ls,E6 as Os,t_ as Us,E0 as js,RV as Ms,C3 as na,RW as Ns,RX as Vs,RY as Hs,RZ as Gs,R_ as $s,R$ as Pt,S0 as zs,Ck as Yn,Cd as Ys,S1 as Zs,gw as Ks,Ct as Zn,Cx as Kn,gv as Ws,S2 as qs,CW as Wn,S3 as Qs,S4 as Js,S5 as Xs,Cv as qn,Cg as Qn,BY as Jn,Cp as Xn,Cn as er,Cr as ec,S6 as ar,S7 as ac,f4 as tc,f5 as nc,f6 as rc,S8 as nt,g9 as tr,cS as wt,S9 as sc,Sa as cc,Sb as oc,Sc as ic,CF as St,D1 as dc,CZ as lc,CB as uc,C$ as mc,CR as Cc,CT as pc,Sd as nr,D7 as Ga,JR as hc,Se as fc,Sf as gc,Sg as bc,Sh as rr,Si as Sc,Du as yc,CJ as sr,CE as je,CI as Ic,Sj as kc,Sk as Ec,BP as Ac,Sl as cr,eZ as or,Sm as Dc,BR as _c,BQ as mn,Sn as Pc,So as wc,Sp as vc,Mm as Tc,Sq as vt,Sr as Fc,xD as ir,l8 as Rc,hG as xc,Dz as Bc,Ss as dr,fV as Lc,fW as Oc,St as Uc,di as jc,g6 as Mc,Dp as Nc,Dj as We,bt as Vc,bJ as Hc,cB as Gc,bK as $c,Lz as zc}from"./zeni-epic-state-DrcliB1J.js";import{j as Fe,cm as lr,p as _e,cn as ur,co as mr,cp as Yc,D as ua,_ as Tt,cq as Zc,cr as Kc,X as Cr,a as pr,Z as hr,n as ye,N as le,f as K,aq as ya,cs as fr,ct as Wc,cu as qc,z as re,B as va,cb as rt,cv as Qc,cw as Jc,cx as Xc,cy as eo,cz as ao,K as Ta,aN as ze,bo as Ft,cA as to,w as Fa,h as st,m as Rt,c as J,a7 as ct,cB as no,bB as ba,cC as yt,cD as ro,s as xt,cE as so,at as gr,a2 as It,cF as co,Y as br,e as Sr,cG as oo,cH as io,cI as lo,cJ as uo,cK as mo,cL as Co,o as Ka,cM as po,cN as ho,cO as pt,R as fo,cP as go,cQ as bo,cR as So,cS as yo,cT as Io,a9 as ko}from"./index-Det3Ki3b.js";import{n as Ne,D as yr,S as Eo}from"./mui-BSDa87ap.js";import{a as r}from"./sentry-B2TzMFx9.js";import{u as Ra}from"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import{M as Ie}from"./MobileAppDrawer-D6Fu3M_x.js";import{d as Bt}from"./recharts-D4VpFd5q.js";import{g as Ae,a as xa,b as Ir,c as Re,d as xe,e as Je,f as Xe,h as ea,A as Ao,i as Lt,P as Do,j as Ot,s as Ia,k as kr,l as ra,m as Er,n as _o,o as Ar,p as Po,S as Cn}from"./SetupPagesScreen-Djxd17id.js";import{u as Dr}from"./useInitialThreadRequest-D9NRPlO5.js";import ot from"./NotFoundScreen-_JeeXwwE.js";import{n as pn}from"./utils-BwzhiOdE.js";import{t as wo}from"./AddressScreen-BdkkfpOD.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./analyticsHelper-DaDCazpC.js";import"./routePaths-CbGdb8gZ.js";import"./BusinessVerificationPageScreen-BvxrLE03.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]="fecaac05-5193-44ba-8ae6-6ccce39eeb7c",e._sentryDebugIdIdentifier="sentry-dbid-fecaac05-5193-44ba-8ae6-6ccce39eeb7c")}catch{}})();const vo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},_r=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:vo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)}),{spendManagement:{chargeCard:{cardPolicyPage:hn}}}=ua.getLocalizedStrings(),To=e=>Bn(e,!1),Fo=e=>Ln(e.name,!1);function Ro(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(v=>{g(v)},[]),i=r.useCallback(()=>{_(!0)},[_]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:R}=Ra({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(ts()),a(ns()),a(ln())},[a]);const D=o(v=>In(v.cardPolicyState)),d=o(v=>kn(v.cardPolicyState)),j=o(v=>En(v.cardPolicyState)),P=o(v=>An(v.cardPolicyState)),B=o(v=>Dn(v.cardPolicyState)),p=o(v=>_n(v.cardPolicyState)),h=o(v=>Pn(v.cardPolicyState)),w=o(v=>wn(v.cardPolicyState)),u=o(v=>vn(v.cardPolicyState)),T=o(v=>v.chargeCardConfigState.receiptRequiredAboveAmount.amount),k=o(v=>v.chargeCardConfigState.fetchState);r.useEffect(()=>{D!=="Completed"&&D!=="In-Progress"&&a(Tn())},[a,D]),r.useEffect(()=>{w==="Completed"&&u===""||w==="In-Progress"||a($a())},[a,w,u]);const M=o(v=>Fn(v.createCardPolicyState)),A=o(v=>rs(v.createCardPolicyState)),y=o(v=>ss(v.cardPolicyState)),L=o(v=>cs(v.cardPolicyState)),l=o(v=>os(v.createCardPolicyState)),C=o(v=>Rn(v));r.useEffect(()=>{C.fetchState==="Not-Started"&&a(sa(!1,!1,!1))},[C.fetchState,a]);const N=r.useMemo(()=>d.map(To),[d]),G=r.useMemo(()=>h.map(Fo),[h]),O=r.useMemo(()=>C.cards.filter(v=>!lr(v.status.code)).map(_r),[C.cards]),U=D==="Completed"&&C.fetchState==="Completed"&&k==="Completed";r.useEffect(()=>{U&&l==null&&a(is({cardsMasterList:O,defaultRequireReceiptAmount:T,suggestedAllowMerchants:j,suggestedBlockMerchants:P,suggestedAllowCategories:B,suggestedBlockCategories:p}))},[k,a,U,l,O,T,j,P,B,p]);const z=r.useMemo(()=>Bt(v=>{a($a(v))},250),[a]);r.useEffect(()=>()=>{z.cancel()},[z]);const Y=r.useCallback(v=>{z(v)},[z]),I=M.fetchState,x=t!=null?`/${t}/cards/policy`:"..",Z=r.useCallback(()=>{const v=_e(n.state?.pathnameStackToGoBack),ee=v.poppedPathname??x;e(ee,{state:{pathnameStackToGoBack:v.newStack}})},[n.state,e,x]),q=r.useCallback(()=>{e(x)},[e,x]),E=r.useCallback(v=>{a(ds(v))},[a]),V=r.useCallback(v=>{const ee=ur(v);a(ls({templates:[ee]}))},[a]),Q=r.useCallback(v=>{v.length!==0&&a(us(v))},[a]),X=r.useCallback(()=>{a(ln())},[a]),S=r.useRef(I);r.useEffect(()=>{const v=S.current;S.current=I,I==="Completed"&&v!=="Completed"&&A!=null&&(a(xn()),a(Qe({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(x))},[a,I,A,e,x]);const F=I==="Error"?M.error?.message??hn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?l==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(mr,{showUploadDocumentSection:!0,navBarTitle:hn.createPageTitle,onBackClick:Z,onClickMenuIcon:i,isAiCfoAccessEnabled:m,onAskAiCfoClick:R})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Yc,{formDraft:l,vendorSearchOptions:G,categorySearchOptions:N,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:Y,submitState:I,submitErrorMessage:F,documentUploadState:y,uploadedFileName:L,isAiCfoAccessEnabled:m,onAskAiCfoClick:R,onBackClick:Z,onCancelClick:q,onClickMenuIcon:i,onFormChange:E,onSubmit:V,onUploadDocument:Q,onRemoveDocument:X})]}):c.jsx(Sa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:xo}}}=ua.getLocalizedStrings(),Bo=e=>Bn(e,!1),Lo=e=>Ln(e.name,!1);function Oo(){const e=de(),n=Ce(),{tenantEmailDomain:t,templateId:a}=Me(),s=pe(),b=Fe(),f=Pe(b?.loggedInUserRoleMap),[g,_]=r.useState(!1),i=r.useCallback(F=>{_(F)},[]),m=r.useCallback(()=>{i(!0)},[i]),{isAiCfoAccessEnabled:R,onAskAiCfoClick:D}=Ra({mobileExploreReferrer:"Card Policy"}),d=o(F=>ms(F)),j=o(F=>In(F.cardPolicyState)),P=o(F=>kn(F.cardPolicyState)),B=o(F=>En(F.cardPolicyState)),p=o(F=>An(F.cardPolicyState)),h=o(F=>Dn(F.cardPolicyState)),w=o(F=>_n(F.cardPolicyState)),u=o(F=>Pn(F.cardPolicyState)),T=o(F=>wn(F.cardPolicyState)),k=o(F=>vn(F.cardPolicyState)),M=o(F=>Rn(F)),A=o(F=>a!=null?Cs(F.cardPolicyState,a):void 0),y=r.useMemo(()=>d.templateId===a&&d.formDraft!=null?d.formDraft:A!=null?ps(A):void 0,[d.templateId,d.formDraft,A,a]);r.useEffect(()=>{if(a==null)return;const F=d.detailFetchState.fetchState;d.templateId===a&&(F==="Completed"||F==="In-Progress")||A!=null||s(hs(a))},[s,a,d.templateId,d.detailFetchState.fetchState,A]),r.useEffect(()=>{j!=="Completed"&&j!=="In-Progress"&&s(Tn())},[s,j]),r.useEffect(()=>{T==="Completed"&&k===""||T==="In-Progress"||s($a())},[s,T,k]);const L=o(F=>F.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{M.fetchState==="Not-Started"&&s(sa(!1,!1,!1))},[M.fetchState,s]);const l=r.useMemo(()=>P.map(Bo),[P]),C=r.useMemo(()=>u.map(Lo),[u]),N=r.useMemo(()=>M.cards.filter(F=>!lr(F.status.code)).map(_r),[M.cards]);Tt({isDataReady:y!=null});const G=r.useMemo(()=>{if(y!=null)return Zc({draft:y,cardRows:N,categorySearchOptions:l,vendorSearchOptions:C,defaultRequireReceiptAmount:L,suggestedAllowMerchants:B,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:w})},[y,N,l,C,L,B,p,h,w]),[O,U]=r.useState(void 0),z=r.useRef(!1);r.useEffect(()=>{z.current||O!=null||G==null||(z.current=!0,U(G))},[O,G]);const Y=r.useCallback(F=>{U(F)},[]),I=r.useMemo(()=>Bt(F=>{s($a(F))},250),[s]);r.useEffect(()=>()=>{I.cancel()},[I]);const x=r.useCallback(F=>{I(F)},[I]),Z=d.updateFetchState.fetchState,q=t!=null?`/${t}/cards/policy`:"..",E=r.useCallback(()=>{const F=_e(n.state?.pathnameStackToGoBack),v=F.poppedPathname??q;e(v,{state:{pathnameStackToGoBack:F.newStack}})},[n.state,e,q]),V=r.useCallback(()=>{e(q)},[e,q]),Q=r.useCallback(F=>{if(a==null)return;const v=ur(F);s(fs(v)),s(gs(a))},[s,a]),X=r.useRef(Z);r.useEffect(()=>{const F=X.current;X.current=Z,Z==="Completed"&&F!=="Completed"&&(s(Qe({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(q))},[s,Z,e,q]);const S=Z==="Error"?d.updateFetchState.error?.message??xo.updatePolicyGenericErrorMessage:void 0;return!f||t==null||a==null?c.jsx(Sa,{to:"..",replace:!0}):O!=null&&j==="Completed"&&M.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(Kc,{templateName:d.template?.name??"",formDraft:O,vendorSearchOptions:C,categorySearchOptions:l,isVendorSearchLoading:T==="In-Progress",onVendorSearchTextChange:x,submitState:Z,submitErrorMessage:S,isAiCfoAccessEnabled:R,onAskAiCfoClick:D,onBackClick:E,onCancelClick:V,onClickMenuIcon:m,onFormChange:Y,onSubmit:Q})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(mr,{showUploadDocumentSection:!1,navBarTitle:d.template?.name,onBackClick:E,onClickMenuIcon:m,isAiCfoAccessEnabled:R,onAskAiCfoClick:D})]})}function Pr(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function wr(e){return o(n=>e==null||e===""?{chips:ht,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ht:ht,isResolved:s}}(bs(n,e)),At)}const ht=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Uo,subheadline:jo,pageTitle:Mo}}}}=ua.getLocalizedStrings(),No=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Vo(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(I=>{g(I)},[]),i=r.useCallback(()=>{_(!0)},[_]),{useFeatureGate:m}=le(),{isFeatureEnabled:R}=m(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:D}=m(K.isCardPolicyEnabled),{isAiCfoAccessEnabled:d,onAskAiCfoClick:j}=Ra({mobileExploreReferrer:"Card Policy"}),P=o(I=>Ss(I)),B=o(I=>Fn(I.createCardPolicyState)),p=o(I=>ys(I.createCardPolicyState)),h=o(I=>p==null?[]:Un(I.aiCfoState,p).filter(x=>x.kind==="creating_policy"),At),w=B.fetchState==="In-Progress"?Math.max(h.length,1):0,u=o(I=>Is(I.createCardPolicyState)),T=ya(B.fetchState);r.useEffect(()=>{T==="In-Progress"&&B.fetchState==="Completed"&&p!=null&&(a(xn()),h.forEach(I=>{a(jn({chatSessionId:p,id:I.id,entityIds:u,kind:"created_policy"}))}))},[B.fetchState,a,p,u,h,T]);const k=P.fetchState.fetchState;r.useEffect(()=>{k!=="Not-Started"&&k!=="Error"||a(ks())},[a,k]);const M=P.archiveFetchState.fetchState,A=ya(M);r.useEffect(()=>{A==="In-Progress"&&M==="Completed"&&a(Qe({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[M,a,A]);const y=r.useMemo(()=>P.templates.map(No),[P.templates]);Tt({isDataReady:P.fetchState.fetchState==="Completed"});const L=y.length>0||w>0,l=function(I){const{hasAnyPolicies:x,isChargeCardAdmin:Z,isFileUploadEnabled:q}=I,E=de(),V=Ce(),{tenantEmailDomain:Q}=Me(),{isAiCfoOpen:X,setIsAiCfoOpen:S}=Cr(),F=pr(),v=hr(),ee=o(ce=>On(ce)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:W,isResolved:ke}=wr("card_policy"),be=r.useMemo(()=>Pr(W,ke,3),[W,ke]),[ge,ae]=r.useState(""),ue=v&&F&&Q!=null&&!X,oe=r.useCallback(ce=>{if(Q==null)return;const Ea=ye(V.state?.pathnameStackToGoBack,V.pathname);E(`/${Q}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:Ea,referrer:"card_policy_hero",aiCfoInitialQuestion:ce,aiCfoShouldSubmit:ce!=null&&ce.trim().length>0}})},[V.pathname,V.state,E,Q]),te=r.useCallback(ce=>{ce.trim().length!==0&&(ae(""),oe(ce))},[oe]),Ye=r.useCallback(()=>{const ce=ge.trim();ce.length!==0&&(ae(""),oe(ce))},[ge,oe]),Ee=r.useCallback(()=>{},[]),ne=r.useCallback(ce=>{ae(ce)},[]),Ze=r.useCallback(()=>{S(!0)},[S]),Be=r.useCallback(()=>{oe(void 0)},[oe]);return r.useMemo(()=>{if(ue&&!x&&Z)return{aiAgentName:Mo,headline:Uo,subheadline:jo,promptChips:be,composer:{currentInput:ge,isSubmitting:ee,isFileUploadEnabled:q,onInputChange:ne,onSubmit:Ye,onStopSubmit:Ee},onPromptClick:te,onOpenSidePanel:Ze,onOpenFullView:Be,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[ge,x,ue,Z,q,ee,ne,Be,Ze,te,Ee,Ye,be])}({hasAnyPolicies:L,isChargeCardAdmin:b,isFileUploadEnabled:R}),C=D&&l!=null?c.jsx(fr,{...l}):null,N=d&&C==null,G=r.useCallback(()=>{const I=_e(n.state?.pathnameStackToGoBack),x=I.poppedPathname??"..";e(x,{state:{pathnameStackToGoBack:I.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),U=r.useCallback(I=>{t!=null&&e(`/${t}/cards/policy/${I}/edit`)},[e,t]),z=r.useCallback(I=>{a(Es(I))},[a]),Y=P.fetchState.fetchState;return!L&&Y!=="Completed"&&Y!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Wc,{onBackClick:G,onNewPolicyClick:O,onClickMenuIcon:i,isAiCfoAccessEnabled:d,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(qc,{policies:y,archivingTemplateId:P.archiveTargetTemplateId,pendingCreationCount:w,onBackClick:G,onNewPolicyClick:O,onEditPolicyClick:U,onArchivePolicyClick:z,onClickMenuIcon:i,policyAiCfoHero:C,isAiCfoAccessEnabled:N,onAskAiCfoClick:j})]})}function Ho(){const e=de(),{cardId:n}=Me(),t=pe(),a=re.getSignedInUser(),s=o(W=>fe(W)),b=Fe(),f=Pe(b?.loggedInUserRoleMap),{useFeatureGate:g}=le();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,i]=r.useState(!1),m=o(W=>Qa(W).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const R=s.userRole.includes("charge_card_user"),{isFeatureEnabled:D}=g(K.isChargeCardFeatureEnabled),d=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=g(K.isDebitCardFeatureEnabled),P=we(s),B=ve(s),p=Te(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=Re({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),u=xe({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:D,isBookKeepingTenant:B,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:h}),T=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(W=>ca(W,s.companyId)),M=oa(k.controllers),{creditAccount:A,creditAccountRepayment:y}=o(W=>ia(W)),L=o(W=>W.classListState.fetchState),l=!R&&u&&d,C=o(W=>Dt(W,n,l,u)),[N,G]=r.useState(!1),O=C.chargeCard,U=O?.cardCreatedByUser?.userId,z=o(W=>U!=null?za(W.userRoleState,U):void 0),Y=z?.accountingClassIDs[0],I=o(W=>Y!=null?Ya(W.classState,{classId:Y,reportId:"class_list"}):void 0),x=O?.cardHolderUser?.userId,Z=o(W=>x!=null?za(W.userRoleState,x):void 0),q=Z?.accountingClassIDs[0],E=o(W=>q!=null?Ya(W.classState,{classId:q,reportId:"class_list"}):void 0),V=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",Q=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{m&&_===!1&&V&&(i(!0),setTimeout(()=>{t(Za()),Q&&t(Qe({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[m,_,V,Q]),r.useEffect(()=>{N||C.fetchState==="Completed"||C.fetchState==="In-Progress"||n==null||(G(!0),t(ka(n,l,!1)))},[N,C,n,t]),r.useEffect(()=>{if(C.fetchState==="Completed"&&(V===!1||V&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||m===!1&&_===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const W=Ae(s.tenantEmailDomain,n,a,O,m);e(W)}},[C.fetchState,m,V]),r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&d&&f&&t(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&u&&d&&f&&t(_t()),L!=="Completed"&&L!=="In-Progress"&&t(Mn())},[A.fetchState,y.fetchState,t,u,d,f,L]);const X=()=>{if(a!=null&&n!=null){t(Za());const W=Ae(s.tenantEmailDomain,n,a);e(W)}},S=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",F=Je(u,w,T,d),v=xa(u,d,f,A,y),ee=Ir(S,C);return C.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:m}),c.jsx(Qc,{onGotItClick:X,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:d,productInformation:F,creditAccountInformation:v,debitAccountInformation:ee,chargeCardDetailView:C,creditAccount:A,classListFetchState:L,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:I?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ut=e=>{const{events:n,onEvent:t,onSubscribed:a}=e,s=Jc(),b=r.useRef(t),f=r.useRef(a),g=r.useRef(0);r.useEffect(()=>{b.current=t},[t]),r.useEffect(()=>{f.current=a},[a]);const _=r.useMemo(()=>[...n].sort().join("|"),[n]);r.useEffect(()=>{if(s==null||n.length===0)return;const i=[],m=new Set,R=()=>{if(f.current==null)return;const D=Date.now();D-g.current<5e3||(g.current=D,f.current())};return n.forEach(D=>{const[d,j]=Xc(D);if(j==="")return;const P=s.channel(d),B=h=>{b.current(j,h)};let p;if(P?.subscribed===!0)p=P,p.bind(j,B),m.has(d)||(m.add(d),R()),i.push(()=>{P.unbind(j,B)});else{if(p=P??s.subscribe(d),p.bind(j,B),!m.has(d)){m.add(d);const h=()=>{R()};p.bind("pusher:subscription_succeeded",h),i.push(()=>{p.unbind("pusher:subscription_succeeded",h)})}i.push(()=>{p.unbind(j,B)})}}),()=>{i.forEach(D=>D())}},[s,_])},vr="charge-card-transaction-update",Tr="charge-card-transaction-created",Fr="charge-card-transaction-declined",Rr="charge-card-transaction-updated",xr="charge-card-transaction-receipt-uploaded",ma="charge-card-status-update",jt="charge-card-spending-updated",it="credit-account-balance-updated",dt="charge-card-created",Mt="charge-card-limit-updated",Nt="charge-card-limit-reset",Vt="charge-card-renamed",Go="charge-card-department-updated",Br="charge-card-repayment-completed",Lr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",La="charge-card-cashback-earned",Ca=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),$o=[La,Ba],zo=De(function(e){const n=da(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(As({uiState:{sortKey:n,sortOrder:t}}))}}})(ao);function Yo(){const e=de(),n=pe(),t=Ce(),a=re.getSignedInUser(),s=o(j=>fe(j)),{useFeatureGate:b}=le(),{isFeatureEnabled:f}=b(K.isCardsCommentingEnabled),[g,_]=r.useState(!1),i=o(j=>da(j)),m=Dr(s.companyId,{clearParams:i.fetchState==="Completed"}),R=r.useCallback(()=>{const j=_e(t.state?.pathnameStackToGoBack),P=j.poppedPathname??Zo(s.tenantEmailDomain);e(P,{state:{pathnameStackToGoBack:j.newStack}})},[e,t,s.tenantEmailDomain]),D=Xe(s);if(Ut({events:Ca(D,$o),onEvent:j=>{switch(j){case La:case Ba:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{g||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(_(!0),n(_a()))},[g,i,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const d=i.cashbackSummary?.cashbackEarned?.amount!=null&&i.fetchState!=="Not-Started";return i.fetchState!=="In-Progress"||d?(i.cashbackSummary?.cashbackEarned?.amount??0)===0&&i.fetchState==="Completed"?c.jsx(ot,{}):c.jsx(zo,{onBackClick:R,isCardsCommentingEnabled:f,initialOpenThreadRequest:m}):c.jsx(eo,{onBackClick:R})}const Zo=e=>`/${e}/cards`,Ko={containerWidth:new Fa(100,58)},Wo=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f}=le(),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[R,D]=r.useState(!1),[d,j]=r.useState(!1),P=re.getSignedInUser();if(P==null)throw Error("Can't access onboarding card page without signing in...");const B=o(E=>fe(E));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=f(ze.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,w=o(E=>Ds(E,s)),u=w.chargeCard,T=o(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:k}=le(),{isFeatureEnabled:M}=k(K.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(K.isDebitCardFeatureEnabled),y=Te(A,B),L=Re({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:y}),l=!!B.companyChargeCardInfo?.info?.isChargeCardEnabled,C=B.userRole.includes("charge_card_user"),N=we(B),G=ve(B),O=B.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=xe({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:O}),z=!C&&U&&l;r.useEffect(()=>{g===!1&&T!=="In-Progress"&&T!=="Completed"&&(t(Ja()),_(!0)),i===!1&&w.fetchState==="Not-Started"&&(m(!0),t(ka(s,z,U)))},[i,w.fetchState,g,T]);const Y=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(R===!1&&(Y===!1||Y&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==P.userId)){const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);a(E,{state:{pathnameStackToGoBack:V}})}else if(R&&w.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(_s({chargeCardId:s}));const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(E,{state:{pathnameStackToGoBack:V}})}}},[w.fetchState,u?.type.code,R,w.isRefreshingViewInBackground]);const I=re.getZeniOtpTokenForCardHolder(s),x=o(E=>Nn(E.userState,P.userId)),Z=()=>{u?.status?.code!=="active"&&t(ga(s,!0))};r.useEffect(()=>{w.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&R===!1&&(setTimeout(Z,3e3),D(!0))},[w.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const q=E=>{j(E)};if(T!=="Completed"||u==null)return c.jsx(va,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(x?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Jo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:d,handleDrawerToggle:q}),c.jsx(qo,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:x.phone,signedInUser:P,isSandboxEnv:Ft(),chargeCardDetailState:w,signedInUserToken:I,navigate:a,currentTenant:B,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{q(!0)}}),e!=null?c.jsx(Qo,{windowSize:n,children:e}):null]})},qo=De(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=Ps(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const f=Vn(e,s),g=n.updateStatus,_=la(e,!1,!1,!1);let i=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(i=!0);const m=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(ws())||m,showMenuIcon:i,shippingAddress:b,vgsVaultId:st.cardVaultId,twoFAView:f,activationWaitStatus:g,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:i=>{e(Ts(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onCVVActivateSuccess:()=>{e(vs({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("onboard")===!0?ea(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(to),Qo=Ne.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: ${e=>`${Ko.containerWidth.value(e.windowSize)}%`};
|
|
5
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
-
`,Jo=Ne.div`
|
|
7
|
-
display: flex;
|
|
8
|
-
min-height: 100%;
|
|
9
|
-
width: 100%;
|
|
10
|
-
flex: 1 1 auto;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
align-items: center;
|
|
13
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
14
|
-
`,Wa=ua.getLocalizedStrings().dateFormat,Xo={overlayWidth:new Fa(100,100,58)},Or=[Br,it],ei=new Set(Or),ai=De(function(e,n){const t=n.currentTenant?.companyId;return{plaidConnectionDetails:Bs(e,t,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Ls(e.depositAccountState,e.depositAccountListState)}},function(e,n){const{navigate:t,currentTenant:a,hasZeniAccountsAdminAccess:s,isZeniAccountsUser:b,isCashbackInfoFetchStateCompleted:f,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:_,controllerEmails:i,paymentDetails:m,productInformation:R,cashbackInformation:D,paymentSourceInformation:d,creditAccountInformation:j,debitAccountInformation:P,paymentInitiatedDate:B,sourcePage:p}=n,{tenantEmailDomain:h}=a,w=()=>{e($n(!0));const u=Xe(a);u!=null&&u!==""&&e(Pa(u,!0,!0)),e(qe(!0))};return{onBackNavigation:()=>{if(f&&g&&_&&D!=null&&J.trackCardsPayEarlyFormClick(i,R,D,"Back",m.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:m.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:m.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:m.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:m.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:B?.add(3,"day").format(Wa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:B?.format(Wa.visual.MMMDCommaYYYYformat)},d,j,P),p==="cardPaymentHistory")n.closeDrawerHandler(!0),e(zn());else{const u=ea(h);t(u)}},onUpdatePaymentAccountStatus:(u,T,k)=>{e(js(u,T,"bill_pay","bill_pay_detail",k))},onEstablishConnectionSuccess:()=>{e(Pa(a.companyId,!0))},onFetchLinkTokenClick:u=>{e(Us("external_account",u))},onEstablishConnectionClick:u=>{e(Os(u,a.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{s?window.open(`/${h}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{b?window.open(`/${h}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onEventReceived:u=>{ei.has(u)&&w()},onPusherSubscribed:w}})(ct(no)),Ht=({isPaymentDrawerOpen:e,closeDrawerHandler:n,pageName:t,creditAccountSpentAmount:a,productInformation:s,sourcePage:b,creditAccountInformation:f,debitAccountInformation:g,cashbackInformation:_,isDebitCardInfoFetchStateCompleted:i,isCreditCardInfoFetchStateCompleted:m,isCashbackInfoFetchStateCompleted:R,paymentInitiatedDate:D,retryRepayment:d})=>{const j=de(),{useDynamicConfig:P}=le(),{configValue:B}=P(ze.zeniAccountsConfig),p=Fs(B),h=o(F=>Hn(F)),{creditAccount:w}=o(F=>ia(F)),u=o(F=>fe(F)),T=Rt(),k=Ta(),M=pe(),A=re.getSignedInUser(),y=Fe(),[L,l]=r.useState(!1),[C,N]=r.useState(!1),{configValue:G}=P(ze.zeniCardsConfig),O=G.credit_card_auto_pay_threshold_by_company_id?.[u.companyId]??G.default_credit_card_auto_pay_threshold??Ao,U=Gn(y?.loggedInUserRoleMap),z=Rs(y?.loggedInUserRoleMap),Y=!!u.companyZeniAccountInfo?.info?.isZeniAccountEnabled,I=o(F=>wa(F,u.companyId)),x=I.companyChargeCardInfo?.primaryFundingAccount,Z=I.allFundingAccounts.find(F=>F.id===x?.accountId),q=o(F=>ca(F,u.companyId)),E=oa(q.controllers);r.useEffect(()=>{if(h.fetchState!=="Completed"&&h.fetchState!=="In-Progress"&&M($n()),h.fetchState==="Completed"&&!C){const F=u.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,v=h.transferFromAccounts.find(W=>W.id===F);let ee;if(b==="cardPaymentHistory"&&d){const W=d.paymentAccountId!=null?h.transferFromAccounts.find(ke=>ke.id===d.paymentAccountId):void 0;ee={amount:d.amount,isAutoRepayment:u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:pn(),transferFrom:W??v}}else ee={amount:{amount:w.balance.amount+w.hold.amount,currencyCode:w.balance.currencyCode,currencySymbol:w.balance.currencySymbol},isAutoRepayment:u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:pn(),transferFrom:v};M(un(ee)),N(!0)}},[h.fetchState,C,b,d,h.transferFromAccounts,u.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,u.companyChargeCardInfo?.info?.isAutoPayEnabled,w.balance.amount,w.balance.currencyCode,w.balance.currencySymbol,w.hold.amount,M]);const V={isZeniCheckingEnabled:u.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:Z?.accType==="depositAccount",creditCardPaymentSourceAccountName:Z?.label,creditCardPaymentSourceAccountType:Z?.accType,creditCardPaymentSourceLastFourDigits:Z?.accountLast4,creditCardPaymentSourceBalance:Z?.accountBalance?.available?.amount??0};if(r.useEffect(()=>{I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&M(Pa(u.companyId,!0))},[I.fetchState]),r.useEffect(()=>{h.updateStatus==="Completed"&&_!=null&&R&&m&&i&&J.trackCardsPayEarlyPayNowClick(E,s,_,h.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:h.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:h.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:h.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:h.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Wa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Wa.visual.MMMDCommaYYYYformat)},V,f,g)},[h.updateStatus,_,R,m,i,D]),r.useEffect(()=>{h.fetchState==="Completed"&&_!=null&&R&&m&&i&&!L&&e&&C&&_!=null&&(J.trackCardsPayEarlyFormView(E,s,_,t,u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,w.balance.amount,V,f,g),l(!0))},[h,R,m,i,L,e,C]),A==null)throw Error("Can't access invite people page without signing in...");const Q=()=>{n(!0),M(zn())},X=Xe(u),S={events:e?Ca(X,Or):[],eventCallback:(F,v,ee)=>{ee.onEventReceived(F)},onSubscribed:F=>{F.onPusherSubscribed()}};return c.jsx(c.Fragment,{children:c.jsx(yr,{onClose:()=>{Q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Xo.overlayWidth.valuePercentage(k),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:T.colors.black,opacity:.75,cursor:"pointer"}}},children:c.jsx(ti,{onClick:F=>F.stopPropagation(),children:c.jsx(ai,{...S,closeDrawerHandler:n,navigate:j,paymentDetails:h,creditAccountSpentAmount:a,onTransferClick:()=>{R&&m&&i&&_!=null&&J.trackCardsPayEarlyFormClick(E,s,_,"Pay Now",h.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:h.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:h.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:h.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:h.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},V,f,g),M(xs({companyId:u.companyId}))},onDismissClick:Q,onSaveChangesToLocalStore:F=>{M(un(F))},currentTenant:u,hasZeniAccountsAdminAccess:U,isZeniAccountsUser:z,isZeniAccountSetupEnabled:Y,productInformation:s,sourcePage:b,controllerEmails:E,autoPayThreshold:O,paymentSourceInformation:V,creditAccountInformation:f,debitAccountInformation:g,cashbackInformation:_,isCashbackInfoFetchStateCompleted:R,isCreditCardInfoFetchStateCompleted:m,isDebitCardInfoFetchStateCompleted:i,paymentInitiatedDate:D,maxInsuredAmount:p.maxInsuredAmount})})})})},ti=Ne(Eo)`
|
|
15
|
-
display: flex;
|
|
16
|
-
min-height: 100%;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
`,Gt=e=>e!=null&&typeof e=="object"?e:null,ie=e=>typeof e=="string"?e:void 0,Ue=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,qa=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",ft=e=>{if(e==null||typeof e!="object")return!1;const n=e;return typeof n.transaction_id=="string"&&typeof n.amount=="number"&&typeof n.currency_code=="string"&&typeof n.currency_symbol=="string"&&typeof n.direction=="string"&&!!qa(n.transaction_status)&&!!qa(n.transaction_type)},$t=(e,n)=>{const t=e?.card_status;if(!qa(t))return null;const a=e?.is_locked_by_admin;return{cardId:n,cardStatus:t,isLockedByAdmin:typeof a=="boolean"?a:void 0}},kt=[vr,Tr,Fr,Rr,xr,ma,jt,it,Mt,Nt,Vt],Ur=[La,Ba],ni=new Set([...kt,...Ur]),gt=ua.getLocalizedStrings().dateFormat,ri=De(function(e,n){const{includeCreditAccountInfo:t,cardId:a,signedInUserToken:s,isChargeCardFeatureEnabled:b}=n,f=re.getSignedInUser(),g=e.tenantState.currentTenantId,_={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},i=Dt(e,a,t,b),m=Zs(e,a),R=Ks(e);return{chargeCardDetailView:i,chargeCardsRecurringExpensesState:m,vgsVaultId:st.cardVaultId,transactionAttachmentsEndpointToFetch:`${It}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${It}/card_transaction_attachment`,authParams:_,isSnackbarOpen:R.isSnackbarOpen,cardsEndPoint:`${gr.cardMicroServiceBaseUrl}`,signedInUserToken:i.twoFAView.token??s}},function(e,n){const{cardId:t,currentTenant:a,navigate:s,location:b,cardProviderId:f,includeCreditAccountInfo:g,setIsPaymentOpen:_,controllerEmails:i,productInformation:m,cashbackInformation:R,primaryFundingAccountDetails:D,creditAccountInformation:d,debitAccountInformation:j,isChargeCardFeatureEnabled:P}=n,{tenantEmailDomain:B}=a;return{onEventReceived:(p,h)=>{(({event:w,data:u,cardId:T,dispatch:k,subscribedEvents:M})=>{const A=Gt(u);switch(w){case La:case Ba:return void k(_a(!0));case vr:{const y=ie(A?.card_id);if(y==null||y!==T)return;const L=ie(A?.transaction_id),l=A?.transaction_status;return L!=null&&qa(l)?void k(zs({transactionId:L,transactionStatus:l})):void k(na(T,null,null,!0))}case ma:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=$t(A,y);return L!=null?void k(Pt(L)):void k(ga(T,!0))}case jt:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=ie(A?.currency_code),l=ie(A?.currency_symbol),C=Ue(A?.balance);return L!=null&&l!=null&&C!=null?(k($s({cardId:y,currencyCode:L,currencySymbol:l,balance:C,hold:Ue(A?.hold),dailyPurchaseSpends:Ue(A?.daily_purchase_spends),monthlyPurchaseSpends:Ue(A?.monthly_purchase_spends),dailyWithdrawals:Ue(A?.daily_withdrawals),monthlyWithdrawals:Ue(A?.monthly_withdrawals)})),void k(qe(!0))):(k(ga(T,!0)),void k(qe(!0)))}case it:{const y=ie(A?.currency_code),L=ie(A?.currency_symbol),l=Ue(A?.available_amount),C=Ue(A?.balance_amount);return y!=null&&L!=null&&l!=null&&C!=null?void k(Gs({currencyCode:y,currencySymbol:L,available:l,balance:C,hold:Ue(A?.hold_amount),cashback:Ue(A?.cashback_amount)})):void k(qe(!0))}case Tr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=A?.transaction;return ft(L)?void k(Hs({cardId:y,transaction:L})):void k(na(T,null,null,!0))}case Fr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=A?.transaction;return ft(L)?void k(Vs({cardId:y,declineReason:ie(A?.decline_reason),transaction:L})):void k(na(T,null,null,!0))}case Rr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=A?.transaction;return ft(L)?void k(Ns({cardId:y,transaction:L})):void k(na(T,null,null,!0))}case xr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=ie(A?.transaction_id),l=A?.attachment_file_paths;return L!=null&&Array.isArray(l)&&l.every(C=>typeof C=="string")?void k(Ms({cardId:y,transactionId:L,attachmentFilePaths:l})):void k(na(T,null,null,!0))}case Mt:case Nt:case Vt:{const y=ie(A?.card_id);if(y==null||y!==T)return;k(ga(T,!0))}}})({event:p,data:h,cardId:t,dispatch:e,subscribedEvents:ni})},onPusherSubscribed:()=>{e(ga(t,!0)),e(na(t,null,null,!0)),e(qe(!0))},onReloadTransactions:()=>{e(ka(t,g,P))},onFetchChargeCardTransactionList:(p,h)=>{e(na(t,p,h))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{f!=null&&e(tt(p,"ChargeCardHolder",t))},onResendOtp:p=>{f!=null&&e(at(p,"ChargeCardHolder",t))},onVerifyOtp:(p,h)=>{f!=null&&e(et(p,h,"ChargeCardHolder",t))},onVerifyOtpSuccess:p=>{p!=null&&re.saveZeniOtpTokenForCardHolder(p,t)},onColorCodeChange:p=>{e(ec(t,p))},onLockChargeCard:(p,h)=>{e(er(p,t,h))},onUnlockChargeCard:p=>{e(Xn(p,t))},onCloseChargeCard:p=>{e(Jn(t,p))},onFetchChargeCardsRecurringExpenses:()=>{e(Qn([t]))},updateChargeCardName:(p,h)=>{e(qn(p,t,h))},updateChargeCardTransactionAttachments:(p,h)=>{h!=null&&e(Xs({transactionId:p,data:h}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,h,w,u)=>{e(Js({chargeCardId:h,transactionId:p,fetchState:w,error:u}))},updateChargeCardTransactionReceiptsShowTick:(p,h,w)=>{e(Qs({chargeCardId:h,transactionId:p,shouldShowTick:w}))},onChargeCardRevokeInviteClick:()=>{e(Wn(t))},updateChargeCardTransactionIsViewReceiptClicked:(p,h,w)=>{e(qs({chargeCardId:h,transactionId:p,isViewReceiptClicked:w}))},onChargeCardTransactionRowClick:(p,h)=>{const w=ye(b.state?.pathnameStackToGoBack,b.pathname);s(`../../transaction/${p}/${h}`,{state:{pathnameStackToGoBack:w}})},onBackClick:()=>{const p=_e(b.state?.pathnameStackToGoBack),h=ea(B);s(h,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(Ws())},onUpdateDebitCardPinAttempt:p=>{e(Kn(t,p)),p==="success"&&e(Qe({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,h)=>{p?e(Qe({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):h!=null&&e(Qe({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:h.message}]}))},updateSpendLimit(p,h,w,u){e(Zn(p,h,w.code,u))},shouldOpenCreditCardPaymentDrawer(p){p&&R!=null&&J.trackCardsPayEarlyClick(i,m,R,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:a.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:D?.accType==="depositAccount",creditCardPaymentSourceAccountName:D?.label,creditCardPaymentSourceAccountType:D?.accType,creditCardPaymentSourceLastFourDigits:D?.accountLast4,creditCardPaymentSourceBalance:D?.accountBalance?.available?.amount??0},d,j),_(p)}}})(ct(so));function si(){const e=de(),n=pe(),t=Ce(),{cardId:a}=Me(),[s,b]=r.useState(!1),[f,g]=r.useState(!1),{useDynamicConfig:_}=le(),i=re.getSignedInUser(),m=o(H=>fe(H)),R=o(H=>Qa(H).firstViewAfterActivation),D=o(H=>H.classListState.fetchState),{configValue:d}=_(ze.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:j}=_(ze.zeniCardsConfig),P=j.enable_card_controls_for_company_ids,B=j.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(P)&&P.includes(m.companyId),[p,h]=r.useState(!1),[w,u]=r.useState(!1),{useFeatureGate:T}=le(),{isFeatureEnabled:k}=T(K.isChargeCardFeatureEnabled),{isFeatureEnabled:M}=T(K.isDebitCardFeatureEnabled),A=Te(M,m),y=Re({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:A}),{isFeatureEnabled:L}=T(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:l}=T(K.isCardsCommentingEnabled),C=ve(m),N=we(m),G=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,O=xe({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:k,isBookKeepingTenant:C,isDebitCardProductVisible:y,chargeCardsCreditAccountLimit:G}),U=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,z=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,Y=!m.userRole.includes("charge_card_user")&&O&&z;if(a==null)throw Error("Empty card id is not valid...");const I=o(H=>wa(H,m.companyId)),{creditAccount:x,creditAccountRepayment:Z}=o(H=>ia(H)),q=re.getZeniOtpTokenForCardHolder(a),E=o(H=>Dt(H,a,Y,O)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:Q}=Ra({mobileExploreReferrer:"Card Detail"});Tt({isDataReady:E.fetchState==="Completed"});const X=o(H=>da(H)),S=E.chargeCard,F=Fe(),v=Pe(F?.loggedInUserRoleMap),ee=S?.type.code==="business_physical_debit_card"||S?.type.code==="business_virtual_debit_card",W=S?.type.code==="business_physical_debit_card"||S?.type.code==="business_physical_credit_card",ke=S?.type.code==="business_virtual_debit_card"||S?.type.code==="business_virtual_credit_card",be=S?.type.code==="business_virtual_debit_card",ge=xa(O,z,v,x,Z),ae=Ir(ee,E),ue=Lt(v,X),oe=Je(O,y,U,z),te=E.depositAccountLimitFetchState.fetchState!=="Completed"&&E.depositAccountLimitFetchState.fetchState!=="In-Progress",Ye=o(H=>ca(H,m.companyId)),Ee=oa(Ye.controllers),ne=o(H=>S?.cardCreatedByUser?.userId!=null?za(H.userRoleState,S?.cardCreatedByUser?.userId):void 0),Ze=o(H=>ne?.accountingClassIDs[0]!=null?Ya(H.classState,{classId:ne?.accountingClassIDs[0],reportId:"class_list"}):void 0),Be=o(H=>S?.cardHolderUser?.userId!=null?za(H.userRoleState,S?.cardHolderUser?.userId):void 0),ce=o(H=>Be?.accountingClassIDs[0]!=null?Ya(H.classState,{classId:Be?.accountingClassIDs[0],reportId:"class_list"}):void 0),Ea=m?.userRole,pa=o(H=>la(H,!1,y,k).revokeCardInvite),ha=ya(pa.saveStatus.fetchState);if(r.useEffect(()=>{if(ha==="In-Progress"&&pa.saveStatus.fetchState==="Completed"){const H=ea(m.tenantEmailDomain);e(H)}},[ha,pa.saveStatus.fetchState,e,m.tenantEmailDomain]),r.useEffect(()=>{R&&s===!1&&ke&&(b(!0),setTimeout(()=>{n(Za()),be&&n(Qe({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[R,s,ke,be]),r.useEffect(()=>{p||E.fetchState==="Completed"||E.fetchState==="In-Progress"||a==null||(h(!0),n(ka(a,Y,O,!1)))},[p,E,a,n]),r.useEffect(()=>{!w&&E.fetchState==="Completed"&&E.chargeCard?.connectedAccountId!=null&&ee&&te&&v&&(u(!0),n(Yn({depositAccountId:E.chargeCard?.connectedAccountId})))},[w,E,n,te,v]),r.useEffect(()=>{X.fetchState!=="Completed"&&X.fetchState!=="In-Progress"&&v&&n(_a()),D!=="Completed"&&D!=="In-Progress"&&n(Mn()),E.transactionStatistics.fetchState!=="Completed"&&E.transactionStatistics.fetchState!=="In-Progress"&&n(Ys({chargeCardId:a})),I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&n(Pa(m.companyId,!0))},[X.fetchState,n,v,D,E.transactionStatistics.fetchState,I.fetchState]),r.useEffect(()=>{if(!(E.fetchState!=="Completed"||O&&x.fetchState!=="Completed"||S==null||E.transactionStatistics.fetchState!=="Completed"||ee&&v&&E.depositAccountLimitFetchState.fetchState!=="Completed")){const H=S.type.code.includes("physical"),he=H?S.cardActivationAttemptHistory[0]?.timestamp:S.createTime;J.trackCardsCardDetailView(Ee,oe,{cardId:a,cardName:S.cardName,cardType:S.type.code.includes("credit")?"credit":"debit",cardCategory:H?"physical":"virtual",cardLimit:ba(S.limit.amount),cardLastFourDigits:S.accountLast4,cardStatus:S.status.code,cardAssignedDate:S.createTime?.format(gt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:S.providerCardCreateTime?.format(gt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:he?.format(gt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:S.creditLimitFrequency.name,cardSpentAmount:ba(S.balance.amount),cardAvailableLimit:ba(S.available.amount),cardUtilizationPercent:S.limit.amount>0?Math.round((S.limit.amount-S.available.amount)/S.limit.amount*100):0,cardUtilizationAmount:ba(S.limit.amount-S.available.amount),totalNumberOfDeclinedTransactions:E.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:E.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:E.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:E.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:E.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:E.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:yt(S.cardCreatedByUser,!1),cardIssuedByEmail:S.cardCreatedByUser?.email,cardIssuedByUserId:S.cardCreatedByUser?.userId,cardIssuedByRole:ne?.userRoles,cardIssuedByDepartment:Ze?.className},{cardholderName:yt(S.cardHolderUser,!1),cardholderEmail:S.cardHolderUser?.email,cardholderRole:Be?.userRoles,cardholderUserId:S.cardHolderUser?.userId,cardholderDepartment:ce?.className},ge,ae)}},[E.fetchState,E.depositAccountLimitFetchState.fetchState,E.transactionStatistics.fetchState,x.fetchState,v]),i==null)throw Error("Can't access card detail page without signing in...");const aa=Xe(m),Aa=v?[...kt,...Ur]:kt,lt={events:Ca(aa,Aa),eventCallback:(H,he,Le)=>{Le.onEventReceived(H,he)},onSubscribed:H=>{H.onPusherSubscribed()}},ut=()=>{if(a!=null&&S!=null){const{ownerName:H,cardName:he,utilisation:Le,limit:Ve,frequency:He,cardColor:Ge}=bt(S),$e=S.cardHolderUserId===i.userId;J.trackCardsDetailPageViewed(a,H,he,Le,Ve,He,Ge,$e)}};r.useEffect(()=>{if(E.fetchState==="Completed"){const H=E.chargeCard;if(H?.status.code==="inactive"||ee&&H?.isPinSet===!1||W&&R){const he=Ae(m.tenantEmailDomain,a,i,S,R);e(he)}}},[E.fetchState]);const me=(H,he)=>{if(a!=null&&S!=null){const{ownerName:Le,cardName:Ve,utilisation:He,limit:Ge,frequency:$e}=bt(S),ta=S.cardHolderUserId===i.userId;J.trackCardsDetailPageClicked(a,Le,Ve,He,Ge,$e,H,ta,he)}},Oa=(H,he)=>{if(a!=null&&S!=null){const{ownerName:Le,cardName:Ve,utilisation:He,limit:Ge,frequency:$e}=bt(S),ta=S.cardHolderUserId===i.userId;J.trackCardsVerifyPopUpClick(a,Le,Ve,He,Ge,$e,H,ta,he)}},Da=x.balance.amount+x.hold.amount,mt=m.companyChargeCardInfo?.info?.primaryFundingAccount,Ua=I.allFundingAccounts.find(H=>H.id===mt?.accountId),ja=E.chargeCard!=null,Ma=E.depositAccountLimit!=null;return E.fetchState!=="Error"||ja?!ja&&(E.fetchState==="In-Progress"||E.fetchState==="Not-Started")||pa.saveStatus.fetchState==="In-Progress"||!Ma&&ee&&v&&E.depositAccountLimitFetchState.fetchState!=="Completed"?c.jsx(ro,{}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:R}),E.fetchState==="Completed"?c.jsx(xt,{analytics:J,onLoad:ut}):null,f===!0?c.jsx(Ht,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:f,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:oe,creditAccountInformation:ge,debitAccountInformation:ae,cashbackInformation:ue,creditAccountSpentAmount:Da,isDebitCardInfoFetchStateCompleted:!ee||!v||E.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!O||x.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!v||X.fetchState==="Completed",paymentInitiatedDate:Z.initiatedRepaymentDate}):null,c.jsx(ri,{...lt,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:Oa,onFireOnClickAnalytics:me,isSandboxEnv:Ft(),signedInUser:i,location:t,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ne?.userRoles,cardIssuedByDepartmentName:Ze?.className,cardHolderRoles:Be?.userRoles,cardHolderDepartmentName:ce?.className,loggedInUserRole:Ea,isChargeCardFeatureEnabled:O,isDebitCardFeatureEnabled:y,isDebitCardSetupEnabled:U,isChargeCardSetupEnabled:z,isCardControlsEnabled:B,isEarlyPayEnabled:L,controllerEmails:Ee,chargeCardCashbackDetailState:X,productInformation:oe,creditAccountInformation:ge,debitAccountInformation:ae,cashbackInformation:ue,classListFetchState:D,primaryFundingAccountDetails:Ua,currentTenant:m,cardProviderId:E.chargeCard?.cardProviderID,cardId:a,creditAccount:x,creditAccountRepayment:Z,includeCreditAccountInfo:Y,signedInUserToken:q,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:d.documentAiReceiptMaxSizeLimitBytes!=null?d.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:V,onAskAiCfoClick:Q,isCardsCommentingEnabled:l})]}):c.jsx(ot,{})}const bt=e=>{const n=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,t=e.cardName,a=(e.limit.amount??0)-(e.available.amount??0),s=e.limit.amount,b=e.creditLimitFrequency.name;return{ownerName:n,cardName:t,utilisation:a,cardColor:e.cardColorCode??"",frequency:b,limit:s}},{spendManagement:{chargeCard:{cardsAiCfoHero:{headline:ci,subheadline:oi,pageTitle:ii}}}}=ua.getLocalizedStrings(),jr=[ma,it,Lr,Ba,La,dt,Vt,Go,Mt,Nt,jt],di=new Set(jr),Et=Bt((e,n,t,a)=>{e(sa(n,t,a,!0))},400),li=Ne.div`
|
|
19
|
-
display: flex;
|
|
20
|
-
width: 100%;
|
|
21
|
-
flex: 1 1 auto;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,ui=De(function(e,n){const t=la(e,n.includeCreditAccountDebitSummaryAndCashbackInfo,n.isDebitCardFeatureEnabled&&n.isDebitCardSetupEnabled,n.isChargeCardFeatureEnabled&&n.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:sc(e),bulkActionView:cc(e),companyLegalName:n.currentTenant.companyName,admins:n.admins,searchText:t.searchText,uiState:t.uiState,signedInUser:n.signedInUser}},function(e,n){const{navigateAndClearBulkSelection:t,currentTenant:a,location:s,signedInUser:b,chargeCardListState:f,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:_,isCreditCardProductVisibleForExpressInterest:i,isChargeCardSetupEnabled:m,isDebitCardFeatureEnabled:R,isDebitCardSetupEnabled:D,isDebitCardTOSAccepted:d,isChargeCardTOSAccepted:j,controllerEmails:P,depositAccountListWithDebitCardIssued:B,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:h,productInformation:w,cashbackInformation:u,creditAccountInformation:T,debitAccountInformation:k,updatePayNowInfoTooltip:M,isUserHasCardsAdminLevelAccess:A}=n,{tenantEmailDomain:y}=a,{cards:L}=f;return{onChargeCardRowClick:(l,C)=>{const N=Er(L,l);let G;N!=null&&((U=>{const z=U.limit.amount-U.available.amount,Y=`${U.cardHolderUser?.firstName.toLowerCase()} ${U.cardHolderUser?.lastName.toLowerCase()}`,I=U.cardName,x=U.department?.className??"",Z=U.limit.amount,q=U.creditLimitFrequency.name;J.trackCardsListRowClicked(Y,I,x,z,Z,q,b.userId===U.cardHolderUserId)})(N),ra(R,D,B)&&J.trackCardsCardListRowClick(P,w,"Card Row Item","row_clicked",C+1,{cardOwner:yt(N.cardHolderUser,!1),cardName:N.cardName,cardType:N.type.code.includes("credit")?"credit":"debit",cardStatus:N.status.code,cardUtilizationAmount:ba(N.limit.amount-N.available.amount),cardUtilizationPercent:N.limit.amount>0?Math.round((N.limit.amount-N.available.amount)/N.limit.amount*100):0,cardLimit:ba(N.limit.amount)},u,T,k)),G=N?.status.code==="request_on_hold"&&b.userId===N.cardHolderUserId?Ar(y):Ae(y,l,b,N);const O=ye(s.state?.pathnameStackToGoBack,s.pathname);t(G,{state:{pathnameStackToGoBack:O}})},onFetchChargeCardsRecurringExpenses:l=>{e(Qn(l))},onFetchDepositAccountLimit:l=>{e(Yn({depositAccountId:l}))},onChargeCardResendInviteClick:l=>{e(pc(l))},onChargeCardRevokeInviteClick:l=>{e(Wn(l))},onLockChargeCardList:(l,C)=>{e(Cc(l,C))},onUnlockChargeCardList:l=>{e(mc(l))},onCloseChargeCardList:(l,C)=>{e(uc(l,C))},onRevokeChargeCardList:l=>{e(lc(l))},updateChargeCardListSpendLimit(l,C,N){e(dc(l,C,N.code))},onLockChargeCard:(l,C)=>{e(er(A,l,C))},onUnlockChargeCard:l=>{e(Xn(A,l))},onCloseChargeCard:(l,C)=>{e(Jn(l,C))},onUpdateSpendLimit(l,C,N,G){e(Zn(l,C,N.code,G))},updateChargeCardName:(l,C)=>{e(qn(A,l,C))},onClickSetupIcon:()=>{J.trackCardsListPageClicked("settings"),ra(R,D,B)&&u!=null&&J.trackCardsSettingsClick(P,w,u,T,k);const l=_o(y),C=ye(s.state?.pathnameStackToGoBack,s.pathname);t(l,{state:{pathnameStackToGoBack:C}})},onIssueCardClick:()=>{J.trackCardsListPageClicked("new card"),ra(R,D,B)&&u!=null&&J.trackCardsNewCardClick(P,w,u,"New Button","card_creation_initiated","Card List",T,k);const l=mi(y),C=ye(s.state?.pathnameStackToGoBack,s.pathname);t(l,{state:{pathnameStackToGoBack:C}})},onColumnSortConfigChanged:(l,C)=>{ra(R,D,B)&&u!=null&&J.trackCardsCardListSortClick(P,w,u,"Sort Icon","sort",l,C==="ascending"?"ASC":"DESC","Cards List",T,k),e(St({uiState:{sortKey:l,sortOrder:C}}))},onSearchTextChanged:l=>{e(ic(l))},onReloadCards:()=>{e(sa(g,R&&D,_&&m,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{ra(R,D,B)&&u!=null&&J.trackCardsCashbackOverviewClick(P,w,u,"Cashback Overview","cashback_details_viewed",T,k),t("./cashback")},onClickStatementsIcon:()=>{ra(R,D,B)&&u!=null&&J.trackCardsStatementsClick(P,w,u,T,k),t("./statements")},onCreateNowClick:l=>{ra(R,D,B)&&u!=null&&J.trackCardsNewCardClick(P,w,u,"Promo Banner","card_creation_initiated","Card List",T,k),t(`./new?cardType=${l}`)},onPromoCardClick:l=>{t(l==="debit"&&R&&!d||l==="credit"&&i&&!j?`../promo?cardPromoType=${l}`:"./setup")},navigateToCreditCardPaymentPage:(l,C)=>{h==="Completed"&&a.company!=null&&u!=null&&J.trackCardsPayEarlyClick(P,w,u,"Card List",l,C,{isZeniCheckingEnabled:a.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},T,k);const N=Ci(y);t(N)},navigateToCreditCardPaymentHistoryPage:()=>{const l=pi(y),C=ye(s.state?.pathnameStackToGoBack,s.pathname);t(l,{state:{pathnameStackToGoBack:C}})},shouldShowPayNowInfoTooltip:M,onSetRowActionCardId:l=>{e(oc(l))},onSetBulkActionCardIds:l=>{e(ar(l))},onEventReceived:l=>{di.has(l)&&Et(e,g,R&&D,_&&m)},onPusherSubscribed:()=>{Et(e,g,R&&D,_&&m)}}})(ct(oo));function fn({isPaymentDrawerOpen:e}){const n=de(),t=pe(),a=Ce(),s=r.useCallback(($,Oe)=>{t(ar([])),n($,Oe)},[t,n]),[b,f]=r.useState(!1),[g,_]=r.useState(re.getPayNowInfoTooltip()??!1),i=$=>{re.savePayNowInfoTooltip($),_($)},[m,R]=r.useState(!1),D=re.getSignedInUser(),d=o($=>fe($)),[j,P]=r.useState(!1),[B,p]=r.useState(!1),{isAiCfoAccessEnabled:h,onAskAiCfoClick:w}=Ra({mobileExploreReferrer:"Cards"}),u=d.userRole.includes("charge_card_user"),T=!u,k=!!d.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:M,useDynamicConfig:A}=le(),{isFeatureEnabled:y}=M(K.isCashbackFeatureEnabled),{isFeatureEnabled:L}=M(K.isChargeCardFeatureEnabled),{isFeatureEnabled:l}=M(K.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=M(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:N}=M(K.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:G}=M(K.isCardsCommentingEnabled),{isFeatureEnabled:O}=M(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:U}=M(K.isCardPolicyEnabled),{isFeatureEnabled:z}=M(K.isAiCardCreationEnabled),Y=Te(l,d),I=Re({isDebitCardFeatureEnabled:l,isBankingOnlyTenant:Y}),x=we(d),Z=ve(d),q=d.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=xe({isCardsOnlyTenant:x,isChargeCardFeatureEnabled:L,isBookKeepingTenant:Z,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:q}),V=kr({isCardsOnlyTenant:x,isChargeCardFeatureEnabled:L,isBookKeepingTenant:Z}),{configValue:Q}=A(ze.zeniCardsConfig),X=Fe(),S=Pe(X?.loggedInUserRoleMap),F=o($=>ca($,d.companyId)),v=oa(F.controllers),ee=Q.charge_card_cashback_rate_per_transaction!=null?Q.charge_card_cashback_rate_per_transaction:.0175,W=Q.credit_card_pay_now_threshold_by_company_id?.[d.companyId]??Q.default_credit_card_pay_now_threshold??Do,ke=Q.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(Q.enable_card_controls_for_company_ids)&&Q.enable_card_controls_for_company_ids.includes(d.companyId),be=!!d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,ge=!!d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,ae=!!d.companyChargeCardInfo?.info?.isChargeCardEnabled,ue=o($=>Hn($)),oe=ya(ue.updateStatus),te=o($=>la($,T,I&&k,E&&ae)),Ye=o($=>ac($)),Ee=o($=>tc($)),ne=o($=>nc($)),Ze=o($=>rc($)),Be=o($=>ne==null?[]:Un($.aiCfoState,ne).filter(Oe=>Oe.kind==="creating_cards"),At),ce=ya(Ee.fetchState);r.useEffect(()=>{ce==="In-Progress"&&Ee.fetchState==="Completed"&&ne!=null&&Be.forEach($=>{t(jn({chatSessionId:ne,id:$.id,entityIds:Ze,kind:"created_cards"}))})},[t,Ee.fetchState,ne,Ze,Be,ce]);const Ea=te.cards.filter($=>$.type.code.includes("debit")).map($=>$.connectedAccountId),pa=[...new Set(Ea)],ha=o($=>da($)),aa=o($=>nt($,pa)),Aa=o($=>wa($,d.companyId)),lt=Aa.companyChargeCardInfo?.primaryFundingAccount,ut=Aa.allFundingAccounts.find($=>$.id===lt?.accountId),me=te.fetchState,Oa=te.creditAccount,Da=r.useCallback(()=>S===!0&&U===!0&&me==="Completed"&&re.getCardPolicyPopupSeen(d.tenantEmailDomain??"")!==!0,[S,U,me,d.tenantEmailDomain]),[mt,Ua]=r.useState(Da);r.useEffect(()=>{Ua(Da())},[Da]);const ja=()=>{re.saveCardPolicyPopupSeen(d.tenantEmailDomain??"",!0),Ua(!1)},Ma=me==="Completed"&&!te.hasCreditCard&&!te.hasDebitCard;co({isDataReady:me==="Completed",pageContext:Ma?"cards_creation":"cards"});const{creditAccountRepayment:H}=o($=>ia($)),he=o($=>Qa($).firstViewAfterActivation),{areTenantIdsInSync:Le}=br(),Ve=Lt(S,ha),He=xa(E,ae,S,Oa,H),Ge=Ot(I,k,S,aa,te.debitCardSummary),$e=Je(E,I,k,ae),ta=te.creditAccount.balance.amount+te.creditAccount.hold.amount;if(r.useEffect(()=>{me==="Completed"&&(re.getPayNowInfoTooltip()==null||ta<W*te.creditAccount.limit.amount/100)&&i(!0)},[me,W,ta,te.creditAccount.limit.amount]),r.useEffect(()=>{if(e!=null&&e===!0&&H.initiatedRepayments.amount===0&&H.fetchState==="Completed"||oe==="In-Progress"&&ue.updateStatus==="Completed")i(!1),f(!0);else if(H.initiatedRepayments.amount>0&&H.fetchState==="Completed"){f(!1),document.body.style.overflow="auto";const $=ea(d.tenantEmailDomain);s($)}},[e,H.initiatedRepayments.amount,H.fetchState,oe,ue.updateStatus,s,d.tenantEmailDomain]),r.useEffect(()=>{!j&&(ae||k)&&Le&&(P(!0),t(sa(T,I&&k,E&&ae,!1)))},[j,T,t,Le]),r.useEffect(()=>{he&&m===!1&&(R(!0),setTimeout(()=>{t(Za())},5e3))},[he,m]),r.useEffect(()=>()=>{Et.flush()},[]),r.useEffect(()=>{me==="Completed"&&u&&te.cards.length===1&&(te.cards[0].status.code==="inactive"&&te.cards[0].type.code==="business_physical_credit_card"?s(`./${te.cards[0].id}/activate`):te.cards[0].status.code!=="request_on_hold"&&(a.state?.message==="comingFromCardDetail"?s("../../"):s(`./${te.cards[0].id}`)))},[me,u,a.state,s,te.cards]),r.useEffect(()=>{if(me==="Completed"&&u){const $=te.cards.length,Oe=te.cards.filter(Ke=>Ke.cardHolderUserId===D?.userId).filter(Ke=>Ke.status.code==="request_on_hold");Oe.length>0&&$===Oe.length&&s("./onboard")}},[me,te.cards,u,s,D?.userId]),r.useEffect(()=>{me!=="Completed"||E&&H.fetchState!=="Completed"||I&&k&&S&&aa.fetchState!=="Completed"||J.trackCardsCardListView(v,$e,Ve,He,Ge)},[me,Oa,H.fetchState,aa.fetchState,S]),D==null)throw Error("Can't access charge card list page without signing in...");const Hr=o($=>tr($.userState,$.userRoleState,$.userListViewState,"cardAdmin")),zt=wt(X?.loggedInUserRoleMap),Yt=$=>{p($)},Gr=te.creditAccount.limit,$r=()=>{f(!1),s("..")},zr=d.companyChargeCardInfo?.info!=null&&Ia({cardInfo:d.companyChargeCardInfo.info,isProductVisible:E,isTOSAccepted:be,isSetupEnabled:ae,isUserHasCardsAdminLevelAccess:S,isUserHasCardsAccess:zt}),Yr=d.companyDebitCardInfo?.info!=null&&Ia({cardInfo:d.companyDebitCardInfo.info,isProductVisible:I,isTOSAccepted:ge,isSetupEnabled:k,isUserHasCardsAdminLevelAccess:S,isUserHasCardsAccess:zt}),Zr=zr||Yr,Zt=function($){const{isEmptyCardsState:Oe,isChargeCardAdmin:Ke,isFileUploadEnabled:Wt}=$,qt=de(),Na=Ce(),{tenantEmailDomain:Va}=Me(),{isAiCfoOpen:Qr,setIsAiCfoOpen:Qt}=Cr(),Jr=pr(),Xr=hr(),Jt=o(Se=>On(Se)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:Xt,isResolved:en}=wr("cards_creation"),an=r.useMemo(()=>Pr(Xt,en,3),[Xt,en]),[Ha,Ct]=r.useState(""),tn=Xr&&Jr&&Va!=null&&!Qr,fa=r.useCallback(Se=>{if(Va==null)return;const es=ye(Na.state?.pathnameStackToGoBack,Na.pathname);qt(`/${Va}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:es,referrer:"cards_hero",aiCfoInitialQuestion:Se,aiCfoShouldSubmit:Se!=null&&Se.trim().length>0}})},[Na.pathname,Na.state,qt,Va]),nn=r.useCallback(Se=>{Se.trim().length!==0&&(Ct(""),fa(Se))},[fa]),rn=r.useCallback(()=>{const Se=Ha.trim();Se.length!==0&&(Ct(""),fa(Se))},[Ha,fa]),sn=r.useCallback(()=>{},[]),cn=r.useCallback(Se=>{Ct(Se)},[]),on=r.useCallback(()=>{Qt(!0)},[Qt]),dn=r.useCallback(()=>{fa(void 0)},[fa]);return r.useMemo(()=>{if(tn&&Oe&&Ke)return{aiAgentName:ii,headline:ci,subheadline:oi,promptChips:an,composer:{currentInput:Ha,isSubmitting:Jt,isFileUploadEnabled:Wt,onInputChange:cn,onSubmit:rn,onStopSubmit:sn},onPromptClick:nn,onOpenSidePanel:on,onOpenFullView:dn,dataTestIdPrefix:"cards-ai-cfo-hero"}},[Ha,tn,Ke,Oe,Wt,Jt,cn,dn,on,nn,sn,rn,an])}({isEmptyCardsState:Ma,isChargeCardAdmin:S,isFileUploadEnabled:O}),Kt=z&&Zt!=null?c.jsx(fr,{...Zt}):null,Kr=h&&Kt==null,Wr=Xe(d),qr={events:Ca(Wr,jr),eventCallback:($,Oe,Ke)=>{Ke.onEventReceived($)},onSubscribed:$=>{$.onPusherSubscribed()}};return ae||k?c.jsxs(c.Fragment,{children:[me==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(xt,{analytics:J,onLoad:()=>{J.trackPageLoaded(Sr.Event.cardsListPage),(E&&!ae||I&&!k)&&J.trackCardsPromoView(v,{isCreditCardOffered:E,isDebitCardOffered:I,isDebitCardEnabled:k,isCreditCardEnabled:ae},"Banner",I&&!k?"Debit Card":E&&!ae?"Credit Card":"","Card List")}}),c.jsx(rt,{showConfetti:he})]}):null,b===!0?c.jsx(Ht,{closeDrawerHandler:$r,isPaymentDrawerOpen:b,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:ta,productInformation:$e,creditAccountInformation:He,debitAccountInformation:Ge,cashbackInformation:Ve,isDebitCardInfoFetchStateCompleted:!(I&&k&&S)||aa.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||H.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!S||ha.fetchState==="Completed",paymentInitiatedDate:H.initiatedRepaymentDate}):null,c.jsxs(li,{children:[c.jsx(Ie,{isAppContentDrawerOpen:B,handleDrawerToggle:Yt}),c.jsx(ui,{...qr,isCashbackFeatureEnabled:y,isChargeCardFeatureEnabled:E,isDebitCardFeatureEnabled:I,isCreditCardProductVisibleForExpressInterest:V,updatePayNowInfoTooltip:i,showPayNowInfoTooltip:g,creditCardPayNowThreshold:W,signedInUser:D,chargeCardListState:te,location:a,admins:Hr.users,navigateAndClearBulkSelection:s,currentTenant:d,isCardControlsEnabled:ke,companyChargeCardInfoCreditAccountLimit:d.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:d.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:S,includeCreditAccountDebitSummaryAndCashbackInfo:T,onClickMenuIcon:()=>{Yt(!0)},creditLimit:Gr,isChargeCardSetupEnabled:ae,isDebitCardSetupEnabled:k,isEarlyPayEnabled:C,isChargeCardPaymentHistoryFeatureEnabled:N,cashbackRate:ee,controllerEmails:v,chargeCardCashbackDetailState:ha,depositAccountListWithDebitCardIssued:aa,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:ge,primaryFundingAccountDetails:ut,chargeCardSetUpViewFetchState:Aa.fetchState,productInformation:$e,creditAccountInformation:He,debitAccountInformation:Ge,cashbackInformation:Ve,isAiCfoAccessEnabled:Kr,onAskAiCfoClick:w,isCardsCommentingEnabled:G,cardsAiCfoHero:Kt,onClickPolicyIcon:S&&U?()=>n(hi(d.tenantEmailDomain)):void 0,isPolicyIntroTooltipVisible:mt,onPolicyIntroTooltipClose:ja,pendingCreationCount:Ye})]})]}):(be||ge)&&S===!0?c.jsx(Sa,{to:"../setup"}):Zr?c.jsx(Sa,{to:"../promo"}):c.jsx(va,{fetchState:me})}const mi=e=>`/${e}/cards/new`,Ci=e=>`/${e}/cards/payment`,pi=e=>`/${e}/cards/payment-history`,hi=e=>`/${e}/cards/policy`,Mr=[Br,Lr],fi=new Set(Mr),gi=De(function(e){const n=re.getSignedInUser(),t=fe(e),a=e.tenantState.currentTenantId,s=nr(e),b={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:a??""},f=t?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:s.fetchState,filters:s.filters,isZeniTenant:hc(t),repaymentList:s.repaymentHistory,searchText:s.searchText,repaymentHistoryUsers:s.repaymentHistoryUsers,sortConfig:{sortKey:s.uiState.sortKey,sortOrder:s.uiState.sortOrder},downloadParams:{authParams:b,companyName:f,spendManagementEndPoint:`${It}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,n){const{location:t,navigate:a}=n;return{onBackClick:()=>{const s=_e(t.state?.pathnameStackToGoBack),b=s.poppedPathname??"..";a(b,{state:{pathnameStackToGoBack:s.newStack}})},onColumnSortConfigChanged:(s,b)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:s,sortOrder:b}}})},onFiltersChange:s=>{e(gc({filters:s}))},onReloadPayments:()=>{e(Ga(!0))},onEventReceived:s=>{fi.has(s)&&e(Ga(!0))},onPusherSubscribed:()=>{e(Ga(!0))},onSearchTextChanged:s=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:s})},updateDownloadStateHandler:s=>{e(fc({uiState:{downloadState:s}}))}}})(ct(io));function bi(){const e=de(),n=Ce(),t=pe(),{areTenantIdsInSync:a}=br(),{useFeatureGate:s}=le();if(re.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const b=o(S=>fe(S)),f=o(S=>nr(S)),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[R,D]=r.useState(!1),[d,j]=r.useState(null),P=!b.userRole.includes("charge_card_user"),B=!!b.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=s(K.isChargeCardFeatureEnabled),{isFeatureEnabled:h}=s(K.isDebitCardFeatureEnabled),w=Te(h,b),u=Re({isDebitCardFeatureEnabled:h,isBankingOnlyTenant:w}),T=we(b),k=ve(b),M=b.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=xe({isCardsOnlyTenant:T,isChargeCardFeatureEnabled:p,isBookKeepingTenant:k,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:M}),y=!!b.companyChargeCardInfo?.info?.isChargeCardEnabled,L=Fe(),l=Pe(L?.loggedInUserRoleMap),C=o(S=>la(S,P,u&&B,A&&y)),N=r.useMemo(()=>{const S=C.cards.filter(F=>F.type.code.includes("debit"));return[...new Set(S.map(F=>F.connectedAccountId))]},[C.cards]),G=o(S=>da(S)),O=o(S=>nt(S,N)),{creditAccountRepayment:U}=o(S=>ia(S)),z=r.useMemo(()=>Lt(l,G),[l,G]),Y=r.useMemo(()=>xa(A,y,l,C.creditAccount,U),[A,y,l,C.creditAccount,U]),I=r.useMemo(()=>Ot(u,B,l,O,C.debitCardSummary),[u,B,l,O,C.debitCardSummary]),x=r.useMemo(()=>Je(A,u,B,y),[A,u,B,y]),Z=C.creditAccount.balance.amount+C.creditAccount.hold.amount,q=r.useMemo(()=>d!=null?f.repaymentHistory.find(S=>S.cardRepaymentId===d):void 0,[d,f.repaymentHistory]),E=r.useCallback(S=>{j(S),t(sa(P,u&&B,A&&y,!1)),D(!0)},[t,P,u,B,A,y]),V=r.useCallback(()=>{D(!1),j(null),document.body.style.overflow="auto"},[]);r.useEffect(()=>{g||f.fetchState==="Completed"||f.fetchState==="In-Progress"||(_(!0),t(Ga()))},[g,t,f.fetchState]),r.useEffect(()=>{!i&&(y||B)&&a&&(m(!0),t(sa(P,!1,A&&y,!1)))},[i,y,B,a,t,P,A]);const Q=Xe(b),X={events:Ca(Q,Mr),eventCallback:(S,F,v)=>{v.onEventReceived(S)},onSubscribed:S=>{S.onPusherSubscribed()}};return c.jsxs(c.Fragment,{children:[R?c.jsx(Ht,{closeDrawerHandler:V,isPaymentDrawerOpen:R,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:Z,productInformation:x,creditAccountInformation:Y,debitAccountInformation:I,cashbackInformation:z,isDebitCardInfoFetchStateCompleted:!(u&&B&&l)||O.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!A||U.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!l||G.fetchState==="Completed",paymentInitiatedDate:U.initiatedRepaymentDate,retryRepayment:q}):null,c.jsx(gi,{...X,location:n,navigate:e,accountInfoByAccountId:f.accountInfoByAccountId,onRetryPaymentClick:E})]})}const gn=Ne.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
height: 100vh;
|
|
28
|
-
width: 100%;
|
|
29
|
-
flex: 1 1 auto;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
overflow: auto;
|
|
32
|
-
align-items: center;
|
|
33
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
34
|
-
`,bn=ua.getLocalizedStrings().months;function Si(){const e=de(),n=pe(),t=Ce(),{creditAccount:a,creditAccountRepayment:s}=o(x=>ia(x)),b=`${gr.cardMicroServiceBaseUrl}/1.0/credit-accounts/${a.id}`,[f,g]=r.useState(!1),[_,i]=r.useState(!1),m=o(x=>bc(x)),{useFeatureGate:R}=le(),D=o(x=>fe(x)),{isFeatureEnabled:d}=R(K.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=R(K.isDebitCardFeatureEnabled),{isFeatureEnabled:P}=R(K.isCardsCommentingEnabled),B=Dr(P?D.companyId:void 0,{clearParams:P&&m.fetchState==="Completed"}),p=Te(j,D),h=Re({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),w=we(D),u=ve(D),T=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,k=xe({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:d,isBookKeepingTenant:u,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:T}),M=!!D.companyDebitCardInfo?.info?.isDebitCardEnabled,A=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,y=o(x=>ca(x,D.companyId)),L=oa(y.controllers),l=o(x=>rr(x)),C=l.cards.filter(x=>x.type.code.includes("debit")).map(x=>x.connectedAccountId),N=[...new Set(C)],G=o(x=>nt(x,N)),O=o(x=>Sc(x));r.useEffect(()=>{_||a.fetchState==="Completed"||a.fetchState==="In-Progress"||(g(!0),n(qe()))},[f,n,a.fetchState]),r.useEffect(()=>{_||a.fetchState!=="Completed"||a.id==null||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(i(!0),n(yc(a.id)))},[_,n,a.fetchState,a.id,m.fetchState]),r.useEffect(()=>{G.fetchState!=="Completed"&&G.fetchState!=="In-Progress"&&h&&M&&n(sr()),l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&n(je()),O.fetchState!=="Completed"&&O.fetchState!=="In-Progress"&&h&&M&&n(Ic()),s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&k&&A&&n(_t())},[G.fetchState,h,M,l.fetchState,O.fetchState,s.fetchState,k,A]),r.useEffect(()=>{if(m.fetchState==="Completed"&&a.fetchState==="Completed"&&s.fetchState==="Completed"&&l.fetchState==="Completed"&&(!h||!M||G.fetchState==="Completed"&&O.fetchState==="Completed")){let x="",Z="";if(m.statements.length>0){const Q=m.statements[m.statements.length-1].period,[X,S]=Q.split("-"),F=m.statements[0].period,[v,ee]=F.split("-");x=`${bn[parseInt(S)-1]} ${X}`,Z=`${bn[parseInt(ee)-1]} ${v}`}const q=Je(k,h,M,A),E=xa(k,A,!0,a,s),V=Ot(h,M,!0,G,O);J.trackCardsCreditCardStatementsView(L,q,{numberOfStatements:m.statements.length,oldestStatementMonthYear:x,latestStatementMonthYear:Z},E,V)}},[m.fetchState,a.fetchState,s.fetchState,G.fetchState,l.fetchState,O.fetchState]);const U=()=>{const x=_e(t.state?.pathnameStackToGoBack),Z=x.poppedPathname??"..";e(Z,{state:{pathnameStackToGoBack:x.newStack}})},z=o(x=>da(x)),Y=re.getSignedInUser(),I={userId:Y?.userId??"",sessionId:Y?.zeniSessionId??"",tenantId:D.tenantId??""};if(Y==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return c.jsx(gn,{children:c.jsx(lo,{onBackClick:U})});{const x=Je(k,h,M,A);return c.jsx(gn,{children:c.jsx(uo,{currentTenantCompanyName:D.companyName,statementListView:m,productInformation:x,onBackClick:U,authParams:I,controllerEmails:L,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:h,isDebitCardSetupEnabled:M,isChargeCardSetupEnabled:A,isCardsCommentingEnabled:P,initialOpenThreadRequest:B,chargeCardCashbackDetailState:z,creditAccount:a,creditAccountRepayment:s,depositAccountListWithDebitCardIssued:G,debitCardSummary:O,downloadEndPoint:b})})}}const Nr=[ma,dt],yi=new Set(Nr),Ii={containerWidth:new Fa(100,58)},ki=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),s=Ce(),{useDynamicConfig:b}=le(),[f,g]=r.useState(!1),[_,i]=r.useState(!1),[m,R]=r.useState(!1),[D,d]=r.useState(!1),j=r.useRef(!1),P=r.useRef(null);r.useEffect(()=>()=>{P.current!=null&&(clearTimeout(P.current),P.current=null)},[]);const[B,p]=r.useState(!1),[h,w]=r.useState(!1),u=re.getSignedInUser();if(u==null)throw Error("Can't access onboarding card page without signing in...");const T=o(V=>fe(V)),{configValue:k}=b(ze.zeniCardsConfig),M=o(V=>kc(V)),{tenantEmailDomain:A}=T,y=o(V=>V.settingsViewState.profile.fetchState),L=o(V=>V.chargeCardListState.fetchState),l=o(V=>V.settingsViewState.profile.userId),C=o(V=>V.chargeCardConfigState.fetchState);r.useEffect(()=>{f===!1&&y!=="In-Progress"&&y!=="Completed"&&(t(Ec()),g(!0)),_===!1&&C!=="In-Progress"&&C!=="Completed"&&(t(Ja()),i(!0)),m===!1&&L==="Not-Started"&&(R(!0),t(je()))},[f,m,L,_,C]),r.useEffect(()=>{y==="Completed"&&B===!1&&l!=null&&L==="Completed"&&M.cards.length>0&&(t(Ac({userId:l})),t(cr({cardId:M.cards[M.cards.length-1].id})),p(!0))},[y,B,l,L]),r.useEffect(()=>{if(!D&&M.fetchState==="Completed"&&M.cards.length===0){const V=_e(s.state?.pathnameStackToGoBack),Q=V.poppedPathname??ea(A);a(Q,{state:{pathnameStackToGoBack:V.newStack}})}},[M.fetchState,M.cards,D]);const N=o(V=>Qa(V)),G=ya(N.updateStatus.fetchState),O=N.currentDisplayedCardId,{useFeatureGate:U}=le(),{isFeatureEnabled:z}=U(K.isChargeCardFeatureEnabled),Y=!!T.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!T.userRole.includes("charge_card_user")&&z&&Y,x=o(V=>O!=null?or(V.chargeCardState,O):null),Z=()=>{O!=null&&(j.current=!0,P.current!=null&&clearTimeout(P.current),P.current=setTimeout(()=>{j.current=!1,P.current=null},5e3),t(ka(O,I,!0)),t(je(!0)),d(!0))},q=Xe(T);Ut({events:Ca(q,Nr),onSubscribed:()=>{t(je(!0))},onEvent:(V,Q)=>{if(!yi.has(V))return;const X=Gt(Q),S=j.current;if(V===ma){const v=ie(X?.card_id)??O;if(v!=null){const ee=$t(X,v);if(ee!=null)return t(Pt(ee)),void(v!==O||S||Z())}}if(V===dt)return void t(je(!0));const F=ie(X?.card_id)??O;(O==null||F===O)&&O!=null?S||Z():t(je(!0))}}),r.useEffect(()=>{if(D&&O!=null&&x!=null&&x.status.code!=="request_on_hold"){const V=Ae(T.tenantEmailDomain,O,u,x),Q=ye(s.state?.pathnameStackToGoBack,s.pathname);t(Dc()),x?.type.code==="business_virtual_credit_card"&&t(Xa()),a(V,{state:{pathnameStackToGoBack:Q},replace:!0}),j.current=!1,P.current!=null&&(clearTimeout(P.current),P.current=null)}},[D,x?.status.code]),r.useEffect(()=>{G==="In-Progress"&&N.updateStatus.fetchState==="Completed"&&setTimeout(Z,3e3)},[G,N.updateStatus.fetchState]);const E=V=>{w(V)};if(y!=="Completed"||M.cards.length===0)return c.jsxs(Sn,{children:[c.jsx(Ie,{isAppContentDrawerOpen:h,handleDrawerToggle:E}),c.jsx(mo,{})]});if(l==null)throw Error("Can't access my userId.");return c.jsxs(Sn,{children:[c.jsx(Ie,{isAppContentDrawerOpen:h,handleDrawerToggle:E}),c.jsx(Ei,{chargeCardListView:M,cardUserOnboardingView:N,navigate:a,currentTenant:T,myUserId:l,location:s,chargeCardCashbackRatePerTransaction:k.charge_card_cashback_rate_per_transaction!=null?k.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{E(!0)}}),e!=null?c.jsx(Ai,{windowSize:n,children:e}):null]})},Ei=De(function(e,{currentTenant:n,cardUserOnboardingView:t,chargeCardListView:a,myUserId:s}){const b=la(e,!1,!1,!1);let f=!1;return b.fetchState==="Completed"&&b.cards.length<=1&&(f=!0),{cards:a.cards,showMenuIcon:f,companyLegalName:n.companyName,twoFAView:t.twoFAView,cardUserOnboardingLocalData:t.cardUserOnboardingLocalData??{userId:s},isDOBDisabled:t.isDOBPresent,onboardingProgressStatus:t.onboardingProgressStatus}},function(e,n){const{navigate:t,cardUserOnboardingView:a,location:s,currentTenant:b}=n,{tenantEmailDomain:f}=b;return{updateCardUserOnboardingLocalData:g=>{e(mn({localData:g}))},onGetOtp:g=>{if(a.cardUserOnboardingLocalData!=null){const _={...a.cardUserOnboardingLocalData,phone:g};e(mn({localData:_}))}e(tt(g,"CardUserOnboarding"))},onResendOtp:g=>{e(at(g,"CardUserOnboarding"))},onVerifyOtp:(g,_)=>{e(et(g,_,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(_c()),g!=null&&re.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(cr({cardId:g}))},onBackClick:()=>{const g=_e(s.state?.pathnameStackToGoBack),_=g.poppedPathname??ea(f);t(_,{state:{pathnameStackToGoBack:g.newStack}})}}})(Co),Ai=Ne.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
width: ${e=>`${Ii.containerWidth.value(e.windowSize)}%`};
|
|
38
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
-
`,Sn=Ne.div`
|
|
40
|
-
display: flex;
|
|
41
|
-
min-height: 100%;
|
|
42
|
-
width: 100%;
|
|
43
|
-
flex: 1 1 auto;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
align-items: center;
|
|
46
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
47
|
-
`,Di={containerWidth:new Fa(100,58)},_i=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f,useFeatureGate:g}=le(),[_,i]=r.useState(!1),[m,R]=r.useState(!1),[D,d]=r.useState(!1),[j,P]=r.useState(!1),B=re.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const p=o(I=>fe(I));if(s==null)throw Error("Empty card id is not valid...");const{configValue:h}=f(ze.zeniCardsConfig),w=o(I=>Pc(I,s)),{isFeatureEnabled:u}=g(K.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=g(K.isDebitCardFeatureEnabled),k=Te(T,p),M=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:k}),A=we(p),y=ve(p),L=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,l=xe({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:u,isBookKeepingTenant:y,isDebitCardProductVisible:M,chargeCardsCreditAccountLimit:L}),C=w.chargeCard,N=o(I=>I.chargeCardConfigState.fetchState);r.useEffect(()=>{_===!1&&N!=="In-Progress"&&N!=="Completed"&&(t(Ja()),i(!0)),m===!1&&w.fetchState==="Not-Started"&&(R(!0),t(ka(s,!1,l)))},[m,w.fetchState,_,N]);const G=C?.type.code==="business_physical_debit_card"||C?.type.code==="business_virtual_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(D===!1&&(G===!1||G&&C.status?.code!=="active"||G&&C.status.code==="active"&&C.isPinSet||C.cardHolderUserId!==B.userId)){const I=Ae(p.tenantEmailDomain,s,B,C,!0),x=ye(b.state?.pathnameStackToGoBack,b.pathname);a(I,{state:{pathnameStackToGoBack:x}})}else if(D&&w.isRefreshingViewInBackground===!1&&C?.isPinSet===!0){t(wc({chargeCardId:s}));const I=Ae(p.tenantEmailDomain,s,B,C,!0),x=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(I,{state:{pathnameStackToGoBack:x}})}}},[w.fetchState,C?.type.code,D,w.isRefreshingViewInBackground]);const O=re.getZeniOtpTokenForCardHolder(s),U=o(I=>Nn(I.userState,B.userId)),z=()=>{C?.isPinSet!==!0&&t(ga(s,!0))};r.useEffect(()=>{w.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(z,3e3),d(!0))},[w.updateDebitCardPinAttemptFetchState.fetchState]);const Y=I=>{P(I)};if(N!=="Completed"||C==null)return c.jsx(va,{fetchState:"In-Progress"});if(U?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(vi,{children:[c.jsx(Ie,{isAppContentDrawerOpen:j,handleDrawerToggle:Y}),c.jsx(Pi,{cardId:s,card:C,phone:U.phone,signedInUser:B,isSandboxEnv:Ft(),debitCardDetailState:w,signedInUserToken:O,navigate:a,currentTenant:p,location:b,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?c.jsx(wi,{windowSize:n,children:e}):null]})},Pi=De(function(e,{debitCardDetailState:n,cardId:t}){const a=Vn(e,t),s=n.updateStatus,b=la(e,!1,!1,!1);let f=!1;return b.fetchState==="Completed"&&b.cards.length<=1&&(f=!0),{showMenuIcon:f,vgsVaultId:st.cardVaultId,twoFAView:a,setPinWaitStatus:s}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,debitCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdateDebitCardPinAttempt:i=>{e(Kn(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onSetPinSuccess:()=>{e(vc({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("activate")===!0?ea(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(po),wi=Ne.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
width: ${e=>`${Di.containerWidth.value(e.windowSize)}%`};
|
|
51
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
-
box-shadow: ${e=>`${Ka.sp0} 2px ${Ka.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
-
`,vi=Ne.div`
|
|
54
|
-
display: flex;
|
|
55
|
-
min-height: 100%;
|
|
56
|
-
width: 100%;
|
|
57
|
-
flex: 1 1 auto;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
align-items: center;
|
|
60
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
61
|
-
box-shadow: ${e=>`${Ka.sp0} 2px ${Ka.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
-
`,Ti={overlayWidth:new Fa(pt[12],pt[12],pt[9])},Fi=De(function(e,n){const t=vt(e,!1,!1),a=n.lineId,s=t.customAddress[a],b=t.customAddressStatus[a]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:n.googleAPIKey,customAddress:s,customAddressStatus:b,lineId:a}},function(e,n){const{newCustomAddressId:t,lineId:a,chargeCardTypeOption:s}=n;return{onSubmitHandler:b=>{t!=null&&e(ir(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`));const f=wo(b);e(Rc({addressType:`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`,addressToCreate:f})),e(xc(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},onDismissClick:()=>{n.onDismissClick(),t!=null&&e(Fc({addressId:t,cardLineId:a,cardType:s==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(ho),Ri=({lineId:e,closeDrawerHandler:n,chargeCardTypeOption:t})=>{const a=Rt(),s=Ta(),b=()=>{n()},f=o(g=>Tc(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return c.jsx(yr,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:Ti.overlayWidth.valuePercentage(s),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:(g,_)=>(_==="backdropClick"||_==="escapeKeyDown")&&b(),children:c.jsx(Fi,{googleAPIKey:st.googleMapsAPIKey,onDismissClick:b,lineId:e,chargeCardTypeOption:t,newCustomAddressId:f})})},xi=De(function(e,n){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:a,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:b,isChargeCardSetupEnabled:f,isDebitCardSetupEnabled:g}=n,_=vt(e,t&&f,a&&g);return{issueChargeCards:_,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:b,isDebitCardFeatureEnabled:a,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:f,isDebitCardSetupEnabled:g,cardHolderCandidates:_.userList.map(i=>i.user).filter(Boolean),allRoles:_.userList.map(i=>i.userRole),allAccountingClasses:_.allAccountingClasses,userList:_.userList}},function(e,n){return{onIssueCardClick:()=>{e(Oc())},onSaveChangesToLocalStore:t=>{e(Lc(t))},onDismissClick:()=>{e(dr()),n.navigate("../")},resetCustomAddressByLineID:(t,a)=>{e(ir(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:n.openAddAddressDrawerHandler}})(bo);function Bi(){const e=re.getSignedInUser(),n=de(),t=pe(),a=fo(),[s]=yn(),b=s.get("cardType"),{useFeatureGate:f}=le(),{isFeatureEnabled:g}=f(K.isIssuePhysicalCardEnabled),{isFeatureEnabled:_}=f(K.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:i}=f(K.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=f(K.isChargeCardFeatureEnabled),R=o(z=>fe(z)),D=Te(i,R),d=Re({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:D}),j=we(R),P=ve(R),B=R.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=xe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:m,isBookKeepingTenant:P,isDebitCardProductVisible:d,chargeCardsCreditAccountLimit:B}),[h,w]=r.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");r.useEffect(()=>{h||(w(!0),t(Bc(d&&T,p&&u,!1)))},[h,w,t]);const u=!!R.companyChargeCardInfo?.info?.isChargeCardEnabled,T=!!R.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(z=>vt(z,p&&u,d&&T)),M=k.fetchState,A=k.issueCardStatus.fetchState,y=k.lastSelfIssuedDebitCardId,L=o(z=>y!=null?or(z.chargeCardState,y):void 0),[l,C]=r.useState(null),[N,G]=r.useState(null),O=()=>{C(null)},U=(z,Y)=>{C(z),G(Y)};return r.useEffect(()=>{if(A==="Completed"){if(y!=null&&L?.type.code==="business_virtual_debit_card"){let z;z=L?.status.code==="request_on_hold"&&e.userId===L.cardHolderUserId?Ar(R.tenantEmailDomain):Ae(R.tenantEmailDomain,y,e,L),n(z)}else n("../");t(dr())}},[A,y]),M==="Completed"?c.jsxs(c.Fragment,{children:[l!==null&&N!==null?c.jsx(Ri,{closeDrawerHandler:O,lineId:l,chargeCardTypeOption:N}):null,c.jsx(xi,{themeState:a,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:_,isDebitCardFeatureEnabled:d,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:u,isDebitCardSetupEnabled:T,navigate:n,fetchState:k.fetchState,openAddAddressDrawerHandler:U,defaultCardType:b==="creditCard"||b==="debitCard"?b:void 0})]}):M==="Error"?c.jsx(ot,{}):c.jsx(go,{})}const Vr=[ma,dt],Li=new Set(Vr),Oi=Ne.div`
|
|
63
|
-
display: flex;
|
|
64
|
-
height: 100vh;
|
|
65
|
-
width: 100%;
|
|
66
|
-
flex: 1 1 auto;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
overflow: auto;
|
|
69
|
-
align-items: center;
|
|
70
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
71
|
-
`,Ui=De(function(e,n){const{myPendingActivationChargeCardListState:t}=n;return{myPendingActivationChargeCardListView:t,uiState:t.uiState,signedInUser:n.signedInUser}},function(e,n){const{navigate:t,currentTenant:a,location:s,signedInUser:b,myPendingActivationChargeCardListState:f}=n,{tenantEmailDomain:g}=a,{cards:_}=f;return{onChargeCardRowClick:i=>{const m=Er(_,i),R=Ae(g,i,b,m),D=ye(s.state?.pathnameStackToGoBack,s.pathname);t(R,{state:{pathnameStackToGoBack:D}})},onColumnSortConfigChanged:(i,m)=>{e(St({uiState:{sortKey:i,sortOrder:m}}))},onReloadCards:()=>{e(je())},onBackClick:()=>{const i=a.userRole.includes("charge_card_user");e(St({uiState:{sortKey:i?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(So);function ji(){const e=de(),n=pe(),t=Ce(),a=Rt(),[s,b]=r.useState(!1),f=o(U=>Uc(U)),g=o(U=>fe(U)),_=o(U=>ca(U,g.companyId)),i=oa(_.controllers),{useFeatureGate:m}=le(),{isFeatureEnabled:R}=m(K.isChargeCardFeatureEnabled),{isFeatureEnabled:D}=m(K.isDebitCardFeatureEnabled),d=Te(D,g),j=Re({isDebitCardFeatureEnabled:D,isBankingOnlyTenant:d}),P=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,B=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,p=Fe(),h=we(g),w=ve(g),u=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=xe({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:R,isBookKeepingTenant:w,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:u}),k=Pe(p?.loggedInUserRoleMap),M=o(U=>da(U)),{creditAccount:A,creditAccountRepayment:y}=o(U=>ia(U)),L=o(U=>rr(U)).cards.filter(U=>U.type.code.includes("debit")).map(U=>U.connectedAccountId),l=[...new Set(L)],C=o(U=>nt(U,l));r.useEffect(()=>{s||f.fetchState==="Completed"||f.fetchState==="In-Progress"||(b(!0),n(je()),n(Ja()))},[s,n,f.fetchState]),r.useEffect(()=>{if(f.fetchState==="Completed"&&f.cards.length===1&&N!=null){const U=Ae(g.tenantEmailDomain,f.cards[0].id,N,f.cards[0]);e(U,{state:{message:t.state?.message}})}},[f.fetchState,f.cards]);const N=re.getSignedInUser();r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&T&&B&&k&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&n(_t()),C.fetchState!=="Completed"&&C.fetchState!=="In-Progress"&&j&&P&&k&&n(sr())},[A.fetchState,y.fetchState,n,C.fetchState,j,P,k,T,B]);const G=Xe(g);if(Ut({events:Ca(G,Vr),onEvent:(U,z)=>{if(!Li.has(U))return;const Y=Gt(z);if(U===ma){const I=ie(Y?.card_id);if(I!=null){const x=$t(Y,I);if(x!=null)return void n(Pt(x))}}n(je(!0))},onSubscribed:()=>{n(je(!0))}}),N==null)throw Error("Can't access address page without signing in...");const O=f.cards!=null&&f.cards.length>0;if(f.fetchState==="Completed"||O){const U=Je(T,j,P,B);return c.jsx(Oi,{children:c.jsx(Ui,{navigate:e,currentTenant:g,signedInUser:N,productInformation:U,myPendingActivationChargeCardListState:f,isChargeCardFeatureEnabled:T,isDebitCardFeatureEnabled:j,isDebitCardSetupEnabled:P,isChargeCardSetupEnabled:B,chargeCardCashbackDetailState:M,creditAccount:A,creditAccountRepayment:y,depositAccountListWithDebitCardIssued:C,controllerEmails:i,location:t})})}return c.jsx(va,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}})}const Mi=De(function(e,n){const{companyId:t,companyLegalName:a}=n;return{chargeCardSetupView:wa(e,t),admins:n.adminList,companyLegalName:a,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,n){const{navigate:t,companyId:a,isCompanyBusinessVerificationAndPaymentSetUpDone:s,isDebitCardSetupEnabled:b,isChargeCardSetupEnabled:f,signedInUser:g,location:_,productInformation:i,isEarlyPayEnabled:m,controllerEmails:R,chargeCardsCreditAccountLimit:D}=n;return{onSetupButtonClick:d=>{if(g!=null&&J.trackCardsPromoPageClicked("enable cards"),s)switch(J.trackCardsEnableCardsClick(R,i,"Cards Promo"),d){case"credit":e(We(a,!0,"charge_cards",m,!1));break;case"debit":e(We(a,!0,"debit_cards",m,!1));break;case"debit_and_credit":e(D===0?We(a,!0,"debit_cards",m,!0):We(a,!0,"charge_cards__debit_cards",m,!1))}else switch(J.trackCardsSetupCardsClick(R,i,"Cards Promo"),d){case"credit":e(We(a,!1,"charge_cards",m,!1));break;case"debit":e(We(a,!1,"debit_cards",m,!1));break;case"debit_and_credit":e(D===0?We(a,!1,"debit_cards",m,!0):We(a,!1,"charge_cards__debit_cards",m,!1))}},onBackClick:()=>{const d=_e(_.state?.pathnameStackToGoBack);let j=d.poppedPathname;j==null&&(j=b||f?"..":"../.."),t(j,{state:{pathnameStackToGoBack:d.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{s?(e(Xa()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Nc(a))}}})(Io),Ni=()=>{const e=de(),{tenantEmailDomain:n}=Me(),[t]=yn(),a=t.get("cardPromoType"),s=pe(),{useDynamicConfig:b,useFeatureGate:f}=le(),[g,_]=r.useState(!1),{isFeatureEnabled:i}=f(K.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=f(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:R}=f(K.isChargeCardFeatureEnabled),{configValue:D}=b(ze.zeniCardsConfig),d=o(ne=>fe(ne)),j=o(ne=>ca(ne,d.companyId)),P=oa(j.controllers),B=D.charge_card_cashback_rate_per_transaction!=null?D.charge_card_cashback_rate_per_transaction:.0175,p=Ce(),h=re.getSignedInUserTenant(n)?.companyId??d.companyId,w=o(ne=>wa(ne,h)),u=w.primaryFundingAccount,T=d.companyBillPayInfo?.info,k=we(d),M=ve(d),A=Te(i,d),y=d.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Re({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:A}),l=xe({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:R,isBookKeepingTenant:M,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:y}),C=kr({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:R,isBookKeepingTenant:M}),N=L&&l===!1,G=T?.businessVerificationStatus?.code==="verified"&&(N||u?.accType==="depositAccount"||jc(u?.providerVerificationStatus?.code??"")),O=re.getSignedInUser(),U=!!d.companyZeniAccountInfo?.info?.isZeniAccountEnabled,z=!!d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Y=!!d.company?.companyChargeCardInfo.isChargeCardEnabled,I=!!d.company?.companyDebitCardInfo.isDebitCardEnabled,x=!!d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,Z=ne=>{_(ne)},q=o(ne=>ne.chargeCardSetupViewState.fetchState);if(O==null)throw Error("Can't access Charge Card promo page without signing in...");const E=Fe(),V=Pe(E?.loggedInUserRoleMap),Q=wt(E?.loggedInUserRoleMap),[X,S]=r.useState(!1),[F,v]=r.useState(!1),[ee,W]=r.useState(!1);r.useEffect(()=>{X===!1&&p.state?.message==="activation"&&S(!0)},[p.state]),r.useEffect(()=>{F||q!=="Not-Started"||h==null||(v(!0),s(Pa(h,!0)))},[F,q,h,s]);const ke=d.companyChargeCardInfo?.info!=null&&Ia({cardInfo:d.companyChargeCardInfo.info,isProductVisible:C,isTOSAccepted:z,isSetupEnabled:Y,isUserHasCardsAdminLevelAccess:V,isUserHasCardsAccess:Q}),be=d.companyDebitCardInfo?.info!=null&&Ia({cardInfo:d.companyDebitCardInfo.info,isProductVisible:L,isTOSAccepted:x,isSetupEnabled:I,isUserHasCardsAdminLevelAccess:V,isUserHasCardsAccess:Q}),ge=L&&be&&C&&y>=0&&ke?"debit_and_credit":L&&be?"debit":"credit",ae=Po(a,ge),ue=w?.chargeCardTermsDetails?.fetchStatus?.fetchState,oe=r.useRef(null);r.useEffect(()=>{ue==="In-Progress"?oe.current=ae:ue!=="Error"&&ue!=="Not-Started"||(oe.current=null)},[ue,ae]);const te=ue!=="In-Progress"&&ue!=="Completed"||oe.current==null?ae:oe.current;r.useEffect(()=>{ae==="credit"&&(Y||C===!1&&I)||ae==="debit"&&I||ae==="debit_and_credit"&&I&&Y?e("../"):(ae==="debit_and_credit"&&z===!0&&x===!0||ae==="credit"&&(z===!0||C===!1&&x===!0)||ae==="debit"&&x===!0)&&V===!0&&e("../setup")},[G,Y,I,ae,z,x]),r.useEffect(()=>{ee||(s(Mc("cardAdmin")),W(!0))},[ee]);const Ye=o(ne=>tr(ne.userState,ne.userRoleState,ne.userListViewState,"cardAdmin")),Ee=Je(C,L,I,Y);return(ke||be)&&q==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(xt,{analytics:J,onLoad:()=>{if(J.trackPageLoaded(Sr.Event.cardsPromoPage),!!C&&!Y||!!L&&!I||!!C&&!!L&&!I&&!Y){const ne=Vi({isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:Y,isCreditCardProductVisibleForExpressInterest:C,isDebitCardProductVisible:L});J.trackCardsPromoView(P,Ee,"Page",ne,"Promo Page")}}}),c.jsx(rt,{showConfetti:X}),c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),c.jsx(Mi,{signedInUser:O,location:p,showEnableCardButton:G,isCompanyBusinessVerificationAndPaymentSetUpDone:G,isChargeCardSetupEnabled:Y,isDebitCardSetupEnabled:I,companyLegalName:d.companyName,adminList:Ye.users,isCheckingEnabled:U,navigate:e,companyId:h,cardPromoType:te,controllerEmails:P,productInformation:Ee,isCreditCardProductVisible:l,isDebitCardFeatureEnabled:i,isEarlyPayEnabled:m,cashbackRate:B,chargeCardsCreditAccountLimit:y,onClickMenuIcon:()=>{Z(!0)}})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),c.jsx(yo,{})]})},Vi=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:n,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:a})=>t&&a&&!e&&!n?"Credit & Debit Card":t&&!n?"Credit Card":a&&!e?"Debit Card":"";function md(){const e=Ce(),n=o(E=>fe(E)),{useFeatureGate:t}=le(),{isFeatureEnabled:a}=t(K.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=t(K.isDebitCardFeatureEnabled),{isFeatureEnabled:b}=t(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:f}=t(K.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:g}=t(K.isCardPolicyEnabled),_=Te(s,n),i=Re({isDebitCardFeatureEnabled:s,isBankingOnlyTenant:_}),m=ko(n,a,s),R=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,D=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,d=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,j=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=Fe(),B=Pe(P?.loggedInUserRoleMap),p=wt(P?.loggedInUserRoleMap),{isFeatureEnabled:h}=t(K.isCashbackFeatureEnabled),w=n.userRole.includes("charge_card_user"),u=!w,T=!w&&d,k=n?.userRole!=null&&Vc(n?.userRole),M=(n?.company==null||n.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!k)&&Hc(P?.loggedInUserRoleMap),A=Gc(P?.loggedInUserRoleMap),y=(n?.company==null||n.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!k)&&$c(P?.loggedInUserRoleMap),{isFeatureEnabled:L}=t(K.isDepositAccountsFeatureEnabled),l=L&&!k&&Gn(P?.loggedInUserRoleMap),C=d&&!k,N=j&&!k,G=m&&!k&&Pe(P?.loggedInUserRoleMap),O=zc(P?.loggedInUserRoleMap),U=we(n),z=ve(n),Y=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=xe({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:a,isBookKeepingTenant:z,isDebitCardProductVisible:i,chargeCardsCreditAccountLimit:Y}),x=n.companyChargeCardInfo?.info!=null&&Ia({cardInfo:n.companyChargeCardInfo.info,isProductVisible:I,isTOSAccepted:R,isSetupEnabled:d,isUserHasCardsAdminLevelAccess:B,isUserHasCardsAccess:p}),Z=n.companyDebitCardInfo?.info!=null&&Ia({cardInfo:n.companyDebitCardInfo.info,isProductVisible:i,isTOSAccepted:D,isSetupEnabled:j,isUserHasCardsAdminLevelAccess:B,isUserHasCardsAccess:p}),q=x||Z;return c.jsxs(as,{children:[B?c.jsx(se,{path:"setup",element:c.jsx(Cn,{isBillPayAdminLevelAccess:M,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:l,isChargeCardAdminLevelAccess:G,isUserHasOnlyCardAccess:O,isUserHasOnlyBillPayAccess:A,productType:"charge_cards",type:"setup"})}):null,B?c.jsx(se,{path:"verification",element:c.jsx(Cn,{isBillPayAdminLevelAccess:M,isUserHasOnlyBillPayAccess:A,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:l,isChargeCardAdminLevelAccess:G,isUserHasOnlyCardAccess:O,productType:"charge_cards",type:"verification"})}):null,B&&g?c.jsxs(c.Fragment,{children:[c.jsx(se,{path:"policy",element:c.jsx(Vo,{})}),c.jsx(se,{path:"policy/new",element:c.jsx(Ro,{})}),c.jsx(se,{path:"policy/:templateId/edit",element:c.jsx(Oo,{})})]}):null,c.jsx(se,{path:"promo",element:c.jsx(Ni,{})}),C||N?c.jsxs(c.Fragment,{children:[c.jsx(se,{path:"/",element:c.jsx(fn,{isPaymentDrawerOpen:!1})}),G&&b?c.jsx(se,{path:"payment",element:c.jsx(fn,{isPaymentDrawerOpen:!0})}):null,c.jsx(se,{path:"activate",element:c.jsx(ji,{})}),c.jsx(se,{path:"onboard",element:c.jsx(ki,{})}),B?c.jsx(se,{path:"new",element:c.jsx(Bi,{})}):null,h&&u?c.jsx(se,{path:"cashback",element:c.jsx(Yo,{})}):null,T?c.jsx(se,{path:"statements",element:c.jsx(Si,{})}):null,G&&f&&d?c.jsx(se,{path:"payment-history",element:c.jsx(bi,{})}):null,c.jsx(se,{path:":cardId/activate",element:c.jsx(Wo,{})}),c.jsx(se,{path:":cardId/setPin",element:c.jsx(_i,{})}),c.jsx(se,{path:":cardId/addToWallet",element:c.jsx(Ho,{})}),c.jsx(se,{path:":cardId/*",element:c.jsx(si,{})}),c.jsx(se,{path:"*",element:c.jsx(ot,{})})]}):(R||D)&&B?c.jsx(se,{path:"*",element:c.jsx(Sa,{to:"../setup"})}):q?c.jsx(se,{path:"*",element:c.jsx(Sa,{to:"../promo",state:e.state})}):c.jsx(se,{path:"*",element:null})]})}export{md as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-GsPfxkQ7.js";import{a as g}from"./sentry-B2TzMFx9.js";import{h as w,u as x,g as T,i as k,j as S,n as E}from"./core-wjM80qIn.js";import{z as C,b9 as P,s as F,c as V,e as L,af as b,ba as j,at as A,au as U,n as B}from"./index-Det3Ki3b.js";import{eW as h,gh as M,tp as _,gc as z,c7 as R,OO as G,bn as Y,ry as H,rm as W,l0 as Z,mB as O,OP as $,bE as q,cz as N,mL as J,mO as K}from"./zeni-epic-state-DrcliB1J.js";import"./mui-BSDa87ap.js";import{d as Q}from"./routePaths-CbGdb8gZ.js";import{M as X}from"./MobileAppDrawer-D6Fu3M_x.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="230f0e1b-b0c5-42c3-92ba-f87dc0782174",t._sentryDebugIdIdentifier="sentry-dbid-230f0e1b-b0c5-42c3-92ba-f87dc0782174")}catch{}})();const ee=E(function(t){const a=z(t),i=C.getSignedInUser(),p=h(t),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(p?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:l,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:p,navigate:c,location:l}=a,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=Q(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:D}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?q(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]}};t(O({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(O({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(O({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(O({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(W(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(j);function de(){const t=w(),a=x(),i=T(),{tenantEmailDomain:p}=k(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),n=S(s=>s.companyViewState.passportView.fetchState),o=S(s=>s.companyConfigState.fetchState),r=S(s=>h(s)),d=r.companyId??C.getSignedInUserTenant(p)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(l(!0),a(M(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(L.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-GsPfxkQ7.js";import{a}from"./sentry-B2TzMFx9.js";import{u as D,g as v,j as c,N as w}from"./core-wjM80qIn.js";import{Lv as A,eW as L,fD as O,o5 as _,gq as E,fC as j,f9 as U,LC as F}from"./zeni-epic-state-DrcliB1J.js";import{u as $,z as m,L as g,D as k,o as H}from"./index-Det3Ki3b.js";import{n as z}from"./mui-BSDa87ap.js";import{t as R}from"./getLocaleForTenant-yX1iEbj2.js";import{g as P,Q as q}from"./QBOConnectionScreen-CL_uJ9x0.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./empty-CUF5cU17.js";import"./pdf-lib-BR9HrRu8.js";import"./index-D3VvkPFN.js";import"./url-CcjxrMLZ.js";import"./index-DypTJFR1.js";import"./decodeURIComponentSafe-4aj60Fs2.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]="851e4cbe-bb9d-4279-b313-c553cdbdea90",t._sentryDebugIdIdentifier="sentry-dbid-851e4cbe-bb9d-4279-b313-c553cdbdea90")}catch{}})();const G=z.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 ${H.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function pe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:h}=$(),p=a.useRef(!1),f=a.useRef(!1),{code:x,realmId:T,state:y}=P(i.search),N=x!==""&&T!==""&&y!=="",C=c(l=>A(l)),e=c(l=>L(l)),n=c(l=>l.tenantState.fetchState),r=c(l=>l.tenantState.activeTenantFetchState.fetchState),o=m.getSignedInUser(),u=m.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,b=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{p.current||o==null||u==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(O(o.userId,u))))},[p,n,d]),a.useEffect(()=>{e.tenantId==null&&!f.current&&o!=null&&(f.current=!0,!(u==null||u!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(_(o.userId)))},[f,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||b!=="Error"||(d(g.CONNECTION_AUTH),t(E(o.userId,e.tenantId)))},[b]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(j(e.tenantId)),m.saveActiveTenantDomainForUser(e.tenantEmailDomain),U(o?.userId,o?.zeniSessionId,e.tenantId),k.updateAppLocaleID(R(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(E(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{C.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&m.saveSignedInUserTenants(C.tenantsCoreDetailsInOrder)},[C.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||h()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?I.jsx(G,{children:I.jsx(q,{})}):I.jsx(w,{to:"/",replace:!0})}export{pe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-GsPfxkQ7.js";import{z as n}from"./index-Det3Ki3b.js";import{g as d}from"./QBOConnectionScreen-CL_uJ9x0.js";import"./sentry-B2TzMFx9.js";import{g as p,N as s}from"./core-wjM80qIn.js";import"./zeni-epic-state-DrcliB1J.js";import"./recharts-D4VpFd5q.js";import"./mui-BSDa87ap.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./empty-CUF5cU17.js";import"./pdf-lib-BR9HrRu8.js";import"./index-D3VvkPFN.js";import"./url-CcjxrMLZ.js";import"./index-DypTJFR1.js";import"./decodeURIComponentSafe-4aj60Fs2.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]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-GsPfxkQ7.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-wjM80qIn.js";import{Pv as k,PC as W,gf as K,ge as M,gd as q,jp as J,ME as L,rp as Q,eW as V,P1 as D,jn as F,Pw as v,PF as T,jl as j,jI as G}from"./zeni-epic-state-DrcliB1J.js";import{bw as X,K as N,N as R,z as U,m as O,p,f as S,B as Z,bx as Y,o as z,by as ee,n as te}from"./index-Det3Ki3b.js";import{n as H}from"./mui-BSDa87ap.js";import"./sentry-B2TzMFx9.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]="87831790-8cc2-4370-88ee-709f50b605b2",e._sentryDebugIdIdentifier="sentry-dbid-87831790-8cc2-4370-88ee-709f50b605b2")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,oe=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{e(j(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),c=s.poppedPathname??A();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(T({data:c}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??A(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),d=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>V(u)),g=O(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const A=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},$=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return $(e,"ach",t,n)}function Se(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
height: 100vh;
|
|
12
|
-
width: 100%;
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
box-shadow: ${e=>`0px 2px ${z.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
-
`,ce=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(G(r))},onSaveHandler:r=>{e(j(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(T({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??E();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??E(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=O(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-GsPfxkQ7.js";import{K as l,w as f,m as c}from"./index-Det3Ki3b.js";import{D as b}from"./mui-BSDa87ap.js";import"./sentry-B2TzMFx9.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]="ba208b59-59a4-42ab-af63-7317f2ecb232",e._sentryDebugIdIdentifier="sentry-dbid-ba208b59-59a4-42ab-af63-7317f2ecb232")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=l(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),i=c();return d.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{m as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-GsPfxkQ7.js";import{a as d}from"./sentry-B2TzMFx9.js";import{h as A,u as B,g as G,i as q,j as c,N as F,n as M,o as O,p as W}from"./core-wjM80qIn.js";import{NL as _,eW as J,N8 as R,ls as Y,JN as b,NQ as $,MD as z,ks as L,JO as S,Nd as Q,Ne as V,MF as H,ME as K}from"./zeni-epic-state-DrcliB1J.js";import{aS as U,c as X,p as Z,n as tt}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import{d as k}from"./decodeURIComponentSafe-4aj60Fs2.js";import{w as et}from"./withTransactionSidePanel-D8vEjelm.js";import{f as at,c as nt}from"./routePaths-CbGdb8gZ.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import"./TransactionDetailScreen-s_jEo2WG.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]="dbe00d54-c0f5-4caf-81be-e85101659d30",a._sentryDebugIdIdentifier="sentry-dbid-dbe00d54-c0f5-4caf-81be-e85101659d30")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:L(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(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(K("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Q()),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??I();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(b(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=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:N}=q(),r=k(x??""),p=k(N??""),f=rt(r,p),j=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=c(n=>J(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))},[m,f,i]);const E=c(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(b(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./sentry-B2TzMFx9.js";import{u as l,h as m,g as p}from"./core-wjM80qIn.js";import{hn as f,LT as g,LU as _}from"./zeni-epic-state-DrcliB1J.js";import{u as h,L as b,z as y}from"./index-Det3Ki3b.js";import"./liveblocks-GsPfxkQ7.js";import"./recharts-D4VpFd5q.js";import"./mui-BSDa87ap.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.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]="a304d923-9c07-41c3-9141-3e1adace9d0d",e._sentryDebugIdIdentifier="sentry-dbid-a304d923-9c07-41c3-9141-3e1adace9d0d")}catch{}})();function j(){const e=l(),n=m(),o=p(),{setLoading:i,clearAllLoading:u}=h(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(b.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(f(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}))}u();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-GsPfxkQ7.js";import{a as g}from"./sentry-B2TzMFx9.js";import{u as O,g as _,h as w,t as M,j as l,N as D}from"./core-wjM80qIn.js";import{z as r,m as P,D as V,d as A,c as N,e as W,U as H,M as J,g as R}from"./index-Det3Ki3b.js";import{eW as Y,Lx as $,LH as q,Ly as B,f9 as G,fC as K,LD as Q,gm as X,cY as Z,LI as ee,LJ as te}from"./zeni-epic-state-DrcliB1J.js";import{n as ne}from"./mui-BSDa87ap.js";import{u as ae}from"./useDeviceId-t80vtq4B.js";import{f as se}from"./analyticsHelper-DaDCazpC.js";import{t as ie}from"./getLocaleForTenant-yX1iEbj2.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="5ff71dba-744e-41a7-8ae1-4e7e9d928dca",t._sentryDebugIdIdentifier="sentry-dbid-5ff71dba-744e-41a7-8ae1-4e7e9d928dca")}catch{}})();const x=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function xe(){const t=O(),s=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:C,magicLinkEmail:c,verifyDeviceFetchState:T,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>Y(e)),y=l(e=>$(e)),E=r.getSignedInUser(),L=P().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(q(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&b!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(B(y.tenantsInOrder),a.zeniSessionId),G(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,L,void 0,y.tenantsInOrder),X().then(()=>{const e=R();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,b,a,o,y,L,s.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(H,{phoneNumber:C,verifyOtpFetchState:T.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(I==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(D,{to:e,state:{...s.state,origin:""}})}if(!x(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(J,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
z-index: 9999;
|
|
11
|
-
background-color: ${t=>t.theme.colors.background};
|
|
12
|
-
`;export{xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-GsPfxkQ7.js";import{h as r,n}from"./core-wjM80qIn.js";import{G as i}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import"./sentry-B2TzMFx9.js";import"./zeni-epic-state-DrcliB1J.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="b959eae6-68be-4f7c-be9c-c7323a968e13",o._sentryDebugIdIdentifier="sentry-dbid-b959eae6-68be-4f7c-be9c-c7323a968e13")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-GsPfxkQ7.js";import{a as r}from"./sentry-B2TzMFx9.js";import{u as T,g as A,j as o,N as j}from"./core-wjM80qIn.js";import{LW as C,eW as P,fm as x,LX as z,LY as D,LZ as M,L_ as R,o5 as k,KT as N}from"./zeni-epic-state-DrcliB1J.js";import{z as h,A as I}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="7852d07b-2c26-4711-8232-68714f01822b",n._sentryDebugIdIdentifier="sentry-dbid-7852d07b-2c26-4711-8232-68714f01822b")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),u=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),c=v??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&a!=null&&c!=null&&n(N(a.userId,a.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-GsPfxkQ7.js";import{h as z,u as J,g as Z,i as H,j as d,n as K,o as Q,p as I}from"./core-wjM80qIn.js";import{eW as M,s8 as P,rI as X,Mr as O,rD as S,bt as ee,bn as ae,bY as te,rE as se,Ms as oe,Me as C,dJ as re,vD as ne,Mt as ie,v_ as ce,fd as le,fb as de}from"./zeni-epic-state-DrcliB1J.js";import{z as fe,Y as me,_ as pe,j as ue,N as U,f as _,s as he,c as $,ao as ge,n as Fe}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import be from"./NotFoundScreen-_JeeXwwE.js";import{F as Ie}from"./FeaturePreviewScreen-CeZNu_Vi.js";import{a as g}from"./sentry-B2TzMFx9.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import{u as Se}from"./useInitialThreadRequest-D9NRPlO5.js";import{t as Te}from"./routePaths-CbGdb8gZ.js";import{M as ye}from"./MobileAppDrawer-D6Fu3M_x.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="adfa14d7-db9c-4fbf-ad33-4918d5d15366",s._sentryDebugIdIdentifier="sentry-dbid-adfa14d7-db9c-4fbf-ad33-4918d5d15366")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},De=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const f=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(f,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(ge);function v(){const s=z(),e=J(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[f,u]=g.useState(!1),h=fe.getSignedInUser(),y=d(t=>M(t)),w=y.company?.companyInfo.firstMonthOfFY??1,c=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),D=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),A=t=>D.pandLByForecastID[t]!=null&&se(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=me();pe({isDataReady:l});const{isAiCfoAccessEnabled:N,onAskAiCfoClick:Y}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!f){u(!0);const t=((m,L,R)=>L!=null?m.forecasts.findIndex(b=>b.id===L):R!=null?m.forecasts.findIndex(b=>b.id===R):m.forecasts.length>0?0:-1)(c,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(O(c.forecasts[t].id,t)),T(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!A(c.forecasts[t].id)&&F&&e(S(c.forecasts[t].id))}},[i,p,e,l,c,f,u,P,S,F]);const x=ue(),B=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:W}=U(),{isFeatureEnabled:j}=W(_.isReportsCommentingEnabled),q=Se(j?y?.companyId:void 0,{clearParams:l&&f}),[G,V]=g.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:$,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:E}),n.jsx(De,{firstMonthOfFY:w,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:A,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:N,onAskAiCfoClick:Y,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:q,onClickMenuIcon:()=>{E(!0)}})]})}function Ve(){const s=d(i=>M(i)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e(_.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-GsPfxkQ7.js";import E from"./NotFoundScreen-_JeeXwwE.js";import{a as r}from"./sentry-B2TzMFx9.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as F,p as h}from"./core-wjM80qIn.js";import{eW as O,Sy as b,bo as B,bn as N,i9 as V,hF as W}from"./zeni-epic-state-DrcliB1J.js";import{R as $,z as I,_ as q,cW as G}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import{M as J}from"./MobileAppDrawer-D6Fu3M_x.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.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]="6134bb63-18fd-4756-9084-9980a8aa014a",e._sentryDebugIdIdentifier="sentry-dbid-6134bb63-18fd-4756-9084-9980a8aa014a")}catch{}})();const K=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),L=()=>{const e=_(),t=v(),c=$(),o=p(a=>O(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:u}=M(),f=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[S,w]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(d),x=C||k||y,l=r.useCallback((a,i,T)=>{f(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f(W({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0},[n?.fetchState,l]),R=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{w(a)},{isAiCfoAccessEnabled:j,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:u,onReload:D,onTimeRangeSelect:R,handleDrawerToggle:g,isAiCfoAccessEnabled:j,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${u}/dashboard`,replace:!0})};function ge(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-GsPfxkQ7.js";import{a as o}from"./sentry-B2TzMFx9.js";import{j as f,h as V,u as _,g as H,n as W}from"./core-wjM80qIn.js";import{m as F,K as M,z as R,bb as N,w as U,Y as $,_ as z,s as Q,c as l,e as Y,a7 as K,bc as q}from"./index-Det3Ki3b.js";import{fh as G,eW as J,OQ as P,OR as X,vt as Z,vj as g,fj as ee,bS as ae,vo as re,OS as ne}from"./zeni-epic-state-DrcliB1J.js";import{D as te,e as se,n as oe,S as ie}from"./mui-BSDa87ap.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import{M as ce}from"./MobileAppDrawer-D6Fu3M_x.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]="5494c1f7-5225-4031-96e5-88a7b24320af",e._sentryDebugIdIdentifier="sentry-dbid-5494c1f7-5225-4031-96e5-88a7b24320af")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=F(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>G(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,I="refer-and-earn-status-update",we=W(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(K(q));function be({isReferralDrawerOpen:e}){const a=V(),r=_(),n=H(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,j]=o.useState(!1),[k,h]=o.useState(!1),w=R.getSignedInUser(),C=f(t=>J(t)),m=f(t=>P(t)),v=m.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),S=X([m,p]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(Z()),j(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&d&&(u(!0),r(g(!0)))},[v,r,d]),o.useEffect(()=>{!c&&p.fetchState==="Not-Started"&&d&&(x(!0),r(ee(!0)))},[p,r,d]),o.useEffect(()=>{h(e!=null&&e===!0)},[e]);const[E,A]=o.useState(!1),b=t=>{A(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:L}=le({mobileExploreReferrer:"Rewards"});z({isDataReady:S===!0});const T={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,y,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[S===!0?s.jsx(Q,{analytics:l,onLoad:t=>(y=>{w!=null&&y.trackPageLoaded(Y.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:E,handleDrawerToggle:b}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{h(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{b(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:L,...T})]})}export{be as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-GsPfxkQ7.js";import P from"./NotFoundScreen-_JeeXwwE.js";import{a as c}from"./sentry-B2TzMFx9.js";import{h as E,g as x,u as C,j as u,N as k,n as D,o as z,p as v}from"./core-wjM80qIn.js";import{eW as j,PK as S,P_ as b,Fh as V,En as T,Fg as d,F4 as U,Qf as B,F7 as K}from"./zeni-epic-state-DrcliB1J.js";import{m as N,z as O,B as W,a7 as $,bW as Q,af as _,bz as X,bX as q}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import{R as A}from"./ReimbursementApprovalRuleDetailScreen-DGivgXWQ.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]="db8d347a-403b-4eea-a732-95ae619d490c",e._sentryDebugIdIdentifier="sentry-dbid-db8d347a-403b-4eea-a732-95ae619d490c")}catch{}})();const w="reimbursement-approval-rule-update",G=D(function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:b(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:t,location:i}=r;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(B(!1))},onBackClick:()=>{_(i)?t("../../"):t("../../../reimbursements/setup")},onDeleteRuleClick:a=>{e(U(a,!1))},onEditRuleClick:a=>{a!=null?(e(d(a)),t(`./${a}/edit`)):(e(d()),t("./new"))}}})($(Q)),H=()=>{const e=E(),r=x(),t=C(),[i,a]=c.useState(!1),[o,h]=c.useState(!1),m=u(n=>n.remiSetupApproverViewState.fetchState),p=u(n=>j(n)),g=N(),l=u(n=>S(n)),f=u(n=>b(n).remiSetupApproverViewUpdateData);if(c.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(V())},[f]),c.useEffect(()=>{i||m!=="Not-Started"||(a(!0),t(T(!0,!1,!1,!1)))},[i,m,t]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");c.useEffect(()=>{l.allApprovalRules.length===0&&l.fetchState==="Completed"&&(o||(h(!0),t(d())),e("./new"))},[o,l,t]);const R={events:p.companyId!=null?[`private-encrypted-${p.companyId}.${w}`]:[],eventCallback:(n,F,y)=>{n.endsWith(w)&&y.onApprovalRulesEventReceived(n)}};return p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?s.jsx(k,{to:"../../promo"}):p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||l.fetchState!=="Completed"&&l.fetchState!=="Error"?s.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}}):s.jsx(G,{currentTenant:p,location:r,navigate:e,...R})},I="reimbursement-approval-rule-update",J=D(function(e){const r=S(e),t=b(e).remiSetupApproverViewUpdateData,i={};for(const o of Object.values(e.contactState.contactById))o?.id!=null&&(i[o.id]=o.fullName);const a={};for(const o of Object.values(e.classState.classesByKey))o?.classId!=null&&(a[o.classId]=o.className);return{approvalView:r,remiSetupApproverViewUpdateData:t,vendorNamesById:i,departmentNamesById:a}},function(e,r){const{navigate:t,location:i}=r;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(B(!1))},onBackClick:()=>{_(i)?t("../../"):t("../../../reimbursements/setup")},onDeleteRuleClick:a=>{e(U(a,!0))},onEditRuleClick:a=>{a!=null?(e(d(a)),t(`./${a}/edit`)):(e(d()),t("./new"))},onReorderRules:a=>{e(K(a,!0))}}})($(q)),L=()=>{const e=u(t=>j(t)),{isApprovalRulesV3Enabled:r}=X(e?.tenantId);return r?s.jsx(M,{}):s.jsx(H,{})},M=()=>{const e=E(),r=x(),t=C(),[i,a]=c.useState(!1),[o,h]=c.useState(!1),m=u(n=>n.remiSetupApproverViewState.fetchState),p=u(n=>j(n)),g=N(),l=u(n=>S(n)),f=u(n=>b(n).remiSetupApproverViewUpdateData);if(c.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(V())},[f]),c.useEffect(()=>{i||m!=="Not-Started"||(a(!0),t(T(!0,!1,!1,!0)))},[i,m,t]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");c.useEffect(()=>{l.allApprovalRules.length===0&&l.fetchState==="Completed"&&(o||(h(!0),t(d())),e("./new"))},[o,l,t]);const R={events:p.companyId!=null?[`private-encrypted-${p.companyId}.${I}`]:[],eventCallback:(n,F,y)=>{n.endsWith(I)&&y.onApprovalRulesEventReceived(n)}};return p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?s.jsx(k,{to:"../../promo"}):p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||l.fetchState!=="Completed"&&l.fetchState!=="Error"?s.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}}):s.jsx(J,{currentTenant:p,location:r,navigate:e,...R})};function oe(){return s.jsxs(z,{children:[s.jsx(v,{path:"/",element:s.jsx(L,{})}),s.jsx(v,{path:"/new",element:s.jsx(A,{})}),s.jsx(v,{path:"/:approvalRuleId/edit",element:s.jsx(A,{})}),s.jsx(v,{path:"*",element:s.jsx(P,{})})]})}export{oe as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-GsPfxkQ7.js";import{N as x,z as w,aN as y,s as I,c as p,e as F,d5 as P,f as T}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import m from"./NotFoundScreen-_JeeXwwE.js";import{a as u}from"./sentry-B2TzMFx9.js";import{u as L,j as b,h as V,g as A,n as R,o as U,p as f}from"./core-wjM80qIn.js";import{eW as z,Ta as C,Pp as Y,Tb as v,vt as G,fj as O,Tc as W,vr as q}from"./zeni-epic-state-DrcliB1J.js";import{R as j}from"./ReferralListScreen-Cb-o7kTE.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import"./MobileAppDrawer-D6Fu3M_x.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]="aa78870c-973b-463c-9f99-5223be648179",a._sentryDebugIdIdentifier="sentry-dbid-aa78870c-973b-463c-9f99-5223be648179")}catch{}})();const B=R(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(q())},onUpdateInviteFormLocalData:s=>{a(W({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),H=()=>{const a=L(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=x(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),N=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),D=Y(k);u.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(G()),s(!0))},[]),u.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(O(!0)))},[l.fetchState,a]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(B,{navigate:c,location:_,currentTenant:r,companyName:S,userName:N,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function fa(){const{useFeatureGate:a}=x(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(f,{path:"/",element:t?e.jsx(j,{}):e.jsx(m,{})}),e.jsx(f,{path:"how-it-works",element:t?e.jsx(j,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(f,{path:"refer/*",element:t?e.jsx(H,{}):e.jsx(m,{})}),e.jsx(f,{path:"*",element:e.jsx(m,{})})]})}export{fa as default};
|