@zeniai/web-app-ui 5.3.72-qa → 5.3.73-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/assets/{AccountMappingScreen-CJvl5JXJ.js → AccountMappingScreen-BMF0Tz3u.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-BUq34KSF.js → ActualMatchingMatchDetailScreen-Rggm2rdO.js} +1 -1
  3. package/dist/assets/AddressRoutes-BZC_tHw2.js +1 -0
  4. package/dist/assets/AddressScreen-DFE2TJ9k.js +9 -0
  5. package/dist/assets/AiCfoScreen-B_p5VtI6.js +22 -0
  6. package/dist/assets/{AppDrawer-sYdSE7DV.js → AppDrawer-R5VCAsby.js} +2 -2
  7. package/dist/assets/{BillPayApprovalRoutes-BZEAdInR.js → BillPayApprovalRoutes-DEnTFgOn.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-169K6hbL.js → BillPayRoutes-5mL9KAIs.js} +18 -18
  9. package/dist/assets/BusinessVerificationPageScreen-qcXHutsr.js +9 -0
  10. package/dist/assets/CardsAiCfoScreen-Dw7dZ_97.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-BwNBtpIG.js → ChargeCardRoutes-C2lrQn9u.js} +6 -6
  12. package/dist/assets/{CompanyPassportScreen-D45sXsrZ.js → CompanyPassportScreen-DEU4R8qu.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-DVcYkdE2.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-ZpFTwhtd.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BFxNnHJO.js → CustomerOnboardingRoutes-Bf4kkdxH.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-Co7U6uRf.js → DashboardRoutes-BsfGVh_g.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-CpT6ByaT.js → DefaultTenantHome-BIV3jYpV.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-CdZcuM7h.js → DomesticWireDetailScreen-DyJdRubn.js} +4 -4
  19. package/dist/assets/{DrawerScreen-Crjhobh0.js → DrawerScreen-iM0qHGwt.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-BZi1PXPE.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-DoAFvlJW.js → ExpenseAutomationRoutes-C_sek1OP.js} +3 -3
  22. package/dist/assets/FeaturePreviewScreen-BMIapAWv.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-CNCXJJC-.js +1 -0
  24. package/dist/assets/{InboxNotificationsProvider-CH-l5W7V.js → InboxNotificationsProvider-Dho-IKGo.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-DZfc_GJQ.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-D-AUoRWa.js → MagicLinkRoutes-qpf9fu2s.js} +8 -8
  27. package/dist/assets/MagicLinkSignInScreen-BJUai8Da.js +12 -0
  28. package/dist/assets/{MobileAppDrawer-DfT3Wv4q.js → MobileAppDrawer-OUkc6SS6.js} +1 -1
  29. package/dist/assets/NotFoundScreen-D6Ewfl9l.js +1 -0
  30. package/dist/assets/NotificationRoutes-Dq5J6WUt.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-DZv3rpk0.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-DosVgEtp.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-OFX6JRL7.js → PaymentLinkScreen-Nf5jY6jx.js} +5 -5
  34. package/dist/assets/PeopleRoutes-fi0bv8NG.js +22 -0
  35. package/dist/assets/PerformanceRoutes-d-Ak-y5B.js +1 -0
  36. package/dist/assets/{Preview-Ch5xsyMl.js → Preview-BkEDyesO.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-BnxzdDn6.js → QBOConnectionScreen-3Q-D8A_V.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-KqZCzo-T.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DA2wxNvn.js → ReimbursementApprovalRuleDetailScreen-wJwhX9oS.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-DtigAZux.js → ReimbursementRoutes-NsJfERMF.js} +7 -7
  41. package/dist/assets/{ReportsRoutes-IMfpdgLc.js → ReportsRoutes-BzSGYOeE.js} +1 -1
  42. package/dist/assets/RewardsRoutes-Dfq5a4nJ.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DVmtIBPW.js → ScheduleDetailsPrepaidExpensesScreen-Ch5YyOE1.js} +5 -5
  44. package/dist/assets/ScreenRoutes-Ct-XeoIp.js +2 -0
  45. package/dist/assets/{SettingsRoutes-CPIpAqIx.js → SettingsRoutes-BwbR1Hav.js} +6 -6
  46. package/dist/assets/SetupPagesScreen-CaUjvNzq.js +29 -0
  47. package/dist/assets/SignInScreen-lXlYsOPt.js +1 -0
  48. package/dist/assets/SignOutScreen-D7BxB8Kw.js +9 -0
  49. package/dist/assets/TaskListScreen-BEbbR5qA.js +9 -0
  50. package/dist/assets/TaskRoutes-BTpCvY45.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-BDtVKFcV.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-BWee1nGS.js → TransactionDetailScreen-DqTnN7lb.js} +2 -2
  53. package/dist/assets/TransactionListRoutes-D95fLm7G.js +1 -0
  54. package/dist/assets/{TreasuryRoutes-B_J15-lg.js → TreasuryRoutes-933b-w57.js} +6 -6
  55. package/dist/assets/{VendorsRoutes-5DKAWmAO.js → VendorsRoutes-DNocUq8r.js} +13 -13
  56. package/dist/assets/WiseConfirmationScreen-D26sFhH6.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-C8P1BGhH.js → ZeniAccountRoutes-DqkD5Tj5.js} +11 -11
  58. package/dist/assets/{ZeniAccountStatementScreen-D7BQE1Xy.js → ZeniAccountStatementScreen-CCsR6oS6.js} +2 -2
  59. package/dist/assets/{accountMappingHelper-CnG-eRj3.js → accountMappingHelper-BCIxYvce.js} +1 -1
  60. package/dist/assets/{analytics-DlzSqyvZ.js → analytics-BPoZyeUe.js} +1 -1
  61. package/dist/assets/{analyticsHelper-BlLXbdz8.js → analyticsHelper-CLRmzZBe.js} +1 -1
  62. package/dist/assets/{core-D07hD3KT.js → core-DV1n0xnE.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-D3MFRtCF.js → decodeURIComponentSafe-DV_H_U9m.js} +1 -1
  64. package/dist/assets/{dnd-B-KpYfWT.js → dnd-DhK11Cna.js} +1 -1
  65. package/dist/assets/{empty-DRbThjIF.js → empty-CfvnUFQM.js} +1 -1
  66. package/dist/assets/{empty-aXh7noZx.js → empty-ClI4oFTo.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-BZocj0UF.js → emptyVideoElement-2jnCmpFX.js} +1 -1
  68. package/dist/assets/epic-CC17XF7h.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-DKDAgt14.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-xajEPLim.js → getLocaleForTenant-DSuDxBKk.js} +1 -1
  71. package/dist/assets/{index-z9Fh-4S1.js → index-2jvQLAuX.js} +1 -1
  72. package/dist/assets/{index-YyHAbx34.js → index-BDemtU3L.js} +1 -1
  73. package/dist/assets/{index-BVdX_ubi.js → index-CNybyuHc.js} +2 -2
  74. package/dist/assets/{index-BXZoRXDS.js → index-CQb5WoEC.js} +16523 -16600
  75. package/dist/assets/{index-BIOOl02m.js → index-DPAuplgY.js} +1 -1
  76. package/dist/assets/{index-54OCX1PW.js → index-MBli9fvW.js} +1 -1
  77. package/dist/assets/{index-BxmwktwS.js → index-bS-O_x7p.js} +1 -1
  78. package/dist/assets/{index-D5s14gxd.js → index-dHB9hLbY.js} +1 -1
  79. package/dist/assets/{lexical-NIxvAmS2.js → lexical-Dm0ggfHI.js} +1 -1
  80. package/dist/assets/{liveblocks-CQOAuUNI.js → liveblocks-ByZ2hLlh.js} +1 -1
  81. package/dist/assets/{lottie-BIKpYE12.js → lottie-DLdOGyRC.js} +1 -1
  82. package/dist/assets/{mui-XiTT8YBC.js → mui-jYJOd_FH.js} +1 -1
  83. package/dist/assets/{pathToGoBack-RICxbZCJ.js → pathToGoBack-DU0I2V0d.js} +1 -1
  84. package/dist/assets/{pdf-Dli3mGO_.js → pdf-BNP0Aa3G.js} +4 -4
  85. package/dist/assets/{pdf-lib-D9XJLVoD.js → pdf-lib-Ghg8u77u.js} +1 -1
  86. package/dist/assets/{plaid-BG3pJamN.js → plaid-DlHdcMRS.js} +1 -1
  87. package/dist/assets/{pusher-D9DkHuMx.js → pusher-fCgL3t87.js} +1 -1
  88. package/dist/assets/{react-CrrxpEIc.js → react-0tUPWmny.js} +1 -1
  89. package/dist/assets/{react-C1d1ocIu.js → react-BGoKcGI1.js} +1 -1
  90. package/dist/assets/{react-DkT18Fv5.js → react-BNT2BnLs.js} +1 -1
  91. package/dist/assets/{react-D2I9LF0A.js → react-BfvxJ9E4.js} +1 -1
  92. package/dist/assets/{react-BLzCbojr.js → react-Dw9erbfr.js} +1 -1
  93. package/dist/assets/{react-C-5ZNsBH.js → react-yLaffN1I.js} +1 -1
  94. package/dist/assets/{recharts-CgYqsGTH.js → recharts-DzomOU1a.js} +1 -1
  95. package/dist/assets/{routePaths-D5u7Fiee.js → routePaths-BHNMdM_O.js} +1 -1
  96. package/dist/assets/{sentry-pp_6zWNc.js → sentry-DhrLg200.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-DA-gXJ77.js → stripSplatSuffix-vMLM3ll3.js} +1 -1
  98. package/dist/assets/{url-TK5h7pVR.js → url-C0FnX-Y1.js} +1 -1
  99. package/dist/assets/{url-yI9BET_f.js → url-DRLt9vS2.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-DkjGGAdb.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-cfyM2Cui.js → useAiCfoDashboardSuggestedQuestionsChips-COl_xk2g.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-Dz2Nti66.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-CS7T_ZQN.js → useChargeCardPusherEvents-Cl6UaMMU.js} +1 -1
  104. package/dist/assets/{useDeviceId-DCPRNX-s.js → useDeviceId-B0EeDKbI.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-ClTbOAmR.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-COOzD5oF.js → useInitialThreadRequest-D99s7mit.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-B51fCe2G.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-D8-vSEDU.js → useTaskManagerPusherEvents-D5Tw9apk.js} +1 -1
  109. package/dist/assets/{utils-CrOdvv6w.js → utils-CHwCuPu8.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-eLmj1Ps-.js → withTransactionSidePanel-B8yI0Nfh.js} +4 -4
  111. package/dist/assets/{zeni-epic-state-B3TABHgO.js → zeni-epic-state-Cw9Z8Rxj.js} +6 -6
  112. package/dist/index.html +1 -1
  113. package/package.json +4 -4
  114. package/dist/assets/AddressRoutes-CRp3rVsa.js +0 -1
  115. package/dist/assets/AddressScreen-qpYsmNQj.js +0 -9
  116. package/dist/assets/AiCfoScreen-Cgg6z7vY.js +0 -22
  117. package/dist/assets/BusinessVerificationPageScreen-Bg2PTPOO.js +0 -9
  118. package/dist/assets/CardsAiCfoScreen-ClyuumNF.js +0 -14
  119. package/dist/assets/ConnectionAuthScreen-Ch3SMbL0.js +0 -11
  120. package/dist/assets/CustomerOnboardingAuthScreen-DUAU8WBE.js +0 -1
  121. package/dist/assets/EntityDetailRoutes-DBE0e8tk.js +0 -1
  122. package/dist/assets/FeaturePreviewScreen-WjMnw8KV.js +0 -1
  123. package/dist/assets/HubSpotOAuthCallbackScreen-Co1Efhtt.js +0 -1
  124. package/dist/assets/InvoicingRoutes-B-rSWSFX.js +0 -2
  125. package/dist/assets/MagicLinkSignInScreen-CRDcdldu.js +0 -12
  126. package/dist/assets/NotFoundScreen-CBsVugJE.js +0 -1
  127. package/dist/assets/NotificationRoutes-DXLsGRw8.js +0 -1
  128. package/dist/assets/OAuthConsentScreen-HPHCSEZf.js +0 -1
  129. package/dist/assets/PandLWithForecastRoutes-CFIV5ASt.js +0 -1
  130. package/dist/assets/PeopleRoutes-DMreo66A.js +0 -22
  131. package/dist/assets/PerformanceRoutes-BpHHBv6i.js +0 -1
  132. package/dist/assets/ReimbursementApprovalRoutes-Di_UQPZB.js +0 -1
  133. package/dist/assets/RewardsRoutes-QcnfJ0I2.js +0 -1
  134. package/dist/assets/ScreenRoutes-BLGmNmRV.js +0 -2
  135. package/dist/assets/SetupPagesScreen-DUwJ2VLm.js +0 -29
  136. package/dist/assets/SignInScreen-6knrOqTO.js +0 -1
  137. package/dist/assets/SignOutScreen-Yk4k3uR0.js +0 -9
  138. package/dist/assets/TaskListScreen-CjEfkJDx.js +0 -9
  139. package/dist/assets/TaskRoutes-lIMUyAfY.js +0 -9
  140. package/dist/assets/TransactionDetailRoutes-D7Rn2JsN.js +0 -1
  141. package/dist/assets/TransactionListRoutes-xPkgCyOq.js +0 -1
  142. package/dist/assets/WiseConfirmationScreen-Bor5L5ul.js +0 -12
  143. package/dist/assets/epic-Du2AdUHP.js +0 -2
  144. package/dist/assets/expenseAutomationHelper-CL7YOVzM.js +0 -1
  145. package/dist/assets/useActualMatchingMatchDetail-9njfwmJo.js +0 -1
  146. package/dist/assets/useAskAiCfoHostNavButtonProps-C9O3AmSz.js +0 -1
  147. package/dist/assets/useEmailConnectResultRefresh-50p1dphC.js +0 -1
  148. package/dist/assets/useTaskManagerAccess-Dvad4Vb6.js +0 -1
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-CQOAuUNI.js";import{h as W,u as Y,g as H,i as z,j as d,l as J,n as K,o as S}from"./core-D07hD3KT.js";import{fI as v,Aj as R,vb as Q,VG as M,v6 as C,bq as X,c0 as Z,v7 as ee,VH as ae,Vo as y,ek as te,E7 as se,VI as oe,Ev as re,e0 as ne,d$ as ce}from"./zeni-epic-state-B3TABHgO.js";import{ai as ie,z as le,aq as de,as as me,W as fe,a8 as pe,k as w,aD as ue,p as he,H as Fe,y as ge}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import Ie from"./NotFoundScreen-CBsVugJE.js";import{F as be}from"./FeaturePreviewScreen-WjMnw8KV.js";import{a as F}from"./sentry-pp_6zWNc.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import{u as ye}from"./useInitialThreadRequest-COOzD5oF.js";import{t as Ce}from"./routePaths-D5u7Fiee.js";import{M as Te}from"./MobileAppDrawer-DfT3Wv4q.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./InboxNotificationsProvider-CH-l5W7V.js";import"./useTaskManagerAccess-Dvad4Vb6.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="e4699ee8-5173-46b6-8190-eecc81f1e9e4",s._sentryDebugIdIdentifier="sentry-dbid-e4699ee8-5173-46b6-8190-eecc81f1e9e4")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(M(a,o)),e.isPandLReportFetched(a)||s(C(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(y({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Ce(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(y({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(y({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=W(),a=Y(),o=H(),{forecastId:r,tenantEmailDomain:c}=z(),[p,u]=F.useState(!1),[m,A]=F.useState(!1),g=le.getSignedInUser(),D=d((t=>v(t))),q=D.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),k=d((t=>t.profitAndLossState)),x=d((t=>t.reportUIOptionsState.selectedForecast)),j=t=>k.pandLByForecastID[t]!=null&&ee(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:V,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!m){A(!0);const t=((f,P,O)=>P!=null?f.forecasts.findIndex((b=>b.id===P)):O!=null?f.forecasts.findIndex((b=>b.id===O)):f.forecasts.length>0?0:-1)(i,r,x?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=x?.index?(a(M(i.forecasts[t].id,t)),T(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&T(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!j(i.forecasts[t].id)&&I&&a(C(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,R,C,I]);const E=fe(),_=E?.loggedInUserRole!=null&&X(E.loggedInUserRole),B=ye(D?.companyId,{clearParams:l&&m}),[N,G]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const L=t=>{G(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:N,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:q,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:j,meetingUrl:Z(h.toString()),hasTransactionAccess:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:$,initialOpenThreadRequest:B,onClickMenuIcon:()=>{L(!0)}})]})}function ze(){const s=d((c=>v(c))),{useFeatureGate:e}=Fe(),{isFeatureEnabled:a}=e(ge.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{ze as default};
@@ -1,22 +0,0 @@
1
- import{j as a}from"./liveblocks-CQOAuUNI.js";import{VC as re,fI as N,m2 as G,e0 as Y,d$ as le,St as X,U$ as ce,D2 as Pe,VD as Q,CT as je,Dc as Le,D6 as de,CX as pe,Da as Te,D7 as ve,VE as ue,sw as Ve,g9 as Ae,gG as Fe,VF as H,C$ as me,C_ as ge,Df as Re,c9 as Oe}from"./zeni-epic-state-B3TABHgO.js";import{a1 as fe,H as J,y as _,z as W,g as Ce,Q as he,af as ye,az as be,aA as Be,ab as Se,N as R,ag as De,G as K,aB as Ue,aq as Ze,as as $e,a8 as ze,k as we,U as He,p as _e,aC as Ge,W as We}from"./index-BXZoRXDS.js";import{D as xe,n as M,S as Ie}from"./mui-XiTT8YBC.js";import ae from"./NotFoundScreen-CBsVugJE.js";import{a as c}from"./sentry-pp_6zWNc.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Qe,n as se,o as z}from"./core-D07hD3KT.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import{M as Ye}from"./MobileAppDrawer-DfT3Wv4q.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./InboxNotificationsProvider-CH-l5W7V.js";import"./useTaskManagerAccess-Dvad4Vb6.js";(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]="e7e6d3e6-4871-432c-9a68-5f9318acf712",e._sentryDebugIdIdentifier="sentry-dbid-e7e6d3e6-4871-432c-9a68-5f9318acf712")}catch{}})();const Xe={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Je=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,B]=c.useState(!1),[k,S]=c.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>G(l))),{useFeatureGate:x}=J(),{isFeatureEnabled:I}=x(_.isDebitCardFeatureEnabled),P=Y(I,p),T=le(p),v=X(p),U=ce(p),Z=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(Q()),b()},V=()=>{O===!0?S(!0):h()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(_.isChargeCardFeatureEnabled),L=Ce(p,j,I),{isCardsHidden:A}=he(p?.tenantId),y=!L||A,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(v))},onCloseClick:V,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:V,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Be,{...s})]})})},ea=M(Ie)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,ke=M(De.H6Regular)`
6
- margin-top: ${R.sp7};
7
- padding-left: ${R.sp8};
8
- padding-right: ${R.sp8};
9
- color: ${e=>e.theme.colors.primary};
10
- word-break: break-word;
11
- `,Ee=M(De.LargeRegularSp)`
12
- color: ${e=>e.theme.colors.hero};
13
- padding-left: ${R.sp8};
14
- padding-right: ${R.sp8};
15
- margin-bottom: 30px;
16
- margin-top: ${R.sp4};
17
- white-space: pre-line;
18
- `,aa={overlayWidth:new Se(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,B]=c.useState(!1),[k,S]=c.useState(!1),D=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>G(o))),{useFeatureGate:E}=J(),{isFeatureEnabled:x}=E(_.isDebitCardFeatureEnabled),I=Y(x,r),P=le(r),T=X(r),v=ce(r),U=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,Z=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{b(),m(Q())},h=()=>{O===!0?S(!0):w()},V={onOkClick:()=>{S(!1),w()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(_.isChargeCardFeatureEnabled),L=Ce(r,j,x),{isCardsHidden:A}=he(r?.tenantId),y=!L||A,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),B(!0)},onResetClick:w,onSaveClick:()=>{m(f==="zeni_only"?Te(e):ve())},onCloseClick:h,peopleDetails:D,isAccountingClassesEnabled:p,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:Z};return c.useEffect((()=>{D.invitePersonState.fetchState==="Completed"&&(b(),m(Q()))}),[D.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:V}):null,a.jsx(Ue,{...s})]})})},ta=M(Ie)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,na=Qe((function(e,t){const d=ue(e),n=W.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:we}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(H({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(H({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Me(),n=ee(),f=qe(),{areTenantIdsInSync:i}=Ze(),b=W.getSignedInUser(),C=g((s=>N(s))),{useFeatureGate:m}=J(),{isFeatureEnabled:O}=m(_.isDebitCardFeatureEnabled),B=g((s=>G(s))),k=!Y(O,C)&&B,S=X(C),D=C?.tenantId,{tenantEmailDomain:r}=C,[p,E]=c.useState(!1),[x,I]=c.useState(!1),[P,T]=c.useState(!1),[v,U]=c.useState("off"),[Z,w]=c.useState(!1),h=s=>{w(s)},{isAiCfoAccessEnabled:V,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ve(s.classState,s.classListState))),L=g((s=>Ae(s.userState,s.userRoleState,s.userListViewState,"manager"))),A=g((s=>Fe(s))),y=C?.companyId;c.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(H({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(u.uiState.mode),E(!0),n(me()))}),[p,b,D,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(H({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),T(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:we,onLoad:s=>s.trackPageLoaded(He.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:A,classListView:j,companyId:y,mode:u.uiState.mode}):null,P===!0?a.jsx(Je,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:Z,handleDrawerToggle:h}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:C.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(H({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=_e(f.state?.pathnameStackToGoBack,f.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:V,onAskAiCfoClick:$})]})}function ka(){const e=We();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CQOAuUNI.js";import E from"./NotFoundScreen-CBsVugJE.js";import{a as r}from"./sentry-pp_6zWNc.js";import{h as _,g as v,j as p,i as M,u as U,N as O,l as P,n as z,o as h}from"./core-D07hD3KT.js";import{fI as N,a1d as b,bo as B,bn as F,iO as V,gk as $}from"./zeni-epic-state-B3TABHgO.js";import{D as q,z as I,as as G,dN as H}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import{M as K}from"./MobileAppDrawer-DfT3Wv4q.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./InboxNotificationsProvider-CH-l5W7V.js";import"./useTaskManagerAccess-Dvad4Vb6.js";(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]="6510d896-9dd2-406c-9019-77fb791a2424",e._sentryDebugIdIdentifier="sentry-dbid-6510d896-9dd2-406c-9019-77fb791a2424")}catch{}})();const L=P((function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(H),Q=()=>{const e=_(),t=v(),d=q(),o=p((a=>N(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,D=F(l),x=C||k||D,c=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||c(a,i,!0),m.current=!0}),[n?.fetchState,c]),j=r.useCallback(((a,i)=>{c(a,i,!1)}),[c]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=J({mobileExploreReferrer:"Performance"});return G({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:d,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(O,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-CQOAuUNI.js";import Z from"./NotFoundScreen-CBsVugJE.js";import{a as p}from"./sentry-pp_6zWNc.js";import{h as C,g as N,u as D,j as u,N as V,l as k,n as q,o as g}from"./core-D07hD3KT.js";import{fI as E,Zj as h,ZB as w,NU as U,NQ as T,NT as f,NJ as B,Z_ as L,NN as z,NW as J}from"./zeni-epic-state-B3TABHgO.js";import{z as $,w as W,ca as K,q as _,bT as Q,cb as F}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import{u as G,R as x}from"./ReimbursementApprovalRuleDetailScreen-DA2wxNvn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4a0cf869-db13-4059-8b4a-901f83f4ae69",e._sentryDebugIdIdentifier="sentry-dbid-4a0cf869-db13-4059-8b4a-901f83f4ae69")}catch{}})();const j="reimbursement-approval-rule-update",H=k((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(L(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(W(K)),M=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),b=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(T(!0,!1,!1,!1)))}),[t,S,e,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(H,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=k((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(L(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(J(t,!0))}}}))(W(F)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=Q(e?.tenantId);return s?r.jsx(Y,{isLoading:n}):r.jsx(M,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));G();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(T(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(z(!1,!0)))}),[v,b,e,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,O)=>{i.endsWith(A)&&O.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(q,{children:[r.jsx(g,{path:"/",element:r.jsx(X,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(Z,{})})]})}export{le as R};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-CQOAuUNI.js";import{z as w,a8 as N,k as u,U as S,e2 as k,H as E,y as I}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import g from"./NotFoundScreen-CBsVugJE.js";import{a as c}from"./sentry-pp_6zWNc.js";import{u as C,j as y,h as F,g as L,l as U,n as T,o as d,N as h}from"./core-D07hD3KT.js";import{fI as _,a2c as j,a2d as p,DZ as P,q2 as V,a2e as q,DX as z}from"./zeni-epic-state-B3TABHgO.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var 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]="2c3dfef7-b757-4739-aa0e-2d5438a9c081",e._sentryDebugIdIdentifier="sentry-dbid-2c3dfef7-b757-4739-aa0e-2d5438a9c081")}catch{}})();const G=U((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),H=()=>{const e=C(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=y((o=>_(o))),l=F(),x=L(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=y((o=>j(o))),b=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:x,currentTenant:r,companyName:D,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=E(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(h,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(h,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(H,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-CBsVugJE.js","assets/sentry-pp_6zWNc.js","assets/core-D07hD3KT.js","assets/zeni-epic-state-B3TABHgO.js","assets/index-BXZoRXDS.js","assets/mui-XiTT8YBC.js","assets/analytics-DlzSqyvZ.js","assets/utils-CrOdvv6w.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-Co7U6uRf.js","assets/withTransactionSidePanel-eLmj1Ps-.js","assets/useAskAiCfoHostNavButtonProps-C9O3AmSz.js","assets/TransactionDetailScreen-BWee1nGS.js","assets/decodeURIComponentSafe-D3MFRtCF.js","assets/useInitialThreadRequest-COOzD5oF.js","assets/routePaths-D5u7Fiee.js","assets/expenseAutomationHelper-CL7YOVzM.js","assets/stripSplatSuffix-DA-gXJ77.js","assets/analyticsHelper-BlLXbdz8.js","assets/CompanyPassportScreen-D45sXsrZ.js","assets/MobileAppDrawer-DfT3Wv4q.js","assets/InboxNotificationsProvider-CH-l5W7V.js","assets/useTaskManagerAccess-Dvad4Vb6.js","assets/useAiCfoDashboardSuggestedQuestionsChips-cfyM2Cui.js","assets/FeaturePreviewScreen-WjMnw8KV.js","assets/BillPayRoutes-169K6hbL.js","assets/AddressScreen-qpYsmNQj.js","assets/DomesticWireDetailScreen-CdZcuM7h.js","assets/BusinessVerificationPageScreen-Bg2PTPOO.js","assets/DrawerScreen-Crjhobh0.js","assets/SetupPagesScreen-DUwJ2VLm.js","assets/BillPayApprovalRoutes-BZEAdInR.js","assets/ReimbursementApprovalRuleDetailScreen-DA2wxNvn.js","assets/getLocaleForTenant-xajEPLim.js","assets/ReimbursementRoutes-DtigAZux.js","assets/ReimbursementApprovalRoutes-Di_UQPZB.js","assets/TransactionListRoutes-xPkgCyOq.js","assets/ZeniAccountStatementScreen-D7BQE1Xy.js","assets/SettingsRoutes-CPIpAqIx.js","assets/AccountMappingScreen-CJvl5JXJ.js","assets/QBOConnectionScreen-BnxzdDn6.js","assets/empty-DRbThjIF.js","assets/index-D5s14gxd.js","assets/url-TK5h7pVR.js","assets/index-z9Fh-4S1.js","assets/accountMappingHelper-CnG-eRj3.js","assets/useEmailConnectResultRefresh-50p1dphC.js","assets/ReportsRoutes-IMfpdgLc.js","assets/ChargeCardRoutes-BwNBtpIG.js","assets/useChargeCardPusherEvents-CS7T_ZQN.js","assets/PeopleRoutes-DMreo66A.js","assets/ExpenseAutomationRoutes-DoAFvlJW.js","assets/useActualMatchingMatchDetail-9njfwmJo.js","assets/ScheduleDetailsPrepaidExpensesScreen-DVmtIBPW.js","assets/pathToGoBack-RICxbZCJ.js","assets/TreasuryRoutes-B_J15-lg.js","assets/VendorsRoutes-5DKAWmAO.js","assets/ZeniAccountRoutes-C8P1BGhH.js","assets/AddressRoutes-CRp3rVsa.js","assets/PandLWithForecastRoutes-CFIV5ASt.js","assets/CustomerOnboardingRoutes-BFxNnHJO.js","assets/TransactionDetailRoutes-D7Rn2JsN.js","assets/EntityDetailRoutes-DBE0e8tk.js","assets/InvoicingRoutes-B-rSWSFX.js","assets/NotificationRoutes-DXLsGRw8.js","assets/PerformanceRoutes-BpHHBv6i.js","assets/ActualMatchingMatchDetailScreen-BUq34KSF.js","assets/RewardsRoutes-QcnfJ0I2.js","assets/TaskRoutes-lIMUyAfY.js","assets/TaskListScreen-CjEfkJDx.js","assets/useTaskManagerPusherEvents-D8-vSEDU.js","assets/AiCfoScreen-Cgg6z7vY.js","assets/CardsAiCfoScreen-ClyuumNF.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as Es,fI as hs,e0 as ps,d$ as gs,B8 as xs,dj as Rs,c9 as js,gM as Is,gc as Ts,dg as pe,cH as As,gq as bs,cz as Ds,bF as ys,br as fs,Uo as vs,v as Cs,Ur as Os,bq as Us,Us as Ps,bL as ws,bK as Fs,bu as Ls,cv as Hs,Ut as Vs,Uu as ks,db as Ss,de as Bs,dd as Ns,cG as Ms,cN as Zs,pV as ge,gl as xe,g$ as $s,gn as Re,gO as je,gP as Ie,go as zs}from"./zeni-epic-state-B3TABHgO.js";import{j as e}from"./liveblocks-CQOAuUNI.js";import{a as P}from"./sentry-pp_6zWNc.js";import{N as u,u as Gs,h as qs,i as Ws,g as Ys,j as $,q as Te,n as Ks,o as n}from"./core-D07hD3KT.js";import{P as l,E as Qs,u as Xs,z as f,H as Js,d as et,e as st,y as B,g as tt,Q as nt,W as at,L as F,G as Ae,t as _,R as ot,S as rt,k as ne}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import{f as be}from"./analyticsHelper-BlLXbdz8.js";import{t as it}from"./getLocaleForTenant-xajEPLim.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="4e0a61ce-04b2-48b0-a00b-33ad84994236",o._sentryDebugIdIdentifier="sentry-dbid-4e0a61ce-04b2-48b0-a00b-33ad84994236")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-CBsVugJE.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(H===!0){if(o)return e.jsx(ye,{tenantEmailDomain:C});if(i)return e.jsx(De,{tenantEmailDomain:C});if(O)return e.jsx(fe,{tenantEmailDomain:C})}return o?e.jsx(ye,{tenantEmailDomain:C}):i?e.jsx(De,{tenantEmailDomain:C}):O?e.jsx(fe,{tenantEmailDomain:C}):D?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-Co7U6uRf.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-169K6hbL.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-DtigAZux.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-xPkgCyOq.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-CPIpAqIx.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-IMfpdgLc.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-BwNBtpIG.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-DMreo66A.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-DoAFvlJW.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-B_J15-lg.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-5DKAWmAO.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-C8P1BGhH.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-IMfpdgLc.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-CRp3rVsa.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-DMreo66A.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-CFIV5ASt.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),gt=l((()=>s((()=>import("./CustomerOnboardingRoutes-BFxNnHJO.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),xt=l((()=>s((()=>import("./VendorsRoutes-5DKAWmAO.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-D7Rn2JsN.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-DBE0e8tk.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-Co7U6uRf.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-169K6hbL.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-CPIpAqIx.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-B-rSWSFX.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-DtigAZux.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-C8P1BGhH.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-B_J15-lg.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-xPkgCyOq.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),yt=l((()=>s((()=>import("./ChargeCardRoutes-BwNBtpIG.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),ft=l((()=>s((()=>import("./NotificationRoutes-DXLsGRw8.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-BpHHBv6i.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-DoAFvlJW.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-BUq34KSF.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-QcnfJ0I2.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-lIMUyAfY.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-Cgg6z7vY.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-ClyuumNF.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-CBsVugJE.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-CjEfkJDx.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:V})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(H)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return C===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):H?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Gs(),N=qs(),{tenantEmailDomain:i}=Ws(),H=Qs().mode,{setLoading:O,clearAllLoading:C,clearLoading:V}=Xs(),y=f.getSignedInUserTenant(i)?.tenantId,I=f.getSignedInUser(),K=Es(I),z=Ys(),[L,we]=P.useState(!1),r=$((a=>hs(a))),{useFeatureGate:k}=Js(),M=et(),Q=st(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=k(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(B.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,X=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?xs(r)&&!Rs(r):void 0,Ve=tt(r,He,oe),{isCardsHidden:ke}=nt(r?.tenantId),Se=!Ve||!!ke,{isFeatureEnabled:Be}=k(B.isSettingsFeatureEnabled),{isFeatureEnabled:J}=k(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),G=$((a=>Is(a)));if(i!=null){const a=f.getSignedInUserTenant(i);I!=null&&a!=null&&be(I,r,H)}const Z={tenantId:y,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=at(),$e=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),ze=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=fs();t.isAfter(d,"month")===!1?D(vs(y,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,y]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,D,f]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&f.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(xe(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=f.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,D,qe))}),[y]),P.useEffect((()=>{f.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){S(Re(t));const Y=f.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),xe(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(ge(d.userId,d.zeniSessionId)))}})(T,p,r,y,I,O,D))}),[y,p]),P.useEffect((()=>{f.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),f.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),I!=null&&be(I,r,H,void 0,G.tenantsBaseInOrder))}),[G,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(C(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,y,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:We}=k(B.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=k(B.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Xe=Ps(h?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Hs(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=ks(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),g=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&x,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Xe===!0||os===!0||rs===!0;return f.isSignedIn()?y==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&D(ge(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||K&&!ee)&&es&&Je!==!0&&E===!1&&X===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||K?!L||te!==!1||ee||K?L&&r?.userRole&&E!=null&&X!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(ot,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(gt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Qe?e.jsx(Rt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(Dt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:Q===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:Q===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:Q===!0&&U===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(ft,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(xt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(yt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,$t as S};
@@ -1,29 +0,0 @@
1
- import{j as u}from"./liveblocks-CQOAuUNI.js";import{h as Y,g as X,u as ee,i as H,j as _,N as R,l as W,t as en}from"./core-D07hD3KT.js";import{bK as nn,fI as V,cH as tn,H_ as J,Za as an,Zd as sn,v1 as ne,uR as te,mC as ae,BS as N,Zf as be,gJ as We,gI as Ge,gH as Ke,Zg as on,I7 as cn,MH as Ce,My as he,Mv as Ie,Ma as Q,MB as Ae,ME as ke,MK as _e,Ck as ve,h1 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,Zh as yn,La as fe,LO as fn,Zi as gn,bL as Sn,O0 as ge,NQ as bn,Zj as Cn,Zk as hn,O4 as In,O8 as An,Zl as je,BL as kn,Sw as _n,Zm as vn,Zn as Pn,Zo as Tn,Zp as qe,Zq as En,Zr as Dn,VA as Un,Yr as On,VP as wn,Zs as Je,Mm as Fn,Me as Vn,VQ as xn,Mi as Bn,Zt as Oe,OQ as Qe,mK as jn,uU as Ye,BU as Rn,bF as Re,C4 as Le,cF as Ln,Zu as Xe,OG as we,On as Nn,Oo as Mn,Os as zn,Zv as Zn,OJ as Ne,Zw as $n,Zx as Hn,Zy as Wn,Pv as Se,Zz as Gn,gY as Kn,Jj as qn,ZA as Jn,Jo as Qn,Jn as Yn}from"./zeni-epic-state-B3TABHgO.js";import{ai as Pe,W as ie,H as de,y as q,E as Te,z as E,a8 as se,k as D,a7 as Ee,U as $,bQ as Xn,ae as oe,bR as x,bi as Ve,bS as et,bT as nt,bU as tt,q as Be,bV as at,p as Me,aG as ze,a1 as it,ab as st,bW as ot,bX as ct,bY as rt,w as ut}from"./index-BXZoRXDS.js";import{a as h}from"./sentry-pp_6zWNc.js";import{n as xe,D as dt,S as lt}from"./mui-XiTT8YBC.js";import{u as pt,d as Ze,B as Ue}from"./BusinessVerificationPageScreen-Bg2PTPOO.js";import{M as le}from"./MobileAppDrawer-DfT3Wv4q.js";import L from"./NotFoundScreen-CBsVugJE.js";import{a as $e}from"./analyticsHelper-BlLXbdz8.js";import{d as He}from"./routePaths-D5u7Fiee.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]="594a8de3-4121-42e5-8b63-766443c95ee4",e._sentryDebugIdIdentifier="sentry-dbid-594a8de3-4121-42e5-8b63-766443c95ee4")}catch{}})();const mt=xe.div`
2
- display: flex;
3
- height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,yt=W((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=V(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(J(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(_e(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(J(t,!0))},onEnableBillPayClick:()=>{e(Q(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(J(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(We(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(N(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(N(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=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=de(),{isFeatureEnabled:s}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(q.isBillPayLocalCurrencyFeatureEnabled),p=Te(),[g,S]=h.useState(!1),k=h.useRef(!1),I=_((m=>m.billPaySetupViewState.fetchState)),d=_((m=>V(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((()=>{k.current||I!=="Not-Started"||y==null?k.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(k.current=!0,t(J(y,!1,!0))):(k.current=!0,t(J(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(R,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.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(Ee,{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`,qt=e=>`/${e}/cards/setup`,Jt=e=>`/${e}/cards/onboard`,Qt=(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)),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:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(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:x(t.limit.amount),creditAccountAvailableAmount:x(t.available.amount),creditAccountSpentAmount:x(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:x(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=>x(n.accountBalance.available.amount))),debitCardsSpend:x(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:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(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=W((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=V(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:k,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&&k?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(ve("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(_e(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(ke(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(Q(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Q(t,"charge_cards")):i===!0&&c===!1&&e(Q(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:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:x(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(N(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(N(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(N(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=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),n=ie(),i=_((M=>V(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.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:k}=s(q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(q.isCardPolicyEnabled),y=_((M=>rn(M,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:k,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:U}),O=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=_((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{G(M)},pe=_((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,ue=gt(A,C,b,v);return me||ye?me||ye?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.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:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:O,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(Ee,{fetchState:"Not-Started"}):u.jsx(R,{to:"../promo"})},It=xe.div`
10
- display: flex;
11
- height: 100%;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- `,At=W((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=V(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:k}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:k}}))},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(_e(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(Q(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(N(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),kt=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),n=ie(),i=Te(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,k]=h.useState(!1),I=_((P=>P.remiSetupViewState.fetchState)),d=_((P=>V(P))),y=_((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||(k(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(R,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.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(Ee,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},_t=W((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=V(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=On(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?Je(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:k,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:O,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:k,website:I!=""&&I!=null?Ln(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:P!=null?Re(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:U?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:O?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],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(Le({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:k,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:O}=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:k.firstName,lastName:k.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:v,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:U,treasuryUserVerificationStatus:A,fileIds:O,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Le({officers:c}))},onSaveDetailsClick:s=>{e(N(a,s,t))},onSendForVerificationClick:s=>{e(N(a,s,t,!0))},onAddressClick:s=>{const c=He(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((k,I)=>{S[I]=k})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=He(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(Rn({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(We(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Qe())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=xn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(Vn({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=X(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=H(),S=ie(),{useDynamicConfig:k}=de(),I=Te(),{configValue:d}=k(Ve.zeniAccountsConfig),y=je(d),f=_((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=_((A=>A.companyConfigState.fetchState)),b=_((A=>A.userRoleConfigState.fetchState)),m=_((A=>V(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(kn()),b==="Not-Started"&&n(_n(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=_((A=>{let O;switch(e){case"zeni_accounts":O=En(A,C);break;case"zeni_treasury":O=qe(A,C);break;case"charge_cards":O=Tn(A,C);break;case"reimbursement":O=Pn(A,C);break;default:O=vn(A,C)}return O})),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 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=>(O=>{switch(e){case"zeni_accounts":return O.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return O.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return O.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(_t,{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(Ee,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=W((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(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=Zn(e),S=g.transactions,k=Je(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:k,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(Wn(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(_e(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(ke(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(Q(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(N(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Ne(!1))}c===!0&&e(Qe())},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(Hn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Ne(n))},onOverlayClose:()=>{e(Oe())}}}))(ot),Et=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),r=Te(),n=it(),{tenantEmailDomain:i}=H(),{useDynamicConfig:l}=de(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),k=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=_((w=>w.treasurySetupViewState.fetchState)),A=_((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),O=_((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=_((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=_((w=>V(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=_((w=>Xe(w,F))),G=ce.isAtomicAccountExists,K=E.getSignedInUser(),re=w=>{d(w)};if(K==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||U!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,U,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Nn()))}),[v,A,F,t]),h.useEffect((()=>{m||O!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,O,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||U!=="Completed"||G||j||!a.pathname.includes("setup")||p(!0)}),[U,G,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(R,{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(Oe()),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:w=>w.stopPropagation(),children:u.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:k.maxInsuredAmount,isAllocationDone:G,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=xe(lt)`
18
- display: flex;
19
- min-height: 100%;
20
- flex-direction: column;
21
- `,Ut=W((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Gn(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(_e(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(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(Q(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(N(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),Ot=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),{useDynamicConfig:n}=de(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,k]=h.useState(!1),I=_((b=>b.zeniAccountSetupViewState.fetchState)),d=_((b=>V(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)):(k(!0),t(Se(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(R,{to:"../promo"});{const b=m=>m.trackPageLoaded($.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)}})]})}},wt=xe.div`
22
- display: flex;
23
- height: 100vh;
24
- width: 100%;
25
- flex: 1 1 auto;
26
- flex-direction: column;
27
- align-items: center;
28
- background-color: ${e=>e.theme.colors.grey4};
29
- `,Ft=W((function(e,o){const a=V(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Jn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Yn(t))},onSubmitClick:()=>{e(Qn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Ye(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(rt),Vt=()=>{const e=Y(),o=X(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=H(),p=ie(),{useFeatureGate:g}=de(),{isFeatureEnabled:S}=g(q.isBillPayLocalCurrencyFeatureEnabled),k=_((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=_((T=>T.billPaySetupViewState.fetchState)),d=_((T=>V(T))),y=Te(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,v=_((T=>Kn(T.companyState,d.companyId))),b=v?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||k!=="Not-Started"||f==null||(r(!0),a(qn(f)))}),[t,k,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a(J(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(R,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(wt,{children:[u.jsx(se,{analytics:D,onLoad:T=>(U=>U.trackPageLoaded($.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(Ee,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},xt=W((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(we(a,!0,!0));break;default:e(J(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(R,{to:"../"}):u.jsx(L,{});case"international-wire":return o?u.jsx(Vt,{}):a?u.jsx(R,{to:"../"}):u.jsx(L,{});default:return o?u.jsx(ft,{}):a?u.jsx(R,{to:"../"}):u.jsx(L,{})}case"reimbursement":return c==="verification"?t?u.jsx(Ue,{productType:s}):u.jsx(L,{}):t?u.jsx(kt,{}):u.jsx(L,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(L,{}):r?u.jsx(Ot,{}):u.jsx(L,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(L,{});case"charge_cards":return c==="verification"?i?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(R,{to:"../"}):u.jsx(L,{}):i?u.jsx(ht,{}):l?u.jsx(R,{to:"../"}):u.jsx(L,{})}})));function ua(e){const{tenantEmailDomain:o}=H(),a=_((r=>V(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(xt,{...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,Qt as g,Kt as h,ea as i,ta as j,ca as k,Xt as l,Yt as m,qt as n,Jt as o,Gt as p,ra as s};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-CQOAuUNI.js";import{a as u,R as T,q as A}from"./sentry-pp_6zWNc.js";import{u as z,h as D,j as l,g as M,N as P,l as j}from"./core-D07hD3KT.js";import{u as O,z as s,E as F,k as w,G as N,T as _,U as B,V,X,Y as $,Z as v}from"./index-BXZoRXDS.js";import{fI as q,U7 as J,Ur as R,gl as W,gn as Y,Uw as G,gX as H,dk as Z,Ux as y,Uy as K,Uz as Q,c0 as U}from"./zeni-epic-state-B3TABHgO.js";import"./mui-XiTT8YBC.js";import{u as ee}from"./useDeviceId-DCPRNX-s.js";import{f as te}from"./analyticsHelper-BlLXbdz8.js";import{t as ne}from"./getLocaleForTenant-xajEPLim.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="1b0f32d1-fb63-4657-8b90-1dc3f14cf921",t._sentryDebugIdIdentifier="sentry-dbid-1b0f32d1-fb63-4657-8b90-1dc3f14cf921")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(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(y())}}}))($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=O(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:E}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=M(),h=F().mode,x=m.state?.magicLinkExpired,C=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),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(R(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,h,void 0,I.tenantsInOrder),H().then((()=>{const e=X();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",Z(r.productSettings))}),2e3))}),[S,p,L,o,r,I,h,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(P,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!C,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&E!=null?f.jsx(V,{onClose:()=>i(y()),unlockDate:E}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as a}from"./liveblocks-CQOAuUNI.js";import{a as s}from"./sentry-pp_6zWNc.js";import{u as d,g as f,N as u}from"./core-D07hD3KT.js";import{z as i,k as n,U as m,a7 as p}from"./index-BXZoRXDS.js";import{g_ as g,UN as y}from"./zeni-epic-state-B3TABHgO.js";import{n as b}from"./mui-XiTT8YBC.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="caa650aa-0ccd-4aaa-9984-6a0280239aba",t._sentryDebugIdIdentifier="sentry-dbid-caa650aa-0ccd-4aaa-9984-6a0280239aba")}catch{}})();function L(){const t=d(),e=f(),r=s.useRef(!1),c=i.isSignedIn(),o=e.state?.message==="logout"||c;return s.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),y(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),i.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?a.jsx(h,{children:a.jsx(p,{fetchState:"In-Progress"})}):a.jsx(u,{to:"../",replace:!0})}const h=b.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: ${t=>t.theme.colors.grey4};
9
- `;export{L as default};
@@ -1,9 +0,0 @@
1
- import{j as g}from"./liveblocks-CQOAuUNI.js";import{a as A}from"./sentry-pp_6zWNc.js";import{h as pa,u as Ta,g as fa,k as ga,j as R,i as _a,l as ma}from"./core-D07hD3KT.js";import{z as U,H as Da,y as _,as as Sa,a8 as ya,k as Ea,U as ba,e5 as ha,p as G,a4 as Aa}from"./index-BXZoRXDS.js";import{fI as Ga,a2k as q,Ri as D,a2l as V,a2g as Ca,QG as O,a2m as Ia,QO as N,Qo as Ba,Q0 as Ka,Rj as Q,a2n as z,gk as La,R9 as Ra,Re as va,R1 as Ua,Q$ as Z,Rf as wa,QY as Pa,a2o as Fa,a2p as ja,a2q as xa,a2r as $a,a2s as m,dy as Oa,dx as Na,a2t as Qa,Ql as za}from"./zeni-epic-state-B3TABHgO.js";import{n as Za}from"./mui-XiTT8YBC.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import{M as qa}from"./MobileAppDrawer-DfT3Wv4q.js";import{u as Va}from"./useTaskManagerPusherEvents-D8-vSEDU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="6dc042da-faa7-4fad-91e9-baf9e3426f15",e._sentryDebugIdIdentifier="sentry-dbid-6dc042da-faa7-4fad-91e9-baf9e3426f15")}catch{}})();const c={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"},Wa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),C=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ya=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),C(a.assignees)&&(i.assignees=a.assignees),C(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),C(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return C(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Xa=Za.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,ae=ma((function(e,a){const n=q(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ca(e),l=U.isZeniUser(),S=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:r,tagListView:T,localData:r.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:S}}),(function(e,a){const{navigate:n,currentTenant:i,location:r,isTaskTemplatesEnabled:T}=a,{tenantEmailDomain:l}=i,{groupByKey:S}=a.uiState;return{onTaskManagementRowClick:t=>{const s=M(l,t),k=G(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(D(!0,T))},onTabChange:t=>{e($a(t))},onParentTaskClick:t=>{const s=M(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(Z(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=v(l,a.localData.defaultTaskGroupId),s=G(r.state?.pathnameStackToGoBack,r.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(z({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(xa({filters:t}))},onSearchTextChanged:t=>{e(ja({searchText:t}))},onReloadCards:()=>{e(D(!0,T))},onBackClick:()=>{if(r.state?.message==="triggerBackClick"){const t=Aa(r.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(Fa({localData:t}))},resetLocalData:()=>{e(V({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(Pa(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(Z(a.localData.selectedTaskIds,t,wa(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Ua(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=te(S,t);e(O({taskDetailLocalData:s}));const k=v(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),I=G(r.state?.pathnameStackToGoBack,r.pathname);n(k,{state:{pathnameStackToGoBack:I,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(va(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(Ra(t,s))},onTimeSpentUpdate:(t,s)=>{e(Q({task:t,updates:s}))},onShowToast:t=>{e(La(t))},onGroupByFilterChange:t=>{e(z({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(Q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(Ka(t,s))},onSubtaskCreation:(t,s)=>{e(Ba({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(N(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(N(t,[s]))},handleNewTaskInitialization:t=>{if(e(O({taskDetailLocalData:{...Ia,name:t}})),a.localData.defaultTaskGroupId!=null){const s=v(l,a.localData.defaultTaskGroupId),k=G(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(ha);function ee(){const e=pa(),a=Ta(),n=fa(),i=U.getSignedInUser(),r=U.isZeniUser(),T=ga(),l=R((u=>Ga(u))),{taskGroupId:S}=_a(),{useFeatureGate:t}=Da(),{isFeatureEnabled:s}=t(_.isTaskTemplatesEnabled),{isFeatureEnabled:k}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:I}=t(_.isTaskCategorizationEnabled),{isFeatureEnabled:W}=t(_.isTaskBulkResolutionEnabled),{isFeatureEnabled:H}=t(_.isTaskGroupAssigneesEnabled),{isFeatureEnabled:Y}=t(_.isTaskRecurringParentEnabled),[J,X]=A.useState(!1),B=R((u=>q(u,s))),K=R((u=>u.taskGroupState)),y=B.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Ma({mobileExploreReferrer:"Task Checklist"});Sa({isDataReady:y==="Completed"}),A.useEffect((()=>{a(D(!1,s))}),[l?.tenantId,a,s]);const ta=A.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],f=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...Wa(l?.companyId,u),...Ha(i?.userId,f)]}),[l?.companyId,i?.userId]);if(Va({events:ta,onEvent:(u,f)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Ya(f);if(o!=null){const h=T.getState(),w=o.task_id,p=w!=null?h.taskState.taskByID?.[w]:void 0,L=p!=null;if(!r)if(o.is_private===!0){if(!L)return}else{const E=i?.userId,b=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&b.add(o.created_by),!(E!=null&&b.has(E))&&!L)return}if(u===c.TASK_UPDATED&&L&&p!=null&&Array.isArray(o.task_group_ids)){const E=new Set(Object.values(h.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),b=(p.taskGroupIds??[]).filter((d=>E.has(d))),P=(o.task_group_ids??[]).filter((d=>E.has(d))),sa=b.length===P.length&&b.every((d=>P.includes(d))),F=p.taskGroupIds??[],j=o.task_group_ids??[],na=F.length!==j.length||!F.every((d=>j.includes(d))),oa=(d,da)=>{const x=d??[],$=da??[];if(x.length!==$.length)return!1;const ca=new Set($);return x.every((ka=>ca.has(ka)))},ia=o.name==null||o.name===p.name,ra=o.is_private==null||o.is_private===p.isPrivate,la=o.assignees==null||oa(o.assignees,p.assignees),ua=o.direct_assignees==null;if(sa&&na&&ia&&ra&&la&&ua)return}}return void a(D(!0,s))}case c.TASKS_BULK_DELETED:{const o=Ja(f);return o==null?void 0:void o.task_ids.forEach((h=>a(za(h))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(D(!0,s))}},onSubscribed:()=>{a(D(!0,s))}}),A.useEffect((()=>{y==="Completed"&&a(V({taskGroupById:K.taskGroupById}))}),[y,K.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return g.jsxs(g.Fragment,{children:[y==="Completed"?g.jsx(ya,{analytics:Ea,onLoad:u=>(f=>f.trackPageLoaded(ba.Event.taskListPage))(u)}):null,g.jsxs(Xa,{children:[g.jsx(qa,{isAppContentDrawerOpen:J,handleDrawerToggle:u=>{X(u)}}),g.jsx(ae,{location:n,navigate:e,currentTenant:l,taskGroupId:S,taskGroupState:K,localData:B.localData,uiState:B.uiState,isTaskTemplatesEnabled:s,taskListFetchState:y,isTaskCategorizationEnabled:I,isTaskCannedResponsesEnabled:k,isTaskBulkResolutionEnabled:W,isTaskGroupAssigneesEnabled:H,isTaskRecurringParentEnabled:Y,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const M=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,v=(e,a)=>`/${e}/tasks/new/${a}`,te=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...m.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Oa(a);return{...m.taskDetailLocalData,priority:n}}if(e==="status"){const n=Na(a);return{...m.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...m.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qa(a);return{...m.taskDetailLocalData,dueDate:n}}return{...m.taskDetailLocalData}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));export{c as T,Ha as a,Wa as b,Ja as c,Ya as d,ee as e,pe as f,ke as t};
@@ -1,9 +0,0 @@
1
- import{j as r}from"./liveblocks-CQOAuUNI.js";import ue from"./NotFoundScreen-CBsVugJE.js";import{a as k}from"./sentry-pp_6zWNc.js";import{h as Y,u as ee,j as E,g as de,i as ke,N as pe,l as me,n as Se,o as b}from"./core-D07hD3KT.js";import{Qd as ae,Qg as fe,Qa as ge,a2f as Te,fI as te,a2g as se,QC as T,Qu as g,Q7 as he,R6 as be,Q$ as Ee,a2h as ne,gk as oe,a2i as Z,Q3 as Ie,Q0 as De,v1 as Ce,uR as Ge,mC as Re,Qs as _e,a2j as ye,Rj as Ue,Qo as je,QN as xe,QK as Be,Qj as ve,QH as we,QG as Ae}from"./zeni-epic-state-B3TABHgO.js";import{z as _,e3 as Pe,D as Fe,H as Le,y as G,a4 as ie,p as R,a8 as Qe,k as q,U as Ke,e4 as $e,Z as M,ae as Ne}from"./index-BXZoRXDS.js";import{n as Oe}from"./mui-XiTT8YBC.js";import{u as ze}from"./useInitialThreadRequest-COOzD5oF.js";import{M as Ve}from"./MobileAppDrawer-DfT3Wv4q.js";import{b as Ze,a as qe,T as f,t as Me,c as H,d as J,e as He}from"./TaskListScreen-CjEfkJDx.js";import{u as Je}from"./useTaskManagerPusherEvents-D8-vSEDU.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./InboxNotificationsProvider-CH-l5W7V.js";import"./useTaskManagerAccess-Dvad4Vb6.js";import"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="435fc1cc-6fdb-4ed7-9393-c5b2ef9f60dc",e._sentryDebugIdIdentifier="sentry-dbid-435fc1cc-6fdb-4ed7-9393-c5b2ef9f60dc")}catch{}})();function We(){const e=Y(),a=ee(),n=_.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=E((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(ge({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Pe,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,P=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Xe=Te([P,(e,a)=>{const n=P(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=P(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let W,X=[];const Ye=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=Xe(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=_.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},x=se(e),{tenantEmailDomain:B}=u,y=s.recurringSourceTaskId,v=y!=null?`${M.appUrl}/${B}/tasks/${encodeURIComponent(y)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:_.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==W&&(W=h,X=Object.values(h)),X),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:v,tagListView:x,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(Ae({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(we(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(ve(a.taskId))},onSnoozeTask:(t,o)=>{e(Be(t,o))},onUnsnoozeTask:t=>{e(xe(t))},onCreateSubtask:(t,o)=>{e(je({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Ue({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:R(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:R(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=j(m),o=R(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(ye({taskId:n}))},onDeleteTaskClick:()=>{e(_e(n))},updateFilesEntity:t=>{e(Re({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(T(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))($e);function F(){const e=Y(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=E((i=>te(i))),m=ze(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=t(G.isTaskGroupAssigneesEnabled),[y,v]=k.useState(!1),[h,S]=k.useState(!1),[Q,re]=k.useState(!1),[K,w]=k.useState(!1),C=k.useRef(!1),U=E((i=>i.taskListState.updateTasksFetchState.fetchState)),$=E((i=>se(i))),N=E((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(T(!1,s)),s!=null&&a(g(s))}),[a,s]);const O=_.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Ze(d?.companyId,i),...qe(O,l)]}),[d?.companyId,O]);Je({events:ce,onSubscribed:()=>{s!=null&&(a(T(!0,s)),a(g(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{J(l)?.parent_task_id===s&&(a(T(!0,s)),a(g(s)));break}case f.TASK_UPDATED:{const p=J(l);if(p==null)break;p.task_id===s?(a(T(!0,s)),a(g(s))):p.parent_task_id===s&&a(g(s));break}case f.TASKS_BULK_UPDATED:{const p=H(l);if(p==null)break;p.task_ids.includes(s)&&a(T(!0,s)),a(g(s));break}case f.TASKS_BULK_DELETED:{const p=H(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(j(d.tenantEmailDomain));break}a(g(s));break}case f.TASK_SNOOZE_RESURFACED:{Me(l)?.task_id===s&&a(T(!0,s));break}}}}),k.useEffect((()=>{h||$.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,$.fetchState]),k.useEffect((()=>{Q||N==="Completed"||(re(!0),a(be()))}),[Q,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(Ee([s],null,{isArchived:!1})),w(!0))}),[a,s]);k.useEffect((()=>{if(K)if(U!=="In-Progress"){if(C.current){if(U==="Error")return w(!1),void(C.current=!1);if(U==="Completed"){w(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=j(i);e(l,{state:{pathnameStackToGoBack:R(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[K,U,d,n,e]);const z=E((i=>ne(i,s))),A=z.fetchState,V=_.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(A==="Error"&&z.error?.code===400){const{tenantEmailDomain:i}=d,l=j(i),p=R(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[A==="Completed"?r.jsx(Qe,{analytics:q,onLoad:i=>(l=>l.trackPageLoaded(Ke.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(Ve,{isAppContentDrawerOpen:y,handleDrawerToggle:i=>{v(i)}}),r.jsx(Ye,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:A,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:x,isTaskGroupAssigneesEnabled:B})]})]})}const ea=Oe.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,j=e=>`/${e}/tasks`;function Ca(){return r.jsxs(Se,{children:[r.jsx(b,{path:"/new",element:r.jsx(F,{})}),r.jsx(b,{path:"/new/:taskGroupId",element:r.jsx(F,{})}),r.jsx(b,{path:"/group/:taskGroupId",element:r.jsx(He,{})}),r.jsx(b,{path:"/quick-responses",element:r.jsx(We,{})}),r.jsx(b,{path:"/:taskId",element:r.jsx(F,{})}),r.jsx(b,{path:"*",element:r.jsx(ue,{})})]})}export{Ca as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-CQOAuUNI.js";import i from"./NotFoundScreen-CBsVugJE.js";import{T as r}from"./TransactionDetailScreen-BWee1nGS.js";import"./sentry-pp_6zWNc.js";import{n as a,o as e}from"./core-D07hD3KT.js";import"./zeni-epic-state-B3TABHgO.js";import"./recharts-CgYqsGTH.js";import"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import"./decodeURIComponentSafe-D3MFRtCF.js";import"./useInitialThreadRequest-COOzD5oF.js";import"./routePaths-D5u7Fiee.js";import"./expenseAutomationHelper-CL7YOVzM.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CQOAuUNI.js";import{h as H,g as J,u as X,i as Z,j as g,N as U,l as K,n as Me,o as M}from"./core-D07hD3KT.js";import{fI as q,ug as Q,li as p,eG as ee,Sg as Ae,br as me,$U as Ce,m2 as te,Wq as ae,$V as pe,$W as Be,bF as k,Sc as Se,$X as Le,$Y as fe,$Z as Fe,Sf as he,$_ as Oe,$$ as Te,a00 as $e,a01 as ge,a02 as Ge,a03 as ze,a04 as De,Ts as we}from"./zeni-epic-state-B3TABHgO.js";import{H as ne,y as ce,k as L,G as Ie,dd as oe,p as R,a4 as se,aq as Re,e as _e}from"./index-BXZoRXDS.js";import"./mui-XiTT8YBC.js";import{a as y}from"./sentry-pp_6zWNc.js";import{w as ie}from"./withTransactionSidePanel-eLmj1Ps-.js";import{p as re,c as de}from"./routePaths-D5u7Fiee.js";import{B as Ve}from"./utils-CrOdvv6w.js";import{d as j}from"./decodeURIComponentSafe-D3MFRtCF.js";import{Z as Ne}from"./ZeniAccountStatementScreen-D7BQE1Xy.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import"./TransactionDetailScreen-BWee1nGS.js";import"./useInitialThreadRequest-COOzD5oF.js";import"./expenseAutomationHelper-CL7YOVzM.js";import"./stripSplatSuffix-DA-gXJ77.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="707001c1-b45e-4e45-87f0-ac6d20c39c4c",a._sentryDebugIdIdentifier="sentry-dbid-707001c1-b45e-4e45-87f0-ac6d20c39c4c")}catch{}})();const Je=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ve(a),ke=()=>{const{common:a,uncategorizedTransactionList:e}=Ie.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ue=K((function(a,e){const t=Ce(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=N(e.selectedAccount.tranListType),d=He(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(pe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Ae(o,p(d),!1,o==="missingReceipts"?ke():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=H(),t=J(),n=X(),c=t.pathname.split("/").find((l=>Je.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Z(),{accountType:Y,title:v,subTitle:A}=qe(o),f="month",T=g((l=>q(l))),P=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:h}=S(ce.isProjectsTransactionsEnabled),I=g((l=>Q(l)))&&h,{dataAvailable:x,initialTimeframeTick:F}=We(o,P,T.bookCloseDate),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=y.useMemo((()=>{const l=p(F);return{tranListType:o,accountType:ee(Y),title:v,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!b&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Ae(l,u.period,!0,l==="missingReceipts"?ke():void 0))}}),[b,u,n]);let C=u;return u!=null&&E!=null&&(C={...u,period:E}),c==null||C==null?s.jsx(U,{to:"../"}):s.jsx(Ue,{firstMonthOfFY:P,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:C,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>$(l),...a})})),qe=a=>{let e="",t="";const n=Ie.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},We=(a,e,t)=>{const n=me();let c=me().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},He=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Xe=K((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ye();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Ze=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:P}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(P??""),F=g((r=>Be(r.transactionListState,h,S,I))),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=g((r=>q(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),z=g((r=>Q(r)))&&m;let i;const G=Ke(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},w=Qe(F?.dateRange,r);i={accountId:h,accountType:ee(S),classId:I,title:x,timeframe:A,period:w}}y.useEffect((()=>{b||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.classId,i.period)))}),[b,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const _=[d,Y,v,A,f,T,P].filter((r=>r!=null));return G&&B!=null?s.jsx(Xe,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(U,{to:Ye(_.length)})})),Ye=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),et=K((function(a,e){const t=Oe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),tt=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:P}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(P??""),F=g((r=>Fe(r.transactionListState,h,S,I))),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=g((r=>q(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),z=g((r=>Q(r)))&&m;let i;const G=at(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},w=nt(F?.dateRange,r);i={accountId:h,accountType:ee(S),projectId:I,title:x,timeframe:A,period:w}}y.useEffect((()=>{b||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[b,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const _=[d,Y,v,A,f,T,P].filter((r=>r!=null));return G&&B!=null?s.jsx(et,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(U,{to:ve(_.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},at=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,nt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ct=K((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ze(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=it(e.tenantEmailDomain),n=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),ye=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:v,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:P}=Z(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(P!=null&&P==="exclude_subaccounts"),F=g((D=>$e(D.transactionListState,h,S))),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=g((D=>q(D))),C=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const z=ot(S,h,v,A,f,I);if(z){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=st(F?.dateRange,D);m={accountId:h,accountType:ee(S),title:I,timeframe:v,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:G}=ne(),B=y.useCallback(((D,le)=>{if(o==null)return;const ue=D.url.split(`/${o}/`)[1];if(ue==null)return;const[Ee,je]=ue.split("?"),W=new URLSearchParams(je??"");W.set("view","full"),W.set("thread_id",le),W.set("entity_type",D.entityType);const xe=R(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${Ee}?${W.toString()}`,{state:{pathnameStackToGoBack:xe}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:_}=G(ce.isProjectsTransactionsEnabled),r=g((D=>Q(D)))&&_,{areTenantIdsInSync:w}=Re();y.useEffect((()=>{!b&&m!=null&&w&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(ge(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[b,m,c,w]);const be=[d,Y,v,A,f,T].filter((D=>D!=null));return z&&i!=null?s.jsx(ct,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:C,onCommentThreadClick:B,showProjectField:r,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>$(D),...e}):s.jsx(U,{to:Pe(be.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},ot=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,st=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),it=a=>`/${a}/transactions/${we}/statements`;function Ct(){const a=J().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>q(n))).tenantId],t=_e();return s.jsxs(Me,{children:[s.jsx(M,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/zeni-clearing-account/statements",element:s.jsx(Ne,{})}),s.jsx(M,{path:"/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/missing-receipts/*",element:t?s.jsx(U,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(M,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})}),s.jsx(M,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(tt,{referrerType:a})})]})}export{Ct as default};
@@ -1,12 +0,0 @@
1
- import{j as o}from"./liveblocks-CQOAuUNI.js";import{a as f}from"./sentry-pp_6zWNc.js";import{t as u,u as h,j as y,N as b}from"./core-D07hD3KT.js";import{UK as I,gl as w,JK as j}from"./zeni-epic-state-B3TABHgO.js";import{z as l,a7 as x,af as S,ag as D}from"./index-BXZoRXDS.js";import{n as c}from"./mui-XiTT8YBC.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var 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]="9171c109-f313-4e1e-a0de-9c2cbb13ff70",e._sentryDebugIdIdentifier="sentry-dbid-9171c109-f313-4e1e-a0de-9c2cbb13ff70")}catch{}})();const A=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=f.useState(!1),a=h(),i=y((m=>I(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(b,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(p(!0),a(j(t,g,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.div`
2
- display: flex;
3
- width: 100%;
4
- height: 100vh;
5
- flex-direction: row;
6
- justify-content: center;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey5};
9
- `,_=c(D.LargeRegular)`
10
- display: flex;
11
- color: ${S.important};
12
- `;export{A as default};