@zeniai/web-app-ui 5.4.1-dev → 5.4.2-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/assets/{AccountMappingScreen-CwpNdkmg.js → AccountMappingScreen-DfowxAc-.js} +1 -1
  2. package/dist/assets/ActualMatchingMatchDetailScreen-DpqBi3lD.js +1 -0
  3. package/dist/assets/AddressRoutes-DAUco87Q.js +1 -0
  4. package/dist/assets/AddressScreen-Diwm_C2C.js +9 -0
  5. package/dist/assets/{AiCfoScreen-Mop8GwP8.js → AiCfoScreen-k4JvYL5q.js} +1 -1
  6. package/dist/assets/{AppDrawer-D8l4xFIY.js → AppDrawer-DBMNE-tW.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-BuDIXzCh.js → BillPayApprovalRoutes-D9G2_YOz.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-BepWGIQA.js → BillPayRoutes-P8ok7ngf.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-CrtGdhXl.js → BusinessVerificationPageScreen-B4wIaSZ_.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-csdwe-Dr.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-DDmhnmhS.js → ChargeCardRoutes-D1ZdbX_z.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-UQoTd90a.js → CompanyPassportScreen-d28meAXB.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-BoOX_y4E.js → ConnectionAuthScreen-CIc-7q2q.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-BCLoKVKx.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BdSnyHRG.js → CustomerOnboardingRoutes-DcNGx8td.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-Bs9dEevm.js → DashboardRoutes-Cn2JvSx_.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-l_1V4BPr.js → DefaultTenantHome-CsXVfKlZ.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-Cxel_MVr.js +18 -0
  19. package/dist/assets/{DrawerScreen-MkRuLqUU.js → DrawerScreen-C2EkheMn.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-BoMYch1p.js → EntityDetailRoutes-DYnrDK2H.js} +1 -1
  21. package/dist/assets/ExpenseAutomationRoutes-CFonPv_D.js +38 -0
  22. package/dist/assets/{FeaturePreviewScreen-Dck-h9RH.js → FeaturePreviewScreen-DDYtwmUp.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-BMI_G2ee.js → HubSpotOAuthCallbackScreen-DrQG17NC.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-TM2N59sT.js → InboxNotificationsProvider-Bh2XZMjj.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-jyFsZoET.js → InvoicingRoutes-aLT5Oywn.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-CeTFMXyt.js → MagicLinkRoutes-B98z2_te.js} +3 -3
  27. package/dist/assets/MagicLinkSignInScreen-CUSvf6DA.js +12 -0
  28. package/dist/assets/{MobileAppDrawer-B8l2doly.js → MobileAppDrawer-CYOS7P1p.js} +1 -1
  29. package/dist/assets/NotFoundScreen-Cg7JNFkQ.js +1 -0
  30. package/dist/assets/{NotificationRoutes-DRtqPFLG.js → NotificationRoutes-Cw3UPZ5H.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-CXYDMo83.js → OAuthConsentScreen-DvsId_K6.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-CUsWcA3X.js → PandLWithForecastRoutes-BtveWrPc.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-CytqkD2I.js → PaymentLinkScreen-CyUO-4Wu.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-Ccaq-4FY.js → PeopleRoutes-DVMl8LKW.js} +1 -1
  35. package/dist/assets/PerformanceRoutes-DDDEYaGA.js +1 -0
  36. package/dist/assets/{Preview-DdNlHcw7.js → Preview-Bk5qAysj.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-Bmu4vOrn.js → QBOConnectionScreen-BZaN5thA.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-BhU4bIfF.js → ReimbursementApprovalRoutes-D7E_M16q.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-PInTcz3b.js → ReimbursementApprovalRuleDetailScreen-CXyB0PcY.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-Dl102T-O.js → ReimbursementRoutes-CRRoqag9.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-B2CyvsP0.js → ReportsRoutes-Cgg5QVAq.js} +1 -1
  42. package/dist/assets/RewardsRoutes-phMlkhIl.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-p2vq5B9i.js → ScheduleDetailsPrepaidExpensesScreen-y_RWHH2C.js} +4 -4
  44. package/dist/assets/{ScreenRoutes-B155Z_PT.js → ScreenRoutes-BfdhNdv6.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-Cl-6oX8J.js → SettingsRoutes-C030Wm5E.js} +1 -1
  46. package/dist/assets/{SetupPagesScreen-wTK2UkyR.js → SetupPagesScreen-BhmiBe4o.js} +5 -5
  47. package/dist/assets/{SignInScreen-BPwb_Vzw.js → SignInScreen-uxgoeqdj.js} +1 -1
  48. package/dist/assets/{SignOutScreen-Q021eXBv.js → SignOutScreen-DlEh7dhK.js} +1 -1
  49. package/dist/assets/{TaskListScreen-BEQG6eXo.js → TaskListScreen-BAeSb59G.js} +2 -2
  50. package/dist/assets/{TaskRoutes-SAL6oNdJ.js → TaskRoutes-B0DNH_tz.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-CvRMjyJd.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-GlpiD3Ft.js → TransactionDetailScreen-wMG_3E3j.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-CEr-_gt3.js → TransactionListRoutes-BP3KJlde.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-Dgot2Msu.js → TreasuryRoutes-18cBgc_x.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-nIrlEnpr.js → VendorsRoutes-DLFjUFun.js} +10 -10
  56. package/dist/assets/{WiseConfirmationScreen-DKXZAv0O.js → WiseConfirmationScreen-Tt2rFi3i.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-CjX_nDmm.js → ZeniAccountRoutes-wVFrAQ-3.js} +9 -9
  58. package/dist/assets/ZeniAccountStatementScreen-ku-97h_n.js +9 -0
  59. package/dist/assets/{accountMappingHelper-DpK2x2pO.js → accountMappingHelper-CHry1WVR.js} +1 -1
  60. package/dist/assets/{analytics-CvDaD8K9.js → analytics-C4h9uwWs.js} +1 -1
  61. package/dist/assets/{analyticsHelper-CcVWjFHu.js → analyticsHelper-CsTjLa_U.js} +1 -1
  62. package/dist/assets/{core-BEvMNwAD.js → core-DRRkK-nh.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-CYLAirQ0.js → decodeURIComponentSafe-DZs4O12l.js} +1 -1
  64. package/dist/assets/{dnd-B2-znEgk.js → dnd-_2sJc_42.js} +1 -1
  65. package/dist/assets/{empty-MCEjxjzc.js → empty-CTTtTEUb.js} +1 -1
  66. package/dist/assets/{empty-YxcYKzZr.js → empty-DLiHGVfw.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-B-77FBVY.js → emptyVideoElement-DVRRW-8o.js} +1 -1
  68. package/dist/assets/{epic-DBYEx4XZ.js → epic-1JvU70v2.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-n1rnu5_l.js → expenseAutomationHelper-BC0QbU5f.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-CX8UOlD0.js → getLocaleForTenant-UyMudcKz.js} +1 -1
  71. package/dist/assets/{index-BLeLfbhZ.js → index-4rD-Inub.js} +2 -2
  72. package/dist/assets/{index-Bo2P7yfm.js → index-C4gCcAzE.js} +1 -1
  73. package/dist/assets/{index-DjrnIAGb.js → index-C8t0n_dK.js} +6800 -6800
  74. package/dist/assets/{index-CknhGBud.js → index-C9SmCfob.js} +1 -1
  75. package/dist/assets/{index-BRtn7Fg5.js → index-DV4hjrJB.js} +1 -1
  76. package/dist/assets/{index-CHQdsKk6.js → index-DojZx2HJ.js} +1 -1
  77. package/dist/assets/{index-BNJSTOyr.js → index-DsnNO9ob.js} +1 -1
  78. package/dist/assets/{index-B8gVWGQ4.js → index-tDitJ4zF.js} +1 -1
  79. package/dist/assets/{lexical-VH-Dh1bf.js → lexical-DcIe1jg7.js} +1 -1
  80. package/dist/assets/{liveblocks-DXMWX-Ft.js → liveblocks-BMZsanry.js} +1 -1
  81. package/dist/assets/{lottie-CunmMvLM.js → lottie-C0cdlMyO.js} +1 -1
  82. package/dist/assets/{mui-Bueuo6bM.js → mui-Cs4dDAVi.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Mm2jhyqa.js → pathToGoBack-CkgUjsRE.js} +1 -1
  84. package/dist/assets/{pdf-byaFE2JF.js → pdf-DTtYOrE_.js} +4 -4
  85. package/dist/assets/{pdf-lib-Dvs_Xgmp.js → pdf-lib-0L0P6hdy.js} +1 -1
  86. package/dist/assets/{plaid-QK7fwo4O.js → plaid-3Z5MZAow.js} +1 -1
  87. package/dist/assets/{pusher-C7Bm4ma8.js → pusher-CwJ3oZrv.js} +1 -1
  88. package/dist/assets/{react-Cb2nvCGx.js → react-BFbkar2S.js} +1 -1
  89. package/dist/assets/{react-D6s1bFFI.js → react-CM1VGrgK.js} +1 -1
  90. package/dist/assets/{react-DIKP2Ov_.js → react-DEFivwtJ.js} +1 -1
  91. package/dist/assets/{react-DThrm6Ze.js → react-DdN0oGm3.js} +1 -1
  92. package/dist/assets/{react-B64enUeQ.js → react-Du8d_1DW.js} +1 -1
  93. package/dist/assets/{react-DaoXpjNM.js → react-clYOjmSd.js} +1 -1
  94. package/dist/assets/{recharts-DktJiIze.js → recharts-Dv_Zobiy.js} +1 -1
  95. package/dist/assets/{reportTimeframe-oMu7u5jv.js → reportTimeframe-BZ8sifp3.js} +1 -1
  96. package/dist/assets/{routePaths-B90RU5D-.js → routePaths-CXiI4qT4.js} +1 -1
  97. package/dist/assets/{sentry-B8ZcloT9.js → sentry-w92aQEbS.js} +1 -1
  98. package/dist/assets/{stripSplatSuffix-DqLj2OQc.js → stripSplatSuffix-Dsy_ttXJ.js} +1 -1
  99. package/dist/assets/{url-BjOfzwJn.js → url--dAX0VEW.js} +1 -1
  100. package/dist/assets/{url-BhMCuX-k.js → url-CfBqFLaf.js} +1 -1
  101. package/dist/assets/{useActualMatchingMatchDetail-B5L1drFO.js → useActualMatchingMatchDetail-D7oh67gX.js} +1 -1
  102. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-C_YRnGmr.js +1 -0
  103. package/dist/assets/{useAskAiCfoHostNavButtonProps-HzP0ICaF.js → useAskAiCfoHostNavButtonProps-DYip9Dx9.js} +1 -1
  104. package/dist/assets/{useChargeCardPusherEvents-DafK3E50.js → useChargeCardPusherEvents-DoonLDx8.js} +1 -1
  105. package/dist/assets/{useDeviceId-TkNUqREt.js → useDeviceId-BCt1yivX.js} +1 -1
  106. package/dist/assets/{useEmailConnectResultRefresh-bSDRfQXs.js → useEmailConnectResultRefresh-Bp56oLLy.js} +1 -1
  107. package/dist/assets/{useEnsureVendorListLoaded-CbpMm19m.js → useEnsureVendorListLoaded-C9_7Q9zw.js} +1 -1
  108. package/dist/assets/{useInitialThreadRequest-DMWJ57or.js → useInitialThreadRequest-BLzbdgeM.js} +1 -1
  109. package/dist/assets/{useTaskManagerAccess-D-e_eB5r.js → useTaskManagerAccess-D2-4N0AP.js} +1 -1
  110. package/dist/assets/{useTaskManagerPusherEvents-DBT26LaD.js → useTaskManagerPusherEvents-DiIvQwiL.js} +1 -1
  111. package/dist/assets/{utils-BVoHYbte.js → utils-BKjdMjTj.js} +1 -1
  112. package/dist/assets/{withTransactionSidePanel-DcDvlXJT.js → withTransactionSidePanel-By5bvka9.js} +2 -2
  113. package/dist/assets/{zeni-epic-state-D1qILDrP.js → zeni-epic-state-BgQvRRQh.js} +7 -7
  114. package/dist/index.html +1 -1
  115. package/package.json +3 -3
  116. package/dist/assets/ActualMatchingMatchDetailScreen-BE4yaDq3.js +0 -1
  117. package/dist/assets/AddressRoutes-DRLOkAC3.js +0 -1
  118. package/dist/assets/AddressScreen-D--nXmCk.js +0 -9
  119. package/dist/assets/CardsAiCfoScreen-sTrfRKYu.js +0 -14
  120. package/dist/assets/CustomerOnboardingAuthScreen-BVwisf0O.js +0 -1
  121. package/dist/assets/DomesticWireDetailScreen-BRQnjG76.js +0 -18
  122. package/dist/assets/ExpenseAutomationRoutes-tvVgBVw2.js +0 -38
  123. package/dist/assets/MagicLinkSignInScreen-CkLCfVZb.js +0 -12
  124. package/dist/assets/NotFoundScreen-D3mOwLoO.js +0 -1
  125. package/dist/assets/PerformanceRoutes-1eLkkMnP.js +0 -1
  126. package/dist/assets/RewardsRoutes-BDHyGFdK.js +0 -1
  127. package/dist/assets/TransactionDetailRoutes-CPTgaDiE.js +0 -1
  128. package/dist/assets/ZeniAccountStatementScreen-D_iLjeEJ.js +0 -9
  129. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CEfbNmUc.js +0 -1
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-DXMWX-Ft.js";import{h as G,u as Y,g as z,i as H,j as d,l as J,n as K,o as S}from"./core-BEvMNwAD.js";import{fI as v,Az as O,vc as Q,Wh as w,v7 as T,bq as X,c1 as Z,v8 as ee,Wi as ae,V_ as C,ek as te,Es as se,Wj as oe,ER as re,e1 as ne,e0 as ce}from"./zeni-epic-state-D1qILDrP.js";import{ag as ie,z as le,ao as de,aq as me,V as fe,a6 as pe,k as M,aB as ue,p as he,c as Fe,F as ge}from"./index-DjrnIAGb.js";import"./mui-Bueuo6bM.js";import Ie from"./NotFoundScreen-D3mOwLoO.js";import{F as be}from"./FeaturePreviewScreen-Dck-h9RH.js";import{a as F}from"./sentry-B8ZcloT9.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-HzP0ICaF.js";import{u as Ce}from"./useInitialThreadRequest-DMWJ57or.js";import{t as Te}from"./routePaths-B90RU5D-.js";import{M as ye}from"./MobileAppDrawer-B8l2doly.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.js";import"./InboxNotificationsProvider-TM2N59sT.js";import"./useTaskManagerAccess-D-e_eB5r.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="93aad9c7-93e6-4352-a87e-dcfa7b851432",s._sentryDebugIdIdentifier="sentry-dbid-93aad9c7-93e6-4352-a87e-dcfa7b851432")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=G(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=F.useState(!1),[m,A]=F.useState(!1),g=le.getSignedInUser(),k=d((t=>v(t))),q=k.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),D=d((t=>t.reportUIOptionsState.selectedForecast)),j=t=>x.pandLByForecastID[t]!=null&&ee(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Se({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!m){A(!0);const t=((f,P,R)=>P!=null?f.forecasts.findIndex((b=>b.id===P)):R!=null?f.forecasts.findIndex((b=>b.id===R)):f.forecasts.length>0?0:-1)(i,r,D?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=D?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!j(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,O,T,I]);const E=fe(),W=E?.loggedInUserRole!=null&&X(E.loggedInUserRole),N=Ce(k?.companyId,{clearParams:l&&m}),[V,$]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const L=t=>{$(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:q,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:j,meetingUrl:Z(h.toString()),hasTransactionAccess:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,initialOpenThreadRequest:N,onClickMenuIcon:()=>{L(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=Fe(),{isFeatureEnabled:a}=e(ge.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
1
+ import{j as n}from"./liveblocks-BMZsanry.js";import{h as G,u as Y,g as z,i as H,j as d,l as J,n as K,o as S}from"./core-DRRkK-nh.js";import{fI as v,Az as O,vc as Q,Wh as w,v7 as T,bq as X,c1 as Z,v8 as ee,Wi as ae,V_ as C,ek as te,Es as se,Wj as oe,ER as re,e1 as ne,e0 as ce}from"./zeni-epic-state-BgQvRRQh.js";import{ag as ie,z as le,ao as de,aq as me,V as fe,a6 as pe,k as M,aB as ue,p as he,c as Fe,F as ge}from"./index-C8t0n_dK.js";import"./mui-Cs4dDAVi.js";import Ie from"./NotFoundScreen-Cg7JNFkQ.js";import{F as be}from"./FeaturePreviewScreen-DDYtwmUp.js";import{a as F}from"./sentry-w92aQEbS.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DYip9Dx9.js";import{u as Ce}from"./useInitialThreadRequest-BLzbdgeM.js";import{t as Te}from"./routePaths-CXiI4qT4.js";import{M as ye}from"./MobileAppDrawer-CYOS7P1p.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.js";import"./InboxNotificationsProvider-Bh2XZMjj.js";import"./useTaskManagerAccess-D2-4N0AP.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="93aad9c7-93e6-4352-a87e-dcfa7b851432",s._sentryDebugIdIdentifier="sentry-dbid-93aad9c7-93e6-4352-a87e-dcfa7b851432")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=G(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=F.useState(!1),[m,A]=F.useState(!1),g=le.getSignedInUser(),k=d((t=>v(t))),q=k.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),D=d((t=>t.reportUIOptionsState.selectedForecast)),j=t=>x.pandLByForecastID[t]!=null&&ee(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Se({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!m){A(!0);const t=((f,P,R)=>P!=null?f.forecasts.findIndex((b=>b.id===P)):R!=null?f.forecasts.findIndex((b=>b.id===R)):f.forecasts.length>0?0:-1)(i,r,D?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=D?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!j(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,O,T,I]);const E=fe(),W=E?.loggedInUserRole!=null&&X(E.loggedInUserRole),N=Ce(k?.companyId,{clearParams:l&&m}),[V,$]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const L=t=>{$(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:q,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:j,meetingUrl:Z(h.toString()),hasTransactionAccess:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,initialOpenThreadRequest:N,onClickMenuIcon:()=>{L(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=Fe(),{isFeatureEnabled:a}=e(ge.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-DXMWX-Ft.js";import{a as p}from"./sentry-B8ZcloT9.js";import{J as a,a7 as u,ab as f,ac as h}from"./index-DjrnIAGb.js";import{s as c}from"./mui-Bueuo6bM.js";import{i as y}from"./core-BEvMNwAD.js";import"./zeni-epic-state-D1qILDrP.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.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]="9f729723-bd38-49a8-93d9-b8de3e144ccc",e._sentryDebugIdIdentifier="sentry-dbid-9f729723-bd38-49a8-93d9-b8de3e144ccc")}catch{}})();const g=c("div")`
1
+ import{j as r}from"./liveblocks-BMZsanry.js";import{a as p}from"./sentry-w92aQEbS.js";import{J as a,a7 as u,ab as f,ac as h}from"./index-C8t0n_dK.js";import{s as c}from"./mui-Cs4dDAVi.js";import{i as y}from"./core-DRRkK-nh.js";import"./zeni-epic-state-BgQvRRQh.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.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]="9f729723-bd38-49a8-93d9-b8de3e144ccc",e._sentryDebugIdIdentifier="sentry-dbid-9f729723-bd38-49a8-93d9-b8de3e144ccc")}catch{}})();const g=c("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-DXMWX-Ft.js";import{Wd as re,fI as N,m3 as H,e1 as Y,e0 as le,T2 as Q,VB as de,Di as Pe,We as J,D7 as je,Ds as Le,Dm as ce,Db as pe,Dq as ve,Dn as Te,Wf as ue,sx as Ae,g9 as Re,gG as Ve,Wg as W,Df as me,De as ge,Dv as Fe,ca as Oe}from"./zeni-epic-state-D1qILDrP.js";import{$ as fe,c as X,F as G,z as _,h as he,N as Ce,ad as ye,ax as be,ay as Be,a9 as De,J as F,ae as Se,G as K,az as Ze,ao as Ue,aq as $e,a6 as ze,k as we,R as We,p as Ge,aA as He,V as _e}from"./index-DjrnIAGb.js";import{D as xe,n as M,S as Ie}from"./mui-Bueuo6bM.js";import ae from"./NotFoundScreen-D3mOwLoO.js";import{a as d}from"./sentry-B8ZcloT9.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-BEvMNwAD.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-HzP0ICaF.js";import{M as Ye}from"./MobileAppDrawer-B8l2doly.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.js";import"./InboxNotificationsProvider-TM2N59sT.js";import"./useTaskManagerAccess-D-e_eB5r.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]="3d83aeb1-ea7d-49df-9c7a-5a6eb3d08904",e._sentryDebugIdIdentifier="sentry-dbid-3d83aeb1-ea7d-49df-9c7a-5a6eb3d08904")}catch{}})();const Qe={overlayWidth:new De(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,B]=d.useState(!1),[k,D]=d.useState(!1),{userId:S}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>H(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(G.isDebitCardFeatureEnabled),P=Y(I,p),v=le(p),T=Q(p),Z=de(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{O===!0?D(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(G.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:R}=Ce(p?.tenantId),y=!L||R,V=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:V===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return d.useEffect((()=>{w===!1&&S!=null&&m(Pe(S))}),[w,S]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),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(Be,{...s})]})})},ea=M(Ie)`
1
+ import{j as a}from"./liveblocks-BMZsanry.js";import{Wd as re,fI as N,m3 as H,e1 as Y,e0 as le,T2 as Q,VB as de,Di as Pe,We as J,D7 as je,Ds as Le,Dm as ce,Db as pe,Dq as ve,Dn as Te,Wf as ue,sx as Ae,g9 as Re,gG as Ve,Wg as W,Df as me,De as ge,Dv as Fe,ca as Oe}from"./zeni-epic-state-BgQvRRQh.js";import{$ as fe,c as X,F as G,z as _,h as he,N as Ce,ad as ye,ax as be,ay as Be,a9 as De,J as F,ae as Se,G as K,az as Ze,ao as Ue,aq as $e,a6 as ze,k as we,R as We,p as Ge,aA as He,V as _e}from"./index-C8t0n_dK.js";import{D as xe,n as M,S as Ie}from"./mui-Cs4dDAVi.js";import ae from"./NotFoundScreen-Cg7JNFkQ.js";import{a as d}from"./sentry-w92aQEbS.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-DRRkK-nh.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-DYip9Dx9.js";import{M as Ye}from"./MobileAppDrawer-CYOS7P1p.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.js";import"./InboxNotificationsProvider-Bh2XZMjj.js";import"./useTaskManagerAccess-D2-4N0AP.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]="3d83aeb1-ea7d-49df-9c7a-5a6eb3d08904",e._sentryDebugIdIdentifier="sentry-dbid-3d83aeb1-ea7d-49df-9c7a-5a6eb3d08904")}catch{}})();const Qe={overlayWidth:new De(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,B]=d.useState(!1),[k,D]=d.useState(!1),{userId:S}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>H(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(G.isDebitCardFeatureEnabled),P=Y(I,p),v=le(p),T=Q(p),Z=de(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{O===!0?D(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(G.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:R}=Ce(p?.tenantId),y=!L||R,V=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:V===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return d.useEffect((()=>{w===!1&&S!=null&&m(Pe(S))}),[w,S]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),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(Be,{...s})]})})},ea=M(Ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BMZsanry.js";import E from"./NotFoundScreen-Cg7JNFkQ.js";import{a as r}from"./sentry-w92aQEbS.js";import{h as _,g as U,j as p,i as v,u as M,N as P,l as O,n as z,o as b}from"./core-DRRkK-nh.js";import{fI as B,a1Z as h,bo as F,bn as N,iP as V,gk as q}from"./zeni-epic-state-BgQvRRQh.js";import{U as Z,z as I,aq as $,dO as G}from"./index-C8t0n_dK.js";import"./mui-Cs4dDAVi.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-DYip9Dx9.js";import{M as J}from"./MobileAppDrawer-CYOS7P1p.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.js";import"./InboxNotificationsProvider-Bh2XZMjj.js";import"./useTaskManagerAccess-D2-4N0AP.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]="c3f5e77b-8f9d-41c9-87b3-e8b0baf73392",e._sentryDebugIdIdentifier="sentry-dbid-c3f5e77b-8f9d-41c9-87b3-e8b0baf73392")}catch{}})();const K=O((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),L=()=>{const e=_(),t=U(),c=Z(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=v(),u=M(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(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"&&f.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.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:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function be(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(L,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
@@ -1 +1 @@
1
- import{a as h,R as a}from"./sentry-B8ZcloT9.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-w92aQEbS.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-DXMWX-Ft.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-B8ZcloT9.js";import{L as ge,c1 as xc,fI as kc,UJ as Tc,Vz as jl,ca as xl}from"./zeni-epic-state-D1qILDrP.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-BVoHYbte.js";import{r as cn}from"./empty-MCEjxjzc.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-Dvs_Xgmp.js";import{a as Ye,r as Fl}from"./index-BRtn7Fg5.js";import{r as Ul}from"./index-B8gVWGQ4.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-BEvMNwAD.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,H as Kl}from"./index-DjrnIAGb.js";import"./mui-Bueuo6bM.js";import{d as It}from"./decodeURIComponentSafe-CYLAirQ0.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]="4ec93440-28b9-42d4-8e3c-9c98d1383d3d",e._sentryDebugIdIdentifier="sentry-dbid-4ec93440-28b9-42d4-8e3c-9c98d1383d3d")}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-BMZsanry.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-w92aQEbS.js";import{L as ge,c1 as xc,fI as kc,UJ as Tc,Vz as jl,ca as xl}from"./zeni-epic-state-BgQvRRQh.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-BKjdMjTj.js";import{r as cn}from"./empty-CTTtTEUb.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-0L0P6hdy.js";import{a as Ye,r as Fl}from"./index-DV4hjrJB.js";import{r as Ul}from"./index-tDitJ4zF.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-DRRkK-nh.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,X as Wl,H as Kl}from"./index-C8t0n_dK.js";import"./mui-Cs4dDAVi.js";import{d as It}from"./decodeURIComponentSafe-DZs4O12l.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]="ea0d31bc-68c9-4117-8f1f-a18acab09910",e._sentryDebugIdIdentifier="sentry-dbid-ea0d31bc-68c9-4117-8f1f-a18acab09910")}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 r}from"./liveblocks-DXMWX-Ft.js";import q from"./NotFoundScreen-D3mOwLoO.js";import{a as p}from"./sentry-B8ZcloT9.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-BEvMNwAD.js";import{fI as E,_1 as h,_j as w,Oe as U,Oa as L,Od as f,O3 as N,_I as B,O7 as K,Og as F}from"./zeni-epic-state-D1qILDrP.js";import{z as T,w as _,ca as G,q as $,bT as H,cb as J}from"./index-DjrnIAGb.js";import"./mui-Bueuo6bM.js";import{u as M}from"./useEnsureVendorListLoaded-CbpMm19m.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-PInTcz3b.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]="c1400d4a-88c8-466a-a792-e8bb0d91a991",e._sentryDebugIdIdentifier="sentry-dbid-c1400d4a-88c8-466a-a792-e8bb0d91a991")}catch{}})();const j="reimbursement-approval-rule-update",P=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!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"))}}}))(_(G)),Q=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),b=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,I,y)=>{o.endsWith(j)&&y.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!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(F(t,!0))}}}))(_(J)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=H(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(Q,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));M();const I=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{I?.updateStatus.fetchState==="Completed"&&a(U())}),[I]),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||(R(!0),a(K(!1,!0)))}),[v,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const y={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?r.jsx(k,{to:"../../promo"}):r.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...y})};function ue(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(Y,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(q,{})})]})}export{ue as R};
1
+ import{j as r}from"./liveblocks-BMZsanry.js";import q from"./NotFoundScreen-Cg7JNFkQ.js";import{a as p}from"./sentry-w92aQEbS.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 b}from"./core-DRRkK-nh.js";import{fI as E,_1 as h,_j as w,Oe as U,Oa as L,Od as f,O3 as N,_I as B,O7 as K,Og as F}from"./zeni-epic-state-BgQvRRQh.js";import{z as _,w as T,cb as G,q as $,bU as H,cc as J}from"./index-C8t0n_dK.js";import"./mui-Cs4dDAVi.js";import{u as M}from"./useEnsureVendorListLoaded-C9_7Q9zw.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-CXyB0PcY.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]="ae421f73-240c-49c3-ba56-97a414aa49f3",e._sentryDebugIdIdentifier="sentry-dbid-ae421f73-240c-49c3-ba56-97a414aa49f3")}catch{}})();const j="reimbursement-approval-rule-update",P=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!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(G)),Q=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),g=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(U())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,I,y)=>{o.endsWith(j)&&y.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!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(F(t,!0))}}}))(T(J)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=H(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(Q,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));M();const I=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{I?.updateStatus.fetchState==="Completed"&&a(U())}),[I]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(K(!1,!0)))}),[v,g,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const y={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?r.jsx(k,{to:"../../promo"}):r.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...y})};function ue(){return r.jsxs(z,{children:[r.jsx(b,{path:"/",element:r.jsx(Y,{})}),r.jsx(b,{path:"/new",element:r.jsx(x,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(b,{path:"*",element:r.jsx(q,{})})]})}export{ue as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-DXMWX-Ft.js";import{a as y}from"./sentry-B8ZcloT9.js";import{h as U,u as x,g as C,i as V,j as R,l as k}from"./core-BEvMNwAD.js";import{_j as _,_1 as O,O6 as j,Oj as B,Oe as A,Of as E,_k as F,fI as K,Od as L}from"./zeni-epic-state-D1qILDrP.js";import{z as N,a5 as P,c1 as W,q,bT as G,c2 as H}from"./index-DjrnIAGb.js";import{u as $}from"./mui-Bueuo6bM.js";import{u as J}from"./useEnsureVendorListLoaded-CbpMm19m.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="e7e6211d-9388-4296-bd90-c41188dc4b1b",e._sentryDebugIdIdentifier="sentry-dbid-e7e6211d-9388-4296-bd90-c41188dc4b1b")}catch{}})();const M=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},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:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,z=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=z.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const T=f.action??"require_approval";m.push({action:T,actors:D,operator:D.length>1?T==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.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&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(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:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=R((t=>K(t))),{isApprovalRulesV3Enabled:p}=G(e?.tenantId);return p?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),p(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
1
+ import{j as g}from"./liveblocks-BMZsanry.js";import{a as y}from"./sentry-w92aQEbS.js";import{h as T,u as x,g as C,i as V,j as R,l as k}from"./core-DRRkK-nh.js";import{_j as _,_1 as O,O6 as j,Oj as B,Oe as A,Of as E,_k as F,fI as K,Od as L}from"./zeni-epic-state-BgQvRRQh.js";import{z as N,a5 as P,c2 as W,q,bU as G,c3 as H}from"./index-C8t0n_dK.js";import{u as $}from"./mui-Cs4dDAVi.js";import{u as J}from"./useEnsureVendorListLoaded-C9_7Q9zw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="092c4863-2f4b-4acb-b6e0-d8d224da8446",e._sentryDebugIdIdentifier="sentry-dbid-092c4863-2f4b-4acb-b6e0-d8d224da8446")}catch{}})();const M=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},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:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=T(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,z=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=z.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.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&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(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:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=R((t=>K(t))),{isApprovalRulesV3Enabled:p}=G(e?.tenantId);return p?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=T(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),p(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-DXMWX-Ft.js";import{u as ae,j as v,h as Q,g as J,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-BEvMNwAD.js";import{fI as H,Oa as ct,$O as ge,ca as he,Ng as Ue,me as dt,Nv as ce,Nu as de,$P as ut,bn as fe,gZ as Le,$Q as pt,XE as bt,m3 as $e,XF as ke,XG as gt,kR as ht,ZP as ft,l4 as St,N4 as It,CA as yt,kY as Rt,NR as Ne,$R as Pe,$S as Ce,$T as At,$U as vt,$V as kt,NB as we,la as Ct,ZY as wt,Nt as Et,Ne as xt,$W as Bt,Nd as Tt,$X as Dt,Nl as Ee,NF as jt,NE as Ft,NA as Ut,$Y as _e,T2 as Lt,bo as $t,No as Nt,O7 as Pt,$Z as _t,$_ as Mt,NN as Ot,NK as xe,Zj as Zt,Nb as zt,$$ as Me,OA as Be,OI as Gt,a00 as Vt,a01 as X,a02 as Ht,a03 as Oe,a04 as Wt,a05 as Ze,a06 as ze,NZ as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a07 as Xt,gk as Yt,Zw as Jt,a08 as Kt,a09 as He,ZA as Qt,_j as en,a0a as tn,_I as nn,OF as Te,OE as an,a0b as sn,a0c as on,a0d as rn,a0e as ln,a0f as mn,_2 as cn,Ov as dn,Oz as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,V2 as Sn,dc as In,df as yn,de as Rn,cH as An}from"./zeni-epic-state-D1qILDrP.js";import{bT as vn,Y as We,$ as qe,c as oe,F as U,z as L,cS as Xe,a6 as re,k as E,aQ as De,J as j,ac as se,ad as kn,G as Ye,cT as Cn,p as Y,aq as Je,cU as wn,V as le,cV as En,ao as xn,a9 as Bn,a5 as ye,R as Ke,w as Tn,bB as Dn,at as jn,ag as Fn,cW as Un,h as Ln}from"./index-DjrnIAGb.js";import{n as P,S as $n,u as Qe}from"./mui-Bueuo6bM.js";import pe from"./NotFoundScreen-D3mOwLoO.js";import{S as je}from"./SetupPagesScreen-wTK2UkyR.js";import{F as et}from"./FeaturePreviewScreen-Dck-h9RH.js";import{a as g}from"./sentry-B8ZcloT9.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-HzP0ICaF.js";import{u as tt}from"./useInitialThreadRequest-DMWJ57or.js";import{D as Nn}from"./DrawerScreen-MkRuLqUU.js";import{M as nt}from"./MobileAppDrawer-B8l2doly.js";import{F as Pn}from"./ScreenRoutes-B155Z_PT.js";import{R as _n}from"./ReimbursementApprovalRoutes-BhU4bIfF.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.js";import"./BusinessVerificationPageScreen-CrtGdhXl.js";import"./routePaths-B90RU5D-.js";import"./analyticsHelper-CcVWjFHu.js";import"./InboxNotificationsProvider-TM2N59sT.js";import"./useTaskManagerAccess-D-e_eB5r.js";import"./getLocaleForTenant-CX8UOlD0.js";import"./useEnsureVendorListLoaded-CbpMm19m.js";import"./ReimbursementApprovalRuleDetailScreen-PInTcz3b.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]="d4c7aff0-5605-45ca-b5df-915f419eadaf",e._sentryDebugIdIdentifier="sentry-dbid-d4c7aff0-5605-45ca-b5df-915f419eadaf")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ye.getLocalizedStrings(),On=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),m=L.getSignedInUser(),c=fe(m),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,m?.userId??"");let I=`${m?.firstName} ${m?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=m?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:E,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(Ee(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ft())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(vt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(At({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=Y(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Fe(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(U.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(U.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"}),B=J().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,R]=g.useState(!1),S=L.getSignedInUser(),w=v((b=>H(b))),h=v((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),F=he(w?.userRole??[]);(function(){const b=ae(),M=v((K=>H(K))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=vn(O),z=v((K=>K.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(R(!0),t(Ue(!1,I,u,r)))}));const A=v((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const _={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||F&&h.billStatus==="rejected"||F===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:c,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const Zn=P.div`
1
+ import{j as s}from"./liveblocks-BMZsanry.js";import{u as ae,j as v,h as Q,g as J,i as ie,N,l as ee,q as lt,n as ct,o as x}from"./core-DRRkK-nh.js";import{fI as H,Oa as mt,$O as ge,ca as he,Ng as Ue,me as dt,Nv as me,Nu as de,$P as ut,bn as fe,gZ as Le,$Q as pt,XE as bt,m3 as $e,XF as ke,XG as gt,kR as ht,ZP as ft,l4 as St,N4 as It,CA as yt,kY as Rt,NR as Ne,$R as Pe,$S as Ce,$T as At,$U as vt,$V as kt,NB as we,la as Ct,ZY as wt,Nt as Et,Ne as xt,$W as Bt,Nd as Tt,$X as Dt,Nl as Ee,NF as jt,NE as Ft,NA as Ut,$Y as _e,T2 as Lt,bo as $t,No as Nt,O7 as Pt,$Z as _t,$_ as Mt,NN as Ot,NK as xe,Zj as Zt,Nb as zt,$$ as Me,OA as Be,OI as Gt,a00 as Vt,a01 as X,a02 as Ht,a03 as Oe,a04 as Wt,a05 as Ze,a06 as ze,NZ as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a07 as Xt,gk as Yt,Zw as Jt,a08 as Kt,a09 as He,ZA as Qt,_j as en,a0a as tn,_I as nn,OF as Te,OE as an,a0b as sn,a0c as on,a0d as rn,a0e as ln,a0f as cn,_2 as mn,Ov as dn,Oz as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,V2 as Sn,dc as In,df as yn,de as Rn,cH as An}from"./zeni-epic-state-BgQvRRQh.js";import{bU as vn,U as We,$ as qe,c as oe,F as U,z as L,cT as Xe,a6 as re,k as E,aQ as De,J as j,ac as se,ad as kn,G as Ye,cU as Cn,p as Y,aq as Je,cV as wn,V as le,cW as En,ao as xn,a9 as Bn,a5 as ye,R as Ke,w as Tn,bC as Dn,at as jn,ag as Fn,cX as Un,h as Ln}from"./index-C8t0n_dK.js";import{n as P,S as $n,u as Qe}from"./mui-Cs4dDAVi.js";import pe from"./NotFoundScreen-Cg7JNFkQ.js";import{S as je}from"./SetupPagesScreen-BhmiBe4o.js";import{F as et}from"./FeaturePreviewScreen-DDYtwmUp.js";import{a as g}from"./sentry-w92aQEbS.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-DYip9Dx9.js";import{u as tt}from"./useInitialThreadRequest-BLzbdgeM.js";import{D as Nn}from"./DrawerScreen-C2EkheMn.js";import{M as nt}from"./MobileAppDrawer-CYOS7P1p.js";import{F as Pn}from"./ScreenRoutes-BfdhNdv6.js";import{R as _n}from"./ReimbursementApprovalRoutes-D7E_M16q.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.js";import"./BusinessVerificationPageScreen-B4wIaSZ_.js";import"./routePaths-CXiI4qT4.js";import"./analyticsHelper-CsTjLa_U.js";import"./InboxNotificationsProvider-Bh2XZMjj.js";import"./useTaskManagerAccess-D2-4N0AP.js";import"./getLocaleForTenant-UyMudcKz.js";import"./useEnsureVendorListLoaded-C9_7Q9zw.js";import"./ReimbursementApprovalRuleDetailScreen-CXyB0PcY.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]="bc9f73f3-e7f2-4cb8-8dee-f5cab7cc395c",e._sentryDebugIdIdentifier="sentry-dbid-bc9f73f3-e7f2-4cb8-8dee-f5cab7cc395c")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ye.getLocalizedStrings(),On=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=L.getSignedInUser(),m=fe(c),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,c?.userId??"");let I=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:m,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:E,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:m,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(Ee(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ft())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(me({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(vt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(At({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=Y(c.state?.pathnameStackToGoBack,c.pathname);m(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Fe(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=We(),m=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(U.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(U.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"}),B=J().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,R]=g.useState(!1),S=L.getSignedInUser(),w=v((b=>H(b))),h=v((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),F=he(w?.userRole??[]);(function(){const b=ae(),M=v((K=>H(K))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=vn(O),z=v((K=>K.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(mt(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(R(!0),t(Ue(!1,I,u,r)))}));const A=v((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const _={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||F&&h.billStatus==="rejected"||F===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:m,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&m!=="small"?s.jsx(zn,{}):null,i&&m!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(me({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&m==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(me({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:m,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const Zn=P.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-DXMWX-Ft.js";import{u as ae,j as v,h as Q,g as J
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=ee((function(e,t){const n=_e(e,t.reimbursementId),r=L.getSignedInUser(),m=fe(r),c=e.tenantState.currentTenantId,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},i=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=_t(n.remiActivities,Mt(t.currentTenant),r));const o=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:d,signedInUser:r,createdBy:i,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:o,showApproveRejectBtns:a,isZeniUser:m,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r;return{onDuplicateLineClick:(a,o)=>window.open(`/${i}/reimbursement/${a}#L${o}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=at(i),o=Y(m.state?.pathnameStackToGoBack,m.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onSaveRealTimeApprovals:a=>{e(zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Y(m.state?.pathnameStackToGoBack,m.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{E.trackReimbursementDeleteReimbursement(n),e(Ne(n))},cancelAndDeleteReport:a=>{a===!0?E.trackReimbursementCancelAndDeleteReimbursement(n):E.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{d.toggle()}}}))(wn);function Xn(){const e=Q(),t=ae(),n=J(),r=n.hash.substring(1),m=We(),{reimbursementId:c}=ie(),d=L.getSignedInUser(),i=v((A=>H(A))),a=v((A=>_e(A,c??""))),o=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(i?.companyId,{clearParams:a.fetchState==="Completed"&&!o}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:I}=Re({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=oe(),{isFeatureEnabled:T}=u(U.isLimitedCategoryForReimbursement),[y,B]=g.useState(!1),[D,k]=g.useState(!1),[C,R]=g.useState(!1),{isFeatureEnabled:S}=u(U.isShowDeletedReimbursementsFeatureEnabled),w=v((A=>ge(A,c??""))),h=Lt(i),$=$t(i.userRole),F=a.fetchState;if(g.useEffect((()=>{y||c==null?y==1&&F==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(c,!1,S)))}),[y,c,t,F]),g.useEffect((()=>{S&&a.remiDetails?.isDeleted===!0||i.isZeni===!0&&d?.userEmailDomain==="zeni.ai"&&h===!1?R(!1):R(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((A=>A.user.userId===d?.userId))!=null||a.remiDetails?.lastUpdatedBy===d?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,i.isZeni,h,d]),g.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||w.fetchState=="Completed"||w.fetchState=="In-Progress"||(k(!0),t(Ue(!1,T,S,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,c,t]),d==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:A=>(_=>{c!=null&&_.trackReimbursementReimbursementDetails(c)})(A)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:S,location:n,navigate:e,isRealTimeApprovalEnabled:C,currentTenant:i,reimbursementId:c??"",themeState:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:I})]})}const Yn=ee((function(e,t){return{remisReviewView:Me(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Be("approved",r??""));break;case"reject":e(Be("rejected",r??""))}}}}))(En);function Jn({tenantEmailDomain:e}){const t=Q(),n=v((d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((d=>Me(d))),m=le(),c=m?.loggedInUserRole?.includes("admin")===!0;return g.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Yn,{navigate:t,analytics:E,isAdmin:c,tenantEmailDomain:e})}const V=Qt(),st="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:Kn,common:me}=Ye.getLocalizedStrings(),Qn=Kn.reimbursement.bulkActions,ea=P.div`
56
+ `,qn=ee((function(e,t){const n=_e(e,t.reimbursementId),r=L.getSignedInUser(),c=fe(r),m=e.tenantState.currentTenantId,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:m??""},i=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=_t(n.remiActivities,Mt(t.currentTenant),r));const o=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:d,signedInUser:r,createdBy:i,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:o,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:m,themeState:d}=t,{tenantEmailDomain:i}=r;return{onDuplicateLineClick:(a,o)=>window.open(`/${i}/reimbursement/${a}#L${o}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=at(i),o=Y(c.state?.pathnameStackToGoBack,c.pathname);m(a,{state:{pathnameStackToGoBack:o}})},onSaveRealTimeApprovals:a=>{e(zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Y(c.state?.pathnameStackToGoBack,c.pathname);m("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{E.trackReimbursementDeleteReimbursement(n),e(Ne(n))},cancelAndDeleteReport:a=>{a===!0?E.trackReimbursementCancelAndDeleteReimbursement(n):E.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{d.toggle()}}}))(wn);function Xn(){const e=Q(),t=ae(),n=J(),r=n.hash.substring(1),c=We(),{reimbursementId:m}=ie(),d=L.getSignedInUser(),i=v((A=>H(A))),a=v((A=>_e(A,m??""))),o=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(i?.companyId,{clearParams:a.fetchState==="Completed"&&!o}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:I}=Re({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=oe(),{isFeatureEnabled:T}=u(U.isLimitedCategoryForReimbursement),[y,B]=g.useState(!1),[D,k]=g.useState(!1),[C,R]=g.useState(!1),{isFeatureEnabled:S}=u(U.isShowDeletedReimbursementsFeatureEnabled),w=v((A=>ge(A,m??""))),h=Lt(i),$=$t(i.userRole),F=a.fetchState;if(g.useEffect((()=>{y||m==null?y==1&&F==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(m,!1,S)))}),[y,m,t,F]),g.useEffect((()=>{S&&a.remiDetails?.isDeleted===!0||i.isZeni===!0&&d?.userEmailDomain==="zeni.ai"&&h===!1?R(!1):R(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((A=>A.user.userId===d?.userId))!=null||a.remiDetails?.lastUpdatedBy===d?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,i.isZeni,h,d]),g.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||w.fetchState=="Completed"||w.fetchState=="In-Progress"||(k(!0),t(Ue(!1,T,S,m)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,m,t]),d==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:A=>(_=>{m!=null&&_.trackReimbursementReimbursementDetails(m)})(A)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:S,location:n,navigate:e,isRealTimeApprovalEnabled:C,currentTenant:i,reimbursementId:m??"",themeState:c,isAiCfoAccessEnabled:p,onAskAiCfoClick:I})]})}const Yn=ee((function(e,t){return{remisReviewView:Me(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Be("approved",r??""));break;case"reject":e(Be("rejected",r??""))}}}}))(En);function Jn({tenantEmailDomain:e}){const t=Q(),n=v((d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((d=>Me(d))),c=le(),m=c?.loggedInUserRole?.includes("admin")===!0;return g.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Yn,{navigate:t,analytics:E,isAdmin:m,tenantEmailDomain:e})}const V=Qt(),st="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:Kn,common:ce}=Ye.getLocalizedStrings(),Qn=Kn.reimbursement.bulkActions,ea=P.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-DXMWX-Ft.js";import{u as ae,j as v,h as Q,g as J
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ta=ee((function(e,t){const n=ze(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const m=L.getSignedInUser(),c=fe(m),d=e.tenantState.currentTenantId,i=H(e),a=i?.companyName??"",o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:d??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const p=n.fetchState,I=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:E,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:o,companyName:a,timePeriod:V,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:m,period:c}=t,{tenantEmailDomain:d}=r;return{updateTabToState:i=>{e(X()),e(Oe(i))},onSubtabChange:i=>{e(X()),e(Ze(i))},onTransactionClick:(i,a)=>{const o=sa(d,i,a),l=Y(m.state?.pathnameStackToGoBack,m.pathname);n(o,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const i=aa(d),a=Y(m.state?.pathnameStackToGoBack,m.pathname);n(i,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:i}=t.currentTenant;E?.trackReimbursementNewReimbursement();const a=`/${i}/reimbursement/new`,o=Y(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:o}})},onColumnSortConfigChanged:(i,a)=>{e(mn({uiState:{sortKey:i,sortOrder:a},period:t.period}))},onSearchTextChanged:i=>{e(ln(i))},onFiltersChange:i=>{e(rn({filters:i})),i.categories.every((a=>a.field!=null&&a.values?.length!==0))&&E.trackSpendManagmentFilterChange("reimbursement",i.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:i=>{i==="In-Progress"&&E.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:i}}))},onReloadTransactions:()=>{e(ue(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:i=>{e(sn(i))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(i,a)=>{switch(i){case"delete":case"cancel":e(an(i,a??""));break;case"send_for_approval":e(Te("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Te("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:i=>{i.endsWith(be)&&e(nn(!1))},onEventReceived:i=>{i===st&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ae(),n=J(),r=n.state,m=qe(),[c,d]=g.useState(null),i=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Ht(r.tab.toString());f!=null?t(Oe(f)):console.log("Warning:Not a valid remiListTab");const G=Wt(r.subTab.toString());G!=null?t(Ze(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:o}=a(U.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(U.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:p}=a(U.isReimbursementBulkActionEnabled),I=L.getSignedInUser(),u=v((f=>H(f))),[T,y]=g.useState(!1),[B,D]=g.useState(!1),k=le(),C=k?.loggedInUserRole?.includes("admin")===!0,R=v((f=>ze(f,V,p))),{areTenantIdsInSync:S}=xn(),w=R.fetchState,{isAiCfoAccessEnabled:h,onAskAiCfoClick:$}=Re({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:w==="Completed"}),g.useEffect((()=>{!B&&S&&(D(!0),t(ue(V,!0,l,!1,!0)))}),[B,V,t,S]),I==null)throw Error("Can't access address page without signing in...");const F=!!u?.userRole&&qt(u),A=Se(k?.loggedInUserRoleMap),_=Ie(k?.loggedInUserRoleMap),b=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,M=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,O=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,Z=v((f=>Le(f.companyState,u.companyId))),W=Z?.company.featuresActivationInfo.connectedAccountProvider,z=f=>{y(f)},{isFeatureEnabled:K}=a(U.isDebitCardFeatureEnabled),it=Ge(K,u),ot=Ve(u),{remisProcessed:te,remisProcessing:Ae}=v((f=>Xt(f)));g.useEffect((()=>{te===Ae&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:Qn.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Jt(c)}]})),t(Kt()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),d(null))}),[te,Ae]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(f,G,ve)=>{f.endsWith(be)?ve.onReimbursementApprovalRulesEventReceived?.(f):G.entity_type==="reimbursement"&&(d(G.operation_type),ve.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(et,{}):M&&(!F||A)||_&&b?s.jsxs(s.Fragment,{children:[w==="Completed"?s.jsx(re,{analytics:E,onLoad:f=>(G=>G.trackPageLoaded(Ke.Event.reimbursementHome))(f)}):null,s.jsx(nt,{isAppContentDrawerOpen:T,handleDrawerToggle:z}),s.jsxs(ea,{windowSize:m,children:[s.jsx(Nn,{isOpen:i,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:f=>f.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:o,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:V,isAdmin:C,isEmployee:F,entity:"reimbursement",onClickMenuIcon:()=>{z(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:p,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:h,onAskAiCfoClick:$,...rt})]})]}):O&&A?s.jsx(N,{to:"../setup"}):k!=null&&He(u,k.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=P($n)`
64
+ `,ta=ee((function(e,t){const n=ze(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const c=L.getSignedInUser(),m=fe(c),d=e.tenantState.currentTenantId,i=H(e),a=i?.companyName??"",o={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:d??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const p=n.fetchState,I=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:m,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:E,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:o,companyName:a,timePeriod:V,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:m}=t,{tenantEmailDomain:d}=r;return{updateTabToState:i=>{e(X()),e(Oe(i))},onSubtabChange:i=>{e(X()),e(Ze(i))},onTransactionClick:(i,a)=>{const o=sa(d,i,a),l=Y(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const i=aa(d),a=Y(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:i}=t.currentTenant;E?.trackReimbursementNewReimbursement();const a=`/${i}/reimbursement/new`,o=Y(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:o}})},onColumnSortConfigChanged:(i,a)=>{e(cn({uiState:{sortKey:i,sortOrder:a},period:t.period}))},onSearchTextChanged:i=>{e(ln(i))},onFiltersChange:i=>{e(rn({filters:i})),i.categories.every((a=>a.field!=null&&a.values?.length!==0))&&E.trackSpendManagmentFilterChange("reimbursement",i.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:i=>{i==="In-Progress"&&E.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:i}}))},onReloadTransactions:()=>{e(ue(m,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:i=>{e(sn(i))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(i,a)=>{switch(i){case"delete":case"cancel":e(an(i,a??""));break;case"send_for_approval":e(Te("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Te("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:i=>{i.endsWith(be)&&e(nn(!1))},onEventReceived:i=>{i===st&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ae(),n=J(),r=n.state,c=qe(),[m,d]=g.useState(null),i=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Ht(r.tab.toString());f!=null?t(Oe(f)):console.log("Warning:Not a valid remiListTab");const G=Wt(r.subTab.toString());G!=null?t(Ze(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:o}=a(U.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(U.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:p}=a(U.isReimbursementBulkActionEnabled),I=L.getSignedInUser(),u=v((f=>H(f))),[T,y]=g.useState(!1),[B,D]=g.useState(!1),k=le(),C=k?.loggedInUserRole?.includes("admin")===!0,R=v((f=>ze(f,V,p))),{areTenantIdsInSync:S}=xn(),w=R.fetchState,{isAiCfoAccessEnabled:h,onAskAiCfoClick:$}=Re({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:w==="Completed"}),g.useEffect((()=>{!B&&S&&(D(!0),t(ue(V,!0,l,!1,!0)))}),[B,V,t,S]),I==null)throw Error("Can't access address page without signing in...");const F=!!u?.userRole&&qt(u),A=Se(k?.loggedInUserRoleMap),_=Ie(k?.loggedInUserRoleMap),b=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,M=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,O=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,Z=v((f=>Le(f.companyState,u.companyId))),W=Z?.company.featuresActivationInfo.connectedAccountProvider,z=f=>{y(f)},{isFeatureEnabled:K}=a(U.isDebitCardFeatureEnabled),it=Ge(K,u),ot=Ve(u),{remisProcessed:te,remisProcessing:Ae}=v((f=>Xt(f)));g.useEffect((()=>{te===Ae&&m!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?ce.texts.reports2:Qn.report},{variableName:"_has_",variableValue:te>1?ce.texts.have:ce.texts.has},{variableName:"_action_",variableValue:Jt(m)}]})),t(Kt()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),d(null))}),[te,Ae]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(f,G,ve)=>{f.endsWith(be)?ve.onReimbursementApprovalRulesEventReceived?.(f):G.entity_type==="reimbursement"&&(d(G.operation_type),ve.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(et,{}):M&&(!F||A)||_&&b?s.jsxs(s.Fragment,{children:[w==="Completed"?s.jsx(re,{analytics:E,onLoad:f=>(G=>G.trackPageLoaded(Ke.Event.reimbursementHome))(f)}):null,s.jsx(nt,{isAppContentDrawerOpen:T,handleDrawerToggle:z}),s.jsxs(ea,{windowSize:c,children:[s.jsx(Nn,{isOpen:i,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:f=>f.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:o,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:V,isAdmin:C,isEmployee:F,entity:"reimbursement",onClickMenuIcon:()=>{z(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:p,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:h,onAskAiCfoClick:$,...rt})]})]}):O&&A?s.jsx(N,{to:"../setup"}):k!=null&&He(u,k.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=P($n)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,oa=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:E,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),ra=()=>{const e=Fn(),t=Q(),n=J(),{tenantEmailDomain:r}=ie(),m=Qe(),[c,d]=g.useState(!1),i=v((C=>H(C))),a=L.getSignedInUserTenant(r)?.companyId??i.companyId,o=L.getSignedInUser(),l=i.userRoleId,p=!!i.userRole?.includes("reimbursements_user"),I=le(),u=Se(I?.loggedInUserRoleMap),T=Ie(I?.loggedInUserRoleMap),y=!!i.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!i.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!i.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,k=C=>{d(C)};if(o==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&T&&y?s.jsx(N,{to:"../../../reimbursements"}):D&&u?s.jsx(N,{to:"../../reimbursements/setup"}):i.companyReimbursementInfo&&!D||i.userReimbursementInfo&&T&&y===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:C=>(R=>R.trackPageLoaded(Ke.Event.reimbursementPromoPage))(C)}),s.jsx(nt,{isAppContentDrawerOpen:c,handleDrawerToggle:k}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:i.userReimbursementInfo,userRoleId:l,isEmployee:p,onClickMenuIcon:()=>{k(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})};function Ma(){const e=v((z=>H(z))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),m=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:d}=oe(),{isFeatureEnabled:i}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=d(U.isDebitCardFeatureEnabled),o=Ge(a,e),l=Ve(e),p=e?.userRole!=null&&pn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,y=Se(t?.loggedInUserRoleMap),B=T&&y,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,k=D&&hn(t?.loggedInUserRoleMap),C=Ln(e,i,a)&&!p,R=C&&fn(t?.loggedInUserRoleMap),S=Sn(t?.loggedInUserRoleMap),w=In(t?.loggedInUserRoleMap),h=yn(t?.loggedInUserRoleMap),$=D&&w,F=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&h,A=Rn(t?.loggedInUserRoleMap),_=An(t?.loggedInUserRoleMap),b=Ie(t?.loggedInUserRoleMap),M=C&&A,{tenantEmailDomain:O}=ie(),Z=J(),W=n===!0&&(y||b&&c);return s.jsxs(mt,{children:[Z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(_n,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:_,isUserHasReimbursementAccess:b,showTreasuryRoute:F,isTenantBankingOnly:o,showChargeCardRoute:M,tenantEmailDomain:O??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(o===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(et,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../promo"})}),m&&y&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):Z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(Fe,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(x,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]})}export{Ma as default};
68
+ `,oa=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:mn(e,n),analytics:E,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),ra=()=>{const e=Fn(),t=Q(),n=J(),{tenantEmailDomain:r}=ie(),c=Qe(),[m,d]=g.useState(!1),i=v((C=>H(C))),a=L.getSignedInUserTenant(r)?.companyId??i.companyId,o=L.getSignedInUser(),l=i.userRoleId,p=!!i.userRole?.includes("reimbursements_user"),I=le(),u=Se(I?.loggedInUserRoleMap),T=Ie(I?.loggedInUserRoleMap),y=!!i.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!i.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!i.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,k=C=>{d(C)};if(o==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&T&&y?s.jsx(N,{to:"../../../reimbursements"}):D&&u?s.jsx(N,{to:"../../reimbursements/setup"}):i.companyReimbursementInfo&&!D||i.userReimbursementInfo&&T&&y===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:C=>(R=>R.trackPageLoaded(Ke.Event.reimbursementPromoPage))(C)}),s.jsx(nt,{isAppContentDrawerOpen:m,handleDrawerToggle:k}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:i.userReimbursementInfo,userRoleId:l,isEmployee:p,onClickMenuIcon:()=>{k(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Ma(){const e=v((z=>H(z))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,m=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:d}=oe(),{isFeatureEnabled:i}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=d(U.isDebitCardFeatureEnabled),o=Ge(a,e),l=Ve(e),p=e?.userRole!=null&&pn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,y=Se(t?.loggedInUserRoleMap),B=T&&y,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,k=D&&hn(t?.loggedInUserRoleMap),C=Ln(e,i,a)&&!p,R=C&&fn(t?.loggedInUserRoleMap),S=Sn(t?.loggedInUserRoleMap),w=In(t?.loggedInUserRoleMap),h=yn(t?.loggedInUserRoleMap),$=D&&w,F=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&h,A=Rn(t?.loggedInUserRoleMap),_=An(t?.loggedInUserRoleMap),b=Ie(t?.loggedInUserRoleMap),M=C&&A,{tenantEmailDomain:O}=ie(),Z=J(),W=n===!0&&(y||b&&m);return s.jsxs(ct,{children:[Z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(_n,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:_,isUserHasReimbursementAccess:b,showTreasuryRoute:F,isTenantBankingOnly:o,showChargeCardRoute:M,tenantEmailDomain:O??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(o===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(et,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../promo"})}),c&&y&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):Z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(Fe,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(x,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]})}export{Ma as default};
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-DXMWX-Ft.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as ze,o as oe}from"./core-BEvMNwAD.js";import{fI as J,ED as S,VA as Ge,m3 as ue,uh as he,v6 as Y,lK as j,lT as D,lL as V,kO as E,kF as P,kE as A,DG as U,vb as ye,bq as We,VB as He,bn as Ne,E$ as $e,VC as qe,VD as Ze,ck as R,Dz as ne,VE as re,VF as Ke,VG as Qe,VH as Je,VI as Xe,VJ as ea,VK as aa,VL as sa,VM as ta,VN as oa,VO as na,VP as ra,VQ as la,VR as k,VS as x,VT as z,VU as G,VV as W,VW as H,VX as N,VY as $,VZ as q,V_ as Z,ek as ca,EF as ia,Er as le,Es as ce,EL as da,Ew as ie,bG as O,V$ as de,di as pe,Ex as _e,ER as pa,W0 as _a,W1 as fa,W2 as ba,W3 as ma,W4 as ua,W5 as ha,W6 as ya,W7 as Ca,W8 as wa,W9 as ga,e1 as Ra,e0 as Ia}from"./zeni-epic-state-D1qILDrP.js";import{al as Sa,am as Ta,an as ka,a as Oa,$ as Fa,c as Ce,F as K,z as we,ao as ja,V as Da,e as Va,ap as Ea,aq as Pa,a6 as Aa,k as Q,R as Ma,B as La,p as ge,ar as Ba,as as va,at as Ya}from"./index-DjrnIAGb.js";import"./mui-Bueuo6bM.js";import Ua from"./NotFoundScreen-D3mOwLoO.js";import{F as xa}from"./FeaturePreviewScreen-Dck-h9RH.js";import{a as u}from"./sentry-B8ZcloT9.js";import{u as za}from"./useInitialThreadRequest-DMWJ57or.js";import{t as fe,a as be,b as Ga}from"./routePaths-B90RU5D-.js";import{t as me}from"./reportTimeframe-oMu7u5jv.js";import{M as Wa}from"./MobileAppDrawer-B8l2doly.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.js";import"./InboxNotificationsProvider-TM2N59sT.js";import"./useTaskManagerAccess-D-e_eB5r.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]="3ecd8bed-ef4d-48bc-a53c-5f08ac6b99b4",e._sentryDebugIdIdentifier="sentry-dbid-3ecd8bed-ef4d-48bc-a53c-5f08ac6b99b4")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(Z({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(W({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=J(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=He(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:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=O(a),i=O(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(A(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(A(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(P());break;case"balance_sheet_by_projects":e(A(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(E());break;case"cash_flow":e(j(r,!0,a,s));break;case"cash_flow_by_classes":e(j(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(j(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(D())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||R(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ga(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:F(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Z({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(W({scrollPosition:s}));break;case"cash_flow_by_classes":e(G({scrollPosition:s}));break;case"cash_flow_by_projects":e(z({scrollPosition:s}));break;case"cash_flow":e(x({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(Z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=I(t),r=R(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",F(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",F(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",F(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{R(o.selectedReportID)?e(Xe({classesToFilterOut:a})):I(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{R(o.selectedReportID)?e(Ke({projectsToFilterOut:a})):I(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):e(Je({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=R(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?P():ne()),o.isAccountingProjectsEnabled&&e(s?D():a?E():U())},onUpdateDisplayOrder:a=>{e(Ze(a))},onUpdateReportFormat:a=>{Na(e),e(qe(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"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):D(!0):V(!0):E(!0):P(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=Fa(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(K.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(K.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Re]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>J(l))),Ie=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=za(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>Ge(l))),{areTenantIdsInSync:y}=ja(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),Fe=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Re(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(A(C.timeframe));break;case"balance_sheet_by_classes":T&&s(P());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(D());break;case"cash_flow":s(j(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Da(),je=ee?.loggedInUserRole!=null&&We(ee?.loggedInUserRole)!==!0,[De,Ve]=u.useState(!1),ae=l=>{Ve(l)},Ee=Va(),Pe=Ea();return(function(l){const{isDataReady:Ae}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ae),Be=u.useMemo((()=>se?Ha:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Pa({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Aa,{analytics:Q,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Wa,{isAppContentDrawerOpen:De,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:Fe,selectedReportID:B,analytics:Q,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:je,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Pe&&Ee&&!e,onAskAiCfoClick:()=>{if(Ie)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const F=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 ys(){const e=_((s=>J(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(K.isDebitCardFeatureEnabled),m=Ra(b,e),a=Ia(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(ze,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
1
+ import{j as f}from"./liveblocks-BMZsanry.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as ze,o as oe}from"./core-DRRkK-nh.js";import{fI as J,ED as S,VA as Ge,m3 as ue,uh as he,v6 as Y,lK as j,lT as D,lL as V,kO as E,kF as P,kE as A,DG as U,vb as ye,bq as We,VB as He,bn as Ne,E$ as $e,VC as qe,VD as Ze,ck as R,Dz as ne,VE as re,VF as Ke,VG as Qe,VH as Je,VI as Xe,VJ as ea,VK as aa,VL as sa,VM as ta,VN as oa,VO as na,VP as ra,VQ as la,VR as k,VS as x,VT as z,VU as G,VV as W,VW as H,VX as N,VY as $,VZ as q,V_ as Z,ek as ca,EF as ia,Er as le,Es as ce,EL as da,Ew as ie,bG as O,V$ as de,di as pe,Ex as _e,ER as pa,W0 as _a,W1 as fa,W2 as ba,W3 as ma,W4 as ua,W5 as ha,W6 as ya,W7 as Ca,W8 as wa,W9 as ga,e1 as Ra,e0 as Ia}from"./zeni-epic-state-BgQvRRQh.js";import{al as Sa,am as Ta,an as ka,a as Oa,$ as Fa,c as Ce,F as K,z as we,ao as ja,V as Da,e as Va,ap as Ea,aq as Pa,a6 as Aa,k as Q,R as Ma,B as La,p as ge,ar as Ba,as as va,at as Ya}from"./index-C8t0n_dK.js";import"./mui-Cs4dDAVi.js";import Ua from"./NotFoundScreen-Cg7JNFkQ.js";import{F as xa}from"./FeaturePreviewScreen-DDYtwmUp.js";import{a as u}from"./sentry-w92aQEbS.js";import{u as za}from"./useInitialThreadRequest-BLzbdgeM.js";import{t as fe,a as be,b as Ga}from"./routePaths-CXiI4qT4.js";import{t as me}from"./reportTimeframe-BZ8sifp3.js";import{M as Wa}from"./MobileAppDrawer-CYOS7P1p.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.js";import"./InboxNotificationsProvider-Bh2XZMjj.js";import"./useTaskManagerAccess-D2-4N0AP.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]="3ecd8bed-ef4d-48bc-a53c-5f08ac6b99b4",e._sentryDebugIdIdentifier="sentry-dbid-3ecd8bed-ef4d-48bc-a53c-5f08ac6b99b4")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(Z({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(W({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=J(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=He(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:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=O(a),i=O(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(A(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(A(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(P());break;case"balance_sheet_by_projects":e(A(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(E());break;case"cash_flow":e(j(r,!0,a,s));break;case"cash_flow_by_classes":e(j(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(j(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(D())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||R(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ga(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:F(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Z({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(W({scrollPosition:s}));break;case"cash_flow_by_classes":e(G({scrollPosition:s}));break;case"cash_flow_by_projects":e(z({scrollPosition:s}));break;case"cash_flow":e(x({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(Z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=I(t),r=R(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",F(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",F(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",F(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{R(o.selectedReportID)?e(Xe({classesToFilterOut:a})):I(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{R(o.selectedReportID)?e(Ke({projectsToFilterOut:a})):I(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):e(Je({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=R(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?P():ne()),o.isAccountingProjectsEnabled&&e(s?D():a?E():U())},onUpdateDisplayOrder:a=>{e(Ze(a))},onUpdateReportFormat:a=>{Na(e),e(qe(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"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):D(!0):V(!0):E(!0):P(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=Fa(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(K.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(K.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Re]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>J(l))),Ie=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=za(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>Ge(l))),{areTenantIdsInSync:y}=ja(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),Fe=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Re(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(A(C.timeframe));break;case"balance_sheet_by_classes":T&&s(P());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(D());break;case"cash_flow":s(j(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Da(),je=ee?.loggedInUserRole!=null&&We(ee?.loggedInUserRole)!==!0,[De,Ve]=u.useState(!1),ae=l=>{Ve(l)},Ee=Va(),Pe=Ea();return(function(l){const{isDataReady:Ae}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ae),Be=u.useMemo((()=>se?Ha:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Pa({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Aa,{analytics:Q,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Wa,{isAppContentDrawerOpen:De,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:Fe,selectedReportID:B,analytics:Q,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:je,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Pe&&Ee&&!e,onAskAiCfoClick:()=>{if(Ie)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const F=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 ys(){const e=_((s=>J(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(K.isDebitCardFeatureEnabled),m=Ra(b,e),a=Ia(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(ze,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-BMZsanry.js";import{z as j,a6 as N,k as u,R as S,e5 as k,c as I,F as C}from"./index-C8t0n_dK.js";import"./mui-Cs4dDAVi.js";import g from"./NotFoundScreen-Cg7JNFkQ.js";import{a as c}from"./sentry-w92aQEbS.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as d,N as y}from"./core-DRRkK-nh.js";import{fI as _,a30 as w,a31 as p,Ei as P,q3 as V,a32 as R,Eg as q}from"./zeni-epic-state-BgQvRRQh.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.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]="8857480d-4bd5-47d1-8a8f-aafa0c1cf9d7",e._sentryDebugIdIdentifier="sentry-dbid-8857480d-4bd5-47d1-8a8f-aafa0c1cf9d7")}catch{}})();const z=T((function(e,t){const n=w(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=j.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(q())},onUpdateInviteFormLocalData:s=>{e(R({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),G=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),x=L(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),b=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:l,location:x,currentTenant:r,companyName:E,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};