@zeniai/web-app-ui 5.4.21-qa → 5.4.22-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-DSIWi6s5.js → AccountMappingScreen-C5mOiJ2U.js} +2 -2
- package/dist/assets/ActualMatchingMatchDetailScreen-wHD8fSWU.js +1 -0
- package/dist/assets/AddressRoutes-CVWN9CJv.js +1 -0
- package/dist/assets/AddressScreen-DgUwrml_.js +9 -0
- package/dist/assets/AiCfoScreen-yDQ2sphg.js +22 -0
- package/dist/assets/{AppDrawer-DXTltxSC.js → AppDrawer-DzYZBC2G.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-B5OXFSfw.js → BillPayApprovalRoutes-BcCgse3-.js} +1 -1
- package/dist/assets/BillPayRoutes-HAS0-pNc.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-DM_jBIuD.js +9 -0
- package/dist/assets/CardsAiCfoScreen-yrI2CL7M.js +14 -0
- package/dist/assets/ChargeCardRoutes-DgtmFgR6.js +71 -0
- package/dist/assets/CompanyPassportScreen-BLtXgkEd.js +1 -0
- package/dist/assets/ConnectionAuthScreen-CuZmfRIp.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BjmJLllh.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CCsjVlGs.js → CustomerOnboardingRoutes-C0b805o-.js} +7 -7
- package/dist/assets/CustomersRoutes-DD5Gx1mW.js +8 -0
- package/dist/assets/DashboardRoutes-C8RZkkYj.js +20 -0
- package/dist/assets/DefaultTenantHome-C6Ygdgwt.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-BxClNf2J.js +18 -0
- package/dist/assets/DrawerScreen-BHaectiO.js +1 -0
- package/dist/assets/EntityDetailRoutes-BJzuW7dq.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BKrWZyYV.js +38 -0
- package/dist/assets/FallBackRoute-DuMHkNqk.js +2 -0
- package/dist/assets/FeaturePreviewScreen-DHt0WFS8.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Di0pbhHE.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-CR8M19mz.js → InboxNotificationsProvider-CiKEEv6Q.js} +1 -1
- package/dist/assets/InvoicingRoutes-Bsq4ym98.js +3 -0
- package/dist/assets/MagicLinkRoutes-DJX5Nm1n.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CD7Pya_j.js +12 -0
- package/dist/assets/MobileAppDrawer-BWNb5zLN.js +1 -0
- package/dist/assets/NotFoundScreen-DXy-BCit.js +1 -0
- package/dist/assets/NotificationRoutes-B2xHVaqf.js +1 -0
- package/dist/assets/OAuthConsentScreen-BA2eBLib.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Dm5Vnr71.js +1 -0
- package/dist/assets/PaymentLinkScreen-CndVAq3p.js +21 -0
- package/dist/assets/PeopleRoutes-kralZgbz.js +22 -0
- package/dist/assets/PerformanceRoutes-DJhuo9qY.js +1 -0
- package/dist/assets/{Preview-DY7J6hF2.js → Preview--c8D4GAG.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CUY1FKXU.js → QBOConnectionScreen-DroXrkno.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-B2ftFL0O.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CHTcY28V.js +1 -0
- package/dist/assets/{ReimbursementRoutes-BGuB1qNk.js → ReimbursementRoutes-CI3m7PHD.js} +9 -9
- package/dist/assets/ReportsRoutes-C7A0Ycu_.js +1 -0
- package/dist/assets/RewardsRoutes-Dkg4zGB8.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CY17Raf2.js → ScheduleDetailsPrepaidExpensesScreen-ZwdXW6K5.js} +5 -5
- package/dist/assets/ScreenRoutes-B_WT7FAm.js +2 -0
- package/dist/assets/{SettingsRoutes-ClmD3D2-.js → SettingsRoutes-_XBnyBgG.js} +6 -6
- package/dist/assets/{SetupPagesScreen-CZUQQDiy.js → SetupPagesScreen-D6ssIWb0.js} +5 -5
- package/dist/assets/SignInScreen-H_SOl_FQ.js +1 -0
- package/dist/assets/SignOutScreen-OFswrnt8.js +9 -0
- package/dist/assets/{TaskListScreen-DpbqjWaF.js → TaskListScreen-Bmj5V_dR.js} +2 -2
- package/dist/assets/TaskRoutes-D6cEqDZN.js +9 -0
- package/dist/assets/TransactionDetailRoutes-D-b6zdg4.js +1 -0
- package/dist/assets/TransactionDetailScreen-JBKbtouq.js +5 -0
- package/dist/assets/TransactionListRoutes-THtfycHC.js +1 -0
- package/dist/assets/TreasuryRoutes-CgHwdyKd.js +37 -0
- package/dist/assets/{VendorsRoutes-CyzrLUAk.js → VendorsRoutes-jETcYESc.js} +18 -18
- package/dist/assets/WiseConfirmationScreen-BpRHCykr.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-vedqKXJ2.js → ZeniAccountRoutes-C8cr5UMy.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-DAs1_LIC.js +9 -0
- package/dist/assets/{accountMappingHelper-6DbklLyK.js → accountMappingHelper-DSd2V454.js} +1 -1
- package/dist/assets/{analytics-CFxWPAfp.js → analytics-Vgn85Ur_.js} +4 -4
- package/dist/assets/analyticsHelper-CWMk7_rd.js +1 -0
- package/dist/assets/{core-Dj_sc5JU.js → core-CbdTrw7T.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CruFQaAA.js → decodeURIComponentSafe-D7APy95S.js} +1 -1
- package/dist/assets/{dnd-5Q4l7GBy.js → dnd-DuiAlI7w.js} +1 -1
- package/dist/assets/empty-B1nH_ieU.js +1 -0
- package/dist/assets/{empty-90bgzNqS.js → empty-CjoB5KP4.js} +1 -1
- package/dist/assets/{emptyVideoElement-CG1lrSja.js → emptyVideoElement-B6iUrc8S.js} +1 -1
- package/dist/assets/epic-CCMzkkv8.js +2 -0
- package/dist/assets/expenseAutomationHelper-CgTsmmCm.js +1 -0
- package/dist/assets/getLocaleForTenant-B8EqveGi.js +1 -0
- package/dist/assets/{index-CknpfAr_.js → index-BFdcFsSo.js} +1 -1
- package/dist/assets/index-BNFAuGus.js +1 -0
- package/dist/assets/{index-CY0VD1jn.js → index-CnIO6_IQ.js} +14764 -14764
- package/dist/assets/{index-D3GdhLCV.js → index-DjPsG1Xt.js} +1 -1
- package/dist/assets/{index-DgM5Gz01.js → index-LGKtWUy9.js} +1 -1
- package/dist/assets/{index-LWpD9GrX.js → index-naWU0Itr.js} +2 -2
- package/dist/assets/{empty-UDJfEj2S.js → index-pWh5QyXZ.js} +1 -1
- package/dist/assets/{index-CGFget0-.js → index-wSCaSCb5.js} +1 -1
- package/dist/assets/{lexical-BzjAp4AL.js → lexical-B-vxEaRQ.js} +1 -1
- package/dist/assets/{liveblocks-ByIxqWJk.js → liveblocks-BLpmr1Pv.js} +15 -15
- package/dist/assets/{lottie-CelagD5x.js → lottie-Lb1ftKY1.js} +1 -1
- package/dist/assets/{mui-BYXLmEqm.js → mui-DNGY4bFU.js} +2 -2
- package/dist/assets/{pathToGoBack-BzjAj2pA.js → pathToGoBack-CJCquoqC.js} +1 -1
- package/dist/assets/{pdf-Ctx2ExfD.js → pdf-B1uD4Ovv.js} +3 -3
- package/dist/assets/{pdf-lib-CZyWp-Tq.js → pdf-lib-BKN88Kre.js} +1 -1
- package/dist/assets/{plaid-CLiLant-.js → plaid-DhfTjhua.js} +1 -1
- package/dist/assets/{pusher-4U4JTU2d.js → pusher-BPtf_EL-.js} +1 -1
- package/dist/assets/{react-BEae2nKv.js → react-B10NZVQI.js} +1 -1
- package/dist/assets/{react-DsOnQCnT.js → react-BAEKpD-r.js} +1 -1
- package/dist/assets/{react-BzAF6y_Y.js → react-Bhjp4pzB.js} +1 -1
- package/dist/assets/{react-CB4BsLSa.js → react-DEDzyvMl.js} +1 -1
- package/dist/assets/{react-RNadsjUA.js → react-DGl2P4dK.js} +1 -1
- package/dist/assets/{react-BsM3F52d.js → react-arX5WESX.js} +1 -1
- package/dist/assets/{recharts-PGbaLytC.js → recharts-CTh_JhT_.js} +1 -1
- package/dist/assets/{reportTimeframe-Dl2MfTSY.js → reportTimeframe-DeLnONFM.js} +1 -1
- package/dist/assets/{routePaths-CsEd-Pbs.js → routePaths-CV12X_S-.js} +1 -1
- package/dist/assets/{sentry-9XsSr7sR.js → sentry-DWNq3t8E.js} +2 -2
- package/dist/assets/{stripSplatSuffix-BjmSkzFi.js → stripSplatSuffix-DP9nmQOu.js} +1 -1
- package/dist/assets/{url-CHBhwoFp.js → url-B2x9G6No.js} +4 -4
- package/dist/assets/{url-Bl9O_rxx.js → url-BqlXUDAr.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-D-Ym3wTm.js +1 -0
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Dqg5VVaq.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-DXFswt7R.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-Cq6Y4mMW.js +1 -0
- package/dist/assets/{useDeviceId-D9z31npB.js → useDeviceId-dj9QS4Ga.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-qgk6N8cm.js +1 -0
- package/dist/assets/useEnsureVendorListLoaded-CIShbpK4.js +1 -0
- package/dist/assets/useInitialThreadRequest-DAUsQlCl.js +1 -0
- package/dist/assets/useIsCustomersTabEnabled-C6mkabn2.js +1 -0
- package/dist/assets/useTaskManagerAccess-Cm5trA3i.js +1 -0
- package/dist/assets/useTaskManagerPusherEvents-C1gzc-aA.js +1 -0
- package/dist/assets/{utils-DI6OGGjP.js → utils-CrhrpmD8.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-BoHm4v8l.js → withTransactionSidePanel-D-hDwbdr.js} +5 -5
- package/dist/assets/{zeni-epic-state-RN9etYeQ.js → zeni-epic-state-C5DO1jkr.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/ActualMatchingMatchDetailScreen-fiFb522S.js +0 -1
- package/dist/assets/AddressRoutes-CZXccJVo.js +0 -1
- package/dist/assets/AddressScreen-D9ytAzo4.js +0 -9
- package/dist/assets/AiCfoScreen-CkU9Vttb.js +0 -22
- package/dist/assets/BillPayRoutes-BdnvTGKc.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-IdWkVeTs.js +0 -9
- package/dist/assets/CardsAiCfoScreen-Cj86rJgb.js +0 -14
- package/dist/assets/ChargeCardRoutes-DcPAOx8X.js +0 -71
- package/dist/assets/CompanyPassportScreen-DqB5oBcd.js +0 -1
- package/dist/assets/ConnectionAuthScreen-2sFx8558.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BZZUKU2D.js +0 -1
- package/dist/assets/CustomersRoutes-b_GBDyKW.js +0 -8
- package/dist/assets/DashboardRoutes-DpXCoqPl.js +0 -20
- package/dist/assets/DefaultTenantHome-IBYOPnwd.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-ClicUNfX.js +0 -18
- package/dist/assets/DrawerScreen-1iiJqYPf.js +0 -1
- package/dist/assets/EntityDetailRoutes-DGjLGj1f.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-nEe3PFTP.js +0 -38
- package/dist/assets/FeaturePreviewScreen-CWeorrAP.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-rjJ7of46.js +0 -1
- package/dist/assets/InvoicingRoutes-WYyYgKyd.js +0 -3
- package/dist/assets/MagicLinkRoutes-CxOsj948.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CMCs7o4p.js +0 -12
- package/dist/assets/MobileAppDrawer-B4DreqQy.js +0 -1
- package/dist/assets/NotFoundScreen-qzMvf835.js +0 -1
- package/dist/assets/NotificationRoutes-B5b-HM0B.js +0 -1
- package/dist/assets/OAuthConsentScreen-BSYOAgnX.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BAqDgcrm.js +0 -1
- package/dist/assets/PaymentLinkScreen-uBCPj7U-.js +0 -21
- package/dist/assets/PeopleRoutes-CsLCmyJ2.js +0 -22
- package/dist/assets/PerformanceRoutes-DBaA-VPu.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-BU3j473F.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-Cwcu8o11.js +0 -1
- package/dist/assets/ReportsRoutes-D3JsKyFt.js +0 -1
- package/dist/assets/RewardsRoutes-Y44oe2Vc.js +0 -1
- package/dist/assets/ScreenRoutes-DWsCKyWW.js +0 -2
- package/dist/assets/SignInScreen-D6NmDWFW.js +0 -1
- package/dist/assets/SignOutScreen-Bq9qzL9T.js +0 -9
- package/dist/assets/TaskRoutes-BF3MK68Y.js +0 -9
- package/dist/assets/TransactionDetailRoutes-B9-OGoe1.js +0 -1
- package/dist/assets/TransactionDetailScreen-P7tVSby5.js +0 -5
- package/dist/assets/TransactionListRoutes-rF93JJZz.js +0 -1
- package/dist/assets/TreasuryRoutes-CXZ3GK1g.js +0 -37
- package/dist/assets/WiseConfirmationScreen-B5Y7a2RT.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BlGO2V-T.js +0 -9
- package/dist/assets/analyticsHelper-Cz_Jj03m.js +0 -1
- package/dist/assets/epic-COLv6VHe.js +0 -2
- package/dist/assets/expenseAutomationHelper-Cl03EVHW.js +0 -1
- package/dist/assets/getLocaleForTenant-Cb0gGUXK.js +0 -1
- package/dist/assets/index-CupGsprQ.js +0 -1
- package/dist/assets/index-fIzifU8E.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-B1mBWE-P.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BjbLlJPK.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-KhabBRdb.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-CAaJDucS.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-h6IoQxvO.js +0 -1
- package/dist/assets/useEnsureVendorListLoaded-vYAJo8rK.js +0 -1
- package/dist/assets/useInitialThreadRequest-BsXsay8_.js +0 -1
- package/dist/assets/useIsCustomersTabEnabled-CjgNHh2z.js +0 -1
- package/dist/assets/useTaskManagerAccess-5u2jYjXE.js +0 -1
- package/dist/assets/useTaskManagerPusherEvents-BZR3VVVu.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReportsRoutes-C7A0Ycu_.js","assets/sentry-DWNq3t8E.js","assets/core-CbdTrw7T.js","assets/zeni-epic-state-C5DO1jkr.js","assets/index-CnIO6_IQ.js","assets/mui-DNGY4bFU.js","assets/analytics-Vgn85Ur_.js","assets/utils-CrhrpmD8.js","assets/NotFoundScreen-DXy-BCit.js","assets/FeaturePreviewScreen-DHt0WFS8.js","assets/useInitialThreadRequest-DAUsQlCl.js","assets/routePaths-CV12X_S-.js","assets/reportTimeframe-DeLnONFM.js","assets/MobileAppDrawer-BWNb5zLN.js","assets/InboxNotificationsProvider-CiKEEv6Q.js","assets/useTaskManagerAccess-Cm5trA3i.js","assets/useIsCustomersTabEnabled-C6mkabn2.js","assets/index-BQ3cXEYt.css","assets/AddressRoutes-CVWN9CJv.js","assets/AddressScreen-DgUwrml_.js","assets/PeopleRoutes-kralZgbz.js","assets/useAskAiCfoHostNavButtonProps-DXFswt7R.js","assets/PandLWithForecastRoutes-Dm5Vnr71.js","assets/CustomerOnboardingRoutes-C0b805o-.js","assets/QBOConnectionScreen-DroXrkno.js","assets/empty-CjoB5KP4.js","assets/index-LGKtWUy9.js","assets/url-B2x9G6No.js","assets/index-BNFAuGus.js","assets/decodeURIComponentSafe-D7APy95S.js","assets/useEmailConnectResultRefresh-qgk6N8cm.js","assets/useChargeCardPusherEvents-Cq6Y4mMW.js","assets/VendorsRoutes-jETcYESc.js","assets/ScheduleDetailsPrepaidExpensesScreen-ZwdXW6K5.js","assets/pathToGoBack-CJCquoqC.js","assets/useActualMatchingMatchDetail-D-Ym3wTm.js","assets/stripSplatSuffix-DP9nmQOu.js","assets/DrawerScreen-BHaectiO.js","assets/accountMappingHelper-DSd2V454.js","assets/CustomersRoutes-DD5Gx1mW.js","assets/TransactionDetailRoutes-D-b6zdg4.js","assets/useEnsureVendorListLoaded-CIShbpK4.js","assets/TransactionDetailScreen-JBKbtouq.js","assets/expenseAutomationHelper-CgTsmmCm.js","assets/EntityDetailRoutes-BJzuW7dq.js","assets/withTransactionSidePanel-D-hDwbdr.js","assets/DashboardRoutes-C8RZkkYj.js","assets/analyticsHelper-CWMk7_rd.js","assets/CompanyPassportScreen-BLtXgkEd.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Dqg5VVaq.js","assets/BillPayRoutes-HAS0-pNc.js","assets/DomesticWireDetailScreen-BxClNf2J.js","assets/BusinessVerificationPageScreen-DM_jBIuD.js","assets/SetupPagesScreen-D6ssIWb0.js","assets/BillPayApprovalRoutes-BcCgse3-.js","assets/ReimbursementApprovalRuleDetailScreen-CHTcY28V.js","assets/FallBackRoute-DuMHkNqk.js","assets/SettingsRoutes-_XBnyBgG.js","assets/AccountMappingScreen-C5mOiJ2U.js","assets/ReimbursementApprovalRoutes-B2ftFL0O.js","assets/InvoicingRoutes-Bsq4ym98.js","assets/ReimbursementRoutes-CI3m7PHD.js","assets/ZeniAccountRoutes-C8cr5UMy.js","assets/ZeniAccountStatementScreen-DAs1_LIC.js","assets/TreasuryRoutes-CgHwdyKd.js","assets/TransactionListRoutes-THtfycHC.js","assets/ChargeCardRoutes-DgtmFgR6.js","assets/NotificationRoutes-B2xHVaqf.js","assets/PerformanceRoutes-DJhuo9qY.js","assets/ExpenseAutomationRoutes-BKrWZyYV.js","assets/ActualMatchingMatchDetailScreen-wHD8fSWU.js","assets/RewardsRoutes-Dkg4zGB8.js","assets/TaskRoutes-D6cEqDZN.js","assets/TaskListScreen-Bmj5V_dR.js","assets/useTaskManagerPusherEvents-C1gzc-aA.js","assets/AiCfoScreen-yDQ2sphg.js","assets/CardsAiCfoScreen-yrI2CL7M.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bm as hs,fJ as _s,er as ps,eq as xs,h8 as js,d4 as Es,c8 as gs,gN as Is,gd as Rs,eh as xe,cz as As,gr as Ts,cq as fs,bF as bs,bw as ys,h9 as ws,v as Cs,ha as Ds,bp as vs,hb as Us,bL as ks,bK as Fs,bs as Os,cm as Ps,hc as Hs,hd as Ss,ec as Bs,ef as Ls,ee as Ns,cy as Vs,cF as Zs,he as je,gm as Ee,h1 as Ms,go as ge,gP as Ie,gQ as Re,gp as zs,_ as r}from"./zeni-epic-state-C5DO1jkr.js";import{j as e}from"./liveblocks-BLpmr1Pv.js";import{a as U}from"./sentry-DWNq3t8E.js";import{u as Gs,h as $s,i as Ys,g as qs,j as z,q as Ae,N as d,n as Ws,o as s}from"./core-CbdTrw7T.js";import{u as Ks,z as f,p as Js,a as Qs,h as Xs,_ as L,i as en,K as sn,V as nn,L as F,G as Te,t as c,b as an,P as tn,c as ae,r as on,l as i,d as rn,Z as ln}from"./index-CnIO6_IQ.js";import{u as dn}from"./mui-DNGY4bFU.js";import{f as fe}from"./analyticsHelper-CWMk7_rd.js";import{t as cn}from"./getLocaleForTenant-B8EqveGi.js";import{u as un}from"./useIsCustomersTabEnabled-C6mkabn2.js";import{F as C}from"./FallBackRoute-DuMHkNqk.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new l.Error().stack;b&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[b]="1c231a9c-a720-4a84-9133-c2aa76ffe40d",l._sentryDebugIdIdentifier="sentry-dbid-1c231a9c-a720-4a84-9133-c2aa76ffe40d")}catch{}})();const mn=i((()=>r((()=>import("./ReportsRoutes-C7A0Ycu_.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])))),hn=i((()=>r((()=>import("./AddressRoutes-CVWN9CJv.js")),__vite__mapDeps([18,1,2,3,19,4,5,6,7,8,17])))),_n=i((()=>r((()=>import("./PeopleRoutes-kralZgbz.js")),__vite__mapDeps([20,1,2,3,4,5,6,7,8,21,13,14,15,16,17])))),pn=i((()=>r((()=>import("./PandLWithForecastRoutes-Dm5Vnr71.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,21,10,11,13,14,15,16,17])))),xn=i((()=>r((()=>import("./CustomerOnboardingRoutes-C0b805o-.js")),__vite__mapDeps([23,1,2,3,19,4,5,6,7,8,24,25,26,27,28,29,30,31,17])))),jn=i((()=>r((()=>import("./VendorsRoutes-jETcYESc.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,19,8,9,33,34,35,36,29,11,21,13,14,15,16,37,38,17])))),En=i((()=>r((()=>import("./CustomersRoutes-DD5Gx1mW.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,11,8,21,13,14,15,16,17])))),gn=i((()=>r((()=>import("./TransactionDetailRoutes-D-b6zdg4.js")),__vite__mapDeps([40,1,2,3,8,4,5,6,7,29,41,42,21,10,11,43,17])))),be=i((()=>r((()=>import("./EntityDetailRoutes-BJzuW7dq.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,29,45,21,42,10,11,43,36,16,17])))),In=i((()=>r((()=>import("./DashboardRoutes-C8RZkkYj.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,45,21,42,29,10,11,43,36,16,8,12,47,48,13,14,15,49,9,17])))),ye=i((()=>r((()=>import("./BillPayRoutes-HAS0-pNc.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,19,8,51,21,10,52,11,13,14,15,16,37,9,53,47,54,41,55,56,17])))),Rn=i((()=>r((()=>import("./SettingsRoutes-_XBnyBgG.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,15,58,13,14,16,24,25,26,27,28,29,38,19,8,47,52,11,48,30,54,41,55,59,17])))),An=i((()=>r((()=>import("./InvoicingRoutes-Bsq4ym98.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,19,8,13,14,15,16,24,25,26,27,28,29,17])))),we=i((()=>r((()=>import("./ReimbursementRoutes-CI3m7PHD.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,8,53,52,11,13,14,15,16,47,9,21,10,37,56,59,41,55,17])))),Tn=i((()=>r((()=>import("./ZeniAccountRoutes-C8cr5UMy.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,8,53,52,11,13,14,15,16,47,9,51,19,21,63,17])))),fn=i((()=>r((()=>import("./TreasuryRoutes-CgHwdyKd.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,8,53,52,11,13,14,15,16,47,21,10,9,17])))),bn=i((()=>r((()=>import("./TransactionListRoutes-THtfycHC.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,45,21,42,29,10,11,43,36,63,17])))),yn=i((()=>r((()=>import("./ChargeCardRoutes-DgtmFgR6.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,21,13,14,15,16,53,52,11,8,47,10,31,19,17])))),wn=i((()=>r((()=>import("./NotificationRoutes-B2xHVaqf.js")),__vite__mapDeps([67,1,2,3,8,4,5,6,7,21,15,17])))),Cn=i((()=>r((()=>import("./PerformanceRoutes-DJhuo9qY.js")),__vite__mapDeps([68,1,2,3,8,4,5,6,7,21,13,14,15,16,17])))),Dn=i((()=>r((()=>import("./ExpenseAutomationRoutes-BKrWZyYV.js")),__vite__mapDeps([69,1,2,3,8,4,5,6,7,21,42,29,10,11,43,35,36,45,33,34,38,37,17])))),vn=i((()=>r((()=>import("./ActualMatchingMatchDetailScreen-wHD8fSWU.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,35,36,29,11,8,17])))),Un=i((()=>r((()=>import("./RewardsRoutes-Dkg4zGB8.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8,17])))),kn=i((()=>r((()=>import("./TaskRoutes-D6cEqDZN.js")),__vite__mapDeps([72,1,2,3,8,4,5,6,7,10,13,14,15,16,73,21,74,17])))),Fn=i((()=>r((()=>import("./AiCfoScreen-yDQ2sphg.js")),__vite__mapDeps([75,1,2,3,4,5,6,7,49,34,11,74,17])))),Ce=i((()=>r((()=>import("./CardsAiCfoScreen-yrI2CL7M.js")),__vite__mapDeps([76,1,2,3,4,5,6,7,17])))),R=i((()=>r((()=>import("./NotFoundScreen-DXy-BCit.js")),__vite__mapDeps([8,1,2,3,4,5,6,7,17])))),On=i((()=>r((()=>import("./TaskListScreen-Bmj5V_dR.js").then((l=>l.f))),__vite__mapDeps([73,1,2,3,4,5,6,7,21,13,14,15,16,74,17]))));function na({setTenantEmailDomain:l}){const b=Gs(),N=$s(),{tenantEmailDomain:o}=Ys(),V=dn().mode,{setLoading:O,clearAllLoading:W,clearLoading:H}=Ks(),y=f.getSignedInUserTenant(o)?.tenantId,A=f.getSignedInUser(),K=hs(A),G=qs(),[P,ve]=U.useState(!1),n=z((a=>_s(a))),{useFeatureGate:S}=Js(),Z=Qs(),J=Xs(),Ue=!!n.company?.companyZeniAccountInfo?.isZeniAccountEnabled,ke=n.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Fe}=S(L.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=S(L.isDebitCardFeatureEnabled),T=z((a=>a.tenantState.fetchState)),x=z((a=>a.tenantState.activeTenantFetchState.fetchState)),m=x==="Completed"||T==="Completed"?ps(te,n):void 0,Q=x==="Completed"||T==="Completed"?xs(n):void 0,oe=x==="Completed"||T==="Completed"?js(n)&&!Es(n):void 0,Oe=en(n,Fe,te),{isCardsHidden:Pe}=sn(n?.tenantId),He=!Oe||!!Pe,{isFeatureEnabled:Se}=S(L.isSettingsFeatureEnabled),{isFeatureEnabled:X}=S(L.isAiCfoFileUploadEnabled),{isFeatureEnabled:Be}=S(L.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Le=n?.userRole!=null&&gs(n.userRole),$=z((a=>Is(a)));if(o!=null){const a=f.getSignedInUserTenant(o);A!=null&&a!=null&&fe(A,n,V)}const M={tenantId:y,userId:A?.userId,sessionId:A?.zeniSessionId},re=Rs(),h=nn(),Ne=un(n.company==null),Ve=n.company==null||h?.loggedInUserRoleMap!=null&&xe(h.loggedInUserRole),Ze=As(h?.loggedInUserRoleMap),ee=Ae("/:tenantEmailDomain/onboarding/*")!==null,Me=Ae("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Me?.params.selectedPeriod,ze=z((a=>M.tenantId!=null?Ts(a,M.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),l(o)}),[o]),U.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const D=fs(Number(a[0])),w=Number(a[1]),t=bs(`01-${D<10?`0${D}`:D}-${w}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),_=ys();t.isAfter(_,"month")===!1?b(ws(y,{month:D,year:w})):N(`/${o}/month_end_close_checks/review`)}}}),[se,o,y]),U.useEffect((()=>{P||(ve(!0),O(F.TENANT_FETCHING))}),[P,M,re,A,b,f]),U.useLayoutEffect((()=>{!Cs(re,M)&&f.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t){if(Ee(D?.userId,D?.zeniSessionId,a.tenantId),w(Ms(!0)),w(ge(a.tenantId)),a.tenantId!=null&&c.clearTenant(a.tenantId),a.tenantId!=null){const _=f.getSignedInUserTenantWithId(a.tenantId);t&&Te.updateAppLocaleID(cn(t)),_?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(_?.tenantEmailDomain)}a.userId!=null?ae.identify(a.userId,{tenant_id:a.tenantId}):ae.resetUserIdentity()})(M,A,b,ze))}),[y]),U.useEffect((()=>{f.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t,_,ls,B){if(w==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&_?.zeniSessionId!=null,ds=w==null||w.tenantId!==t,cs=w!=null&&w.excludedResources==null,us=w!=null&&w.externalConnections==null;if(Y&&ds){B(ge(t));const q=f.getSignedInUserTenantWithId(t);q?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(q?.tenantEmailDomain),Ee(_?.userId,_?.zeniSessionId,t),c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)))}else Y&&cs&&c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),Y&&us&&c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)));if(Y){ae.identify(_.userId,{tenant_id:t});const q=t==null||t!=null&&(D==="Completed"||D==="Error");if(a==="Completed"||D!=="Not-Started"&&D!=="Error"||t==null||!c.shouldFetchActiveTenant(t)||(c.markActiveTenantFetchStarted(t),ls(F.TENANT_FETCHING),B(zs(_.userId,t,_.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&c.shouldFetchAllTenants()){c.markAllTenantsFetchStarted();const{userId:ms,zeniSessionId:pe}=_;on((()=>{f.getSignedInUser()?.zeniSessionId===pe?B(je(ms,pe)):c.markAllTenantsFetchFailed()}),Pn)}}})(T,x,n,y,A,O,b))}),[y,x]),U.useEffect((()=>{f.isSignedIn()&&T==="Completed"&&$.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),f.saveSignedInUserTenants(Ds($.tenantsBaseInOrder)),A!=null&&fe(A,n,V,void 0,$.tenantsBaseInOrder))}),[$,T,n,A]),U.useEffect((()=>{x==="In-Progress"&&O(F.TENANT_FETCHING),x!=="Completed"&&x!=="Error"||(x==="Completed"&&y!=null?(performance.mark("zeni:boot_tenant_data"),W(),c.markActiveTenantFetchCompleted(y)):x==="Error"&&y!=null&&(c.markActiveTenantFetchFailed(y),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?c.markAllTenantsFetchCompleted():T==="Error"&&c.markAllTenantsFetchFailed())}),[x,T,y,P]);const ie=U.useRef(!1);U.useEffect((()=>{!ie.current&&x==="Completed"&&P&&(ie.current=!0,an())}),[x,P]);const v=n?.userRole!=null&&vs(n?.userRole),{isFeatureEnabled:Ge}=S(L.isReferralFeatureEnabled),{isFeatureEnabled:$e}=S(L.isAccrualEnabled),Ye=n?.userRole!=null&&n.userRole.includes("charge_card_user"),qe=n?.userRole!=null&&n.userRole.includes("charge_card_admin"),k=n?.userRole!=null&&xe(n.userRole),le=n?.company==null||n.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!v,de=!He&&!v,We=Us(h?.loggedInUserRoleMap),Ke=n.externalConnections?.accounting[0]?.isValid,Je=n.externalConnections?.fetchState==="Completed",ne=n.company?.companyOnboardingInfo.isOnboardingCompleted,ce=n?.company==null||n.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!v,ue=ce&&ks(h?.loggedInUserRoleMap),me=Ue&&!v,Qe=ke&&!v,Xe=le&&Fs(h?.loggedInUserRoleMap),es=de&&Os(h?.loggedInUserRoleMap),ss=me&&Ps(h?.loggedInUserRoleMap),ns=Hs(h?.loggedInUserRoleMap),as=Ss(h?.loggedInUserRoleMap),ts=Bs(h?.loggedInUserRoleMap),os=Ls(h?.loggedInUserRoleMap),rs=Ns(h?.loggedInUserRoleMap),j=Vs(h?.loggedInUserRoleMap),E=Zs(h?.loggedInUserRoleMap),he=le&&j,_e=ce&&E,g=me&&ts,I=Qe&&os,u=de&&rs,is=n.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ze===!0||We===!0||ns===!0||as===!0;return f.isSignedIn()?y==null?T==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(A!=null&&T!=="In-Progress"&&b(je(A.userId,A.zeniSessionId)),null):x!=="In-Progress"&&x!=="Not-Started"||T==="Completed"?(ne===!0||K&&!ee)&&Je&&Ke!==!0&&m===!1&&Q===!1&&oe===!1?(l(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!P||oe!==!0||ne!==!0||ee||K?!P||ne!==!1||ee||K?P&&n?.userRole&&m!=null&&Q!=null&&o!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ws,{children:e.jsxs(s,{element:e.jsx(tn,{}),children:[e.jsx(s,{path:"/",element:e.jsx(Hn,{isDashboardAccess:k,showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,isTenantCardsOnly:Q,showChargeCardRoute:u})}),e.jsx(s,{path:"dashboard/*",element:k?e.jsx(In,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reports/*",element:k?e.jsx(mn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"people/*",element:is||k?e.jsx(_n,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"forecast/*",element:k?e.jsx(pn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"onboarding/*",element:e.jsx(xn,{})}),e.jsx(s,{path:"transaction/*",element:k&&v===!1||Ye||qe?e.jsx(gn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"transactions/*",element:k&&v===!1?e.jsx(bn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"customer/*",element:k&&v===!1?e.jsx(be,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,isTenantBankingOnly:m,showTreasuryRoute:I,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"vendor/*",element:k&&v===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"tasks",element:e.jsx(On,{})}),e.jsx(s,{path:"tasks/*",element:e.jsx(kn,{})}),e.jsx(s,{path:"address/*",element:Xe||ue||ss||es?e.jsx(hn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"checking/*",element:e.jsx(p,{isAllowed:g,fallback:e.jsx(R,{}),children:e.jsx(Tn,{})})}),e.jsx(s,{path:"treasury/*",element:e.jsx(p,{isAllowed:I,fallback:e.jsx(R,{}),children:e.jsx(fn,{})})}),e.jsx(s,{path:"performance",element:e.jsx(p,{isAllowed:J,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(Cn,{})})}),e.jsx(s,{path:"month_end_close_checks/review/*",element:e.jsx(p,{isAllowed:J&&!v,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(Dn,{})})}),e.jsx(s,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(p,{isAllowed:J&&!v&&$e,fallback:e.jsx(R,{}),children:e.jsx(vn,{})})}),e.jsx(s,{path:"notifications/*",element:e.jsx(wn,{})}),e.jsx(s,{path:"vendors/*",element:e.jsx(p,{isAllowed:Ve,fallback:e.jsx(R,{}),children:e.jsx(jn,{})})}),e.jsx(s,{path:"customers/*",element:e.jsx(p,{isAllowed:Ne,fallback:e.jsx(R,{}),children:e.jsx(En,{})})}),e.jsx(s,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursement/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursements/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"settings/*",element:e.jsx(p,{isAllowed:Se,fallback:e.jsx(R,{}),children:e.jsx(Rn,{hasAdminLevelAccess:ue})})}),e.jsx(s,{path:"invoicing/*",element:e.jsx(p,{isAllowed:Be&&Le,fallback:e.jsx(R,{}),children:e.jsx(An,{})})}),e.jsx(s,{path:"cards/ask",element:e.jsx(p,{isAllowed:u&&Z,fallback:e.jsx(R,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/ask/:session_id",element:e.jsx(p,{isAllowed:u&&Z,fallback:e.jsx(R,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/*",element:e.jsx(p,{isAllowed:u,fallback:e.jsx(R,{}),children:e.jsx(yn,{})})}),e.jsx(s,{path:"rewards/*",element:e.jsx(p,{isAllowed:Ge,fallback:e.jsx(R,{}),children:e.jsx(Un,{})})}),e.jsx(s,{path:"/ai-cfo",element:e.jsx(p,{isAllowed:Z,fallback:e.jsx(R,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/",element:e.jsx(p,{isAllowed:Z,fallback:e.jsx(R,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/:session_id",element:e.jsx(p,{isAllowed:Z,fallback:e.jsx(R,{}),children:e.jsx(Fn,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"*",element:e.jsx(R,{})})]})}):null:(l(void 0),e.jsx(d,{to:`/${o}/onboarding`,replace:!0})):(l(void 0),e.jsx(d,{to:`/${o}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),l(void 0),e.jsx(d,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const Pn=5e3,Hn=({isDashboardAccess:l,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:o,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:W,showChargeCardRoute:H})=>{if(O===!0){if(b)return e.jsx(d,{to:"checking"});if(V)return e.jsx(d,{to:"treasury"});if(H)return e.jsx(d,{to:"cards"})}return W===!0&&H?e.jsx(d,{to:"cards"}):l?e.jsx(d,{to:"dashboard"}):b?e.jsx(d,{to:"checking"}):V?e.jsx(d,{to:"treasury"}):H?e.jsx(d,{to:"cards"}):N?e.jsx(d,{to:"bills"}):o?e.jsx(d,{to:"reimbursements"}):e.jsx(d,{to:"dashboard"})},p=({children:l,fallback:b,isAllowed:N})=>{const o=rn();return N?l:o?e.jsx(ln,{fetchState:"In-Progress"}):b},De=({tenantEmailDomain:l})=>e.jsx(d,{to:`/${l}/dashboard`});export{na as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BLpmr1Pv.js";import{a as d}from"./sentry-DWNq3t8E.js";import{h as Y,g as $,u as T,i as F,j as C,l as Z,n as J,o as k}from"./core-CbdTrw7T.js";import{fJ as w,Yn as je,Oy as ve,Xz as we,Yo as Ae,c8 as W,cM as De,cN as Ue,bp as Te,eg as _e,GQ as Re,Yp as Me,P$ as Be,Np as Ne,Ng as de,Nd as Ve,GU as ue,Nj as pe,Nm as ge,Ns as X,CY as ee,GT as Oe,lG as H,lJ as me,Yq as Ye,mT as Fe,H9 as Le,Yr as Ge,Ys as He,lE as $e,Yt as Ze,lH as Ke,v8 as ze,Yu as qe,Yv as Je,vc as Qe,i5 as We,VC as q,hZ as ae,hW as Xe,i2 as en,VD as nn,H6 as tn,Yw as an,Yx as on,NG as sn,mb as rn,eq as fe,er as he,Yy as ln,gG as cn,Wg as dn,H5 as oe,gL as se,gK as un,H4 as pn,gJ as gn,gI as mn,Yz as fn,V8 as Ce,YA as hn,YB as Cn,YC as bn,YD as yn,YE as Sn,YF as In,Hc as xn,YG as En,H3 as ie,GZ as G,YH as kn,YI as Pn,YJ as re,YK as jn,dG as vn,YL as wn,YM as An,YN as Dn,Vk as Un,dO as Tn,dV as _n,dU as Rn,dP as Mn,YO as Bn,dS as Nn,dR as Vn,dT as On,dQ as Yn}from"./zeni-epic-state-C5DO1jkr.js";import{b0 as Fn,z as v,V as L,a8 as ne,b7 as Ln,c as K,p as te,_ as V,i as be,K as ye,b8 as Gn,o as Hn,W as Se,b9 as $n,az as Zn,ba as Kn,bb as zn,aC as qn,bc as Jn,s as Qn,k as Ie,bd as Wn}from"./index-CnIO6_IQ.js";import{n as B}from"./mui-DNGY4bFU.js";import{u as xe}from"./useTaskManagerAccess-Cm5trA3i.js";import{U as Xn}from"./AccountMappingScreen-C5mOiJ2U.js";import{t as et,A as nt}from"./AddressScreen-DgUwrml_.js";import O from"./NotFoundScreen-DXy-BCit.js";import{g as tt}from"./analyticsHelper-CWMk7_rd.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DM_jBIuD.js";import{C as st}from"./CompanyPassportScreen-BLtXgkEd.js";import{M as R}from"./MobileAppDrawer-BWNb5zLN.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-qgk6N8cm.js";import{q as le}from"./QBOConnectionScreen-DroXrkno.js";import{B as lt}from"./BillPayApprovalRoutes-BcCgse3-.js";import{R as ct}from"./ReimbursementApprovalRoutes-B2ftFL0O.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";import"./accountMappingHelper-DSd2V454.js";import"./routePaths-CV12X_S-.js";import"./InboxNotificationsProvider-CiKEEv6Q.js";import"./useIsCustomersTabEnabled-C6mkabn2.js";import"./empty-CjoB5KP4.js";import"./pdf-lib-BKN88Kre.js";import"./index-LGKtWUy9.js";import"./url-B2x9G6No.js";import"./index-BNFAuGus.js";import"./decodeURIComponentSafe-D7APy95S.js";import"./useEnsureVendorListLoaded-CIShbpK4.js";import"./ReimbursementApprovalRuleDetailScreen-CHTcY28V.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="3dede6ee-5858-4d3d-887c-c76e2a2ba649",e._sentryDebugIdIdentifier="sentry-dbid-3dede6ee-5858-4d3d-887c-c76e2a2ba649")}catch{}})();const dt=B.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-ByIxqWJk.js";import{a as d}from"./sentry-9XsSr7s
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ut=
|
|
9
|
+
`,ut=Z((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=Y(),l=$(),o=T(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:y,isLoading:m}=Fn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const S=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,y)))}),[t,u,m,y,c?.tenantId,o]);const E=g=>{n(g)};return S?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:S.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-ByIxqWJk.js";import{a as d}from"./sentry-9XsSr7s
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,mt=
|
|
17
|
+
`,mt=Z((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=Y(),l=$(),o=T(),{tenantEmailDomain:i}=F(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,y]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),S=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Te(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,_=be(m,t,s),D=_e(m,r?.loggedInUserRoleMap)&&_,{isCardsHidden:I}=ye(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(y(!0),o(Re(!1)))}),[h,o,p]);const M=A=>{u(A)};return S||j||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:S,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(O,{})},ht=B.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-ByIxqWJk.js";import{a as d}from"./sentry-9XsSr7s
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=
|
|
25
|
+
`,Ct=Z((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ye(e,o),{uiState:t}=n,s=(W(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Se.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Ke(n))},updateCardPaymentModalState:n=>{e(Ze({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e($e(n,t,s))},handleFetchPaymentSources:()=>{e(H())},resetCardPaymentViewState:()=>{e(He())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Fe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))($n),bt=()=>{const e=Y(),l=$(),o=T(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>w(P))),y=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Hn(y.addCardPaymentSourceStatus.fetchState),S=y.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Oe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o(H()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&S==="Completed"&&o(H())}),[p,S]);const j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",yt=Z((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(We(t,q("payments"),s))},onNotifyMe:s=>{K.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Kn),St=()=>{const e=Zn(),l=Y(),o=T(),{tenantEmailDomain:i}=F(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),y=L(),m=W(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,S]=d.useState(!1);d.useEffect((()=>{p||(S(!0),o(H()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:_,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return y?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(yt,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:P,onAddPlaidAccount:_,onReLoginPlaidAccount:D,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-ByIxqWJk.js";import{a as d}from"./sentry-9XsSr7s
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,Et=()=>{const e=
|
|
41
|
+
`,Et=()=>{const e=T(),{tenantEmailDomain:l}=F(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),y=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:y,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-ByIxqWJk.js";import{a as d}from"./sentry-9XsSr7s
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,ce=({appContent:e})=>{const l=
|
|
49
|
+
`,ce=({appContent:e})=>{const l=T(),o=Y(),i=$(),[r,n]=d.useState(!1),t=C((b=>w(b))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=C((b=>rn(b))),E=fe(t),g=he(m,t),j=!g&&S,P=be(t,y,m),{isCardsHidden:_}=ye(t?.tenantId),D=!P||_,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((b=>cn(b,j))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=b=>{n(b)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:S,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:b=>{const N=(function(ke,Pe){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${Pe}`),z})(s,b),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:b=>{const N={...x.myProfileLocalData,phone:b};l(oe({localData:N})),l(mn(b,"MyProfile"))},onResendOtp:b=>{l(gn(b,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(b,N)=>{l(un(b,N,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&v.saveZeniOtpToken(b),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{l(oe({localData:b}))}})]})};function Pt(){const e=T(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>bn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:y}=xe(u),[m,p]=d.useState(!1),S=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(yn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(Sn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),_=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,b)=>{e(Pn({eventId:f,channel:re(U),enabled:b}))}),[e]),I=d.useCallback(((f,U)=>{e(jn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,b)=>{e(wn({groupId:f,channel:re(U),enabled:b}))}),[e]),M=d.useMemo((()=>{if(y&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[y,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:S}),a.jsx(Wn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{S(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:_,taskNotifications:M,isTaskNotificationsDirty:c})]})}function pa(e){const[l,o]=d.useState(!1),i=C((S=>Ce(S))),r=C((S=>w(S))),n=L(),t=Ie(),s=T(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),y=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||y!==!0?Tn(r)?a.jsxs(J,{children:[_n(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(bt,{})}),Yn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(St,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),y&&a.jsx(k,{path:"notifications",element:a.jsx(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function jt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{pa as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as u}from"./liveblocks-BLpmr1Pv.js";import{h as Q,g as X,u as ee,i as W,j as k,N,l as K,t as en}from"./core-CbdTrw7T.js";import{bK as nn,fJ as x,cz as tn,II as Y,Xz as an,XC as sn,vr as ne,vf as te,mL as ae,Cu as L,a1j as be,gK as Ke,gJ as He,gI as Ge,a1k as on,IR as cn,Np as Ce,Ng as he,Nd as Ie,MU as J,Nj as Ae,Nm as _e,Ns as ke,CY as ve,h3 as rn,ct as un,er as dn,eq as ln,d4 as pn,bs as mn,cm as Fe,ZY as yn,LU as fe,Mw as fn,ZU as gn,bL as Sn,OK as ge,Oy as bn,Yo as Cn,Y8 as hn,OO as In,OS as An,a18 as je,Cn as _n,Tt as kn,a1l as vn,a1m as Pn,a1n as Tn,a1o as qe,a1p as En,a1q as Dn,a1r as Un,YV as wn,a1s as On,$Q as Ye,N4 as Fn,MY as xn,a1t as Vn,N0 as Bn,$R as we,Py as Je,mT as jn,vi as Qe,Cw as Nn,bF as Ne,CI as Re,cw as Rn,$O as Xe,Po as Oe,P5 as Ln,P6 as zn,Pa as Mn,$T as $n,Pr as Le,$P as Zn,a1u as Wn,$S as Kn,Qd as Se,a1g as Hn,g_ as Gn,K1 as qn,a1v as Yn,K6 as Jn,K5 as Qn}from"./zeni-epic-state-C5DO1jkr.js";import{az as Pe,V as ie,p as de,_ as q,z as E,a9 as se,c as D,a8 as Te,R as Z,cZ as Xn,af as oe,bH as V,au as xe,c_ as et,b0 as nt,c$ as tt,B as Be,d0 as at,s as ze,bg as Me,a2 as it,ac as st,d1 as ot,d2 as ct,d3 as rt,w as ut}from"./index-CnIO6_IQ.js";import{a as h}from"./sentry-DWNq3t8E.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-DNGY4bFU.js";import{u as pt,d as $e,B as Ue}from"./BusinessVerificationPageScreen-DM_jBIuD.js";import{M as le}from"./MobileAppDrawer-BWNb5zLN.js";import R from"./NotFoundScreen-DXy-BCit.js";import{a as Ze}from"./analyticsHelper-CWMk7_rd.js";import{d as We}from"./routePaths-CV12X_S-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="3536c048-999f-4f91-a21c-4f24553fa64c",e._sentryDebugIdIdentifier="sentry-dbid-3536c048-999f-4f91-a21c-4f24553fa64c")}catch{}})();const mt=Ve.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as d}from"./liveblocks-ByIxqWJk.js";import{h as Y,g as Q,u as ee,i as W
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,yt=H((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=x(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(q(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(q(t,!0))},onEnableBillPayClick:()=>{e(X(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(q(t,!0))},onGetOtp:(n,i)=>{e(Ke(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(He(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Qn),ft=()=>{const e=Pe(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(J.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(J.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=k((m=>m.billPaySetupViewState.fetchState)),u=k((m=>x(m)));pt();const y=u.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||u.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(q(y,!1,!0))):(_.current=!0,t(q(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return d.jsx(N,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.Event.billPaySetup);return d.jsxs(mt,{children:[d.jsx(se,{analytics:D,onLoad:C=>m(C)}),d.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),d.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:u,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return d.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Gt=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Kt=e=>`/${e}/cards`,Jt=e=>`/${e}/cards/setup`,qt=e=>`/${e}/cards/onboard`,Xt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Yt=(e,o)=>e.find((a=>a.id===o)),Qt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=H((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=x(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(u,y)=>{e(ve("charge_card_setup",u,y))},onEstablishConnectionClick:u=>{e(ke(u,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(u,y,f)=>{e(_e(u,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(u,y)=>{e(Ae(!1,u,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(X(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(X(t,"charge_cards")):i===!0&&c===!1&&e(X(t,"debit_cards"))},onUpdateChargeCardClick:(u,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===u));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===u))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(u,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",u,y))},onUpdatePrimaryFundingAccount:(u,y)=>{const f=n.allFundingAccounts.find((m=>m.id===u)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===u))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",u,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(u,y)=>{e(be({officerType:u,fileIds:y}))},onSendForVerificationClick:u=>{l===!0&&i===!0?e(L(t,u,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(t,u,"charge_cards",!0,!0,!0)):i===!0&&e(L(t,u,"debit_cards",!0,!0,!0))},updateFilesEntity:u=>{e(ae({files:u}))},onDeleteFile:u=>{e(te(u))},onEditFileName:(u,y)=>{e(ne(u,y.split(".")[0]))},onUpdateAutoPayClick:u=>{e(fn(t,u))}}}))(et),ht=()=>{const e=Pe(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>x(M))),{useDynamicConfig:l,useFeatureGate:s}=ue(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(xe.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(J.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(J.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(J.isEarlyPayFeatureEnabled),{isFeatureEnabled:u}=s(J.isCardPolicyEnabled),y=k((M=>rn(M,i.companyId))),f=dn(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=un(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),O=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:O}),U=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,G]=h.useState(!1),[K,re]=h.useState(!1),Z=k((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{G(M)},pe=k((M=>yn(M,j)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{K||Z!=="Not-Started"||j==null?K||Z!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[K,Z,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,de=gt(A,C,b,v);return me||ye?me||ye?d.jsxs(d.Fragment,{children:[d.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,de,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),d.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),d.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:z,isCardPolicyEnabled:u,isDebitCardOnlyEnabled:U,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:de,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):d.jsx(Te,{fetchState:"Not-Started"}):d.jsx(N,{to:"../promo"})},It=Ve.div`
|
|
9
|
+
`,yt=K((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=x(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Y(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Y(t,!0))},onEnableBillPayClick:()=>{e(J(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(Y(t,!0))},onGetOtp:(n,i)=>{e(Ge(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ke(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Xn),ft=()=>{const e=Pe(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=de(),{isFeatureEnabled:s}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(q.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=k((m=>m.billPaySetupViewState.fetchState)),d=k((m=>x(m)));pt();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(Y(y,!1,!0))):(_.current=!0,t(Y(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(N,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded(Z.Event.billPaySetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Ht=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Gt=e=>`/${e}/cards`,qt=e=>`/${e}/cards/setup`,Yt=e=>`/${e}/cards/onboard`,Jt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Qt=(e,o)=>e.find((a=>a.id===o)),Xt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=K((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=x(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(ve("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ke(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(_e(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Ae(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(J(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(t,"charge_cards")):i===!0&&c===!1&&e(J(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(d,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(be({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(fn(t,d))}}}))(et),ht=()=>{const e=Pe(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((z=>x(z))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(xe.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(q.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(q.isCardPolicyEnabled),y=k((z=>rn(z,i.companyId))),f=un(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=dn(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),U=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:U}),w=C&&A===!1,B=C===!1&&A,M=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,H]=h.useState(!1),[G,re]=h.useState(!1),$=k((z=>z.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,O=E.getSignedInUser(),De=z=>{H(z)},pe=k((z=>yn(z,j)));if(O==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{G||$!=="Not-Started"||j==null?G||$!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[G,$,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=gt(A,C,b,v);return me||ye?me||ye?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded(Z.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),u.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:M,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:w,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):u.jsx(Te,{fetchState:"Not-Started"}):u.jsx(N,{to:"../promo"})},It=Ve.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as d}from"./liveblocks-ByIxqWJk.js";import{h as Y,g as Q,u as ee,i as W
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,At=H((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=x(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(X(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"reimbursement_setup",n,i))}}}))(tt),_t=()=>{const e=Pe(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=k((P=>P.remiSetupViewState.fetchState)),u=k((P=>x(P))),y=k((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(u?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??u.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||u.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(_(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return d.jsx(N,{to:"../promo"});if(u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.Event.reimbursementSetup);return d.jsxs(It,{children:[d.jsx(se,{analytics:D,onLoad:T=>P(T)}),d.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),d.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:u,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return d.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},kt=H((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=On(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Un(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:u,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:O,sourceOfFunds:A,companySubIndustry:U,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:G,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:j,usNexus:w,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Rn(I):void 0,phone:u,syncToken:m,fileIds:C,incDate:P!=null?Ne(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:O?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:U?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((de=>de.length===2?de:ze(de)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:G,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:j,usNexus:w,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Re({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:u,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:u?.selectedOption!=null?ze(u.selectedOption):void 0,phone:v,birthday:f!=null?Ne(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Re({officers:c}))},onSaveDetailsClick:s=>{e(L(a,s,t))},onSendForVerificationClick:s=>{e(L(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Nn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Ye(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ke(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(He(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Xe())},onOverlayClose:()=>{e(Ue())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=Vn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(xn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Y(),r=Q(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=ue(),I=Ee(),{configValue:u}=_(xe.zeniAccountsConfig),y=je(u),f=k((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=k((A=>A.companyConfigState.fetchState)),b=k((A=>A.userRoleConfigState.fetchState)),m=k((A=>x(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(_n()),b==="Not-Started"&&n(kn(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=k((A=>{let U;switch(e){case"zeni_accounts":U=En(A,C);break;case"zeni_treasury":U=Je(A,C);break;case"charge_cards":U=Tn(A,C);break;case"reimbursement":U=Pn(A,C);break;default:U=vn(A,C)}return U})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&(Ze(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let O;switch(e){case"zeni_accounts":O=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":O=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":O=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":O=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:O=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return O===!1?null:P.fetchState==="Completed"&&O===!0&&S?.loggedInUserRoleMap!=null?d.jsxs(d.Fragment,{children:[d.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),d.jsx(kt,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):d.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=Je(e,t),p=a&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=Zn(e),S=g.transactions,_=qe(e),I=g.accountSummary?.totalBalance?.amount,u=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:u,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Hn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(we(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ke(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(we(t,!0))},onEnableTreasuryClick:()=>{e(X(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(L(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Le(!1))}c===!0&&e(Xe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(Ue())}}}))(ot),Et=()=>{const e=Pe(),o=Y(),a=Q(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=ue(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(xe.zeniAccountsConfig),_=je(S),[I,u]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),O=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),U=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>x(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Qe(w,F))),G=ce.isAtomicAccountExists,K=E.getSignedInUser(),re=w=>{u(w)};if(K==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||O!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,O,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Ln()))}),[v,A,F,t]),h.useEffect((()=>{m||U!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,U,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(zn(!0)))}),[P,B,F,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||O!=="Completed"||G||j||!a.pathname.includes("setup")||p(!0)}),[O,G,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?d.jsx(N,{to:"../promo"}):d.jsxs(d.Fragment,{children:[d.jsx(se,{analytics:D,onLoad:()=>{}}),d.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),d.jsx(ut,{onClose:()=>{t(Ue()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:d.jsx(Dt,{onClick:w=>w.stopPropagation(),children:d.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ue()),o("../setup")}})})}),d.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:G,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=Ve(lt)`
|
|
17
|
+
`,At=K((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=x(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(J(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"reimbursement_setup",n,i))}}}))(tt),_t=()=>{const e=Pe(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=k((P=>P.remiSetupViewState.fetchState)),d=k((P=>x(P))),y=k((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(_(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(N,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded(Z.Event.reimbursementSetup);return u.jsxs(It,{children:[u.jsx(se,{analytics:D,onLoad:T=>P(T)}),u.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},kt=K((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Un(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=wn(e.companyConfigState),p=On(e.userRoleConfigState),g=t==="zeni_treasury"?Ye(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:U,sourceOfFunds:A,companySubIndustry:w,countriesOfOperations:B,companySourceOfFunds:M,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:H,purposeOfAccount:G,purposeOfAccountDescription:re,regulatedStatus:$,regulatedStatusDescription:j,usNexus:O,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Rn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:P!=null?Ne(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:U?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:w?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:Me(ue)))??[],companySourceOfFunds:M?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:G?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:$??"",regulatedStatusDescription:j,usNexus:O,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Re({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:U,treasuryUserVerificationStatus:A,fileIds:w}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:v,birthday:f!=null?Ne(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:U,treasuryUserVerificationStatus:A,fileIds:w,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Re({officers:c}))},onSaveDetailsClick:s=>{e(L(a,s,t))},onSendForVerificationClick:s=>{e(L(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Nn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Qe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ke(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Je())},onOverlayClose:()=>{e(we())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=Vn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(xn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Q(),r=X(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=de(),I=Ee(),{configValue:d}=_(xe.zeniAccountsConfig),y=je(d),f=k((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=k((A=>A.companyConfigState.fetchState)),b=k((A=>A.userRoleConfigState.fetchState)),m=k((A=>x(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(_n()),b==="Not-Started"&&n(kn(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),$e(n,e,C))}),[c,f,C,n]);const P=k((A=>{let w;switch(e){case"zeni_accounts":w=En(A,C);break;case"zeni_treasury":w=qe(A,C);break;case"charge_cards":w=Tn(A,C);break;case"reimbursement":w=Pn(A,C);break;default:w=vn(A,C)}return w})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&($e(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let U;switch(e){case"zeni_accounts":U=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":U=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":U=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":U=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:U=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return U===!1?null:P.fetchState==="Completed"&&U===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(w=>{switch(e){case"zeni_accounts":return w.trackPageLoaded(Z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return w.trackPageLoaded(Z.Event.reimbursementBusinessVerification);default:return w.trackPageLoaded(Z.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(kt,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=K((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Xe(e,t),c=qe(e,t),p=a&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=$n(e),S=g.transactions,_=Ye(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Kn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Oe(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ke(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(Oe(t,!0))},onEnableTreasuryClick:()=>{e(J(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(L(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Le(!1))}c===!0&&e(Je())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Ze(s)),e(Zn(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(we())}}}))(ot),Et=()=>{const e=Pe(),o=Q(),a=X(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=de(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(xe.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),U=k((O=>O.treasurySetupViewState.fetchState)),A=k((O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),w=k((O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((O=>O.treasuryDetailState.transactionsState?.fetchState)),M=k((O=>x(O))),F=E.getSignedInUserTenant(i)?.companyId??M.companyId,ce=k((O=>Xe(O,F))),H=ce.isAtomicAccountExists,G=E.getSignedInUser(),re=O=>{d(O)};if(G==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||U!=="Not-Started"||F==null||(f(!0),t(Oe(F,!0,!1)))}),[y,U,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Ln()))}),[v,A,F,t]),h.useEffect((()=>{m||w!=="Not-Started"||F==null||(C(!0),t(zn()))}),[m,w,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(Mn(!0)))}),[P,B,F,t]);const $=M.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=$==="pending_review"||$==="verified";return h.useEffect((()=>{c||U!=="Completed"||H||j||!a.pathname.includes("setup")||p(!0)}),[U,H,j]),M.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(N,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(dt,{onClose:()=>{t(we()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Dt,{onClick:O=>O.stopPropagation(),children:u.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(we()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:M,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=Ve(lt)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,
|
|
21
|
+
`,Ut=K((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Hn(e,t),c=a&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Se(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(ve("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(Se(t,!0))},onEnableZeniAccountClick:()=>{e(J(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"zeni_accounts","account_setup"):Ie("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(ct),wt=()=>{const e=Pe(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=de(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(xe.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=k((b=>b.zeniAccountSetupViewState.fetchState)),d=k((b=>x(b))),y=E.getSignedInUserTenant(r)?.companyId??d.companyId,f=E.getSignedInUser(),v=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(Se(y,!1,!0)):(_(!0),t(Se(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(N,{to:"../promo"});{const b=m=>m.trackPageLoaded(Z.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(le,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),u.jsx(Ut,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{v(!0)}})]})}},Ot=Ve.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as d}from"./liveblocks-ByIxqWJk.js";import{h as Y,g as Q,u as ee,i as W
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Ft=
|
|
29
|
+
`,Ft=K((function(e,o){const a=x(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Yn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Qn(t))},onSubmitClick:()=>{e(Jn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Qe(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(rt),xt=()=>{const e=Q(),o=X(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=de(),{isFeatureEnabled:S}=g(q.isBillPayLocalCurrencyFeatureEnabled),_=k((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=k((T=>T.billPaySetupViewState.fetchState)),d=k((T=>x(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,v=k((T=>Gn(T.companyState,d.companyId))),b=v?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||_!=="Not-Started"||f==null||(r(!0),a(qn(f)))}),[t,_,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a(Y(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=T=>{s(T)};return C===!1?u.jsx(N,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Ot,{children:[u.jsx(se,{analytics:D,onLoad:T=>(U=>U.trackPageLoaded(Z.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?u.jsx(le,{isAppContentDrawerOpen:l,handleDrawerToggle:P}):null,u.jsx(Ft,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Vt=K((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(ge(a,!0,!0));break;case"zeni_accounts":e(Se(a,!0,!0));break;case"charge_cards":e(fe(a,!0,!0));break;case"zeni_treasury":e(Oe(a,!0,!0));break;default:e(Y(a,!0,!0))}}}}}))(ut((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Ue,{productType:s}):a?u.jsx(N,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(xt,{}):a?u.jsx(N,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ft,{}):a?u.jsx(N,{to:"../"}):u.jsx(R,{})}case"reimbursement":return c==="verification"?t?u.jsx(Ue,{productType:s}):u.jsx(R,{}):t?u.jsx(_t,{}):u.jsx(R,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(R,{}):r?u.jsx(wt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(R,{});case"charge_cards":return c==="verification"?i?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(N,{to:"../"}):u.jsx(R,{}):i?u.jsx(ht,{}):l?u.jsx(N,{to:"../"}):u.jsx(R,{})}})));function ua(e){const{tenantEmailDomain:o}=W(),a=k((r=>x(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Vt,{...e,companyId:a,...t})}export{ia as A,sa as P,ua as S,na as a,aa as b,St as c,bt as d,gt as e,oa as f,Jt as g,Gt as h,ea as i,ta as j,ca as k,Xt as l,Qt as m,qt as n,Yt as o,Ht as p,ra as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-BLpmr1Pv.js";import{a as u,R as T,v as A}from"./sentry-DWNq3t8E.js";import{u as z,h as D,j as c,g as M,N as O,l as V}from"./core-CbdTrw7T.js";import{u as j,z as s,c as E,G as P,Q as F,R as _,T as B,S as N,U as J,W as v}from"./index-CnIO6_IQ.js";import{fJ as R,V4 as W,ha as $,gm as q,go as Q,Vo as Z,gZ as G,d5 as H,Vp as U,Vq as K,Vr as X,e0 as y}from"./zeni-epic-state-C5DO1jkr.js";import{u as Y}from"./mui-DNGY4bFU.js";import{u as ee}from"./useDeviceId-dj9QS4Ga.js";import{f as te}from"./analyticsHelper-CWMk7_rd.js";import{t as ne}from"./getLocaleForTenant-B8EqveGi.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.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]="c28c4d3e-3fb7-4694-983d-5115251020ef",t._sentryDebugIdIdentifier="sentry-dbid-c28c4d3e-3fb7-4694-983d-5115251020ef")}catch{}})();const ie=V((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(K(n,a)))},clearSignInError:()=>{t(U())}}}))(J),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),L=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>R(e))),I=c((e=>W(e))),m=M(),w=Y().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants($(I.tenantsInOrder),o.zeniSessionId),q(o.userId,o.zeniSessionId,r.tenantId),i(Q(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Z("Completed")),P.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=N();e!=null&&F(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx(B,{onClose:()=>i(U()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BLpmr1Pv.js";import{a as i}from"./sentry-DWNq3t8E.js";import{u as l,g as c,N as u}from"./core-CbdTrw7T.js";import{z as n,c as a,R as m,a8 as p}from"./index-CnIO6_IQ.js";import{h0 as g,VE as y}from"./zeni-epic-state-C5DO1jkr.js";import{n as h}from"./mui-DNGY4bFU.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="de381f14-fb98-4da3-9fa1-49f0e2e51a18",e._sentryDebugIdIdentifier="sentry-dbid-de381f14-fb98-4da3-9fa1-49f0e2e51a18")}catch{}})();function N(){const e=l(),t=c(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(b,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const b=h.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`;export{N as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as A}from"./liveblocks-BLpmr1Pv.js";import{a as u}from"./sentry-DWNq3t8E.js";import{u as H,k as J,j as C,h as Se,g as me,i as ye,l as De}from"./core-CbdTrw7T.js";import{z as M,p as Ee,_ as R,al as be,a9 as he,c as Ce,R as Ge,di as Ae,s as F,a5 as Re}from"./index-CnIO6_IQ.js";import{R4 as Ie,RR as ve,fJ as Be,a1X as ne,gR as V,a1Y as re,a1Z as Le,Rl as X,a1_ as Ke,Rx as Y,R6 as we,QK as Ue,S1 as ee,a1$ as ae,gl as Pe,RU as Fe,RZ as je,RM as xe,RK as te,R_ as $e,RH as Oe,a20 as Ne,a21 as Ze,a22 as ze,a23 as Me,a24 as I,di as Ve,dh as qe,a25 as Qe,R3 as We}from"./zeni-epic-state-C5DO1jkr.js";import{n as He}from"./mui-DNGY4bFU.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";import{M as Xe}from"./MobileAppDrawer-BWNb5zLN.js";import{u as Ye}from"./useTaskManagerPusherEvents-C1gzc-aA.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="952d4c67-e22a-4d0e-94ea-8730fd28c1a6",e._sentryDebugIdIdentifier="sentry-dbid-952d4c67-e22a-4d0e-94ea-8730fd28c1a6")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as G}from"./liveblocks-ByIxqWJk.js";import{a as u}from"./sentry-9XsSr7s
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,na=De((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,y=Le(e),f=
|
|
9
|
+
`,na=De((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,y=Le(e),f=M.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(f,a),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D}})},onReloadTasks:()=>{e(V(!0,y))},onTabChange:a=>{e(Me(a))},onParentTaskClick:a=>{const s=se(f,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=z(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(ae({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ze({filters:a}))},onSearchTextChanged:a=>{e(Ze({searchText:a}))},onReloadCards:()=>{e(V(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const a=Re(p.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:a.newStack}})}else n("../")},updateLocalData:a=>{e(Ne({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Oe(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(te(t.localData.selectedTaskIds,a,$e(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(xe(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=oa(v,a);e(X({taskDetailLocalData:s}));const D=z(f,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(D,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(je(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(Fe(a,s))},onTimeSpentUpdate:(a,s)=>{e(ee({task:a,updates:s}))},onShowToast:a=>{e(Pe(a))},onGroupByFilterChange:a=>{e(ae({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(ee({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(Ue(a,s))},onSubtaskCreation:(a,s)=>{e(we({...s,parentTaskId:a}))},handleGroupTemplateClick:a=>{e(Y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(Y(a,[s]))},handleNewTaskInitialization:a=>{if(e(X({taskDetailLocalData:{...Ke,name:a}})),t.localData.defaultTaskGroupId!=null){const s=z(f,t.localData.defaultTaskGroupId),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${f}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=Se(),t=H(),n=me(),c=M.getSignedInUser(),p=M.isZeniUser(),y=J(),f=C((d=>Be(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=Ee(),{isFeatureEnabled:s}=a(R.isTaskTemplatesEnabled),{isFeatureEnabled:D}=a(R.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=a(R.isTaskCategorizationEnabled),{isFeatureEnabled:ie}=a(R.isTaskBulkResolutionEnabled),{isFeatureEnabled:le}=a(R.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ue}=a(R.isTaskRecurringParentEnabled),[ce,de]=u.useState(!1),$=C((d=>ne(d,s))),O=C((d=>d.taskGroupState)),B=$.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});be({isDataReady:B==="Completed"});const{markBoardFetchInFlight:q,requestTaskRefetch:N}=(function(d){const S=H(),r=J(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),m=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,m.current=!0}),[r]),w=u.useCallback((()=>{K(),S(Ie())}),[S,K]),E=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,S(ve())}),[S,r]),b=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:E()}),[w,E,r]),Z=u.useCallback((()=>{m.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(m.current=!1,b())}),6e3))):b()}),[b,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=C((i=>i.taskListState.fetchState)),G=C((i=>i.taskGroupViewState.fetchState)),U=C((i=>i.taskListState.byTab.live)),P=C((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!m.current||U!==L.current||h==="Error")&&(m.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):b()))}),[h,U,b]),u.useEffect((()=>{G!=="In-Progress"&&(!k.current||P!==g.current||G==="Error")&&(k.current=!1,o.current&&(o.current=!1,G!=="Error"&&E()))}),[G,P,E]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:Z}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||q(),t(V(!1,s))}),[f?.tenantId,t,s,q,y]);const fe=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],S=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(f?.companyId,d),...aa(c?.userId,S)]}),[f?.companyId,c?.userId]);if(Ye({events:fe,onEvent:(d,S)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oe(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(S);if(r!=null){const T=y.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,m=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&m.add(r.created_by),!(l!=null&&m.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),m=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=m.length===L.length&&m.every((i=>L.includes(i))),w=k.taskGroupIds??[],E=r.task_group_ids??[],b=w.length!==E.length||!w.every((i=>E.includes(i))),Z=(i,Te)=>{const Q=i??[],W=Te??[];if(Q.length!==W.length)return!1;const ge=new Set(W);return Q.every((_e=>ge.has(_e)))},h=r.name==null||r.name===k.name,G=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||Z(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&b&&h&&G&&U&&P)return}}return void N()}case _.TASKS_BULK_DELETED:{const r=ta(S);return r==null?void 0:void r.task_ids.forEach((T=>t(We(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void N()}},onSubscribed:()=>{N()}}),u.useEffect((()=>{B==="Completed"&&t(re({taskGroupById:O.taskGroupById}))}),[B,O.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[B==="Completed"?A.jsx(he,{analytics:Ce,onLoad:d=>(S=>S.trackPageLoaded(Ge.Event.taskListPage))(d)}):null,A.jsxs(sa,{children:[A.jsx(Xe,{isAppContentDrawerOpen:ce,handleDrawerToggle:d=>{de(d)}}),A.jsx(na,{location:n,navigate:e,currentTenant:f,taskGroupId:v,taskGroupState:O,localData:$.localData,uiState:$.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:D,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,z=(e,t)=>`/${e}/tasks/new/${t}`,oa=(e,t)=>{if(e==="assignee"){const n=t.split(",");return{...I.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Ve(t);return{...I.taskDetailLocalData,priority:n}}if(e==="status"){const n=qe(t);return{...I.taskDetailLocalData,status:n}}if(e==="tag"){const n=t.split(",");return{...I.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qe(t);return{...I.taskDetailLocalData,dueDate:n}}return{...I.taskDetailLocalData}},Sa=Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}));export{_ as T,aa as a,ea as b,_a as c,ta as d,ra as e,Sa as f,ga as t};
|