@zeniai/web-app-ui 5.3.72-qa → 5.3.73-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/{AccountMappingScreen-CJvl5JXJ.js → AccountMappingScreen-BMF0Tz3u.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-BUq34KSF.js → ActualMatchingMatchDetailScreen-Rggm2rdO.js} +1 -1
- package/dist/assets/AddressRoutes-BZC_tHw2.js +1 -0
- package/dist/assets/AddressScreen-DFE2TJ9k.js +9 -0
- package/dist/assets/AiCfoScreen-B_p5VtI6.js +22 -0
- package/dist/assets/{AppDrawer-sYdSE7DV.js → AppDrawer-R5VCAsby.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-BZEAdInR.js → BillPayApprovalRoutes-DEnTFgOn.js} +1 -1
- package/dist/assets/{BillPayRoutes-169K6hbL.js → BillPayRoutes-5mL9KAIs.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-qcXHutsr.js +9 -0
- package/dist/assets/CardsAiCfoScreen-Dw7dZ_97.js +14 -0
- package/dist/assets/{ChargeCardRoutes-BwNBtpIG.js → ChargeCardRoutes-C2lrQn9u.js} +6 -6
- package/dist/assets/{CompanyPassportScreen-D45sXsrZ.js → CompanyPassportScreen-DEU4R8qu.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-DVcYkdE2.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-ZpFTwhtd.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BFxNnHJO.js → CustomerOnboardingRoutes-Bf4kkdxH.js} +3 -3
- package/dist/assets/{DashboardRoutes-Co7U6uRf.js → DashboardRoutes-BsfGVh_g.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CpT6ByaT.js → DefaultTenantHome-BIV3jYpV.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CdZcuM7h.js → DomesticWireDetailScreen-DyJdRubn.js} +4 -4
- package/dist/assets/{DrawerScreen-Crjhobh0.js → DrawerScreen-iM0qHGwt.js} +1 -1
- package/dist/assets/EntityDetailRoutes-BZi1PXPE.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-DoAFvlJW.js → ExpenseAutomationRoutes-C_sek1OP.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-BMIapAWv.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CNCXJJC-.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-CH-l5W7V.js → InboxNotificationsProvider-Dho-IKGo.js} +1 -1
- package/dist/assets/InvoicingRoutes-DZfc_GJQ.js +2 -0
- package/dist/assets/{MagicLinkRoutes-D-AUoRWa.js → MagicLinkRoutes-qpf9fu2s.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-BJUai8Da.js +12 -0
- package/dist/assets/{MobileAppDrawer-DfT3Wv4q.js → MobileAppDrawer-OUkc6SS6.js} +1 -1
- package/dist/assets/NotFoundScreen-D6Ewfl9l.js +1 -0
- package/dist/assets/NotificationRoutes-Dq5J6WUt.js +1 -0
- package/dist/assets/OAuthConsentScreen-DZv3rpk0.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DosVgEtp.js +1 -0
- package/dist/assets/{PaymentLinkScreen-OFX6JRL7.js → PaymentLinkScreen-Nf5jY6jx.js} +5 -5
- package/dist/assets/PeopleRoutes-fi0bv8NG.js +22 -0
- package/dist/assets/PerformanceRoutes-d-Ak-y5B.js +1 -0
- package/dist/assets/{Preview-Ch5xsyMl.js → Preview-BkEDyesO.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BnxzdDn6.js → QBOConnectionScreen-3Q-D8A_V.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-KqZCzo-T.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DA2wxNvn.js → ReimbursementApprovalRuleDetailScreen-wJwhX9oS.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DtigAZux.js → ReimbursementRoutes-NsJfERMF.js} +7 -7
- package/dist/assets/{ReportsRoutes-IMfpdgLc.js → ReportsRoutes-BzSGYOeE.js} +1 -1
- package/dist/assets/RewardsRoutes-Dfq5a4nJ.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DVmtIBPW.js → ScheduleDetailsPrepaidExpensesScreen-Ch5YyOE1.js} +5 -5
- package/dist/assets/ScreenRoutes-Ct-XeoIp.js +2 -0
- package/dist/assets/{SettingsRoutes-CPIpAqIx.js → SettingsRoutes-BwbR1Hav.js} +6 -6
- package/dist/assets/SetupPagesScreen-CaUjvNzq.js +29 -0
- package/dist/assets/SignInScreen-lXlYsOPt.js +1 -0
- package/dist/assets/SignOutScreen-D7BxB8Kw.js +9 -0
- package/dist/assets/TaskListScreen-BEbbR5qA.js +9 -0
- package/dist/assets/TaskRoutes-BTpCvY45.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BDtVKFcV.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BWee1nGS.js → TransactionDetailScreen-DqTnN7lb.js} +2 -2
- package/dist/assets/TransactionListRoutes-D95fLm7G.js +1 -0
- package/dist/assets/{TreasuryRoutes-B_J15-lg.js → TreasuryRoutes-933b-w57.js} +6 -6
- package/dist/assets/{VendorsRoutes-5DKAWmAO.js → VendorsRoutes-DNocUq8r.js} +13 -13
- package/dist/assets/WiseConfirmationScreen-D26sFhH6.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C8P1BGhH.js → ZeniAccountRoutes-DqkD5Tj5.js} +11 -11
- package/dist/assets/{ZeniAccountStatementScreen-D7BQE1Xy.js → ZeniAccountStatementScreen-CCsR6oS6.js} +2 -2
- package/dist/assets/{accountMappingHelper-CnG-eRj3.js → accountMappingHelper-BCIxYvce.js} +1 -1
- package/dist/assets/{analytics-DlzSqyvZ.js → analytics-BPoZyeUe.js} +1 -1
- package/dist/assets/{analyticsHelper-BlLXbdz8.js → analyticsHelper-CLRmzZBe.js} +1 -1
- package/dist/assets/{core-D07hD3KT.js → core-DV1n0xnE.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-D3MFRtCF.js → decodeURIComponentSafe-DV_H_U9m.js} +1 -1
- package/dist/assets/{dnd-B-KpYfWT.js → dnd-DhK11Cna.js} +1 -1
- package/dist/assets/{empty-DRbThjIF.js → empty-CfvnUFQM.js} +1 -1
- package/dist/assets/{empty-aXh7noZx.js → empty-ClI4oFTo.js} +1 -1
- package/dist/assets/{emptyVideoElement-BZocj0UF.js → emptyVideoElement-2jnCmpFX.js} +1 -1
- package/dist/assets/epic-CC17XF7h.js +2 -0
- package/dist/assets/expenseAutomationHelper-DKDAgt14.js +1 -0
- package/dist/assets/{getLocaleForTenant-xajEPLim.js → getLocaleForTenant-DSuDxBKk.js} +1 -1
- package/dist/assets/{index-z9Fh-4S1.js → index-2jvQLAuX.js} +1 -1
- package/dist/assets/{index-YyHAbx34.js → index-BDemtU3L.js} +1 -1
- package/dist/assets/{index-BVdX_ubi.js → index-CNybyuHc.js} +2 -2
- package/dist/assets/{index-BXZoRXDS.js → index-CQb5WoEC.js} +16523 -16600
- package/dist/assets/{index-BIOOl02m.js → index-DPAuplgY.js} +1 -1
- package/dist/assets/{index-54OCX1PW.js → index-MBli9fvW.js} +1 -1
- package/dist/assets/{index-BxmwktwS.js → index-bS-O_x7p.js} +1 -1
- package/dist/assets/{index-D5s14gxd.js → index-dHB9hLbY.js} +1 -1
- package/dist/assets/{lexical-NIxvAmS2.js → lexical-Dm0ggfHI.js} +1 -1
- package/dist/assets/{liveblocks-CQOAuUNI.js → liveblocks-ByZ2hLlh.js} +1 -1
- package/dist/assets/{lottie-BIKpYE12.js → lottie-DLdOGyRC.js} +1 -1
- package/dist/assets/{mui-XiTT8YBC.js → mui-jYJOd_FH.js} +1 -1
- package/dist/assets/{pathToGoBack-RICxbZCJ.js → pathToGoBack-DU0I2V0d.js} +1 -1
- package/dist/assets/{pdf-Dli3mGO_.js → pdf-BNP0Aa3G.js} +4 -4
- package/dist/assets/{pdf-lib-D9XJLVoD.js → pdf-lib-Ghg8u77u.js} +1 -1
- package/dist/assets/{plaid-BG3pJamN.js → plaid-DlHdcMRS.js} +1 -1
- package/dist/assets/{pusher-D9DkHuMx.js → pusher-fCgL3t87.js} +1 -1
- package/dist/assets/{react-CrrxpEIc.js → react-0tUPWmny.js} +1 -1
- package/dist/assets/{react-C1d1ocIu.js → react-BGoKcGI1.js} +1 -1
- package/dist/assets/{react-DkT18Fv5.js → react-BNT2BnLs.js} +1 -1
- package/dist/assets/{react-D2I9LF0A.js → react-BfvxJ9E4.js} +1 -1
- package/dist/assets/{react-BLzCbojr.js → react-Dw9erbfr.js} +1 -1
- package/dist/assets/{react-C-5ZNsBH.js → react-yLaffN1I.js} +1 -1
- package/dist/assets/{recharts-CgYqsGTH.js → recharts-DzomOU1a.js} +1 -1
- package/dist/assets/{routePaths-D5u7Fiee.js → routePaths-BHNMdM_O.js} +1 -1
- package/dist/assets/{sentry-pp_6zWNc.js → sentry-DhrLg200.js} +1 -1
- package/dist/assets/{stripSplatSuffix-DA-gXJ77.js → stripSplatSuffix-vMLM3ll3.js} +1 -1
- package/dist/assets/{url-TK5h7pVR.js → url-C0FnX-Y1.js} +1 -1
- package/dist/assets/{url-yI9BET_f.js → url-DRLt9vS2.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-DkjGGAdb.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-cfyM2Cui.js → useAiCfoDashboardSuggestedQuestionsChips-COl_xk2g.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Dz2Nti66.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-CS7T_ZQN.js → useChargeCardPusherEvents-Cl6UaMMU.js} +1 -1
- package/dist/assets/{useDeviceId-DCPRNX-s.js → useDeviceId-B0EeDKbI.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-ClTbOAmR.js +1 -0
- package/dist/assets/{useInitialThreadRequest-COOzD5oF.js → useInitialThreadRequest-D99s7mit.js} +1 -1
- package/dist/assets/useTaskManagerAccess-B51fCe2G.js +1 -0
- package/dist/assets/{useTaskManagerPusherEvents-D8-vSEDU.js → useTaskManagerPusherEvents-D5Tw9apk.js} +1 -1
- package/dist/assets/{utils-CrOdvv6w.js → utils-CHwCuPu8.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-eLmj1Ps-.js → withTransactionSidePanel-B8yI0Nfh.js} +4 -4
- package/dist/assets/{zeni-epic-state-B3TABHgO.js → zeni-epic-state-Cw9Z8Rxj.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-CRp3rVsa.js +0 -1
- package/dist/assets/AddressScreen-qpYsmNQj.js +0 -9
- package/dist/assets/AiCfoScreen-Cgg6z7vY.js +0 -22
- package/dist/assets/BusinessVerificationPageScreen-Bg2PTPOO.js +0 -9
- package/dist/assets/CardsAiCfoScreen-ClyuumNF.js +0 -14
- package/dist/assets/ConnectionAuthScreen-Ch3SMbL0.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DUAU8WBE.js +0 -1
- package/dist/assets/EntityDetailRoutes-DBE0e8tk.js +0 -1
- package/dist/assets/FeaturePreviewScreen-WjMnw8KV.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Co1Efhtt.js +0 -1
- package/dist/assets/InvoicingRoutes-B-rSWSFX.js +0 -2
- package/dist/assets/MagicLinkSignInScreen-CRDcdldu.js +0 -12
- package/dist/assets/NotFoundScreen-CBsVugJE.js +0 -1
- package/dist/assets/NotificationRoutes-DXLsGRw8.js +0 -1
- package/dist/assets/OAuthConsentScreen-HPHCSEZf.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CFIV5ASt.js +0 -1
- package/dist/assets/PeopleRoutes-DMreo66A.js +0 -22
- package/dist/assets/PerformanceRoutes-BpHHBv6i.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-Di_UQPZB.js +0 -1
- package/dist/assets/RewardsRoutes-QcnfJ0I2.js +0 -1
- package/dist/assets/ScreenRoutes-BLGmNmRV.js +0 -2
- package/dist/assets/SetupPagesScreen-DUwJ2VLm.js +0 -29
- package/dist/assets/SignInScreen-6knrOqTO.js +0 -1
- package/dist/assets/SignOutScreen-Yk4k3uR0.js +0 -9
- package/dist/assets/TaskListScreen-CjEfkJDx.js +0 -9
- package/dist/assets/TaskRoutes-lIMUyAfY.js +0 -9
- package/dist/assets/TransactionDetailRoutes-D7Rn2JsN.js +0 -1
- package/dist/assets/TransactionListRoutes-xPkgCyOq.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Bor5L5ul.js +0 -12
- package/dist/assets/epic-Du2AdUHP.js +0 -2
- package/dist/assets/expenseAutomationHelper-CL7YOVzM.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-9njfwmJo.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C9O3AmSz.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-50p1dphC.js +0 -1
- package/dist/assets/useTaskManagerAccess-Dvad4Vb6.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-CQb5WoEC.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-DhrLg200.js"><link rel="modulepreload" crossorigin href="/assets/core-DV1n0xnE.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-Cw9Z8Rxj.js"><link rel="modulepreload" crossorigin href="/assets/mui-jYJOd_FH.js"><link rel="modulepreload" crossorigin href="/assets/analytics-BPoZyeUe.js"><link rel="modulepreload" crossorigin href="/assets/utils-CHwCuPu8.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/web-app-ui",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.73-dev",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/**/*"
|
|
6
6
|
],
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@sentry/core": "^9.42.1",
|
|
29
29
|
"@sentry/react": "^9.42.1",
|
|
30
30
|
"@stripe/stripe-js": "^4.4.0",
|
|
31
|
-
"@zeniai/client-analytics": "2.0.
|
|
32
|
-
"@zeniai/client-epic-state": "5.2.
|
|
33
|
-
"@zeniai/web-components": "4.4.
|
|
31
|
+
"@zeniai/client-analytics": "2.0.98",
|
|
32
|
+
"@zeniai/client-epic-state": "5.2.73",
|
|
33
|
+
"@zeniai/web-components": "4.4.12",
|
|
34
34
|
"color": "3.1.3",
|
|
35
35
|
"crypto-js": "4.2.0",
|
|
36
36
|
"dnd-core": "^16.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-CQOAuUNI.js";import{A as i}from"./AddressScreen-qpYsmNQj.js";import s from"./NotFoundScreen-CBsVugJE.js";import"./sentry-pp_6zWNc.js";import{n as d,o as r}from"./core-D07hD3KT.js";import"./zeni-epic-state-B3TABHgO.js";import"./recharts-CgYqsGTH.js";import"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="81cbb5c1-1b56-4d87-a240-ae6c03b91825",t._sentryDebugIdIdentifier="sentry-dbid-81cbb5c1-1b56-4d87-a240-ae6c03b91825")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-CQOAuUNI.js";import{a as h}from"./sentry-pp_6zWNc.js";import{h as T,u as P,g as j,i as E,j as B,l as M}from"./core-D07hD3KT.js";import{a1 as $,E as D,z as K,W as L,a7 as V,a8 as U,k as C,U as S,a3 as z,Z as b,a4 as F}from"./index-BXZoRXDS.js";import{Vz as _,is as R,fI as G,VA as N,c9 as O,VB as q,mK as H}from"./zeni-epic-state-B3TABHgO.js";import{n as W}from"./mui-XiTT8YBC.js";import Z from"./NotFoundScreen-CBsVugJE.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b4225413-d381-4779-99a8-3f7ecdc1b821",e._sentryDebugIdIdentifier="sentry-dbid-b4225413-d381-4779-99a8-3f7ecdc1b821")}catch{}})();const J=W.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Q=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=G(e),a=s.roleMap!=null&&N(s.roleMap),d=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=_(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=F(d?.pathnameStackToGoBack);let t=r.poppedPathname??v();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(t=`${t}?${g}`)}o(t,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:a=>{const d=X(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(z);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=P(),r=j(),{addressId:t,addressType:u}=E(),g=$(),w=D(),I=K.getSignedInUser(),[p,k]=h.useState(t==null),f=B((m=>t!=null?_(m,t).fetchState:"Not-Started")),x=L();if(I==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(t!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect((()=>{p||t==null||(k(!0),d(R(t,!1)))}),[p,t,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?n.jsx(V,{fetchState:f,style:{backgroundColor:w.colors.grey5}}):t!=null&&f==="Error"?(a(`${v(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(U,{analytics:C,onLoad:A}),n.jsx(J,{windowSize:g,children:n.jsx(Q,{location:r,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(Z,{})}const v=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{ne as A,X as t};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-CQOAuUNI.js";import{a as n}from"./sentry-pp_6zWNc.js";import{u as Qt,h as Lt,i as Bt,g as Mt,j as v,l as Ft}from"./core-D07hD3KT.js";import{e6 as Vt,a as $t,h as Nt,e7 as Gt,z as Ht,a1 as qt,e8 as zt,e9 as Wt,ea as Yt,bp as Be,eb as We,ec as Jt,bo as Ye,a4 as ge,a8 as ce,k as V,ed as me,ee as Xt,ef as Kt,au as Zt,U as es,w as ts,eg as ss,eh as ns,av as as,ei as os,ej as is,ek as rs,el as ls,p as us,bk as Me,em as ds}from"./index-BXZoRXDS.js";import{fH as F,gw as R,Uh as cs,a2u as ms,a2v as Ss,jP as hs,a2w as ps,jM as fs,a2x as Se,js as J,jV as X,jy as Ie,jf as he,jd as gs,jX as Is,jH as Je,Uq as Fe,gy as $,gN as Cs,Up as ks,Ua as Ve,fI as bs,j6 as vs,a2y as Es,gb as Ps,jo as ys,jk as ws,fJ as pe,gi as xs,a2z as Rs,a2A as Ts,a2B as js,gx as Os,gr as $e,k7 as Ne,gt as Ge,gz as As,a2C as He,jY as _s,jh as Us,jB as Ds,jT as qe,jE as Qs,gA as Ls,gB as Bs,gC as Ms,gD as Fs}from"./zeni-epic-state-B3TABHgO.js";import{D as Vs,n as N,S as $s,P as Ns}from"./mui-XiTT8YBC.js";import{u as Gs}from"./useAiCfoDashboardSuggestedQuestionsChips-cfyM2Cui.js";import{p as Hs}from"./pathToGoBack-RICxbZCJ.js";import{j as qs}from"./routePaths-D5u7Fiee.js";import{u as zs}from"./useTaskManagerPusherEvents-D8-vSEDU.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="b1e120a3-2e68-4be2-af09-8897dfbb5fd3",t._sentryDebugIdIdentifier="sentry-dbid-b1e120a3-2e68-4be2-af09-8897dfbb5fd3")}catch{}})();const Ws=["claimed","running","succeeded","failed","timeout"],fe=t=>typeof t=="string"&&t!=="",Xe="chat-response-generated";function Ys(t,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const h=R(t).skills.find((s=>s.macroId===r.savedMacroId));return h==null?void 0:{status:"saved",command:h.name}}const Js=Ft((function(t,r){const h=F(t),s=r.isSubmitting,d=h.uiState?.currentChatSessionId,l=d!=null?xs(t.aiCfoState,d):[],i=ns(t,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),g=Rs(t),p=Ts(t),f=js(t);return{showSampleQuestions:r.sessionFromUrl==="explore"&&h.uiState.currentChatSessionId==null,aiCfoView:h,isSubmitting:s,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${as}/tableDownload`,exportDownloadEndPoint:rs(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:R(t).skills,skillSaveState:Ys(t,f),skillsEnabled:R(t).skillsEnabled,skillsList:R(t).skills,skillsListError:R(t).fetchState==="Error",skillsListLoading:R(t).fetchState==="In-Progress",skillsCanPublish:R(t).canPublish,skillSaving:f.fetchState==="In-Progress",skillSaveError:f.fetchState==="Error",skillVersionHistory:g.macroId!=null?{macroId:g.macroId,versions:g.versions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillRestoreBody:p.macroId!=null&&p.version!=null?{macroId:p.macroId,version:p.version,instructions:p.instructions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillDetail:X(t).detail,skillDetailError:X(t).fetchState==="Error",skillDetailLoading:X(t).fetchState==="In-Progress",syntheticAnswers:l,resolveSyntheticAnswerCardTile:is(t),resolveSyntheticAnswerPolicyTile:os(t),...i}}),(function(t,r){const{location:h,currentTenant:s,userId:d,navigate:l,currentChatSessionId:i,allSessionsWithOrderedQuestionAnswers:g,isAiCardCreationEnabled:p,isCardPolicyEnabled:f,setIsAiCfoOpen:L}=r,B=s.tenantEmailDomain;return{onEventReceived:(a,o)=>{if(a===Xe&&typeof o.text=="string"&&typeof o.metadata=="object"){const c=o,j=Ls(c.type),E=c.metadata.chat_session_id??null,{currentChatSession:O,currentQuestionAnswer:G,currentQuestionAnswerSummary:A}=Ye(g,E);j!=="answer"?V.trackAICFOChatResponseGenerated(j,G?.question.questionText??"",c.text,E,ds(A,O),c.metadata.message_id??null):V.trackAICFOChatAnswerGenerated(c.text,G?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,Bs(c.visualization?.type??"")??null,E,c.summarized_title,c.metadata.message_id??null),t(Ms({chatSessionId:c.metadata.chat_session_id,responseType:j,fetchState:{fetchState:"Completed",error:void 0}})),t(Fs({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:d}))}},onSubmit:(a,o,c,j,E)=>{a&&Me(t,a,o,i,g,d,j,c,void 0,E)},onFetchSkills:()=>{t(Je())},onOpenSkill:a=>{t(Ie({macroId:a})),t(Qs({macroId:a}))},onSaveSkill:(a,o)=>{t(qe({draft:a,macroId:o}))},onSaveSkillDraft:a=>{const o=a.displayName?.trim()??"",c=a.name?.trim()??"";t(qe({draft:{name:o.length>0?o:c,description:a.description?.trim()??null,instructions:a.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(a,o)=>{t(Ds({macroId:a,version:o}))},onDeleteSkill:a=>{t(Us({macroId:a}))},onSetSkillVisibility:(a,o)=>{t(_s({macroId:a,visibility:o}))},onCloseSkillDetail:()=>{t(He())},onRunSkill:(a,o)=>{t($()),t($e()),Me(t,o,"user_input",void 0,g,d,void 0,void 0,void 0,a),t(He())},updateCurrentInput:a=>{t(Ge(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(As(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{l(-1)},onCloseClick:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??Hs(1);l(o,{state:{...h.state,pathnameStackToGoBack:a.newStack}}),t(Ge(""))},togglePageView:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??`/${s.tenantEmailDomain}/dashboard`;l(o,{state:{...We(h.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),L(!0)},onCopy:()=>{},onThumbsUp:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ne(i,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ne(i,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{l(-1)},onNewChatClick:()=>{t($()),i!=null&&t($e());const a=us(h.state?.pathnameStackToGoBack,h.pathname);l(`/${s.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,o)=>{t(Os({questionAnswerId:a,isCollapsed:o}))},onMenuClick:r.onMenuClick,...ls(t,{isAiCardCreationEnabled:p,isCardPolicyEnabled:f,currentChatSessionId:i,onAfterCardsCreationSubmit:()=>{L(!0),l(`/${B}/cards`,{state:{...h.state}})},onAfterCardPolicySubmit:()=>{L(!0),l(`/${B}/cards/policy`,{state:{...h.state}})}})}}))(ts(ss)),bn=({isFileUploadEnabled:t})=>{const r=Vt(),{setIsAiCfoOpen:h}=$t(),s=Qt(),d=Lt(),{session_id:l}=Bt(),i=Mt(),g=new URLSearchParams(i.search).get("routine")??void 0,[p,f]=n.useState(!1),L=v((e=>F(e).uiState.isSkillsBrowserOpen===!0)),B=v((e=>R(e).skillsEnabled)),a=v((e=>F(e).uiState.isRoutinesBrowserOpen===!0)),o=v((e=>cs(e))),c=v((e=>ms(e))),j=v((e=>Ss(e))),[E,O]=n.useState(void 0),[G,A]=n.useState(!1),[Ke,Ce]=n.useState(void 0),Ze=n.useCallback((()=>{Ce(void 0),O(void 0),A(!0)}),[]),et=n.useCallback((e=>{O(e),A(!0)}),[]),tt=n.useCallback((()=>{O(void 0),A(!1)}),[]),st=n.useCallback((e=>{s(hs({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),O(void 0),A(!1)}),[s,E]),P=g,ke=o.routines.find((e=>e.scheduleId===P)),C=v((e=>ps(e))),nt=n.useCallback((e=>{s(fs({scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{s(P!=null?J({scheduleId:P}):Se())}),[s,P]);const M=ke?.macroId,at=v((e=>X(e))),be=M!=null&&M!==""&&at.fetchState==="Not-Started";n.useEffect((()=>{be&&M!=null&&s(Ie({macroId:M}))}),[s,be,M]);const ot=v((e=>F(e).uiState.currentChatSessionId))??l,k=o.routines.find((e=>e.scheduleId===g))??o.routines.find((e=>e.scheduleId===Nt(ot))),T=k?.scheduleId??null,[ve,it]=n.useState(!0);n.useEffect((()=>{T!=null&&s(J({scheduleId:T}))}),[s,T]);const Ee=C.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;n.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{s(J({scheduleId:P})),s(he())}),5e3);return()=>window.clearInterval(e)}),[s,Ee,P]);const rt=n.useCallback((e=>{Ce(e),O(void 0),A(!0)}),[]),lt=n.useCallback((e=>{s(gs({scheduleId:e.scheduleId}))}),[s]),ut=n.useCallback(((e,m)=>{s(Is({enabled:m,scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{a&&s(he())}),[s,a]);const Pe=v((e=>R(e).skills)),K=n.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),dt=n.useCallback((e=>{s(Ie({macroId:e}))}),[s]),Z=n.useCallback((()=>{s(Je()),s(Fe())}),[s]),ct=n.useCallback((()=>{s($())}),[s]),{allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,onCardPolicyVendorSearchTextChange:pt}=Gt();n.useEffect((()=>{s(Cs())}),[s]);const I=v((e=>F(e))),w=Ht.getSignedInUser();n.useEffect((()=>l==="routines"?(s($()),void s(ks())):l==="skills"?(s(Se()),s(Ve()),void s(Fe())):(T==null&&s(Se()),s(Ve()),void s($()))),[s,T,g,l]);const ft=qt(),_=Zt(ft),b=v((e=>bs(e))),u=I.uiState.currentChatSessionId,y=b.tenantEmailDomain,Q=y!=null&&y!=="",ee=n.useCallback((e=>{Q&&d(`/${y}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[Q,d,y]),te=n.useCallback((()=>{Q&&d(`/${y}/ai-cfo/routines`)}),[Q,d,y]),se=n.useCallback(((e,m)=>{const U=e.sessionId??C.sessionId;U!=null&&Q&&d(`/${y}/ai-cfo/${U}?routine=${encodeURIComponent(m)}`)}),[Q,d,C.sessionId,y]),gt=n.useMemo((()=>k==null?void 0:{error:C.fetchState==="Error",kind:"routineRuns",loading:C.fetchState==="In-Progress"||C.fetchState==="Not-Started",routineName:k.name,schedule:zt(k),skillName:k.isAdHoc===!0?void 0:K.find((e=>e.macroId===k.macroId))?.name,onOpenSkill:k.isAdHoc===!0?void 0:Z,runs:C.runs,tzName:k.tzName,unreadCount:k.unreadRuns,open:ve,onToggle:()=>it((e=>!e)),onOpenRun:e=>se(e,k.scheduleId),onOpenRoutine:()=>ee(k),onOpenRoutines:te}),[Z,te,ee,se,ve,k,C.fetchState,C.runs,K]),{handleUploadPromoClose:It,isUploadPromoVisible:Ct}=Wt({isFileUploadEnabled:t,tenantEmailDomain:y}),ne=Yt({currentTenant:b,currentChatSessionId:u,aiCfoView:I,skillsEnabled:B,onCloseSkills:ct,onOpenSkills:Z}),{isSuggestedQuestionsLoading:kt,suggestedPromptQuestions:bt}=Gs(),H=i.state,q=H?.aiCfoInitialQuestion,ye=!!H?.aiCfoShouldSubmit;n.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;f(!0);const m={...e};delete m[Be],d(i,{replace:!0,state:m})}),[i.pathname,i.search,i.state,d]);const[vt,ae]=n.useState(null),[Et,oe]=n.useState(!1),[Pt,ie]=n.useState(void 0),[yt,re]=n.useState(void 0),we=n.useRef(!1);n.useEffect((()=>{if(!we.current&&q!=null&&q!==""){const e=i.state;ae(q),oe(ye),ie(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const m=e?.aiCfoSuggestionIndex;re(typeof m=="number"?m:void 0),we.current=!0}}),[q,ye,i.state]);const wt=n.useCallback((()=>{ae(null),oe(!1),ie(void 0),re(void 0),d(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,d]),xe=n.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??H?.aiCfoRef,le=xe.get("emailRefId")??H?.aiCfoEmailRefId,Te=n.useRef(!1);n.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||w==null||(s(vs("controller",w.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,s,w]);const z=I.uiState.lastContextMessage;n.useEffect((()=>{z!=null&&z!==""&&u!=null&&(ae(z),oe(!0),ie(void 0),re(void 0),s(Es()))}),[z,u,s]);const xt=b.masterTOSInfo,x=xt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Jt(u),W=I.fetchState,Y=I.uiState.chatSessionsNextPageToken.hasMore||!I.uiState.chatSessionsFirstPageFetched,Oe=u!=null?I.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(I.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),_e=I.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Rt}=Ye(_e,u),Tt=Rt.length===0;n.useEffect((()=>{x||_||d("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,_,d,i.state]);const jt=n.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),m=b.tenantEmailDomain;d(e.poppedPathname??(m!=null?`/${m}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[b.tenantEmailDomain,i.state,d]),Ue=n.useRef(void 0),De=n.useRef(void 0);n.useEffect((()=>{const e=l!==Ue.current,m=u!==De.current;Ue.current=l,De.current=u,l!==u&&(!e||l==null||qs(l)?m&&u!=null&&d(`../ai-cfo/${u}`,{state:{...i.state}}):s(Ps({sessionId:l,agentId:"controller"})))}),[u,l]);const Ot=n.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Xe}`)),eventCallback:(e,m,U)=>U.onEventReceived(e,m)})),[je]);n.useEffect((()=>{W!=="In-Progress"&&Y&&s(ys())}),[W,Y,s]),n.useEffect((()=>{u!=null&&Oe!=="In-Progress"&&Ae&&w!=null&&(l===u||W==="Completed"&&!Y)&&s(ws(u,w.userId))}),[Oe,W,Ae,Y,u,w,l,s]);const ue=w?.userId,At=n.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),Qe=n.useCallback((e=>{const m=e!=null&&(e===P||e===T);(a||m)&&s(he()),m&&s(J({scheduleId:e}))}),[s,a,T,P]);zs({events:At,onSubscribed:()=>Qe(P??T),onEvent:(e,m)=>{const U=(de=>{if(de==null||typeof de!="object")return null;const D=de;return fe(D.schedule_id)&&fe(D.run_id)?{scheduleId:D.schedule_id,runId:D.run_id,status:Ws.find((Dt=>Dt===D.status))??null,finishedAt:fe(D.finished_at)?D.finished_at:null}:null})(m);U!=null&&Qe(U.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(w==null||l==null)throw Error("Can't access AI Controller page without signing in...");const _t=u!=null&&I.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&_)return S.jsxs(Ks,{children:[S.jsx(ce,{analytics:V,onLoad:Le}),ne.drawerElement,S.jsx(Zs,{children:S.jsx(ze,{children:S.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:jt,onCompleteClick:()=>{b.userRoleId!=null&&s(pe(b.userRoleId))}})})})]});const Ut=S.jsxs(S.Fragment,{children:[p&&!x?S.jsx(ce,{analytics:V,onLoad:Le}):null,S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>f(!1):void 0,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})]});return S.jsxs(S.Fragment,{children:[S.jsxs(Xs,{children:[S.jsx(ce,{analytics:V,onLoad:e=>e.trackPageLoaded(es.Event.aiCFOPage)}),_&&ne.drawerElement,S.jsx(Js,{answerExportEndPoint:r,...Ot,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:_e,allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,openOnboardingPage:()=>f(!0),userId:w.userId,setIsAiCfoOpen:h,navigate:d,sessionFromUrl:l,location:i,isSubmitting:_t,isEmptyChatWithSession:Tt,currentTenant:b,emailLinkQuestion:vt??void 0,autoSubmitEmailLinkQuestion:Et,onEmailLinkQuestionProcessed:wt,routedInitialQuestionSource:Pt,routedInitialQuestionSuggestionIndex:yt,onCardPolicyVendorSearchTextChange:pt,onMenuClick:_?ne.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:Ct,onUploadPromoClose:It,exploreSuggestedPromptQuestions:bt,exploreSuggestedPromptQuestionsLoading:kt,isSkillsOpen:L,isRoutinesOpen:a,routineCanCreate:j,routineEditing:E,routineEditorOpen:G,routineListError:o.fetchState==="Error",routineListLoading:o.fetchState==="In-Progress",routineMaxRoutines:o.maxRoutines,routineSaveError:c.fetchState==="Error",routineSaving:c.fetchState==="In-Progress",routineSchedulableSkills:K,routines:o.routines,onRoutineCreate:Ze,onRoutineDelete:lt,routineHistoryError:C.fetchState==="Error",routineHistoryLoading:C.fetchState==="In-Progress",chatSidePanel:gt,routineDetail:ke,routineRunningScheduleId:c.runningScheduleId,routineRuns:C.runs,onRoutineEdit:et,onRoutineOpenRun:(e,m)=>se(m,e.scheduleId),onRoutineRun:nt,onRoutineCloseDetail:te,onRoutineDraft:rt,routineDraftPrompt:Ke,onRoutineOpenDetail:ee,onRoutineEditorCancel:tt,onRoutineLoadSkillInstructions:dt,onRoutineSave:st,onRoutineSetEnabled:ut,isCreateSkillEnabled:B,promoDismissalScope:y}),p&&_?S.jsx(Vs,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:en,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:S.jsx(ze,{onClick:e=>e.stopPropagation(),children:S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})})}):null]}),p&&!_?S.jsx(Xt,{open:p,onClose:()=>f(!1),children:S.jsx(Kt,{children:Ut})}):null]})},ze=N($s)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,Xs=N.div`
|
|
6
|
-
height: 100vh;
|
|
7
|
-
width: 100%;
|
|
8
|
-
`,Ks=N.div`
|
|
9
|
-
height: 100vh;
|
|
10
|
-
width: 100%;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
min-height: 0;
|
|
14
|
-
`,Zs=N.div`
|
|
15
|
-
flex: 1;
|
|
16
|
-
min-height: 0;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
`,en=N(Ns)`
|
|
20
|
-
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
21
|
-
color: ${({theme:t})=>t.colors.grey4};
|
|
22
|
-
`;export{bn as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as C}from"./sentry-pp_6zWNc.js";import{u as q,j as b,h as se,g as oe,i as ie,N as re,l as ce}from"./core-D07hD3KT.js";import{fI as z,HM as ue,H_ as de,La as pe,O0 as le,OG as me,Pv as fe,Zl as ye,BL as Se,Sw as ge,Zm as Ie,Zn as be,Zo as he,Zp as Te,Zq as De,Zr as Oe,VA as Ce,Yr as ke,VP as Ve,Mm as Ae,Me as we,VQ as Ne,Mi as Fe,mK as ve,gJ as _e,gI as xe,gH as Be,v1 as Ee,uU as ze,uR as Pe,mC as Re,BU as Ue,BS as P,bF as R,C4 as U,cF as Me}from"./zeni-epic-state-B3TABHgO.js";import{bT as Le,W as Ze,H as je,bi as Ge,z as E,a8 as qe,k as M,q as x,U as B,bV as Ke,ae as He,p as L,aG as Z}from"./index-BXZoRXDS.js";import{n as We}from"./mui-XiTT8YBC.js";import{j as A}from"./liveblocks-CQOAuUNI.js";import{d as j}from"./routePaths-D5u7Fiee.js";import{M as $e}from"./MobileAppDrawer-DfT3Wv4q.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]="ea400840-e33f-4060-bedc-8d81cfbe5e30",e._sentryDebugIdIdentifier="sentry-dbid-ea400840-e33f-4060-bedc-8d81cfbe5e30")}catch{}})();function it(){const e=q(),r=b((u=>z(u))),a=r?.tenantId,{isApprovalRulesV3Enabled:s,isLoading:p}=Le(a),l=b((u=>u.billPaySetupApproverViewState.fetchState));C.useEffect((()=>{a==null||p||l==="Not-Started"&&e(ue(!0,!0,s))}),[a,p,s,l,e])}function G(e,r,a,s=!1){switch(r){case"zeni_accounts":e(fe(a,!0,s));break;case"zeni_treasury":e(me(a,!0,s));break;case"reimbursement":e(le(a,!0,s));break;case"charge_cards":e(pe(a,!0,s));break;default:e(de(a,!0,s))}}const Je=We.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Qe=ce((function(e,r){const{businessVerificationDetails:a}=r,s=z(e),p=E.getSignedInUser(),l=s.tenantId,u={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:l??""},h=Ce(r.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=ke(e.companyConfigState),o=Ve(e.userRoleConfigState);return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${He.fileMicroServiceBaseUrl}`,authParams:u,isDisabled:h,allIndustries:t.companyIndustries??[],companyTitles:o.companyTitles}}),(function(e,r){const{companyId:a,productType:s,currentTenant:p,navigate:l,location:u}=r,{tenantEmailDomain:h}=p;return{onCompanyDetailsChanged:t=>{const{companyDescription:o,companyIndustry:m,companyIndustryType:k,companyLegalName:V,companyTaxId:y,companyWebsite:f,companyPhone:S,primaryContactEmail:d,primaryContactName:i,primaryContactUserId:T,primaryContactSyncToken:D,syncToken:c,fileIds:O,incDate:n,typeOfIncorporation:g,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:I,companySourceOfFunds:K,companySourceOfFundsDescription:H,transactionVolume:W,transactionVolumeDescription:$,purposeOfAccount:J,purposeOfAccountDescription:Q,regulatedStatus:Y,regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te}=t,v=k?.selectedOption,ae={companyId:a,companyDescription:o,companyIndustry:m.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:V,taxIdOrEIN:y,website:f!=""&&f!=null?Me(f):void 0,phone:S,syncToken:c,fileIds:O,incDate:n!=null?R(n?.toString()):n,typeOfIncorporation:g?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:I?.selectedOptions.map((_=>_.length===2?_:Z(_)))??[],companySourceOfFunds:K?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:Y??"",regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te?.selectedOptions??[]},ne={userId:T,firstName:i.firstName,lastName:i.lastName,email:d,syncToken:D};e(U({companyDetails:ae,primaryContactDetails:ne}))},onCompanyOfficerUpdated:t=>{const o=t.map((m=>{const{officerType:k,userId:V,name:y,email:f,nationalityCountryCode:S,ssn:d,dob:i,phone:T,syncToken:D,selectDocument:c,role:O,ownership:n,isSelectedForVerification:g,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=m;let I;return c.selectDocumentType==="driverLicense"?I="driving_license":c.selectDocumentType==="passport"?I="passport":c.selectDocumentType==="stateId"?I="id_document":c.selectDocumentType==="ssnCard"&&(I="social_security_card"),{officerType:k,userId:V,firstName:y.firstName,lastName:y.lastName,email:f,ssn:d,nationalityCountryCode:S?.selectedOption!=null?Z(S.selectedOption):void 0,phone:T,birthday:i!=null?R(i?.toString()):i,syncToken:D,titleAtCompany:O.selectedOption,ownershipInCompany:n,documentTypeSelectedForVerification:I,isSelectedForVerification:g,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(U({officers:o}))},onSaveDetailsClick:t=>{e(P(a,t,s))},onSendForVerificationClick:t=>{e(P(a,t,s,!0))},onAddressClick:t=>{const o=j(h,t),m=L(u.state?.pathnameStackToGoBack,u.pathname);l(o,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:t=>{const o=j(h,t),m=L(u.state?.pathnameStackToGoBack,u.pathname);l(o,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{e(Ue({companyId:a})),l("../setup")},updateFilesEntity:t=>{e(Re({files:t}))},onDeleteFile:t=>{e(Pe(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,o)=>{e(Ee(t,o.split(".")[0]))},onGetOtp:t=>{e(Be(t,"SpendManagementSetup"))},onResendOtp:t=>{e(xe(t,"SpendManagementSetup"))},onVerifyOtp:(t,o)=>{e(_e(t,o,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,o)=>{e(ve({addressType:t,addressToCreate:o}))},onIdentityDocumentUploadedForAutofill:t=>{if(a==null)return;const o=Ne(t.documentType);o!=null&&e(Fe({target:"setup",companyId:a,officerType:t.officerType,fileId:t.fileId,documentType:o}))},onCompanyDocumentUploadedForAutofill:t=>{a!=null&&e(we({target:"setup",companyId:a,fileId:t.fileId,documentType:t.documentType}))},onResetKycKybClick:()=>{e(Ae())}}}))(Ke),rt=({productType:e})=>{const r=se(),a=oe(),s=q(),[p,l]=C.useState(!1),[u,h]=C.useState(!1),{tenantEmailDomain:t}=ie(),o=Ze(),{useDynamicConfig:m}=je(),{configValue:k}=m(Ge.zeniAccountsConfig),V=ye(k),y=b((n=>{switch(e){case"zeni_accounts":return n.zeniAccountSetupViewState.fetchState;case"reimbursement":return n.remiSetupViewState.fetchState;case"charge_cards":return n.chargeCardSetupViewState.fetchState;case"zeni_treasury":return n.treasurySetupViewState.fetchState;default:return n.billPaySetupViewState.fetchState}})),f=b((n=>n.companyConfigState.fetchState)),S=b((n=>n.userRoleConfigState.fetchState)),d=b((n=>z(n))),i=d.companyId??E.getSignedInUserTenant(t)?.companyId;C.useEffect((()=>{f==="Not-Started"&&s(Se()),S==="Not-Started"&&s(ge(!0))}),[f,S,s]),C.useEffect((()=>{p||y!=="Not-Started"||i==null||(l(!0),G(s,e,i))}),[p,y,i,s]);const T=b((n=>{switch(e){case"zeni_accounts":return De(n,i);case"zeni_treasury":return Te(n,i);case"charge_cards":return he(n,i);case"reimbursement":return be(n,i);default:return Ie(n,i)}})),D=T.kycKybResetStatus.fetchState;if(C.useEffect((()=>{D==="Completed"&&i!=null&&(G(s,e,i,!0),s(Oe()))}),[D,i,e,s]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let c;switch(e){case"zeni_accounts":c=d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":c=d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":c=d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":c=d.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:c=d.companyBillPayInfo?.info?.isBillPayTOSAccepted}const O=n=>{h(n)};return c===!1?A.jsx(re,{to:"../promo"}):A.jsxs(Je,{children:[A.jsx(qe,{analytics:M,onLoad:n=>(g=>{switch(e){case"zeni_accounts":return g.trackPageLoaded(B.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return g.trackPageLoaded(B.Event.reimbursementBusinessVerification);default:return g.trackPageLoaded(B.Event.billPayBusinessVerification,x(a)?"Settings":void 0)}})(n)}),x(a)?A.jsx($e,{isAppContentDrawerOpen:u,handleDrawerToggle:O}):null,A.jsx(Qe,{businessVerificationDetails:T,navigate:r,location:a,companyId:i,analytics:M,currentTenant:d,productType:e,isSettings:x(a),roleMap:o?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:V.maxInsuredAmount})]})};export{rt as B,G as d,it as u};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-CQOAuUNI.js";import{a as r}from"./sentry-pp_6zWNc.js";import{u as he,h as Ce,g as fe,j as H,i as ge,l as Se}from"./core-D07hD3KT.js";import{e6 as be,a as Pe,e7 as ye,z as Ie,e9 as we,eb as W,ec as Ee,bo as G,a8 as ke,k as j,ed as M,en as xe,G as Ae,U as Te,w as Ue,eg as Oe,eh as _e,av as ve,ek as Qe,el as De,bk as Fe,em as je}from"./index-BXZoRXDS.js";import{gN as $e,fH as J,fI as Le,gb as Ve,jo as Re,jk as qe,fJ as N,gx as Be,gr as He,gt as z,gz as Me,gA as Ne,gB as ze,gC as We,gD as Ge}from"./zeni-epic-state-B3TABHgO.js";import{D as Je,n as L,P as Ye,S as Ke}from"./mui-XiTT8YBC.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.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]="4c210313-73c1-4cd0-aad3-b644d4c6b189",t._sentryDebugIdIdentifier="sentry-dbid-4c210313-73c1-4cd0-aad3-b644d4c6b189")}catch{}})();const Y="chat-response-generated",K="cards/ask",X="card_policy_hero";function $(t){return`/${t}/cards`}function Z(t){return`/${t}/cards/policy`}const Xe=Se((function(t,s){const d=J(t),l=s.isSubmitting,u=_e(t,{allUsers:s.allUsers,onCardPolicyVendorSearchTextChange:s.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:s.sessionFromUrl==="new_chat"&&d.uiState.currentChatSessionId==null,aiCfoView:d,isSubmitting:l,isNewChatSession:s.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${ve}/tableDownload`,exportDownloadEndPoint:Qe(),emailLinkQuestion:s.emailLinkQuestion,autoSubmitEmailLinkQuestion:s.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:s.onEmailLinkQuestionProcessed,isFileUploadEnabled:s.isFileUploadEnabled,isUploadPromoVisible:s.isUploadPromoVisible,onUploadPromoClose:s.onUploadPromoClose,...u}}),(function(t,s){const{location:d,currentTenant:l,userId:u,navigate:o,currentChatSessionId:P,allSessionsWithOrderedQuestionAnswers:C,isAiCardCreationEnabled:x,isCardPolicyEnabled:A,cardPolicyPageContext:T}=s,f=l.tenantEmailDomain,c=d.state?.referrer,h=c===X?Z(f):$(f);return{onEventReceived:(a,n)=>{if(a===Y&&typeof n.text=="string"&&typeof n.metadata=="object"){const e=n,m=Ne(e.type),y=e.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:b,currentQuestionAnswerSummary:p}=G(C,y);m!=="answer"?j.trackAICFOChatResponseGenerated(m,b?.question.questionText??"",e.text,y,je(p,U),e.metadata.message_id??null):j.trackAICFOChatAnswerGenerated(e.text,b?.question.questionText??"",(e.follow_up_questions?.length??0)>0,!!e.assumptions,!!e.insights,e.visualization!=null,ze(e.visualization?.type??"")??null,y,e.summarized_title,e.metadata.message_id??null),t(We({chatSessionId:e.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),t(Ge({chatSessionId:e.metadata.chat_session_id,answerPayload:e,userId:u}))}},onSubmit:(a,n,e,m)=>{a&&Fe(t,a,n,P,C,u,m,e,T)},updateCurrentInput:a=>{t(z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(Me(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{o(-1)},onCloseClick:()=>{o(h,{state:{...d.state}}),t(z(""))},togglePageView:()=>{o(h,{state:W(d.state)}),s.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{o(-1)},onNewChatClick:()=>{P!=null&&t(He()),o((function(a){return`/${a}/${K}`})(f),{state:{...d.state}})},onToggleCotCollapsed:(a,n)=>{t(Be({questionAnswerId:a,isCollapsed:n}))},...De(t,{isAiCardCreationEnabled:x,isCardPolicyEnabled:A,currentChatSessionId:P,onAfterCardsCreationSubmit:()=>{s.setIsAiCfoOpen(!0),o($(f),{state:{...d.state}})},onAfterCardPolicySubmit:()=>{s.setIsAiCfoOpen(!0),o(`/${f}/cards/policy`,{state:{...d.state}})}})}}))(Ue(Oe)),{spendManagement:{chargeCard:{cardsAiCfoHero:ee,cardPolicyAiCfoHero:te}}}=Ae.getLocalizedStrings(),k=ee.pageTitle,Ze=te.pageTitle,et=ee.chatHeaderSubtitle,tt=te.chatHeaderSubtitle,Pt=({isFileUploadEnabled:t})=>{const s=be(),{setIsAiCfoOpen:d}=Pe(),l=he(),u=Ce(),o=fe(),[P,C]=r.useState(!1),{allUsers:x,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:f}=ye();r.useEffect((()=>{l($e())}),[l]);const c=H((i=>J(i))),h=Ie.getSignedInUser(),{session_id:a}=ge(),n=H((i=>Le(i))),e=c.uiState.currentChatSessionId,m=n.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:U}=we({isFileUploadEnabled:t,tenantEmailDomain:m}),b=o.state,p=b?.aiCfoInitialQuestion??null,O=!!b?.aiCfoShouldSubmit,I=b?.referrer===X,se=I?"card_policy":void 0,ae=r.useMemo((()=>({title:I?Ze:k,subtitle:I?tt:et})),[I]),[oe,_]=r.useState(null),[ne,v]=r.useState(!1),Q=r.useRef(!1);r.useEffect((()=>{Q.current||p==null||p===""||(_(p),v(O),Q.current=!0)}),[p,O]);const ie=r.useCallback((()=>{_(null),v(!1),u(o.pathname,{replace:!0,state:W(o.state)})}),[o.pathname,o.state,u]),re=n.masterTOSInfo,g=re?.isMasterTOSAccepted??!1,E=r.useRef(null);r.useEffect((()=>{if(g&&E.current!=null){const{question:i,shouldSubmit:w}=E.current;E.current=null,_(i),v(w),Q.current=!1}}),[g]);const{visitedSessions:V}=Ee(e),D=c.fetchState,F=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,R=e!=null?c.fetchChatSessionHistoryByChatSessionId?.[e]?.fetchState??"Not-Started":"Not-Started",q=e==null||(c.uiState.chatHistoryNextPageToken[e]?.hasMore??!0),B=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:le}=G(B,e),de=le.length===0;r.useEffect((()=>{e!=null&&a!==e&&u((function(i,w){return`/${i}/${K}/${w}`})(m,e),{state:{...o.state},replace:!0})}),[e,a,m,u,o.state]),r.useEffect((()=>{a!=null&&e==null&&a!=="new_chat"&&l(Ve({sessionId:a,agentId:"controller"}))}),[]);const ce=r.useMemo((()=>({events:V.map((i=>`private-encrypted-chat-${i}.${Y}`)),eventCallback:(i,w,pe)=>pe.onEventReceived(i,w)})),[V]);if(r.useEffect((()=>{D!=="In-Progress"&&F&&l(Re())}),[D,F,l]),r.useEffect((()=>{e!=null&&R!=="In-Progress"&&q&&h!=null&&D==="Completed"&&!F&&l(qe(e,h.userId))}),[R,q,e,h,l]),h==null)throw Error("Can't access Cards AI CFO page without signing in...");const ue=a??"new_chat",me=e!=null&&c.responseStateByChatSessionId?.[e]?.answer?.fetchState==="In-Progress";return S.jsxs(at,{children:[S.jsx(ke,{analytics:j,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),g?S.jsx(Xe,{answerExportEndPoint:s,...ce,currentChatSessionId:e,allSessionsWithOrderedQuestionAnswers:B,allUsers:x,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,openOnboardingPage:()=>C(!0),userId:h.userId,setIsAiCfoOpen:d,navigate:u,sessionFromUrl:ue,location:o,isSubmitting:me,isEmptyChatWithSession:de,customPageTitle:k,chatHeader:ae,currentTenant:n,emailLinkQuestion:oe??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:ie,isFileUploadEnabled:t,isUploadPromoVisible:U,onUploadPromoClose:y,onCardPolicyVendorSearchTextChange:f,cardPolicyPageContext:se}):S.jsx(M,{isTOSAccepted:g,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:k,onCloseClick:()=>{u(I?Z(m):$(m),{state:{...o.state}})},onCompleteClick:()=>{g||n.userRoleId==null||(p!=null&&p!==""&&(E.current={question:p,shouldSubmit:O}),l(N(n.userRoleId)))}}),S.jsx(Je,{anchor:"right",open:P,transitionDuration:250,PaperProps:{component:ot,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>C(!1),children:S.jsx(st,{onClick:i=>i.stopPropagation(),children:S.jsx(M,{isTOSAccepted:g,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:k,onCloseClick:()=>C(!1),onCompleteClick:()=>{g||n.userRoleId==null||l(N(n.userRoleId)),C(!1)}})})})]})},st=L(Ke)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,at=L.div`
|
|
6
|
-
flex: 1 1 auto;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
min-height: 0;
|
|
10
|
-
width: 100%;
|
|
11
|
-
`,ot=L(Ye)`
|
|
12
|
-
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
13
|
-
color: ${({theme:t})=>t.colors.grey4};
|
|
14
|
-
`;export{Pt as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-CQOAuUNI.js";import{a as o}from"./sentry-pp_6zWNc.js";import{u as F,h as R,g as H,j as C,N as w}from"./core-D07hD3KT.js";import{U5 as q,fI as z,go as G,pV as V,gP as U,gn as Q,gl as B,Uv as J,gk as A}from"./zeni-epic-state-B3TABHgO.js";import{u as K,z as E,L as D,G as M,N as W}from"./index-BXZoRXDS.js";import{n as X}from"./mui-XiTT8YBC.js";import{P as h,a as T}from"./AccountMappingScreen-CJvl5JXJ.js";import{t as Y}from"./getLocaleForTenant-xajEPLim.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-BnxzdDn6.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./MobileAppDrawer-DfT3Wv4q.js";import"./InboxNotificationsProvider-CH-l5W7V.js";import"./useTaskManagerAccess-Dvad4Vb6.js";import"./accountMappingHelper-CnG-eRj3.js";import"./empty-DRbThjIF.js";import"./pdf-lib-D9XJLVoD.js";import"./index-D5s14gxd.js";import"./url-TK5h7pVR.js";import"./index-z9Fh-4S1.js";import"./decodeURIComponentSafe-D3MFRtCF.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]="efa2a614-00e1-4012-a1b1-58014dbfd98e",t._sentryDebugIdIdentifier="sentry-dbid-efa2a614-00e1-4012-a1b1-58014dbfd98e")}catch{}})();const te=X.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex: 1 1 auto;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100vh;
|
|
9
|
-
background-color: ${t=>t.theme.colors.background};
|
|
10
|
-
box-shadow: ${t=>`0px 2px ${W.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function we(){const t=F(),i=R(),_=H(),{setLoading:m,clearAllLoading:c}=K(),S=o.useRef(!1),b=o.useRef(!1),N=o.useRef(!1),p=o.useRef(!1),{code:O,realmId:$,state:L}=Z(_.search),f=O!==""&&$!==""&&L!=="";f&&(N.current=!0);const j=sessionStorage.getItem(h),u=j===T.pending,P=j===T.ready,x=C((s=>q(s))),e=C((s=>z(s))),n=C((s=>s.tenantState.fetchState)),r=C((s=>s.tenantState.activeTenantFetchState.fetchState)),a=E.getSignedInUser(),g=E.getActiveTenantForUser()?.tenantId,l=e?.externalConnections?.fetchState,d=e?.externalConnections?.saveConnectionState,y=e.externalConnections?.accounting[0]?.isValid;o.useLayoutEffect((()=>{m(D.CONNECTION_AUTH)}),[m]),o.useEffect((()=>{S.current||a==null||g==null||(S.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(m(D.TENANT_FETCHING),t(G(a.userId,g))))}),[S,n,m]),o.useEffect((()=>{e.tenantId==null&&!b.current&&a!=null&&(b.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(V(a.userId)))}),[b,n,r]),o.useEffect((()=>{a==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||d!=="Error"||(m(D.CONNECTION_AUTH),t(U(a.userId,e.tenantId)))}),[d]),o.useEffect((()=>{n!=="Completed"&&r!=="Completed"||a==null||e?.tenantId==null||(t(Q(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),B(a?.userId,a?.zeniSessionId,e.tenantId),M.updateAppLocaleID(Y(J(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||a==null||e==null||t(U(a.userId,e.tenantId)))}),[n,r,l]),o.useEffect((()=>{x.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&E.saveSignedInUserTenants(x.tenantsCoreDetailsInOrder)}),[x.tenantsCoreDetailsInOrder.length,n]);const v=e==null||n!=="Completed"&&r!=="Completed"||l!=="Completed";if(o.useEffect((()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||l!=="Completed"&&l!=="Error"||c()}),[n,r,l]),o.useEffect((()=>{u&&d==="In-Progress"&&(p.current=!0)}),[u,d]),o.useEffect((()=>{if(!u||v)return;const s=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return p.current&&d==="Completed"?(sessionStorage.setItem(h,T.ready),c(),void i(s,{replace:!0})):p.current&&d==="Error"?(sessionStorage.removeItem(h),t(A({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),c(),void i(s,{replace:!0})):void(f||N.current||p.current||y!==!0||(sessionStorage.removeItem(h),t(A({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),c(),i(s,{replace:!0})))}),[u,v,d,f,y,e.tenantEmailDomain,c,t,i]),v)return null;if(f||y!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const k=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return P?I.jsx(w,{to:k,replace:!0}):I.jsx(w,{to:"/",replace:!0})}export{we as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-CQOAuUNI.js";import{z as m}from"./index-BXZoRXDS.js";import{g as n}from"./QBOConnectionScreen-BnxzdDn6.js";import"./sentry-pp_6zWNc.js";import{g as p,N as a}from"./core-D07hD3KT.js";import"./zeni-epic-state-B3TABHgO.js";import"./recharts-CgYqsGTH.js";import"./mui-XiTT8YBC.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./empty-DRbThjIF.js";import"./pdf-lib-D9XJLVoD.js";import"./index-D5s14gxd.js";import"./url-TK5h7pVR.js";import"./index-z9Fh-4S1.js";import"./decodeURIComponentSafe-D3MFRtCF.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-CQOAuUNI.js";import{a as d}from"./sentry-pp_6zWNc.js";import{h as q,u as A,g as G,i as W,j as l,N as X,l as F,n as N,o as O}from"./core-D07hD3KT.js";import{X7 as _,fI as M,Wo as R,n2 as Y,Sp as I,Xc as $,X1 as z,m2 as V,Sq as S,Wt as H,Wu as J,X3 as K,X2 as L}from"./zeni-epic-state-B3TABHgO.js";import{b8 as Q,k as U,a4 as Z,p as tt}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import{d as k}from"./decodeURIComponentSafe-D3MFRtCF.js";import{w as et}from"./withTransactionSidePanel-eLmj1Ps-.js";import{f as nt,c as at}from"./routePaths-D5u7Fiee.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import"./TransactionDetailScreen-BWee1nGS.js";import"./useInitialThreadRequest-COOzD5oF.js";import"./expenseAutomationHelper-CL7YOVzM.js";import"./stripSplatSuffix-DA-gXJ77.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="7e9d7390-6d6b-413d-870d-cf7440d50964",n._sentryDebugIdIdentifier="sentry-dbid-7e9d7390-6d6b-413d-870d-cf7440d50964")}catch{}})();const ot=F((function(n,t){const e=t.entity,o=$(n,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(n,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:V(n)}}),(function(n,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${at(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?n(K({searchString:e,searchOrigin:"common"})):e.trim().length===0&&n(L("common"))},onAutoCompleteEntity:e=>{const o=nt(e,t.tenantEmailDomain);n(H()),n(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&n(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};n(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),n(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(Q),it=et((function({entityType:n,...t}){const e=q(),o=A(),c=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:w,entityNameEncoded:x}=W(),r=k(w??""),p=k(x??""),u=rt(r,p),j=[r,p].filter((a=>a!=null)),i={name:p,id:r,type:n,zeniId:r,qboId:r},g=l((a=>_(a.customerIncomeState,a.vendorExpenseState,a.trendState,i,"quarter"))),v=l((a=>M(a).company?.companyInfo.firstMonthOfFY??1)),f=l((a=>R(a.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&u===!0&&(T(!0),o(Y(i)))}),[m,u,i]);const E=l((a=>a.trendState.fetchState)),P=f?.selectedPeriod?.timePeriod??g,B=(function(a,y){return a!=null&&y!=null?{startDate:a.startDate,endDate:y?.endDate}:y})(f?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:B,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(X,{to:b(j.length)})})),rt=(n,t)=>t!=null&&t.length>0&&n!=null&&n.length>0,b=(n=2)=>{let t="../";for(let e=0;e<n;e++)t=`${t}../`;return t};function vt({entityType:n}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:n})})})}export{vt as EntityDetailRoutes,vt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-CQOAuUNI.js";import{a as r}from"./sentry-pp_6zWNc.js";import{aw as f,ax as c,r as l,a4 as p}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import m from"./NotFoundScreen-CBsVugJE.js";import{h as b,g as u}from"./core-D07hD3KT.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="aafc30b9-341c-40aa-86a1-bb77a9af613d",a._sentryDebugIdIdentifier="sentry-dbid-aafc30b9-341c-40aa-86a1-bb77a9af613d")}catch{}})();const _=()=>{const a=b(),e=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),i=r.useCallback((()=>{(()=>{const n=p(e.state?.pathnameStackToGoBack),d=n.poppedPathname??k();a(d,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(e.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{_ as F};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./sentry-pp_6zWNc.js";import{u as f,h as l,g as m}from"./core-D07hD3KT.js";import{h$ as p,UL as g,UM as _}from"./zeni-epic-state-B3TABHgO.js";import{u as b,L as h,z as y}from"./index-BXZoRXDS.js";import"./liveblocks-CQOAuUNI.js";import"./recharts-CgYqsGTH.js";import"./mui-XiTT8YBC.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0fdf3891-5c7e-4a9e-b5ea-d15ebfeee038",e._sentryDebugIdIdentifier="sentry-dbid-0fdf3891-5c7e-4a9e-b5ea-d15ebfeee038")}catch{}})();function $(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:c}=b(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{$ as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-CQOAuUNI.js";import{a as r}from"./sentry-pp_6zWNc.js";import{u as L,h as _,i as $,j as k,t as J,l as O,s as q,g as Y,N as V,n as oe,o as x}from"./core-D07hD3KT.js";import{a8 as Xn,k as g,aq as R,U as d,cc as Zn,cd as et,ce as nt,cf as tt,cg as it,ch as ot,ci as at,cj as ct,ck as st,cl as rt,cm as dt,cn as lt,p as X,co as ut,cp as gt,z as W,ae as se,cq as vt,cr as mt,cs as pt,ct as St,cu as ft,cv as It,cw as ht,cx as Ct,cy as kt,cz as Et,W as yt,ai as rn,cA as bt,cB as xt,cC as At,cD as Dt,cE as jt,cF as Lt,cG as _t,cH as Pt,cI as wt,cJ as $t,cK as Ft,t as He,j as _e,cL as Rt,cM as Tt,cN as Ot,cO as Mt,cP as Nt,cQ as Ut,cR as Bt}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import{A as K}from"./AddressScreen-qpYsmNQj.js";import M from"./NotFoundScreen-CBsVugJE.js";import{Z$ as Vt,_0 as Ht,vv as qe,_1 as G,v_ as re,_2 as Pe,_3 as de,wB as be,wI as qt,wM as dn,_4 as we,wF as Qt,ye as Qe,vZ as ze,_5 as ln,wX as xe,_6 as le,w$ as zt,_7 as Kt,_8 as un,x2 as gn,z9 as Gt,_9 as Se,_a as Ke,_b as vn,vX as Wt,_c as Jt,vP as Yt,_d as Xt,yr as Zt,_e as mn,yA as Ge,_f as ei,yx as ni,_g as $e,gk as Fe,_h as te,_i as ie,xh as ti,w3 as We,w8 as pn,w6 as ii,w0 as oi,xa as ai,wa as ci,xj as si,_j as Ae,xs as Sn,xq as fe,xo as ue,xn as ri,_k as fn,yG as Je,_l as di,vY as In,_m as Re,fI as Ie,wj as De,wg as je,wt as hn,ws as Te,wd as li,wm as Cn,wv as ae,VM as kn,v$ as Oe,wq as ui,wr as gi,wp as vi,_n as mi,x0 as pi,wY as En,_o as yn,vJ as Ye,_p as Si,vF as fi,_q as Ii,yM as hi,yQ as Q,yL as Ci,xU as he,_r as ki,_s as bn,yZ as Xe,_t as Ei,yW as yi,_u as xn,xX as bi,xY as H,x$ as xi,_v as An,y9 as Ee,_w as Ai,xi as Dn,Ui as jn,_x as Di,yj as ji,_y as Ln,_z as Li,_A as _i,_B as Pi,zO as wi,_C as $i,_D as _n,z4 as Pn,_E as wn,zM as ye,_F as Fi,zJ as Ri,_G as Ti,_H as Oi,_I as Mi,_J as Ni,_K as Ui,_L as Ze,_M as Bi,ei as Vi,zS as Hi,_N as Me,xC as qi,xx as Qi,_O as ge,xN as $n,xF as ve,xE as zi,xI as Fn,_P as Ki,xD as Gi,_Q as Rn,za as Tn,zB as en,zw as Wi,_R as Ji,zb as Yi,_S as Xi,zC as Zi,zG as eo,_T as Ne,wD as On,zn as no,wE as to,_U as io,_V as Mn,c9 as oo,mv as ao,mw as co,_W as nn,wC as me,go as so,mC as ro,zt as Nn,A2 as lo,zq as Un,v1 as uo,uR as go,hV as vo,UL as tn,UM as mo,Go as Bn,z$ as po,hN as So,zY as fo,_X as Io,_Y as ho,A8 as Co,A7 as ko,_Z as Eo,__ as Vn,A5 as yo,_$ as bo,$0 as xo,yn as Ao,$1 as Do}from"./zeni-epic-state-B3TABHgO.js";import{M as jo}from"./MobileAppDrawer-DfT3Wv4q.js";import{q as pe}from"./QBOConnectionScreen-BnxzdDn6.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./InboxNotificationsProvider-CH-l5W7V.js";import"./useTaskManagerAccess-Dvad4Vb6.js";import"./empty-DRbThjIF.js";import"./pdf-lib-D9XJLVoD.js";import"./index-D5s14gxd.js";import"./url-TK5h7pVR.js";import"./index-z9Fh-4S1.js";import"./decodeURIComponentSafe-D3MFRtCF.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3323183a-ec2e-4284-880c-cf2f2e8b91b4",t._sentryDebugIdIdentifier="sentry-dbid-3323183a-ec2e-4284-880c-cf2f2e8b91b4")}catch{}})();const w=({event:t,isReady:e=!0})=>e?c.jsx(Xn,{analytics:g,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function Lo(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:m,hasMore:p,items:f,nextCursor:I,auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:h}=k(Vt),y=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),D=`/${n??""}/invoicing`,b=r.useCallback(((F,U)=>{const T=Ht(D,F,U,E);T!=null&&(g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{entity:F,entityId:U,fromScreen:"audit_log",toScreen:F}),e(T))}),[E,e,D]);r.useEffect((()=>{const F=setTimeout((()=>u(a)),300);return()=>clearTimeout(F)}),[a]),r.useEffect((()=>{i&&t(qe({filters:y,keepExistingListItems:!1,sort:v}))}),[i,y,v,t]);const A=m==="Not-Started"||m==="In-Progress"&&f.length===0,C=m==="In-Progress"&&f.length>0,j=m==="Completed";return N(m)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingAuditLogPage,isReady:j}),c.jsx(Zn,{auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:h,entries:f,hasMore:p,isLoading:A,isLoadingMore:C,searchValue:a,sortState:l,onEntityLinkClick:b,onLoadMore:()=>{p&&I!=null&&t(qe({cursor:I,filters:y,keepExistingListItems:!0,sort:v}))},onSearchChange:o,onSortChange:S})]})}function Ce(t,e=!1){const n=L(),i=k((s=>G(s).productNextCursor!=null)),a=k((s=>G(s).productNextCursor)),o=k((s=>G(s).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&o!=="Not-Started"||n(re({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&o!=="In-Progress"&&i&&a!=null&&n(re({cursor:a,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,o,i,a])}function Z(t,e,n,i){const[a,o]=r.useState(0),[s,u]=r.useState(!1),l=r.useRef(t);return r.useEffect((()=>{const S=l.current==="In-Progress";l.current=t,t==="Completed"&&S&&n!=null&&(u(!0),i(n))}),[t,n,i]),r.useEffect((()=>{s&&!e&&(u(!1),o((S=>S+1)))}),[s,e]),a}const _o=new Set(["plan"]),Po=O((function(t,e){const{view:n}=e;return{applicableItemOptions:n.applicableItemOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboClassHierarchy:n.qboClassHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,catalogProductLifecycleActionOptions:n.catalogProductLifecycleActionOptions,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,isLoading:e.isLoading,isRunningLifecycleAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",itemId:e.itemId,localData:n.localData,plan:n.plan}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{itemId:i}=e;return{onBack:()=>e.navigate(`${n}/catalog`),onLifecycleAction:i!==""?a=>{i!==""&&(g.trackInvoicingActionClick(d.Event.invoicingCatalogItemLifecycleAction,{action:a,fromScreen:"catalog_item_detail",itemId:i}),t(Qt({action:a,id:i})))}:void 0,onEditChange:a=>{i!==""&&t(we({id:i,localData:a}))},onSaveEdit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemEdited,{itemId:i}),t(dn({id:i}))},onSubFamilyLifecycleAction:(a,o)=>{i!==""&&t(qt({action:o,id:a,parentItemId:i}))}}}))(et);function wo(){const t=L(),e=_(),{item_id:n,tenantEmailDomain:i}=$(),[a]=J(),{areTenantIdsInSync:o}=R(),s=(u=a.get("kind"))!=null&&_o.has(u)?u:"plan";var u;const l=k((y=>Pe(y,n))),{pageFetchState:S}=l,v=S.fetchState;r.useEffect((()=>(t(de({id:n})),()=>{t(de({id:n}))})),[t,n]),r.useEffect((()=>{o&&t(be({id:n,kind:s}))}),[o,n,s,t]);const m=r.useCallback((y=>t(be({cacheOverride:!0,id:y,kind:s}))),[t,s]),p=Z(l.fetchState,l.isFormLoading,n,m),f=v==="Completed"&&!l.isFormLoading;Ce(o,!0);const[I,E]=r.useState(f?n:void 0);r.useEffect((()=>{n!=null&&f&&E(n)}),[n,f]);const h=I!==n&&(v==="Not-Started"||v==="In-Progress"||l.isFormLoading);return N(v)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCatalogItemDetailPage,isReady:f}),c.jsx(Po,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:s,isLoading:h,view:l},p)]})}const $o=new Set(["addon","charge","plan"]),Fo=new Set(["plan"]),Ro=O((function(t,e){const n=Pe(t,e.itemId);return{fieldHelp:n.fieldHelp,qboClassHierarchy:n.qboClassHierarchy,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,applicabilityValues:n.applicabilityValues,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,applicableItemOptions:n.applicableItemOptions,defaultType:e.isEdit?void 0:e.defaultType,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save catalog item.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,pricingModelValues:n.pricingModelValues,prorationValues:n.prorationValues,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,tierTypeValues:n.tierTypeValues}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:a}=e,o=a!=null?`${n}/catalog/${encodeURIComponent(a)}`:`${n}/catalog`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemFormCancelled),t(de({id:a})),e.navigate(`${n}/catalog`)},onChange:s=>{t(we({id:a,localData:s}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemSaved,{mode:i}),t(dn({id:a}))}}}))(nt);function To(){const t=L(),e=_(),{item_id:n,tenantEmailDomain:i}=$(),[a]=J(),{areTenantIdsInSync:o}=R(),s=n!=null,u=a.get("type"),l=u!=null&&$o.has(u)?u:void 0,S=(v=a.get("kind"))!=null&&Fo.has(v)?v:"plan";var v;const m=k((p=>Pe(p,n)));return Ce(o,!0),r.useEffect((()=>{o&&t(be({id:n,kind:S}))}),[o,n,S,t]),r.useEffect((()=>{s||l==null||m.localData.catalogType===l||t(we({localData:{...m.localData,catalogType:l}}))}),[s,l,m.localData?.catalogType,t]),r.useEffect((()=>{if(m.fetchState==="Completed"){const p=m.savedItemId??n,f=p!=null?`/${i}/invoicing/catalog/${encodeURIComponent(p)}`:`/${i}/invoicing/catalog`;e(f),t(de({id:n}))}}),[m.fetchState,m.savedItemId,n,t,e,i]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCatalogItemFormPage}),c.jsx(Ro,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:s,itemId:n})]})}const Oo={addons:"addon",all:"item",charges:"charge",plans:"plan"},Mo=O((function(t,e){const n=G(t),i=e.activeTab==="plans",a=e.activeTab==="all",o=i?n.plans:a?[...n.plans,...n.products]:n.products,s=i||a&&n.fetchState==="In-Progress"?n.fetchState:n.productFetchState.fetchState;return{counts:n.count,countsLoading:n.countsFetchState.fetchState==="Not-Started"||n.countsFetchState.fetchState==="In-Progress",hasMore:i?n.planNextCursor!=null:a&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:s==="Not-Started"||s==="In-Progress"&&o.length===0,isLoadingMore:s==="In-Progress"&&o.length>0,planRows:n.planRows,productRows:n.productRows}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",a=e.activeTab==="all",o=i?e.planNextCursor:e.productNextCursor;return{activeTab:e.activeTab,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTabChange:e.onTabChange,onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const s=Oo[e.activeTab];g.trackInvoicingActionClick(d.Event.invoicingAddCatalogItemClicked,{itemType:s}),e.navigate(`${n}/catalog/new?type=${s}`)},onItemClick:(s,u)=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemRowClicked,{itemId:u}),e.navigate(`${n}/catalog/${encodeURIComponent(u)}`)},onLoadMore:()=>{if(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"catalog",tab:e.activeTab}),a)return e.planNextCursor!=null&&t(ze({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(re({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));o!=null&&t(i?ze({cursor:o,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):re({cursor:o,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(tt);function No(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState("plans"),[l,S]=r.useState(""),[v,m]=r.useState(null),p=r.useMemo((()=>v!=null?{dir:v.direction,field:v.columnKey}:void 0),[v]),f=l.trim()!==""?l.trim():void 0,I=r.useMemo((()=>({search:f,type:"plan"})),[f]),E=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),h=k((j=>G(j))),y=h.planFilters.search,D=h.planSort,b=h.planNextCursor,A=h.productNextCursor,C=h.fetchState==="Completed";return r.useEffect((()=>{const j=setTimeout((()=>S(a)),300);return()=>clearTimeout(j)}),[a]),r.useEffect((()=>{i&&t(Qe({cacheOverride:!1,planFilters:I,productFilters:E,planSort:p,productSort:p}))}),[i,t,I,E,p]),r.useEffect((()=>{i&&(f!==y||p?.field!==D?.field||p?.dir!==D?.dir)&&t(Qe({cacheOverride:!0,planFilters:I,productFilters:E,planSort:p,productSort:p}))}),[y,D,i,t,I,E,f,p]),N(h.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCatalogPage,isReady:C}),c.jsx(Mo,{navigate:e,tenantEmailDomain:n,activeTab:s,searchValue:a,sortState:v,planFilters:I,productFilters:E,sort:p,planNextCursor:b,productNextCursor:A,onSearchChange:o,onTabChange:u,onSortChange:m})]})}const Uo=O((function(t,e){const n=ln(t,e.couponId);return{fieldHelp:n.fieldHelp,applyOnOptions:n.applyOnOptions,discountTypeOptions:n.discountTypeOptions,durationTypeOptions:n.durationTypeOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save coupon.":void 0,isQboConnected:n.isQboConnected,isQboPickerDataLoading:n.isQboPickerDataLoading,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCouponFormCancelled),t(le({id:i})),e.navigate(`${n}/discounts`)},onChange:s=>{t(Kt({id:i,localData:s}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCouponSaved,{mode:a}),t(zt({id:i}))}}}))(it);function Bo(){const t=L(),e=_(),{coupon_id:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),{fetchState:o,savedCouponId:s}=k((u=>ln(u,n)));return r.useEffect((()=>{a&&t(xe({id:n}))}),[a,n,t]),r.useEffect((()=>{if(o==="Completed"){const u=s??n,l=u!=null?`/${i}/invoicing/discounts/${encodeURIComponent(u)}`:`/${i}/invoicing/discounts`;e(l),t(le({id:n}))}}),[o,s,n,t,e,i]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCouponFormPage}),c.jsx(Uo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const Vo=O((function(t){const e=un(t);return{fieldHelp:e.fieldHelp,customers:e.customers,planNames:e.planNames,errorMessage:e.fetchState==="Error"?e.error?.message??"Failed to create invoice. Please try again.":void 0,isSubmitting:e.fetchState==="In-Progress",localData:e.localData,settings:e.settings}}),(function(t){return{dispatch:t}}),(function(t,{dispatch:e},n){const i=`/${n.tenantEmailDomain}/invoicing`;return{...t,onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:a=>{e(vn(a))},onSubmit:()=>{const a=Jt(t.localData);g.trackInvoicingActionClick(d.Event.invoicingInvoiceCreated,{customerId:a.customer_id,lineItemCount:a.line_items?.length}),e(Yt(a))}}}))(at);function Ho(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),[i]=J(),{areTenantIdsInSync:a}=R(),o=i.get("customerId"),s=k((b=>un(b))),u=s.fetchState,l=s.localData,S=s.savedInvoiceId,v=k(gn),m=k((b=>Gt(b))),p=k(Se),f=m.fetchState==="Not-Started"||m.fetchState==="In-Progress"&&v==null,I=p.fetchState==="Not-Started"||p.fetchState==="In-Progress"&&p.customers.length===0,E=f||I,h=m.fetchState==="Completed"&&p.fetchState==="Completed";r.useEffect((()=>(t(Ke()),()=>{t(Ke())})),[t]);const y=r.useRef(!1);r.useEffect((()=>{y.current||o==null||o===""||l.customerId!==""||(y.current=!0,t(vn({...l,customerId:o})))}),[o,l,t]),r.useEffect((()=>{a&&t(Wt({cacheOverride:!1}))}),[a,t]);const D=r.useRef(u);return r.useEffect((()=>{const b=D.current;if(D.current=u,b!=="Completed"&&u==="Completed"){const A=S!=null?`/${n}/invoicing/invoices/${encodeURIComponent(S)}`:`/${n}/invoicing/invoices`;e(A)}}),[u,S,e,n]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCreateInvoicePage,isReady:h}),E?c.jsx(ot,{}):c.jsx(Vo,{navigate:e,tenantEmailDomain:n})]})}const qo=O((function(t,e){const{detailView:n}=e;return{fieldHelp:e.detailView.fieldHelp,creditNote:n.creditNote,creditNoteId:e.creditNoteId,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onBack:()=>e.navigate(`${n}/credits`),onCustomerClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(ct);function Qo(){const t=L(),e=_(),{credit_note_id:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),o=k((u=>Xt(u,n??""))),s=o.fetchState==="Completed";return r.useEffect((()=>{a&&n!=null&&t(Zt({id:n}))}),[a,n,t]),N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCreditDetailPage,isReady:s}),c.jsx(qo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:o})]})}const zo=O((function(t){const e=mn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",creditNotes:e.creditNotes,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.creditNotes.length===0,isLoadingMore:n==="In-Progress"&&e.creditNotes.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"credits",status:e.activeStatus}),t(ni({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(st);function Ko(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,creditNoteListFetchState:h}=k((D=>{const b=mn(D);return{activeStatus:b.activeTab,appliedSearch:b.filters.search,appliedSort:b.sort,nextCursor:b.nextCursor,creditNoteListFetchState:b.fetchState}}),q),y=h==="Completed";return r.useEffect((()=>{const D=setTimeout((()=>u(a)),300);return()=>clearTimeout(D)}),[a]),r.useEffect((()=>{i&&t(Ge({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ge({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCreditsListPage,isReady:y}),c.jsx(zo,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,onSearchChange:o,onStatusChange:D=>t(ei(D)),onSortChange:S})]})}const Hn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Go=O((function(t,e){const{editView:n,hasLoadedRecord:i}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,hasUnsavedBillingAddress:n.hasUnsavedBillingAddress,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:!i&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),hasPaymentLinkEmailPreviewFailed:n.emailPreviewFetchState.fetchState==="Error",isPaymentLinkEmailPreviewLoading:n.emailPreviewFetchState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",paymentLinkEmailPreview:n.emailPreview,isSendingPaymentLink:n.record.sendLinkState.fetchState==="In-Progress",localData:n.localData,paymentMethods:n.record.paymentMethods,sendPaymentLinkErrorMessage:n.record.sendLinkState.fetchState==="Error"?n.record.sendLinkState.error?.message??"Failed to send payment link.":void 0,sentPaymentLinkEmail:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkEmail:void 0,sentPaymentLinkMagicUrl:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkMagicUrl:void 0,stripeConnected:n.record.stripeConnected}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e;return{onBack:()=>e.navigate(`${n}/customers`),onChange:a=>{t(Ae({id:i,localData:a}))},onCreateInvoice:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customer_detail"}),e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onCreatePromotionalCredits:()=>{g.trackInvoicingActionClick(d.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customer_detail"}),e.onCreatePromotionalCredits()},onNewSubscription:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customer_detail"}),e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`)},onDiscardEdit:()=>{t(fe(ue)),t(ri({id:i}))},onOpenAddress:()=>{const a=Hn(e.tenantEmailDomain??"",ue,i),o=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(a,{state:{pathnameStackToGoBack:o}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:a=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerEdited,{customerId:i}),t(Ae({id:i,localData:a})),t(Sn({id:i}))},onFetchPaymentLinkEmailPreview:a=>t(si({cacheOverride:a,customerId:i})),onSendPaymentLink:(a,o,s)=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentLinkSent,{customerId:i,fromScreen:"customer_detail"}),t(ci({body:s,customerId:i,email:a,subject:o}))},onSubscriptionClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)}}}))(lt);function Wo(){const t=L(),e=_(),n=Y(),{customer_id:i,tenantEmailDomain:a}=$(),{areTenantIdsInSync:o}=R(),s=k((T=>$e(T,i))),u=s.pageFetchState.fetchState,l=u==="Completed"&&!s.isFormLoading,[S,v]=r.useState(!1),[m,p]=r.useState(!1),[f,I]=r.useState(l?i:void 0);r.useEffect((()=>{i!=null&&l&&I(i)}),[i,l]);const E=f===i,{plaidTokenFetchState:h,promotionalCreditSubmitState:y}=s,{paymentMethodSaveState:D,setupIntentFetchState:b,stripeConnected:A}=s.record,C=r.useRef(s.record.sendLinkState.fetchState);r.useEffect((()=>{const T=s.record.sendLinkState.fetchState;C.current!=="Error"&&T==="Error"&&t(Fe({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),C.current=T}),[t,s.record.sendLinkState.fetchState]);const j=b.fetchState==="Error"?b.error?.message??"Failed to start card setup.":D.fetchState==="Error"?D.error?.message??"Failed to save payment method.":h.fetchState==="Error"?h.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(te()),t(ie()),()=>{t(te()),t(ie())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(p(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{o&&i!=null&&t(ti({id:i}))}),[o,i,t]),r.useEffect((()=>{o&&i!=null&&A&&t(We({customerId:i}))}),[o,i,t,A]);const F=r.useCallback((T=>t(pn({id:T}))),[t]),U=Z(s.fetchState,s.isFormLoading,i,F);return N(u)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCustomerDetailPage,isReady:l}),c.jsx(Go,{customerId:i??"",editView:s,hasLoadedRecord:E,location:n,navigate:e,tenantEmailDomain:a,onAddPaymentMethod:()=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentMethodAddClicked,{customerId:i??"",fromScreen:"customer_detail"}),t(te()),i!=null&&A&&t(We({customerId:i})),v(!0)},onCreatePromotionalCredits:()=>{t(ie()),p(!0)}},U),c.jsx(rt,{errorMessage:j,isCreatingSetupIntent:b.fetchState==="In-Progress",isSaving:D.fetchState==="In-Progress",open:S,plaidLinkToken:s.record.plaidLinkToken,saveSucceeded:D.fetchState==="Completed",setupIntent:s.record.setupIntent,stripeConnected:A,onChooseCard:()=>{i!=null&&t(oi({customerId:i}))},onClose:()=>{v(!1),t(te())},onSavePaymentMethod:T=>{i!=null&&(g.trackInvoicingActionClick(d.Event.invoicingPaymentMethodSaved,{customerId:i,fromScreen:"customer_detail"}),t(ii({customerId:i,data:T})))}}),c.jsx(dt,{currentBalance:s.record.invoicingCustomer?.promotionalCredits,currencyCode:s.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:y.fetchState==="Error"?y.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:y.fetchState==="In-Progress",open:m,submitSucceeded:y.fetchState==="Completed",onClose:()=>{p(!1),t(ie())},onSubmit:({amount:T,description:ne})=>{i!=null&&(g.trackInvoicingActionClick(d.Event.invoicingPromotionalCreditsAdded,{amount:T,customerId:i,fromScreen:"customer_detail"}),t(ai({amount:T,customerId:i,currencyCode:s.record.invoicingCustomer?.preferredCurrencyCode,description:ne})))}})]})}const Jo=O((function(t,e){const n=$e(t,e.customerId);return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save customer.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerFormCancelled),t(fn({id:i})),t(fe(ue)),e.navigate(`${n}/customers`)},onChange:s=>{t(Ae({id:i,localData:s}))},onOpenAddress:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddressOpened,{entity:"customer",fromScreen:"customer_form"});const s=Hn(e.tenantEmailDomain??"",ue,i),u=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerSaved,{mode:a}),t(Sn({id:i}))}}}))(ut);function Yo(){const t=L(),e=_(),n=Y(),{customer_id:i,tenantEmailDomain:a}=$(),{areTenantIdsInSync:o}=R(),{fetchState:s,savedCustomerId:u}=k((l=>$e(l,i)));return r.useEffect((()=>{o&&i!=null&&t(pn({id:i}))}),[o,i,t]),r.useEffect((()=>{if(s==="Completed"){const l=u??i,S=l!=null?`/${a}/invoicing/customers/${encodeURIComponent(l)}`:`/${a}/invoicing/customers`;e(S),t(fn({id:i}))}}),[s,u,i,t,e,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCustomerFormPage}),c.jsx(Jo,{customerId:i,location:n,navigate:e,tenantEmailDomain:a})]})}const Xo=O((function(t){const e=Se(t),{fetchState:n}=e;return{addressesById:t.addressState.addressesById,columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",customers:e.customers,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.customers.length===0,isLoadingMore:n==="In-Progress"&&e.customers.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onAddCustomer:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,a)=>{switch(a){case"createInvoice":g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":g.trackInvoicingActionClick(d.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":g.trackInvoicingActionClick(d.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"customers",status:e.activeStatus}),t(In({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(gt);function Zo(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,customerListFetchState:h}=k((D=>{const b=Se(D);return{activeStatus:b.activeTab,appliedSearch:b.filters.search,appliedSort:b.sort,nextCursor:b.nextCursor,customerListFetchState:b.fetchState}}),q),y=h==="Completed";return r.useEffect((()=>{const D=setTimeout((()=>u(a)),300);return()=>clearTimeout(D)}),[a]),r.useEffect((()=>{i&&t(Je({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Je({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingCustomersListPage,isReady:y}),c.jsx(Xo,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,onSearchChange:o,onStatusChange:D=>t(di(D)),onSortChange:S})]})}const Le=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),ea=O((function(t,e){const{authParams:n,csvDownloadUrl:i,filters:a,sessionId:o,view:s}=e,u=o==null?void 0:s.diagnosticsBySession[o],l=u?.fetch.fetchState??"Not-Started";return{authParams:n,csvDownloadUrl:i,diagnostics:u?.items??[],errorMessage:l==="Error"?u?.fetch.error?.message:void 0,expired:u?.expired??!1,filters:a,hasMore:u?.nextCursor!=null,isLoading:l==="Not-Started"||l==="In-Progress",isLoadingMore:l==="In-Progress"&&(u?.items.length??0)>0,session:Le(s,o)}}),(function(t,e){const{filters:n,navigate:i,sessionId:a,tenantEmailDomain:o,view:s}=e,u=a==null?void 0:s.diagnosticsBySession[a],l=Le(s,a),S=s.actionStateByKind.retry?.fetchState==="In-Progress",v=s.actionStateByKind.rollback?.fetchState==="In-Progress",m=l?.status==="done"&&l.rollback_available_until!=null&&new Date(l.rollback_available_until).getTime()>Date.now()&&!v;return{onBack:()=>i(`/${o}/invoicing/data_import`),onDownloadCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"download_csv",fromScreen:"data_import_detail",sessionId:a})},onDownloadError:()=>{t(Fe({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{a!=null&&u?.nextCursor!=null&&t(je({...n,cursor:u.nextCursor,sessionId:a}))},onRetry:l?.status!=="failed"||S?void 0:()=>{a!=null&&(g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"retry",fromScreen:"data_import_detail",sessionId:a}),t(Te(a)))},onRollback:m?()=>{a!=null&&(g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"rollback",fromScreen:"data_import_detail",sessionId:a}),t(hn(a)))}:void 0}}))(vt);function na(){const t=L(),e=_(),{sessionId:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),[o,s]=r.useState({}),u=k(Re),l=k(Ie),S=r.useMemo((()=>{const E=W.getSignedInUser();return{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:l.tenantId}}),[l.tenantId]),v=Le(u,n),m=n==null?void 0:u.diagnosticsBySession[n];r.useEffect((()=>{a&&n!=null&&t(De(n))}),[a,t,n]),r.useEffect((()=>{if(!a||n==null)return;const E=setTimeout((()=>{t(je({...o,sessionId:n}))}),300);return()=>clearTimeout(E)}),[a,t,o,n]);const p=v?.status==="scanning"||v?.status==="importing";r.useEffect((()=>{if(!a||n==null||!p)return;const E=setInterval((()=>{t(De(n)),t(je({...o,sessionId:n}))}),3e3);return()=>clearInterval(E)}),[a,t,o,p,n]);const f=r.useMemo((()=>{if(n==null)return"";const E=new URLSearchParams;o.moduleId!=null&&E.set("module_id",o.moduleId),o.level!=null&&E.set("level",o.level),o.outcome!=null&&E.set("outcome",o.outcome),o.search!=null&&o.search.trim()!==""&&E.set("search",o.search.trim());const h=E.toString();return`${se?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${h===""?"":`?${h}`}`}),[o,n]),I=m?.fetch.fetchState??"Not-Started";return N(I)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDataImportDetailPage,isReady:v!=null&&I!=="Not-Started"}),c.jsx(ea,{authParams:S,csvDownloadUrl:f,filters:o,navigate:e,sessionId:n,tenantEmailDomain:i,view:u,onFiltersChange:s})]})}const qn=t=>`invoicing_active_migration:${t}`,ce=(t,e)=>{if(t!=null&&t!=="")try{const n=qn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},ta=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:a,statusRows:o}=e.view;return{isLoading:!(a.fetchState!=="Not-Started"&&a.fetchState!=="In-Progress"||o.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:o}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,a=o=>{const s=o??null;t(ae(s)),ce(i,s),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"continue",sessionId:o}),a(o)},onNewImport:()=>{g.trackInvoicingActionClick(d.Event.invoicingNewImportClicked),a()},onRetrySession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"retry",sessionId:o}),t(Te(o)),a(o)},onRollbackSession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"rollback",sessionId:o}),t(hn(o))},onViewSession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"view_details",sessionId:o}),n(`/${i}/invoicing/data_import/${encodeURIComponent(o)}`)}}}))(mt);function ia(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),a=k(Re);r.useEffect((()=>{i&&(t(li()),t(Cn()))}),[i,t]);const o=a.statusFetch.fetchState==="Completed"&&a.sessionsFetch.fetchState==="Completed";return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDataImportHubPage,isReady:o}),c.jsx(ta,{navigate:e,tenantEmailDomain:n,view:a})]})}const oa=O((function(t,e){const{activeId:n,authParams:i,integrationsView:a,settings:o,templatesDownloadUrl:s,view:u}=e,{actionStateByKind:l,sessionDetail:S,sessions:v}=u,m=a.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee")),p=n!=null?S[n]:void 0;return{authParams:i,templatesDownloadUrl:s,chargebeeConnected:o?.chargebee_connected===!0||(m?.isValid??!1),chargebeeConnectorAvailable:m!=null,chargebeeSite:o?.chargebee_site,connectError:l.connect?.error?.message,connecting:l.connect?.fetchState==="In-Progress",retrying:l.retry?.fetchState==="In-Progress",session:p??v.find((f=>f.id===n)),starting:l.start?.fetchState==="In-Progress",uploading:l.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:a}=e;return{onBack:e.onBack,onDownloadError:()=>{t(Fe({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onDownloadTemplates:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportTemplatesDownloaded)},onFetchFromChargebee:()=>{g.trackInvoicingActionClick(d.Event.invoicingChargebeeConnectClicked),t(vi())},onGoToIntegrations:()=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"data_import_migrate",toScreen:"settings_integrations"}),i(`/${a}/invoicing/settings`)},onGoToOverview:()=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"data_import_migrate",toScreen:"overview"}),i(`/${a}/invoicing/overview`)},onRetry:()=>{n!=null&&(g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"retry",fromScreen:"data_import_migrate",sessionId:n}),t(Te(n)))},onSaveLater:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportStarted),n!=null&&t(gi(n))},onUpload:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportFileUploaded),t(ui({files:o}))},onViewDetails:n==null?void 0:()=>i(`/${a}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(pt);function aa(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),a=k(gn),o=k(Ie),s=r.useMemo((()=>{const h=W.getSignedInUser();return{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:o.tenantId}}),[o.tenantId]),u=`${se?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/templates`,l=o.companyId??W.getSignedInUserTenant(n??"")?.companyId,S=k((h=>kn(h,l))),v=k(Re),{activeMigrationSessionId:m}=v,p=m??void 0,f=p!=null?v.sessionDetail[p]??v.sessions.find((h=>h.id===p)):void 0;r.useEffect((()=>{i&&(t(Oe()),t(Cn()))}),[i,t]),r.useEffect((()=>{if(m!=null)return;const h=(y=>{if(y==null||y==="")return null;try{return sessionStorage.getItem(qn(y))}catch{return null}})(n);h!=null&&t(ae(h))}),[m,t,n]),r.useEffect((()=>{ce(n,m)}),[m,n]);const I=f?.status,E=I==="scanning"||I==="importing";return r.useEffect((()=>{if(!i||p==null||!E)return;const h=setInterval((()=>{t(De(p))}),3e3);return()=>clearInterval(h)}),[i,p,E,t]),r.useEffect((()=>{I==="done"&&(t(ae(null)),ce(n,null))}),[t,I,n]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDataImportMigratePage}),c.jsx(oa,{activeId:p,authParams:s,integrationsView:S,navigate:e,settings:a,templatesDownloadUrl:u,tenantEmailDomain:n,view:v,onBack:()=>{t(ae(null)),ce(n,null),e(`/${n}/invoicing/data_import`)}})]})}const ca=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,discountsAccountName:n.discountsAccountName,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${n}/discounts`),onLifecycleAction:a=>{g.trackInvoicingActionClick(d.Event.invoicingCouponLifecycleAction,{action:a,couponId:i,fromScreen:"discount_detail",status:e.editView.coupon?.status}),t(En({action:a,id:i}))},onSaveEdit:a=>{g.trackInvoicingActionClick(d.Event.invoicingCouponEdited,{couponId:i}),t(pi({data:a,id:i}))}}}))(St);function sa(){const t=L(),e=_(),{coupon_id:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),o=k((I=>mi(I,n))),s=o.actionState.fetchState==="In-Progress",u=o.pageFetchState.fetchState,l=u==="Completed",[S,v]=r.useState(l?n:void 0);r.useEffect((()=>{n!=null&&l&&v(n)}),[n,l]);const m=S===n;r.useEffect((()=>(t(le({id:n})),()=>{t(le({id:n}))})),[n,t]),r.useEffect((()=>{a&&t(xe({id:n}))}),[a,n,t]);const p=r.useCallback((I=>t(xe({cacheOverride:!0,id:I}))),[t]),f=Z(o.fetchState,o.isFormLoading,n,p);return N(u)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDiscountDetailPage,isReady:l}),c.jsx(ca,{hasLoadedRecord:m,couponId:n??"",discountLifecycleActionOptions:o.discountLifecycleActionOptions,editView:o,isRunningLifecycleAction:s,navigate:e,tenantEmailDomain:i},f)]})}const ra=O((function(t){const e=yn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,discountLifecycleActionOptions:e.discountLifecycleActionOptions,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",coupons:e.coupons,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.coupons.length===0,isLoadingMore:n==="In-Progress"&&e.coupons.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onCouponClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,a)=>{g.trackInvoicingActionClick(d.Event.invoicingCouponLifecycleAction,{action:a,couponId:i,fromScreen:"discounts_list"}),t(En({action:a,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"discounts",status:e.activeStatus}),t(fi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(ft);function da(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,couponListFetchState:h,runningDiscountActionId:y}=k((b=>{const A=yn(b);return{activeStatus:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,couponListFetchState:A.fetchState,runningDiscountActionId:A.runningActionId??null}}),q),D=h==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>u(a)),300);return()=>clearTimeout(b)}),[a]),r.useEffect((()=>{i&&t(Ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ye({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDiscountsListPage,isReady:D}),c.jsx(ra,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,runningDiscountActionId:y,onSearchChange:o,onStatusChange:b=>t(Si(b)),onSortChange:S})]})}const la=O((function(t,e){const{readView:n}=e;return{fieldHelp:e.readView.fieldHelp,caseId:e.caseId,dunningAttempts:e.dunningAttempts,dunningCase:n.dunningCase,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{caseId:i}=e,a=i!=="",{dunningCase:o}=e.readView,s={amount:o?.amount?.amount,caseId:i,customerId:o?.customerID,invoiceId:o?.invoiceID,status:o?.status,subscriptionId:o?.subscriptionID};return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:u=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:u,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(u)}`)},onCancel:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"cancel",fromScreen:"dunning_detail"}),t(Q({action:"cancel",id:i}))}:void 0,onResolve:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"resolve",fromScreen:"dunning_detail"}),t(Q({action:"resolve",id:i}))}:void 0,onResume:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"resume",fromScreen:"dunning_detail"}),t(Q({action:"resume",id:i}))}:void 0,onRetry:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"retry",fromScreen:"dunning_detail"}),t(Q({action:"retry",id:i}))}:void 0}}))(ht);function ua(){const t=L(),e=_(),{case_id:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),o=k((C=>Ii(C,n??""))),s=o.fetchState==="Completed",u=o.dunningCase?.invoiceID,[l,S]=r.useState("idle"),[v,m]=r.useState(!1),[p,f]=r.useState(),[I,E]=r.useState(!1),h=r.useCallback((()=>{S("idle"),m(!1),f(void 0),E(!1)}),[]),y=r.useCallback((()=>{if(n==null)return;t(hi({id:n})),S("idle"),m(!1);const C=o.emailPreview.preview;f(C==null?void 0:{body:C.body,cc:C.cc,subject:C.subject,to:C.to}),E(!0)}),[n,t,o.emailPreview.preview]),D=r.useCallback((C=>{n!=null&&l!=="pending"&&(m(!1),S("pending"),g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{action:"send-email",amount:o.dunningCase?.amount?.amount,caseId:n,customerId:o.dunningCase?.customerID,fromScreen:"dunning_detail",invoiceId:o.dunningCase?.invoiceID,status:o.dunningCase?.status,subscriptionId:o.dunningCase?.subscriptionID}),t(Q({action:"send-email",body:C,id:n})))}),[n,t,l,o.dunningCase]),b=r.useMemo((()=>o.emailPreview.preview==null?void 0:{bodyToken:o.emailPreview.preview.bodyToken,renderedHtmlTemplate:o.emailPreview.preview.renderedHtmlTemplate,subjectToken:o.emailPreview.preview.subjectToken}),[o.emailPreview.preview]);r.useEffect((()=>{a&&n!=null&&t(Ci({id:n}))}),[a,n,t]),r.useEffect((()=>{a&&u!=null&&t(he({invoiceId:u}))}),[a,u,t]),r.useEffect((()=>{S("idle"),m(!1),f(void 0),E(!1)}),[n]),r.useEffect((()=>{a||(S("idle"),m(!1),f(void 0),E(!1))}),[a]),r.useEffect((()=>{I&&p==null&&o.emailPreview.preview!=null&&f({body:o.emailPreview.preview.body,cc:o.emailPreview.preview.cc,subject:o.emailPreview.preview.subject,to:o.emailPreview.preview.to})}),[o.emailPreview.preview,p,I]),r.useEffect((()=>{l==="pending"&&(o.actionState.fetchState!=="In-Progress"?v&&o.actionState.fetchState==="Completed"?(n!=null&&t(ki({id:n})),h()):v&&o.actionState.fetchState==="Error"&&S("failed"):m(!0))}),[n,h,t,l,v,o.actionState.fetchState]);const A=u!=null&&o.linkedInvoice?.id===u?o.linkedInvoice.dunningAttempts:void 0;return N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDunningDetailPage,isReady:s}),c.jsx(la,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:o,dunningAttempts:A,onSendEmail:y}),c.jsx(It,{initialDraft:p,isPreviewLoading:o.emailPreview.fetchState==="Not-Started"||o.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:h,onSend:D,open:I,preview:b,previewErrorMessage:o.emailPreview.fetchState==="Error"?o.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?o.actionState.error?.message:void 0})]})}const ga=O((function(t){const e=bn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",dunningCases:e.dunningCases,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.dunningCases.length===0,isLoadingMore:n==="In-Progress"&&e.dunningCases.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=a=>{const o=e.dunningCases.find((s=>s.id===a));return{amount:o?.amount?.amount,caseId:a,customerId:o?.customerID,fromScreen:"dunning_list",invoiceId:o?.invoiceID,status:o?.status,subscriptionId:o?.subscriptionID}};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>e.navigate(`${n}/data_import`),onDunningCaseClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingDunningCaseRowClicked,i(a)),e.navigate(`${n}/dunning/${encodeURIComponent(a)}`)},onRowAction:(a,o)=>{o!=="retry"&&o!=="resume"&&o!=="resolve"&&o!=="cancel"||(g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...i(a),action:o}),t(Q({action:o,id:a})))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"dunning",status:e.activeStatus}),t(yi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(Ct);function va(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,dunningCaseListFetchState:h,dunningCases:y}=k((b=>{const A=bn(b);return{activeStatus:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,dunningCaseListFetchState:A.fetchState,dunningCases:A.dunningCases}}),q),D=h==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>u(a)),300);return()=>clearTimeout(b)}),[a]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Xe({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDunningListPage,isReady:D}),c.jsx(ga,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,dunningCases:y,nextCursor:E,onSearchChange:o,onStatusChange:b=>t(Ei(b)),onSortChange:S})]})}const ma=O((function(t,e){const{view:n}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:n.billingAddress,invoice:n.invoice,invoiceId:e.invoiceId,shippingAddress:n.shippingAddress,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isSaving:n.actionState.fetchState==="In-Progress",isVoiding:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e,{invoice:a}=e.view,o={amount:a?.total?.amount,customerId:a?.customerID,invoiceId:i,status:a?.status};return{onBack:()=>e.navigate(`${n}/invoices`),onCustomerClick:s=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(s)}`)},onIssueCreditNote:()=>{g.trackInvoicingActionClick(d.Event.invoicingIssueCreditNoteClicked,{...o,fromScreen:"invoice_detail"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{g.trackInvoicingActionClick(d.Event.invoicingRecordPaymentClicked,{...o,fromScreen:"invoice_detail"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceRegenerated,{...o,fromScreen:"invoice_detail"}),t(H({action:"regenerate",invoiceId:i}))},onSaveEdit:s=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceEdited,{...o,fromScreen:"invoice_detail"}),t(xi({data:{due_date:s.due_date!==""?s.due_date:void 0,notes:s.notes.trim()!==""?s.notes.split(`
|
|
2
|
-
`).map((u=>u.trim())).filter((u=>u!=="")).map((u=>({note:u}))):void 0,po_number:s.po_number!==""?s.po_number:null},invoiceId:i}))},onSendReminder:()=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceReminderSent,{...o,fromScreen:"invoice_detail"}),t(H({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:s=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:s,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(s)}`)},onVoid:s=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceVoided,{...o,fromScreen:"invoice_detail"}),t(H({action:"void",invoiceId:i,body:s}))}}}))(kt);function pa(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),o=k((f=>xn(f,n??""))),s=o.pageFetchState.fetchState,u=s==="Completed",[l,S]=r.useState(u?n:void 0);r.useEffect((()=>{n!=null&&u&&S(n)}),[n,u]);const v=l===n;r.useEffect((()=>{a&&n!=null&&t(bi({invoiceId:n}))}),[a,n,t]);const m=r.useCallback((f=>t(he({invoiceId:f}))),[t]),p=Z(o.actionState.fetchState,o.fetchState==="In-Progress",n,m);return N(s)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingInvoiceDetailPage,isReady:u}),c.jsx(ma,{invoiceId:n??"",hasLoadedRecord:v,navigate:e,tenantEmailDomain:i,view:o},p)]})}const Sa=O((function(t){const e=An(t),{fetchState:n}=e;return{counts:e.counts,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,invoices:e.invoices,statusOptions:e.statusOptions,isLoading:n==="Not-Started"||n==="In-Progress"&&e.invoices.length===0,isLoadingMore:n==="In-Progress"&&e.invoices.length>0,kpis:e.kpis,kpisLoading:e.kpisFetchState.fetchState==="Not-Started"||e.kpisFetchState.fetchState==="In-Progress"&&e.kpis==null,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=a=>{const o=e.invoices.find((s=>s.id===a));return{amount:o?.total?.amount,customerId:o?.customerID,fromScreen:"invoices_list",invoiceId:a,status:o?.status}};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onCreateInvoice:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceRowClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onRowAction:(a,o)=>{switch(o){case"recordPayment":g.trackInvoicingActionClick(d.Event.invoicingRecordPaymentClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}/record-payment`);break;case"issueCreditNote":g.trackInvoicingActionClick(d.Event.invoicingIssueCreditNoteClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}/issue-credit-note`);break;case"sendReminder":g.trackInvoicingActionClick(d.Event.invoicingInvoiceReminderSent,i(a)),t(H({action:"send-reminder",invoiceId:a}));break;case"regenerate":g.trackInvoicingActionClick(d.Event.invoicingInvoiceRegenerated,i(a)),t(H({action:"regenerate",invoiceId:a}));break;case"void":g.trackInvoicingActionClick(d.Event.invoicingInvoiceVoided,i(a)),t(H({action:"void",invoiceId:a}))}},onVoidInvoice:(a,o)=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceVoided,i(a)),t(H({action:"void",invoiceId:a,body:o}))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"invoices",status:e.activeStatus}),t(Dn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(Et);function fa(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,invoiceListFetchState:h,voidingInvoiceId:y,invoices:D}=k((A=>{const C=An(A);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:A.invoicingInvoiceListState.sort,nextCursor:C.nextCursor,invoiceListFetchState:C.fetchState,voidingInvoiceId:C.runningActionId,invoices:C.invoices}}),q),b=h==="Completed";return r.useEffect((()=>{const A=setTimeout((()=>u(a)),300);return()=>clearTimeout(A)}),[a]),r.useEffect((()=>{i&&t(Ee({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ee({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingInvoicesListPage,isReady:b}),c.jsx(Sa,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,invoices:D,nextCursor:E,voidingInvoiceId:y,onSearchChange:o,onStatusChange:A=>{t(Ai(A)),t(Ee({cacheOverride:!1,filters:m,sort:v}))},onSortChange:S})]})}function on(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),i=yt(),a=rn(),[o,s]=r.useState(!1),{acceptTermsState:u,status:l}=k(jn),S=Di(i?.loggedInUserRoleMap),v=`/${n}/invoicing`,m=p=>{s(p)};return l==="completed"?c.jsx(V,{to:`${v}/overview`,replace:!0}):l==="settings"&&S?c.jsx(V,{to:`${v}/settings`,replace:!0}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingPromoPage}),c.jsx(jo,{isAppContentDrawerOpen:o,handleDrawerToggle:m}),c.jsx(bt,{analytics:g,isAccepting:u.fetchState==="In-Progress",isReadOnlyUser:!S,meetingUrl:a("invoicing_promo"),onAcceptClick:()=>{g.trackInvoicingActionClick(d.Event.invoicingTermsAccepted),t(ji())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{m(!0)}})]})}const Ia=O((function(t,e){const n=Ln(t,e.invoiceId),{invoice:i,localData:a,reasonCodeOptions:o,submitState:s,typeOptions:u}=n;return{fieldHelp:n.fieldHelp,amountDue:i?.amountDue,currencyCode:i?.currencyCode??"USD",customerName:i?.customerName??"",errorMessage:s.fetchState==="Error"?s.error?.message??"Failed to issue credit note. Please try again.":void 0,invoiceNumber:i?.invoiceNumber??e.invoiceId,isSubmitting:s.fetchState==="In-Progress",localData:a,reasonCodeOptions:o,typeOptions:u}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:a=>{t($i({localData:a}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(wi())}}}))(xt);function ha(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),{fetchState:o,invoice:s,isPageReady:u,issuedCreditNoteId:l,submitState:S}=k((f=>Ln(f,n??""))),v=`/${i}/invoicing`,m=r.useRef(null);r.useEffect((()=>{t(Li()),m.current=null}),[t,n]),r.useEffect((()=>{a&&n!=null&&t(he({invoiceId:n}))}),[a,t,n]),r.useEffect((()=>{s!=null&&n!=null&&o==="Completed"&&m.current!==n&&(m.current=n,t(_i({localData:Pi(s)})))}),[t,o,s,n]);const p=r.useRef(S.fetchState);return r.useEffect((()=>{const f=p.current;p.current=S.fetchState,f!=="Completed"&&S.fetchState==="Completed"&&l!=null&&e(`${v}/credits/${encodeURIComponent(l)}`)}),[l,e,S.fetchState,v]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingIssueCreditNotePage,isReady:u}),c.jsx(Ia,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const Ca=O((function(t){return{invoicingOverview:_n(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{g.trackInvoicingActionClick(d.Event.invoicingOverviewRefreshed),t(Pn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{g.trackInvoicingActionClick(d.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{g.trackInvoicingActionClick(d.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(At);function ka(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a]=r.useState((()=>{const s=new Date;return{month:s.getMonth()+1,year:s.getFullYear()}})),o=k((s=>_n(s).fetchState))==="Completed";return r.useEffect((()=>{i&&t(Pn(a))}),[i,t,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingOverviewPage,isReady:o}),c.jsx(Ca,{navigate:e,selectedPeriod:a,tenantEmailDomain:n})]})}const Ea=O((function(t){const e=wn(t),{fetchState:n}=e;return{columns:e.columns,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.transactions.length===0,isLoadingMore:n==="In-Progress"&&e.transactions.length>0,tabIds:e.tabIds,transactions:e.transactions}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeType:e.activeType,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTypeChange:e.onTypeChange,onViewTransactionCustomer:e.onViewTransactionCustomer,onViewTransactionInvoice:e.onViewTransactionInvoice,onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"payments",tab:e.activeType}),t(Ri({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(Dt);function ya(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeType:p,appliedSearch:f,appliedSort:I,nextCursor:E,transactionListFetchState:h,transactions:y}=k((j=>{const F=wn(j);return{activeType:F.activeTab,appliedSearch:F.filters.search,appliedSort:F.sort,nextCursor:F.nextCursor,transactionListFetchState:F.fetchState,transactions:F.transactions}}),q),D=h==="Completed",b=`/${n}/invoicing`,A=r.useCallback((j=>{const F=y.find((T=>T.id===j)),U=F?.linkedInvoices?.[0]?.invoiceID??F?.invoiceID;U!=null&&(g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${b}/invoices/${encodeURIComponent(U)}`))}),[e,b,y]),C=r.useCallback((j=>{const F=y.find((U=>U.id===j))?.customerID;F!=null&&(g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:F,fromScreen:"payments_list",toScreen:"customer"}),e(`${b}/customers/${encodeURIComponent(F)}`))}),[e,b,y]);return r.useEffect((()=>{const j=setTimeout((()=>u(a)),300);return()=>clearTimeout(j)}),[a]),r.useEffect((()=>{i&&t(ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(ye({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingPaymentsListPage,isReady:D}),c.jsx(Ea,{navigate:e,tenantEmailDomain:n,activeType:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,onSearchChange:o,onTypeChange:j=>{t(Fi(j)),t(ye({cacheOverride:!1,filters:m,sort:v}))},onSortChange:S,onViewTransactionCustomer:C,onViewTransactionInvoice:A})]})}const ba=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id};function an(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=$(),{areTenantIdsInSync:a}=R(),o=n!=null&&n!=="",s=k(Se),u=k((C=>Ti(C))),l=k(Oi),S=k((C=>xn(C,n??""))),v=S.invoice,m=`/${i}/invoicing`,p=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Mi()),p.current=null,f.current=""}),[t,n]),r.useEffect((()=>{a&&t(o&&n!=null?he({invoiceId:n}):In({filters:{},keepExistingListItems:!1}))}),[a,t,n,o]),r.useEffect((()=>{o&&v!=null&&n!=null&&S.fetchState==="Completed"&&p.current!==n&&(p.current=n,t(Ni({contextInvoiceId:n,localData:Ui(v)})))}),[t,v,n,S.fetchState,o]),r.useEffect((()=>{if(o)return;const C=u.localData.customerId;C!==""&&C!==f.current&&(f.current=C,t(Dn({filters:{customerId:C},keepExistingListItems:!1})),u.localData.invoiceToLink!==""&&t(Ze({localData:{...u.localData,customerId:C,invoiceToLink:""}})))}),[t,u.localData,o]);const I=r.useRef(l.fetchState);r.useEffect((()=>{const C=I.current;if(I.current=l.fetchState,C!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${m}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${m}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,m]);const E=r.useMemo((()=>s.customers.map((C=>({id:C.id,name:ba(C)})))),[s.customers]),h=k((C=>Bi(C,u.localData.customerId))),y=r.useMemo((()=>h.map((C=>{return{amountDue:(j=C.amountDue,F=Vi.currencySymbol,_t("0,0.00",j,F)),amountDueValue:C.amountDue,id:C.id,label:C.invoiceNumber};var j,F}))),[h]),D=r.useMemo((()=>{if(!o||v==null)return;const C=v.currencyCode??"USD",j=v.amountDue?.amount??0;return{amountDue:jt("0,0.00",v.amountDue),amountDueValue:j,currencyCode:C,customerName:v.customerName??v.customerID,invoiceId:v.id,invoiceNumber:v.invoiceNumber??v.id}}),[v,o]),b=o?`${m}/invoices/${encodeURIComponent(n??"")}`:`${m}/payments`,A=!o||S.fetchState==="Completed"&&u.localData.invoiceToLink!=="";return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingRecordPaymentPage,isReady:A}),c.jsx(Lt,{customers:E,fieldHelp:u.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:u.gatewayOptions,invoiceContext:D,invoiceOptions:y,isSubmitting:l.fetchState==="In-Progress",localData:u.localData,mode:o?"invoice":"customer",paymentMethodOptions:u.paymentMethodOptions,onBack:()=>{e(b)},onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingRecordPaymentCancelled),e(b)},onChange:C=>{t(Ze({localData:C}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentRecorded,{customerId:u.localData.customerId,invoiceId:o?n:u.localData.invoiceToLink,paymentMethod:u.localData.paymentMethod}),t(Hi(o?n??void 0:void 0))}})]})}const Qn=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},xa=O((function(t,e){const{editView:n}=e,i=n.subscription,a=i?.status,o=a!=null&&e.commercialEditAllowedFromStatuses.includes(a);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.addons,canEditCommercial:o,charges:n.charges,coupons:n.coupons,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),isRunningAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:n.localData,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=="",o=(s,u)=>{const{subscription:l}=e.editView;g.trackInvoicingActionClick(d.Event.invoicingSubscriptionLifecycleAction,{action:s,amount:l?.mrr?.amount,customerId:l?.customerID,fromScreen:"subscription_detail",status:l?.status,subscriptionId:i}),t(Fn({action:s,id:i,body:u}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:s=>{t(ge({id:i,localData:s}))},onChangeTermEnd:a?s=>{const u=s?.trim()??"";u!==""&&o("change_term_end",{term_ends_at:u})}:void 0,onCustomerClick:s=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(s)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(fe(ve)),t(zi({id:i}))},onOpenAddress:()=>{const s=Qn(e.tenantEmailDomain??"",ve,i),u=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:u}})},onViewInvoices:()=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"subscription_detail",subscriptionId:i,toScreen:"invoices"}),e.navigate(`${n}/invoices`)},onSaveEdit:s=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(ge({id:i,localData:s})),t($n({id:i}))},onCancelSubscription:a?s=>{o("cancel",{cancel_reason_code:s.cancelReasonCode,end_of_term:!1,...s.cancelReason!=null&&s.cancelReason.trim()!==""?{cancel_reason:s.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:a?(s,u)=>{s!=="pause"?o(s):o(s,u!=null&&u.trim()!==""?{resume_date:u.trim()}:void 0)}:void 0}}))(Pt);function Aa(){const t=L(),e=_(),n=Y(),{subscription_id:i,tenantEmailDomain:a}=$(),{areTenantIdsInSync:o}=R(),s=k((y=>Me(y,i))),{subscriptionCommercialEditAllowedFromStatuses:u,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:S}=s,v=s.pageFetchState.fetchState,m=v==="Completed"&&!s.isFormLoading,[p,f]=r.useState(m?i:void 0);r.useEffect((()=>{i!=null&&m&&f(i)}),[i,m]);const I=p===i;Ce(o),r.useEffect((()=>{o&&i!=null&&t(qi({id:i}))}),[o,i,t]);const E=r.useCallback((y=>t(Qi({id:y}))),[t]),h=Z(s.fetchState,s.isFormLoading,i,E);return N(v)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingSubscriptionDetailPage,isReady:m}),c.jsx(xa,{hasLoadedRecord:I,commercialEditAllowedFromStatuses:u,editView:s,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:S,navigate:e,subscriptionId:i??"",tenantEmailDomain:a},h)]})}const Da=O((function(t,e){const n=Me(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.addons,charges:n.charges,coupons:n.coupons,customers:n.customers,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=null?"edit":"create";return{onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionFormCancelled),t(Rn({id:i})),t(fe(ve)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:o=>{t(ge({id:i,localData:o}))},onOpenAddress:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddressOpened,{entity:"subscription",fromScreen:"subscription_form"});const o=Qn(e.tenantEmailDomain??"",ve,i),s=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:s}})},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionSaved,{mode:a}),t($n({id:i}))}}}))(wt);function ja(){const t=L(),e=_(),n=Y(),{subscription_id:i,tenantEmailDomain:a}=$(),[o]=J(),{areTenantIdsInSync:s}=R(),u=o.get("customerId"),{fetchState:l,savedSubscriptionId:S}=k((p=>Ki(p,i))),v=k((p=>Me(p,i).localData));Ce(s),r.useEffect((()=>{s&&t(Gi({subscriptionId:i}))}),[s,i,t]);const m=r.useRef(!1);return r.useEffect((()=>{m.current||i!=null||u==null||u===""||v.customerId!==""||(m.current=!0,t(ge({id:i,localData:{...v,customerId:u}})))}),[u,i,v,t]),r.useEffect((()=>{if(l==="Completed"){const p=S??i,f=p!=null?`/${a}/invoicing/subscriptions/${encodeURIComponent(p)}`:`/${a}/invoicing/subscriptions`;e(f),t(Rn({id:i}))}}),[l,S,i,t,e,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingSubscriptionFormPage}),c.jsx(Da,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:a})]})}const La=O((function(t){const e=Tn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.subscriptions.length===0,isLoadingMore:n==="In-Progress"&&e.subscriptions.length>0,cancelReasonCodeOptions:e.cancelReasonCodeOptions,lifecycleActionOptions:e.subscriptionLifecycleActionOptions,subscriptions:e.subscriptions,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=(a,o,s)=>{const u=e.subscriptions.find((l=>l.id===a));g.trackInvoicingActionClick(d.Event.invoicingSubscriptionLifecycleAction,{action:o,amount:u?.mrr?.amount,customerId:u?.customerID,fromScreen:"subscriptions_list",status:u?.status,subscriptionId:a}),t(Fn({action:o,id:a,body:s}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(a,o)=>{const s=o?.trim()??"";s!==""&&i(a,"change_term_end",{term_ends_at:s})},onSubscriptionAction:(a,o,s)=>{o!=="pause"?i(a,o):i(a,o,s!=null&&s.trim()!==""?{resume_date:s.trim()}:void 0)},onCancelSubscription:(a,o)=>{i(a,"cancel",{cancel_reason_code:o.cancelReasonCode,end_of_term:!1,...o.cancelReason!=null&&o.cancelReason.trim()!==""?{cancel_reason:o.cancelReason.trim()}:{}})},onSubscriptionClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionRowClicked,{subscriptionId:a}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"subscriptions",status:e.activeStatus}),t(Yi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))($t);function _a(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,subscriptionListFetchState:h,runningActionSubscriptionId:y,subscriptions:D}=k((C=>{const j=Tn(C);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:j.sort,nextCursor:j.nextCursor,subscriptionListFetchState:j.fetchState,runningActionSubscriptionId:j.runningActionId??null,subscriptions:j.subscriptions}}),q),b=h==="Completed";r.useEffect((()=>{const C=setTimeout((()=>u(a)),300);return()=>clearTimeout(C)}),[a]),r.useEffect((()=>{i&&t(en({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(en({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]);const A=r.useRef(y);return r.useEffect((()=>{const C=A.current!=null&&y==null;A.current=y,C&&i&&t(Wi())}),[y,i,t]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingSubscriptionsListPage,isReady:b}),c.jsx(La,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,runningActionSubscriptionId:y,subscriptions:D,onSearchChange:o,onStatusChange:C=>t(Ji(C)),onSortChange:S})]})}const Pa=O((function(t,e){const{readView:n}=e;return{isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress",transaction:n.transaction,transactionId:e.transactionId}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{transactionId:i}=e;return{onBack:()=>e.navigate(`${n}/payments`),onCustomerClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:a,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(a)}`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onSubscriptionClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onCapture:i!==""?()=>{g.trackInvoicingActionClick(d.Event.invoicingTransactionCaptured,{transactionId:i}),t(eo({action:"capture",id:i}))}:void 0}}))(Ft);function wa(){const t=L(),e=_(),{tenantEmailDomain:n,transaction_id:i}=$(),{areTenantIdsInSync:a}=R(),o=k((u=>Xi(u,i??""))),s=o.fetchState==="Completed";return r.useEffect((()=>{a&&i!=null&&t(Zi({id:i}))}),[a,i,t]),N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingTransactionDetailPage,isReady:s}),c.jsx(Pa,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:o})]})}function zn(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:a=!1}=t,o=L(),{areTenantIdsInSync:s}=R(),u=k(Ne),l=u.connection?.connected===!0,S=u.connectionFetchState.fetchState;return r.useEffect((()=>{e&&s&&(a&&S!=="Not-Started"||o(On()),n&&o(no()))}),[s,o,e,n,a]),r.useEffect((()=>{e&&s&&l&&i&&o(to())}),[s,o,e,l,i]),{isQboConnected:l,qboView:u}}const $a={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function ee(t){const e=L(),{areTenantIdsInSync:n}=R(),{tenantEmailDomain:i}=$(),{fetchState:a,fieldHelp:o,logoFile:s,saveState:u,settings:l,stripeConnectState:S}=k(io),{configError:v,configFetchState:m,dunningScheduleActionOptions:p,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:I,qboSyncStatusOptions:E}=k(Mn),h=k(Ne);zn({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const y=k(Ie),D=t==="dunning"||t==="quickbooks",b=y.companyId??W.getSignedInUserTenant(i??"")?.companyId,A=k((P=>kn(P,b))),C=oo(y.userRole??[]),j=y.tenantId??"",F=W.getSignedInUser(),U={userId:F?.userId??"",sessionId:F?.zeniSessionId??"",tenantId:j},T=s?.fileId,ne=k((P=>T!=null&&T!==""?ao(P,T):void 0)),Ue=k((P=>T!=null&&T!==""?co(P,T):void 0)),Kn=T!=null&&T!==""&&ne!=null?{[T]:ne}:{},Gn=T!=null&&T!==""&&Ue!=null?{[T]:Ue}:{};r.useEffect((()=>(e(nn()),()=>{e(nn())})),[e]),r.useEffect((()=>{n&&(a!=="Not-Started"&&a!=="Error"||e(Oe()))}),[n,e,a]),r.useEffect((()=>{n&&D&&m==="Not-Started"&&e(me())}),[n,e,m,D]),r.useEffect((()=>{if(!n)return;const P=F?.userId;P!=null&&P!==""&&j!==""&&He.shouldFetchActiveTenant(j)&&(He.markActiveTenantFetchStarted(j),e(so(P,j,F?.zeniSessionId)))}),[n,e,F?.userId,F?.zeniSessionId,j]);const Wn=p.length>0||f.length>0,Jn=a==="Not-Started"||a==="In-Progress"&&l==null||D&&!Wn&&(m==="Not-Started"||m==="In-Progress"),Yn=a==="Completed"&&(!D||m==="Completed"),Be=A.externalConnections?.revenue?.find((P=>P.connectionName==="chargebee"))?.connectionId,ke=se?.invoicingMicroServiceBaseUrl,Ve=ke!=null&&ke.length>0?`${ke}/1.0/webhooks/stripe`:"",z={deleteConnectionError:A.externalConnections?.deleteConnectionError?.message,deleteConnectionState:A.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:A,isAdmin:C,isStripeBusy:S.fetchState==="In-Progress",onConnectStripe:P=>{g.trackInvoicingActionClick(d.Event.invoicingStripeConnectClicked,{fromScreen:t??"hub"}),e(fo(P))},onDisconnect:(P,B)=>{j!==""&&(g.trackInvoicingActionClick(d.Event.invoicingIntegrationDisconnected,{entity:B,entityId:P,fromScreen:t??"hub"}),e(So(j,P,tn(B))))},onDisconnectStripe:()=>{g.trackInvoicingActionClick(d.Event.invoicingStripeDisconnected,{fromScreen:t??"hub"}),e(po())},onReconnectQBO:()=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"reconnect",fromScreen:t??"hub"});const P=y.tenantEmailDomain??i??"";pe.init("/connection/auth",P),pe.handleClick()},onRefreshQBO:()=>{A.integrations.refreshQBO.fetchState!=="In-Progress"&&(g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"refresh",fromScreen:t??"hub"}),e(Bn()))},onSaveChargeBeeCredentials:(P,B)=>{Be!=null&&j!==""&&(g.trackInvoicingActionClick(d.Event.invoicingChargebeeCredentialsSaved,{fromScreen:t??"hub"}),e(vo(j,Be,tn("revenue"),mo("chargebee"),{api_key:P,site:B})))},saveChargeBeeError:A.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:A.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:l,stripeError:S.fetchState==="Error"?S.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:Ve};return{authParams:U,deleteFileStatusById:Kn,fieldHelp:o,dunningScheduleActionOptions:p,filesEndPoint:se?.fileMicroServiceBaseUrl??"",integrationsSectionProps:z,isInvoicingPageReady:Yn,isLoading:Jn,isSaving:u.fetchState==="In-Progress",isStripeBusy:S.fetchState==="In-Progress",logoFile:s,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:I,qboSyncStatusOptions:E,qboView:h,saveErrorMessage:u.fetchState==="Error"?u.error?.message??"Failed to save settings.":D&&m==="Error"?v?.message??"Failed to load invoicing configuration.":void 0,settings:l,stripeError:S.fetchState==="Error"?S.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:Ve,updateFileStatusById:Gn,onConnectStripe:z.onConnectStripe,onDeleteFile:P=>{g.trackInvoicingActionClick(d.Event.invoicingLogoRemoved,{fromScreen:t??"hub"}),e(go(P,j))},onDisconnectStripe:z.onDisconnectStripe,onEditFileName:(P,B)=>{g.trackInvoicingActionClick(d.Event.invoicingLogoRenamed,{fromScreen:t??"hub"}),e(uo(P,B.split(".")[0],j))},onReconnectQBO:z.onReconnectQBO,onRefreshQBO:z.onRefreshQBO,onRetryQboSyncTask:P=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"retry_task",entityId:P,fromScreen:t??"hub"}),e(Un(P))},onSave:P=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsSaved,{fieldsChanged:Object.keys(P).filter((B=>JSON.stringify(P[B])!==JSON.stringify(l?.[B]))),tab:t??"hub"}),e(lo({settings:P,snackbarSection:$a[t??""]}))},onStartQboBackfill:P=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"backfill",fromScreen:t??"hub"}),e(Nn(P))},updateFilesEntity:P=>{g.trackInvoicingActionClick(d.Event.invoicingLogoUploaded,{fromScreen:t??"hub"}),e(ro({files:P}))}}}function cn({appContent:t}){const e=_(),n=Y(),i=L(),{tenantEmailDomain:a}=$(),o=ee("branding"),s=k((l=>Io(l)));r.useEffect((()=>{s.saveState.fetchState==="Completed"&&i(ho())}),[s.saveState.fetchState,i]);const u=_e(s.saveState.fetchState);return r.useEffect((()=>{u==="In-Progress"&&s.saveState.fetchState==="Completed"&&e("..")}),[u,s.saveState.fetchState,e]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingBrandingSettingsPage,isReady:o.isInvoicingPageReady}),c.jsx(Rt,{address:s.address,fieldHelp:s.fieldHelp,addressLabel:s.addressLabel,appContent:t,authParams:o.authParams,dateFormatOptions:s.dateFormatOptions,deleteFileStatusById:o.deleteFileStatusById,filesEndPoint:o.filesEndPoint,isLoading:o.isLoading,isSaving:o.isSaving,localData:s.localData,logoFile:o.logoFile,saveErrorMessage:o.saveErrorMessage,settings:o.settings,updateFileStatusById:o.updateFileStatusById,onBackClick:()=>e(".."),onChange:l=>{i(Eo({localData:l}))},onDeleteFile:o.onDeleteFile,onEditFileName:o.onEditFileName,onOpenAddress:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddressOpened,{entity:"branding",fromScreen:"settings_branding"});const l=`/${a}/invoicing/settings/branding/${ko}/`,S=X(n.state?.pathnameStackToGoBack,n.pathname);e(l,{state:{pathnameStackToGoBack:S}})},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsSaved,{tab:"branding"}),i(Co())},updateFilesEntity:o.updateFilesEntity})]})}function Fa(){const t=_(),e=ee("dunning");return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingDunningSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Tt,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Ra(){const t=_(),e=ee("integrations");return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingIntegrationsSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Ot,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Ta(){const t=_(),e=ee("payment-destination");return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingPaymentDestinationSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Mt,{fieldHelp:e.fieldHelp,isLoading:e.isLoading,isStripeBusy:e.isStripeBusy,saveErrorMessage:e.saveErrorMessage,settings:e.settings,stripeError:e.stripeError,stripeWebhookUrl:e.stripeWebhookUrl,onBackClick:()=>t(".."),onConnectStripe:e.onConnectStripe})]})}const Oa=["autoCreateItems","closedPeriodVoidAsCreditMemo","customerMatching","isSyncEnabled","syncStartDate","trackingCategoriesEnabled"],Ma=O((function(t){const e=Vn(t);return{accountMappingKindOptions:e.accountMappingKindOptions,fieldHelp:e.fieldHelp,accounts:e.accounts,connection:e.connection,customerMatchingOptions:e.customerMatchingOptions,isBackfilling:e.backfillState.fetchState==="In-Progress",isLoading:e.isLoading,isSaving:e.saveState.fetchState==="In-Progress",isSyncEnabledSaved:e.isSyncEnabledSaved,localData:e.localData,nestedAccountHierarchy:e.nestedAccountHierarchy,retryFetchStateByTaskId:e.retryFetchStateByTaskId,saveErrorMessage:e.saveState.fetchState==="Error"?e.saveState.error?.message:void 0,syncHealth:e.syncHealth,syncStatusOptions:e.syncStatusOptions}}),(function(t){return{onChange:e=>{t(xo({localData:e}))},onReset:()=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsReset,{tab:"quickbooks"}),t(bo())},onRetryTask:e=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"retry_task",entityId:e,fromScreen:"settings_qbo"}),t(Un(e))},onStartBackfill:e=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"backfill",fromScreen:"settings_qbo"}),t(Nn(e))}}}))(Nt);function Na(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),i=k(Ie),{configFetchState:a,localData:o,savedLocalData:s,saveState:u,settingsFetchState:l}=k(Vn),S=r.useMemo((()=>{return m=o,p=s,[...[...new Set([...Object.keys(m.accountIdByMappingCode),...Object.keys(p.accountIdByMappingCode)])].some((f=>(m.accountIdByMappingCode[f]??"")!==(p.accountIdByMappingCode[f]??"")))?["account_mappings"]:[],...Oa.filter((f=>m[f]!==p[f]))];var m,p}),[o,s]),v=_e(u.fetchState);return r.useEffect((()=>{v==="In-Progress"&&u.fetchState==="Completed"&&e("..")}),[e,v,u.fetchState]),r.useEffect((()=>{l!=="Not-Started"&&l!=="Error"||t(Oe())}),[t,l]),r.useEffect((()=>{a==="Not-Started"&&t(me())}),[a,t]),zn({fetchSyncHealth:!0,loadAccountingPickers:!0}),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingQboSettingsPage}),c.jsx(Ma,{onBackClick:()=>e(".."),onReconnect:()=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"reconnect",fromScreen:"settings_qbo"}),pe.init("/connection/auth",i.tenantEmailDomain??n??""),pe.handleClick()},onRefresh:()=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"refresh",fromScreen:"settings_qbo"}),t(Bn())},onSave:()=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsSaved,{fieldsChanged:S,tab:"quickbooks"}),t(yo())}})]})}const Ua={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function Ba(){const t=rn(),e=L(),n=_(),[i,a]=J(),o=ee(),{canEnableInvoicing:s,isEnablingInvoicing:u,isInvoicingEnabled:l,isQboConfigured:S,isStripeConnected:v}=k(Mn),m=i.get("tab");return r.useEffect((()=>{if(m==null)return;const p=Ua[m];a({},{replace:!0}),p!=null&&n(p,{replace:!0})}),[m,n,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:d.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),c.jsx(Ut,{analytics:g,integrationsSectionProps:{...o.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:u,isLoading:o.isLoading,meetingUrl:t("invoicing_settings"),settings:o.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:s,isQboConfigured:S,isStripePaymentsReady:v,onEnableInvoicingClick:l?void 0:()=>{g.trackInvoicingActionClick(d.Event.invoicingEnableClicked),e(Ao())}})]})}function sn(){return c.jsxs(oe,{children:[c.jsx(x,{index:!0,element:c.jsx(Ba,{})}),c.jsx(x,{path:"payment-destination",element:c.jsx(Ta,{})}),c.jsx(x,{path:"branding",element:c.jsx(cn,{})}),c.jsx(x,{path:"branding/:addressType",element:c.jsx(cn,{appContent:c.jsx(K,{isSubPage:!0,hideAddressBackButton:!0})})}),c.jsx(x,{path:"integrations",element:c.jsx(Ra,{})}),c.jsx(x,{path:"dunning",element:c.jsx(Fa,{})}),c.jsx(x,{path:"quickbooks",element:c.jsx(Na,{})}),c.jsx(x,{path:"*",element:c.jsx(V,{to:"..",replace:!0})})]})}function pc(){const t=L(),e=_(),{tenantEmailDomain:n}=$(),{areTenantIdsInSync:i}=R(),{enableState:a,fetchState:o,status:s}=k(jn),u=_e(a.fetchState),l=`/${n}/invoicing`,S=r.useRef(!1),v=k((m=>Ne(m).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(o!=="Not-Started"?o!=="Error"||S.current||(S.current=!0,t(me({cacheOverride:!1}))):t(me({cacheOverride:!1})))}),[i,t,o]),r.useEffect((()=>{i&&v==="Not-Started"&&t(On())}),[i,t,v]),r.useEffect((()=>{u==="In-Progress"&&a.fetchState==="Completed"&&(e(`${l}/catalog`),t(Do()))}),[u,a.fetchState,l,t,e]),s==null&&o!=="Error"?c.jsx(Bt,{fetchState:"In-Progress"}):s==="not_started"?c.jsxs(oe,{children:[c.jsx(x,{path:"promo",element:c.jsx(on,{})}),c.jsx(x,{path:"*",element:c.jsx(V,{to:`${l}/promo`,replace:!0})})]}):s==="settings"?c.jsxs(oe,{children:[c.jsx(x,{path:"promo",element:c.jsx(on,{})}),c.jsx(x,{path:"settings/*",element:c.jsx(sn,{})}),c.jsx(x,{path:"*",element:c.jsx(V,{to:`${l}/settings`,replace:!0})})]}):c.jsxs(oe,{children:[c.jsx(x,{path:"/",element:c.jsx(V,{to:"overview",replace:!0})}),c.jsx(x,{path:"overview",element:c.jsx(ka,{})}),c.jsx(x,{path:"promo",element:c.jsx(V,{to:`${l}/overview`,replace:!0})}),c.jsx(x,{path:"customers",element:c.jsx(Zo,{})}),c.jsx(x,{path:"customers/new",element:c.jsx(Yo,{})}),c.jsx(x,{path:"customers/new/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"customers/:customer_id",element:c.jsx(Wo,{})}),c.jsx(x,{path:"customers/:customer_id/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"subscriptions",element:c.jsx(_a,{})}),c.jsx(x,{path:"subscriptions/new",element:c.jsx(ja,{})}),c.jsx(x,{path:"subscriptions/new/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"subscriptions/:subscription_id",element:c.jsx(Aa,{})}),c.jsx(x,{path:"subscriptions/:subscription_id/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"invoices",element:c.jsx(fa,{})}),c.jsx(x,{path:"invoices/create",element:c.jsx(Ho,{})}),c.jsx(x,{path:"invoices/:invoice_id",element:c.jsx(pa,{})}),c.jsx(x,{path:"invoices/:invoice_id/record-payment",element:c.jsx(an,{})}),c.jsx(x,{path:"invoices/:invoice_id/issue-credit-note",element:c.jsx(ha,{})}),c.jsx(x,{path:"payments",element:c.jsx(ya,{})}),c.jsx(x,{path:"payments/record",element:c.jsx(an,{})}),c.jsx(x,{path:"payments/:transaction_id",element:c.jsx(wa,{})}),c.jsx(x,{path:"credits",element:c.jsx(Ko,{})}),c.jsx(x,{path:"credits/:credit_note_id",element:c.jsx(Qo,{})}),c.jsx(x,{path:"discounts",element:c.jsx(da,{})}),c.jsx(x,{path:"discounts/new",element:c.jsx(Bo,{})}),c.jsx(x,{path:"discounts/:coupon_id",element:c.jsx(sa,{})}),c.jsx(x,{path:"dunning",element:c.jsx(va,{})}),c.jsx(x,{path:"dunning/:case_id",element:c.jsx(ua,{})}),c.jsx(x,{path:"catalog",element:c.jsx(No,{})}),c.jsx(x,{path:"catalog/new",element:c.jsx(To,{})}),c.jsx(x,{path:"catalog/:item_id",element:c.jsx(wo,{})}),c.jsx(x,{path:"settings/*",element:c.jsx(sn,{})}),c.jsx(x,{path:"audit_log",element:c.jsx(Lo,{})}),c.jsx(x,{path:"data_import",element:c.jsx(ia,{})}),c.jsx(x,{path:"data_import/migrate",element:c.jsx(aa,{})}),c.jsx(x,{path:"data_import/:sessionId",element:c.jsx(na,{})}),c.jsx(x,{path:"*",element:c.jsx(M,{})})]})}export{pc as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-CQOAuUNI.js";import{a as f}from"./sentry-pp_6zWNc.js";import{u as O,g as _,h as w,t as A,j as l,N as L}from"./core-D07hD3KT.js";import{z as r,E as M,G as P,T as V,k as N,U as X,_ as $,$ as B,X as G}from"./index-BXZoRXDS.js";import{fI as R,U7 as W,UA as q,Ur as H,gl as J,gn as K,Uw as Q,gX as Y,dk as Z,UB as ee,UC as te}from"./zeni-epic-state-B3TABHgO.js";import{n as ne}from"./mui-XiTT8YBC.js";import{u as se}from"./useDeviceId-DCPRNX-s.js";import{f as ie}from"./analyticsHelper-BlLXbdz8.js";import{t as ae}from"./getLocaleForTenant-xajEPLim.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.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]="384996f5-5624-4470-974d-63f32ceff989",t._sentryDebugIdIdentifier="sentry-dbid-384996f5-5624-4470-974d-63f32ceff989")}catch{}})();const T=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function Te(){const t=O(),i=_(),m=w(),[y]=A(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:C,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),b=l((e=>e.tenantState.activeTenantFetchState.fetchState)),I=l((e=>e.tenantState.signInState)),h=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>R(e))),k=l((e=>W(e))),D=r.getSignedInUser(),v=M().mode;f.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&a!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(q(n,a,g)))}),[n,p,t,a,g,s?.zeniSessionId]),f.useEffect((()=>{I!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(k.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),P.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,k.tenantsInOrder),Y().then((()=>{const e=G();e!=null&&V(e)})),setTimeout((()=>{N.trackLogin(X.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[I,S,b,s,o,k,v,i.state,t]);const E=f.useCallback((()=>{m("/signin/auth")}),[m]),j=f.useCallback((()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))}),[a,d,t,c]),F=f.useCallback((e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))}),[a,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx($,{phoneNumber:C,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:E});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||D!=null){const e=i.state?.origin??"/";return u.jsx(L,{to:e,state:{...i.state,origin:""}})}if(!T(n,p)||g==null||h==="Error"){const e=i.state?.origin??"/",U=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(L,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:U,magicLinkExpired:!U&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(B,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
z-index: 9999;
|
|
11
|
-
background-color: ${t=>t.theme.colors.background};
|
|
12
|
-
`;export{Te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-CQOAuUNI.js";import{h as r,l as i}from"./core-D07hD3KT.js";import{am as n}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import"./sentry-pp_6zWNc.js";import"./zeni-epic-state-B3TABHgO.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="f2f6ef04-8019-4dfe-8bec-98d5efe59039",o._sentryDebugIdIdentifier="sentry-dbid-f2f6ef04-8019-4dfe-8bec-98d5efe59039")}catch{}})();const f=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as mt,b as lt,o as ft,j as N}from"./liveblocks-CQOAuUNI.js";import ut from"./NotFoundScreen-CBsVugJE.js";import{a as k}from"./sentry-pp_6zWNc.js";import{h as ht,g as pt,i as kt,u as gt,j as b,l as bt,n as St,o as O}from"./core-D07hD3KT.js";import{cB as It,Ub as Y,fI as J,h4 as Tt,Uf as S,a19 as Q,Ul as m,U9 as y,Ay as F,Gf as Ct,a1a as At,U8 as yt,Un as Et,AD as _t,a1b as $,br as j,gk as x,AH as X,a1c as Nt,cN as Bt,cG as wt}from"./zeni-epic-state-B3TABHgO.js";import{aq as xt,c as Ut,H as vt,y as Dt,as as Gt,dK as Rt,p as B,dL as Pt,w as Mt,dM as $t,i as jt,a4 as Ft}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import{u as Lt}from"./useTaskManagerAccess-Dvad4Vb6.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="be88a2ac-7cda-471c-9fd4-0866ba054658",t._sentryDebugIdIdentifier="sentry-dbid-be88a2ac-7cda-471c-9fd4-0866ba054658")}catch{}})();const qt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Ht=bt((function(t,l){const n=Y(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=S(t),f=J(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(e,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}d==="unread"&&t(X("task_manager","read",[e],!1))},onCommentNotificationClick:(e,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(e),t($([e],j())));let i=`/${h}/${r[1]}`;const T=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!wt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(e,s)=>{t(y(e,s))},onUpdateNotificationTabState:(e,s)=>{t(m(e,s))},onUpdateNotificationViewCurrentTabAndSubTab:(e,s)=>{t(Q(e,s));const d=`../${e}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:e=>{t(Nt(e))},onFetchMoreNotifications:(e,s)=>{if(e==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(F("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(e,s,d,r)=>{e==="tasks"?t(X("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t($([i],j())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:e=>{e==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(o,I).then((()=>{t($(o,j())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const e=Ft(n.state?.pathnameStackToGoBack),s=e.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:e.newStack}})},onSettingsClick:()=>{const e=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:e}})}}}))(Mt($t)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=It(h??""),o=gt(),f=Ut(),[I,v]=k.useState(!1),e=b((a=>Y(a))),s=b((a=>J(a))),{useFeatureGate:d}=vt(),{isFeatureEnabled:r}=d(Dt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:T}=Vt({mobileExploreReferrer:"Notifications"});Gt({isDataReady:!0});const Z=Tt(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=b((a=>S(a).notificationDetailsByTab.tasks.fetchState)),L=b((a=>S(a).currentTab)),D=b((a=>S(a).currentSubTab)),tt=b((a=>S(a).notificationDetailsByTab.comments.fetchCountState)),G=b((a=>S(a).notificationDetailsByTab.comments.fetchState)),at=b((a=>S(a).notificationDetailsByTab.comments.uiState.unreadCount)),et=b((a=>S(a).allExternalNotifications)).filter((a=>a.inboxNotification.readAt==null)).map((a=>a.inboxNotification.id)),st=Rt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:R,fetchMore:ot}=mt(),{threads:q,isLoading:H,fetchMore:W,isFetchingMore:z,hasFetchedAll:K}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(L!==c&&c!=null&&o(Q(c)),c==null){const a=`../${L}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(a,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&C===!0&&s?.companyId!=null&&w!=null){const a=`dashboard_${s.companyId}`,p=w.filter((A=>A.roomId===a&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const a=setTimeout((()=>ot?.()),0);return()=>clearTimeout(a)}));const P=E||R===!0||C!==!0||E||R===!0||C!==!0;k.useEffect((()=>{P&&G!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):P||G!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[P,G]),k.useEffect((()=>{o(y({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{e.fetchState!=="In-Progress"&&e.fetchState!=="Completed"&&I===!1&&(v(!0),o(Ct()))}),[e.fetchState]),k.useEffect((()=>{if(E===!1&&H===!1&&w!=null&&q!=null){const a=`dashboard_${s.companyId}`,p=w.filter((u=>u.roomId===a)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=q.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(z||K===!0||W==null||W(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,R,z,C,K,H,w?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(a,p)=>{if(jt(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),o(F("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Lt(f);return N.jsx(Ht,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:i,onAskAiCfoClick:T,...nt})};function ma(){return N.jsxs(St,{children:[N.jsx(O,{path:"/:selectedTab",element:N.jsx(Wt,{})}),N.jsx(O,{path:"*",element:N.jsx(ut,{})})]})}export{ma as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-CQOAuUNI.js";import{a as r}from"./sentry-pp_6zWNc.js";import{u as A,g as P,j as o,N as j}from"./core-D07hD3KT.js";import{UO as C,fI as R,gp as x,UP as z,UQ as D,UR as M,US as L,pV as k,Tt as N}from"./zeni-epic-state-B3TABHgO.js";import{z as h,ah as I}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="c7e15d0f-8386-4c7a-8877-066d040fdca4",n._sentryDebugIdIdentifier="sentry-dbid-c7e15d0f-8386-4c7a-8877-066d040fdca4")}catch{}})();function ee(){const n=A(),s=P(),{params:t,error:i}=r.useMemo((()=>C(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o((e=>R(e))),l=o((e=>x(e))),d=o((e=>e.tenantState.fetchState)),y=o(z),S=o(D),c=o(M),[U,v]=r.useState(null),[E,b]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(L())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[p,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((T=>T.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[f?.tenantId,l]),u=U??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:v,approveError:E??S,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{b("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|