@zeniai/web-app-ui 5.3.97-dev → 5.3.97-next

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 (117) hide show
  1. package/dist/assets/{AccountMappingScreen-pMoXS6Rn.js → AccountMappingScreen-LtghMJ53.js} +1 -1
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-2j1MK1Cs.js → ActualMatchingMatchDetailScreen-CVOOgZ0b.js} +1 -1
  3. package/dist/assets/AddressRoutes-R0dB6V24.js +1 -0
  4. package/dist/assets/{AddressScreen-YJZ3XLLs.js → AddressScreen-BtCJRvRi.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-F0FnLHcN.js → AiCfoScreen-DlktWk8q.js} +1 -1
  6. package/dist/assets/{AppDrawer-DSRQq0gS.js → AppDrawer-CZayWSbG.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-Bruhx8rE.js → BillPayApprovalRoutes-DuTkAHwW.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-DUQj1hx4.js → BillPayRoutes-DcsfYiOV.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-BiU68eTf.js → BusinessVerificationPageScreen-BXuKHh4u.js} +1 -1
  10. package/dist/assets/{CardsAiCfoScreen-CUaeuUnr.js → CardsAiCfoScreen-ChhU1bs-.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-ynRPxHBZ.js → ChargeCardRoutes-DS6mznwb.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-BYufSIKe.js → CompanyPassportScreen-Bf-IroJd.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-DiTiPNDX.js → ConnectionAuthScreen-CJtJc_-c.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-BqbVaQlp.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-CrsZJCTy.js → CustomerOnboardingRoutes-B-wxGCQX.js} +1 -1
  16. package/dist/assets/{DashboardRoutes-BRTIyx5r.js → DashboardRoutes-CLHEbPPN.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-BO7x19ip.js → DefaultTenantHome-BLvZD7ii.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-KjWlwIBh.js → DomesticWireDetailScreen-BtSmYogC.js} +1 -1
  19. package/dist/assets/{DrawerScreen-DkAXkoMI.js → DrawerScreen-BtT38qdC.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-BzhW6WY7.js → EntityDetailRoutes-BywYsihJ.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-ZXNq7Qec.js → ExpenseAutomationRoutes-6J7B6_kl.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-BvZfqhwT.js → FeaturePreviewScreen-BgAvjcv4.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-DkrBLbDB.js → HubSpotOAuthCallbackScreen-1E_yM8vW.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-DbPSBd88.js → InboxNotificationsProvider-B6k_ZZus.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-CuULXbYn.js → InvoicingRoutes-ywVi-ZDX.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-D2nRpQw1.js → MagicLinkRoutes-NkKEOy1g.js} +1 -1
  27. package/dist/assets/{MagicLinkSignInScreen-2Zd1Nril.js → MagicLinkSignInScreen-D4kyBtMh.js} +1 -1
  28. package/dist/assets/{MobileAppDrawer-oi_jxOPF.js → MobileAppDrawer-8zMmA8Xu.js} +1 -1
  29. package/dist/assets/NotFoundScreen-BCeM_PG6.js +1 -0
  30. package/dist/assets/{NotificationRoutes-DUQWlfCi.js → NotificationRoutes-DS8otnRD.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-XOLntP64.js → OAuthConsentScreen-S0Wrgvg7.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-D9xLpCAH.js → PandLWithForecastRoutes-JTGLO-em.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-DEK-zZGM.js → PaymentLinkScreen-DdkG_EGZ.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-lW9xpnrb.js → PeopleRoutes-CnsPVM6G.js} +1 -1
  35. package/dist/assets/{PerformanceRoutes-C5ibwB0q.js → PerformanceRoutes-C6MvkBe5.js} +1 -1
  36. package/dist/assets/{Preview-DBGhtaN7.js → Preview-BLMB6QcV.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-DyZbiZk7.js → QBOConnectionScreen-B_vXQHtz.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-CUiLb34T.js → ReimbursementApprovalRoutes-CAthqpq_.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-WV0VKJY8.js → ReimbursementApprovalRuleDetailScreen-BXgJFPx_.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-CiCUWAKg.js → ReimbursementRoutes-DupKcJRv.js} +1 -1
  41. package/dist/assets/{ReportsRoutes-CXYlRE3O.js → ReportsRoutes-COyZzdLn.js} +1 -1
  42. package/dist/assets/{RewardsRoutes-gBJ6pm3X.js → RewardsRoutes-V4OelJJ2.js} +1 -1
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-C-oJpxCF.js → ScheduleDetailsPrepaidExpensesScreen-DQnOVl2n.js} +1 -1
  44. package/dist/assets/{ScreenRoutes-czg4LVOl.js → ScreenRoutes-BV5BoFkr.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-Brh5uqPV.js → SettingsRoutes-B42_e2Hj.js} +1 -1
  46. package/dist/assets/{SetupPagesScreen-DAeMUdyW.js → SetupPagesScreen-AIVkM_Y0.js} +1 -1
  47. package/dist/assets/{SignInScreen-DNDACP8F.js → SignInScreen-CdIhDjjF.js} +1 -1
  48. package/dist/assets/{SignOutScreen-Bdz6Ft6M.js → SignOutScreen-C34qCF-m.js} +1 -1
  49. package/dist/assets/{TaskListScreen-DgIXYUys.js → TaskListScreen-C0Wy5DT9.js} +1 -1
  50. package/dist/assets/{TaskRoutes-B5nKYrwF.js → TaskRoutes-DLTEXIri.js} +1 -1
  51. package/dist/assets/TransactionDetailRoutes-AN1QFiUE.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-B_dUf7sV.js → TransactionDetailScreen-CHQbplBd.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-w-YEtt6F.js → TransactionListRoutes-F0GiNEIF.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-bD3OIF4R.js → TreasuryRoutes-CVAwiAli.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-DTZh86cd.js → VendorsRoutes-X711fvAo.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-DC5m1P5X.js → WiseConfirmationScreen-D76OgQ_h.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-Cp_GiZAn.js → ZeniAccountRoutes-Bzvnup3I.js} +1 -1
  58. package/dist/assets/{ZeniAccountStatementScreen-9zE8sMnF.js → ZeniAccountStatementScreen-DKdZKSXu.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-BI6zMiQn.js → accountMappingHelper-o1sBkta7.js} +1 -1
  60. package/dist/assets/{analytics-d11__KPJ.js → analytics-D5jXUsQ3.js} +1 -1
  61. package/dist/assets/{analyticsHelper-BWXp54-h.js → analyticsHelper-v9_AA-g6.js} +1 -1
  62. package/dist/assets/{core-DN52-78R.js → core-BWrl6R4M.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-B3iHpNbe.js → decodeURIComponentSafe-WhsnYAK4.js} +1 -1
  64. package/dist/assets/{dnd-DmRCPujN.js → dnd-BbHjK4qR.js} +1 -1
  65. package/dist/assets/{empty-FXto4em_.js → empty-C-AQp48M.js} +1 -1
  66. package/dist/assets/{empty-_U_x9V4F.js → empty-HJWtiaJG.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-CqNU05fB.js → emptyVideoElement-Dx9QycdK.js} +1 -1
  68. package/dist/assets/{epic-o7-NdXGE.js → epic-CVgOH6h6.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-BEXB3_j0.js → expenseAutomationHelper-C7tu-4uT.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-C4ctFsVy.js → getLocaleForTenant-CtC8aHJ4.js} +1 -1
  71. package/dist/assets/{index-OGT-__nJ.js → index-BrWjmhHy.js} +1 -1
  72. package/dist/assets/{index-eTMT6pHH.js → index-Cr8GTk0V.js} +1 -1
  73. package/dist/assets/{index-GhKP-ylz.js → index-D3uPNG7F.js} +1 -1
  74. package/dist/assets/{index-GfEl-Dfx.js → index-DW78R7sV.js} +1 -1
  75. package/dist/assets/{index-CItQR0iB.js → index-m73PhWbr.js} +2 -2
  76. package/dist/assets/{index-BcXg2TkN.js → index-nAoYt7sS.js} +1 -1
  77. package/dist/assets/{index-Dc7Kl8xP.js → index-w6JYCpiU.js} +1 -1
  78. package/dist/assets/{index-CcTOsN6n.js → index-wnCO9EbF.js} +8 -8
  79. package/dist/assets/{lexical-LEeCUpN7.js → lexical-B89FceKv.js} +1 -1
  80. package/dist/assets/{liveblocks-9GmpXxpV.js → liveblocks-B6vxaAqz.js} +1 -1
  81. package/dist/assets/{lottie-yPmCb5yH.js → lottie-D6Aqllry.js} +1 -1
  82. package/dist/assets/{mui-DhQvsLdn.js → mui-ByGAP7gt.js} +1 -1
  83. package/dist/assets/{pathToGoBack-DJTUj6Ze.js → pathToGoBack-C1T8-OpE.js} +1 -1
  84. package/dist/assets/{pdf-cTO9wAGA.js → pdf-BfCjm_so.js} +3 -3
  85. package/dist/assets/{pdf-lib-CF1yLptT.js → pdf-lib-DFwEcrOi.js} +1 -1
  86. package/dist/assets/{plaid-DKx0sbcX.js → plaid-C39IGEx4.js} +1 -1
  87. package/dist/assets/{pusher-BAaWw3wT.js → pusher-BOonk0F3.js} +1 -1
  88. package/dist/assets/{react-CTglmHXr.js → react-CYm2PfiO.js} +1 -1
  89. package/dist/assets/{react-BqKaOlqR.js → react-ClHl4lmy.js} +1 -1
  90. package/dist/assets/{react-CGDLhvO_.js → react-Db8Os_Ag.js} +1 -1
  91. package/dist/assets/{react-Bl63jZN7.js → react-DesIrnly.js} +1 -1
  92. package/dist/assets/{react-CDZLt83I.js → react-K5Dj4Z5s.js} +1 -1
  93. package/dist/assets/{react-BcUp-j0h.js → react-gsmIegQJ.js} +1 -1
  94. package/dist/assets/{recharts-D1kT0p-5.js → recharts-Ybgd62gt.js} +1 -1
  95. package/dist/assets/{routePaths-Cf2lH5Cm.js → routePaths-Dh25imAD.js} +1 -1
  96. package/dist/assets/{sentry-BjL01Z0h.js → sentry-AM9ygkuy.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CsMQFMU-.js → stripSplatSuffix-LZwtKl1i.js} +1 -1
  98. package/dist/assets/{url-BaKy2r5z.js → url-BIJCR4Ca.js} +1 -1
  99. package/dist/assets/{url-CGtBtyoL.js → url-BfgNXtOD.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-DkRrIUr5.js → useActualMatchingMatchDetail-9-rcMHRW.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CtcDCRqR.js → useAiCfoDashboardSuggestedQuestionsChips-DJy-eioS.js} +1 -1
  102. package/dist/assets/{useAskAiCfoHostNavButtonProps-BzzTTT3R.js → useAskAiCfoHostNavButtonProps-CNU5kDV5.js} +1 -1
  103. package/dist/assets/{useChargeCardPusherEvents-BM2UpqSx.js → useChargeCardPusherEvents-C9ej5lPl.js} +1 -1
  104. package/dist/assets/{useDeviceId-YMqu84TU.js → useDeviceId-Y7auM6u1.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-Dylp3fKb.js → useEmailConnectResultRefresh-BLtqAAgq.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-CE-c1u_9.js → useInitialThreadRequest-BwMsUHDw.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-BxLSEWlO.js → useTaskManagerAccess-Zlyco6Mm.js} +1 -1
  108. package/dist/assets/{useTaskManagerPusherEvents-DcBcCFgV.js → useTaskManagerPusherEvents-JDBSLX1h.js} +1 -1
  109. package/dist/assets/{utils-BoByipD1.js → utils-DSI7OWLu.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-O7185yBB.js → withTransactionSidePanel-sNc_Vk-e.js} +1 -1
  111. package/dist/assets/{zeni-epic-state-kN_H0ghW.js → zeni-epic-state-B8rVYKDq.js} +3 -3
  112. package/dist/index.html +1 -1
  113. package/package.json +1 -1
  114. package/dist/assets/AddressRoutes-tA_EPTQS.js +0 -1
  115. package/dist/assets/CustomerOnboardingAuthScreen-C5aUZCcK.js +0 -1
  116. package/dist/assets/NotFoundScreen-CFVOeV9b.js +0 -1
  117. package/dist/assets/TransactionDetailRoutes-CWTTa-gP.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-9GmpXxpV.js";import{a as p}from"./sentry-BjL01Z0h.js";import{E as a,a7 as u,ab as f,ac as h}from"./index-CcTOsN6n.js";import{s as d}from"./mui-DhQvsLdn.js";import{i as y}from"./core-DN52-78R.js";import"./zeni-epic-state-kN_H0ghW.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.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]="8e7dd9f4-06b5-4f16-8d32-9e3d111e8904",e._sentryDebugIdIdentifier="sentry-dbid-8e7dd9f4-06b5-4f16-8d32-9e3d111e8904")}catch{}})();const g=d("div")`
1
+ import{j as r}from"./liveblocks-B6vxaAqz.js";import{a as p}from"./sentry-AM9ygkuy.js";import{E as a,a7 as u,ab as f,ac as h}from"./index-wnCO9EbF.js";import{s as d}from"./mui-ByGAP7gt.js";import{i as y}from"./core-BWrl6R4M.js";import"./zeni-epic-state-B8rVYKDq.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.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]="8e7dd9f4-06b5-4f16-8d32-9e3d111e8904",e._sentryDebugIdIdentifier="sentry-dbid-8e7dd9f4-06b5-4f16-8d32-9e3d111e8904")}catch{}})();const g=d("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-9GmpXxpV.js";import{W0 as re,fI as N,m3 as G,e0 as Y,d$ as le,SS as Q,Vp as ce,Di as Pe,W1 as J,D7 as je,Ds as Le,Dm as de,Db as pe,Dq as ve,Dn as Te,W2 as ue,sx as Ae,g9 as Ve,gG as Re,W3 as W,Df as me,De as ge,Dv as Fe,c9 as Oe}from"./zeni-epic-state-kN_H0ghW.js";import{_ as he,q as X,$ as _,z as H,f as fe,N as Ce,ad as ye,ax as be,ay as Ze,a9 as Se,E as F,ae as De,G as K,az as Be,ao as Ue,aq as $e,a6 as ze,h as we,K as We,p as _e,aA as Ge,V as He}from"./index-CcTOsN6n.js";import{D as xe,n as q,S as Ie}from"./mui-DhQvsLdn.js";import ae from"./NotFoundScreen-CFVOeV9b.js";import{a as c}from"./sentry-BjL01Z0h.js";import{u as ee,i as Ke,j as g,h as qe,g as Me,l as Je,n as se,o as z}from"./core-DN52-78R.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-BzzTTT3R.js";import{M as Ye}from"./MobileAppDrawer-oi_jxOPF.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";import"./InboxNotificationsProvider-DbPSBd88.js";import"./useTaskManagerAccess-BxLSEWlO.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]="c16dc109-65b9-408e-9186-cc38ea660297",e._sentryDebugIdIdentifier="sentry-dbid-c16dc109-65b9-408e-9186-cc38ea660297")}catch{}})();const Qe={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const f=he(),m=ee(),[O,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>G(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(_.isDebitCardFeatureEnabled),P=Y(I,p),v=le(p),T=Q(p),B=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{O===!0?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(_.isChargeCardFeatureEnabled),L=fe(p,j,I),{isCardsHidden:V}=Ce(p?.tenantId),y=!L||V,R=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:h,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(h==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ze,{...s})]})})},ea=q(Ie)`
1
+ import{j as a}from"./liveblocks-B6vxaAqz.js";import{W0 as re,fI as N,m3 as G,e0 as Y,d$ as le,SS as Q,Vp as ce,Di as Pe,W1 as J,D7 as je,Ds as Le,Dm as de,Db as pe,Dq as ve,Dn as Te,W2 as ue,sx as Ae,g9 as Ve,gG as Re,W3 as W,Df as me,De as ge,Dv as Fe,c9 as Oe}from"./zeni-epic-state-B8rVYKDq.js";import{_ as he,q as X,$ as _,z as H,f as fe,N as Ce,ad as ye,ax as be,ay as Ze,a9 as Se,E as F,ae as De,G as K,az as Be,ao as Ue,aq as $e,a6 as ze,h as we,K as We,p as _e,aA as Ge,V as He}from"./index-wnCO9EbF.js";import{D as xe,n as q,S as Ie}from"./mui-ByGAP7gt.js";import ae from"./NotFoundScreen-BCeM_PG6.js";import{a as c}from"./sentry-AM9ygkuy.js";import{u as ee,i as Ke,j as g,h as qe,g as Me,l as Je,n as se,o as z}from"./core-BWrl6R4M.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-CNU5kDV5.js";import{M as Ye}from"./MobileAppDrawer-8zMmA8Xu.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.js";import"./InboxNotificationsProvider-B6k_ZZus.js";import"./useTaskManagerAccess-Zlyco6Mm.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]="c16dc109-65b9-408e-9186-cc38ea660297",e._sentryDebugIdIdentifier="sentry-dbid-c16dc109-65b9-408e-9186-cc38ea660297")}catch{}})();const Qe={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const f=he(),m=ee(),[O,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>G(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(_.isDebitCardFeatureEnabled),P=Y(I,p),v=le(p),T=Q(p),B=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{O===!0?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(_.isChargeCardFeatureEnabled),L=fe(p,j,I),{isCardsHidden:V}=Ce(p?.tenantId),y=!L||V,R=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:h,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(h==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ze,{...s})]})})},ea=q(Ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-9GmpXxpV.js";import E from"./NotFoundScreen-CFVOeV9b.js";import{a as r}from"./sentry-BjL01Z0h.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as F,o as h}from"./core-DN52-78R.js";import{fI as O,a1F as b,bo as B,bn as N,iP as V,gk as q}from"./zeni-epic-state-kN_H0ghW.js";import{k as L,z as I,aq as $,dL as G}from"./index-CcTOsN6n.js";import"./mui-DhQvsLdn.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-BzzTTT3R.js";import{M as J}from"./MobileAppDrawer-oi_jxOPF.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";import"./InboxNotificationsProvider-DbPSBd88.js";import"./useTaskManagerAccess-BxLSEWlO.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]="322f80e2-1fa6-42d6-aa2e-e220a0e35907",e._sentryDebugIdIdentifier="sentry-dbid-322f80e2-1fa6-42d6-aa2e-e220a0e35907")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),Q=()=>{const e=_(),t=v(),c=L(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
1
+ import{j as s}from"./liveblocks-B6vxaAqz.js";import E from"./NotFoundScreen-BCeM_PG6.js";import{a as r}from"./sentry-AM9ygkuy.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as F,o as h}from"./core-BWrl6R4M.js";import{fI as O,a1F as b,bo as B,bn as N,iP as V,gk as q}from"./zeni-epic-state-B8rVYKDq.js";import{k as L,z as I,aq as $,dL as G}from"./index-wnCO9EbF.js";import"./mui-ByGAP7gt.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-CNU5kDV5.js";import{M as J}from"./MobileAppDrawer-8zMmA8Xu.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.js";import"./InboxNotificationsProvider-B6k_ZZus.js";import"./useTaskManagerAccess-Zlyco6Mm.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]="322f80e2-1fa6-42d6-aa2e-e220a0e35907",e._sentryDebugIdIdentifier="sentry-dbid-322f80e2-1fa6-42d6-aa2e-e220a0e35907")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),Q=()=>{const e=_(),t=v(),c=L(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1 +1 @@
1
- import{a as h,R as a}from"./sentry-BjL01Z0h.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
1
+ import{a as h,R as a}from"./sentry-AM9ygkuy.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-9GmpXxpV.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-BjL01Z0h.js";import{L as ge,c0 as xc,fI as kc,Ux as Tc,Vn as jl,c9 as xl}from"./zeni-epic-state-kN_H0ghW.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-BoByipD1.js";import{r as cn}from"./empty-FXto4em_.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-CF1yLptT.js";import{a as Ye,r as Fl}from"./index-BcXg2TkN.js";import{r as Ul}from"./index-OGT-__nJ.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-DN52-78R.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,T as Wl,C as Kl}from"./index-CcTOsN6n.js";import"./mui-DhQvsLdn.js";import{d as It}from"./decodeURIComponentSafe-B3iHpNbe.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]="bc1df7a4-8740-44b7-8a38-74f6696a7b83",e._sentryDebugIdIdentifier="sentry-dbid-bc1df7a4-8740-44b7-8a38-74f6696a7b83")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
1
+ import{j as _l}from"./liveblocks-B6vxaAqz.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-AM9ygkuy.js";import{L as ge,c0 as xc,fI as kc,Ux as Tc,Vn as jl,c9 as xl}from"./zeni-epic-state-B8rVYKDq.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-DSI7OWLu.js";import{r as cn}from"./empty-C-AQp48M.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-DFwEcrOi.js";import{a as Ye,r as Fl}from"./index-nAoYt7sS.js";import{r as Ul}from"./index-BrWjmhHy.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-BWrl6R4M.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,T as Wl,C as Kl}from"./index-wnCO9EbF.js";import"./mui-ByGAP7gt.js";import{d as It}from"./decodeURIComponentSafe-WhsnYAK4.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]="bc1df7a4-8740-44b7-8a38-74f6696a7b83",e._sentryDebugIdIdentifier="sentry-dbid-bc1df7a4-8740-44b7-8a38-74f6696a7b83")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
2
2
  `),I=S(E).split(`
3
3
  `),k=0,C="";if(O==="strictEqual"&&l(j)==="object"&&l(E)==="object"&&j!==null&&E!==null&&(O="strictEqualObject"),R.length===1&&I.length===1&&R[0]!==I[0]){var H=R[0].length+I[0].length;if(H<=10){if(!(l(j)==="object"&&j!==null||l(E)==="object"&&E!==null||j===0&&E===0))return"".concat(_[O],`
4
4
 
@@ -1 +1 @@
1
- import{j as o}from"./liveblocks-9GmpXxpV.js";import Z from"./NotFoundScreen-CFVOeV9b.js";import{a as p}from"./sentry-BjL01Z0h.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as z,o as g}from"./core-DN52-78R.js";import{fI as E,ZJ as h,Z$ as R,Oe as U,Oa as L,Od as f,O3 as N,_o as $,O7 as J,Og as K}from"./zeni-epic-state-kN_H0ghW.js";import{z as B,w as T,c8 as q,n as _,bR as F,c9 as G}from"./index-CcTOsN6n.js";import"./mui-DhQvsLdn.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-WV0VKJY8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="2f6e9a04-4a4b-4306-b2ef-cea536b898c5",e._sentryDebugIdIdentifier="sentry-dbid-2f6e9a04-4a4b-4306-b2ef-cea536b898c5")}catch{}})();const j="reimbursement-approval-rule-update",M=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:R(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e($(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(q)),P=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>h(r))),b=u((r=>R(r).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(w(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(r,y,I)=>{r.endsWith(j)&&I.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",Q=O((function(e){const s=h(e),n=R(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e($(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(T(G)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=F(e?.tenantId);return s?o.jsx(Y,{isLoading:n}):o.jsx(P,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),r=u((i=>h(i)));H();const y=u((i=>R(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(w(!0),a(J(!1,!0)))}),[v,b,e,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,r,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(Q,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return o.jsxs(z,{children:[o.jsx(g,{path:"/",element:o.jsx(X,{})}),o.jsx(g,{path:"/new",element:o.jsx(x,{})}),o.jsx(g,{path:"/:approvalRuleId/edit",element:o.jsx(x,{})}),o.jsx(g,{path:"*",element:o.jsx(Z,{})})]})}export{le as R};
1
+ import{j as o}from"./liveblocks-B6vxaAqz.js";import Z from"./NotFoundScreen-BCeM_PG6.js";import{a as p}from"./sentry-AM9ygkuy.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as z,o as g}from"./core-BWrl6R4M.js";import{fI as E,ZJ as h,Z$ as R,Oe as U,Oa as L,Od as f,O3 as N,_o as $,O7 as J,Og as K}from"./zeni-epic-state-B8rVYKDq.js";import{z as B,w as T,c8 as q,n as _,bR as F,c9 as G}from"./index-wnCO9EbF.js";import"./mui-ByGAP7gt.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-BXgJFPx_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="2f6e9a04-4a4b-4306-b2ef-cea536b898c5",e._sentryDebugIdIdentifier="sentry-dbid-2f6e9a04-4a4b-4306-b2ef-cea536b898c5")}catch{}})();const j="reimbursement-approval-rule-update",M=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:R(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e($(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(q)),P=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>h(r))),b=u((r=>R(r).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(w(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(r,y,I)=>{r.endsWith(j)&&I.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",Q=O((function(e){const s=h(e),n=R(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e($(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(T(G)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=F(e?.tenantId);return s?o.jsx(Y,{isLoading:n}):o.jsx(P,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),r=u((i=>h(i)));H();const y=u((i=>R(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(w(!0),a(J(!1,!0)))}),[v,b,e,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,r,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(Q,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return o.jsxs(z,{children:[o.jsx(g,{path:"/",element:o.jsx(X,{})}),o.jsx(g,{path:"/new",element:o.jsx(x,{})}),o.jsx(g,{path:"/:approvalRuleId/edit",element:o.jsx(x,{})}),o.jsx(g,{path:"*",element:o.jsx(Z,{})})]})}export{le as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-9GmpXxpV.js";import{a as f}from"./sentry-BjL01Z0h.js";import{u as O,j as g,h as x,g as C,i as V,l as k}from"./core-DN52-78R.js";import{mv as Z,Z$ as w,ZJ as U,O6 as j,Oj as B,Oe as A,Of as E,_0 as N,fI as z,Od as J}from"./zeni-epic-state-kN_H0ghW.js";import{z as F,a5 as P,b$ as K,n as $,bR as W,c0 as G}from"./index-CcTOsN6n.js";import{u as q}from"./mui-DhQvsLdn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="ead6fcea-b78c-4684-9d21-33f94f6cfd7e",e._sentryDebugIdIdentifier="sentry-dbid-ead6fcea-b78c-4684-9d21-33f94f6cfd7e")}catch{}})();function H(){const e=O(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Z({})))}),[p,t,e])}const M=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const u=v=>{const S=[];return v.forEach((d=>{const I=d.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=d.actors.selectedNonUsers.map((m=>{const y=(R=m.value,N(R)==null);var R;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=I.concat(b);S.push({action:d.stepType.selectedOption,actors:c,operator:c.length>1?d.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function Q(){const e=x(),s=O(),t=C(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=q(),r=g((n=>w(n))),l=g((n=>U(n))),[a,u]=f.useState(!1);if(f.useEffect((()=>{a||(u(!0),s(j(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return N(e)==null}const X=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const u=c=>{const m=[];return c.forEach((y=>{const R=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];R==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):R==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const _=y.action??"require_approval";m.push({action:_,actors:D,operator:D.length>1?_==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,d={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;d.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(d.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=S?.selection.selectedOptions??[];if(b.length>0&&(d.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:d,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:d,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(J(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(G);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(Q,{})}function Y(){const e=x(),s=O(),t=C(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=q(),r=g((n=>w(n))),l=g((n=>U(n))),[a,u]=f.useState(!1);if(H(),f.useEffect((()=>{a||(u(!0),s(j(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as h}from"./liveblocks-B6vxaAqz.js";import{a as f}from"./sentry-AM9ygkuy.js";import{u as O,j as g,h as x,g as C,i as V,l as k}from"./core-BWrl6R4M.js";import{mv as Z,Z$ as w,ZJ as U,O6 as j,Oj as B,Oe as A,Of as E,_0 as N,fI as z,Od as J}from"./zeni-epic-state-B8rVYKDq.js";import{z as F,a5 as P,b$ as K,n as $,bR as W,c0 as G}from"./index-wnCO9EbF.js";import{u as q}from"./mui-ByGAP7gt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="ead6fcea-b78c-4684-9d21-33f94f6cfd7e",e._sentryDebugIdIdentifier="sentry-dbid-ead6fcea-b78c-4684-9d21-33f94f6cfd7e")}catch{}})();function H(){const e=O(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Z({})))}),[p,t,e])}const M=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const u=v=>{const S=[];return v.forEach((d=>{const I=d.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=d.actors.selectedNonUsers.map((m=>{const y=(R=m.value,N(R)==null);var R;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=I.concat(b);S.push({action:d.stepType.selectedOption,actors:c,operator:c.length>1?d.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function Q(){const e=x(),s=O(),t=C(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=q(),r=g((n=>w(n))),l=g((n=>U(n))),[a,u]=f.useState(!1);if(f.useEffect((()=>{a||(u(!0),s(j(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return N(e)==null}const X=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const u=c=>{const m=[];return c.forEach((y=>{const R=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];R==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):R==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const _=y.action??"require_approval";m.push({action:_,actors:D,operator:D.length>1?_==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,d={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;d.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(d.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=S?.selection.selectedOptions??[];if(b.length>0&&(d.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:d,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:d,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(J(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(G);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(Q,{})}function Y(){const e=x(),s=O(),t=C(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=q(),r=g((n=>w(n))),l=g((n=>U(n))),[a,u]=f.useState(!1);if(H(),f.useEffect((()=>{a||(u(!0),s(j(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-9GmpXxpV.js";import{u as ne,j as k,h as J,g as Q,i as se,N as M,l as Y,q as lt,n as mt,o as E}from"./core-DN52-78R.js";import{fI as V,Oa as ct,$u as be,c9 as ge,Ng as je,me as dt,Nv as me,Nu as ce,$v as ut,bn as he,gZ as Fe,$w as pt,Xr as bt,m3 as Ue,Xs as Re,Xt as gt,kR as ht,Zv as ft,l4 as St,N4 as It,CA as yt,kY as vt,NR as Le,$x as Ne,$y as ke,$z as At,$A as Rt,$B as kt,NB as Ce,la as Ct,ZE as wt,Nt as Et,Ne as xt,$C as Bt,Nd as Tt,$D as Dt,Nl as we,NF as $t,NE as jt,NA as Ft,$E as Pe,SS as Ut,bo as Lt,No as Nt,O7 as Pt,$F as Mt,$G as _t,NN as Ot,NK as Ee,Y$ as Zt,Nb as zt,$H as Me,OA as xe,OI as Gt,$I as Vt,$J as K,$K as Ht,$L as _e,$M as Wt,$N as Oe,$O as Ze,NZ as de,bv as qt,bL as fe,cN as Se,e0 as ze,d$ as Ge,$P as Kt,gk as Xt,Zc as Qt,$Q as Jt,$R as Ve,Zg as Yt,Z$ as en,$S as tn,_o as nn,OF as Be,OE as an,$T as sn,$U as on,$V as rn,$W as ln,$X as mn,ZK as cn,Ov as dn,Oz as un,bq as pn,bK as bn,cH as gn,cv as hn,bu as fn,US as Sn,db as In,de as yn,dd as vn,cG as An}from"./zeni-epic-state-kN_H0ghW.js";import{bR as Rn,k as He,_ as We,q as ie,$,z as U,cQ as qe,a6 as oe,h as C,aQ as Te,E as D,ac as ae,ad as kn,G as Ke,cR as Cn,p as X,aq as Xe,cS as wn,V as re,cT as En,ao as xn,a9 as Bn,a5 as Ie,K as Qe,w as Tn,bz as Dn,at as $n,ag as jn,cU as Fn,f as Un}from"./index-CcTOsN6n.js";import{n as _,S as Ln,u as Je}from"./mui-DhQvsLdn.js";import ue from"./NotFoundScreen-CFVOeV9b.js";import{S as De}from"./SetupPagesScreen-DAeMUdyW.js";import{F as Ye}from"./FeaturePreviewScreen-BvZfqhwT.js";import{a as f}from"./sentry-BjL01Z0h.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-BzzTTT3R.js";import{u as et}from"./useInitialThreadRequest-CE-c1u_9.js";import{D as Nn}from"./DrawerScreen-DkAXkoMI.js";import{M as tt}from"./MobileAppDrawer-oi_jxOPF.js";import{F as Pn}from"./ScreenRoutes-czg4LVOl.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CUiLb34T.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";import"./BusinessVerificationPageScreen-BiU68eTf.js";import"./routePaths-Cf2lH5Cm.js";import"./analyticsHelper-BWXp54-h.js";import"./InboxNotificationsProvider-DbPSBd88.js";import"./useTaskManagerAccess-BxLSEWlO.js";import"./getLocaleForTenant-C4ctFsVy.js";import"./ReimbursementApprovalRuleDetailScreen-WV0VKJY8.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]="723dc8e3-bc09-4020-919d-e55f90179b1d",e._sentryDebugIdIdentifier="sentry-dbid-723dc8e3-bc09-4020-919d-e55f90179b1d")}catch{}})();const nt=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Ke.getLocalizedStrings(),On=Y((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=U.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Ue(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=U.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(jt())},clearRemiSaveStatus:()=>{e($t("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(xt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Et({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(ke({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Rt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Ne()),e(ke({}));const i=nt(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}}))(Cn);function $e(){const e=J(),t=ne(),n=Q(),{reimbursementId:r}=se(),c=He(),d=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l($.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l($.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:x}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=Q().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[v,w]=f.useState(!1),h=U.getSignedInUser(),A=k((p=>V(p))),g=k((p=>be(p,r))),L=et(A?.companyId,{clearParams:g.fetchState==="Completed"}),j=ge(A?.userRole??[]);(function(){const p=ne(),N=k((P=>V(P))),O=N?.tenantId,{isApprovalRulesV3Enabled:H,isLoading:Z}=Rn(O),W=k((P=>P.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||Z||W==="Not-Started"&&p(ct(!0,!1,!1,H))}),[O,Z,H,W,p])})(),f.useEffect((()=>{(T&&!v||B&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(je(!1,b,y,r)))}));const F=k((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||j&&g.billStatus==="rejected"||j===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(zn,{}):null,m&&d!=="small"?s.jsx(Gn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:A?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:A?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:A,reimbursementId:r,themeState:c,uncategorizedAccounts:F,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:x})})]})}const Zn=_.div`
1
+ import{j as s}from"./liveblocks-B6vxaAqz.js";import{u as ne,j as k,h as J,g as Q,i as se,N as M,l as Y,q as lt,n as mt,o as E}from"./core-BWrl6R4M.js";import{fI as V,Oa as ct,$u as be,c9 as ge,Ng as je,me as dt,Nv as me,Nu as ce,$v as ut,bn as he,gZ as Fe,$w as pt,Xr as bt,m3 as Ue,Xs as Re,Xt as gt,kR as ht,Zv as ft,l4 as St,N4 as It,CA as yt,kY as vt,NR as Le,$x as Ne,$y as ke,$z as At,$A as Rt,$B as kt,NB as Ce,la as Ct,ZE as wt,Nt as Et,Ne as xt,$C as Bt,Nd as Tt,$D as Dt,Nl as we,NF as $t,NE as jt,NA as Ft,$E as Pe,SS as Ut,bo as Lt,No as Nt,O7 as Pt,$F as Mt,$G as _t,NN as Ot,NK as Ee,Y$ as Zt,Nb as zt,$H as Me,OA as xe,OI as Gt,$I as Vt,$J as K,$K as Ht,$L as _e,$M as Wt,$N as Oe,$O as Ze,NZ as de,bv as qt,bL as fe,cN as Se,e0 as ze,d$ as Ge,$P as Kt,gk as Xt,Zc as Qt,$Q as Jt,$R as Ve,Zg as Yt,Z$ as en,$S as tn,_o as nn,OF as Be,OE as an,$T as sn,$U as on,$V as rn,$W as ln,$X as mn,ZK as cn,Ov as dn,Oz as un,bq as pn,bK as bn,cH as gn,cv as hn,bu as fn,US as Sn,db as In,de as yn,dd as vn,cG as An}from"./zeni-epic-state-B8rVYKDq.js";import{bR as Rn,k as He,_ as We,q as ie,$,z as U,cQ as qe,a6 as oe,h as C,aQ as Te,E as D,ac as ae,ad as kn,G as Ke,cR as Cn,p as X,aq as Xe,cS as wn,V as re,cT as En,ao as xn,a9 as Bn,a5 as Ie,K as Qe,w as Tn,bz as Dn,at as $n,ag as jn,cU as Fn,f as Un}from"./index-wnCO9EbF.js";import{n as _,S as Ln,u as Je}from"./mui-ByGAP7gt.js";import ue from"./NotFoundScreen-BCeM_PG6.js";import{S as De}from"./SetupPagesScreen-AIVkM_Y0.js";import{F as Ye}from"./FeaturePreviewScreen-BgAvjcv4.js";import{a as f}from"./sentry-AM9ygkuy.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-CNU5kDV5.js";import{u as et}from"./useInitialThreadRequest-BwMsUHDw.js";import{D as Nn}from"./DrawerScreen-BtT38qdC.js";import{M as tt}from"./MobileAppDrawer-8zMmA8Xu.js";import{F as Pn}from"./ScreenRoutes-BV5BoFkr.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CAthqpq_.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.js";import"./BusinessVerificationPageScreen-BXuKHh4u.js";import"./routePaths-Dh25imAD.js";import"./analyticsHelper-v9_AA-g6.js";import"./InboxNotificationsProvider-B6k_ZZus.js";import"./useTaskManagerAccess-Zlyco6Mm.js";import"./getLocaleForTenant-CtC8aHJ4.js";import"./ReimbursementApprovalRuleDetailScreen-BXgJFPx_.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]="723dc8e3-bc09-4020-919d-e55f90179b1d",e._sentryDebugIdIdentifier="sentry-dbid-723dc8e3-bc09-4020-919d-e55f90179b1d")}catch{}})();const nt=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Ke.getLocalizedStrings(),On=Y((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=U.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Ue(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=U.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(jt())},clearRemiSaveStatus:()=>{e($t("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(xt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Et({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(ke({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Rt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Ne()),e(ke({}));const i=nt(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}}))(Cn);function $e(){const e=J(),t=ne(),n=Q(),{reimbursementId:r}=se(),c=He(),d=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l($.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l($.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:x}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=Q().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[v,w]=f.useState(!1),h=U.getSignedInUser(),A=k((p=>V(p))),g=k((p=>be(p,r))),L=et(A?.companyId,{clearParams:g.fetchState==="Completed"}),j=ge(A?.userRole??[]);(function(){const p=ne(),N=k((P=>V(P))),O=N?.tenantId,{isApprovalRulesV3Enabled:H,isLoading:Z}=Rn(O),W=k((P=>P.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||Z||W==="Not-Started"&&p(ct(!0,!1,!1,H))}),[O,Z,H,W,p])})(),f.useEffect((()=>{(T&&!v||B&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(je(!1,b,y,r)))}));const F=k((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||j&&g.billStatus==="rejected"||j===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(zn,{}):null,m&&d!=="small"?s.jsx(Gn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:A?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:A?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:A,reimbursementId:r,themeState:c,uncategorizedAccounts:F,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:x})})]})}const Zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-9GmpXxpV.js";import{g as J,h as ke,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-DN52-78R.js";import{fI as N,EE as R,Vo as Ee,m3 as ne,uh as re,v6 as D,lK as Pe,lT as A,lL as E,kO as P,kF as L,kE as Le,DG as le,vb as Me,bq as Be,Vp as ve,bn as Ue,E$ as xe,Vq as ze,Vr as Ge,cj as I,Dz as He,Vs as X,Vt as Ye,Vu as qe,Vv as Ne,Vw as $e,Vx as Ke,Vy as Qe,Vz as Ze,VA as Je,VB as We,VC as Xe,VD as ea,VE as aa,VF as T,VG as M,VH as B,VI as v,VJ as U,VK as x,VL as z,VM as G,VN as H,VO as Y,ek as sa,EF as ta,Er as ee,Es as ae,EL as oa,Ew as se,ER as na,VP as ra,VQ as la,VR as ca,VS as ia,VT as da,VU as pa,VV as _a,VW as fa,VX as ma,VY as ua,e0 as ba,d$ as ha}from"./zeni-epic-state-kN_H0ghW.js";import{al as ya,am as wa,an as Ca,a as Sa,_ as Ia,q as ce,$ as ie,z as de,ao as ga,V as Ra,d as Va,ap as Ta,aq as ja,a6 as ka,h as q,K as Fa,x as Oa,p as pe,ar as Da,as as Aa,at as Ea}from"./index-CcTOsN6n.js";import"./mui-DhQvsLdn.js";import Pa from"./NotFoundScreen-CFVOeV9b.js";import{F as La}from"./FeaturePreviewScreen-BvZfqhwT.js";import{a as u}from"./sentry-BjL01Z0h.js";import{u as Ma}from"./useInitialThreadRequest-CE-c1u_9.js";import{t as te,a as oe,b as Ba}from"./routePaths-Cf2lH5Cm.js";import{M as va}from"./MobileAppDrawer-oi_jxOPF.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";import"./InboxNotificationsProvider-DbPSBd88.js";import"./useTaskManagerAccess-BxLSEWlO.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]="1fb60b9d-a3ca-42e4-a606-516aaf71f12d",e._sentryDebugIdIdentifier="sentry-dbid-1fb60b9d-a3ca-42e4-a606-516aaf71f12d")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:q,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(T(a)),(g(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ta({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=sa(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=g(t),l=I(t);l?(e(Ze({viewMode:a})),e(Je({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(T(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(T(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(T(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):g(o.selectedReportID)?e(qe({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?E():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?P():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):E(!0):P(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Aa(_),a=ke(),s=Fe(),t=J(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[$,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>N(n))),fe=k.masterTOSInfo?.isMasterTOSAccepted??!1,me=k.company?.companyInfo.firstMonthOfFY??1,ue=Ma(k?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Ee(n))),{areTenantIdsInSync:b}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!$&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":V&&s(L());break;case"balance_sheet_by_projects":S&&s(P());break;case"cash_flow_by_classes":V&&s(E());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Pe(h.timeframe))}}),[c,F,O,b,V,S]);const K=Ra(),we=K?.loggedInUserRole!=null&&Be(K?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),Q=n=>{Se(n)},Ie=Va(),ge=Ta();return(function(n){const{isDataReady:Re}=n,{pathname:Ve}=J(),Z=ya(Ve??"")==="reports",Te=wa(Re),je=u.useMemo((()=>Z?Ua:void 0),[Z]);Ca({canFetchSuggestedQuestions:Te,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ka,{analytics:q,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Q}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:q,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Q,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Ie&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Pa,{})})]})}export{ps as default};
1
+ import{j as p}from"./liveblocks-B6vxaAqz.js";import{g as J,h as ke,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-BWrl6R4M.js";import{fI as N,EE as R,Vo as Ee,m3 as ne,uh as re,v6 as D,lK as Pe,lT as A,lL as E,kO as P,kF as L,kE as Le,DG as le,vb as Me,bq as Be,Vp as ve,bn as Ue,E$ as xe,Vq as ze,Vr as Ge,cj as I,Dz as He,Vs as X,Vt as Ye,Vu as qe,Vv as Ne,Vw as $e,Vx as Ke,Vy as Qe,Vz as Ze,VA as Je,VB as We,VC as Xe,VD as ea,VE as aa,VF as T,VG as M,VH as B,VI as v,VJ as U,VK as x,VL as z,VM as G,VN as H,VO as Y,ek as sa,EF as ta,Er as ee,Es as ae,EL as oa,Ew as se,ER as na,VP as ra,VQ as la,VR as ca,VS as ia,VT as da,VU as pa,VV as _a,VW as fa,VX as ma,VY as ua,e0 as ba,d$ as ha}from"./zeni-epic-state-B8rVYKDq.js";import{al as ya,am as wa,an as Ca,a as Sa,_ as Ia,q as ce,$ as ie,z as de,ao as ga,V as Ra,d as Va,ap as Ta,aq as ja,a6 as ka,h as q,K as Fa,x as Oa,p as pe,ar as Da,as as Aa,at as Ea}from"./index-wnCO9EbF.js";import"./mui-ByGAP7gt.js";import Pa from"./NotFoundScreen-BCeM_PG6.js";import{F as La}from"./FeaturePreviewScreen-BgAvjcv4.js";import{a as u}from"./sentry-AM9ygkuy.js";import{u as Ma}from"./useInitialThreadRequest-BwMsUHDw.js";import{t as te,a as oe,b as Ba}from"./routePaths-Dh25imAD.js";import{M as va}from"./MobileAppDrawer-8zMmA8Xu.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.js";import"./InboxNotificationsProvider-B6k_ZZus.js";import"./useTaskManagerAccess-Zlyco6Mm.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]="1fb60b9d-a3ca-42e4-a606-516aaf71f12d",e._sentryDebugIdIdentifier="sentry-dbid-1fb60b9d-a3ca-42e4-a606-516aaf71f12d")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:q,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(T(a)),(g(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ta({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=sa(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=g(t),l=I(t);l?(e(Ze({viewMode:a})),e(Je({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(T(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(T(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(T(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):g(o.selectedReportID)?e(qe({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?E():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?P():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):E(!0):P(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Aa(_),a=ke(),s=Fe(),t=J(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[$,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>N(n))),fe=k.masterTOSInfo?.isMasterTOSAccepted??!1,me=k.company?.companyInfo.firstMonthOfFY??1,ue=Ma(k?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Ee(n))),{areTenantIdsInSync:b}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!$&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":V&&s(L());break;case"balance_sheet_by_projects":S&&s(P());break;case"cash_flow_by_classes":V&&s(E());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Pe(h.timeframe))}}),[c,F,O,b,V,S]);const K=Ra(),we=K?.loggedInUserRole!=null&&Be(K?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),Q=n=>{Se(n)},Ie=Va(),ge=Ta();return(function(n){const{isDataReady:Re}=n,{pathname:Ve}=J(),Z=ya(Ve??"")==="reports",Te=wa(Re),je=u.useMemo((()=>Z?Ua:void 0),[Z]);Ca({canFetchSuggestedQuestions:Te,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ka,{analytics:q,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Q}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:q,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Q,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Ie&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Pa,{})})]})}export{ps as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-9GmpXxpV.js";import{z as b,a6 as I,h as u,K as N,e1 as S,q as k,$ as C}from"./index-CcTOsN6n.js";import"./mui-DhQvsLdn.js";import g from"./NotFoundScreen-CFVOeV9b.js";import{a as c}from"./sentry-BjL01Z0h.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-DN52-78R.js";import{fI as _,a2G as j,a2H as p,Ei as P,q3 as V,a2I as q,Eg as G}from"./zeni-epic-state-kN_H0ghW.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.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]="2b390855-670d-4f4d-8b69-78b1594f3f5d",e._sentryDebugIdIdentifier="sentry-dbid-2b390855-670d-4f4d-8b69-78b1594f3f5d")}catch{}})();const z=T((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(S),H=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),w=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:l,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(H,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-B6vxaAqz.js";import{z as b,a6 as I,h as u,K as N,e1 as S,q as k,$ as C}from"./index-wnCO9EbF.js";import"./mui-ByGAP7gt.js";import g from"./NotFoundScreen-BCeM_PG6.js";import{a as c}from"./sentry-AM9ygkuy.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-BWrl6R4M.js";import{fI as _,a2G as j,a2H as p,Ei as P,q3 as V,a2I as q,Eg as G}from"./zeni-epic-state-B8rVYKDq.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.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]="2b390855-670d-4f4d-8b69-78b1594f3f5d",e._sentryDebugIdIdentifier="sentry-dbid-2b390855-670d-4f4d-8b69-78b1594f3f5d")}catch{}})();const z=T((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(S),H=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),w=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:l,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(H,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as E}from"./liveblocks-9GmpXxpV.js";import{a as A}from"./sentry-BjL01Z0h.js";import{i as M,u as H,h as Q,g as ee,j as h,l as te}from"./core-DN52-78R.js";import{Xm as Fe,Xn as Ge,m3 as ae,sB as Ve,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xo as Ye,fI as K,Wl as pe,Xp as Se,h2 as ne,cC as se,cD as le,FJ as ve,Xq as Ce,FN as Xe,gS as ce,sE as qe,td as ze,dE as Ze,dD as We,TJ as fe,FH as He,FB as Qe,Xr as De,Ft as et,Fs as tt,Fn as at,Fy as nt,FO as st,Xs as Y,Xt as ge,Fu as lt,Wm as oe,G2 as Ae,FX as Ie,Xu as xe,sH as Te,FR as Be,FP as Le,Xv as Je,G9 as we,G6 as je,FS as be,G8 as Ne}from"./zeni-epic-state-kN_H0ghW.js";import{a2 as de,aW as ie,aX as ct,z as ot,g as dt,a5 as it,a6 as ue,h as _,at as ut,aY as rt,p as G,G as ye,k as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-CcTOsN6n.js";import{n as re}from"./mui-DhQvsLdn.js";import{p as St}from"./pathToGoBack-DJTUj6Ze.js";import W from"./NotFoundScreen-CFVOeV9b.js";import{c as V}from"./routePaths-Cf2lH5Cm.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]="1521901c-15f2-461d-85dc-9dbe2a350cd2",e._sentryDebugIdIdentifier="sentry-dbid-1521901c-15f2-461d-85dc-9dbe2a350cd2")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ge(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ve(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(W,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
1
+ import{j as E}from"./liveblocks-B6vxaAqz.js";import{a as A}from"./sentry-AM9ygkuy.js";import{i as M,u as H,h as Q,g as ee,j as h,l as te}from"./core-BWrl6R4M.js";import{Xm as Fe,Xn as Ge,m3 as ae,sB as Ve,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xo as Ye,fI as K,Wl as pe,Xp as Se,h2 as ne,cC as se,cD as le,FJ as ve,Xq as Ce,FN as Xe,gS as ce,sE as qe,td as ze,dE as Ze,dD as We,TJ as fe,FH as He,FB as Qe,Xr as De,Ft as et,Fs as tt,Fn as at,Fy as nt,FO as st,Xs as Y,Xt as ge,Fu as lt,Wm as oe,G2 as Ae,FX as Ie,Xu as xe,sH as Te,FR as Be,FP as Le,Xv as Je,G9 as we,G6 as je,FS as be,G8 as Ne}from"./zeni-epic-state-B8rVYKDq.js";import{a2 as de,aW as ie,aX as ct,z as ot,g as dt,a5 as it,a6 as ue,h as _,at as ut,aY as rt,p as G,G as ye,k as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-wnCO9EbF.js";import{n as re}from"./mui-ByGAP7gt.js";import{p as St}from"./pathToGoBack-C1T8-OpE.js";import W from"./NotFoundScreen-BCeM_PG6.js";import{c as V}from"./routePaths-Dh25imAD.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]="1521901c-15f2-461d-85dc-9dbe2a350cd2",e._sentryDebugIdIdentifier="sentry-dbid-1521901c-15f2-461d-85dc-9dbe2a350cd2")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ge(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ve(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(W,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-CFVOeV9b.js","assets/sentry-BjL01Z0h.js","assets/core-DN52-78R.js","assets/zeni-epic-state-kN_H0ghW.js","assets/index-CcTOsN6n.js","assets/mui-DhQvsLdn.js","assets/analytics-d11__KPJ.js","assets/utils-BoByipD1.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-BRTIyx5r.js","assets/withTransactionSidePanel-O7185yBB.js","assets/useAskAiCfoHostNavButtonProps-BzzTTT3R.js","assets/TransactionDetailScreen-B_dUf7sV.js","assets/decodeURIComponentSafe-B3iHpNbe.js","assets/useInitialThreadRequest-CE-c1u_9.js","assets/routePaths-Cf2lH5Cm.js","assets/expenseAutomationHelper-BEXB3_j0.js","assets/stripSplatSuffix-CsMQFMU-.js","assets/analyticsHelper-BWXp54-h.js","assets/CompanyPassportScreen-BYufSIKe.js","assets/MobileAppDrawer-oi_jxOPF.js","assets/InboxNotificationsProvider-DbPSBd88.js","assets/useTaskManagerAccess-BxLSEWlO.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CtcDCRqR.js","assets/FeaturePreviewScreen-BvZfqhwT.js","assets/BillPayRoutes-DUQj1hx4.js","assets/AddressScreen-YJZ3XLLs.js","assets/DomesticWireDetailScreen-KjWlwIBh.js","assets/BusinessVerificationPageScreen-BiU68eTf.js","assets/DrawerScreen-DkAXkoMI.js","assets/SetupPagesScreen-DAeMUdyW.js","assets/BillPayApprovalRoutes-Bruhx8rE.js","assets/ReimbursementApprovalRuleDetailScreen-WV0VKJY8.js","assets/getLocaleForTenant-C4ctFsVy.js","assets/ReimbursementRoutes-CiCUWAKg.js","assets/ReimbursementApprovalRoutes-CUiLb34T.js","assets/TransactionListRoutes-w-YEtt6F.js","assets/ZeniAccountStatementScreen-9zE8sMnF.js","assets/SettingsRoutes-Brh5uqPV.js","assets/AccountMappingScreen-pMoXS6Rn.js","assets/QBOConnectionScreen-DyZbiZk7.js","assets/empty-FXto4em_.js","assets/index-BcXg2TkN.js","assets/url-CGtBtyoL.js","assets/index-OGT-__nJ.js","assets/accountMappingHelper-BI6zMiQn.js","assets/useEmailConnectResultRefresh-Dylp3fKb.js","assets/ReportsRoutes-CXYlRE3O.js","assets/ChargeCardRoutes-ynRPxHBZ.js","assets/useChargeCardPusherEvents-BM2UpqSx.js","assets/PeopleRoutes-lW9xpnrb.js","assets/ExpenseAutomationRoutes-ZXNq7Qec.js","assets/useActualMatchingMatchDetail-DkRrIUr5.js","assets/ScheduleDetailsPrepaidExpensesScreen-C-oJpxCF.js","assets/pathToGoBack-DJTUj6Ze.js","assets/TreasuryRoutes-bD3OIF4R.js","assets/VendorsRoutes-DTZh86cd.js","assets/ZeniAccountRoutes-Cp_GiZAn.js","assets/AddressRoutes-tA_EPTQS.js","assets/PandLWithForecastRoutes-D9xLpCAH.js","assets/CustomerOnboardingRoutes-CrsZJCTy.js","assets/TransactionDetailRoutes-CWTTa-gP.js","assets/EntityDetailRoutes-BzhW6WY7.js","assets/InvoicingRoutes-CuULXbYn.js","assets/NotificationRoutes-DUQWlfCi.js","assets/PerformanceRoutes-C5ibwB0q.js","assets/ActualMatchingMatchDetailScreen-2j1MK1Cs.js","assets/RewardsRoutes-gBJ6pm3X.js","assets/TaskRoutes-B5nKYrwF.js","assets/TaskListScreen-DgIXYUys.js","assets/useTaskManagerPusherEvents-DcBcCFgV.js","assets/AiCfoScreen-F0FnLHcN.js","assets/CardsAiCfoScreen-CUaeuUnr.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as hs,fI as Es,e0 as ps,d$ as xs,Bo as Rs,dj as gs,c9 as js,gM as Is,gc as Ts,dg as pe,cH as As,gq as bs,cz as fs,bF as Ds,br as ys,UO as vs,v as Cs,UR as Os,bq as Us,US as Ps,bL as ws,bK as Fs,bu as Ls,cv as Hs,UT as Vs,UU as ks,db as Ss,de as Bs,dd as Ns,cG as Ms,cN as Zs,pW as xe,gl as Re,h0 as $s,gn as ge,gO as je,gP as Ie,go as zs}from"./zeni-epic-state-kN_H0ghW.js";import{j as e}from"./liveblocks-9GmpXxpV.js";import{a as P}from"./sentry-BjL01Z0h.js";import{N as u,u as Gs,h as qs,i as Ws,g as Ys,j as $,q as Te,n as Ks,o as n}from"./core-DN52-78R.js";import{F as l,u as Xs,z as y,q as Js,d as Qs,o as et,$ as B,f as st,N as tt,V as nt,L as F,G as Ae,t as _,P as at,H as ot,h as ne}from"./index-CcTOsN6n.js";import{u as rt}from"./mui-DhQvsLdn.js";import{f as be}from"./analyticsHelper-BWXp54-h.js";import{t as it}from"./getLocaleForTenant-C4ctFsVy.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="e5f486fe-7d08-40d4-8d57-db05bec5db15",o._sentryDebugIdIdentifier="sentry-dbid-e5f486fe-7d08-40d4-8d57-db05bec5db15")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-CFVOeV9b.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(H===!0){if(o)return e.jsx(De,{tenantEmailDomain:C});if(i)return e.jsx(fe,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(De,{tenantEmailDomain:C}):i?e.jsx(fe,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):f?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-BRTIyx5r.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-DUQj1hx4.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-CiCUWAKg.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-w-YEtt6F.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-Brh5uqPV.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-CXYlRE3O.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-ynRPxHBZ.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-lW9xpnrb.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-ZXNq7Qec.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-bD3OIF4R.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-DTZh86cd.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-Cp_GiZAn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-CXYlRE3O.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),ht=l((()=>s((()=>import("./AddressRoutes-tA_EPTQS.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-lW9xpnrb.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-D9xLpCAH.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-CrsZJCTy.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-DTZh86cd.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-CWTTa-gP.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-BzhW6WY7.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-BRTIyx5r.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-DUQj1hx4.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-Brh5uqPV.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-CuULXbYn.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-CiCUWAKg.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-Cp_GiZAn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-bD3OIF4R.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-w-YEtt6F.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),Dt=l((()=>s((()=>import("./ChargeCardRoutes-ynRPxHBZ.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-DUQWlfCi.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-C5ibwB0q.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-ZXNq7Qec.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-2j1MK1Cs.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-gBJ6pm3X.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-B5nKYrwF.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-F0FnLHcN.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-CUaeuUnr.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-CFVOeV9b.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-DgIXYUys.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:V})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(H)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return C===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):H?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=Gs(),N=qs(),{tenantEmailDomain:i}=Ws(),H=rt().mode,{setLoading:O,clearAllLoading:C,clearLoading:V}=Xs(),D=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),K=hs(I),z=Ys(),[L,we]=P.useState(!1),r=$((a=>Es(a))),{useFeatureGate:k}=Js(),M=Qs(),X=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=k(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(B.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,J=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,Ve=st(r,He,oe),{isCardsHidden:ke}=tt(r?.tenantId),Se=!Ve||!!ke,{isFeatureEnabled:Be}=k(B.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=k(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&js(r.userRole),G=$((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&be(I,r,H)}const Z={tenantId:D,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),E=nt(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),ze=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=Ds(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?f(vs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,f,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,f,qe))}),[D]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){S(ge(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),Re(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,I,O,f))}),[D,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),I!=null&&be(I,r,H,void 0,G.tenantsBaseInOrder))}),[G,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(C(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:We}=k(B.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=k(B.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Je=Ps(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Hs(E?.loggedInUserRoleMap),os=Vs(E?.loggedInUserRoleMap),rs=ks(E?.loggedInUserRoleMap),is=Ss(E?.loggedInUserRoleMap),ls=Bs(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Je===!0||os===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&f(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||K&&!ee)&&es&&Qe!==!0&&h===!1&&J===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||K?!L||te!==!1||ee||K?L&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Xe?e.jsx(gt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(ft,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:X===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:X===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:X===!0&&U===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,$t as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-BCeM_PG6.js","assets/sentry-AM9ygkuy.js","assets/core-BWrl6R4M.js","assets/zeni-epic-state-B8rVYKDq.js","assets/index-wnCO9EbF.js","assets/mui-ByGAP7gt.js","assets/analytics-D5jXUsQ3.js","assets/utils-DSI7OWLu.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-CLHEbPPN.js","assets/withTransactionSidePanel-sNc_Vk-e.js","assets/useAskAiCfoHostNavButtonProps-CNU5kDV5.js","assets/TransactionDetailScreen-CHQbplBd.js","assets/decodeURIComponentSafe-WhsnYAK4.js","assets/useInitialThreadRequest-BwMsUHDw.js","assets/routePaths-Dh25imAD.js","assets/expenseAutomationHelper-C7tu-4uT.js","assets/stripSplatSuffix-LZwtKl1i.js","assets/analyticsHelper-v9_AA-g6.js","assets/CompanyPassportScreen-Bf-IroJd.js","assets/MobileAppDrawer-8zMmA8Xu.js","assets/InboxNotificationsProvider-B6k_ZZus.js","assets/useTaskManagerAccess-Zlyco6Mm.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DJy-eioS.js","assets/FeaturePreviewScreen-BgAvjcv4.js","assets/BillPayRoutes-DcsfYiOV.js","assets/AddressScreen-BtCJRvRi.js","assets/DomesticWireDetailScreen-BtSmYogC.js","assets/BusinessVerificationPageScreen-BXuKHh4u.js","assets/DrawerScreen-BtT38qdC.js","assets/SetupPagesScreen-AIVkM_Y0.js","assets/BillPayApprovalRoutes-DuTkAHwW.js","assets/ReimbursementApprovalRuleDetailScreen-BXgJFPx_.js","assets/getLocaleForTenant-CtC8aHJ4.js","assets/ReimbursementRoutes-DupKcJRv.js","assets/ReimbursementApprovalRoutes-CAthqpq_.js","assets/TransactionListRoutes-F0GiNEIF.js","assets/ZeniAccountStatementScreen-DKdZKSXu.js","assets/SettingsRoutes-B42_e2Hj.js","assets/AccountMappingScreen-LtghMJ53.js","assets/QBOConnectionScreen-B_vXQHtz.js","assets/empty-C-AQp48M.js","assets/index-nAoYt7sS.js","assets/url-BfgNXtOD.js","assets/index-BrWjmhHy.js","assets/accountMappingHelper-o1sBkta7.js","assets/useEmailConnectResultRefresh-BLtqAAgq.js","assets/ReportsRoutes-COyZzdLn.js","assets/ChargeCardRoutes-DS6mznwb.js","assets/useChargeCardPusherEvents-C9ej5lPl.js","assets/PeopleRoutes-CnsPVM6G.js","assets/ExpenseAutomationRoutes-6J7B6_kl.js","assets/useActualMatchingMatchDetail-9-rcMHRW.js","assets/ScheduleDetailsPrepaidExpensesScreen-DQnOVl2n.js","assets/pathToGoBack-C1T8-OpE.js","assets/TreasuryRoutes-CVAwiAli.js","assets/VendorsRoutes-X711fvAo.js","assets/ZeniAccountRoutes-Bzvnup3I.js","assets/AddressRoutes-R0dB6V24.js","assets/PandLWithForecastRoutes-JTGLO-em.js","assets/CustomerOnboardingRoutes-B-wxGCQX.js","assets/TransactionDetailRoutes-AN1QFiUE.js","assets/EntityDetailRoutes-BywYsihJ.js","assets/InvoicingRoutes-ywVi-ZDX.js","assets/NotificationRoutes-DS8otnRD.js","assets/PerformanceRoutes-C6MvkBe5.js","assets/ActualMatchingMatchDetailScreen-CVOOgZ0b.js","assets/RewardsRoutes-V4OelJJ2.js","assets/TaskRoutes-DLTEXIri.js","assets/TaskListScreen-C0Wy5DT9.js","assets/useTaskManagerPusherEvents-JDBSLX1h.js","assets/AiCfoScreen-DlktWk8q.js","assets/CardsAiCfoScreen-ChhU1bs-.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fI as Es,e0 as ps,d$ as xs,Bo as Rs,dj as gs,c9 as js,gM as Is,gc as Ts,dg as pe,cH as As,gq as bs,cz as fs,bF as Ds,br as ys,UO as vs,v as Cs,UR as Os,bq as Us,US as Ps,bL as ws,bK as Fs,bu as Ls,cv as Hs,UT as Vs,UU as ks,db as Ss,de as Bs,dd as Ns,cG as Ms,cN as Zs,pW as xe,gl as Re,h0 as $s,gn as ge,gO as je,gP as Ie,go as zs}from"./zeni-epic-state-B8rVYKDq.js";import{j as e}from"./liveblocks-B6vxaAqz.js";import{a as P}from"./sentry-AM9ygkuy.js";import{N as u,u as Gs,h as qs,i as Ws,g as Ys,j as $,q as Te,n as Ks,o as n}from"./core-BWrl6R4M.js";import{F as l,u as Xs,z as y,q as Js,d as Qs,o as et,$ as B,f as st,N as tt,V as nt,L as F,G as Ae,t as _,P as at,H as ot,h as ne}from"./index-wnCO9EbF.js";import{u as rt}from"./mui-ByGAP7gt.js";import{f as be}from"./analyticsHelper-v9_AA-g6.js";import{t as it}from"./getLocaleForTenant-CtC8aHJ4.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="e5f486fe-7d08-40d4-8d57-db05bec5db15",o._sentryDebugIdIdentifier="sentry-dbid-e5f486fe-7d08-40d4-8d57-db05bec5db15")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-BCeM_PG6.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(H===!0){if(o)return e.jsx(De,{tenantEmailDomain:C});if(i)return e.jsx(fe,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(De,{tenantEmailDomain:C}):i?e.jsx(fe,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):f?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-CLHEbPPN.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-DcsfYiOV.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-DupKcJRv.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-F0GiNEIF.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-B42_e2Hj.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-COyZzdLn.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-DS6mznwb.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-CnsPVM6G.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-6J7B6_kl.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CVAwiAli.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-X711fvAo.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-Bzvnup3I.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-COyZzdLn.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),ht=l((()=>s((()=>import("./AddressRoutes-R0dB6V24.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-CnsPVM6G.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-JTGLO-em.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-B-wxGCQX.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-X711fvAo.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-AN1QFiUE.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-BywYsihJ.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-CLHEbPPN.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-DcsfYiOV.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-B42_e2Hj.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-ywVi-ZDX.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-DupKcJRv.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-Bzvnup3I.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-CVAwiAli.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-F0GiNEIF.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),Dt=l((()=>s((()=>import("./ChargeCardRoutes-DS6mznwb.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-DS8otnRD.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-C6MvkBe5.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-6J7B6_kl.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-CVOOgZ0b.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-V4OelJJ2.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-DLTEXIri.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-DlktWk8q.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-ChhU1bs-.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-BCeM_PG6.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-C0Wy5DT9.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:V})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(H)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return C===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):H?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=Gs(),N=qs(),{tenantEmailDomain:i}=Ws(),H=rt().mode,{setLoading:O,clearAllLoading:C,clearLoading:V}=Xs(),D=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),K=hs(I),z=Ys(),[L,we]=P.useState(!1),r=$((a=>Es(a))),{useFeatureGate:k}=Js(),M=Qs(),X=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=k(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(B.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,J=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,Ve=st(r,He,oe),{isCardsHidden:ke}=tt(r?.tenantId),Se=!Ve||!!ke,{isFeatureEnabled:Be}=k(B.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=k(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&js(r.userRole),G=$((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&be(I,r,H)}const Z={tenantId:D,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),E=nt(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),ze=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=Ds(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?f(vs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,f,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,f,qe))}),[D]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){S(ge(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),Re(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,I,O,f))}),[D,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),I!=null&&be(I,r,H,void 0,G.tenantsBaseInOrder))}),[G,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(C(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:We}=k(B.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=k(B.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Je=Ps(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Hs(E?.loggedInUserRoleMap),os=Vs(E?.loggedInUserRoleMap),rs=ks(E?.loggedInUserRoleMap),is=Ss(E?.loggedInUserRoleMap),ls=Bs(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Je===!0||os===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&f(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||K&&!ee)&&es&&Qe!==!0&&h===!1&&J===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||K?!L||te!==!1||ee||K?L&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Xe?e.jsx(gt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(ft,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:X===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:X===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:X===!0&&U===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,$t as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-9GmpXxpV.js";import{a as d}from"./sentry-BjL01Z0h.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-DN52-78R.js";import{fI as v,_1 as Pe,Oa as je,ZA as ve,ZJ as we,c9 as X,cU as Ae,cV as De,bq as Ue,df as Re,Gs as Te,_2 as Me,PD as Be,N1 as Ne,MU as de,MR as Ve,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Oe,ly as Z,lB as me,_3 as Fe,mL as Le,GN as Ge,Wf as $e,Wg as Ze,lw as He,_4 as Ke,lz as qe,uL as ze,Wa as We,Wb as Je,uP as Qe,hZ as Xe,V9 as W,hR as ae,hO as Ye,hW as en,Va as nn,GK as tn,_5 as an,_6 as on,Ni as sn,m3 as rn,d$ as fe,e0 as he,_7 as ln,gF as cn,Vp as dn,GJ as oe,gK as se,gJ as un,GI as pn,gI as gn,gH as mn,_8 as fn,UB as Ce,_9 as hn,_a as Cn,_b as yn,_c as Sn,_d as bn,_e as In,GQ as xn,_f as En,GH as ie,GB as $,_g as kn,_h as _n,_i as re,_j as Pn,dU as jn,_k as vn,_l as wn,_m as An,UN as Dn,c1 as Un,c8 as Rn,c7 as Tn,c2 as Mn,_n as Bn,c5 as Nn,c4 as Vn,c6 as On,c3 as Fn}from"./zeni-epic-state-kN_H0ghW.js";import{bR as Ln,z as j,V as G,a5 as ne,c1 as Gn,h as q,q as te,$ as V,f as ye,N as Se,c2 as $n,g as Zn,T as be,c3 as Hn,ag as Kn,c4 as qn,c5 as zn,ao as Wn,c6 as Jn,p as Qn,c as Ie,c7 as Xn}from"./index-CcTOsN6n.js";import{n as B}from"./mui-DhQvsLdn.js";import{u as xe}from"./useTaskManagerAccess-BxLSEWlO.js";import{U as Yn}from"./AccountMappingScreen-pMoXS6Rn.js";import{t as et,A as nt}from"./AddressScreen-YJZ3XLLs.js";import O from"./NotFoundScreen-CFVOeV9b.js";import{g as tt}from"./analyticsHelper-BWXp54-h.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BiU68eTf.js";import{C as st}from"./CompanyPassportScreen-BYufSIKe.js";import{M as T}from"./MobileAppDrawer-oi_jxOPF.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-Dylp3fKb.js";import{q as le}from"./QBOConnectionScreen-DyZbiZk7.js";import{B as lt}from"./BillPayApprovalRoutes-Bruhx8rE.js";import{R as ct}from"./ReimbursementApprovalRoutes-CUiLb34T.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";import"./accountMappingHelper-BI6zMiQn.js";import"./routePaths-Cf2lH5Cm.js";import"./InboxNotificationsProvider-DbPSBd88.js";import"./empty-FXto4em_.js";import"./pdf-lib-CF1yLptT.js";import"./index-BcXg2TkN.js";import"./url-CGtBtyoL.js";import"./index-OGT-__nJ.js";import"./decodeURIComponentSafe-B3iHpNbe.js";import"./ReimbursementApprovalRuleDetailScreen-WV0VKJY8.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]="813c0444-96bc-4d11-8de0-653e86d4053d",e._sentryDebugIdIdentifier="sentry-dbid-813c0444-96bc-4d11-8de0-653e86d4053d")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-B6vxaAqz.js";import{a as d}from"./sentry-AM9ygkuy.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-BWrl6R4M.js";import{fI as v,_1 as Pe,Oa as je,ZA as ve,ZJ as we,c9 as X,cU as Ae,cV as De,bq as Ue,df as Re,Gs as Te,_2 as Me,PD as Be,N1 as Ne,MU as de,MR as Ve,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Oe,ly as Z,lB as me,_3 as Fe,mL as Le,GN as Ge,Wf as $e,Wg as Ze,lw as He,_4 as Ke,lz as qe,uL as ze,Wa as We,Wb as Je,uP as Qe,hZ as Xe,V9 as W,hR as ae,hO as Ye,hW as en,Va as nn,GK as tn,_5 as an,_6 as on,Ni as sn,m3 as rn,d$ as fe,e0 as he,_7 as ln,gF as cn,Vp as dn,GJ as oe,gK as se,gJ as un,GI as pn,gI as gn,gH as mn,_8 as fn,UB as Ce,_9 as hn,_a as Cn,_b as yn,_c as Sn,_d as bn,_e as In,GQ as xn,_f as En,GH as ie,GB as $,_g as kn,_h as _n,_i as re,_j as Pn,dU as jn,_k as vn,_l as wn,_m as An,UN as Dn,c1 as Un,c8 as Rn,c7 as Tn,c2 as Mn,_n as Bn,c5 as Nn,c4 as Vn,c6 as On,c3 as Fn}from"./zeni-epic-state-B8rVYKDq.js";import{bR as Ln,z as j,V as G,a5 as ne,c1 as Gn,h as q,q as te,$ as V,f as ye,N as Se,c2 as $n,g as Zn,T as be,c3 as Hn,ag as Kn,c4 as qn,c5 as zn,ao as Wn,c6 as Jn,p as Qn,c as Ie,c7 as Xn}from"./index-wnCO9EbF.js";import{n as B}from"./mui-ByGAP7gt.js";import{u as xe}from"./useTaskManagerAccess-Zlyco6Mm.js";import{U as Yn}from"./AccountMappingScreen-LtghMJ53.js";import{t as et,A as nt}from"./AddressScreen-BtCJRvRi.js";import O from"./NotFoundScreen-BCeM_PG6.js";import{g as tt}from"./analyticsHelper-v9_AA-g6.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BXuKHh4u.js";import{C as st}from"./CompanyPassportScreen-Bf-IroJd.js";import{M as T}from"./MobileAppDrawer-8zMmA8Xu.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-BLtqAAgq.js";import{q as le}from"./QBOConnectionScreen-B_vXQHtz.js";import{B as lt}from"./BillPayApprovalRoutes-DuTkAHwW.js";import{R as ct}from"./ReimbursementApprovalRoutes-CAthqpq_.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.js";import"./accountMappingHelper-o1sBkta7.js";import"./routePaths-Dh25imAD.js";import"./InboxNotificationsProvider-B6k_ZZus.js";import"./empty-C-AQp48M.js";import"./pdf-lib-DFwEcrOi.js";import"./index-nAoYt7sS.js";import"./url-BfgNXtOD.js";import"./index-BrWjmhHy.js";import"./decodeURIComponentSafe-WhsnYAK4.js";import"./ReimbursementApprovalRuleDetailScreen-BXgJFPx_.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]="813c0444-96bc-4d11-8de0-653e86d4053d",e._sentryDebugIdIdentifier="sentry-dbid-813c0444-96bc-4d11-8de0-653e86d4053d")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-9GmpXxpV.js";import{h as X,g as Y,u as ee,i as W,j as k,N as R,l as H,t as en}from"./core-DN52-78R.js";import{bK as nn,fI as V,cH as tn,Ik as q,ZA as an,ZD as sn,v2 as ne,uS as te,mD as ae,C6 as N,ZF as be,gJ as He,gI as Ge,gH as Ke,ZG as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as Q,MX as Ae,M_ as _e,N4 as ke,CA as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,ZH as yn,Lw as fe,M8 as fn,ZI as gn,bL as Sn,Om as ge,Oa as bn,ZJ as Cn,ZK as hn,Oq as In,Ou as An,ZL as je,B$ as _n,SW as kn,ZM as vn,ZN as Pn,ZO as Tn,ZP as Je,ZQ as En,ZR as Dn,V_ as Un,YR as On,Wd as wn,ZS as qe,MI as Fn,MA as Vn,We as xn,ME as Bn,ZT as Oe,Pa as Qe,mL as jn,uV as Xe,C8 as Rn,bF as Re,Ck as Le,cF as Ln,ZU as Ye,P0 as we,OJ as Nn,OK as Mn,OO as Zn,ZV as zn,P3 as Ne,ZW as $n,ZX as Wn,ZY as Hn,PR as Se,ZZ as Gn,gZ as Kn,JF as Jn,Z_ as qn,JK as Qn,JJ as Xn}from"./zeni-epic-state-kN_H0ghW.js";import{ag as Pe,V as ie,q as de,$ as J,z as E,a6 as se,h as D,a5 as Te,K as $,bO as Yn,ac as oe,bP as x,bg as Ve,bQ as et,bR as nt,bS as tt,n as Be,bT as at,p as Me,aE as Ze,_ as it,a9 as st,bU as ot,bV as ct,bW as rt,w as ut}from"./index-CcTOsN6n.js";import{a as h}from"./sentry-BjL01Z0h.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-DhQvsLdn.js";import{u as pt,d as ze,B as Ue}from"./BusinessVerificationPageScreen-BiU68eTf.js";import{M as le}from"./MobileAppDrawer-oi_jxOPF.js";import L from"./NotFoundScreen-CFVOeV9b.js";import{a as $e}from"./analyticsHelper-BWXp54-h.js";import{d as We}from"./routePaths-Cf2lH5Cm.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]="eeb9c768-4350-413e-af6e-29806007f51f",e._sentryDebugIdIdentifier="sentry-dbid-eeb9c768-4350-413e-af6e-29806007f51f")}catch{}})();const mt=xe.div`
1
+ import{j as u}from"./liveblocks-B6vxaAqz.js";import{h as X,g as Y,u as ee,i as W,j as k,N as R,l as H,t as en}from"./core-BWrl6R4M.js";import{bK as nn,fI as V,cH as tn,Ik as q,ZA as an,ZD as sn,v2 as ne,uS as te,mD as ae,C6 as N,ZF as be,gJ as He,gI as Ge,gH as Ke,ZG as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as Q,MX as Ae,M_ as _e,N4 as ke,CA as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,ZH as yn,Lw as fe,M8 as fn,ZI as gn,bL as Sn,Om as ge,Oa as bn,ZJ as Cn,ZK as hn,Oq as In,Ou as An,ZL as je,B$ as _n,SW as kn,ZM as vn,ZN as Pn,ZO as Tn,ZP as Je,ZQ as En,ZR as Dn,V_ as Un,YR as On,Wd as wn,ZS as qe,MI as Fn,MA as Vn,We as xn,ME as Bn,ZT as Oe,Pa as Qe,mL as jn,uV as Xe,C8 as Rn,bF as Re,Ck as Le,cF as Ln,ZU as Ye,P0 as we,OJ as Nn,OK as Mn,OO as Zn,ZV as zn,P3 as Ne,ZW as $n,ZX as Wn,ZY as Hn,PR as Se,ZZ as Gn,gZ as Kn,JF as Jn,Z_ as qn,JK as Qn,JJ as Xn}from"./zeni-epic-state-B8rVYKDq.js";import{ag as Pe,V as ie,q as de,$ as J,z as E,a6 as se,h as D,a5 as Te,K as $,bO as Yn,ac as oe,bP as x,bg as Ve,bQ as et,bR as nt,bS as tt,n as Be,bT as at,p as Me,aE as Ze,_ as it,a9 as st,bU as ot,bV as ct,bW as rt,w as ut}from"./index-wnCO9EbF.js";import{a as h}from"./sentry-AM9ygkuy.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-ByGAP7gt.js";import{u as pt,d as ze,B as Ue}from"./BusinessVerificationPageScreen-BXuKHh4u.js";import{M as le}from"./MobileAppDrawer-8zMmA8Xu.js";import L from"./NotFoundScreen-BCeM_PG6.js";import{a as $e}from"./analyticsHelper-v9_AA-g6.js";import{d as We}from"./routePaths-Dh25imAD.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]="eeb9c768-4350-413e-af6e-29806007f51f",e._sentryDebugIdIdentifier="sentry-dbid-eeb9c768-4350-413e-af6e-29806007f51f")}catch{}})();const mt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-9GmpXxpV.js";import{a as u,R as T,t as A}from"./sentry-BjL01Z0h.js";import{u as z,h as D,j as l,g as M,N as O,l as P}from"./core-DN52-78R.js";import{u as j,z as s,h as E,G as F,I as N,K as _,O as B,R,S as V,T as v}from"./index-CcTOsN6n.js";import{fI as W,Ux as Y,UR as $,gl as J,gn as K,UW as X,gY as G,dk as H,UX as y,UY as Z,UZ as q,c0 as U}from"./zeni-epic-state-kN_H0ghW.js";import{u as Q}from"./mui-DhQvsLdn.js";import{u as ee}from"./useDeviceId-YMqu84TU.js";import{f as te}from"./analyticsHelper-BWXp54-h.js";import{t as ne}from"./getLocaleForTenant-C4ctFsVy.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="78f1d689-a8eb-4613-937f-3da523896463",t._sentryDebugIdIdentifier="sentry-dbid-78f1d689-a8eb-4613-937f-3da523896463")}catch{}})();const ie=P((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Z(n,a)))},clearSignInError:()=>{t(y())}}}))(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:x,accountUnlockTime:h}=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=Q().mode,C=m.state?.magicLinkExpired,b=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants($(I.tenantsInOrder),o.zeniSessionId),J(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(X("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=R();e!=null&&N(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!b,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&h!=null?f.jsx(B,{onClose:()=>i(y()),unlockDate:h}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-B6vxaAqz.js";import{a as u,R as T,t as A}from"./sentry-AM9ygkuy.js";import{u as z,h as D,j as l,g as M,N as O,l as P}from"./core-BWrl6R4M.js";import{u as j,z as s,h as E,G as F,I as N,K as _,O as B,R,S as V,T as v}from"./index-wnCO9EbF.js";import{fI as W,Ux as Y,UR as $,gl as J,gn as K,UW as X,gY as G,dk as H,UX as y,UY as Z,UZ as q,c0 as U}from"./zeni-epic-state-B8rVYKDq.js";import{u as Q}from"./mui-ByGAP7gt.js";import{u as ee}from"./useDeviceId-Y7auM6u1.js";import{f as te}from"./analyticsHelper-v9_AA-g6.js";import{t as ne}from"./getLocaleForTenant-CtC8aHJ4.js";import"./recharts-Ybgd62gt.js";import"./analytics-D5jXUsQ3.js";import"./plaid-C39IGEx4.js";import"./dnd-BbHjK4qR.js";import"./stripe-cKAAJElX.js";import"./lottie-D6Aqllry.js";import"./lexical-B89FceKv.js";import"./pdf-BfCjm_so.js";import"./utils-DSI7OWLu.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="78f1d689-a8eb-4613-937f-3da523896463",t._sentryDebugIdIdentifier="sentry-dbid-78f1d689-a8eb-4613-937f-3da523896463")}catch{}})();const ie=P((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Z(n,a)))},clearSignInError:()=>{t(y())}}}))(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:x,accountUnlockTime:h}=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=Q().mode,C=m.state?.magicLinkExpired,b=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants($(I.tenantsInOrder),o.zeniSessionId),J(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(X("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=R();e!=null&&N(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!b,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&h!=null?f.jsx(B,{onClose:()=>i(y()),unlockDate:h}):null]})}export{ve as default};