@zeniai/web-app-ui 5.4.17-dev → 5.4.18-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 (122) hide show
  1. package/dist/assets/{AccountMappingScreen-DIZ1qWql.js → AccountMappingScreen-4Zeu95kU.js} +1 -1
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-C6MMW6xe.js → ActualMatchingMatchDetailScreen-B6pl-MVl.js} +1 -1
  3. package/dist/assets/AddressRoutes-zjWkB0xf.js +1 -0
  4. package/dist/assets/{AddressScreen-CxRV-hrD.js → AddressScreen-Czlolp2X.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-Ct8ctLoM.js → AiCfoScreen-BhfmD__h.js} +1 -1
  6. package/dist/assets/{AppDrawer-DDlKiLbC.js → AppDrawer-B7GEeTxi.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-WPV-16X0.js → BillPayApprovalRoutes-B4dh4WxY.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-PQbxiOB3.js → BillPayRoutes-DZx-x_-P.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-DaAqJAwC.js → BusinessVerificationPageScreen-je1np7-9.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-CVenT1_U.js → CardsAiCfoScreen-abedaxWu.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-uCAqAWIA.js → ChargeCardRoutes-Db9V9An_.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-DtXzsb3x.js → CompanyPassportScreen-Db20J8Yl.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-BC1VQ6tg.js → ConnectionAuthScreen-BmJpUHtJ.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-Deo-LVYJ.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-B6np-cNh.js → CustomerOnboardingRoutes-De4sHn4O.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-9dawbCei.js → DashboardRoutes-CCGs4e1_.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-BgSSAKid.js → DefaultTenantHome-BN__AQ5l.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-u2HKaCWA.js → DomesticWireDetailScreen-6W-Er5_q.js} +3 -3
  19. package/dist/assets/{DrawerScreen-BmZb1i83.js → DrawerScreen-DUhkZI2Z.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-DV-gNWAZ.js → EntityDetailRoutes-BrJAd36h.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-DJyIDCG4.js → ExpenseAutomationRoutes-DcjeaHHd.js} +1 -1
  22. package/dist/assets/{FallBackRoute--cXyuVDR.js → FallBackRoute-orqRsHMl.js} +2 -2
  23. package/dist/assets/{FeaturePreviewScreen-DjPPDYKv.js → FeaturePreviewScreen-Dcu53_tf.js} +1 -1
  24. package/dist/assets/{HubSpotOAuthCallbackScreen-DL6_G6pe.js → HubSpotOAuthCallbackScreen-ClZsPGpZ.js} +1 -1
  25. package/dist/assets/{InboxNotificationsProvider-Daf1RQwd.js → InboxNotificationsProvider-DiTDJFwP.js} +1 -1
  26. package/dist/assets/{InvoicingRoutes-DKlu_pXq.js → InvoicingRoutes-BTvzZ8JV.js} +2 -2
  27. package/dist/assets/{MagicLinkRoutes-BkZcOPcj.js → MagicLinkRoutes-V1DxaNiW.js} +5 -5
  28. package/dist/assets/{MagicLinkSignInScreen-CmIZfa-U.js → MagicLinkSignInScreen-DnCx8Y6G.js} +1 -1
  29. package/dist/assets/{MobileAppDrawer-DTqKEh3f.js → MobileAppDrawer-Bql3K6nh.js} +1 -1
  30. package/dist/assets/NotFoundScreen-CTik05r2.js +1 -0
  31. package/dist/assets/{NotificationRoutes-BwTXq37O.js → NotificationRoutes-wSm6mA8N.js} +1 -1
  32. package/dist/assets/{OAuthConsentScreen-NPetpQky.js → OAuthConsentScreen-BELrcqAy.js} +1 -1
  33. package/dist/assets/{PandLWithForecastRoutes-eI5sgFXq.js → PandLWithForecastRoutes-Dpao8SIb.js} +1 -1
  34. package/dist/assets/{PaymentLinkScreen-C3fxjzB1.js → PaymentLinkScreen-vbM_NtP3.js} +1 -1
  35. package/dist/assets/{PeopleRoutes-B4kdNKMm.js → PeopleRoutes-CJeBX2Ca.js} +1 -1
  36. package/dist/assets/PerformanceRoutes-W4NxEUmH.js +1 -0
  37. package/dist/assets/{Preview-Cr2n9zp9.js → Preview-Db0nRlxD.js} +1 -1
  38. package/dist/assets/{QBOConnectionScreen-BLLJy6Ug.js → QBOConnectionScreen-BEn_CddB.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRoutes-DX03V50m.js → ReimbursementApprovalRoutes-CSZJghRB.js} +1 -1
  40. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-y6N7Iuxh.js → ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js} +1 -1
  41. package/dist/assets/{ReimbursementRoutes-50C6Ebhr.js → ReimbursementRoutes-BUZKWvJ7.js} +1 -1
  42. package/dist/assets/{ReportsRoutes-CPbwIPP-.js → ReportsRoutes-BUZ4r7hx.js} +1 -1
  43. package/dist/assets/{RewardsRoutes-cADkol8X.js → RewardsRoutes-DuYZ4TXP.js} +1 -1
  44. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-Bb90T06-.js → ScheduleDetailsPrepaidExpensesScreen-DN2DZsFw.js} +4 -4
  45. package/dist/assets/{ScreenRoutes-BOM6GDiC.js → ScreenRoutes-CxP9HSCe.js} +2 -2
  46. package/dist/assets/{SettingsRoutes-Dd8PYfpt.js → SettingsRoutes-CCWla9X1.js} +6 -6
  47. package/dist/assets/{SetupPagesScreen-BY0N32JD.js → SetupPagesScreen-C5PRNruc.js} +1 -1
  48. package/dist/assets/{SignInScreen-DGgeSRO8.js → SignInScreen-BScZ138a.js} +1 -1
  49. package/dist/assets/{SignOutScreen-DPsA_-Qd.js → SignOutScreen-Bk-Y8Sbv.js} +1 -1
  50. package/dist/assets/{TaskListScreen-yze1VNuP.js → TaskListScreen-C7smUYFP.js} +2 -2
  51. package/dist/assets/{TaskRoutes-B5s7sZXk.js → TaskRoutes-DPcu4NRR.js} +2 -2
  52. package/dist/assets/{TransactionDetailRoutes-D5llvRhv.js → TransactionDetailRoutes-yEwix446.js} +1 -1
  53. package/dist/assets/{TransactionDetailScreen-CebcYk9B.js → TransactionDetailScreen-CHzsnTr9.js} +1 -1
  54. package/dist/assets/{TransactionListRoutes-PnEvh6qc.js → TransactionListRoutes-ChJOrV96.js} +1 -1
  55. package/dist/assets/{TreasuryRoutes-DbBm2doo.js → TreasuryRoutes-C24SAGLB.js} +1 -1
  56. package/dist/assets/{VendorsRoutes-CQjAHjxC.js → VendorsRoutes-CVu8jS5h.js} +1 -1
  57. package/dist/assets/{WiseConfirmationScreen-d0_FJyyD.js → WiseConfirmationScreen-Dt6hB5m-.js} +1 -1
  58. package/dist/assets/{ZeniAccountRoutes-CrROItmj.js → ZeniAccountRoutes-D3ONSR9y.js} +7 -7
  59. package/dist/assets/{ZeniAccountStatementScreen-DiwM8zAQ.js → ZeniAccountStatementScreen-CmfHt6Wr.js} +1 -1
  60. package/dist/assets/{accountMappingHelper-DHkHknqJ.js → accountMappingHelper-CHQgwqfy.js} +1 -1
  61. package/dist/assets/{analytics-CabaUa1L.js → analytics-D051O7ML.js} +1 -1
  62. package/dist/assets/{analyticsHelper-BOs1nNPv.js → analyticsHelper-DkNc3mKz.js} +1 -1
  63. package/dist/assets/{core-BQ6YlWys.js → core-BBlQ3ArL.js} +1 -1
  64. package/dist/assets/{decodeURIComponentSafe-D_MvDEMm.js → decodeURIComponentSafe-YbpxzvKa.js} +1 -1
  65. package/dist/assets/{dnd-DL41lZFs.js → dnd-CU3yeazS.js} +1 -1
  66. package/dist/assets/{empty-CmBSqEpE.js → empty-B3C-udVF.js} +1 -1
  67. package/dist/assets/{empty-mwfdcHvm.js → empty-BiAWzWBi.js} +1 -1
  68. package/dist/assets/{emptyVideoElement-BIOkPHF6.js → emptyVideoElement-CRPwTqUS.js} +1 -1
  69. package/dist/assets/{epic-PdviWWJR.js → epic-DwBfFPJQ.js} +1 -1
  70. package/dist/assets/{expenseAutomationHelper-Bn2j121J.js → expenseAutomationHelper-SA0jUIyg.js} +1 -1
  71. package/dist/assets/{getLocaleForTenant-jg4r2V28.js → getLocaleForTenant-DTPcYF0O.js} +1 -1
  72. package/dist/assets/{index-Bfsx1pdD.js → index--CQENyaz.js} +1 -1
  73. package/dist/assets/{index-BNuLRh9K.js → index-CaztP9tz.js} +1 -1
  74. package/dist/assets/{index-DZBfE5XI.js → index-ClwW47Zs.js} +899 -904
  75. package/dist/assets/{index-Du1SP9oT.js → index-MRZKoeCT.js} +2 -2
  76. package/dist/assets/{index-B7zYAj-7.js → index-ae04Qn4V.js} +1 -1
  77. package/dist/assets/{index-CamOdFyi.js → index-fVadamkP.js} +1 -1
  78. package/dist/assets/{index-Deo5Hnb2.js → index-jomr_c-N.js} +1 -1
  79. package/dist/assets/{index-BiyVMPcR.js → index-s4pcd-16.js} +1 -1
  80. package/dist/assets/{lexical-BmxGnuDE.js → lexical-DVH-xgq1.js} +1 -1
  81. package/dist/assets/{liveblocks-UAxYbctH.js → liveblocks-CuUK5O_2.js} +1 -1
  82. package/dist/assets/{lottie-BPF4ysWw.js → lottie-Du4lbH8J.js} +1 -1
  83. package/dist/assets/{mui-DYo6Z7Si.js → mui--aGBnNu2.js} +1 -1
  84. package/dist/assets/{pathToGoBack-CxX9ql3A.js → pathToGoBack-DOePc_e5.js} +1 -1
  85. package/dist/assets/{pdf-CHT1_0Mk.js → pdf-CrvsvvW3.js} +3 -3
  86. package/dist/assets/{pdf-lib-BMce44-8.js → pdf-lib-Cvsvldn7.js} +1 -1
  87. package/dist/assets/{plaid-BNcFec4W.js → plaid-7P9b69CP.js} +1 -1
  88. package/dist/assets/{pusher-C1AzfTgV.js → pusher-DdvpIMG0.js} +1 -1
  89. package/dist/assets/{react-DZjZzXEf.js → react-B8GJK4jq.js} +1 -1
  90. package/dist/assets/{react-CT8AAIAI.js → react-Bz6aBujY.js} +1 -1
  91. package/dist/assets/{react-BnffftLd.js → react-CUlf2ISA.js} +1 -1
  92. package/dist/assets/{react-CSOME4pA.js → react-CjVSd3S9.js} +1 -1
  93. package/dist/assets/{react-B13-Yejj.js → react-D-JjM7p6.js} +1 -1
  94. package/dist/assets/{react-CjoLUzLz.js → react-DoYRVAKa.js} +1 -1
  95. package/dist/assets/{recharts-VJtr9O-6.js → recharts-CkREU3LH.js} +1 -1
  96. package/dist/assets/{reportTimeframe-D2vFkQK6.js → reportTimeframe-ChAOzqo_.js} +1 -1
  97. package/dist/assets/{routePaths-CaZTJQOM.js → routePaths-D0jOibXk.js} +1 -1
  98. package/dist/assets/{sentry-CQfqw6mU.js → sentry-D0lP5-8e.js} +1 -1
  99. package/dist/assets/{stripSplatSuffix-TzoGXcwz.js → stripSplatSuffix-CFosfir7.js} +1 -1
  100. package/dist/assets/{url-dVvWrnA9.js → url-GwD82u5j.js} +1 -1
  101. package/dist/assets/{url-OL55dppf.js → url-nN4BnP9N.js} +1 -1
  102. package/dist/assets/useActualMatchingMatchDetail-nJ3hpXEY.js +1 -0
  103. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B4OxQoVy.js → useAiCfoDashboardSuggestedQuestionsChips-usJW6KKQ.js} +1 -1
  104. package/dist/assets/useAskAiCfoHostNavButtonProps-CWWQxV2L.js +1 -0
  105. package/dist/assets/{useChargeCardPusherEvents-Gp7Qmy_v.js → useChargeCardPusherEvents-DPfHk-vM.js} +1 -1
  106. package/dist/assets/{useDeviceId-B6KB8W5T.js → useDeviceId-pp3Grc-z.js} +1 -1
  107. package/dist/assets/{useEmailConnectResultRefresh-DJgvOf06.js → useEmailConnectResultRefresh-B6j7j1rG.js} +1 -1
  108. package/dist/assets/{useEnsureVendorListLoaded-BbjOUcqm.js → useEnsureVendorListLoaded-COBYTL2U.js} +1 -1
  109. package/dist/assets/{useInitialThreadRequest-BpNcTGLt.js → useInitialThreadRequest-DmfmyzKI.js} +1 -1
  110. package/dist/assets/{useTaskManagerAccess-CP331xWN.js → useTaskManagerAccess-DrmpkeUw.js} +1 -1
  111. package/dist/assets/{useTaskManagerPusherEvents-BmjCwNse.js → useTaskManagerPusherEvents-CHhZ2DRZ.js} +1 -1
  112. package/dist/assets/{utils-BpLD-La5.js → utils-Ctp9Zfhk.js} +1 -1
  113. package/dist/assets/{withTransactionSidePanel-7NlWHlVm.js → withTransactionSidePanel-CKC1_4cy.js} +1 -1
  114. package/dist/assets/{zeni-epic-state-j9Po26Lg.js → zeni-epic-state-aUBx6G2Q.js} +3 -3
  115. package/dist/index.html +1 -1
  116. package/package.json +2 -2
  117. package/dist/assets/AddressRoutes-DneYortX.js +0 -1
  118. package/dist/assets/CustomerOnboardingAuthScreen-DGFpytn-.js +0 -1
  119. package/dist/assets/NotFoundScreen-CY-XFa3a.js +0 -1
  120. package/dist/assets/PerformanceRoutes-CT8b6LEZ.js +0 -1
  121. package/dist/assets/useActualMatchingMatchDetail-DglThU_y.js +0 -1
  122. package/dist/assets/useAskAiCfoHostNavButtonProps-DV6iNvbF.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as E}from"./liveblocks-UAxYbctH.js";import{a as v}from"./sentry-CQfqw6mU.js";import{i as M,u as Q,h as W,g as ee,j as r,l as te}from"./core-BQ6YlWys.js";import{_C as Ge,_S as Ve,ma as ae,sL as Fe,sX as Me,tb as $e,t9 as Re,tc as Ke,te as Ue,a0C as Ye,fI as K,$G as pe,a0D as Se,h2 as ne,cs as se,ct as le,FS as ve,a0E as Ce,FW as ze,gS as ce,sO as qe,tn as He,dn as Ze,dm as Xe,T$ as fe,FQ as Qe,FK as We,VH as De,FC as et,FB as tt,Fw as at,FH as nt,FX as st,VJ as Y,VI as ge,FD as lt,$H as oe,Gb as Ae,G4 as Ie,a0F as xe,sR as Te,F_ as Be,FY as Le,a0G as Je,Gi as we,Gf as je,F$ as be,Gh as _e}from"./zeni-epic-state-j9Po26Lg.js";import{a5 as de,cG as ie,cH as ct,z as ot,q as dt,a8 as it,a9 as ue,d as N,aj as ut,cI as rt,s as V,G as ye,j as Ee,cJ as ht,cK as mt,cL as pt}from"./index-DZBfE5XI.js";import{n as re}from"./mui-DYo6Z7Si.js";import{p as St}from"./pathToGoBack-CxX9ql3A.js";import{a as ft}from"./useActualMatchingMatchDetail-DglThU_y.js";import X from"./NotFoundScreen-CY-XFa3a.js";import{t as F}from"./routePaths-CaZTJQOM.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]="83033ef2-ec36-4189-801d-ef4efaac341b",e._sentryDebugIdIdentifier="sentry-dbid-83033ef2-ec36-4189-801d-ef4efaac341b")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=Q(),i=W(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Ge(u,l??""))),m=r((u=>Ve(u))),C=r((u=>ae(u))),y=ft(),S=v.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),I=v.useRef(!1);return v.useEffect((()=>{o.fetchState!=="In-Progress"&&I.current&&o.fetchState==="Completed"&&(I.current=!1,S())}),[o.fetchState,S]),v.useEffect((()=>{l!=null&&d==null&&h.fetchState==="Not-Started"&&n(Fe(l))}),[l,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(X,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(X,{}):E.jsx(Dt,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n(Re(l,u,f))},onSkip:(u,f)=>{n($e(l,u,f))}})})}const Dt=re.div`
1
+ import{j as E}from"./liveblocks-CuUK5O_2.js";import{a as v}from"./sentry-D0lP5-8e.js";import{i as M,u as Q,h as W,g as ee,j as r,l as te}from"./core-BBlQ3ArL.js";import{_C as Ge,_S as Ve,ma as ae,sL as Fe,sX as Me,tb as $e,t9 as Re,tc as Ke,te as Ue,a0C as Ye,fI as K,$G as pe,a0D as Se,h2 as ne,cs as se,ct as le,FS as ve,a0E as Ce,FW as ze,gS as ce,sO as qe,tn as He,dn as Ze,dm as Xe,T$ as fe,FQ as Qe,FK as We,VH as De,FC as et,FB as tt,Fw as at,FH as nt,FX as st,VJ as Y,VI as ge,FD as lt,$H as oe,Gb as Ae,G4 as Ie,a0F as xe,sR as Te,F_ as Be,FY as Le,a0G as be,Gi as Je,Gf as we,F$ as je,Gh as _e}from"./zeni-epic-state-aUBx6G2Q.js";import{a5 as de,cG as ie,cH as ct,z as ot,m as dt,a8 as it,a9 as ue,d as N,aj as ut,cI as rt,q as V,G as ye,h as Ee,cJ as ht,cK as mt,cL as pt}from"./index-ClwW47Zs.js";import{n as re}from"./mui--aGBnNu2.js";import{p as St}from"./pathToGoBack-DOePc_e5.js";import{a as ft}from"./useActualMatchingMatchDetail-nJ3hpXEY.js";import X from"./NotFoundScreen-CTik05r2.js";import{t as F}from"./routePaths-D0jOibXk.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]="6e3352fe-3b2b-4edf-a220-6465646b73fb",e._sentryDebugIdIdentifier="sentry-dbid-6e3352fe-3b2b-4edf-a220-6465646b73fb")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=Q(),i=W(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Ge(u,l??""))),m=r((u=>Ve(u))),C=r((u=>ae(u))),y=ft(),S=v.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),I=v.useRef(!1);return v.useEffect((()=>{o.fetchState!=="In-Progress"&&I.current&&o.fetchState==="Completed"&&(I.current=!1,S())}),[o.fetchState,S]),v.useEffect((()=>{l!=null&&d==null&&h.fetchState==="Not-Started"&&n(Fe(l))}),[l,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(X,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(X,{}):E.jsx(Dt,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n(Re(l,u,f))},onSkip:(u,f)=>{n($e(l,u,f))}})})}const Dt=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -14,7 +14,7 @@ import{j as E}from"./liveblocks-UAxYbctH.js";import{a as v}from"./sentry-CQfqw6m
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Ct=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:h,months:A,scheduleAccruedExpenseCategory:m,scheduleClass:C,scheduleExpenseCategory:y,startDate:S,vendor:I}=d,u=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,f=y.selectedOption!=null?t.accountList.find((B=>B.qboId===y.selectedOption)):void 0,D=m.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===m.selectedOption)):void 0,J=A?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||f?.accountId==null||t.isAccountingClassesEnabled!==!1&&u?.classId==null||D==null||I.selectedOption==null||h==null||o==null&&o==0||S==null||J==null||e(tt({scheduleType:l}))}}}))(ht),zt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=v.useState(!1),d=e??i,o=t??a,h=W(),A=ee(),m=Q(),C=Ee(),{tenantEmailDomain:y}=M(),[S,I]=v.useState(!1);if(y==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:u}=M(),f=s??u;let D;f!=="new"&&(D=f);const J=vt(f),B=r((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),w="accrued_expenses",k=r((L=>Se(L,"accrued_expenses"))),j=r((L=>fe(L))),b=r((L=>L.classListState.fetchState)),x=r((L=>ae(L))),_=j!=="Completed"||b!=="Completed";v.useEffect((()=>{S===!1&&_?(m(Qe(w,D)),I(!0)):_===!1&&S===!1&&f!=="new"&&(m(We(w,f)),I(!0))}),[S]);const P=r((L=>K(L))),T=r((L=>ne(L,P.companyId))),O=A.state?.message==="expenseAutomation",z=r((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:q,scheduleDecisionStatus:H}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:w,onDecided:()=>{if(l==null)if(O!==!0)h("../schedules/accrued_expenses");else{const{month:L,year:Pe}=z;h(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),G=k.fetchState,$=k.allAccountList,Z=k.allClassList,g=k.allAccruedAccountList,p=k.scheduleAccruedDetailsLocalData;if(J!==!0||k.fetchState==="Error")return E.jsx(X,{});const R=G==="Completed"&&S===!0,Oe=k.selectedJEAccruedSchedule!=null;return G==="Completed"||G==="Not-Started"||c===!0&&Oe?E.jsxs(kt,{children:[R===!0?E.jsx(ue,{analytics:N,onLoad:()=>{At(k,w,T)}}):null,E.jsx(Ct,{onScheduleDecision:U?q:void 0,scheduleDecisionStatus:H,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:A,navigate:h,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:g,scheduleLocalData:p,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:y,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},vt=e=>e!=null,At=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},It=re.div`
17
+ `,Ct=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:h,months:A,scheduleAccruedExpenseCategory:m,scheduleClass:C,scheduleExpenseCategory:y,startDate:S,vendor:I}=d,u=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,f=y.selectedOption!=null?t.accountList.find((B=>B.qboId===y.selectedOption)):void 0,D=m.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===m.selectedOption)):void 0,b=A?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||f?.accountId==null||t.isAccountingClassesEnabled!==!1&&u?.classId==null||D==null||I.selectedOption==null||h==null||o==null&&o==0||S==null||b==null||e(tt({scheduleType:l}))}}}))(ht),zt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=v.useState(!1),d=e??i,o=t??a,h=W(),A=ee(),m=Q(),C=Ee(),{tenantEmailDomain:y}=M(),[S,I]=v.useState(!1);if(y==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:u}=M(),f=s??u;let D;f!=="new"&&(D=f);const b=vt(f),B=r((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),J="accrued_expenses",k=r((L=>Se(L,"accrued_expenses"))),w=r((L=>fe(L))),j=r((L=>L.classListState.fetchState)),x=r((L=>ae(L))),_=w!=="Completed"||j!=="Completed";v.useEffect((()=>{S===!1&&_?(m(Qe(J,D)),I(!0)):_===!1&&S===!1&&f!=="new"&&(m(We(J,f)),I(!0))}),[S]);const P=r((L=>K(L))),T=r((L=>ne(L,P.companyId))),O=A.state?.message==="expenseAutomation",z=r((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:q,scheduleDecisionStatus:H}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:J,onDecided:()=>{if(l==null)if(O!==!0)h("../schedules/accrued_expenses");else{const{month:L,year:Pe}=z;h(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),G=k.fetchState,$=k.allAccountList,Z=k.allClassList,g=k.allAccruedAccountList,p=k.scheduleAccruedDetailsLocalData;if(b!==!0||k.fetchState==="Error")return E.jsx(X,{});const R=G==="Completed"&&S===!0,Oe=k.selectedJEAccruedSchedule!=null;return G==="Completed"||G==="Not-Started"||c===!0&&Oe?E.jsxs(kt,{children:[R===!0?E.jsx(ue,{analytics:N,onLoad:()=>{At(k,J,T)}}):null,E.jsx(Ct,{onScheduleDecision:U?q:void 0,scheduleDecisionStatus:H,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:A,navigate:h,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:g,scheduleLocalData:p,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:y,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},vt=e=>e!=null,At=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},It=re.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as E}from"./liveblocks-UAxYbctH.js";import{a as v}from"./sentry-CQfqw6m
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,xt=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(be(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(we(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${F(d,t.tenantEmailDomain)}`,h=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:h,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${F(d,t.tenantEmailDomain)}`,h=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:h}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:h,scheduleDetailsListSection:A}=d,{scheduleClass:m,scheduleExpenseCategory:C,accumulatedDepreciationCategory:y,assetId:S,months:I,startDate:u,postingDate:f,vendor:D}=h,J=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},w=m.selectedOption!=null?t.classList.find((T=>T.classId===m.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,j=y.selectedOption!=null?t.depAccountList.find((T=>T.qboId===y.selectedOption)):void 0,b=I?.selectedOption,x=A.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,P=f.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:w?.classId,selectedAccumulatedDepreciationCategory:j?.accountId,selectedDate:u,selectedMonths:b,assetId:S,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||j?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&w?.classId==null||u==null||b==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),qt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=W(),n=ee(),i=Q(),a=Ee(),{tenantEmailDomain:d}=M(),[o,h]=v.useState(!1),{scheduleDetailId:A}=M(),m=t??A,C=n.state?.message==="expenseAutomation",y=Tt(m),S=r((g=>g.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{S!=null&&S.length!==0||m!=="new"||l("../schedules/fixed_assets")}),[S,m]);const I="fixed_assets",u=r((g=>oe(g,I))),f=r((g=>g.entityAutoCompleteState.autoCompleteText.common)),D=r((g=>De(g,"common"))),J=r((g=>fe(g))),B=r((g=>g.classListState.fetchState)),w=r((g=>ae(g))),k=r((g=>ce(g).selectedPeriod)),j=J!=="Completed"||B!=="Completed";v.useEffect((()=>{o===!1&&j?(i(Ae(I,G,!0)),h(!0)):j===!1&&o===!1&&(i(Ie(I,m==="new"?void 0:m,!0)),h(!0))}),[o]),v.useEffect((()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:g,year:p}=k;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else l("../schedules/fixed_assets")}),[u.markAsCompleteStatus.fetchState]);const b=r((g=>K(g))),x=r((g=>ne(g,b.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:u.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:u.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:I,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:g,year:p}=k;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else c()}}),O=u.fetchState,z=u.allAccountList,U=u.allClassList,q=u.allDepreciationAccountList,H=u.scheduleDetailsLocalData.fixed_assets;let G;if(m!=="new"&&(G=m),y!==!0||u.fetchState==="Error")return E.jsx(X,{});const $=O==="Completed"&&o===!0,Z=u.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?E.jsxs(It,{children:[$===!0?E.jsx(ue,{analytics:N,onLoad:()=>{Lt(u,I,x)}}):null,E.jsx(xt,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{i(Te(g,p))},accountList:z,depAccountList:q,scheduleLocalData:H,selectedJEScheduleKey:S,scheduleDetailId:G,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:w,status:u.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},Tt=e=>e!=null,Bt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Lt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Bt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Jt=re.div`
25
+ `,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,xt=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(Je(i,d,o))},onJELinkClick:d=>{e(be({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${F(d,t.tenantEmailDomain)}`,h=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:h,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${F(d,t.tenantEmailDomain)}`,h=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:h}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:h,scheduleDetailsListSection:A}=d,{scheduleClass:m,scheduleExpenseCategory:C,accumulatedDepreciationCategory:y,assetId:S,months:I,startDate:u,postingDate:f,vendor:D}=h,b=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:b?.zeniId??D?.selectedOption??"",name:b?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:b?.logo},J=m.selectedOption!=null?t.classList.find((T=>T.classId===m.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=y.selectedOption!=null?t.depAccountList.find((T=>T.qboId===y.selectedOption)):void 0,j=I?.selectedOption,x=A.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,P=f.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:J?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:u,selectedMonths:j,assetId:S,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&J?.classId==null||u==null||j==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),qt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=W(),n=ee(),i=Q(),a=Ee(),{tenantEmailDomain:d}=M(),[o,h]=v.useState(!1),{scheduleDetailId:A}=M(),m=t??A,C=n.state?.message==="expenseAutomation",y=Tt(m),S=r((g=>g.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{S!=null&&S.length!==0||m!=="new"||l("../schedules/fixed_assets")}),[S,m]);const I="fixed_assets",u=r((g=>oe(g,I))),f=r((g=>g.entityAutoCompleteState.autoCompleteText.common)),D=r((g=>De(g,"common"))),b=r((g=>fe(g))),B=r((g=>g.classListState.fetchState)),J=r((g=>ae(g))),k=r((g=>ce(g).selectedPeriod)),w=b!=="Completed"||B!=="Completed";v.useEffect((()=>{o===!1&&w?(i(Ae(I,G,!0)),h(!0)):w===!1&&o===!1&&(i(Ie(I,m==="new"?void 0:m,!0)),h(!0))}),[o]),v.useEffect((()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:g,year:p}=k;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else l("../schedules/fixed_assets")}),[u.markAsCompleteStatus.fetchState]);const j=r((g=>K(g))),x=r((g=>ne(g,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:u.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:u.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:I,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:g,year:p}=k;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else c()}}),O=u.fetchState,z=u.allAccountList,U=u.allClassList,q=u.allDepreciationAccountList,H=u.scheduleDetailsLocalData.fixed_assets;let G;if(m!=="new"&&(G=m),y!==!0||u.fetchState==="Error")return E.jsx(X,{});const $=O==="Completed"&&o===!0,Z=u.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?E.jsxs(It,{children:[$===!0?E.jsx(ue,{analytics:N,onLoad:()=>{Lt(u,I,x)}}):null,E.jsx(xt,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{i(Te(g,p))},accountList:z,depAccountList:q,scheduleLocalData:H,selectedJEScheduleKey:S,scheduleDetailId:G,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:J,status:u.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},Tt=e=>e!=null,Bt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Lt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Bt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},bt=re.div`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  width: 100%;
@@ -30,4 +30,4 @@ import{j as E}from"./liveblocks-UAxYbctH.js";import{a as v}from"./sentry-CQfqw6m
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,wt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(be(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(we(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${F(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${F(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:h}=a,{scheduleClass:A,scheduleExpenseCategory:m,months:C,startDate:y,postingDate:S,vendor:I}=o,u=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===I?.selectedOption)):void 0,f={id:u?.zeniId??I?.selectedOption??"",name:u?.name??I?.defaultOptions.find((x=>x.value===I?.selectedOption))?.label??"",logo:u?.logo},D=A.selectedOption!=null?t.classList.find((x=>x.classId===A.selectedOption)):void 0,J=m.selectedOption!=null?t.accountList.find((x=>x.qboId===m.selectedOption)):void 0,B=C?.selectedOption,w=h.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),k=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,j=S.type==="lastDayOfMonth"||void 0,b={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:y,selectedMonths:B,jeScheduleDetails:w,lastDayOfMonth:j,selectedVendor:f,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:b,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||y==null||B==null||j!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Ht=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=W(),i=ee(),a=Q(),d=Ee(),{tenantEmailDomain:o}=M(),[h,A]=v.useState(!1),m=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:y}=M(),S=t??y,I=jt(c??C,S),u=r((p=>p.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{u!=null&&u.length!==0||S!=="new"||n("../schedules/prepaid_expenses")}),[u,S]);const f=c??pe(C)??"prepaid_expenses",D=r((p=>oe(p,f))),J=r((p=>p.entityAutoCompleteState.autoCompleteText.common)),B=r((p=>De(p,"common"))),w=r((p=>fe(p))),k=r((p=>p.classListState.fetchState)),j=r((p=>ae(p))),b=r((p=>ce(p).selectedPeriod)),x=w!=="Completed"||k!=="Completed";v.useEffect((()=>{h===!1&&x?(a(Ae(f,$,!0)),A(!0)):x===!1&&h===!1&&(a(Ie(f,S==="new"?void 0:S,!0)),A(!0))}),[h]),v.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),m===!0){const{month:p,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${p}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=r((p=>K(p))),P=r((p=>ne(p,_.companyId))),T=e||m,{onScheduleDecision:O,scheduleDecisionStatus:z}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:f,onDecided:()=>{if(s==null)if(m!==!0)n("../schedules/prepaid_expenses");else{const{month:p,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${p}-${R}`)}else s()}}),U=D.fetchState,q=D.allAccountList,H=D.allClassList,G=D.scheduleDetailsLocalData;let $;if(S!=="new"&&($=S),I!==!0||D.fetchState==="Error")return E.jsx(X,{});const Z=U==="Completed"&&h===!0,g=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&g?E.jsxs(Jt,{children:[Z===!0?E.jsx(ue,{analytics:N,onLoad:()=>{_t(D,f,P)}}):null,E.jsx(wt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:z,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:m,removeJeScheduleTransactionKey:(p,R)=>{a(Te(p,R))},expenseAutomationSelectedPeriod:b,navigate:n,classList:H,accountList:q,scheduleLocalData:G[f],selectedJEScheduleKey:u,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:f,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:j,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},jt=(e,t)=>pe(e)!=null&&t!=null,bt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),_t=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...bt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Ut as J,Ht as S,qt as a,zt as b,Yt as c};
33
+ `,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Jt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(Je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(be({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${F(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${F(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:h}=a,{scheduleClass:A,scheduleExpenseCategory:m,months:C,startDate:y,postingDate:S,vendor:I}=o,u=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===I?.selectedOption)):void 0,f={id:u?.zeniId??I?.selectedOption??"",name:u?.name??I?.defaultOptions.find((x=>x.value===I?.selectedOption))?.label??"",logo:u?.logo},D=A.selectedOption!=null?t.classList.find((x=>x.classId===A.selectedOption)):void 0,b=m.selectedOption!=null?t.accountList.find((x=>x.qboId===m.selectedOption)):void 0,B=C?.selectedOption,J=h.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),k=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,w=S.type==="lastDayOfMonth"||void 0,j={selectedAccount:b?.accountId,selectedClass:D?.classId,selectedDate:y,selectedMonths:B,jeScheduleDetails:J,lastDayOfMonth:w,selectedVendor:f,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||b?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||y==null||B==null||w!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Ht=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=W(),i=ee(),a=Q(),d=Ee(),{tenantEmailDomain:o}=M(),[h,A]=v.useState(!1),m=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:y}=M(),S=t??y,I=wt(c??C,S),u=r((p=>p.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{u!=null&&u.length!==0||S!=="new"||n("../schedules/prepaid_expenses")}),[u,S]);const f=c??pe(C)??"prepaid_expenses",D=r((p=>oe(p,f))),b=r((p=>p.entityAutoCompleteState.autoCompleteText.common)),B=r((p=>De(p,"common"))),J=r((p=>fe(p))),k=r((p=>p.classListState.fetchState)),w=r((p=>ae(p))),j=r((p=>ce(p).selectedPeriod)),x=J!=="Completed"||k!=="Completed";v.useEffect((()=>{h===!1&&x?(a(Ae(f,$,!0)),A(!0)):x===!1&&h===!1&&(a(Ie(f,S==="new"?void 0:S,!0)),A(!0))}),[h]),v.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),m===!0){const{month:p,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${p}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=r((p=>K(p))),P=r((p=>ne(p,_.companyId))),T=e||m,{onScheduleDecision:O,scheduleDecisionStatus:z}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:f,onDecided:()=>{if(s==null)if(m!==!0)n("../schedules/prepaid_expenses");else{const{month:p,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${p}-${R}`)}else s()}}),U=D.fetchState,q=D.allAccountList,H=D.allClassList,G=D.scheduleDetailsLocalData;let $;if(S!=="new"&&($=S),I!==!0||D.fetchState==="Error")return E.jsx(X,{});const Z=U==="Completed"&&h===!0,g=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&g?E.jsxs(bt,{children:[Z===!0?E.jsx(ue,{analytics:N,onLoad:()=>{_t(D,f,P)}}):null,E.jsx(Jt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:z,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:b,entityAutoCompleteView:B},usedInExpenseAutomation:m,removeJeScheduleTransactionKey:(p,R)=>{a(Te(p,R))},expenseAutomationSelectedPeriod:j,navigate:n,classList:H,accountList:q,scheduleLocalData:G[f],selectedJEScheduleKey:u,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:f,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},wt=(e,t)=>pe(e)!=null&&t!=null,jt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),_t=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...jt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Ut as J,Ht as S,qt as a,zt as b,Yt as c};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReportsRoutes-CPbwIPP-.js","assets/sentry-CQfqw6mU.js","assets/core-BQ6YlWys.js","assets/zeni-epic-state-j9Po26Lg.js","assets/index-DZBfE5XI.js","assets/mui-DYo6Z7Si.js","assets/analytics-CabaUa1L.js","assets/utils-BpLD-La5.js","assets/NotFoundScreen-CY-XFa3a.js","assets/FeaturePreviewScreen-DjPPDYKv.js","assets/useInitialThreadRequest-BpNcTGLt.js","assets/routePaths-CaZTJQOM.js","assets/reportTimeframe-D2vFkQK6.js","assets/MobileAppDrawer-DTqKEh3f.js","assets/InboxNotificationsProvider-Daf1RQwd.js","assets/useTaskManagerAccess-CP331xWN.js","assets/index-BQ3cXEYt.css","assets/AddressRoutes-DneYortX.js","assets/AddressScreen-CxRV-hrD.js","assets/PeopleRoutes-B4kdNKMm.js","assets/useAskAiCfoHostNavButtonProps-DV6iNvbF.js","assets/PandLWithForecastRoutes-eI5sgFXq.js","assets/CustomerOnboardingRoutes-B6np-cNh.js","assets/QBOConnectionScreen-BLLJy6Ug.js","assets/empty-mwfdcHvm.js","assets/index-Bfsx1pdD.js","assets/url-OL55dppf.js","assets/index-B7zYAj-7.js","assets/decodeURIComponentSafe-D_MvDEMm.js","assets/useEmailConnectResultRefresh-DJgvOf06.js","assets/useChargeCardPusherEvents-Gp7Qmy_v.js","assets/VendorsRoutes-CQjAHjxC.js","assets/ScheduleDetailsPrepaidExpensesScreen-Bb90T06-.js","assets/pathToGoBack-CxX9ql3A.js","assets/useActualMatchingMatchDetail-DglThU_y.js","assets/stripSplatSuffix-TzoGXcwz.js","assets/DrawerScreen-BmZb1i83.js","assets/accountMappingHelper-DHkHknqJ.js","assets/TransactionDetailRoutes-D5llvRhv.js","assets/useEnsureVendorListLoaded-BbjOUcqm.js","assets/TransactionDetailScreen-CebcYk9B.js","assets/expenseAutomationHelper-Bn2j121J.js","assets/EntityDetailRoutes-DV-gNWAZ.js","assets/withTransactionSidePanel-7NlWHlVm.js","assets/DashboardRoutes-9dawbCei.js","assets/analyticsHelper-BOs1nNPv.js","assets/CompanyPassportScreen-DtXzsb3x.js","assets/useAiCfoDashboardSuggestedQuestionsChips-B4OxQoVy.js","assets/BillPayRoutes-PQbxiOB3.js","assets/DomesticWireDetailScreen-u2HKaCWA.js","assets/BusinessVerificationPageScreen-DaAqJAwC.js","assets/SetupPagesScreen-BY0N32JD.js","assets/BillPayApprovalRoutes-WPV-16X0.js","assets/ReimbursementApprovalRuleDetailScreen-y6N7Iuxh.js","assets/FallBackRoute--cXyuVDR.js","assets/SettingsRoutes-Dd8PYfpt.js","assets/AccountMappingScreen-DIZ1qWql.js","assets/ReimbursementApprovalRoutes-DX03V50m.js","assets/InvoicingRoutes-DKlu_pXq.js","assets/ReimbursementRoutes-50C6Ebhr.js","assets/ZeniAccountRoutes-CrROItmj.js","assets/ZeniAccountStatementScreen-DiwM8zAQ.js","assets/TreasuryRoutes-DbBm2doo.js","assets/TransactionListRoutes-PnEvh6qc.js","assets/ChargeCardRoutes-uCAqAWIA.js","assets/NotificationRoutes-BwTXq37O.js","assets/PerformanceRoutes-CT8b6LEZ.js","assets/ExpenseAutomationRoutes-DJyIDCG4.js","assets/ActualMatchingMatchDetailScreen-C6MMW6xe.js","assets/RewardsRoutes-cADkol8X.js","assets/TaskRoutes-B5s7sZXk.js","assets/TaskListScreen-yze1VNuP.js","assets/useTaskManagerPusherEvents-BmjCwNse.js","assets/AiCfoScreen-Ct8ctLoM.js","assets/CardsAiCfoScreen-CVenT1_U.js"])))=>i.map(i=>d[i]);
2
- import{bm as ms,fI as hs,eq as _s,ep as ps,h7 as xs,d2 as Es,c7 as gs,gM as js,gc as Is,eg as xe,cx as Rs,gq as As,cp as Ts,bE as fs,bv as bs,h8 as ys,v as ws,h9 as Cs,bp as Ds,ha as vs,bK as Us,bJ as ks,br as Fs,cl as Os,hb as Ps,hc as Hs,eb as Ss,ee as Bs,ed as Ls,cw as Ns,cD as Vs,hd as Ee,gl as ge,h0 as Ms,gn as je,gO as Ie,gP as Re,go as Zs,_ as r}from"./zeni-epic-state-j9Po26Lg.js";import{j as e}from"./liveblocks-UAxYbctH.js";import{a as U}from"./sentry-CQfqw6mU.js";import{u as zs,h as Gs,i as $s,g as Ys,j as z,q as Ae,N as d,n as qs,o as s}from"./core-BQ6YlWys.js";import{u as Ws,z as T,p as Js,a as Ks,f as Qs,N as L,i as Xs,L as en,V as sn,b as F,G as Te,t as c,c as nn,P as an,d as ae,r as tn,l as i,B as on,Z as rn}from"./index-DZBfE5XI.js";import{u as ln}from"./mui-DYo6Z7Si.js";import{f as fe}from"./analyticsHelper-BOs1nNPv.js";import{t as dn}from"./getLocaleForTenant-jg4r2V28.js";import{F as C}from"./FallBackRoute--cXyuVDR.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new l.Error().stack;b&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[b]="133fdf49-7e1d-44a7-883a-916465df2704",l._sentryDebugIdIdentifier="sentry-dbid-133fdf49-7e1d-44a7-883a-916465df2704")}catch{}})();const cn=i((()=>r((()=>import("./ReportsRoutes-CPbwIPP-.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])))),un=i((()=>r((()=>import("./AddressRoutes-DneYortX.js")),__vite__mapDeps([17,1,2,3,18,4,5,6,7,8,16])))),mn=i((()=>r((()=>import("./PeopleRoutes-B4kdNKMm.js")),__vite__mapDeps([19,1,2,3,4,5,6,7,8,20,13,14,15,16])))),hn=i((()=>r((()=>import("./PandLWithForecastRoutes-eI5sgFXq.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,20,10,11,13,14,15,16])))),_n=i((()=>r((()=>import("./CustomerOnboardingRoutes-B6np-cNh.js")),__vite__mapDeps([22,1,2,3,18,4,5,6,7,8,23,24,25,26,27,28,29,30,16])))),pn=i((()=>r((()=>import("./VendorsRoutes-CQjAHjxC.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,18,8,9,32,33,34,35,28,11,20,13,14,15,36,37,16])))),xn=i((()=>r((()=>import("./TransactionDetailRoutes-D5llvRhv.js")),__vite__mapDeps([38,1,2,3,8,4,5,6,7,28,39,40,20,10,11,41,16])))),be=i((()=>r((()=>import("./EntityDetailRoutes-DV-gNWAZ.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,28,43,20,40,10,11,41,35,16])))),En=i((()=>r((()=>import("./DashboardRoutes-9dawbCei.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,43,20,40,28,10,11,41,35,8,12,45,46,13,14,15,47,9,16])))),ye=i((()=>r((()=>import("./BillPayRoutes-PQbxiOB3.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,18,8,49,20,10,50,11,13,14,15,36,9,51,45,52,39,53,54,16])))),gn=i((()=>r((()=>import("./SettingsRoutes-Dd8PYfpt.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,15,56,13,14,23,24,25,26,27,28,37,18,8,45,50,11,46,29,52,39,53,57,16])))),jn=i((()=>r((()=>import("./InvoicingRoutes-DKlu_pXq.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,18,8,13,14,15,23,24,25,26,27,28,16])))),we=i((()=>r((()=>import("./ReimbursementRoutes-50C6Ebhr.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,9,20,10,36,54,57,39,53,16])))),In=i((()=>r((()=>import("./ZeniAccountRoutes-CrROItmj.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,9,49,18,20,61,16])))),Rn=i((()=>r((()=>import("./TreasuryRoutes-DbBm2doo.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,20,10,9,16])))),An=i((()=>r((()=>import("./TransactionListRoutes-PnEvh6qc.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,43,20,40,28,10,11,41,35,61,16])))),Tn=i((()=>r((()=>import("./ChargeCardRoutes-uCAqAWIA.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,20,13,14,15,51,50,11,8,45,10,30,18,16])))),fn=i((()=>r((()=>import("./NotificationRoutes-BwTXq37O.js")),__vite__mapDeps([65,1,2,3,8,4,5,6,7,20,15,16])))),bn=i((()=>r((()=>import("./PerformanceRoutes-CT8b6LEZ.js")),__vite__mapDeps([66,1,2,3,8,4,5,6,7,20,13,14,15,16])))),yn=i((()=>r((()=>import("./ExpenseAutomationRoutes-DJyIDCG4.js")),__vite__mapDeps([67,1,2,3,8,4,5,6,7,20,40,28,10,11,41,34,35,43,32,33,37,36,16])))),wn=i((()=>r((()=>import("./ActualMatchingMatchDetailScreen-C6MMW6xe.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,34,35,28,11,8,16])))),Cn=i((()=>r((()=>import("./RewardsRoutes-cADkol8X.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,8,16])))),Dn=i((()=>r((()=>import("./TaskRoutes-B5s7sZXk.js")),__vite__mapDeps([70,1,2,3,8,4,5,6,7,10,13,14,15,71,20,72,16])))),vn=i((()=>r((()=>import("./AiCfoScreen-Ct8ctLoM.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,47,33,11,72,16])))),Ce=i((()=>r((()=>import("./CardsAiCfoScreen-CVenT1_U.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,16])))),f=i((()=>r((()=>import("./NotFoundScreen-CY-XFa3a.js")),__vite__mapDeps([8,1,2,3,4,5,6,7,16])))),Un=i((()=>r((()=>import("./TaskListScreen-yze1VNuP.js").then((l=>l.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,20,13,14,15,72,16]))));function Qn({setTenantEmailDomain:l}){const b=zs(),N=Gs(),{tenantEmailDomain:o}=$s(),V=ln().mode,{setLoading:O,clearAllLoading:W,clearLoading:H}=Ws(),y=T.getSignedInUserTenant(o)?.tenantId,R=T.getSignedInUser(),J=ms(R),G=Ys(),[P,ve]=U.useState(!1),n=z((a=>hs(a))),{useFeatureGate:S}=Js(),M=Ks(),K=Qs(),Ue=!!n.company?.companyZeniAccountInfo?.isZeniAccountEnabled,ke=n.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Fe}=S(L.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=S(L.isDebitCardFeatureEnabled),A=z((a=>a.tenantState.fetchState)),p=z((a=>a.tenantState.activeTenantFetchState.fetchState)),m=p==="Completed"||A==="Completed"?_s(te,n):void 0,Q=p==="Completed"||A==="Completed"?ps(n):void 0,oe=p==="Completed"||A==="Completed"?xs(n)&&!Es(n):void 0,Oe=Xs(n,Fe,te),{isCardsHidden:Pe}=en(n?.tenantId),He=!Oe||!!Pe,{isFeatureEnabled:Se}=S(L.isSettingsFeatureEnabled),{isFeatureEnabled:X}=S(L.isAiCfoFileUploadEnabled),{isFeatureEnabled:Be}=S(L.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Le=n?.userRole!=null&&gs(n.userRole),$=z((a=>js(a)));if(o!=null){const a=T.getSignedInUserTenant(o);R!=null&&a!=null&&fe(R,n,V)}const Z={tenantId:y,userId:R?.userId,sessionId:R?.zeniSessionId},re=Is(),h=sn(),Ne=n.company==null||h?.loggedInUserRoleMap!=null&&xe(h.loggedInUserRole),Ve=Rs(h?.loggedInUserRoleMap),ee=Ae("/:tenantEmailDomain/onboarding/*")!==null,Me=Ae("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Me?.params.selectedPeriod,Ze=z((a=>Z.tenantId!=null?As(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),l(o)}),[o]),U.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const D=Ts(Number(a[0])),w=Number(a[1]),t=fs(`01-${D<10?`0${D}`:D}-${w}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),_=bs();t.isAfter(_,"month")===!1?b(ys(y,{month:D,year:w})):N(`/${o}/month_end_close_checks/review`)}}}),[se,o,y]),U.useEffect((()=>{P||(ve(!0),O(F.TENANT_FETCHING))}),[P,Z,re,R,b,T]),U.useLayoutEffect((()=>{!ws(re,Z)&&T.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t){if(ge(D?.userId,D?.zeniSessionId,a.tenantId),w(Ms(!0)),w(je(a.tenantId)),a.tenantId!=null&&c.clearTenant(a.tenantId),a.tenantId!=null){const _=T.getSignedInUserTenantWithId(a.tenantId);t&&Te.updateAppLocaleID(dn(t)),_?.tenantEmailDomain!=null&&T.saveActiveTenantDomainForUser(_?.tenantEmailDomain)}a.userId!=null?ae.identify(a.userId,{tenant_id:a.tenantId}):ae.resetUserIdentity()})(Z,R,b,Ze))}),[y]),U.useEffect((()=>{T.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t,_,is,B){if(w==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&_?.zeniSessionId!=null,ls=w==null||w.tenantId!==t,ds=w!=null&&w.excludedResources==null,cs=w!=null&&w.externalConnections==null;if(Y&&ls){B(je(t));const q=T.getSignedInUserTenantWithId(t);q?.tenantEmailDomain!=null&&T.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(_?.userId,_?.zeniSessionId,t),c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)))}else Y&&ds&&c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),Y&&cs&&c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)));if(Y){ae.identify(_.userId,{tenant_id:t});const q=t==null||t!=null&&(D==="Completed"||D==="Error");if(a==="Completed"||D!=="Not-Started"&&D!=="Error"||t==null||!c.shouldFetchActiveTenant(t)||(c.markActiveTenantFetchStarted(t),is(F.TENANT_FETCHING),B(Zs(_.userId,t,_.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&c.shouldFetchAllTenants()){c.markAllTenantsFetchStarted();const{userId:us,zeniSessionId:pe}=_;tn((()=>{T.getSignedInUser()?.zeniSessionId===pe?B(Ee(us,pe)):c.markAllTenantsFetchFailed()}),kn)}}})(A,p,n,y,R,O,b))}),[y,p]),U.useEffect((()=>{T.isSignedIn()&&A==="Completed"&&$.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),T.saveSignedInUserTenants(Cs($.tenantsBaseInOrder)),R!=null&&fe(R,n,V,void 0,$.tenantsBaseInOrder))}),[$,A,n,R]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(performance.mark("zeni:boot_tenant_data"),W(),c.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(c.markActiveTenantFetchFailed(y),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?c.markAllTenantsFetchCompleted():A==="Error"&&c.markAllTenantsFetchFailed())}),[p,A,y,P]);const ie=U.useRef(!1);U.useEffect((()=>{!ie.current&&p==="Completed"&&P&&(ie.current=!0,nn())}),[p,P]);const v=n?.userRole!=null&&Ds(n?.userRole),{isFeatureEnabled:ze}=S(L.isReferralFeatureEnabled),{isFeatureEnabled:Ge}=S(L.isAccrualEnabled),$e=n?.userRole!=null&&n.userRole.includes("charge_card_user"),Ye=n?.userRole!=null&&n.userRole.includes("charge_card_admin"),k=n?.userRole!=null&&xe(n.userRole),le=n?.company==null||n.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!v,de=!He&&!v,qe=vs(h?.loggedInUserRoleMap),We=n.externalConnections?.accounting[0]?.isValid,Je=n.externalConnections?.fetchState==="Completed",ne=n.company?.companyOnboardingInfo.isOnboardingCompleted,ce=n?.company==null||n.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!v,ue=ce&&Us(h?.loggedInUserRoleMap),me=Ue&&!v,Ke=ke&&!v,Qe=le&&ks(h?.loggedInUserRoleMap),Xe=de&&Fs(h?.loggedInUserRoleMap),es=me&&Os(h?.loggedInUserRoleMap),ss=Ps(h?.loggedInUserRoleMap),ns=Hs(h?.loggedInUserRoleMap),as=Ss(h?.loggedInUserRoleMap),ts=Bs(h?.loggedInUserRoleMap),os=Ls(h?.loggedInUserRoleMap),x=Ns(h?.loggedInUserRoleMap),E=Vs(h?.loggedInUserRoleMap),he=le&&x,_e=ce&&E,g=me&&as,j=Ke&&ts,u=de&&os,rs=n.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ve===!0||qe===!0||ss===!0||ns===!0;return T.isSignedIn()?y==null?A==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(R!=null&&A!=="In-Progress"&&b(Ee(R.userId,R.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||A==="Completed"?(ne===!0||J&&!ee)&&Je&&We!==!0&&m===!1&&Q===!1&&oe===!1?(l(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!P||oe!==!0||ne!==!0||ee||J?!P||ne!==!1||ee||J?P&&n?.userRole&&m!=null&&Q!=null&&o!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(qs,{children:e.jsxs(s,{element:e.jsx(an,{}),children:[e.jsx(s,{path:"/",element:e.jsx(Fn,{isDashboardAccess:k,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,isTenantCardsOnly:Q,showChargeCardRoute:u})}),e.jsx(s,{path:"dashboard/*",element:k?e.jsx(En,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reports/*",element:k?e.jsx(cn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"people/*",element:rs||k?e.jsx(mn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"forecast/*",element:k?e.jsx(hn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"onboarding/*",element:e.jsx(_n,{})}),e.jsx(s,{path:"transaction/*",element:k&&v===!1||$e||Ye?e.jsx(xn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"transactions/*",element:k&&v===!1?e.jsx(An,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"customer/*",element:k&&v===!1?e.jsx(be,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,isTenantBankingOnly:m,showTreasuryRoute:j,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"vendor/*",element:k&&v===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"tasks",element:e.jsx(Un,{})}),e.jsx(s,{path:"tasks/*",element:e.jsx(Dn,{})}),e.jsx(s,{path:"address/*",element:Qe||ue||es||Xe?e.jsx(un,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"checking/*",element:e.jsx(I,{isAllowed:g,fallback:e.jsx(f,{}),children:e.jsx(In,{})})}),e.jsx(s,{path:"treasury/*",element:e.jsx(I,{isAllowed:j,fallback:e.jsx(f,{}),children:e.jsx(Rn,{})})}),e.jsx(s,{path:"performance",element:e.jsx(I,{isAllowed:K,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(bn,{})})}),e.jsx(s,{path:"month_end_close_checks/review/*",element:e.jsx(I,{isAllowed:K&&!v,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(yn,{})})}),e.jsx(s,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(I,{isAllowed:K&&!v&&Ge,fallback:e.jsx(f,{}),children:e.jsx(wn,{})})}),e.jsx(s,{path:"notifications/*",element:e.jsx(fn,{})}),e.jsx(s,{path:"vendors/*",element:e.jsx(I,{isAllowed:Ne,fallback:e.jsx(f,{}),children:e.jsx(pn,{})})}),e.jsx(s,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursement/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursements/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"settings/*",element:e.jsx(I,{isAllowed:Se,fallback:e.jsx(f,{}),children:e.jsx(gn,{hasAdminLevelAccess:ue})})}),e.jsx(s,{path:"invoicing/*",element:e.jsx(I,{isAllowed:Be&&Le,fallback:e.jsx(f,{}),children:e.jsx(jn,{})})}),e.jsx(s,{path:"cards/ask",element:e.jsx(I,{isAllowed:u&&M,fallback:e.jsx(f,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/ask/:session_id",element:e.jsx(I,{isAllowed:u&&M,fallback:e.jsx(f,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/*",element:e.jsx(I,{isAllowed:u,fallback:e.jsx(f,{}),children:e.jsx(Tn,{})})}),e.jsx(s,{path:"rewards/*",element:e.jsx(I,{isAllowed:ze,fallback:e.jsx(f,{}),children:e.jsx(Cn,{})})}),e.jsx(s,{path:"/ai-cfo",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(f,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(f,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/:session_id",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(f,{}),children:e.jsx(vn,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"*",element:e.jsx(f,{})})]})}):null:(l(void 0),e.jsx(d,{to:`/${o}/onboarding`,replace:!0})):(l(void 0),e.jsx(d,{to:`/${o}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),l(void 0),e.jsx(d,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const kn=5e3,Fn=({isDashboardAccess:l,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:o,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:W,showChargeCardRoute:H})=>{if(O===!0){if(b)return e.jsx(d,{to:"checking"});if(V)return e.jsx(d,{to:"treasury"});if(H)return e.jsx(d,{to:"cards"})}return W===!0&&H?e.jsx(d,{to:"cards"}):l?e.jsx(d,{to:"dashboard"}):b?e.jsx(d,{to:"checking"}):V?e.jsx(d,{to:"treasury"}):H?e.jsx(d,{to:"cards"}):N?e.jsx(d,{to:"bills"}):o?e.jsx(d,{to:"reimbursements"}):e.jsx(d,{to:"dashboard"})},I=({children:l,fallback:b,isAllowed:N})=>{const o=on();return N?l:o?e.jsx(rn,{fetchState:"In-Progress"}):b},De=({tenantEmailDomain:l})=>e.jsx(d,{to:`/${l}/dashboard`});export{Qn as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReportsRoutes-BUZ4r7hx.js","assets/sentry-D0lP5-8e.js","assets/core-BBlQ3ArL.js","assets/zeni-epic-state-aUBx6G2Q.js","assets/index-ClwW47Zs.js","assets/mui--aGBnNu2.js","assets/analytics-D051O7ML.js","assets/utils-Ctp9Zfhk.js","assets/NotFoundScreen-CTik05r2.js","assets/FeaturePreviewScreen-Dcu53_tf.js","assets/useInitialThreadRequest-DmfmyzKI.js","assets/routePaths-D0jOibXk.js","assets/reportTimeframe-ChAOzqo_.js","assets/MobileAppDrawer-Bql3K6nh.js","assets/InboxNotificationsProvider-DiTDJFwP.js","assets/useTaskManagerAccess-DrmpkeUw.js","assets/index-BQ3cXEYt.css","assets/AddressRoutes-zjWkB0xf.js","assets/AddressScreen-Czlolp2X.js","assets/PeopleRoutes-CJeBX2Ca.js","assets/useAskAiCfoHostNavButtonProps-CWWQxV2L.js","assets/PandLWithForecastRoutes-Dpao8SIb.js","assets/CustomerOnboardingRoutes-De4sHn4O.js","assets/QBOConnectionScreen-BEn_CddB.js","assets/empty-BiAWzWBi.js","assets/index--CQENyaz.js","assets/url-nN4BnP9N.js","assets/index-ae04Qn4V.js","assets/decodeURIComponentSafe-YbpxzvKa.js","assets/useEmailConnectResultRefresh-B6j7j1rG.js","assets/useChargeCardPusherEvents-DPfHk-vM.js","assets/VendorsRoutes-CVu8jS5h.js","assets/ScheduleDetailsPrepaidExpensesScreen-DN2DZsFw.js","assets/pathToGoBack-DOePc_e5.js","assets/useActualMatchingMatchDetail-nJ3hpXEY.js","assets/stripSplatSuffix-CFosfir7.js","assets/DrawerScreen-DUhkZI2Z.js","assets/accountMappingHelper-CHQgwqfy.js","assets/TransactionDetailRoutes-yEwix446.js","assets/useEnsureVendorListLoaded-COBYTL2U.js","assets/TransactionDetailScreen-CHzsnTr9.js","assets/expenseAutomationHelper-SA0jUIyg.js","assets/EntityDetailRoutes-BrJAd36h.js","assets/withTransactionSidePanel-CKC1_4cy.js","assets/DashboardRoutes-CCGs4e1_.js","assets/analyticsHelper-DkNc3mKz.js","assets/CompanyPassportScreen-Db20J8Yl.js","assets/useAiCfoDashboardSuggestedQuestionsChips-usJW6KKQ.js","assets/BillPayRoutes-DZx-x_-P.js","assets/DomesticWireDetailScreen-6W-Er5_q.js","assets/BusinessVerificationPageScreen-je1np7-9.js","assets/SetupPagesScreen-C5PRNruc.js","assets/BillPayApprovalRoutes-B4dh4WxY.js","assets/ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js","assets/FallBackRoute-orqRsHMl.js","assets/SettingsRoutes-CCWla9X1.js","assets/AccountMappingScreen-4Zeu95kU.js","assets/ReimbursementApprovalRoutes-CSZJghRB.js","assets/InvoicingRoutes-BTvzZ8JV.js","assets/ReimbursementRoutes-BUZKWvJ7.js","assets/ZeniAccountRoutes-D3ONSR9y.js","assets/ZeniAccountStatementScreen-CmfHt6Wr.js","assets/TreasuryRoutes-C24SAGLB.js","assets/TransactionListRoutes-ChJOrV96.js","assets/ChargeCardRoutes-Db9V9An_.js","assets/NotificationRoutes-wSm6mA8N.js","assets/PerformanceRoutes-W4NxEUmH.js","assets/ExpenseAutomationRoutes-DcjeaHHd.js","assets/ActualMatchingMatchDetailScreen-B6pl-MVl.js","assets/RewardsRoutes-DuYZ4TXP.js","assets/TaskRoutes-DPcu4NRR.js","assets/TaskListScreen-C7smUYFP.js","assets/useTaskManagerPusherEvents-CHhZ2DRZ.js","assets/AiCfoScreen-BhfmD__h.js","assets/CardsAiCfoScreen-abedaxWu.js"])))=>i.map(i=>d[i]);
2
+ import{bm as ms,fI as hs,eq as _s,ep as ps,h7 as xs,d2 as Es,c7 as gs,gM as js,gc as Is,eg as xe,cx as Rs,gq as As,cp as Ts,bE as fs,bv as bs,h8 as ys,v as ws,h9 as Cs,bp as Ds,ha as vs,bK as Us,bJ as ks,br as Fs,cl as Os,hb as Ps,hc as Hs,eb as Ss,ee as Bs,ed as Ls,cw as Ns,cD as Vs,hd as Ee,gl as ge,h0 as Ms,gn as je,gO as Ie,gP as Re,go as Zs,_ as r}from"./zeni-epic-state-aUBx6G2Q.js";import{j as e}from"./liveblocks-CuUK5O_2.js";import{a as U}from"./sentry-D0lP5-8e.js";import{u as zs,h as Gs,i as $s,g as Ys,j as z,q as Ae,N as d,n as qs,o as s}from"./core-BBlQ3ArL.js";import{u as Ws,z as T,p as Js,a as Ks,x as Qs,N as L,i as Xs,L as en,V as sn,b as F,G as Te,t as c,c as nn,P as an,d as ae,r as tn,l as i,B as on,Z as rn}from"./index-ClwW47Zs.js";import{u as ln}from"./mui--aGBnNu2.js";import{f as fe}from"./analyticsHelper-DkNc3mKz.js";import{t as dn}from"./getLocaleForTenant-DTPcYF0O.js";import{F as C}from"./FallBackRoute-orqRsHMl.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new l.Error().stack;b&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[b]="32805a07-a560-496d-86fa-9a35fe85fe50",l._sentryDebugIdIdentifier="sentry-dbid-32805a07-a560-496d-86fa-9a35fe85fe50")}catch{}})();const cn=i((()=>r((()=>import("./ReportsRoutes-BUZ4r7hx.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])))),un=i((()=>r((()=>import("./AddressRoutes-zjWkB0xf.js")),__vite__mapDeps([17,1,2,3,18,4,5,6,7,8,16])))),mn=i((()=>r((()=>import("./PeopleRoutes-CJeBX2Ca.js")),__vite__mapDeps([19,1,2,3,4,5,6,7,8,20,13,14,15,16])))),hn=i((()=>r((()=>import("./PandLWithForecastRoutes-Dpao8SIb.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,20,10,11,13,14,15,16])))),_n=i((()=>r((()=>import("./CustomerOnboardingRoutes-De4sHn4O.js")),__vite__mapDeps([22,1,2,3,18,4,5,6,7,8,23,24,25,26,27,28,29,30,16])))),pn=i((()=>r((()=>import("./VendorsRoutes-CVu8jS5h.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,18,8,9,32,33,34,35,28,11,20,13,14,15,36,37,16])))),xn=i((()=>r((()=>import("./TransactionDetailRoutes-yEwix446.js")),__vite__mapDeps([38,1,2,3,8,4,5,6,7,28,39,40,20,10,11,41,16])))),be=i((()=>r((()=>import("./EntityDetailRoutes-BrJAd36h.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,28,43,20,40,10,11,41,35,16])))),En=i((()=>r((()=>import("./DashboardRoutes-CCGs4e1_.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,43,20,40,28,10,11,41,35,8,12,45,46,13,14,15,47,9,16])))),ye=i((()=>r((()=>import("./BillPayRoutes-DZx-x_-P.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,18,8,49,20,10,50,11,13,14,15,36,9,51,45,52,39,53,54,16])))),gn=i((()=>r((()=>import("./SettingsRoutes-CCWla9X1.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,15,56,13,14,23,24,25,26,27,28,37,18,8,45,50,11,46,29,52,39,53,57,16])))),jn=i((()=>r((()=>import("./InvoicingRoutes-BTvzZ8JV.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,18,8,13,14,15,23,24,25,26,27,28,16])))),we=i((()=>r((()=>import("./ReimbursementRoutes-BUZKWvJ7.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,9,20,10,36,54,57,39,53,16])))),In=i((()=>r((()=>import("./ZeniAccountRoutes-D3ONSR9y.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,9,49,18,20,61,16])))),Rn=i((()=>r((()=>import("./TreasuryRoutes-C24SAGLB.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,20,10,9,16])))),An=i((()=>r((()=>import("./TransactionListRoutes-ChJOrV96.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,43,20,40,28,10,11,41,35,61,16])))),Tn=i((()=>r((()=>import("./ChargeCardRoutes-Db9V9An_.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,20,13,14,15,51,50,11,8,45,10,30,18,16])))),fn=i((()=>r((()=>import("./NotificationRoutes-wSm6mA8N.js")),__vite__mapDeps([65,1,2,3,8,4,5,6,7,20,15,16])))),bn=i((()=>r((()=>import("./PerformanceRoutes-W4NxEUmH.js")),__vite__mapDeps([66,1,2,3,8,4,5,6,7,20,13,14,15,16])))),yn=i((()=>r((()=>import("./ExpenseAutomationRoutes-DcjeaHHd.js")),__vite__mapDeps([67,1,2,3,8,4,5,6,7,20,40,28,10,11,41,34,35,43,32,33,37,36,16])))),wn=i((()=>r((()=>import("./ActualMatchingMatchDetailScreen-B6pl-MVl.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,34,35,28,11,8,16])))),Cn=i((()=>r((()=>import("./RewardsRoutes-DuYZ4TXP.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,8,16])))),Dn=i((()=>r((()=>import("./TaskRoutes-DPcu4NRR.js")),__vite__mapDeps([70,1,2,3,8,4,5,6,7,10,13,14,15,71,20,72,16])))),vn=i((()=>r((()=>import("./AiCfoScreen-BhfmD__h.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,47,33,11,72,16])))),Ce=i((()=>r((()=>import("./CardsAiCfoScreen-abedaxWu.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,16])))),f=i((()=>r((()=>import("./NotFoundScreen-CTik05r2.js")),__vite__mapDeps([8,1,2,3,4,5,6,7,16])))),Un=i((()=>r((()=>import("./TaskListScreen-C7smUYFP.js").then((l=>l.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,20,13,14,15,72,16]))));function Qn({setTenantEmailDomain:l}){const b=zs(),N=Gs(),{tenantEmailDomain:o}=$s(),V=ln().mode,{setLoading:O,clearAllLoading:W,clearLoading:H}=Ws(),y=T.getSignedInUserTenant(o)?.tenantId,R=T.getSignedInUser(),J=ms(R),G=Ys(),[P,ve]=U.useState(!1),n=z((a=>hs(a))),{useFeatureGate:S}=Js(),M=Ks(),K=Qs(),Ue=!!n.company?.companyZeniAccountInfo?.isZeniAccountEnabled,ke=n.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Fe}=S(L.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=S(L.isDebitCardFeatureEnabled),A=z((a=>a.tenantState.fetchState)),p=z((a=>a.tenantState.activeTenantFetchState.fetchState)),m=p==="Completed"||A==="Completed"?_s(te,n):void 0,Q=p==="Completed"||A==="Completed"?ps(n):void 0,oe=p==="Completed"||A==="Completed"?xs(n)&&!Es(n):void 0,Oe=Xs(n,Fe,te),{isCardsHidden:Pe}=en(n?.tenantId),He=!Oe||!!Pe,{isFeatureEnabled:Se}=S(L.isSettingsFeatureEnabled),{isFeatureEnabled:X}=S(L.isAiCfoFileUploadEnabled),{isFeatureEnabled:Be}=S(L.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Le=n?.userRole!=null&&gs(n.userRole),$=z((a=>js(a)));if(o!=null){const a=T.getSignedInUserTenant(o);R!=null&&a!=null&&fe(R,n,V)}const Z={tenantId:y,userId:R?.userId,sessionId:R?.zeniSessionId},re=Is(),h=sn(),Ne=n.company==null||h?.loggedInUserRoleMap!=null&&xe(h.loggedInUserRole),Ve=Rs(h?.loggedInUserRoleMap),ee=Ae("/:tenantEmailDomain/onboarding/*")!==null,Me=Ae("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Me?.params.selectedPeriod,Ze=z((a=>Z.tenantId!=null?As(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),l(o)}),[o]),U.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const D=Ts(Number(a[0])),w=Number(a[1]),t=fs(`01-${D<10?`0${D}`:D}-${w}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),_=bs();t.isAfter(_,"month")===!1?b(ys(y,{month:D,year:w})):N(`/${o}/month_end_close_checks/review`)}}}),[se,o,y]),U.useEffect((()=>{P||(ve(!0),O(F.TENANT_FETCHING))}),[P,Z,re,R,b,T]),U.useLayoutEffect((()=>{!ws(re,Z)&&T.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t){if(ge(D?.userId,D?.zeniSessionId,a.tenantId),w(Ms(!0)),w(je(a.tenantId)),a.tenantId!=null&&c.clearTenant(a.tenantId),a.tenantId!=null){const _=T.getSignedInUserTenantWithId(a.tenantId);t&&Te.updateAppLocaleID(dn(t)),_?.tenantEmailDomain!=null&&T.saveActiveTenantDomainForUser(_?.tenantEmailDomain)}a.userId!=null?ae.identify(a.userId,{tenant_id:a.tenantId}):ae.resetUserIdentity()})(Z,R,b,Ze))}),[y]),U.useEffect((()=>{T.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t,_,is,B){if(w==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&_?.zeniSessionId!=null,ls=w==null||w.tenantId!==t,ds=w!=null&&w.excludedResources==null,cs=w!=null&&w.externalConnections==null;if(Y&&ls){B(je(t));const q=T.getSignedInUserTenantWithId(t);q?.tenantEmailDomain!=null&&T.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(_?.userId,_?.zeniSessionId,t),c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)))}else Y&&ds&&c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),Y&&cs&&c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)));if(Y){ae.identify(_.userId,{tenant_id:t});const q=t==null||t!=null&&(D==="Completed"||D==="Error");if(a==="Completed"||D!=="Not-Started"&&D!=="Error"||t==null||!c.shouldFetchActiveTenant(t)||(c.markActiveTenantFetchStarted(t),is(F.TENANT_FETCHING),B(Zs(_.userId,t,_.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&c.shouldFetchAllTenants()){c.markAllTenantsFetchStarted();const{userId:us,zeniSessionId:pe}=_;tn((()=>{T.getSignedInUser()?.zeniSessionId===pe?B(Ee(us,pe)):c.markAllTenantsFetchFailed()}),kn)}}})(A,p,n,y,R,O,b))}),[y,p]),U.useEffect((()=>{T.isSignedIn()&&A==="Completed"&&$.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),T.saveSignedInUserTenants(Cs($.tenantsBaseInOrder)),R!=null&&fe(R,n,V,void 0,$.tenantsBaseInOrder))}),[$,A,n,R]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(performance.mark("zeni:boot_tenant_data"),W(),c.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(c.markActiveTenantFetchFailed(y),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?c.markAllTenantsFetchCompleted():A==="Error"&&c.markAllTenantsFetchFailed())}),[p,A,y,P]);const ie=U.useRef(!1);U.useEffect((()=>{!ie.current&&p==="Completed"&&P&&(ie.current=!0,nn())}),[p,P]);const v=n?.userRole!=null&&Ds(n?.userRole),{isFeatureEnabled:ze}=S(L.isReferralFeatureEnabled),{isFeatureEnabled:Ge}=S(L.isAccrualEnabled),$e=n?.userRole!=null&&n.userRole.includes("charge_card_user"),Ye=n?.userRole!=null&&n.userRole.includes("charge_card_admin"),k=n?.userRole!=null&&xe(n.userRole),le=n?.company==null||n.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!v,de=!He&&!v,qe=vs(h?.loggedInUserRoleMap),We=n.externalConnections?.accounting[0]?.isValid,Je=n.externalConnections?.fetchState==="Completed",ne=n.company?.companyOnboardingInfo.isOnboardingCompleted,ce=n?.company==null||n.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!v,ue=ce&&Us(h?.loggedInUserRoleMap),me=Ue&&!v,Ke=ke&&!v,Qe=le&&ks(h?.loggedInUserRoleMap),Xe=de&&Fs(h?.loggedInUserRoleMap),es=me&&Os(h?.loggedInUserRoleMap),ss=Ps(h?.loggedInUserRoleMap),ns=Hs(h?.loggedInUserRoleMap),as=Ss(h?.loggedInUserRoleMap),ts=Bs(h?.loggedInUserRoleMap),os=Ls(h?.loggedInUserRoleMap),x=Ns(h?.loggedInUserRoleMap),E=Vs(h?.loggedInUserRoleMap),he=le&&x,_e=ce&&E,g=me&&as,j=Ke&&ts,u=de&&os,rs=n.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ve===!0||qe===!0||ss===!0||ns===!0;return T.isSignedIn()?y==null?A==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(R!=null&&A!=="In-Progress"&&b(Ee(R.userId,R.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||A==="Completed"?(ne===!0||J&&!ee)&&Je&&We!==!0&&m===!1&&Q===!1&&oe===!1?(l(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!P||oe!==!0||ne!==!0||ee||J?!P||ne!==!1||ee||J?P&&n?.userRole&&m!=null&&Q!=null&&o!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(qs,{children:e.jsxs(s,{element:e.jsx(an,{}),children:[e.jsx(s,{path:"/",element:e.jsx(Fn,{isDashboardAccess:k,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,isTenantCardsOnly:Q,showChargeCardRoute:u})}),e.jsx(s,{path:"dashboard/*",element:k?e.jsx(En,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reports/*",element:k?e.jsx(cn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"people/*",element:rs||k?e.jsx(mn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"forecast/*",element:k?e.jsx(hn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"onboarding/*",element:e.jsx(_n,{})}),e.jsx(s,{path:"transaction/*",element:k&&v===!1||$e||Ye?e.jsx(xn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"transactions/*",element:k&&v===!1?e.jsx(An,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"customer/*",element:k&&v===!1?e.jsx(be,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,isTenantBankingOnly:m,showTreasuryRoute:j,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"vendor/*",element:k&&v===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"tasks",element:e.jsx(Un,{})}),e.jsx(s,{path:"tasks/*",element:e.jsx(Dn,{})}),e.jsx(s,{path:"address/*",element:Qe||ue||es||Xe?e.jsx(un,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"checking/*",element:e.jsx(I,{isAllowed:g,fallback:e.jsx(f,{}),children:e.jsx(In,{})})}),e.jsx(s,{path:"treasury/*",element:e.jsx(I,{isAllowed:j,fallback:e.jsx(f,{}),children:e.jsx(Rn,{})})}),e.jsx(s,{path:"performance",element:e.jsx(I,{isAllowed:K,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(bn,{})})}),e.jsx(s,{path:"month_end_close_checks/review/*",element:e.jsx(I,{isAllowed:K&&!v,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(yn,{})})}),e.jsx(s,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(I,{isAllowed:K&&!v&&Ge,fallback:e.jsx(f,{}),children:e.jsx(wn,{})})}),e.jsx(s,{path:"notifications/*",element:e.jsx(fn,{})}),e.jsx(s,{path:"vendors/*",element:e.jsx(I,{isAllowed:Ne,fallback:e.jsx(f,{}),children:e.jsx(pn,{})})}),e.jsx(s,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursement/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursements/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"settings/*",element:e.jsx(I,{isAllowed:Se,fallback:e.jsx(f,{}),children:e.jsx(gn,{hasAdminLevelAccess:ue})})}),e.jsx(s,{path:"invoicing/*",element:e.jsx(I,{isAllowed:Be&&Le,fallback:e.jsx(f,{}),children:e.jsx(jn,{})})}),e.jsx(s,{path:"cards/ask",element:e.jsx(I,{isAllowed:u&&M,fallback:e.jsx(f,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/ask/:session_id",element:e.jsx(I,{isAllowed:u&&M,fallback:e.jsx(f,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/*",element:e.jsx(I,{isAllowed:u,fallback:e.jsx(f,{}),children:e.jsx(Tn,{})})}),e.jsx(s,{path:"rewards/*",element:e.jsx(I,{isAllowed:ze,fallback:e.jsx(f,{}),children:e.jsx(Cn,{})})}),e.jsx(s,{path:"/ai-cfo",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(f,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(f,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/:session_id",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(f,{}),children:e.jsx(vn,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"*",element:e.jsx(f,{})})]})}):null:(l(void 0),e.jsx(d,{to:`/${o}/onboarding`,replace:!0})):(l(void 0),e.jsx(d,{to:`/${o}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),l(void 0),e.jsx(d,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const kn=5e3,Fn=({isDashboardAccess:l,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:o,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:W,showChargeCardRoute:H})=>{if(O===!0){if(b)return e.jsx(d,{to:"checking"});if(V)return e.jsx(d,{to:"treasury"});if(H)return e.jsx(d,{to:"cards"})}return W===!0&&H?e.jsx(d,{to:"cards"}):l?e.jsx(d,{to:"dashboard"}):b?e.jsx(d,{to:"checking"}):V?e.jsx(d,{to:"treasury"}):H?e.jsx(d,{to:"cards"}):N?e.jsx(d,{to:"bills"}):o?e.jsx(d,{to:"reimbursements"}):e.jsx(d,{to:"dashboard"})},I=({children:l,fallback:b,isAllowed:N})=>{const o=on();return N?l:o?e.jsx(rn,{fetchState:"In-Progress"}):b},De=({tenantEmailDomain:l})=>e.jsx(d,{to:`/${l}/dashboard`});export{Qn as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-UAxYbctH.js";import{a as d}from"./sentry-CQfqw6mU.js";import{h as Y,g as Z,u as _,i as O,j as b,l as K,n as Q,o as k}from"./core-BQ6YlWys.js";import{fI as w,Y6 as Pe,Oj as ve,Xi as we,Y7 as Ae,c7 as W,cK as De,cL as Ue,bp as _e,ef as Re,GB as Te,Y8 as Me,PM as Be,Na as Ne,N1 as de,M_ as Ve,GF as ue,N4 as pe,N7 as ge,Nd as X,CJ as ee,GE as Fe,lF as $,lI as me,Y9 as Ye,mS as Oe,GW as Le,Ya as Ge,Yb as $e,lD as Ze,Yc as Ke,lG as He,uV as qe,Yd as ze,Ye as Qe,uZ as Je,i4 as We,Vl as z,hY as ae,hV as Xe,i1 as en,Vm as nn,GT as tn,Yf as an,Yg as on,Nr as sn,ma as rn,ep as fe,eq as he,Yh as ln,gF as cn,V$ as dn,GS as oe,gK as se,gJ as un,GR as pn,gI as gn,gH as mn,Yi as fn,UT as be,Yj as hn,Yk as bn,Yl as Cn,Ym as Sn,Yn as yn,Yo as In,GZ as xn,Yp as En,GQ as ie,GK as G,Yq as kn,Yr as jn,Ys as re,Yt as Pn,dF as vn,Yu as wn,Yv as An,Yw as Dn,V3 as Un,dN as _n,dU as Rn,dT as Tn,dO as Mn,Yx as Bn,dR as Nn,dQ as Vn,dS as Fn,dP as Yn}from"./zeni-epic-state-j9Po26Lg.js";import{b0 as On,z as v,V as L,a8 as ne,b7 as Ln,d as H,p as te,N as V,i as Ce,L as Se,b8 as Gn,q as $n,_ as ye,b9 as Zn,az as Kn,ba as Hn,bb as qn,aC as zn,bc as Qn,s as Jn,k as Ie,bd as Wn}from"./index-DZBfE5XI.js";import{n as B}from"./mui-DYo6Z7Si.js";import{u as xe}from"./useTaskManagerAccess-CP331xWN.js";import{U as Xn}from"./AccountMappingScreen-DIZ1qWql.js";import{t as et,A as nt}from"./AddressScreen-CxRV-hrD.js";import F from"./NotFoundScreen-CY-XFa3a.js";import{g as tt}from"./analyticsHelper-BOs1nNPv.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DaAqJAwC.js";import{C as st}from"./CompanyPassportScreen-DtXzsb3x.js";import{M as T}from"./MobileAppDrawer-DTqKEh3f.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DJgvOf06.js";import{q as le}from"./QBOConnectionScreen-BLLJy6Ug.js";import{B as lt}from"./BillPayApprovalRoutes-WPV-16X0.js";import{R as ct}from"./ReimbursementApprovalRoutes-DX03V50m.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";import"./accountMappingHelper-DHkHknqJ.js";import"./routePaths-CaZTJQOM.js";import"./InboxNotificationsProvider-Daf1RQwd.js";import"./empty-mwfdcHvm.js";import"./pdf-lib-BMce44-8.js";import"./index-Bfsx1pdD.js";import"./url-OL55dppf.js";import"./index-B7zYAj-7.js";import"./decodeURIComponentSafe-D_MvDEMm.js";import"./useEnsureVendorListLoaded-BbjOUcqm.js";import"./ReimbursementApprovalRuleDetailScreen-y6N7Iuxh.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="d1c8623d-3cab-4b4e-a7a0-deb4ea3cbe54",e._sentryDebugIdIdentifier="sentry-dbid-d1c8623d-3cab-4b4e-a7a0-deb4ea3cbe54")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8e.js";import{h as Y,g as Z,u as _,i as O,j as C,l as K,n as Q,o as k}from"./core-BBlQ3ArL.js";import{fI as w,Y6 as Pe,Oj as ve,Xi as we,Y7 as Ae,c7 as W,cK as De,cL as Ue,bp as _e,ef as Re,GB as Te,Y8 as Me,PM as Be,Na as Ne,N1 as de,M_ as Ve,GF as ue,N4 as pe,N7 as ge,Nd as X,CJ as ee,GE as Fe,lF as $,lI as me,Y9 as Ye,mS as Oe,GW as Le,Ya as Ge,Yb as $e,lD as Ze,Yc as Ke,lG as He,uV as qe,Yd as ze,Ye as Qe,uZ as Je,i4 as We,Vl as z,hY as ae,hV as Xe,i1 as en,Vm as nn,GT as tn,Yf as an,Yg as on,Nr as sn,ma as rn,ep as fe,eq as he,Yh as ln,gF as cn,V$ as dn,GS as oe,gK as se,gJ as un,GR as pn,gI as gn,gH as mn,Yi as fn,UT as Ce,Yj as hn,Yk as Cn,Yl as bn,Ym as Sn,Yn as yn,Yo as In,GZ as xn,Yp as En,GQ as ie,GK as G,Yq as kn,Yr as jn,Ys as re,Yt as Pn,dF as vn,Yu as wn,Yv as An,Yw as Dn,V3 as Un,dN as _n,dU as Rn,dT as Tn,dO as Mn,Yx as Bn,dR as Nn,dQ as Vn,dS as Fn,dP as Yn}from"./zeni-epic-state-aUBx6G2Q.js";import{b0 as On,z as v,V as L,a8 as ne,b7 as Ln,d as H,p as te,N as V,i as be,L as Se,b8 as Gn,m as $n,_ as ye,b9 as Zn,az as Kn,ba as Hn,bb as qn,aC as zn,bc as Qn,q as Jn,j as Ie,bd as Wn}from"./index-ClwW47Zs.js";import{n as B}from"./mui--aGBnNu2.js";import{u as xe}from"./useTaskManagerAccess-DrmpkeUw.js";import{U as Xn}from"./AccountMappingScreen-4Zeu95kU.js";import{t as et,A as nt}from"./AddressScreen-Czlolp2X.js";import F from"./NotFoundScreen-CTik05r2.js";import{g as tt}from"./analyticsHelper-DkNc3mKz.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-je1np7-9.js";import{C as st}from"./CompanyPassportScreen-Db20J8Yl.js";import{M as T}from"./MobileAppDrawer-Bql3K6nh.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-B6j7j1rG.js";import{q as le}from"./QBOConnectionScreen-BEn_CddB.js";import{B as lt}from"./BillPayApprovalRoutes-B4dh4WxY.js";import{R as ct}from"./ReimbursementApprovalRoutes-CSZJghRB.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.js";import"./accountMappingHelper-CHQgwqfy.js";import"./routePaths-D0jOibXk.js";import"./InboxNotificationsProvider-DiTDJFwP.js";import"./empty-BiAWzWBi.js";import"./pdf-lib-Cvsvldn7.js";import"./index--CQENyaz.js";import"./url-nN4BnP9N.js";import"./index-ae04Qn4V.js";import"./decodeURIComponentSafe-YbpxzvKa.js";import"./useEnsureVendorListLoaded-COBYTL2U.js";import"./ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="1bddfe8d-0f71-48e6-9f64-d6854e667199",e._sentryDebugIdIdentifier="sentry-dbid-1bddfe8d-0f71-48e6-9f64-d6854e667199")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-UAxYbctH.js";import{a as d}from"./sentry-CQfqw6m
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=b((g=>w(g)));at();const u=b((g=>g.remiSetupApproverViewState.fetchState)),h=b((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=On(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return y?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=On(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return y?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-UAxYbctH.js";import{a as d}from"./sentry-CQfqw6m
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=b((A=>w(A))),p=b((A=>A.settingsViewState.bankConnection.fetchState)),y=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&_e(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=Ce(m,t,s),D=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=A=>{u(A)};return y||P||E||D?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:y,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(F,{})},ht=B.div`
17
+ `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),y=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&_e(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=be(m,t,s),D=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=A=>{u(A)};return y||P||E||D?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:y,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(F,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-UAxYbctH.js";import{a as d}from"./sentry-CQfqw6m
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,bt=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ye(e,o),{uiState:t}=n,s=(W(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(He(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(Ze(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Oe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Zn),Ct=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=b((j=>w(j))),S=b((j=>j.cardPaymentViewState)),m=b((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),y=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&y==="Completed"&&o($())}),[p,y]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(bt,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=K((function(e){const l=Qe(e,J);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,z("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,z(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(We(t,z("payments"),s))},onNotifyMe:s=>{H.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(Hn),yt=()=>{const e=Kn(),l=Y(),o=_(),{tenantEmailDomain:i}=O(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=b((I=>I.tenantState.fetchState)),c=b((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=L(),m=W(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(qe(J))}),[o]);const[p,y]=d.useState(!1);d.useEffect((()=>{p||(y(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=b((I=>ze(I,u))),P=b((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:D,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ye(e,o),{uiState:t}=n,s=(W(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(He(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(Ze(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Oe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Zn),bt=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),y=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&y==="Completed"&&o($())}),[p,y]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=K((function(e){const l=Qe(e,J);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,z("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,z(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(We(t,z("payments"),s))},onNotifyMe:s=>{H.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(Hn),yt=()=>{const e=Kn(),l=Y(),o=_(),{tenantEmailDomain:i}=O(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=L(),m=W(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(qe(J))}),[o]);const[p,y]=d.useState(!1);d.useEffect((()=>{p||(y(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>ze(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:D,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-UAxYbctH.js";import{a as d}from"./sentry-CQfqw6m
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=_(),{tenantEmailDomain:l}=O(),[o,i]=d.useState(!1),r=b((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=b((p=>an(p,n.userId))),s=b((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(qn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=_(),{tenantEmailDomain:l}=O(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(qn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-UAxYbctH.js";import{a as d}from"./sentry-CQfqw6m
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=_(),o=Y(),i=Z(),[r,n]=d.useState(!1),t=b((C=>w(C))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",y=b((C=>rn(C))),E=fe(t),g=he(m,t),P=!g&&y,j=Ce(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),D=!j||R,{areTenantIdsInSync:I}=zn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=b((C=>cn(C,P))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=C=>{n(C)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:y,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:C=>{const N=(function(ke,je){let q=`/${ke}/settings/my_profile`;return q=q.concat(`/new/${je}`),q})(s,C),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:C=>{const N={...x.myProfileLocalData,phone:C};l(oe({localData:N})),l(mn(C,"MyProfile"))},onResendOtp:C=>{l(gn(C,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(C,N)=>{l(un(C,N,"MyProfile"))},onVerifyOtpSuccess:C=>{C!=null&&v.saveZeniOtpToken(C),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:C=>{l(oe({localData:C}))}})]})};function jt(){const e=_(),l=b((f=>w(f))),o=l.companyId,i=l.tenantId,r=b((f=>fn(f))),n=b((f=>be(f))),t=b((f=>hn(f.notificationRegistryState))),s=b((f=>bn(f))),c=b((f=>Cn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),y=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(yn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,C)=>{e(jn({eventId:f,channel:re(U),enabled:C}))}),[e]),I=d.useCallback(((f,U)=>{e(Pn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,C)=>{e(wn({groupId:f,channel:re(U),enabled:C}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:y}),a.jsx(Wn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{y(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function ua(e){const[l,o]=d.useState(!1),i=b((y=>be(y))),r=b((y=>w(y))),n=L(),t=Ie(),s=_(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?_n(r)?a.jsxs(Q,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(Ct,{})}),Yn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(yt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function Pt(e){return a.jsxs(Q,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{ua as default};
49
+ `,ce=({appContent:e})=>{const l=_(),o=Y(),i=Z(),[r,n]=d.useState(!1),t=C((b=>w(b))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",y=C((b=>rn(b))),E=fe(t),g=he(m,t),P=!g&&y,j=be(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),D=!j||R,{areTenantIdsInSync:I}=zn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((b=>cn(b,P))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=b=>{n(b)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:y,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:b=>{const N=(function(ke,je){let q=`/${ke}/settings/my_profile`;return q=q.concat(`/new/${je}`),q})(s,b),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:b=>{const N={...x.myProfileLocalData,phone:b};l(oe({localData:N})),l(mn(b,"MyProfile"))},onResendOtp:b=>{l(gn(b,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(b,N)=>{l(un(b,N,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&v.saveZeniOtpToken(b),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{l(oe({localData:b}))}})]})};function jt(){const e=_(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>bn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),y=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(yn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,b)=>{e(jn({eventId:f,channel:re(U),enabled:b}))}),[e]),I=d.useCallback(((f,U)=>{e(Pn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,b)=>{e(wn({groupId:f,channel:re(U),enabled:b}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:y}),a.jsx(Wn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{y(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function ua(e){const[l,o]=d.useState(!1),i=C((y=>Ce(y))),r=C((y=>w(y))),n=L(),t=Ie(),s=_(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?_n(r)?a.jsxs(Q,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(bt,{})}),Yn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(yt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function Pt(e){return a.jsxs(Q,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{ua as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-UAxYbctH.js";import{h as Y,g as Q,u as ee,i as H,j as k,N,l as W,t as en}from"./core-BQ6YlWys.js";import{bJ as nn,fI as x,cx as tn,It as q,Xi as an,Xl as sn,vc as ne,v0 as te,mK as ae,Cf as L,a12 as be,gJ as We,gI as Ge,gH as Ke,a13 as on,IC as cn,Na as Ce,N1 as he,M_ as Ie,MF as X,N4 as Ae,N7 as _e,Nd as ke,CJ as ve,h2 as rn,cs as dn,eq as un,ep as ln,d2 as pn,br as mn,cl as Fe,ZH as yn,LF as fe,Mh as fn,ZD as gn,bK as Sn,Ov as ge,Oj as bn,Y7 as Cn,XT as hn,Oz as In,OD as An,a0T as je,C8 as _n,Tc as kn,a14 as vn,a15 as Pn,a16 as Tn,a17 as Je,a18 as En,a19 as Dn,a1a as Un,YE as On,a1b as wn,$z as qe,MR as Fn,MJ as xn,a1c as Vn,MN as Bn,$A as Oe,Pj as Xe,mS as jn,v3 as Ye,Ch as Nn,bE as Ne,Ct as Re,cv as Rn,$x as Qe,P9 as we,OS as Ln,OT as zn,OX as Mn,$C as $n,Pc as Le,$y as Zn,a1d as Hn,$B as Wn,P_ as Se,a0$ as Gn,gZ as Kn,JO as Jn,a1e as qn,JT as Xn,JS as Yn}from"./zeni-epic-state-j9Po26Lg.js";import{az as Pe,V as ie,p as ue,N as J,z as E,a9 as se,d as D,a8 as Te,U as Z,cZ as Qn,af as oe,bH as V,au as xe,c_ as et,b0 as nt,c$ as tt,C as Be,d0 as at,s as ze,bg as Me,a2 as it,ac as st,d1 as ot,d2 as ct,d3 as rt,w as dt}from"./index-DZBfE5XI.js";import{a as h}from"./sentry-CQfqw6mU.js";import{u as Ee,n as Ve,D as ut,S as lt}from"./mui-DYo6Z7Si.js";import{u as pt,d as $e,B as Ue}from"./BusinessVerificationPageScreen-DaAqJAwC.js";import{M as le}from"./MobileAppDrawer-DTqKEh3f.js";import R from"./NotFoundScreen-CY-XFa3a.js";import{a as Ze}from"./analyticsHelper-BOs1nNPv.js";import{d as He}from"./routePaths-CaZTJQOM.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]="d85d569e-8fa0-4d7a-8eea-c3469d71cf3b",e._sentryDebugIdIdentifier="sentry-dbid-d85d569e-8fa0-4d7a-8eea-c3469d71cf3b")}catch{}})();const mt=Ve.div`
1
+ import{j as d}from"./liveblocks-CuUK5O_2.js";import{h as Y,g as Q,u as ee,i as H,j as k,N,l as W,t as en}from"./core-BBlQ3ArL.js";import{bJ as nn,fI as x,cx as tn,It as q,Xi as an,Xl as sn,vc as ne,v0 as te,mK as ae,Cf as L,a12 as be,gJ as We,gI as Ge,gH as Ke,a13 as on,IC as cn,Na as Ce,N1 as he,M_ as Ie,MF as X,N4 as Ae,N7 as _e,Nd as ke,CJ as ve,h2 as rn,cs as dn,eq as un,ep as ln,d2 as pn,br as mn,cl as Fe,ZH as yn,LF as fe,Mh as fn,ZD as gn,bK as Sn,Ov as ge,Oj as bn,Y7 as Cn,XT as hn,Oz as In,OD as An,a0T as je,C8 as _n,Tc as kn,a14 as vn,a15 as Pn,a16 as Tn,a17 as Je,a18 as En,a19 as Dn,a1a as Un,YE as On,a1b as wn,$z as qe,MR as Fn,MJ as xn,a1c as Vn,MN as Bn,$A as Oe,Pj as Xe,mS as jn,v3 as Ye,Ch as Nn,bE as Ne,Ct as Re,cv as Rn,$x as Qe,P9 as we,OS as Ln,OT as zn,OX as Mn,$C as $n,Pc as Le,$y as Zn,a1d as Hn,$B as Wn,P_ as Se,a0$ as Gn,gZ as Kn,JO as Jn,a1e as qn,JT as Xn,JS as Yn}from"./zeni-epic-state-aUBx6G2Q.js";import{az as Pe,V as ie,p as ue,N as J,z as E,a9 as se,d as D,a8 as Te,U as Z,cZ as Qn,af as oe,bH as V,au as xe,c_ as et,b0 as nt,c$ as tt,C as Be,d0 as at,q as ze,bg as Me,a2 as it,ac as st,d1 as ot,d2 as ct,d3 as rt,w as dt}from"./index-ClwW47Zs.js";import{a as h}from"./sentry-D0lP5-8e.js";import{u as Ee,n as Ve,D as ut,S as lt}from"./mui--aGBnNu2.js";import{u as pt,d as $e,B as Ue}from"./BusinessVerificationPageScreen-je1np7-9.js";import{M as le}from"./MobileAppDrawer-Bql3K6nh.js";import R from"./NotFoundScreen-CTik05r2.js";import{a as Ze}from"./analyticsHelper-DkNc3mKz.js";import{d as He}from"./routePaths-D0jOibXk.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]="7e5c435d-1aca-44f5-b1ba-4401e08d1933",e._sentryDebugIdIdentifier="sentry-dbid-7e5c435d-1aca-44f5-b1ba-4401e08d1933")}catch{}})();const mt=Ve.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-UAxYbctH.js";import{a as u,R as T,v as A}from"./sentry-CQfqw6mU.js";import{u as z,h as D,j as l,g as M,N as O,l as P}from"./core-BQ6YlWys.js";import{u as j,z as s,d as E,G as V,T as _,U as F,W as B,X as N,Y as $,_ as v}from"./index-DZBfE5XI.js";import{fI as W,UP as Y,h9 as J,gl as R,gn as q,V7 as G,gY as H,d3 as X,V8 as U,V9 as K,Va as Q,d$ as y}from"./zeni-epic-state-j9Po26Lg.js";import{u as Z}from"./mui-DYo6Z7Si.js";import{u as ee}from"./useDeviceId-B6KB8W5T.js";import{f as te}from"./analyticsHelper-BOs1nNPv.js";import{t as ne}from"./getLocaleForTenant-jg4r2V28.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a917c61e-bf7f-418a-a7a7-8713185ad731",t._sentryDebugIdIdentifier="sentry-dbid-a917c61e-bf7f-418a-a7a7-8713185ad731")}catch{}})();const ae=P((function(t,a){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}=a;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}}),(function(t,a){const{location:d,navigate:g}=a;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,i)=>{A({message:`OAuth error from provider ${i} with error ${n}`,level:"error",tags:{authProvider:i,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,i)=>{const c=i==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:i,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:i}=a;i!=null&&(s.saveMagicLinkEmail(n),t(K(n,i)))},clearSignInError:()=>{t(U())}}}))($),ie=T.memo(ae);function ve({setTenantEmailDomain:t}){const a=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const i=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=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=>W(e))),I=l((e=>Y(e))),m=M(),w=Z().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.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(J(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),a(q(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),a(G("Completed")),V.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),H().then((()=>{const e=N();e!=null&&_(e)})),setTimeout((()=>{E.trackLogin(F.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,a]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ie,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:i??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx(B,{onClose:()=>a(U()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-CuUK5O_2.js";import{a as u,R as T,v as A}from"./sentry-D0lP5-8e.js";import{u as z,h as D,j as l,g as M,N as O,l as P}from"./core-BBlQ3ArL.js";import{u as j,z as s,d as E,G as V,T as _,U as F,W as B,X as N,Y as $,_ as v}from"./index-ClwW47Zs.js";import{fI as W,UP as Y,h9 as J,gl as R,gn as q,V7 as G,gY as H,d3 as X,V8 as U,V9 as K,Va as Q,d$ as y}from"./zeni-epic-state-aUBx6G2Q.js";import{u as Z}from"./mui--aGBnNu2.js";import{u as ee}from"./useDeviceId-pp3Grc-z.js";import{f as te}from"./analyticsHelper-DkNc3mKz.js";import{t as ne}from"./getLocaleForTenant-DTPcYF0O.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a917c61e-bf7f-418a-a7a7-8713185ad731",t._sentryDebugIdIdentifier="sentry-dbid-a917c61e-bf7f-418a-a7a7-8713185ad731")}catch{}})();const ae=P((function(t,a){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}=a;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}}),(function(t,a){const{location:d,navigate:g}=a;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,i)=>{A({message:`OAuth error from provider ${i} with error ${n}`,level:"error",tags:{authProvider:i,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,i)=>{const c=i==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:i,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:i}=a;i!=null&&(s.saveMagicLinkEmail(n),t(K(n,i)))},clearSignInError:()=>{t(U())}}}))($),ie=T.memo(ae);function ve({setTenantEmailDomain:t}){const a=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const i=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=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=>W(e))),I=l((e=>Y(e))),m=M(),w=Z().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.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(J(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),a(q(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),a(G("Completed")),V.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),H().then((()=>{const e=N();e!=null&&_(e)})),setTimeout((()=>{E.trackLogin(F.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,a]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ie,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:i??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx(B,{onClose:()=>a(U()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-UAxYbctH.js";import{a as i}from"./sentry-CQfqw6mU.js";import{u as l,g as f,N as u}from"./core-BQ6YlWys.js";import{z as n,d as a,U as m,a8 as p}from"./index-DZBfE5XI.js";import{g$ as g,Vn as y}from"./zeni-epic-state-j9Po26Lg.js";import{n as b}from"./mui-DYo6Z7Si.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.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]="85a3910a-872c-4205-983d-532bc8508977",t._sentryDebugIdIdentifier="sentry-dbid-85a3910a-872c-4205-983d-532bc8508977")}catch{}})();function L(){const t=l(),e=f(),r=i.useRef(!1),c=n.isSignedIn(),o=e.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
1
+ import{j as s}from"./liveblocks-CuUK5O_2.js";import{a as i}from"./sentry-D0lP5-8e.js";import{u as l,g as f,N as u}from"./core-BBlQ3ArL.js";import{z as n,d as a,U as m,a8 as p}from"./index-ClwW47Zs.js";import{g$ as g,Vn as y}from"./zeni-epic-state-aUBx6G2Q.js";import{n as b}from"./mui--aGBnNu2.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.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]="85a3910a-872c-4205-983d-532bc8508977",t._sentryDebugIdIdentifier="sentry-dbid-85a3910a-872c-4205-983d-532bc8508977")}catch{}})();function L(){const t=l(),e=f(),r=i.useRef(!1),c=n.isSignedIn(),o=e.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as A}from"./liveblocks-UAxYbctH.js";import{a as u}from"./sentry-CQfqw6mU.js";import{u as H,k as J,j as C,h as me,g as Se,i as ye,l as De}from"./core-BQ6YlWys.js";import{z as M,p as be,N as I,al as Ee,a9 as he,d as Ce,U as Ge,di as Ae,s as F,a5 as Ie}from"./index-DZBfE5XI.js";import{QR as Re,RC as ve,fI as Le,a1F as ne,gQ as Z,a1G as re,a1H as Be,R6 as X,a1I as Ke,Ri as Y,QT as we,Qv as Ue,RO as ee,a1J as ae,gk as Pe,RF as Fe,RK as je,Rx as xe,Rv as te,RL as Oe,Rs as Ne,a1K as $e,a1L as Qe,a1M as ze,a1N as Me,a1O as R,dg as Ze,df as Ve,a1P as qe,QQ as We}from"./zeni-epic-state-j9Po26Lg.js";import{n as He}from"./mui-DYo6Z7Si.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-DV6iNvbF.js";import{M as Xe}from"./MobileAppDrawer-DTqKEh3f.js";import{u as Ye}from"./useTaskManagerPusherEvents-BmjCwNse.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]="39508d14-b574-4207-86a4-fbea1053dbc8",e._sentryDebugIdIdentifier="sentry-dbid-39508d14-b574-4207-86a4-fbea1053dbc8")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.div`
1
+ import{j as A}from"./liveblocks-CuUK5O_2.js";import{a as u}from"./sentry-D0lP5-8e.js";import{u as H,k as J,j as C,h as me,g as Se,i as ye,l as De}from"./core-BBlQ3ArL.js";import{z as M,p as Ee,N as I,al as be,a9 as he,d as Ce,U as Ge,di as Ae,q as F,a5 as Ie}from"./index-ClwW47Zs.js";import{QR as Re,RC as ve,fI as Le,a1F as ne,gQ as Z,a1G as re,a1H as Be,R6 as X,a1I as Ke,Ri as Y,QT as we,Qv as Ue,RO as ee,a1J as ae,gk as Pe,RF as Fe,RK as je,Rx as xe,Rv as te,RL as Oe,Rs as Ne,a1K as $e,a1L as Qe,a1M as ze,a1N as Me,a1O as R,dg as Ze,df as Ve,a1P as qe,QQ as We}from"./zeni-epic-state-aUBx6G2Q.js";import{n as He}from"./mui--aGBnNu2.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-CWWQxV2L.js";import{M as Xe}from"./MobileAppDrawer-Bql3K6nh.js";import{u as Ye}from"./useTaskManagerPusherEvents-CHhZ2DRZ.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]="5fa5a239-35ba-4083-8ded-55e96f4d99e8",e._sentryDebugIdIdentifier="sentry-dbid-5fa5a239-35ba-4083-8ded-55e96f4d99e8")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as A}from"./liveblocks-UAxYbctH.js";import{a as u}from"./sentry-CQfqw6m
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,na=De((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,y=Be(e),f=M.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(f,a),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D}})},onReloadTasks:()=>{e(Z(!0,y))},onTabChange:a=>{e(Me(a))},onParentTaskClick:a=>{const s=se(f,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=z(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(ae({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ze({filters:a}))},onSearchTextChanged:a=>{e(Qe({searchText:a}))},onReloadCards:()=>{e(Z(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const a=Ie(p.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:a.newStack}})}else n("../")},updateLocalData:a=>{e($e({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Ne(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(te(t.localData.selectedTaskIds,a,Oe(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(xe(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=oa(v,a);e(X({taskDetailLocalData:s}));const D=z(f,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(D,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(je(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(Fe(a,s))},onTimeSpentUpdate:(a,s)=>{e(ee({task:a,updates:s}))},onShowToast:a=>{e(Pe(a))},onGroupByFilterChange:a=>{e(ae({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(ee({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(Ue(a,s))},onSubtaskCreation:(a,s)=>{e(we({...s,parentTaskId:a}))},handleGroupTemplateClick:a=>{e(Y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(Y(a,[s]))},handleNewTaskInitialization:a=>{if(e(X({taskDetailLocalData:{...Ke,name:a}})),t.localData.defaultTaskGroupId!=null){const s=z(f,t.localData.defaultTaskGroupId),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${f}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=me(),t=H(),n=Se(),c=M.getSignedInUser(),p=M.isZeniUser(),y=J(),f=C((d=>Le(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=be(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:D}=a(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=a(I.isTaskCategorizationEnabled),{isFeatureEnabled:ie}=a(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:le}=a(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ue}=a(I.isTaskRecurringParentEnabled),[ce,de]=u.useState(!1),O=C((d=>ne(d,s))),N=C((d=>d.taskGroupState)),L=O.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});Ee({isDataReady:L==="Completed"});const{markBoardFetchInFlight:V,requestTaskRefetch:$}=(function(d){const m=H(),r=J(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),B=u.useRef(),K=u.useCallback((()=>{B.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Re())}),[m,K]),b=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(ve())}),[m,r]),E=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:b()}),[w,b,r]),Q=u.useCallback((()=>{S.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,E())}),6e3))):E()}),[E,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=C((i=>i.taskListState.fetchState)),G=C((i=>i.taskGroupViewState.fetchState)),U=C((i=>i.taskListState.byTab.live)),P=C((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==B.current||h==="Error")&&(S.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):E()))}),[h,U,E]),u.useEffect((()=>{G!=="In-Progress"&&(!k.current||P!==g.current||G==="Error")&&(k.current=!1,o.current&&(o.current=!1,G!=="Error"&&b()))}),[G,P,b]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:Q}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||V(),t(Z(!1,s))}),[f?.tenantId,t,s,V,y]);const fe=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(f?.companyId,d),...aa(c?.userId,m)]}),[f?.companyId,c?.userId]);if(Ye({events:fe,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oe(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const T=y.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),B=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===B.length&&S.every((i=>B.includes(i))),w=k.taskGroupIds??[],b=r.task_group_ids??[],E=w.length!==b.length||!w.every((i=>b.includes(i))),Q=(i,Te)=>{const q=i??[],W=Te??[];if(q.length!==W.length)return!1;const ge=new Set(W);return q.every((_e=>ge.has(_e)))},h=r.name==null||r.name===k.name,G=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||Q(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&E&&h&&G&&U&&P)return}}return void $()}case _.TASKS_BULK_DELETED:{const r=ta(m);return r==null?void 0:void r.task_ids.forEach((T=>t(We(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void $()}},onSubscribed:()=>{$()}}),u.useEffect((()=>{L==="Completed"&&t(re({taskGroupById:N.taskGroupById}))}),[L,N.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[L==="Completed"?A.jsx(he,{analytics:Ce,onLoad:d=>(m=>m.trackPageLoaded(Ge.Event.taskListPage))(d)}):null,A.jsxs(sa,{children:[A.jsx(Xe,{isAppContentDrawerOpen:ce,handleDrawerToggle:d=>{de(d)}}),A.jsx(na,{location:n,navigate:e,currentTenant:f,taskGroupId:v,taskGroupState:N,localData:O.localData,uiState:O.uiState,isTaskTemplatesEnabled:s,taskListFetchState:L,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:D,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,z=(e,t)=>`/${e}/tasks/new/${t}`,oa=(e,t)=>{if(e==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Ze(t);return{...R.taskDetailLocalData,priority:n}}if(e==="status"){const n=Ve(t);return{...R.taskDetailLocalData,status:n}}if(e==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=qe(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},ma=Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}));export{_ as T,aa as a,ea as b,_a as c,ta as d,ra as e,ma as f,ga as t};
9
+ `,na=De((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,y=Be(e),f=M.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(f,a),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D}})},onReloadTasks:()=>{e(Z(!0,y))},onTabChange:a=>{e(Me(a))},onParentTaskClick:a=>{const s=se(f,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=z(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(ae({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ze({filters:a}))},onSearchTextChanged:a=>{e(Qe({searchText:a}))},onReloadCards:()=>{e(Z(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const a=Ie(p.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:a.newStack}})}else n("../")},updateLocalData:a=>{e($e({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Ne(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(te(t.localData.selectedTaskIds,a,Oe(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(xe(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=oa(v,a);e(X({taskDetailLocalData:s}));const D=z(f,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(D,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(je(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(Fe(a,s))},onTimeSpentUpdate:(a,s)=>{e(ee({task:a,updates:s}))},onShowToast:a=>{e(Pe(a))},onGroupByFilterChange:a=>{e(ae({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(ee({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(Ue(a,s))},onSubtaskCreation:(a,s)=>{e(we({...s,parentTaskId:a}))},handleGroupTemplateClick:a=>{e(Y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(Y(a,[s]))},handleNewTaskInitialization:a=>{if(e(X({taskDetailLocalData:{...Ke,name:a}})),t.localData.defaultTaskGroupId!=null){const s=z(f,t.localData.defaultTaskGroupId),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${f}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=me(),t=H(),n=Se(),c=M.getSignedInUser(),p=M.isZeniUser(),y=J(),f=C((d=>Le(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=Ee(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:D}=a(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=a(I.isTaskCategorizationEnabled),{isFeatureEnabled:ie}=a(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:le}=a(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ue}=a(I.isTaskRecurringParentEnabled),[ce,de]=u.useState(!1),O=C((d=>ne(d,s))),N=C((d=>d.taskGroupState)),L=O.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});be({isDataReady:L==="Completed"});const{markBoardFetchInFlight:V,requestTaskRefetch:$}=(function(d){const m=H(),r=J(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),B=u.useRef(),K=u.useCallback((()=>{B.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Re())}),[m,K]),E=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(ve())}),[m,r]),b=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:E()}),[w,E,r]),Q=u.useCallback((()=>{S.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,b())}),6e3))):b()}),[b,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=C((i=>i.taskListState.fetchState)),G=C((i=>i.taskGroupViewState.fetchState)),U=C((i=>i.taskListState.byTab.live)),P=C((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==B.current||h==="Error")&&(S.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):b()))}),[h,U,b]),u.useEffect((()=>{G!=="In-Progress"&&(!k.current||P!==g.current||G==="Error")&&(k.current=!1,o.current&&(o.current=!1,G!=="Error"&&E()))}),[G,P,E]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:Q}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||V(),t(Z(!1,s))}),[f?.tenantId,t,s,V,y]);const fe=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(f?.companyId,d),...aa(c?.userId,m)]}),[f?.companyId,c?.userId]);if(Ye({events:fe,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oe(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const T=y.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),B=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===B.length&&S.every((i=>B.includes(i))),w=k.taskGroupIds??[],E=r.task_group_ids??[],b=w.length!==E.length||!w.every((i=>E.includes(i))),Q=(i,Te)=>{const q=i??[],W=Te??[];if(q.length!==W.length)return!1;const ge=new Set(W);return q.every((_e=>ge.has(_e)))},h=r.name==null||r.name===k.name,G=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||Q(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&b&&h&&G&&U&&P)return}}return void $()}case _.TASKS_BULK_DELETED:{const r=ta(m);return r==null?void 0:void r.task_ids.forEach((T=>t(We(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void $()}},onSubscribed:()=>{$()}}),u.useEffect((()=>{L==="Completed"&&t(re({taskGroupById:N.taskGroupById}))}),[L,N.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[L==="Completed"?A.jsx(he,{analytics:Ce,onLoad:d=>(m=>m.trackPageLoaded(Ge.Event.taskListPage))(d)}):null,A.jsxs(sa,{children:[A.jsx(Xe,{isAppContentDrawerOpen:ce,handleDrawerToggle:d=>{de(d)}}),A.jsx(na,{location:n,navigate:e,currentTenant:f,taskGroupId:v,taskGroupState:N,localData:O.localData,uiState:O.uiState,isTaskTemplatesEnabled:s,taskListFetchState:L,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:D,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,z=(e,t)=>`/${e}/tasks/new/${t}`,oa=(e,t)=>{if(e==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Ze(t);return{...R.taskDetailLocalData,priority:n}}if(e==="status"){const n=Ve(t);return{...R.taskDetailLocalData,status:n}}if(e==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=qe(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},ma=Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}));export{_ as T,aa as a,ea as b,_a as c,ta as d,ra as e,ma as f,ga as t};