@zeniai/web-app-ui 5.1.16-prod → 5.1.17-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-ONuQ3ZD_.js +1 -0
- package/dist/assets/{AddressScreen-kxW0VXwU.js → AddressScreen-yvk9EJD_.js} +2 -2
- package/dist/assets/AiCfoScreen-5Ur-xPG5.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-Q0bYZW0T.js → BillPayApprovalRoutes-CnFFutYF.js} +1 -1
- package/dist/assets/{BillPayRoutes-BtXh9WDW.js → BillPayRoutes-DGkvdCBY.js} +18 -18
- package/dist/assets/{BusinessVerificationPageScreen-DqVUAhbH.js → BusinessVerificationPageScreen-ClHuJd0T.js} +2 -2
- package/dist/assets/ChargeCardRoutes-CalH9RqY.js +71 -0
- package/dist/assets/{CompanyPassportScreen-BV2a_i6I.js → CompanyPassportScreen-DNqutLHm.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-avyUSYfj.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BHrgJ6kV.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-DNVpXl0F.js +23 -0
- package/dist/assets/{DashboardRoutes-uHr8Sl8R.js → DashboardRoutes-BMckHwEZ.js} +1 -1
- package/dist/assets/{DefaultTenantHome-DFimLn-s.js → DefaultTenantHome-_Ug_ps6P.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CbiDMLSl.js → DomesticWireDetailScreen-CrprHerA.js} +3 -3
- package/dist/assets/DrawerScreen-BEUSeYLQ.js +1 -0
- package/dist/assets/{EntityDetailRoutes-ChMyPkBw.js → EntityDetailRoutes-DKZrs3wB.js} +1 -1
- package/dist/assets/ExpenseAutomationRoutes-DTa_pNWl.js +25 -0
- package/dist/assets/FeaturePreviewScreen-B44hDNmq.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen--wKEcQu5.js +1 -0
- package/dist/assets/MagicLinkRoutes-SdZK3Mz9.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DDFnRNmQ.js +12 -0
- package/dist/assets/{MobileAppDrawer-COGIpIoc.js → MobileAppDrawer-Dv1dDEZl.js} +1 -1
- package/dist/assets/NotFoundScreen-CR8bA5co.js +1 -0
- package/dist/assets/{NotificationRoutes-CoI1I0UX.js → NotificationRoutes-DzkYX_vg.js} +1 -1
- package/dist/assets/OAuthConsentScreen-knq-X9AY.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-UEoSTLLp.js +1 -0
- package/dist/assets/PeopleRoutes-B6cGPNhT.js +22 -0
- package/dist/assets/PerformanceRoutes-D6-G4qB1.js +1 -0
- package/dist/assets/{Preview-CoTRJ68H.js → Preview-B5oHKMPo.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Bp_uUyx7.js → QBOConnectionScreen-DKFGeKHi.js} +1 -1
- package/dist/assets/ReferralListScreen-BAAuMlvK.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-CiI-Tidw.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CihX7RJp.js → ReimbursementApprovalRuleDetailScreen-DG5O6VhX.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-XYw6ylOw.js → ReimbursementRoutes-KrIm9xZq.js} +9 -9
- package/dist/assets/{ReportsRoutes-yASgFceO.js → ReportsRoutes-DcFDfTC4.js} +1 -1
- package/dist/assets/RewardsRoutes-B8ZdB3fo.js +1 -0
- package/dist/assets/{ScreenRoutes-T9RlS2PP.js → ScreenRoutes-Dwk26toI.js} +2 -2
- package/dist/assets/{SettingsRoutes-Dh-XsJNw.js → SettingsRoutes-Bi6d-ixQ.js} +8 -8
- package/dist/assets/{SetupPagesScreen-D5yVGK0c.js → SetupPagesScreen-DpHUpz4w.js} +5 -5
- package/dist/assets/SignInScreen-BbInnfqi.js +1 -0
- package/dist/assets/SignOutScreen-Dn-15Gx5.js +9 -0
- package/dist/assets/TaskListScreen-D15VKQty.js +9 -0
- package/dist/assets/TaskRoutes-uigLJDIH.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-CnoyseN8.js → TransactionDetailRoutes-DdG2Yk-4.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-CRrD1rrU.js → TransactionDetailScreen-oOeAZGGC.js} +2 -2
- package/dist/assets/{TransactionListRoutes-DMcMw7xZ.js → TransactionListRoutes-CznJ-_kx.js} +1 -1
- package/dist/assets/TreasuryRoutes-DyL2AmIl.js +37 -0
- package/dist/assets/{VendorsRoutes-BpeZSkrq.js → VendorsRoutes-D4arwcMq.js} +22 -22
- package/dist/assets/WiseConfirmationScreen-CACL2cjb.js +12 -0
- package/dist/assets/ZeniAccountRoutes-D54O3hSS.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-CWtWfkJV.js +9 -0
- package/dist/assets/{accountMappingHelper-BxXl62E-.js → accountMappingHelper-Q4AWrIJ8.js} +1 -1
- package/dist/assets/{analytics-DVcHd5D4.js → analytics-p-atCQap.js} +1 -1
- package/dist/assets/analyticsHelper-B0fBIGUf.js +1 -0
- package/dist/assets/{core-Cy60pewc.js → core-85-jQOHl.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CvAV2ZH_.js → decodeURIComponentSafe-DMY7naVP.js} +1 -1
- package/dist/assets/{dnd-B7KA0YNa.js → dnd-aCLmWYWF.js} +1 -1
- package/dist/assets/{empty-BinKjDMu.js → empty-B8YZlU8y.js} +1 -1
- package/dist/assets/{empty-C0r2LR8d.js → empty-BUCP1zlD.js} +1 -1
- package/dist/assets/{emptyVideoElement-C_Y4KTAc.js → emptyVideoElement-BzTeHcqi.js} +1 -1
- package/dist/assets/epic-BnLWYuZv.js +2 -0
- package/dist/assets/getLocaleForTenant-B58QgT81.js +1 -0
- package/dist/assets/{index-Lu-vRYTK.js → index--AtO8DLV.js} +1 -1
- package/dist/assets/{index-jjkr5xKv.js → index-BBYM723i.js} +2 -2
- package/dist/assets/{index-CyER2VFG.js → index-BjSilB1q.js} +1 -1
- package/dist/assets/{index-DXfCjMwK.js → index-Boh_iHRY.js} +11410 -11406
- package/dist/assets/{index-BAxidMKK.js → index-DCnezmp4.js} +1 -1
- package/dist/assets/{index-B9ZC8BBd.js → index-Dx_wxYK2.js} +1 -1
- package/dist/assets/{index-e5kQpVcT.js → index-RkQAxlvL.js} +1 -1
- package/dist/assets/{index-lS13JcL7.js → index-YSSSINh1.js} +1 -1
- package/dist/assets/{lexical-BTXEvig3.js → lexical-BiigqH5F.js} +1 -1
- package/dist/assets/{liveblocks-Cj_tHvtA.js → liveblocks-DPIuO3ZH.js} +1 -1
- package/dist/assets/{lottie-KAslBocY.js → lottie-Dyslb7Yt.js} +1 -1
- package/dist/assets/{mui-CRLIhCCm.js → mui-bZkpowbW.js} +1 -1
- package/dist/assets/{pathToGoBack-DM0_tn07.js → pathToGoBack-DrUZouuw.js} +1 -1
- package/dist/assets/{pdf-DKyxBlDM.js → pdf-DmPsD6fu.js} +4 -4
- package/dist/assets/{pdf-lib-CGSxq5us.js → pdf-lib-DVsRNJ0B.js} +1 -1
- package/dist/assets/{plaid-DkEItuLc.js → plaid-AGYiNbMg.js} +1 -1
- package/dist/assets/{pusher-DioeXKnY.js → pusher-BnGrHB5v.js} +1 -1
- package/dist/assets/{react-D7y_-2_F.js → react-B2QuP8nN.js} +1 -1
- package/dist/assets/{react-DlOJcc0C.js → react-Bq1_8StD.js} +1 -1
- package/dist/assets/{react-CFXHw0r2.js → react-BrihoTMQ.js} +1 -1
- package/dist/assets/{react-DBJb8vBz.js → react-CzhAGPyA.js} +1 -1
- package/dist/assets/{react-BKylHzuD.js → react-DBTwfklC.js} +1 -1
- package/dist/assets/{react-CsmCEt-f.js → react-DDzH1t0V.js} +1 -1
- package/dist/assets/{recharts-Btsi-yTh.js → recharts-DDB6XWY-.js} +1 -1
- package/dist/assets/{routePaths-BHuMCYZS.js → routePaths-JFefqAnf.js} +1 -1
- package/dist/assets/{sentry-pDh2qSl7.js → sentry-D2jFbVNj.js} +1 -1
- package/dist/assets/{url-DQEg-S7X.js → url-B4hbg5S-.js} +1 -1
- package/dist/assets/{url-8O3uL66H.js → url-C3RKXM3D.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BrY2cg9j.js → useAiCfoDashboardSuggestedQuestionsChips-6J2Wy56m.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CLSbJN2Y.js +1 -0
- package/dist/assets/{useDeviceId-BqeoLOMn.js → useDeviceId-CS-9EsMC.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Jto-q518.js → useInitialThreadRequest-08ACZstL.js} +1 -1
- package/dist/assets/{utils-BEyM61hw.js → utils-BK-h0w8q.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Pig-pzDa.js → withTransactionSidePanel-DW2zydUx.js} +3 -3
- package/dist/assets/{zeni-epic-state-CRkqEZ9n.js → zeni-epic-state-BMMVjv_C.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +5 -4
- package/dist/assets/AddressRoutes-DTTDbfyu.js +0 -1
- package/dist/assets/AiCfoScreen-BD9LuPbq.js +0 -22
- package/dist/assets/ChargeCardRoutes-CcR0Kg4Y.js +0 -71
- package/dist/assets/ConnectionAuthScreen-nS5UA39_.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BSR7thHq.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-zynbVbT1.js +0 -23
- package/dist/assets/DrawerScreen-B8qy6piZ.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Dbs8jAQC.js +0 -25
- package/dist/assets/FeaturePreviewScreen-zYylsmMO.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-URGZ5Ekz.js +0 -1
- package/dist/assets/MagicLinkRoutes-BbIaUZ6F.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CTSvCkzk.js +0 -12
- package/dist/assets/NotFoundScreen-VuNCYuY2.js +0 -1
- package/dist/assets/OAuthConsentScreen-Dj4ZZB6A.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DFoNlsD5.js +0 -1
- package/dist/assets/PeopleRoutes-DD4sacjZ.js +0 -22
- package/dist/assets/PerformanceRoutes-Cz6YUxSp.js +0 -1
- package/dist/assets/ReferralListScreen-ENnmEy2s.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-Cbx66GuE.js +0 -1
- package/dist/assets/RewardsRoutes-BZPv2dJJ.js +0 -1
- package/dist/assets/SignInScreen-CI-24AM2.js +0 -1
- package/dist/assets/SignOutScreen-BiH831Xb.js +0 -9
- package/dist/assets/TaskListScreen-Dx4MLZkj.js +0 -9
- package/dist/assets/TaskRoutes-m59AlWYW.js +0 -9
- package/dist/assets/TreasuryRoutes-swKkwa_X.js +0 -37
- package/dist/assets/WiseConfirmationScreen-ClPWF8w3.js +0 -12
- package/dist/assets/ZeniAccountRoutes-BwLuDOzt.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-BgjrMmvf.js +0 -9
- package/dist/assets/analyticsHelper-D8mqdnP1.js +0 -1
- package/dist/assets/epic-DLFk3lb5.js +0 -2
- package/dist/assets/getLocaleForTenant-RkomRM_7.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BZkbW7CL.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-Boh_iHRY.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-D2jFbVNj.js"><link rel="modulepreload" crossorigin href="/assets/core-85-jQOHl.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-BMMVjv_C.js"><link rel="modulepreload" crossorigin href="/assets/mui-bZkpowbW.js"><link rel="modulepreload" crossorigin href="/assets/analytics-p-atCQap.js"><link rel="modulepreload" crossorigin href="/assets/utils-BK-h0w8q.js"><link rel="stylesheet" crossorigin href="/assets/index-Bc34frN_.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/web-app-ui",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.17-dev",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/**/*"
|
|
6
6
|
],
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@sentry/core": "^9.42.1",
|
|
28
28
|
"@sentry/react": "^9.42.1",
|
|
29
29
|
"@stripe/stripe-js": "^4.4.0",
|
|
30
|
-
"@zeniai/client-analytics": "2.0.
|
|
31
|
-
"@zeniai/client-epic-state": "5.0.
|
|
32
|
-
"@zeniai/web-components": "4.1.
|
|
30
|
+
"@zeniai/client-analytics": "2.0.14",
|
|
31
|
+
"@zeniai/client-epic-state": "5.0.66",
|
|
32
|
+
"@zeniai/web-components": "4.1.28",
|
|
33
33
|
"color": "3.1.3",
|
|
34
34
|
"cross-fetch": "^4.0.0",
|
|
35
35
|
"crypto-js": "4.2.0",
|
|
@@ -160,6 +160,7 @@
|
|
|
160
160
|
"publish_mohali": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm lint && pnpm build_mohali && pnpm publish --tag mohali",
|
|
161
161
|
"publish_next": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm lint && pnpm build_next && pnpm publish --tag next",
|
|
162
162
|
"test": "pnpm vitest run",
|
|
163
|
+
"test:pusher": "pnpm vitest run src/screens/pusher/tests src/screens/chargeCard/tests src/screens/chargeCard/constants/tests",
|
|
163
164
|
"version": "pnpm format && git add -A src",
|
|
164
165
|
"postversion": "git push && git push --tags",
|
|
165
166
|
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-Cj_tHvtA.js";import{A as d}from"./AddressScreen-kxW0VXwU.js";import i from"./NotFoundScreen-VuNCYuY2.js";import"./sentry-pDh2qSl7.js";import{o as s,p as r}from"./core-Cy60pewc.js";import"./zeni-epic-state-CRkqEZ9n.js";import"./recharts-Btsi-yTh.js";import"./index-DXfCjMwK.js";import"./mui-CRLIhCCm.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-Cj_tHvtA.js";import{a as r}from"./sentry-pDh2qSl7.js";import{u as ge,h as Ce,g as Ie,j as J,i as be,n as ke}from"./core-Cy60pewc.js";import{U as xe,z as we,J as Pe,cP as Ee,cQ as Qe,b4 as Y,cR as Te,b3 as Z,j as D,x as L,c as I,cS as F,cT as ve,cU as ye,a1 as _e,e as Oe,a7 as Ae,cV as Ue,a2 as je,m as Le,b0 as Fe,cW as Re}from"./index-DXfCjMwK.js";import{fI as De,eO as ee,eP as Be,hH as Me,QN as Ve,eS as Ge,hR as Ne,hN as $e,eQ as R,ft as qe,fm as We,fq as X,fu as ze,fv as He,fw as Je,fx as Ye,fy as Xe}from"./zeni-epic-state-CRkqEZ9n.js";import{D as Ke,n as b,S as Ze,P as et}from"./mui-CRLIhCCm.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-BrY2cg9j.js";import{p as st}from"./pathToGoBack-DM0_tn07.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="798b1d0c-d6f0-4a7d-b945-671a630e258a",a._sentryDebugIdIdentifier="sentry-dbid-798b1d0c-d6f0-4a7d-b945-671a630e258a")}catch{}})();const te="chat-response-generated",ot=ke(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:Q}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",o.text,t,Re(Q,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Je(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Ye({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Xe({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(X(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(We());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=xe(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=J(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=be(),p=Pe(),o=_e(p),u=J(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:Q}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),T=Qe({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),x=l.state,w=x?.aiCfoInitialQuestion,B=!!x?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[Y]!==!0)return;h(!0);const g={...n};delete g[Y],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,v]=r.useState(null),[ne,y]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&w!=null&&w!==""){const n=l.state;v(w),y(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[w,B,l.state]);const le=r.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??x?.aiCfoRef,A=V.get("emailRefId")??x?.aiCfoEmailRefId,N=r.useRef(!1);r.useEffect(()=>{N.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),N.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(v(P),y(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:$}=Te(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:$.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[$]);r.useEffect(()=>{U!=="In-Progress"&&j&&s(Ne())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s($e(t,f.userId))},[q,W,t,f,s]);const H=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:H}),T.drawerElement,c.jsx(it,{children:c.jsx(K,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:H}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&T.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?T.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:Q,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ke,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(K,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ve,{open:S,onClose:()=>h(!1),children:c.jsx(ye,{children:Se})}):null]})},K=b(Ze)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,at=b.div`
|
|
6
|
-
height: 100vh;
|
|
7
|
-
width: 100%;
|
|
8
|
-
`,nt=b.div`
|
|
9
|
-
height: 100vh;
|
|
10
|
-
width: 100%;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
min-height: 0;
|
|
14
|
-
`,it=b.div`
|
|
15
|
-
flex: 1;
|
|
16
|
-
min-height: 0;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
`,rt=b(et)`
|
|
20
|
-
box-shadow: ${({theme:a})=>a.colors.elevation2};
|
|
21
|
-
color: ${({theme:a})=>a.colors.grey4};
|
|
22
|
-
`;export{Et as default};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-Cj_tHvtA.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as qt,p as ne}from"./core-Cy60pewc.js";import{eP as ce,bs as Ue,Pc as ka,eY as be,eZ as ye,e_ as Se,fT as $e,cs as ze,Pd as Ze,Pe as Ma,tt as ba,jO as ya,Pf as Sa,gT as oa,zZ as Je,z$ as Ga,A0 as $a,jE as mt,Pg as Ye,zN as Ct,Ph as Qt,Pi as Xt,zQ as Da,Pj as Jt,NC as _a,rF as pt,zW as za,h2 as en,Pk as ht,Pl as Ke,bq as an,Pm as tn,fE as Pa,fD as wa,Au as nn,fC as Ta,Ni as rn,Pn as ft,cl as gt,cM as sn,NB as da,B4 as on,Po as tt,AG as Fa,Pp as bt,B5 as cn,O1 as dn,B6 as ln,C0 as un,sP as mn,BW as Cn,Af as yt,A8 as pn,Pq as hn,fV as fn,Ao as St,As as It,fU as gn,Pr as bn,AS as At,Ps as yn,Pt as Sn,Pu as In,Aq as Et,Ab as kt,zT as Dt,Ak as _t,Ai as Pt,Am as An,z_ as nt,Pv as wt,Pw as va,AD as Ia,Kh as Tt,cN as Za,Px as En,Py as kn,Pz as Dn,PA as _n,AA as Va,AZ as Pn,AV as wn,Aw as Tn,AX as Fn,AN as vn,AP as xn,PB as Ft,B3 as vt,HG as Bn,PC as Ln,PD as Rn,PE as Un,PF as xt,PG as On,Bq as jn,AF as Bt,Az as ia,AE as Vn,PH as Nn,PI as Hn,zK as Mn,PJ as Lt,PK as Rt,PL as Gn,zM as $n,zL as rt,PM as zn,PN as Zn,PO as Yn,Kd as Kn,PP as Ya,PQ as Wn,wl as Ut,km as qn,gU as Qn,Bv as Xn,PR as Ot,PS as Jn,Bw as er,PT as ar,de as tr,tn as nr,Bl as rr,Bf as Re,bt as sr,bF as or,cx as ir,bG as cr,Jq as dr}from"./zeni-epic-state-CRkqEZ9n.js";import{z as J,k as je,v as se,I as Z,B as la,c2 as xa,cd as lr,j as ve,ce as ur,cf as mr,J as ua,aN as Fe,m as fe,bm as Ka,cg as Cr,A as ma,i as Ba,h as Wa,c as Q,D as qa,ch as pr,Y as jt,aq as Qa,by as Qe,ci as Na,cj as hr,x as Xa,a7 as fr,ck as gr,at as Vt,a2 as Ha,V as Nt,e as Ht,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,cq as Er,o as Aa,cr as kr,cs as Dr,ct as Ua,r as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,cy as vr,a9 as xr}from"./index-DXfCjMwK.js";import{n as _e,D as Mt,S as Br}from"./mui-CRLIhCCm.js";import{a as c}from"./sentry-pDh2qSl7.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ve,A as Lr,h as Ja,P as Rr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Zt,p as Or,S as st}from"./SetupPagesScreen-D5yVGK0c.js";import{u as Yt}from"./useInitialThreadRequest-Jto-q518.js";import La from"./NotFoundScreen-VuNCYuY2.js";import{M as Ge}from"./MobileAppDrawer-COGIpIoc.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-BZkbW7CL.js";import{v as ot}from"./utils-BEyM61hw.js";import{t as jr}from"./AddressScreen-kxW0VXwU.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./analyticsHelper-D8mqdnP1.js";import"./routePaths-BHuMCYZS.js";import"./BusinessVerificationPageScreen-DqVUAhbH.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]="e772e0c1-2fef-4a88-bbd9-01277f6ff494",e._sentryDebugIdIdentifier="sentry-dbid-e772e0c1-2fef-4a88-bbd9-01277f6ff494")}catch{}})();function Vr(){const e=le(),{cardId:t}=ca(),a=ue(),r=J.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Ue(C?.loggedInUserRoleMap),{useFeatureGate:g}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=g(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:O}=g(Z.isDebitCardFeatureEnabled),v=be(n),D=ye(n),p=Se(O,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,b=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),l=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:u}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y(X=>$e(X,n.companyId)),R=ze(F.controllers),{creditAccount:B,creditAccountRepayment:T}=y(X=>Ze(X)),N=y(X=>X.classListState.fetchState),d=!E&&l&&f,h=y(X=>Ma(X,t,d,l)),[P,w]=c.useState(!1),U=h.chargeCard,j=U?.cardCreatedByUser?.userId,$=y(X=>j!=null?ba(X.userRoleState,j):void 0),H=$?.accountingClassIDs[0],V=y(X=>H!=null?ya(X.classState,{classId:H,reportId:"class_list"}):void 0),A=U?.cardHolderUser?.userId,L=y(X=>A!=null?ba(X.userRoleState,A):void 0),W=L?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",q=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,Y,q]),c.useEffect(()=>{P||h.fetchState==="Completed"||h.fetchState==="In-Progress"||t==null||(w(!0),a(Je(t,d,!1)))},[P,h,t,a]),c.useEffect(()=>{if(h.fetchState==="Completed"&&(Y===!1||Y&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,U,i);e(X)}},[h.fetchState,i,Y]),c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a($a()),N!=="Completed"&&N!=="In-Progress"&&a(mt())},[B.fetchState,T.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",oe=Oe(l,b,_,f),ee=Ca(l,f,m,B,T),te=Gt(x,h);return h.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(lr,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:R,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:f,productInformation:oe,creditAccountInformation:ee,debitAccountInformation:te,chargeCardDetailView:h,creditAccount:B,classListFetchState:N,creditAccountRepayment:T,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:L?.userRoles,cardHolderDepartmentName:k?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(mr);function Hr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(Z.isCardsCommentingEnabled),[g,I]=c.useState(!1),o=y(S=>Ye(S)),i=Yt(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),f=S.poppedPathname??Mr(n.tenantEmailDomain);e(f,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{g||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(I(!0),t(Ct()))},[g,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(ur,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m}=se(),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),u=p.max_charge_card_activation_attempts_by_card_id,b=y(k=>Xt(k,n)),l=b.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:F}=se(),{isFeatureEnabled:R}=F(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=F(Z.isDebitCardFeatureEnabled),T=Se(B,D),N=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:T}),d=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,h=D.userRole.includes("charge_card_user"),P=be(D),w=ye(D),U=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),$=!h&&j&&d;c.useEffect(()=>{g===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),I(!0)),o===!1&&b.fetchState==="Not-Started"&&(i(!0),a(Je(n,$,j)))},[o,b.fetchState,g,_]);const H=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(E===!1&&(H===!1||H&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&b.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(Jt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[b.fetchState,l?.type.code,E,b.isRefreshingViewInBackground]);const V=J.getZeniOtpTokenForCardHolder(n),A=y(k=>pt(k.userState,v.userId)),L=()=>{l?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{b.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(L,3e3),S(!0))},[b.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const W=k=>{O(k)};if(_!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(A?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:A.phone,signedInUser:v,isSandboxEnv:Ka(),chargeCardDetailState:b,signedInUserToken:V,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:u[n]!=null?u[n]: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:()=>{W(!0)}}),e!=null?s.jsx(Zr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=en(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),g=t.updateStatus,I=Ke(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(an())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:g,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(nn(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(tn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Cr),Zr=_e.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: ${e=>`${Gr.containerWidth.value(e.windowSize)}%`};
|
|
5
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
-
`,Yr=_e.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
|
-
`,Ea=qa.getLocalizedStrings().dateFormat,Kr={overlayWidth:new ma(100,100,58)},Wr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:dn(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:ln(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:C,isCashbackInfoFetchStateCompleted:m,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:I,controllerEmails:o,paymentDetails:i,productInformation:E,cashbackInformation:S,paymentSourceInformation:f,creditAccountInformation:O,debitAccountInformation:v,paymentInitiatedDate:D,sourcePage:p}=t,{tenantEmailDomain:u}=r;return{onBackNavigation:()=>{if(m&&g&&I&&S!=null&&Q.trackCardsPayEarlyFormClick(o,E,S,"Back",i.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:i.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:i.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:i.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:i.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Ea.visual.MMMDCommaYYYYformat)},f,O,v),p==="cardPaymentHistory")t.closeDrawerHandler(!0),e(bt());else{const b=Ve(u);a(b)}},onUpdatePaymentAccountStatus:(b,l,_)=>{e(Cn(b,l,"bill_pay","bill_pay_detail",_))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:b=>{e(mn("external_account",b))},onEstablishConnectionClick:b=>{e(un(b,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${u}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{C?window.open(`/${u}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(pr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:C,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:I,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:i,isCashbackInfoFetchStateCompleted:E,paymentInitiatedDate:S,retryRepayment:f})=>{const O=le(),{useDynamicConfig:v}=se(),{configValue:D}=v(Fe.zeniAccountsConfig),p=rn(D),u=y(z=>ft(z)),{creditAccount:b}=y(z=>Ze(z)),l=y(z=>ce(z)),_=Wa(),F=ua(),R=ue(),B=J.getSignedInUser(),T=je(),[N,d]=c.useState(!1),[h,P]=c.useState(!1),{configValue:w}=v(Fe.zeniCardsConfig),U=w.credit_card_auto_pay_threshold_by_company_id?.[l.companyId]??w.default_credit_card_auto_pay_threshold??Lr,j=gt(T?.loggedInUserRoleMap),$=sn(T?.loggedInUserRoleMap),H=!!l.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=y(z=>da(z,l.companyId)),A=V.companyChargeCardInfo?.primaryFundingAccount,L=V.allFundingAccounts.find(z=>z.id===A?.accountId),W=y(z=>$e(z,l.companyId)),k=ze(W.controllers);c.useEffect(()=>{if(u.fetchState!=="Completed"&&u.fetchState!=="In-Progress"&&R(on()),u.fetchState==="Completed"&&!h){const z=l.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=u.transferFromAccounts.find(ee=>ee.id===z);let oe;if(C==="cardPaymentHistory"&&f){const ee=f.paymentAccountId!=null?u.transferFromAccounts.find(te=>te.id===f.paymentAccountId):void 0;oe={amount:f.amount,isAutoRepayment:l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ee??x}}else oe={amount:{amount:b.balance.amount+b.hold.amount,currencyCode:b.balance.currencyCode,currencySymbol:b.balance.currencySymbol},isAutoRepayment:l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};R(tt(oe)),P(!0)}},[u.fetchState,h,C,f,u.transferFromAccounts,l.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,l.companyChargeCardInfo?.info?.isAutoPayEnabled,b.balance.amount,b.balance.currencyCode,b.balance.currencySymbol,b.hold.amount,R]);const Y={isZeniCheckingEnabled:l.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:L?.accType==="depositAccount",creditCardPaymentSourceAccountName:L?.label,creditCardPaymentSourceAccountType:L?.accType,creditCardPaymentSourceLastFourDigits:L?.accountLast4,creditCardPaymentSourceBalance:L?.accountBalance?.available?.amount??0};if(c.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&R(Fa(l.companyId,!0))},[V.fetchState]),c.useEffect(()=>{u.updateStatus==="Completed"&&I!=null&&E&&i&&o&&Q.trackCardsPayEarlyPayNowClick(k,n,I,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:S?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:S?.format(Ea.visual.MMMDCommaYYYYformat)},Y,m,g)},[u.updateStatus,I,E,i,o,S]),c.useEffect(()=>{u.fetchState==="Completed"&&I!=null&&E&&i&&o&&!N&&e&&h&&I!=null&&(Q.trackCardsPayEarlyFormView(k,n,I,a,l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,b.balance.amount,Y,m,g),d(!0))},[u,E,i,o,N,e,h]),B==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),R(bt())};return s.jsx(s.Fragment,{children:s.jsx(Mt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Kr.overlayWidth.valuePercentage(F),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:_.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(qr,{onClick:z=>z.stopPropagation(),children:s.jsx(Wr,{closeDrawerHandler:t,navigate:O,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{E&&i&&o&&I!=null&&Q.trackCardsPayEarlyFormClick(k,n,I,"Pay Now",u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},Y,m,g),R(cn({companyId:l.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:z=>{R(tt(z))},currentTenant:l,hasZeniAccountsAdminAccess:j,isZeniAccountsUser:$,isZeniAccountSetupEnabled:H,productInformation:n,sourcePage:C,controllerEmails:k,autoPayThreshold:U,paymentSourceInformation:Y,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:I,isCashbackInfoFetchStateCompleted:E,isCreditCardInfoFetchStateCompleted:i,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:S,maxInsuredAmount:p.maxInsuredAmount})})})})},qr=_e(Br)`
|
|
15
|
-
display: flex;
|
|
16
|
-
min-height: 100%;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
`,Wt="charge-card-transaction-update",Oa=qa.getLocalizedStrings().dateFormat,Qr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:C}=t,m=J.getSignedInUser(),g=e.tenantState.currentTenantId,I={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},o=Ma(e,r,a,C),i=hn(e,r),E=fn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:i,vgsVaultId:Ba.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:I,isSnackbarOpen:E.isSnackbarOpen,cardsEndPoint:`${Vt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:C,cardProviderId:m,includeCreditAccountInfo:g,setIsPaymentOpen:I,controllerEmails:o,productInformation:i,cashbackInformation:E,primaryFundingAccountDetails:S,creditAccountInformation:f,debitAccountInformation:O,isChargeCardFeatureEnabled:v}=t,{tenantEmailDomain:D}=r;return{onEventReceived:p=>{p===Wt&&(e(za(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Je(a,g,v))},onFetchChargeCardTransactionList:(p,u)=>{e(nt(a,p,u))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{m!=null&&e(Ta(p,"ChargeCardHolder",a))},onResendOtp:p=>{m!=null&&e(wa(p,"ChargeCardHolder",a))},onVerifyOtp:(p,u)=>{m!=null&&e(Pa(p,u,"ChargeCardHolder",a))},onVerifyOtpSuccess:p=>{p!=null&&J.saveZeniOtpTokenForCardHolder(p,a)},onColorCodeChange:p=>{e(An(a,p))},onLockChargeCard:(p,u)=>{e(Pt(p,a,u))},onUnlockChargeCard:p=>{e(_t(p,a))},onCloseChargeCard:p=>{e(Dt(a,p))},onFetchChargeCardsRecurringExpenses:()=>{e(kt([a]))},updateChargeCardName:(p,u)=>{e(Et(p,a,u))},updateChargeCardTransactionAttachments:(p,u)=>{u!=null&&e(In({transactionId:p,data:u}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,u,b,l)=>{e(Sn({chargeCardId:u,transactionId:p,fetchState:b,error:l}))},updateChargeCardTransactionReceiptsShowTick:(p,u,b)=>{e(yn({chargeCardId:u,transactionId:p,shouldShowTick:b}))},onChargeCardRevokeInviteClick:()=>{e(At(a))},updateChargeCardTransactionIsViewReceiptClicked:(p,u,b)=>{e(bn({chargeCardId:u,transactionId:p,isViewReceiptClicked:b}))},onChargeCardTransactionRowClick:(p,u)=>{const b=fe(C.state?.pathnameStackToGoBack,C.pathname);n(`../../transaction/${p}/${u}`,{state:{pathnameStackToGoBack:b}})},onBackClick:()=>{const p=ve(C.state?.pathnameStackToGoBack),u=Ve(D);n(u,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(gn())},onUpdateDebitCardPinAttempt:p=>{e(It(a,p)),p==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,u)=>{p?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):u!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:u.message}]}))},updateSpendLimit(p,u,b,l){e(St(p,u,b.code,l))},shouldOpenCreditCardPaymentDrawer(p){p&&E!=null&&Q.trackCardsPayEarlyClick(o,i,E,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:S?.accType==="depositAccount",creditCardPaymentSourceAccountName:S?.label,creditCardPaymentSourceAccountType:S?.accType,creditCardPaymentSourceLastFourDigits:S?.accountLast4,creditCardPaymentSourceBalance:S?.accountBalance?.available?.amount??0},f,O),I(p)}}})(fr(gr));function Xr(){const e=le(),t=ue(),a=ge(),{cardId:r}=ca(),[n,C]=c.useState(!1),[m,g]=c.useState(!1),{useDynamicConfig:I}=se(),o=J.getSignedInUser(),i=y(M=>ce(M)),E=y(M=>ka(M).firstViewAfterActivation),S=y(M=>M.classListState.fetchState),{configValue:f}=I(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:O}=I(Fe.zeniCardsConfig),v=O.enable_card_controls_for_company_ids,D=O.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(v)&&v.includes(i.companyId),[p,u]=c.useState(!1),[b,l]=c.useState(!1),{useFeatureGate:_}=se(),{isFeatureEnabled:F}=_(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:R}=_(Z.isDebitCardFeatureEnabled),B=Se(R,i),T=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:B}),{isFeatureEnabled:N}=_(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=_(Z.isCardsCommentingEnabled),h=ye(i),P=be(i),w=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:F,isBookKeepingTenant:h,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:w}),j=!!i.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!i.companyChargeCardInfo?.info?.isChargeCardEnabled,H=!i.userRole.includes("charge_card_user")&&U&&$;if(r==null)throw Error("Empty card id is not valid...");const V=y(M=>da(M,i.companyId)),{creditAccount:A,creditAccountRepayment:L}=y(M=>Ze(M)),W=J.getZeniOtpTokenForCardHolder(r),k=y(M=>Ma(M,r,H,U)),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:q}=Kt({mobileExploreReferrer:"Card Detail"});jt({isDataReady:k.fetchState==="Completed"});const z=y(M=>Ye(M)),x=k.chargeCard,oe=je(),ee=Ue(oe?.loggedInUserRoleMap),te=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",X=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=Ca(U,$,ee,A,L),K=Gt(te,k),he=Ja(ee,z),ke=Oe(U,T,j,$),Be=k.depositAccountLimitFetchState.fetchState!=="Completed"&&k.depositAccountLimitFetchState.fetchState!=="In-Progress",Pe=y(M=>$e(M,i.companyId)),we=ze(Pe.controllers),ae=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ae?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ae?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>ie?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=i?.userRole,Le=y(M=>Ke(M,!1,T,F).revokeCardInvite),aa=Qa(Le.saveStatus.fetchState);if(c.useEffect(()=>{if(aa==="In-Progress"&&Le.saveStatus.fetchState==="Completed"){const M=Ve(i.tenantEmailDomain);e(M)}},[aa,Le.saveStatus.fetchState,e,i.tenantEmailDomain]),c.useEffect(()=>{E&&n===!1&&re&&(C(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[E,n,re,Ee]),c.useEffect(()=>{p||k.fetchState==="Completed"||k.fetchState==="In-Progress"||r==null||(u(!0),t(Je(r,H,U,!1)))},[p,k,r,t]),c.useEffect(()=>{!b&&k.fetchState==="Completed"&&k.chargeCard?.connectedAccountId!=null&&te&&Be&&ee&&(l(!0),t(yt({depositAccountId:k.chargeCard?.connectedAccountId})))},[b,k,t,Be,ee]),c.useEffect(()=>{z.fetchState!=="Completed"&&z.fetchState!=="In-Progress"&&ee&&t(Ct()),S!=="Completed"&&S!=="In-Progress"&&t(mt()),k.transactionStatistics.fetchState!=="Completed"&&k.transactionStatistics.fetchState!=="In-Progress"&&t(pn({chargeCardId:r})),V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&t(Fa(i.companyId,!0))},[z.fetchState,t,ee,S,k.transactionStatistics.fetchState,V.fetchState]),c.useEffect(()=>{if(!(k.fetchState!=="Completed"||U&&A.fetchState!=="Completed"||x==null||k.transactionStatistics.fetchState!=="Completed"||te&&ee&&k.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;Q.trackCardsCardDetailView(we,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Qe(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Qe(x.balance.amount),cardAvailableLimit:Qe(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Qe(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:k.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:k.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:k.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:k.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:k.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:k.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Na(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ae?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Na(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,K)}},[k.fetchState,k.depositAccountLimitFetchState.fetchState,k.transactionStatistics.fetchState,A.fetchState,ee]),o==null)throw Error("Can't access card detail page without signing in...");const We=i.companyId??J.getSignedInUserTenant(i.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-encrypted-${We}.${Wt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ne,frequency:qe,cardColor:G}=ja(x),De=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageViewed(r,M,me,Te,Ne,qe,G,De)}};c.useEffect(()=>{if(k.fetchState==="Completed"){const M=k.chargeCard;if(M?.status.code==="inactive"||te&&M?.isPinSet===!1||X&&E){const me=Ce(i.tenantEmailDomain,r,o,x,E);e(me)}}},[k.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ne,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageClicked(r,Te,Ne,qe,G,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ne,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsVerifyPopUpClick(r,Te,Ne,qe,G,De,M,He,me)}},Ra=A.balance.amount+A.hold.amount,ha=i.companyChargeCardInfo?.info?.primaryFundingAccount,fa=V.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||k.fetchState==="Error"?s.jsx(La,{}):k.fetchState==="In-Progress"||k.fetchState==="Not-Started"||Le.saveStatus.fetchState==="In-Progress"||te&&ee&&k.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(hr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:E}),k.fetchState==="Completed"?s.jsx(Xa,{analytics:Q,onLoad:na}):null,m===!0?s.jsx(at,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:m,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:K,cashbackInformation:he,creditAccountSpentAmount:Ra,isDebitCardInfoFetchStateCompleted:!te||!ee||k.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!U||A.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ee||z.fetchState==="Completed",paymentInitiatedDate:L.initiatedRepaymentDate}):null,s.jsx(Qr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ae?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:U,isDebitCardFeatureEnabled:T,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:$,isCardControlsEnabled:D,isEarlyPayEnabled:N,controllerEmails:we,chargeCardCashbackDetailState:z,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:K,cashbackInformation:he,classListFetchState:S,primaryFundingAccountDetails:fa,currentTenant:i,cardProviderId:k.chargeCard?.cardProviderID,cardId:r,creditAccount:A,creditAccountRepayment:L,includeCreditAccountInfo:H,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:f.documentAiReceiptMaxSizeLimitBytes!=null?f.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:Y,onAskAiCfoClick:q,isCardsCommentingEnabled:d})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,C=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:C,limit:n}},Jr=_e.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
|
-
`,es=pe(function(e,t){const a=Ke(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:En(e),bulkActionView:kn(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:C,chargeCardListState:m,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:I,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:i,isDebitCardFeatureEnabled:E,isDebitCardSetupEnabled:S,isDebitCardTOSAccepted:f,isChargeCardTOSAccepted:O,controllerEmails:v,depositAccountListWithDebitCardIssued:D,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:u,productInformation:b,cashbackInformation:l,creditAccountInformation:_,debitAccountInformation:F,updatePayNowInfoTooltip:R,isUserHasCardsAdminLevelAccess:B}=t,{tenantEmailDomain:T}=r,{cards:N}=m;return{onChargeCardRowClick:(d,h)=>{const P=zt(N,d);let w;P!=null&&((j=>{const $=j.limit.amount-j.available.amount,H=`${j.cardHolderUser?.firstName.toLowerCase()} ${j.cardHolderUser?.lastName.toLowerCase()}`,V=j.cardName,A=j.department?.className??"",L=j.limit.amount,W=j.creditLimitFrequency.name;Q.trackCardsListRowClicked(H,V,A,$,L,W,C.userId===j.cardHolderUserId)})(P),Me(E,S,D)&&Q.trackCardsCardListRowClick(v,b,"Card Row Item","row_clicked",h+1,{cardOwner:Na(P.cardHolderUser,!1),cardName:P.cardName,cardType:P.type.code.includes("credit")?"credit":"debit",cardStatus:P.status.code,cardUtilizationAmount:Qe(P.limit.amount-P.available.amount),cardUtilizationPercent:P.limit.amount>0?Math.round((P.limit.amount-P.available.amount)/P.limit.amount*100):0,cardLimit:Qe(P.limit.amount)},l,_,F)),w=P?.status.code==="request_on_hold"&&C.userId===P.cardHolderUserId?Zt(T):Ce(T,d,C,P);const U=fe(n.state?.pathnameStackToGoBack,n.pathname);a(w,{state:{pathnameStackToGoBack:U}})},onFetchChargeCardsRecurringExpenses:d=>{e(kt(d))},onFetchDepositAccountLimit:d=>{e(yt({depositAccountId:d}))},onChargeCardResendInviteClick:d=>{e(xn(d))},onChargeCardRevokeInviteClick:d=>{e(At(d))},onLockChargeCardList:(d,h)=>{e(vn(d,h))},onUnlockChargeCardList:d=>{e(Fn(d))},onCloseChargeCardList:(d,h)=>{e(Tn(d,h))},onRevokeChargeCardList:d=>{e(wn(d))},updateChargeCardListSpendLimit(d,h,P){e(Pn(d,h,P.code))},onLockChargeCard:(d,h)=>{e(Pt(B,d,h))},onUnlockChargeCard:d=>{e(_t(B,d))},onCloseChargeCard:(d,h)=>{e(Dt(d,h))},onUpdateSpendLimit(d,h,P,w){e(St(d,h,P.code,w))},updateChargeCardName:(d,h)=>{e(Et(B,d,h))},onClickSetupIcon:()=>{Q.trackCardsListPageClicked("settings"),Me(E,S,D)&&l!=null&&Q.trackCardsSettingsClick(v,b,l,_,F);const d=Ur(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},onIssueCardClick:()=>{Q.trackCardsListPageClicked("new card"),Me(E,S,D)&&l!=null&&Q.trackCardsNewCardClick(v,b,l,"New Button","card_creation_initiated","Card List",_,F);const d=as(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},onColumnSortConfigChanged:(d,h)=>{Me(E,S,D)&&l!=null&&Q.trackCardsCardListSortClick(v,b,l,"Sort Icon","sort",d,h==="ascending"?"ASC":"DESC","Cards List",_,F),e(Va({uiState:{sortKey:d,sortOrder:h}}))},onSearchTextChanged:d=>{e(_n(d))},onReloadCards:()=>{e(Ia(g,E&&S,I&&i,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(E,S,D)&&l!=null&&Q.trackCardsCashbackOverviewClick(v,b,l,"Cashback Overview","cashback_details_viewed",_,F),a("./cashback")},onClickStatementsIcon:()=>{Me(E,S,D)&&l!=null&&Q.trackCardsStatementsClick(v,b,l,_,F),a("./statements")},onCreateNowClick:d=>{Me(E,S,D)&&l!=null&&Q.trackCardsNewCardClick(v,b,l,"Promo Banner","card_creation_initiated","Card List",_,F),a(`./new?cardType=${d}`)},onPromoCardClick:d=>{a(d==="debit"&&E&&!f||d==="credit"&&o&&!O?`../promo?cardPromoType=${d}`:"./setup")},navigateToCreditCardPaymentPage:(d,h)=>{u==="Completed"&&r.company!=null&&l!=null&&Q.trackCardsPayEarlyClick(v,b,l,"Card List",d,h,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},_,F);const P=ts(T);a(P)},navigateToCreditCardPaymentHistoryPage:()=>{const d=ns(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},shouldShowPayNowInfoTooltip:R,onSetRowActionCardId:d=>{e(Dn(d))},onSetBulkActionCardIds:d=>{e(wt(d))}}})(br);function it({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=ge(),n=c.useCallback((G,De)=>{a(wt([])),t(G,De)},[a,t]),[C,m]=c.useState(!1),[g,I]=c.useState(J.getPayNowInfoTooltip()??!1),o=G=>{J.savePayNowInfoTooltip(G),I(G)},[i,E]=c.useState(!1),S=J.getSignedInUser(),f=y(G=>ce(G)),[O,v]=c.useState(!1),[D,p]=c.useState(!1),{isAiCfoAccessEnabled:u,onAskAiCfoClick:b}=Kt({mobileExploreReferrer:"Cards"}),l=f.userRole.includes("charge_card_user"),_=!l,F=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:R,useDynamicConfig:B}=se(),{isFeatureEnabled:T}=R(Z.isCashbackFeatureEnabled),{isFeatureEnabled:N}=R(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:d}=R(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:h}=R(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:P}=R(Z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:w}=R(Z.isCardsCommentingEnabled),U=Se(d,f),j=Ie({isDebitCardFeatureEnabled:d,isBankingOnlyTenant:U}),$=be(f),H=ye(f),V=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=Ae({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:N,isBookKeepingTenant:H,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:V}),L=$t({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:N,isBookKeepingTenant:H}),{configValue:W}=B(Fe.zeniCardsConfig),k=je(),Y=Ue(k?.loggedInUserRoleMap),q=y(G=>$e(G,f.companyId)),z=ze(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,oe=W.credit_card_pay_now_threshold_by_company_id?.[f.companyId]??W.default_credit_card_pay_now_threshold??Rr,ee=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(f.companyId),te=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,X=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(G=>ft(G)),xe=Qa(Ee.updateStatus),K=y(G=>Ke(G,_,j&&F,A&&re)),he=K.cards.filter(G=>G.type.code.includes("debit")).map(G=>G.connectedAccountId),ke=[...new Set(he)],Be=y(G=>Ye(G)),Pe=y(G=>va(G,ke)),we=y(G=>da(G,f.companyId)),ae=we.companyChargeCardInfo?.primaryFundingAccount,pa=we.allFundingAccounts.find(G=>G.id===ae?.accountId),ie=K.fetchState,ea=K.creditAccount;jt({isDataReady:ie==="Completed"});const{creditAccountRepayment:de}=y(G=>Ze(G)),Le=y(G=>ka(G).firstViewAfterActivation),{areTenantIdsInSync:aa}=Nt(),We=Ja(Y,Be),ta=Ca(A,re,Y,ea,de),na=et(j,F,Y,Pe,K.debitCardSummary),ra=Oe(A,j,F,re),sa=K.creditAccount.balance.amount+K.creditAccount.hold.amount;if(c.useEffect(()=>{ie==="Completed"&&(J.getPayNowInfoTooltip()==null||sa<oe*K.creditAccount.limit.amount/100)&&o(!0)},[ie,oe,sa,K.creditAccount.limit.amount]),c.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),m(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){m(!1),document.body.style.overflow="auto";const G=Ve(f.tenantEmailDomain);n(G)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,f.tenantEmailDomain]),c.useEffect(()=>{!O&&(re||F)&&aa&&(v(!0),a(Ia(_,j&&F,A&&re,!1)))},[O,_,a,aa]),c.useEffect(()=>{Le&&i===!1&&(E(!0),setTimeout(()=>{a(Sa())},5e3))},[Le,i]),c.useEffect(()=>{ie==="Completed"&&l&&K.cards.length===1&&(K.cards[0].status.code==="inactive"&&K.cards[0].type.code==="business_physical_credit_card"?n(`./${K.cards[0].id}/activate`):K.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${K.cards[0].id}`)))},[ie,l,r.state,n,K.cards]),c.useEffect(()=>{if(ie==="Completed"&&l){const G=K.cards.length,De=K.cards.filter(He=>He.cardHolderUserId===S?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&G===De.length&&n("./onboard")}},[ie,K.cards,l,n,S?.userId]),c.useEffect(()=>{ie!=="Completed"||A&&de.fetchState!=="Completed"||j&&F&&Y&&Pe.fetchState!=="Completed"||Q.trackCardsCardListView(z,ra,We,ta,na)},[ie,ea,de.fetchState,Pe.fetchState,Y]),S==null)throw Error("Can't access charge card list page without signing in...");const Ra=y(G=>Tt(G.userState,G.userRoleState,G.userListViewState,"cardAdmin")),ha=Za(k?.loggedInUserRoleMap),fa=G=>{p(G)},M=K.creditAccount.limit,me=()=>{m(!1),n("..")},Te=f.companyChargeCardInfo?.info!=null&&Xe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:A,isTOSAccepted:te,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha}),Ne=f.companyDebitCardInfo?.info!=null&&Xe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:j,isTOSAccepted:X,isSetupEnabled:F,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha});return re||F?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{Q.trackPageLoaded(Ht.Event.cardsListPage),(A&&!re||j&&!F)&&Q.trackCardsPromoView(z,{isCreditCardOffered:A,isDebitCardOffered:j,isDebitCardEnabled:F,isCreditCardEnabled:re},"Banner",j&&!F?"Debit Card":A&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Le})]}):null,C===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:C,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(j&&F&&Y)||Pe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!A||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!Y||Be.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Jr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:fa}),s.jsx(es,{isCashbackFeatureEnabled:T,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:j,isCreditCardProductVisibleForExpressInterest:L,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:g,creditCardPayNowThreshold:oe,signedInUser:S,chargeCardListState:K,location:r,admins:Ra.users,navigateAndClearBulkSelection:n,currentTenant:f,isCardControlsEnabled:ee,companyChargeCardInfoCreditAccountLimit:f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:f.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:Y,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{fa(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:F,isEarlyPayEnabled:h,isChargeCardPaymentHistoryFeatureEnabled:P,cashbackRate:x,controllerEmails:z,chargeCardCashbackDetailState:Be,depositAccountListWithDebitCardIssued:Pe,isChargeCardTOSAccepted:te,isDebitCardTOSAccepted:X,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:we.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:u,onAskAiCfoClick:b,isCardsCommentingEnabled:w})]})]}):(te||X)&&Y===!0?s.jsx(ga,{to:"../setup"}):Te||Ne?s.jsx(ga,{to:"../promo"}):s.jsx(la,{fetchState:ie})}const as=e=>`/${e}/cards/new`,ts=e=>`/${e}/cards/payment`,ns=e=>`/${e}/cards/payment-history`,rs=pe(function(e){const t=J.getSignedInUser(),a=ce(e),r=e.tenantState.currentTenantId,n=Ft(e),C={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},m=a?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:Bn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:C,companyName:m,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),C=n.poppedPathname??"..";r(C,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,C)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:C}}})},onFiltersChange:n=>{e(Rn({filters:n}))},onReloadPayments:()=>{e(vt(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(Ln({uiState:{downloadState:n}}))}}})(yr);function ss(){const e=le(),t=ge(),a=ue(),{areTenantIdsInSync:r}=Nt(),{useFeatureGate:n}=se();if(J.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const C=y(q=>ce(q)),m=y(q=>Ft(q)),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(null),v=!C.userRole.includes("charge_card_user"),D=!!C.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=n(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Z.isDebitCardFeatureEnabled),b=Se(u,C),l=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:b}),_=be(C),F=ye(C),R=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:p,isBookKeepingTenant:F,isDebitCardProductVisible:l,chargeCardsCreditAccountLimit:R}),T=!!C.companyChargeCardInfo?.info?.isChargeCardEnabled,N=je(),d=Ue(N?.loggedInUserRoleMap),h=y(q=>Ke(q,v,l&&D,B&&T)),P=c.useMemo(()=>{const q=h.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(q.map(z=>z.connectedAccountId))]},[h.cards]),w=y(q=>Ye(q)),U=y(q=>va(q,P)),{creditAccountRepayment:j}=y(q=>Ze(q)),$=c.useMemo(()=>Ja(d,w),[d,w]),H=c.useMemo(()=>Ca(B,T,d,h.creditAccount,j),[B,T,d,h.creditAccount,j]),V=c.useMemo(()=>et(l,D,d,U,h.debitCardSummary),[l,D,d,U,h.debitCardSummary]),A=c.useMemo(()=>Oe(B,l,D,T),[B,l,D,T]),L=h.creditAccount.balance.amount+h.creditAccount.hold.amount,W=c.useMemo(()=>f!=null?m.repaymentHistory.find(q=>q.cardRepaymentId===f):void 0,[f,m.repaymentHistory]),k=c.useCallback(q=>{O(q),a(Ia(v,l&&D,B&&T,!1)),S(!0)},[a,v,l,D,B,T]),Y=c.useCallback(()=>{S(!1),O(null),document.body.style.overflow="auto"},[]);return c.useEffect(()=>{g||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(I(!0),a(vt()))},[g,a,m.fetchState]),c.useEffect(()=>{!o&&(T||D)&&r&&(i(!0),a(Ia(v,!1,B&&T,!1)))},[o,T,D,r,a,v,B]),s.jsxs(s.Fragment,{children:[E?s.jsx(at,{closeDrawerHandler:Y,isPaymentDrawerOpen:E,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:L,productInformation:A,creditAccountInformation:H,debitAccountInformation:V,cashbackInformation:$,isDebitCardInfoFetchStateCompleted:!(l&&D&&d)||U.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!B||j.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!d||w.fetchState==="Completed",paymentInitiatedDate:j.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(rs,{location:t,navigate:e,accountInfoByAccountId:m.accountInfoByAccountId,onRetryPaymentClick:k})]})}const ct=_e.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
|
-
`,dt=qa.getLocalizedStrings().months;function os(){const e=le(),t=ue(),a=ge(),{creditAccount:r,creditAccountRepayment:n}=y(A=>Ze(A)),C=`${Vt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[m,g]=c.useState(!1),[I,o]=c.useState(!1),i=y(A=>Un(A)),{useFeatureGate:E}=se(),S=y(A=>ce(A)),{isFeatureEnabled:f}=E(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:O}=E(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:v}=E(Z.isCardsCommentingEnabled),D=Yt(v?S.companyId:void 0,{clearParams:v&&i.fetchState==="Completed"}),p=Se(O,S),u=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),b=be(S),l=ye(S),_=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,F=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:f,isBookKeepingTenant:l,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:_}),R=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,B=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,T=y(A=>$e(A,S.companyId)),N=ze(T.controllers),d=y(A=>xt(A)),h=d.cards.filter(A=>A.type.code.includes("debit")).map(A=>A.connectedAccountId),P=[...new Set(h)],w=y(A=>va(A,P)),U=y(A=>On(A));c.useEffect(()=>{I||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),t(Ga()))},[m,t,r.fetchState]),c.useEffect(()=>{I||r.fetchState!=="Completed"||r.id==null||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(o(!0),t(jn(r.id)))},[I,t,r.fetchState,r.id,i.fetchState]),c.useEffect(()=>{w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&u&&R&&t(Bt()),d.fetchState!=="Completed"&&d.fetchState!=="In-Progress"&&t(ia()),U.fetchState!=="Completed"&&U.fetchState!=="In-Progress"&&u&&R&&t(Vn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&F&&B&&t($a())},[w.fetchState,u,R,d.fetchState,U.fetchState,n.fetchState,F,B]),c.useEffect(()=>{if(i.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&d.fetchState==="Completed"&&(!u||!R||w.fetchState==="Completed"&&U.fetchState==="Completed")){let A="",L="";if(i.statements.length>0){const q=i.statements[i.statements.length-1].period,[z,x]=q.split("-"),oe=i.statements[0].period,[ee,te]=oe.split("-");A=`${dt[parseInt(x)-1]} ${z}`,L=`${dt[parseInt(te)-1]} ${ee}`}const W=Oe(F,u,R,B),k=Ca(F,B,!0,r,n),Y=et(u,R,!0,w,U);Q.trackCardsCreditCardStatementsView(N,W,{numberOfStatements:i.statements.length,oldestStatementMonthYear:A,latestStatementMonthYear:L},k,Y)}},[i.fetchState,r.fetchState,n.fetchState,w.fetchState,d.fetchState,U.fetchState]);const j=()=>{const A=ve(a.state?.pathnameStackToGoBack),L=A.poppedPathname??"..";e(L,{state:{pathnameStackToGoBack:A.newStack}})},$=y(A=>Ye(A)),H=J.getSignedInUser(),V={userId:H?.userId??"",sessionId:H?.zeniSessionId??"",tenantId:S.tenantId??""};if(H==null)throw Error("Can't access address page without signing in...");if(i.fetchState!=="Completed")return s.jsx(ct,{children:s.jsx(Sr,{onBackClick:j})});{const A=Oe(F,u,R,B);return s.jsx(ct,{children:s.jsx(Ir,{currentTenantCompanyName:S.companyName,statementListView:i,productInformation:A,onBackClick:j,authParams:V,controllerEmails:N,isChargeCardFeatureEnabled:F,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:R,isChargeCardSetupEnabled:B,isCardsCommentingEnabled:v,initialOpenThreadRequest:D,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:w,debitCardSummary:U,downloadEndPoint:C})})}}const is={containerWidth:new ma(100,58)},cs=({appContent:e})=>{const t=ua(),a=ue(),r=le(),n=ge(),{useDynamicConfig:C}=se(),[m,g]=c.useState(!1),[I,o]=c.useState(!1),[i,E]=c.useState(!1),[S,f]=c.useState(!1),[O,v]=c.useState(!1),[D,p]=c.useState(!1),u=J.getSignedInUser();if(u==null)throw Error("Can't access onboarding card page without signing in...");const b=y(L=>ce(L)),{configValue:l}=C(Fe.zeniCardsConfig),_=y(L=>Nn(L)),{tenantEmailDomain:F}=b,R=y(L=>L.settingsViewState.profile.fetchState),B=y(L=>L.chargeCardListState.fetchState),T=y(L=>L.settingsViewState.profile.userId),N=y(L=>L.chargeCardConfigState.fetchState);c.useEffect(()=>{m===!1&&R!=="In-Progress"&&R!=="Completed"&&(a(Hn()),g(!0)),I===!1&&N!=="In-Progress"&&N!=="Completed"&&(a(Da()),o(!0)),i===!1&&B==="Not-Started"&&(E(!0),a(ia()))},[m,i,B,I,N]),c.useEffect(()=>{R==="Completed"&&O===!1&&T!=null&&B==="Completed"&&_.cards.length>0&&(a(Mn({userId:T})),a(Lt({cardId:_.cards[_.cards.length-1].id})),v(!0))},[R,O,T,B]),c.useEffect(()=>{if(!S&&_.fetchState==="Completed"&&_.cards.length===0){const L=ve(n.state?.pathnameStackToGoBack),W=L.poppedPathname??Ve(F);r(W,{state:{pathnameStackToGoBack:L.newStack}})}},[_.fetchState,_.cards,S]);const d=y(L=>ka(L)),h=Qa(d.updateStatus.fetchState),P=d.currentDisplayedCardId,{useFeatureGate:w}=se(),{isFeatureEnabled:U}=w(Z.isChargeCardFeatureEnabled),j=!!b.companyChargeCardInfo?.info?.isChargeCardEnabled,$=!b.userRole.includes("charge_card_user")&&U&&j,H=y(L=>P!=null?Rt(L.chargeCardState,P):null),V=()=>{P!=null&&(a(Je(P,$,!0)),a(ia()),f(!0))};c.useEffect(()=>{if(S&&P!=null&&H!=null&&H.status.code!=="request_on_hold"){const L=Ce(b.tenantEmailDomain,P,u,H),W=fe(n.state?.pathnameStackToGoBack,n.pathname);a(Gn()),H?.type.code==="business_virtual_credit_card"&&a(_a()),r(L,{state:{pathnameStackToGoBack:W},replace:!0})}},[S,H?.status.code]),c.useEffect(()=>{h==="In-Progress"&&d.updateStatus.fetchState==="Completed"&&setTimeout(V,3e3)},[h,d.updateStatus.fetchState]);const A=L=>{p(L)};if(!S&&B!=="Completed"||R!=="Completed"||_.cards.length===0)return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:A}),s.jsx(Ar,{})]});if(T==null)throw Error("Can't access my userId.");return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:A}),s.jsx(ds,{chargeCardListView:_,cardUserOnboardingView:d,navigate:r,currentTenant:b,myUserId:T,location:n,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{A(!0)}}),e!=null?s.jsx(ls,{windowSize:t,children:e}):null]})},ds=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{cards:r.cards,showMenuIcon:m,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:C}=t,{tenantEmailDomain:m}=C;return{updateCardUserOnboardingLocalData:g=>{e(rt({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const I={...r.cardUserOnboardingLocalData,phone:g};e(rt({localData:I}))}e(Ta(g,"CardUserOnboarding"))},onResendOtp:g=>{e(wa(g,"CardUserOnboarding"))},onVerifyOtp:(g,I)=>{e(Pa(g,I,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e($n()),g!=null&&J.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(Lt({cardId:g}))},onBackClick:()=>{const g=ve(n.state?.pathnameStackToGoBack),I=g.poppedPathname??Ve(m);a(I,{state:{pathnameStackToGoBack:g.newStack}})}}})(Er),ls=_e.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
width: ${e=>`${is.containerWidth.value(e.windowSize)}%`};
|
|
38
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
-
`,lt=_e.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
|
-
`,us={containerWidth:new ma(100,58)},ms=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m,useFeatureGate:g}=se(),[I,o]=c.useState(!1),[i,E]=c.useState(!1),[S,f]=c.useState(!1),[O,v]=c.useState(!1),D=J.getSignedInUser();if(D==null)throw Error("Can't access onboarding card page without signing in...");const p=y(V=>ce(V));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=m(Fe.zeniCardsConfig),b=y(V=>zn(V,n)),{isFeatureEnabled:l}=g(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=g(Z.isDebitCardFeatureEnabled),F=Se(_,p),R=Ie({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:F}),B=be(p),T=ye(p),N=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:l,isBookKeepingTenant:T,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:N}),h=b.chargeCard,P=y(V=>V.chargeCardConfigState.fetchState);c.useEffect(()=>{I===!1&&P!=="In-Progress"&&P!=="Completed"&&(a(Da()),o(!0)),i===!1&&b.fetchState==="Not-Started"&&(E(!0),a(Je(n,!1,d)))},[i,b.fetchState,I,P]);const w=h?.type.code==="business_physical_debit_card"||h?.type.code==="business_virtual_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(S===!1&&(w===!1||w&&h.status?.code!=="active"||w&&h.status.code==="active"&&h.isPinSet||h.cardHolderUserId!==D.userId)){const V=Ce(p.tenantEmailDomain,n,D,h,!0),A=fe(C.state?.pathnameStackToGoBack,C.pathname);r(V,{state:{pathnameStackToGoBack:A}})}else if(S&&b.isRefreshingViewInBackground===!1&&h?.isPinSet===!0){a(Zn({chargeCardId:n}));const V=Ce(p.tenantEmailDomain,n,D,h,!0),A=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(V,{state:{pathnameStackToGoBack:A}})}}},[b.fetchState,h?.type.code,S,b.isRefreshingViewInBackground]);const U=J.getZeniOtpTokenForCardHolder(n),j=y(V=>pt(V.userState,D.userId)),$=()=>{h?.isPinSet!==!0&&a(za(n,!0))};c.useEffect(()=>{b.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout($,3e3),f(!0))},[b.updateDebitCardPinAttemptFetchState.fetchState]);const H=V=>{v(V)};if(P!=="Completed"||h==null)return s.jsx(la,{fetchState:"In-Progress"});if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(hs,{children:[s.jsx(Ge,{isAppContentDrawerOpen:O,handleDrawerToggle:H}),s.jsx(Cs,{cardId:n,card:h,phone:j.phone,signedInUser:D,isSandboxEnv:Ka(),debitCardDetailState:b,signedInUserToken:U,navigate:r,currentTenant:p,location:C,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{H(!0)}}),e!=null?s.jsx(ps,{windowSize:t,children:e}):null]})},Cs=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=ht(e,a),n=t.updateStatus,C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{showMenuIcon:m,vgsVaultId:Ba.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,debitCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(It(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Yn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(kr),ps=_e.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
width: ${e=>`${us.containerWidth.value(e.windowSize)}%`};
|
|
51
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
-
box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
-
`,hs=_e.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=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
-
`,fs={overlayWidth:new ma(Ua[12],Ua[12],Ua[9])},gs=pe(function(e,t){const a=Ya(e,!1,!1),r=t.lineId,n=a.customAddress[r],C=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:C,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:C=>{a!=null&&e(Ut(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const m=jr(C);e(qn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:m})),e(Qn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Wn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(Dr),bs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=ua(),C=()=>{t()},m=y(g=>Kn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(Mt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:fs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,I)=>(I==="backdropClick"||I==="escapeKeyDown")&&C(),children:s.jsx(gs,{googleAPIKey:Ba.googleMapsAPIKey,onDismissClick:C,lineId:e,chargeCardTypeOption:a,newCustomAddressId:m})})},ys=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g}=t,I=Ya(e,a&&m,r&&g);return{issueChargeCards:I,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g,cardHolderCandidates:I.userList.map(o=>o.user).filter(Boolean),allRoles:I.userList.map(o=>o.userRole),allAccountingClasses:I.allAccountingClasses,userList:I.userList}},function(e,t){return{onIssueCardClick:()=>{e(er())},onSaveChangesToLocalStore:a=>{e(Jn(a))},onDismissClick:()=>{e(Ot()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Ut(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(wr);function Ss(){const e=J.getSignedInUser(),t=le(),a=ue(),r=_r(),[n]=ut(),C=n.get("cardType"),{useFeatureGate:m}=se(),{isFeatureEnabled:g}=m(Z.isIssuePhysicalCardEnabled),{isFeatureEnabled:I}=m(Z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=m(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(Z.isChargeCardFeatureEnabled),E=y($=>ce($)),S=Se(o,E),f=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:S}),O=be(E),v=ye(E),D=E.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=Ae({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:i,isBookKeepingTenant:v,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:D}),[u,b]=c.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");c.useEffect(()=>{u||(b(!0),a(Xn(f&&_,p&&l,!1)))},[u,b,a]);const l=!!E.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!E.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y($=>Ya($,p&&l,f&&_)),R=F.fetchState,B=F.issueCardStatus.fetchState,T=F.lastSelfIssuedDebitCardId,N=y($=>T!=null?Rt($.chargeCardState,T):void 0),[d,h]=c.useState(null),[P,w]=c.useState(null),U=()=>{h(null)},j=($,H)=>{h($),w(H)};return c.useEffect(()=>{if(B==="Completed"){if(T!=null&&N?.type.code==="business_virtual_debit_card"){let $;$=N?.status.code==="request_on_hold"&&e.userId===N.cardHolderUserId?Zt(E.tenantEmailDomain):Ce(E.tenantEmailDomain,T,e,N),t($)}else t("../");a(Ot())}},[B,T]),R==="Completed"?s.jsxs(s.Fragment,{children:[d!==null&&P!==null?s.jsx(bs,{closeDrawerHandler:U,lineId:d,chargeCardTypeOption:P}):null,s.jsx(ys,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:I,isDebitCardFeatureEnabled:f,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:l,isDebitCardSetupEnabled:_,navigate:t,fetchState:F.fetchState,openAddAddressDrawerHandler:j,defaultCardType:C==="creditCard"||C==="debitCard"?C:void 0})]}):R==="Error"?s.jsx(La,{}):s.jsx(Pr,{})}const Is=_e.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
|
-
`,As=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:C,myPendingActivationChargeCardListState:m}=t,{tenantEmailDomain:g}=r,{cards:I}=m;return{onChargeCardRowClick:o=>{const i=zt(I,o),E=Ce(g,o,C,i),S=fe(n.state?.pathnameStackToGoBack,n.pathname);a(E,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(o,i)=>{e(Va({uiState:{sortKey:o,sortOrder:i}}))},onReloadCards:()=>{e(ia())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Va({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(Tr);function Es(){const e=le(),t=ue(),a=ge(),r=Wa(),[n,C]=c.useState(!1),m=y(w=>ar(w)),g=y(w=>ce(w)),I=y(w=>$e(w,g.companyId)),o=ze(I.controllers),{useFeatureGate:i}=se(),{isFeatureEnabled:E}=i(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=i(Z.isDebitCardFeatureEnabled),f=Se(S,g),O=Ie({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:f}),v=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,D=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,p=je(),u=be(g),b=ye(g),l=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Ae({isCardsOnlyTenant:u,isChargeCardFeatureEnabled:E,isBookKeepingTenant:b,isDebitCardProductVisible:O,chargeCardsCreditAccountLimit:l}),F=Ue(p?.loggedInUserRoleMap),R=y(w=>Ye(w)),{creditAccount:B,creditAccountRepayment:T}=y(w=>Ze(w)),N=y(w=>xt(w)).cards.filter(w=>w.type.code.includes("debit")).map(w=>w.connectedAccountId),d=[...new Set(N)],h=y(w=>va(w,d));c.useEffect(()=>{n||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(C(!0),t(ia()),t(Da()))},[n,t,m.fetchState]),c.useEffect(()=>{if(m.fetchState==="Completed"&&m.cards.length===1&&P!=null){const w=Ce(g.tenantEmailDomain,m.cards[0].id,P,m.cards[0]);e(w,{state:{message:a.state?.message}})}},[m.fetchState,m.cards]);const P=J.getSignedInUser();if(c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&_&&D&&F&&t(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&F&&t($a()),h.fetchState!=="Completed"&&h.fetchState!=="In-Progress"&&O&&v&&F&&t(Bt())},[B.fetchState,T.fetchState,t,h.fetchState,O,v,F,_,D]),P==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return s.jsx(la,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const w=Oe(_,O,v,D);return s.jsx(Is,{children:s.jsx(As,{navigate:e,currentTenant:g,signedInUser:P,productInformation:w,myPendingActivationChargeCardListState:m,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:O,isDebitCardSetupEnabled:v,isChargeCardSetupEnabled:D,chargeCardCashbackDetailState:R,creditAccount:B,creditAccountRepayment:T,depositAccountListWithDebitCardIssued:h,controllerEmails:o,location:a})})}}const ks=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:C,isChargeCardSetupEnabled:m,signedInUser:g,location:I,productInformation:o,isEarlyPayEnabled:i,controllerEmails:E,chargeCardsCreditAccountLimit:S}=t;return{onSetupButtonClick:f=>{if(g!=null&&Q.trackCardsPromoPageClicked("enable cards"),n)switch(Q.trackCardsEnableCardsClick(E,o,"Cards Promo"),f){case"credit":e(Re(r,!0,"charge_cards",i,!1));break;case"debit":e(Re(r,!0,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Re(r,!0,"debit_cards",i,!0):Re(r,!0,"charge_cards__debit_cards",i,!1))}else switch(Q.trackCardsSetupCardsClick(E,o,"Cards Promo"),f){case"credit":e(Re(r,!1,"charge_cards",i,!1));break;case"debit":e(Re(r,!1,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Re(r,!1,"debit_cards",i,!0):Re(r,!1,"charge_cards__debit_cards",i,!1))}},onBackClick:()=>{const f=ve(I.state?.pathnameStackToGoBack);let O=f.poppedPathname;O==null&&(O=C||m?"..":"../.."),a(O,{state:{pathnameStackToGoBack:f.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(rr(r))}}})(vr),Ds=()=>{const e=le(),{tenantEmailDomain:t}=ca(),[a]=ut(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:C,useFeatureGate:m}=se(),[g,I]=c.useState(!1),{isFeatureEnabled:o}=m(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:E}=m(Z.isChargeCardFeatureEnabled),{configValue:S}=C(Fe.zeniCardsConfig),f=y(ae=>ce(ae)),O=y(ae=>$e(ae,f.companyId)),v=ze(O.controllers),D=S.charge_card_cashback_rate_per_transaction!=null?S.charge_card_cashback_rate_per_transaction:.0175,p=ge(),u=J.getSignedInUserTenant(t)?.companyId??f.companyId,b=y(ae=>da(ae,u)),l=b.primaryFundingAccount,_=f.companyBillPayInfo?.info,F=be(f),R=ye(f),B=Se(o,f),T=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,N=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:B}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:E,isBookKeepingTenant:R,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:T}),h=$t({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:E,isBookKeepingTenant:R}),P=N&&d===!1,w=_?.businessVerificationStatus?.code==="verified"&&(P||l?.accType==="depositAccount"||tr(l?.providerVerificationStatus?.code??"")),U=J.getSignedInUser(),j=!!f.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,H=!!f.company?.companyChargeCardInfo.isChargeCardEnabled,V=!!f.company?.companyDebitCardInfo.isDebitCardEnabled,A=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,L=ae=>{I(ae)},W=y(ae=>ae.chargeCardSetupViewState.fetchState);if(U==null)throw Error("Can't access Charge Card promo page without signing in...");const k=je(),Y=Ue(k?.loggedInUserRoleMap),q=Za(k?.loggedInUserRoleMap),[z,x]=c.useState(!1),[oe,ee]=c.useState(!1),[te,X]=c.useState(!1);c.useEffect(()=>{z===!1&&p.state?.message==="activation"&&x(!0)},[p.state]),c.useEffect(()=>{oe||W!=="Not-Started"||u==null||(ee(!0),n(Fa(u,!0)))},[oe,W,u,n]);const re=f.companyChargeCardInfo?.info!=null&&Xe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:h,isTOSAccepted:$,isSetupEnabled:H,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),Ee=f.companyDebitCardInfo?.info!=null&&Xe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:N,isTOSAccepted:A,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),xe=N&&Ee&&h&&T>=0&&re?"debit_and_credit":N&&Ee?"debit":"credit",K=Or(r,xe),he=b?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=c.useRef(null);c.useEffect(()=>{he==="In-Progress"?ke.current=K:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,K]);const Be=he!=="In-Progress"&&he!=="Completed"||ke.current==null?K:ke.current;c.useEffect(()=>{K==="credit"&&(H||h===!1&&V)||K==="debit"&&V||K==="debit_and_credit"&&V&&H?e("../"):(K==="debit_and_credit"&&$===!0&&A===!0||K==="credit"&&($===!0||h===!1&&A===!0)||K==="debit"&&A===!0)&&Y===!0&&e("../setup")},[w,H,V,K,$,A]),c.useEffect(()=>{te||(n(nr("cardAdmin")),X(!0))},[te]);const Pe=y(ae=>Tt(ae.userState,ae.userRoleState,ae.userListViewState,"cardAdmin")),we=Oe(h,N,V,H);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{if(Q.trackPageLoaded(Ht.Event.cardsPromoPage),!!h&&!H||!!N&&!V||!!h&&!!N&&!V&&!H){const ae=_s({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:H,isCreditCardProductVisibleForExpressInterest:h,isDebitCardProductVisible:N});Q.trackCardsPromoView(v,we,"Page",ae,"Promo Page")}}}),s.jsx(xa,{showConfetti:z}),s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:L}),s.jsx(ks,{signedInUser:U,location:p,showEnableCardButton:w,isCompanyBusinessVerificationAndPaymentSetUpDone:w,isChargeCardSetupEnabled:H,isDebitCardSetupEnabled:V,companyLegalName:f.companyName,adminList:Pe.users,isCheckingEnabled:j,navigate:e,companyId:u,cardPromoType:Be,controllerEmails:v,productInformation:we,isCreditCardProductVisible:d,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:i,cashbackRate:D,chargeCardsCreditAccountLimit:T,onClickMenuIcon:()=>{L(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:L}),s.jsx(Fr,{})]})},_s=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Qs(){const e=ge(),t=y(W=>ce(W)),{useFeatureGate:a}=se(),{isFeatureEnabled:r}=a(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=a(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:m}=a(Z.isChargeCardPaymentHistoryFeatureEnabled),g=Se(n,t),I=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),o=xr(t,r,n),i=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,E=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,S=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,O=je(),v=Ue(O?.loggedInUserRoleMap),D=Za(O?.loggedInUserRoleMap),{isFeatureEnabled:p}=a(Z.isCashbackFeatureEnabled),u=t.userRole.includes("charge_card_user"),b=!u,l=!u&&S,_=t?.userRole!=null&&sr(t?.userRole),F=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!_)&&or(O?.loggedInUserRoleMap),R=ir(O?.loggedInUserRoleMap),B=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!_)&&cr(O?.loggedInUserRoleMap),{isFeatureEnabled:T}=a(Z.isDepositAccountsFeatureEnabled),N=T&&!_&>(O?.loggedInUserRoleMap),d=S&&!_,h=f&&!_,P=o&&!_&&Ue(O?.loggedInUserRoleMap),w=dr(O?.loggedInUserRoleMap),U=be(t),j=ye(t),$=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:r,isBookKeepingTenant:j,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:$}),V=t.companyChargeCardInfo?.info!=null&&Xe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:H,isTOSAccepted:i,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:v,isUserHasCardsAccess:D}),A=t.companyDebitCardInfo?.info!=null&&Xe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:I,isTOSAccepted:E,isSetupEnabled:f,isUserHasCardsAdminLevelAccess:v,isUserHasCardsAccess:D}),L=V||A;return s.jsxs(qt,{children:[v?s.jsx(ne,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:F,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:N,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:R,productType:"charge_cards",type:"setup"})}):null,v?s.jsx(ne,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:F,isUserHasOnlyBillPayAccess:R,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:N,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:w,productType:"charge_cards",type:"verification"})}):null,s.jsx(ne,{path:"promo",element:s.jsx(Ds,{})}),d||h?s.jsxs(s.Fragment,{children:[s.jsx(ne,{path:"/",element:s.jsx(it,{isPaymentDrawerOpen:!1})}),P&&C?s.jsx(ne,{path:"payment",element:s.jsx(it,{isPaymentDrawerOpen:!0})}):null,s.jsx(ne,{path:"activate",element:s.jsx(Es,{})}),s.jsx(ne,{path:"onboard",element:s.jsx(cs,{})}),v?s.jsx(ne,{path:"new",element:s.jsx(Ss,{})}):null,p&&b?s.jsx(ne,{path:"cashback",element:s.jsx(Hr,{})}):null,l?s.jsx(ne,{path:"statements",element:s.jsx(os,{})}):null,P&&m&&S?s.jsx(ne,{path:"payment-history",element:s.jsx(ss,{})}):null,s.jsx(ne,{path:":cardId/activate",element:s.jsx($r,{})}),s.jsx(ne,{path:":cardId/setPin",element:s.jsx(ms,{})}),s.jsx(ne,{path:":cardId/addToWallet",element:s.jsx(Vr,{})}),s.jsx(ne,{path:":cardId/*",element:s.jsx(Xr,{})}),s.jsx(ne,{path:"*",element:s.jsx(La,{})})]}):(i||E)&&v?s.jsx(ne,{path:"*",element:s.jsx(ga,{to:"../setup"})}):L?s.jsx(ne,{path:"*",element:s.jsx(ga,{to:"../promo",state:e.state})}):s.jsx(ne,{path:"*",element:null})]})}export{Qs as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-Cj_tHvtA.js";import{a}from"./sentry-pDh2qSl7.js";import{u as D,g as v,j as u,N as w}from"./core-Cy60pewc.js";import{Jm as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jt as F}from"./zeni-epic-state-CRkqEZ9n.js";import{u as P,z as c,L as g,D as $,o as k}from"./index-DXfCjMwK.js";import{n as H}from"./mui-CRLIhCCm.js";import{t as z}from"./getLocaleForTenant-RkomRM_7.js";import{g as R,Q as J}from"./QBOConnectionScreen-Bp_uUyx7.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./empty-C0r2LR8d.js";import"./pdf-lib-CGSxq5us.js";import"./index-CyER2VFG.js";import"./url-8O3uL66H.js";import"./index-lS13JcL7.js";import"./decodeURIComponentSafe-CvAV2ZH_.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]="d9735e6d-9385-4cb9-a9a7-880f042883c1",t._sentryDebugIdIdentifier="sentry-dbid-d9735e6d-9385-4cb9-a9a7-880f042883c1")}catch{}})();const W=H.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex: 1 1 auto;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100vh;
|
|
9
|
-
background-color: ${t=>t.theme.colors.background};
|
|
10
|
-
box-shadow: ${t=>`0px 2px ${k.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function pe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:x}=P(),p=a.useRef(!1),f=a.useRef(!1),{code:b,realmId:T,state:y}=R(i.search),N=b!==""&&T!==""&&y!=="",I=u(l=>A(l)),e=u(l=>O(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=c.getSignedInUser(),m=c.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{p.current||o==null||m==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(j(o.userId,m))))},[p,n,d]),a.useEffect(()=>{e.tenantId==null&&!f.current&&o!=null&&(f.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(U(o.userId)))},[f,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(_(e.tenantId)),c.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),$.updateAppLocaleID(z(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&c.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||x()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(W,{children:C.jsx(J,{})}):C.jsx(w,{to:"/",replace:!0})}export{pe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-Cj_tHvtA.js";import{z as n}from"./index-DXfCjMwK.js";import{g as d}from"./QBOConnectionScreen-Bp_uUyx7.js";import"./sentry-pDh2qSl7.js";import{g as p,N as a}from"./core-Cy60pewc.js";import"./zeni-epic-state-CRkqEZ9n.js";import"./recharts-Btsi-yTh.js";import"./mui-CRLIhCCm.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./empty-C0r2LR8d.js";import"./pdf-lib-CGSxq5us.js";import"./index-CyER2VFG.js";import"./url-8O3uL66H.js";import"./index-lS13JcL7.js";import"./decodeURIComponentSafe-CvAV2ZH_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-Cj_tHvtA.js";import{t as $e,A as Ce}from"./AddressScreen-kxW0VXwU.js";import Ke from"./NotFoundScreen-VuNCYuY2.js";import{a as g}from"./sentry-pDh2qSl7.js";import{h as se,g as oe,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as Me,p as z}from"./core-Cy60pewc.js";import{r as de,k as le,z as B,v as ue,h as qe,I as _,m as V,x as H,c as N,B as we,e as Y,ap as Qe,J as Ze,aq as Ie,i as te,ar as Je,as as ke,o as He,at as We,au as Ee,av as Ye}from"./index-DXfCjMwK.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mU as at,fc as nt,bO as st,ji as ae,jl as ve,JS as ot,bT as it,c2 as ge,ss as he,sd as rt,Km as X,st as _e,HK as ct,km as Ue,Kn as Ve,Ko as dt,Kp as lt,Kq as ut,jg as pt,jj as mt,sf as Be,sr as gt,bE as Te,cv as ht,sF as xe,qf as ft,q3 as yt,ke as St,fE as bt,fD as Ct,fC as It,Kr as kt,s7 as Et,sG as Tt,sJ as xt,sM as Ot,sS as Pt,cT as Dt}from"./zeni-epic-state-CRkqEZ9n.js";import{n as fe}from"./mui-CRLIhCCm.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-Bp_uUyx7.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./empty-C0r2LR8d.js";import"./pdf-lib-CGSxq5us.js";import"./index-CyER2VFG.js";import"./url-8O3uL66H.js";import"./index-lS13JcL7.js";import"./decodeURIComponentSafe-CvAV2ZH_.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]="74141cbd-d059-4a98-9605-c9978092b853",t._sentryDebugIdIdentifier="sentry-dbid-74141cbd-d059-4a98-9605-c9978092b853")}catch{}})();const jt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),D=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),q===!1&&D.push("reimbursement_card","reimbursement_promo_card"),I===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),o(at(i.userId,R,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,o]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
5
|
-
`,Pe=fe.div`
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
align-items: center;
|
|
9
|
-
min-width: calc(100% - ${ke}px);
|
|
10
|
-
padding-left: ${ke}px;
|
|
11
|
-
flex: 1;
|
|
12
|
-
|
|
13
|
-
${t=>t.theme.breakpoints.down("md")} {
|
|
14
|
-
width: 100%;
|
|
15
|
-
padding-left: ${He.sp0};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
-
`,De=ce(function(t,s){const{companyId:o,isAdmin:u,currentTenant:d,isOnAddressPage:r}=s,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=he(t,o),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,s){const{companyId:o,currentTenant:u,themeState:d,navigate:r,location:p}=s,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(o,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:k,email:T,ssn:x,nationalityCountryCode:I,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:h,userId:m,firstName:k.firstName,lastName:k.lastName,email:T,ssn:x,nationalityCountryCode:I?.selectedOption!=null?Ee(I.selectedOption):void 0,phone:U,birthday:f!=null?Te(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:k,companyWebsite:T,companyPhone:x,primaryContactEmail:I,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:R,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:D,regulatedStatusDescription:Q,transactionVolume:K,transactionVolumeDescription:M,usNexus:v,usNexusTypes:q}=e,l={companyId:o,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:T!=""&&T!=null?ht(T):void 0,phone:x,syncToken:F,fileIds:$,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(J=>J.length===2?J:Ee(J))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:D??"",regulatedStatusDescription:Q,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:M,usNexus:v,usNexusTypes:q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:I,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=Ae(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=Ae(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(o,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(o,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(X({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Je),W=({taxCFOCustomer:t=!1,isOnAddressPage:s=!1,appContent:o})=>{const u=se(),d=oe(),r=ie(),p=Ze(),S=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:f}=I(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=A(y=>y.onboardingCustomerViewState.fetchState),F=A(y=>y.onboardingCustomerViewState.currentStep),$=A(y=>y.onboardingCustomerViewState.uiState),c=A(y=>ee(y)),L=A(y=>y.userRoleConfigState.fetchState),j=A(y=>y.cardPaymentViewState),G=Ie(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:b,realmId:R,state:w}=At(d.search),P=c.externalConnections?.accounting[0],D=P?.connectionType,Q=P?.connectionName,K=P?.connectionId??"",M=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(b,R,w,K,M)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(ot(c.tenantId,{connection_type:D??"accounting",connection_name:Q??"quickbooks_online",authorization_code:b,realm_id:R,connection_id:K,user_id:M},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,K),u(d.pathname))},[b,R,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=A(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const J=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(Y.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Re?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Ge?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:s,themeState:S,googleAPIKey:te.googleMapsAPIKey}),o!=null?a.jsx(Pe,{windowSize:p,children:o}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return J===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>Se(y)}),a.jsx(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:s,themeState:S,googleAPIKey:te.googleMapsAPIKey}),o!=null?a.jsx(Pe,{windowSize:p,children:o}):null]});return null};function Ae(t,s,o){let u=`/${t}/onboarding/address`;return u=o!=null?u.concat(`/edit/${s}/${encodeURIComponent(o)}`):u.concat(`/new/${s}`),u}const Fe=fe.div`
|
|
20
|
-
display: flex;
|
|
21
|
-
height: 100vh;
|
|
22
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
-
`,je=ce(function(t,s){const{companyId:o,currentTenant:u}=s,d=he(t,o),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,s){const{currentTenant:o,themeState:u,navigate:d,location:r}=s,{tenantEmailDomain:p}=o;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=se(),s=ie(),o=oe(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&o.state?.message==="OnboardingThankyou"&&n(!0)},[o.state]);const i=A(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{s(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),T=me(i),x=A(f=>f.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||h?x==="Completed"&&I===!0&&h&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Dt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:o,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&I===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:o,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:x}):k?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function sa(){return a.jsxs(Me,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx(Ke,{})})]})}export{sa as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-Cj_tHvtA.js";import{J as d,A as l,h as f}from"./index-DXfCjMwK.js";import{D as p}from"./mui-CRLIhCCm.js";import"./sentry-pDh2qSl7.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]="c6ac78c5-2e61-4396-9a04-09300c52b2a8",e._sentryDebugIdIdentifier="sentry-dbid-c6ac78c5-2e61-4396-9a04-09300c52b2a8")}catch{}})();const u={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=d(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),i=f();return c.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-Cj_tHvtA.js";import Rn from"./NotFoundScreen-VuNCYuY2.js";import{a,b as Pt}from"./sentry-pDh2qSl7.js";import{n as Fe,S as Dn}from"./mui-CRLIhCCm.js";import{u as re,h as wt,g as Ge,j as U,n as Un,i as rt,o as Fn,p as Le}from"./core-Cy60pewc.js";import{eP as Re,PZ as Bn,n4 as ke,fj as _n,qJ as Vn,nm as xt,nH as Rt,P_ as Dt,nR as jn,P$ as Ut,nf as On,qf as Mn,f3 as Ie,Q0 as De,sP as Ft,C0 as Bt,Q1 as _t,Q2 as Ln,pW as qe,LE as dt,LG as zn,jJ as Qn,LH as $n,jQ as Gn,cV as qn,tU as Je,ns as Vt,nW as Ue,Q3 as Jn,Kx as ut,Kw as Pe,Q4 as mt,k5 as Nn,Q5 as Yn,Q6 as Kn,Q7 as Hn,Q8 as Wn,nz as Zn,nk as de,nZ as we,Q9 as Xn,Qa as ea,Qb as ta,o4 as na,jU as aa,jL as oa,Qc as sa,jT as ht,LO as ca,Qd as ia,Qe as la,pS as ra,pv as da,nX as fe,pu as ze,Qf as ua,Qg as ma,lo as ha,bq as pa,lj as pt,l5 as ga,Qh as Ca,gT as gt,fU as Sa,lg as Ia,vN as fa,Qi as ka,ov as Ea,oq as va,ou as ya,of as ba,Qj as Aa,f6 as jt,nK as Ta,nv as Pa,fk as Ct,n$ as wa,Qk as xa,nY as Ot,Ql as Ra,Qm as Da,Qn as Ua,Qo as Fa,Qp as St,q2 as Ba,pl as _a,Kv as Va,jS as ja,Qq as Oa,Gy as Ma,jR as La,jG as za,f5 as Qa,oW as Mt,pd as $a,nV as It,n_ as Ga,bE as qa,ld as Ja,la as Na,Qr as Ya,oe as ft,pb as kt,p9 as Ka,o$ as Ha,oG as Wa,pc as Za,Qs as Xa,Qt as eo,oK as to,Qu as no,oA as ao,oJ as oo,oH as so,pg as co}from"./zeni-epic-state-CRkqEZ9n.js";import{v as Lt,I as le,c as L,m as H,V as zt,Y as Qt,cC as io,z as Be,cD as lo,at as xe,cE as ro,aT as Et,B as $t,cF as uo,aq as Qe,D as mo,cG as ho,a2 as po,cH as go,U as Co,cI as So,cJ as Io,r as fo,k as ko,aN as Eo,b7 as vo,A as yo,cK as bo}from"./index-DXfCjMwK.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-BZkbW7CL.js";import{c as vt,C as Ao}from"./TransactionDetailScreen-CRrD1rrU.js";import{w as To}from"./withTransactionSidePanel-Pig-pzDa.js";import{h as Po,v as wo}from"./routePaths-BHuMCYZS.js";import{g as $e}from"./accountMappingHelper-BxXl62E-.js";import{D as xo}from"./DrawerScreen-B8qy6piZ.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./decodeURIComponentSafe-CvAV2ZH_.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]="6580d999-e796-43cc-9fba-2793d772886d",t._sentryDebugIdIdentifier="sentry-dbid-6580d999-e796-43cc-9fba-2793d772886d")}catch{}})();const Ro=()=>{const t=re(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(le.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Bn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,Y=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:Y}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Do,{children:C.jsx(io,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Do=Fe.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
-
`,Uo=Pt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=re(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,T=(e,n)=>{g(Mn(e,n.split(".")[0]))},I=e=>{h!=null&&g(On({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(jn({accountId:i,selectedPeriod:y,payload:e}))},Y=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),O=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(lo,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:y,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:T,onDeleteFile:I,onSelectSourceType:Y,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(ro,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:O})})}):null}),yt=Fe.div`
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
height: 100%;
|
|
12
|
-
`,bt=Fe.div`
|
|
13
|
-
flex: 1;
|
|
14
|
-
min-height: 0;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
min-width: 0;
|
|
19
|
-
overflow-x: hidden;
|
|
20
|
-
overflow-y: auto;
|
|
21
|
-
`;function Fo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>Ln(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(uo,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Bo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:_o,comma:At,space:Vo}},dateFormat:qt}=mo.getLocalizedStrings(),Tt=co,jo=Un(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=Ie(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${po}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:Y}=S.jeSchedules,te=Vt(I),O=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(I.month,I.year),t(_a(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));go(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(P=>{P!=null?t(Ba(e,P)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Fa(e,n)),m!=null&&t(ke({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Ua(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?Vo+_o+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Da(e))},onUpdateMissingReceiptsUIState:e=>{t(Ra(e))},onFetchMissingReceiptsList:()=>{_!=null&&O!=null&&t(Ot({start:O,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(so(e))},onBulkUploadProgress:e=>{t(oo(e))},onBulkUploadSuccess:e=>{t(ao({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(no(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(to(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(eo())},onSetBulkUploadResultsTab:e=>{t(Xa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Za(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Wa())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ha(e,n))},onFetchBulkUploadBatches:e=>{t(Mt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(xa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&O!=null&&t(fe(s,{start:O,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(wa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Pa(e))},onSaveReconciliationReview:e=>{t(Ta(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(jt(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(Y.prepaidExpensesAccountList,s.selectedOptions),b=$e(Y.fixedAssetsAccountList,l.selectedOptions),P=$e(Y.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:P.map(w=>w.accountId)};t(Aa({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ba())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:P,allClassList:V,allDepreciationAccountList:w}=S.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,ne={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},ae=p?.selectedOption!=null?P.find($=>$.qboId===p.selectedOption):void 0,Ee=k?.selectedOption!=null?V.find($=>$.classId===k.selectedOption):void 0,oe=l?.selectedOption!=null?w.find($=>$.qboId===l.selectedOption):void 0;t(ya({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:ae?.accountId,updatedClassId:Ee?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ne.id,name:ne.name}}}))},ignoreRecommendedJeSchedule(e,n){t(va(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onCancelAutoComplete:()=>{t(Pe("common"))}},onPostJESchedule(e,n){t(Ea({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ka())},handleJeScheduleClick:(e,n,s)=>{t(fa({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Ia(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Sa())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ca(e))},onUpdateFileAttachment:e=>{t(ga({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ha(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,pa().format(qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,P,V,w,Q,ne,ae)=>{t(ma(e,n,s,l,y,k,p,b,P,V,w,Q,ne,ae))},onCancelAutoComplete:()=>{t(Pe("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&O!=null&&(t(fe(e,{start:O,end:_},!1,!1)),t(ua(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&O!=null&&t(fe(e,{start:O,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{_!=null&&O!=null&&t(fe(e,{start:O,end:_},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,P)=>{t(da(e,n,s,l,P??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(ra(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(la({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&t(ca({transactionId:P,customerUpdates:p})),t(ia({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&(t(aa({transactionId:P,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(oa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))):t(sa({selectedTab:l,transactionId:P.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(na(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ta(e))},updateOperatingExpensesIdsForReview:e=>{t(ea({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=wo(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Xn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(de(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Zn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Wn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Kn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Nn(l)),t(Yn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,qe("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(ho),Oo=To(function(t){const i=t.displayName??t.name??"Component",A=Pt.memo(t),f=E=>{const g=re(),u=function(){const T=re(),I=U(d=>Ie(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=U(T=>Ie(T).reconciliation),v=U(T=>Re(T)),S=a.useCallback((T,I)=>{g(Ft("expense_automation_reconcile",T,I))},[g]),m=a.useCallback((T,I)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Uo,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=Co(),m=So(),{isOpen:y}=Io(),r=wt(),B=Ge(),h=re(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:I}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=zt(),Y=(()=>{const c=U(G=>Ie(G)),M=Ge(),{currentSelectedViewFetchState:N,currentSelectedView:j,selectedPeriod:F}=c,Se=Qe(j),X=Qe(N.fetchState),be=a.useCallback(G=>{const K=M.state?.referrer;j==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,G,K??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,G,K??null)),j==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,G,c.missingReceipts.transactions.length,K??null),j==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,K??null),j==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,G,Bo(c.fluxAnalysis),K??null),j==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,G,"draft",c.auditSummary.auditScorePercentage,null,K??null)},[F,c]);return a.useEffect(()=>{X===N.fetchState&&j===Se||N.fetchState!=="Completed"||be(!1)},[j,N.fetchState,Se]),be})(),te=fo(),[O,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,P]=a.useState([]),[V,w]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),ne=a.useCallback(()=>{m(),w(void 0),d(),I()},[d,I,m]),ae=a.useRef(v);a.useEffect(()=>{v===!0&&ae.current===!1&&(m(),w(void 0),d()),ae.current=v},[d,v,m]);const Ee=a.useRef(y);a.useEffect(()=>{y===!0&&Ee.current===!1&&(v&&S(!1),w(void 0),E===!0&&f!==!0&&t?.()),Ee.current=y},[t,y,v,S,f,E]);const oe=E===!0&&f!==!0,$=a.useRef(oe);a.useEffect(()=>{oe&&!$.current&&(v&&S(!1),m(),w(void 0)),$.current=oe},[v,oe,m,S]);const[Ne,Jt]=a.useState(!1),Ye=a.useRef(!1),{selectedTab:Ke}=rt(),{tenantEmailDomain:Nt}=rt(),[_e,He]=a.useState(B.state?.message==="comingFromTransactionDetail"),We=B.state?.message==="comingFromOverview",Yt=ko(),Ve=Be.getSignedInUser(),{useDynamicConfig:Kt,useFeatureGate:ue}=Lt(),{configValue:Ht}=Kt(Eo.enableUncategorizedExpenseCategory),W=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ze}=ue(le.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:me}=ue(le.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=ue(le.isTransactionActivityEnabled),{isFeatureEnabled:Wt}=ue(le.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Zt}=ue(le.isProjectsTransactionsEnabled),Xt=a.useCallback(c=>{const M=qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,M)},[i]),en=U(c=>Va(c,"common")),z=U(c=>Ie(c)),{monthEndCloseChecksView:J,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:se,currentSelectedViewBackgroundRefreshFetchState:tn,currentSelectedViewFetchState:Z,jeSchedules:je,reconciliation:nn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||Q(void 0)},[x,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==se&&(ve.current=se,x==="transaction_categorization"&&Q(void 0)):ve.current=se},[x,se,Q]);const an=U(c=>V==null?void 0:ja(c.transactionState,V)),ce=an?.qboId,on=U(c=>ce==null?void 0:Oa(c,ce));a.useEffect(()=>{ce!=null&&h(Ma(ce))},[h,ce]);const{selectedAccountId:he}=nn,et=Qe(je.accountSettingsView.saveState.fetchState),sn=U(c=>La(c.accountState,c.accountListState,"accountList")),cn=U(c=>za(c)),pe=Ke!=null?Qa(Ke):x,ln=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Qt({isDataReady:Z.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ge=Ue(tt.start),Ce=Ue(tt.end);if(ge==null||Ce==null)throw Error(`Invalid start - ${ge} and end - ${Ce} period from given ${D}`);const rn=a.useCallback(()=>{l(!1)},[]),dn=a.useCallback(()=>{p(!0)},[]),un=a.useCallback(c=>{P(c),p(!1)},[]),mn=a.useCallback(()=>{P([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{me===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(Mt({cacheOverride:!0}))},[me,x,ye,nt,h]);const at=Ve?.userId,hn=D.month,pn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&me!==!1&&ye==="idle"&&at!=null&&ot!=null&&h($a())},[x,me,ye,at,ot,hn,pn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{pe!=null&&x!==pe&&h(jt(pe))},[pe]),a.useEffect(()=>{Ne!==!1||Z.fetchState!=="Completed"&&Z.fetchState!=="Error"||!R||(Jt(!0),h(It(!1,!1,W)))},[Ne,Z,R,W]),a.useEffect(()=>{!We&&R&&(h(It(!1,!1,W)),h(de(D,he,!1,!1)))},[D.month,D.year,R,W]);const st=a.useCallback((c=!1,M=!1)=>{const N={start:ge,end:Ce};switch(x){case"transaction_categorization":h(fe(se,N,c,!_e,void 0,void 0,M,void 0,W)),He(!1);break;case"flux_analysis":h(we(D,c,M,null));break;case"month_end_insights":if(M===!1){const j=new Date(D.year,D.month,0),F=qa(j.toDateString()).format(qt.analytics.YYYYDashMMDashDDFormat);h(Ja(!0,n.companyId,n.tenantId,F)),h(Na(n.companyId,n.tenantId))}break;case"je_schedules":h(Ga(N,M));break;case"missing_receipts":h(Ot(N,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,M));break;default:h(de(D,he,c,M))}},[x,ge,Ce,n.companyId,n.tenantId,se,D,he,_e,He,W]);a.useEffect(()=>{x===pe&&Z.fetchState==="Not-Started"&&R&&st(!0)},[Z,ge,Ce,n.companyId,n.tenantId,R]),a.useEffect(()=>{We||_e||Ye.current||tn.fetchState==="In-Progress"||Z.fetchState!=="Completed"||(Ye.current=!0,st(!0,!0))},[]),a.useEffect(()=>{J.fetchState!=="In-Progress"&&J.fetchState!=="Completed"&&h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[J.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Ya({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{J.fetchState!=="In-Progress"&&J.fetchState==="Completed"&&h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[J.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&he==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(de(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,de,he,D]);const gn=vt();a.useEffect(()=>{const c=(J.monthEndCloseChecks?.monthEndCloseCheckList.find(M=>M.id==="month_end_insights")?.isDisabled??!1)&&!Ze;x!=="month_end_insights"||!c&&J.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,J.monthEndCloseChecks]);const Cn=u===!0?g:A,Sn=u===!0||E===!0,In=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&je.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,je.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:M,currentSelectedView:N})=>{const j=re();let F,Se,X;const be=vt(),G=c.transactionView;let K=()=>{};const{transactions:yn,selectedTransactionId:ie,selectedTransactionLineId:Ae,transactionLocalData:bn}=G;if(N==="transaction_categorization"){const Oe=bn.find(ee=>ee.transactionId===ie),q=yn.find(ee=>ee.id===ie),it=Ae!=null?Oe?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;Se=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Tn=Po(ie,q?.typeOfTransaction);q!=null&&Tn&&(X={id:ie,type:qe(q.typeOfTransaction)}),K=()=>{if(ie!=null&&Ae!=null&&q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===ie)?.transactionReviewLocalData;if(ee!=null&&q.lines!=null&&q.lines.length>0){const Te=ee.lineItemById[Ae];let Me=ee.selectedEntity;if(qn(q)||(Me=Te.selectedEntityLine),Me!=null){const Pn=Me,wn={transactionId:{id:q.id,type:q.type},transaction:q,lineIds:q.lines.map(xn=>xn.id)??[]};j(Je(Pn,Te.amount.amount,wn,!1,!0,be))}}}}}const An=U(Oe=>dt(Oe,void 0,F,Se));return{transactionId:X,onSaveVendor:()=>{j(Gn(X,void 0,!1,!0))},onSaveSuccess:K,onCancel:()=>{X!=null&&j(zn({transactionId:X})),j(Qn()),j($n()),M()},vendorViewDetails:An}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Yt?.loggedInUserRoleMap==null?J.fetchState==="Error"?C.jsx(vo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(xo,{isOpen:k,drawerLeftMargin:new yo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Fo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:un,resetCustomerRequest:mn})})}),ct!=null&&O&&C.jsx(Ao,{isOpen:O,transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}),C.jsx(jo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:ln,entityAutoCompleteView:en},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:me,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:Ze,isUncategorizedExpenseCategoryEnabled:W,isAccountingClassesEnabled:cn,isProjectsTransactionsEnabled:Zt,isCOTEnabled:gn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&V!=null?C.jsx(bo,{activityLogView:on,qboId:ce,onClose:()=>Q(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:sn,onClickCustomerRequest:dn,handleEditClick:rn,tenantEmailDomain:Nt,trackExpenseAutomationTabAnalytics:Y,setActivityLogTransactionId:Q,closeSidePanel:In,openTransactionPanel:i,sidePanelIsOpen:Sn,sidePanelIsFullView:u!==!0&&f,panelContent:Cn,isAiCfoAccessEnabled:T,onAskAiCfoClick:ne,isExpenseAutomationCommentingEnabled:Wt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:u===!0?66:void 0})]})})),Mo=Fe(Dn)`
|
|
22
|
-
display: flex;
|
|
23
|
-
min-height: 100%;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
`;function rs(){return C.jsxs(Fn,{children:[C.jsx(Le,{path:"*",element:C.jsx(Ro,{})}),C.jsx(Le,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Oo,{})}),C.jsx(Le,{path:"*",element:C.jsx(Rn,{})})]})}export{rs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-Cj_tHvtA.js";import{a as r}from"./sentry-pDh2qSl7.js";import{a3 as i,a4 as l,a5 as p,j as b}from"./index-DXfCjMwK.js";import"./mui-CRLIhCCm.js";import f from"./NotFoundScreen-VuNCYuY2.js";import{h as m,g as u}from"./core-Cy60pewc.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]="1c227906-6efc-4ece-9b3c-3dd5d3b61bbc",e._sentryDebugIdIdentifier="sentry-dbid-1c227906-6efc-4ece-9b3c-3dd5d3b61bbc")}catch{}})();const D=()=>{const e=m(),t=u(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=b(t.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:c}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
|