@zeniai/web-app-ui 5.3.47-dev → 5.3.48-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 (159) hide show
  1. package/dist/assets/AccountMappingScreen-DeHsC__B.js +9 -0
  2. package/dist/assets/AddressRoutes-Bh2vRJBa.js +1 -0
  3. package/dist/assets/AddressScreen-C9Fk_Z55.js +9 -0
  4. package/dist/assets/AiCfoScreen-DB41E0VN.js +22 -0
  5. package/dist/assets/{AppDrawer-D4O6tn5i.js → AppDrawer-XdZKck2N.js} +3 -3
  6. package/dist/assets/{BillPayApprovalRoutes-BY4P9AKu.js → BillPayApprovalRoutes-Dyxgp6fW.js} +1 -1
  7. package/dist/assets/BillPayRoutes-Bp82WT-5.js +119 -0
  8. package/dist/assets/BusinessVerificationPageScreen-BT5PhS2R.js +9 -0
  9. package/dist/assets/CardsAiCfoScreen-CgeqAvem.js +14 -0
  10. package/dist/assets/ChargeCardRoutes-Ds9toMfJ.js +71 -0
  11. package/dist/assets/CompanyPassportScreen-B2k7aWUB.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-DrhuD992.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-CpbSTPlS.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-DV3rYEiJ.js → CustomerOnboardingRoutes-RIeFd0Jj.js} +3 -3
  15. package/dist/assets/{DashboardRoutes-D5hdkebN.js → DashboardRoutes-DqcCIUfr.js} +4 -4
  16. package/dist/assets/{DefaultTenantHome-DCPi_wXC.js → DefaultTenantHome-DhG1xEfc.js} +1 -1
  17. package/dist/assets/DomesticWireDetailScreen-BKq5jjLx.js +18 -0
  18. package/dist/assets/{DrawerScreen-BihZ_PpN.js → DrawerScreen-DsFB_53j.js} +1 -1
  19. package/dist/assets/EntityDetailRoutes-mt1xcJ7j.js +1 -0
  20. package/dist/assets/ExpenseAutomationRoutes-lC_JLdAl.js +38 -0
  21. package/dist/assets/FeaturePreviewScreen-BFU7MG_7.js +1 -0
  22. package/dist/assets/HubSpotOAuthCallbackScreen-sKmwa_VW.js +1 -0
  23. package/dist/assets/InboxNotificationsProvider-CLtB_fgp.js +1 -0
  24. package/dist/assets/InvoicingRoutes-9v2-NT7u.js +2 -0
  25. package/dist/assets/MagicLinkRoutes-CXFrKDZN.js +72 -0
  26. package/dist/assets/MagicLinkSignInScreen-dmwIRx3p.js +12 -0
  27. package/dist/assets/MobileAppDrawer-cBt39NZW.js +1 -0
  28. package/dist/assets/NotFoundScreen-DFQDCCRn.js +1 -0
  29. package/dist/assets/NotificationRoutes-DBx2Hpze.js +1 -0
  30. package/dist/assets/OAuthConsentScreen-Y007Isid.js +1 -0
  31. package/dist/assets/PandLWithForecastRoutes-C51wwulq.js +1 -0
  32. package/dist/assets/{PaymentLinkScreen-B8bPleIr.js → PaymentLinkScreen-DJghRBso.js} +7 -7
  33. package/dist/assets/PeopleRoutes-Bm7sOBGu.js +22 -0
  34. package/dist/assets/PerformanceRoutes-BqAferL2.js +1 -0
  35. package/dist/assets/{Preview-DMLQokX_.js → Preview-BTwrFAaN.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-CWU6DFJl.js → QBOConnectionScreen-UblfZAiA.js} +1 -1
  37. package/dist/assets/ReimbursementApprovalRoutes-DEDn1IHB.js +1 -0
  38. package/dist/assets/ReimbursementApprovalRuleDetailScreen-QDei_Fzl.js +1 -0
  39. package/dist/assets/{ReimbursementRoutes-BdJ3oqBf.js → ReimbursementRoutes-BHG-L5Ik.js} +9 -9
  40. package/dist/assets/ReportsRoutes-1SHXwblc.js +1 -0
  41. package/dist/assets/RewardsRoutes-bKzfn6ay.js +1 -0
  42. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-CdJ2LE-G.js +25 -0
  43. package/dist/assets/ScreenRoutes-Bz0Iu7E_.js +2 -0
  44. package/dist/assets/{SettingsRoutes-BGCz0_nd.js → SettingsRoutes-pgiyjQKt.js} +6 -6
  45. package/dist/assets/{SetupPagesScreen-DzNRL7Y-.js → SetupPagesScreen-Dzk7fHhk.js} +5 -5
  46. package/dist/assets/SignInScreen-Rmz1EJ3i.js +1 -0
  47. package/dist/assets/SignOutScreen-BgL1D0p9.js +9 -0
  48. package/dist/assets/{TaskListScreen-Br-mxkKM.js → TaskListScreen-BjJ59grh.js} +2 -2
  49. package/dist/assets/TaskRoutes-cixN3J6B.js +9 -0
  50. package/dist/assets/TransactionDetailRoutes-B_IKz98q.js +1 -0
  51. package/dist/assets/{TransactionDetailScreen-Bp7IFDK0.js → TransactionDetailScreen-BzVEfQec.js} +2 -2
  52. package/dist/assets/TransactionListRoutes-DiO8Bs9p.js +1 -0
  53. package/dist/assets/{TreasuryRoutes-BvvMozYl.js → TreasuryRoutes-DMo68xKo.js} +6 -6
  54. package/dist/assets/{VendorsRoutes-DsJ_lcDO.js → VendorsRoutes-DcubMsnX.js} +17 -17
  55. package/dist/assets/WiseConfirmationScreen-C40X1D6g.js +12 -0
  56. package/dist/assets/ZeniAccountRoutes-B2XcNL7K.js +57 -0
  57. package/dist/assets/ZeniAccountStatementScreen-B4EqmylS.js +9 -0
  58. package/dist/assets/{accountMappingHelper-DqBiQF6x.js → accountMappingHelper-C7mDOec7.js} +1 -1
  59. package/dist/assets/{analytics-D6GpUSOP.js → analytics-D1aMnBue.js} +1 -1
  60. package/dist/assets/{analyticsHelper-CwB3kQvw.js → analyticsHelper-BefphWIe.js} +1 -1
  61. package/dist/assets/{core-B5mDy9pu.js → core-DA_GbUVO.js} +1 -1
  62. package/dist/assets/{decodeURIComponentSafe-DANuhXnG.js → decodeURIComponentSafe-BeWrvHuJ.js} +1 -1
  63. package/dist/assets/{dnd-CGWe1ZMP.js → dnd-BVDuXkBA.js} +1 -1
  64. package/dist/assets/{empty-D0y6rZ_X.js → empty-DkYQEFBR.js} +1 -1
  65. package/dist/assets/{empty-Dj4ZMRNZ.js → empty-kmkuoqGV.js} +1 -1
  66. package/dist/assets/{emptyVideoElement-BbYSqu6F.js → emptyVideoElement-Dr5ohcS7.js} +1 -1
  67. package/dist/assets/epic-DZfUNOLM.js +2 -0
  68. package/dist/assets/expenseAutomationHelper-4Qy8IF7o.js +1 -0
  69. package/dist/assets/{getLocaleForTenant-DH5Avx3x.js → getLocaleForTenant-BYa6QBcb.js} +1 -1
  70. package/dist/assets/{index-BQBXaLiB.js → index-B02Uvg0e.js} +1 -1
  71. package/dist/assets/{index-8s12XWuB.js → index-BVMI-pAw.js} +1 -1
  72. package/dist/assets/{index-k1-Pd2Ki.js → index-BqUvSiTi.js} +1 -1
  73. package/dist/assets/{index-fq0DUtem.js → index-BsYcIz8M.js} +1 -1
  74. package/dist/assets/{index-CI8tXM3D.js → index-C4n_QrNU.js} +1 -1
  75. package/dist/assets/{index-G6Wb7pfX.js → index-C5j9ulaE.js} +2 -2
  76. package/dist/assets/index-CY-CsK5V.js +1 -0
  77. package/dist/assets/{index-6nH5LMe4.js → index-CsnAk3jU.js} +30661 -31464
  78. package/dist/assets/{lexical-DW4lC8Zx.js → lexical-Czsku2z1.js} +1 -1
  79. package/dist/assets/{liveblocks-UOzcPsHa.js → liveblocks-DTaiayIC.js} +2 -2
  80. package/dist/assets/{lottie-C5eNvt0I.js → lottie-CkYI8upo.js} +1 -1
  81. package/dist/assets/{mui-Do6nLzGb.js → mui-yMDYeeMr.js} +1 -1
  82. package/dist/assets/{pathToGoBack-DP_bGWF-.js → pathToGoBack-nmNIndUw.js} +1 -1
  83. package/dist/assets/{pdf-DjwvAC2g.js → pdf-BIYA0Nfl.js} +3 -3
  84. package/dist/assets/{pdf-lib-CZXOqgb4.js → pdf-lib-DZGnWz6X.js} +1 -1
  85. package/dist/assets/{plaid-0g_vwjSd.js → plaid-BtwBxM-6.js} +1 -1
  86. package/dist/assets/{pusher-BwlPp2s7.js → pusher-8BUSKGPT.js} +1 -1
  87. package/dist/assets/{react-BsXfT48C.js → react-Bs3cqIIe.js} +1 -1
  88. package/dist/assets/{react-CU01hiuh.js → react-C6ZyRyfn.js} +1 -1
  89. package/dist/assets/{react-Bja4MeVO.js → react-CxBgzLVF.js} +1 -1
  90. package/dist/assets/{react-Dex3foBA.js → react-a48nQACt.js} +1 -1
  91. package/dist/assets/{react-RZilWHYG.js → react-bpjj59R_.js} +1 -1
  92. package/dist/assets/{react-DkYBVdJJ.js → react-uoYsSJ7d.js} +1 -1
  93. package/dist/assets/{recharts-uFX1dZS-.js → recharts-D3wE7yHJ.js} +1 -1
  94. package/dist/assets/{routePaths-uBvxqlLY.js → routePaths-DeWRBZpS.js} +1 -1
  95. package/dist/assets/{sentry-DHDsO12F.js → sentry-BRmieicQ.js} +1 -1
  96. package/dist/assets/{url-CLCy7GPP.js → url-BAbGMJa_.js} +1 -1
  97. package/dist/assets/{url-BxiN6LKq.js → url-DXDQoAPC.js} +1 -1
  98. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D8KJqvT7.js → useAiCfoDashboardSuggestedQuestionsChips-SoHaFZ4W.js} +1 -1
  99. package/dist/assets/useAskAiCfoHostNavButtonProps-BOgWSkqa.js +1 -0
  100. package/dist/assets/{useChargeCardPusherEvents-BnH8_thb.js → useChargeCardPusherEvents-C1Fc6NgG.js} +1 -1
  101. package/dist/assets/{useDeviceId-Bi38IJl0.js → useDeviceId-CZzjV8tQ.js} +1 -1
  102. package/dist/assets/{useEmailConnectResultRefresh-Ba8t-BuL.js → useEmailConnectResultRefresh-DtruKk0s.js} +1 -1
  103. package/dist/assets/{useInitialThreadRequest-7Q8HJAH2.js → useInitialThreadRequest-BJ6-q-Ev.js} +1 -1
  104. package/dist/assets/useTaskManagerAccess-Bm40mz18.js +1 -0
  105. package/dist/assets/{utils-BsODCDYR.js → utils-UMm0RYR6.js} +1 -1
  106. package/dist/assets/withTransactionSidePanel-aokrUwcT.js +25 -0
  107. package/dist/assets/{zeni-epic-state-7eY0g-Bc.js → zeni-epic-state-cafsD4rZ.js} +6 -6
  108. package/dist/index.html +1 -1
  109. package/package.json +6 -6
  110. package/dist/assets/AccountMappingScreen-Euit4Ttk.js +0 -9
  111. package/dist/assets/ActualMatchingMatchDetailScreen-BBYzjOqh.js +0 -1
  112. package/dist/assets/AddressRoutes-PvYGzHCA.js +0 -1
  113. package/dist/assets/AddressScreen-DsGvV3N8.js +0 -9
  114. package/dist/assets/AiCfoScreen-DAEPn0_B.js +0 -22
  115. package/dist/assets/BillPayRoutes-CWc4tAqm.js +0 -119
  116. package/dist/assets/BusinessVerificationPageScreen-CSruI1nV.js +0 -9
  117. package/dist/assets/CardsAiCfoScreen-COoYscKz.js +0 -14
  118. package/dist/assets/ChargeCardRoutes-BU6-pfJv.js +0 -71
  119. package/dist/assets/CompanyPassportScreen-BxoatMVb.js +0 -1
  120. package/dist/assets/ConnectionAuthScreen-zbcvhPbz.js +0 -11
  121. package/dist/assets/CustomerOnboardingAuthScreen-8IwDeKdF.js +0 -1
  122. package/dist/assets/DomesticWireDetailScreen-DgE28aJN.js +0 -18
  123. package/dist/assets/EntityDetailRoutes-BqX-J3vM.js +0 -1
  124. package/dist/assets/ExpenseAutomationRoutes-DK-U-YTd.js +0 -38
  125. package/dist/assets/FeaturePreviewScreen-5SleVFKv.js +0 -1
  126. package/dist/assets/HubSpotOAuthCallbackScreen-2RxbRDTZ.js +0 -1
  127. package/dist/assets/InboxNotificationsProvider-BmF5-_KA.js +0 -1
  128. package/dist/assets/InvoicingRoutes-D0S6fDxY.js +0 -2
  129. package/dist/assets/MagicLinkRoutes-C22EnpRm.js +0 -72
  130. package/dist/assets/MagicLinkSignInScreen-BVf-rLEH.js +0 -12
  131. package/dist/assets/MobileAppDrawer-0YtWXA3B.js +0 -1
  132. package/dist/assets/NotFoundScreen-BkYIKPgh.js +0 -1
  133. package/dist/assets/NotificationRoutes-CZQRvVbE.js +0 -1
  134. package/dist/assets/OAuthConsentScreen-Q7ZDvc1F.js +0 -1
  135. package/dist/assets/PandLWithForecastRoutes-BzO_OgSq.js +0 -1
  136. package/dist/assets/PeopleRoutes-D_nqmuPM.js +0 -22
  137. package/dist/assets/PerformanceRoutes-BW6dixVF.js +0 -1
  138. package/dist/assets/ReimbursementApprovalRoutes-DAusugdf.js +0 -1
  139. package/dist/assets/ReimbursementApprovalRuleDetailScreen-phJuB98f.js +0 -1
  140. package/dist/assets/ReportsRoutes-CDSCG28G.js +0 -1
  141. package/dist/assets/RewardsRoutes-CHkOPz1g.js +0 -1
  142. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DnVEpQsK.js +0 -33
  143. package/dist/assets/ScreenRoutes-BYAPWka6.js +0 -2
  144. package/dist/assets/SignInScreen-BREpWd6T.js +0 -1
  145. package/dist/assets/SignOutScreen-BNCpbut8.js +0 -9
  146. package/dist/assets/TaskRoutes-CDuiJExM.js +0 -9
  147. package/dist/assets/TransactionDetailRoutes-CYb-4jKQ.js +0 -1
  148. package/dist/assets/TransactionListRoutes-B6NIJUWk.js +0 -1
  149. package/dist/assets/WiseConfirmationScreen-Bg5_g49N.js +0 -12
  150. package/dist/assets/ZeniAccountRoutes-C3fDjuMG.js +0 -57
  151. package/dist/assets/ZeniAccountStatementScreen-CbdRQI0p.js +0 -9
  152. package/dist/assets/epic-mSW644GG.js +0 -2
  153. package/dist/assets/expenseAutomationHelper-DBDpSggk.js +0 -1
  154. package/dist/assets/index-6yt3BfRL.js +0 -1
  155. package/dist/assets/stripSplatSuffix-CQQXAy0N.js +0 -1
  156. package/dist/assets/useActualMatchingMatchDetail-OCZsPxr6.js +0 -1
  157. package/dist/assets/useAskAiCfoHostNavButtonProps-BsP5fVhq.js +0 -1
  158. package/dist/assets/useTaskManagerAccess-BG0Fkj9k.js +0 -1
  159. package/dist/assets/withTransactionSidePanel-DK-Ex27L.js +0 -25
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-DTaiayIC.js";import{h as K,u as X,g as H,i as Q,j as d,l as Z,n as ee,o as C}from"./core-DA_GbUVO.js";import{fE as M,zw as O,uv as ae,UJ as w,uq as y,bq as te,b$ as se,ur as oe,UK as re,Ur as S,eb as ne,Di as ce,UL as ie,DG as le,dY as de,dX as me}from"./zeni-epic-state-cafsD4rZ.js";import{ai as fe,z as pe,aq as ue,as as he,V as Fe,M as q,y as $,a8 as ge,h as _,aD as be,p as Ie}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import Ce from"./NotFoundScreen-DFQDCCRn.js";import{F as Se}from"./FeaturePreviewScreen-BFU7MG_7.js";import{a as F}from"./sentry-BRmieicQ.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import{u as Te}from"./useInitialThreadRequest-BJ6-q-Ev.js";import{t as De}from"./routePaths-DeWRBZpS.js";import{M as Ae}from"./MobileAppDrawer-cBt39NZW.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.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]="8a28c74b-3f24-45a4-a38d-62d3d055f0d3",s._sentryDebugIdIdentifier="sentry-dbid-8a28c74b-3f24-45a4-a38d-62d3d055f0d3")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=Z((function(s){const e=re(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:_}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(y(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(le(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ce(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=ne(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=De(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=Ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(be);function v(){const s=fe(),e=K(),a=X(),o=H(),{forecastId:r,tenantEmailDomain:c}=Q(),[p,u]=F.useState(!1),[m,D]=F.useState(!1),g=pe.getSignedInUser(),A=d((t=>M(t))),B=A.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),E=d((t=>t.reportUIOptionsState.selectedForecast)),L=t=>x.pandLByForecastID[t]!=null&&oe(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:b}=ue();he({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:N}=ye({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&b)u(!0),l||a(ae());else if(l&&!m){D(!0);const t=((f,U,R)=>U!=null?f.forecasts.findIndex((I=>I.id===U)):R!=null?f.forecasts.findIndex((I=>I.id===R)):f.forecasts.length>0?0:-1)(i,r,E?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=E?.index?(a(w(i.forecasts[t].id,t)),T(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&T(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!L(i.forecasts[t].id)&&b&&a(y(i.forecasts[t].id))}}),[p,u,a,l,i,m,D,O,y,b]);const j=Fe(),V=j?.loggedInUserRole!=null&&te(j.loggedInUserRole),{useFeatureGate:W}=q(),{isFeatureEnabled:k}=W($.isReportsCommentingEnabled),Y=Te(k?A?.companyId:void 0,{clearParams:l&&m}),[z,J]=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 P=t=>{J(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:_,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Ae,{isAppContentDrawerOpen:z,handleDrawerToggle:P}),n.jsx(xe,{firstMonthOfFY:B,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:L,meetingUrl:se(h.toString()),hasTransactionAccess:V,isAiCfoAccessEnabled:G,onAskAiCfoClick:N,isReportsCommentingEnabled:k,initialOpenThreadRequest:Y,onClickMenuIcon:()=>{P(!0)}})]})}function Xe(){const s=d((c=>M(c))),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=de(a,s),r=me(s);return o===!0||r===!0?n.jsx(Se,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Xe as default};
@@ -1,15 +1,15 @@
1
- import{j as a}from"./liveblocks-UOzcPsHa.js";import{a as p}from"./sentry-DHDsO12F.js";import{F as c,H as r,a9 as m,ad as f,ae as h}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import{i as y}from"./core-B5mDy9pu.js";import"./zeni-epic-state-7eY0g-Bc.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.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]="c843409e-76f1-4a2e-a664-bbeb91a05d58",e._sentryDebugIdIdentifier="sentry-dbid-c843409e-76f1-4a2e-a664-bbeb91a05d58")}catch{}})();const g=c("div")`
1
+ import{j as r}from"./liveblocks-DTaiayIC.js";import{a as p}from"./sentry-BRmieicQ.js";import{I as c,J as a,a9 as m,ad as f,ae as h}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import{i as y}from"./core-DA_GbUVO.js";import"./zeni-epic-state-cafsD4rZ.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.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]="4553bbf5-4e68-43e4-bfc4-1af1eba789d6",e._sentryDebugIdIdentifier="sentry-dbid-4553bbf5-4e68-43e4-bfc4-1af1eba789d6")}catch{}})();const b=c("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
5
5
  min-height: 100vh;
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,b=c("header")`
7
+ `,g=c("header")`
8
8
  flex-shrink: 0;
9
- padding: ${r.sp3} ${r.sp4};
9
+ padding: ${a.sp3} ${a.sp4};
10
10
  `,k=c(m)`
11
- width: ${r.sp4};
12
- height: ${r.sp4};
11
+ width: ${a.sp4};
12
+ height: ${a.sp4};
13
13
  color: ${e=>e.theme.colors.brandColorJade};
14
14
  `,x=c("main")`
15
15
  display: flex;
@@ -17,5 +17,5 @@ import{j as a}from"./liveblocks-UOzcPsHa.js";import{a as p}from"./sentry-DHDsO12
17
17
  flex-direction: column;
18
18
  align-items: center;
19
19
  justify-content: center;
20
- padding: ${r.sp4};
21
- `;function j({children:e}){return a.jsxs(g,{"data-testid":"invoicing-collect-payment-layout",children:[a.jsx(b,{children:a.jsx(k,{"aria-label":"Zeni",role:"img"})}),a.jsx(x,{children:e})]})}class w extends Error{statusCode;constructor(t,o){super(t),this.name="PortalRequestError",this.statusCode=o}}function $(e,t){const o=(function(){const n=h?.invoicingMicroServiceBaseUrl;return`${n!=null&&n.length>0?n:""}/1.0`})(),s={namespace:e,token:t};async function i(n,u){const l=await fetch(`${o}${n}`,{body:JSON.stringify(u),headers:{"Content-Type":"application/json"},method:"POST"}),d=await l.json();if(!l.ok)throw new w(d.status?.message??`Request failed (${l.status}).`,l.status);return d.data}return{checkoutSession:()=>i("/portal/payment-link/checkout-session",s),plaidLinkToken:()=>i("/portal/payment-link/plaid-link-token",s),requestAccess:()=>i("/portal/payment-link/request-access",s),savePaymentMethod:n=>i("/portal/payment-link/payment-methods",{...s,...n}),session:()=>i("/portal/payment-link/session",s),setupIntent:()=>i("/portal/payment-link/setup-intent",s)}}function B(){const{namespace:e="",token:t=""}=y();p.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]);const o=p.useMemo((()=>$(e,t)),[e,t]);return a.jsx(j,{children:a.jsx(f,{portal:o})})}export{B as default};
20
+ padding: ${a.sp4};
21
+ `;function j({children:e}){return r.jsxs(b,{"data-testid":"invoicing-collect-payment-layout",children:[r.jsx(g,{children:r.jsx(k,{"aria-label":"Zeni",role:"img"})}),r.jsx(x,{children:e})]})}class w extends Error{statusCode;constructor(t,o){super(t),this.name="PortalRequestError",this.statusCode=o}}function $(e,t){const o=(function(){const n=h?.invoicingMicroServiceBaseUrl;return`${n!=null&&n.length>0?n:""}/1.0`})(),s={namespace:e,token:t};async function i(n,u){const l=await fetch(`${o}${n}`,{body:JSON.stringify(u),headers:{"Content-Type":"application/json"},method:"POST"}),d=await l.json();if(!l.ok)throw new w(d.status?.message??`Request failed (${l.status}).`,l.status);return d.data}return{checkoutSession:()=>i("/portal/payment-link/checkout-session",s),plaidLinkToken:()=>i("/portal/payment-link/plaid-link-token",s),requestAccess:()=>i("/portal/payment-link/request-access",s),savePaymentMethod:n=>i("/portal/payment-link/payment-methods",{...s,...n}),session:()=>i("/portal/payment-link/session",s),setupIntent:()=>i("/portal/payment-link/setup-intent",s)}}function B(){const{namespace:e="",token:t=""}=y();p.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]);const o=p.useMemo((()=>$(e,t)),[e,t]);return r.jsx(j,{children:r.jsx(f,{portal:o})})}export{B as default};
@@ -0,0 +1,22 @@
1
+ import{j as a}from"./liveblocks-DTaiayIC.js";import{UF as re,fE as Q,l_ as G,dY as N,dX as le,Rx as X,U2 as de,Cf as Pe,UG as J,C4 as je,Cp as Le,Cj as ce,C8 as pe,Cn as ve,Ck as Te,UH as ue,rL as Ae,g5 as Re,gC as Fe,UI as H,Cc as me,Cb as ge,Cs as Ve,c8 as Oe}from"./zeni-epic-state-cafsD4rZ.js";import{a1 as Ce,M as Y,y as _,z as K,f as fe,P as he,af as be,az as ye,aA as Ue,ab as Se,J as V,ag as we,G as W,aB as Ze,aq as Be,as as $e,a8 as ze,h as xe,S as He,p as _e,aC as Ge,V as Ke}from"./index-CsnAk3jU.js";import{D as De,n as M,S as Ie}from"./mui-yMDYeeMr.js";import ae from"./NotFoundScreen-DFQDCCRn.js";import{a as d}from"./sentry-BRmieicQ.js";import{u as ee,i as We,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-DA_GbUVO.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import{M as Ne}from"./MobileAppDrawer-cBt39NZW.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.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]="18b79044-ddc4-4d37-9687-11dbb4512b20",e._sentryDebugIdIdentifier="sentry-dbid-18b79044-ddc4-4d37-9687-11dbb4512b20")}catch{}})();const Xe={overlayWidth:new Se(100,100,48)},te=W.getLocalizedStrings().peoplePage.invitePage,ne=W.getLocalizedStrings().common,Ye=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:C,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=Ce(),m=ee(),[O,U]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=We(),r=g((l=>re(l))),p=g((l=>Q(l))),E=g((l=>G(l))),{useFeatureGate:D}=Y(),{isFeatureEnabled:I}=D(_.isDebitCardFeatureEnabled),P=N(I,p),v=le(p),T=X(p),Z=de(p),B=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(J()),y()},A=()=>{O===!0?S(!0):h()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=D(_.isChargeCardFeatureEnabled),L=fe(p,j,I),{isCardsHidden:R}=he(p?.tenantId),b=!L||R,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),U(!0)},onSaveClick:()=>{m(C==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(Pe(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(ye,{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(Ue,{...s})]})})},ea=M(Ie)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,ke=M(we.H6Regular)`
6
+ margin-top: ${V.sp7};
7
+ padding-left: ${V.sp8};
8
+ padding-right: ${V.sp8};
9
+ color: ${e=>e.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Ee=M(we.LargeRegularSp)`
12
+ color: ${e=>e.theme.colors.hero};
13
+ padding-left: ${V.sp8};
14
+ padding-right: ${V.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${V.sp4};
17
+ white-space: pre-line;
18
+ `,aa={overlayWidth:new Se(100,100,48)},oe=W.getLocalizedStrings().peoplePage.invitePage,ie=W.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:C,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=Ce(),m=ee(),[O,U]=d.useState(!1),[k,S]=d.useState(!1),w=g((o=>re(o))),r=g((o=>Q(o))),p=g((o=>G(o))),{useFeatureGate:E}=Y(),{isFeatureEnabled:D}=E(_.isDebitCardFeatureEnabled),I=N(D,r),P=le(r),v=X(r),T=de(r),Z=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),m(J())},h=()=>{O===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(_.isChargeCardFeatureEnabled),L=fe(r,j,D),{isCardsHidden:R}=he(r?.tenantId),b=!L||R,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:v,onPeopleLocalDataUpdated:o=>{m(ce({peopleLocalData:o})),U(!0)},onResetClick:x,onSaveClick:()=>{m(C==="zeni_only"?ve(e):Te())},onCloseClick:h,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:Z===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:B};return d.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(y(),m(J()))}),[w.invitePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(ye,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Ze,{...s})]})})},ta=M(Ie)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,na=Je((function(e,t){const c=ue(e),n=K.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:xe}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:C}=t;return{personAction:{onPersonDelete:(i,y)=>{e(pe(i,y))},onResendInvite:i=>{e(Ve(i))},onReloadPeople:()=>{e(me()),e(ge(n,C))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(H({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(H({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=Me(),n=ee(),C=qe(),{areTenantIdsInSync:i}=Be(),y=K.getSignedInUser(),f=g((s=>Q(s))),{useFeatureGate:m}=Y(),{isFeatureEnabled:O}=m(_.isDebitCardFeatureEnabled),U=g((s=>G(s))),k=!N(O,f)&&U,S=X(f),w=f?.tenantId,{tenantEmailDomain:r}=f,[p,E]=d.useState(!1),[D,I]=d.useState(!1),[P,v]=d.useState(!1),[T,Z]=d.useState("off"),[B,x]=d.useState(!1),h=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Qe({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Re(s.userState,s.userRoleState,s.userListViewState,"manager"))),R=g((s=>Fe(s))),b=f?.companyId;d.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(H({searchText:"",sortKey:"name",sortOrder:"ascending"})),Z(u.uiState.mode),E(!0),n(me()))}),[p,y,w,n,u.uiState.mode,i]),d.useEffect((()=>{b!=null&&i&&n(ge(b,k))}),[b,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),v(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(H({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),v(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:xe,onLoad:s=>s.trackPageLoaded(He.Event.members)}):null,D===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:D,managersListView:L,companyPassportView:R,classListView:j,companyId:b,mode:u.uiState.mode}):null,P===!0?a.jsx(Ye,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:R,classListView:j,companyId:b,mode:u.uiState.mode}):null,a.jsx(Ne,{isAppContentDrawerOpen:B,handleDrawerToggle:h}),a.jsx(na,{navigate:c,signedInUser:y,isZeni:f.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:b,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(H({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=_e(C.state?.pathnameStackToGoBack,C.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function ka(){const e=Ke();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DTaiayIC.js";import T from"./NotFoundScreen-DFQDCCRn.js";import{a as r}from"./sentry-BRmieicQ.js";import{h as _,g as v,j as p,i as M,u as U,N as P,l as z,n as N,o as h}from"./core-DA_GbUVO.js";import{fE as O,a0h as b,bo as B,bn as F,iK as V,gg as K}from"./zeni-epic-state-cafsD4rZ.js";import{r as $,z as I,as as q,dN as G}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import{M as J}from"./MobileAppDrawer-cBt39NZW.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.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]="d08f8797-21d4-44b6-8463-853191c54c89",e._sentryDebugIdIdentifier="sentry-dbid-d08f8797-21d4-44b6-8463-853191c54c89")}catch{}})();const L=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),Q=()=>{const e=_(),t=v(),c=$(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),g=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=F(l),y=C||k||x,d=r.useCallback(((a,i,E)=>{g(V({fromMonth:a,toMonth:i,cacheOverride:E}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(g(K({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),u=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:u}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:u,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(N,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(T,{})})]})}export{he as default};
@@ -1 +1 @@
1
- import{a as h,R as a}from"./sentry-DHDsO12F.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-BRmieicQ.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 Ol}from"./liveblocks-UOzcPsHa.js";import{p as Q,d as kc,c as an,g as jl,a as xl}from"./sentry-DHDsO12F.js";import{L as dt,b$ as Tc,fF as Ac,TL as Rc,UB as kl,c8 as Tl}from"./zeni-epic-state-7eY0g-Bc.js";import{a as lt,b as Al,c as Rl,d as Il,e as un,f as Pl,g as Nl,h as Ll,i as Vt,j as Ic,k as oe,l as je,m as $l,o as Yt,p as ue,q as Ml}from"./utils-BsODCDYR.js";import{r as cn}from"./empty-Dj4ZMRNZ.js";import{r as Cl,a as Dl,b as Fl,c as Bl}from"./pdf-lib-CZXOqgb4.js";import{r as Ul}from"./index-k1-Pd2Ki.js";import{r as ql}from"./index-6yt3BfRL.js";import{h as Gl,g as zl,u as Zl,j as _n,l as Hl}from"./core-B5mDy9pu.js";import{u as Vl,z as Pc,L as Yl,ak as Kl,al as Wl,Z as Jl,C as Xl}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import{d as Pe}from"./decodeURIComponentSafe-DANuhXnG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="567f6179-9e44-4a7a-8d01-d3b67849a2ea",t._sentryDebugIdIdentifier="sentry-dbid-567f6179-9e44-4a7a-8d01-d3b67849a2ea")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,In,Pn,Nn,Ne,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,zn,Le,Zn,Hn,Vn,Yn,Kn,Wn,Jn,$e,Xn,Qn,to,eo,ro,no,oo,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(jn)return De;function t(r){return t=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},t(r)}function u(r,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},u(r,e)}function d(r){var e=(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 a,p=o(r);if(e){var h=o(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return(function(m,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g})(m)})(this,a)}}function o(r){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(r)}jn=1;var c,i,n={};function s(r,e,a){a||(a=Error);var p=(function(h){(function(l,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(y&&y.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),y&&u(l,y)})(g,h);var m,b=d(g);function g(l,y,v){var S;return(function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")})(this,g),S=b.call(this,(function(w,_,M){return typeof e=="string"?e:e(w,_,M)})(l,y,v)),S.code=r,S}return m=g,Object.defineProperty(m,"prototype",{writable:!1}),m})(a);n[r]=p}function f(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map((function(p){return String(p)})),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return s("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),s("ERR_INVALID_ARG_TYPE",(function(r,e,a){var p,h,m;if(c===void 0&&(c=ie()),c(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",(function(g,l,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-l.length,y)===l})(r," argument"))m="The ".concat(r," ").concat(p," ").concat(f(e,"type"));else{var b=(function(g,l,y){return typeof y!="number"&&(y=0),!(y+l.length>g.length)&&g.indexOf(l,y)!==-1})(r,".")?"property":"argument";m='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(f(e,"type"))}return m+=". Received type ".concat(t(a))}),TypeError),s("ERR_INVALID_ARG_VALUE",(function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";i===void 0&&(i=lt());var p=i.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)}),TypeError),s("ERR_INVALID_RETURN_VALUE",(function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")}),TypeError),s("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];c===void 0&&(c=ie()),c(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map((function(m){return'"'.concat(m,'"')})),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")}),TypeError),De.codes=n,De}function Ql(){if(kn)return xn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter((function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable}))),j.push.apply(j,x)}return j}function u(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach((function(x){d(k,x,j[x])})):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach((function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))}))}return k}function d(k,E,j){return(E=c(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function o(k,E,j){return E&&(function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,c(N.key),N)}})(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function c(k){var E=(function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)})(k,"string");return p(E)==="symbol"?E:String(E)}function i(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function s(k){var E=typeof Map=="function"?new Map:void 0;return s=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return f(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},s(k)}function f(k,E,j){return f=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},f.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 e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=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},p(k)}kn=1;var h=lt().inspect,m=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",l="",y="",v="",S={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(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach((function(x){j[x]=k[x]})),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-DTaiayIC.js";import{p as Q,d as kc,c as an,g as jl,a as xl}from"./sentry-BRmieicQ.js";import{L as dt,b$ as Tc,fE as Ac,Tb as Rc,U0 as kl,c8 as Tl}from"./zeni-epic-state-cafsD4rZ.js";import{a as lt,b as Al,c as Rl,d as Il,e as un,f as Pl,g as Nl,h as Ll,i as Vt,j as Ic,k as oe,l as je,m as $l,o as Yt,p as ue,q as Ml}from"./utils-UMm0RYR6.js";import{r as cn}from"./empty-kmkuoqGV.js";import{r as Cl,a as Dl,b as Fl,c as Bl}from"./pdf-lib-DZGnWz6X.js";import{r as Ul}from"./index-BqUvSiTi.js";import{r as ql}from"./index-CY-CsK5V.js";import{h as Gl,g as zl,u as Zl,j as _n,l as Hl}from"./core-DA_GbUVO.js";import{u as Vl,z as Pc,L as Yl,ak as Kl,al as Wl,Y as Jl,F as Xl}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import{d as Pe}from"./decodeURIComponentSafe-BeWrvHuJ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="7874a83d-596a-4dcb-8abc-ebba44b129f0",t._sentryDebugIdIdentifier="sentry-dbid-7874a83d-596a-4dcb-8abc-ebba44b129f0")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,In,Pn,Nn,Ne,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,zn,Le,Zn,Hn,Vn,Yn,Kn,Wn,Jn,$e,Xn,Qn,to,eo,ro,no,oo,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(jn)return De;function t(r){return t=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},t(r)}function u(r,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},u(r,e)}function d(r){var e=(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 a,p=o(r);if(e){var h=o(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return(function(m,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g})(m)})(this,a)}}function o(r){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(r)}jn=1;var c,i,n={};function s(r,e,a){a||(a=Error);var p=(function(h){(function(l,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(y&&y.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),y&&u(l,y)})(g,h);var m,b=d(g);function g(l,y,v){var S;return(function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")})(this,g),S=b.call(this,(function(w,_,M){return typeof e=="string"?e:e(w,_,M)})(l,y,v)),S.code=r,S}return m=g,Object.defineProperty(m,"prototype",{writable:!1}),m})(a);n[r]=p}function f(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map((function(p){return String(p)})),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return s("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),s("ERR_INVALID_ARG_TYPE",(function(r,e,a){var p,h,m;if(c===void 0&&(c=ie()),c(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",(function(g,l,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-l.length,y)===l})(r," argument"))m="The ".concat(r," ").concat(p," ").concat(f(e,"type"));else{var b=(function(g,l,y){return typeof y!="number"&&(y=0),!(y+l.length>g.length)&&g.indexOf(l,y)!==-1})(r,".")?"property":"argument";m='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(f(e,"type"))}return m+=". Received type ".concat(t(a))}),TypeError),s("ERR_INVALID_ARG_VALUE",(function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";i===void 0&&(i=lt());var p=i.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)}),TypeError),s("ERR_INVALID_RETURN_VALUE",(function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")}),TypeError),s("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];c===void 0&&(c=ie()),c(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map((function(m){return'"'.concat(m,'"')})),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")}),TypeError),De.codes=n,De}function Ql(){if(kn)return xn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter((function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable}))),j.push.apply(j,x)}return j}function u(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach((function(x){d(k,x,j[x])})):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach((function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))}))}return k}function d(k,E,j){return(E=c(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function o(k,E,j){return E&&(function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,c(N.key),N)}})(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function c(k){var E=(function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)})(k,"string");return p(E)==="symbol"?E:String(E)}function i(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function s(k){var E=typeof Map=="function"?new Map:void 0;return s=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return f(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},s(k)}function f(k,E,j){return f=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},f.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 e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=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},p(k)}kn=1;var h=lt().inspect,m=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",l="",y="",v="",S={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(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach((function(x){j[x]=k[x]})),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-DTaiayIC.js";import W from"./NotFoundScreen-DFQDCCRn.js";import{a as p}from"./sentry-BRmieicQ.js";import{h as C,g as D,u as V,j as u,N as k,l as U,n as Y,o as h}from"./core-DA_GbUVO.js";import{fE as I,Yl as b,YC as R,MY as N,MU as L,MX as f,MN as $,Y$ as B,MR as z,M_ as K}from"./zeni-epic-state-cafsD4rZ.js";import{z as M,w as T,c9 as X,n as _,bS as q,ca as F}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import{u as G,R as x}from"./ReimbursementApprovalRuleDetailScreen-QDei_Fzl.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]="fe926528-0827-4326-ac1d-89f19c9e57d4",e._sentryDebugIdIdentifier="sentry-dbid-fe926528-0827-4326-ac1d-89f19c9e57d4")}catch{}})();const A="reimbursement-approval-rule-update",H=U((function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:R(e).remiSetupApproverViewUpdateData}}),(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($(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(X)),J=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>I(o))),d=u((o=>b(o))),g=u((o=>R(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(N())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),M.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(w(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${A}`]:[],eventCallback:(o,y,j)=>{o.endsWith(A)&&j.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(H,{currentTenant:c,location:n,navigate:s,...m})},E="reimbursement-approval-rule-update",P=U((function(e){const s=b(e),n=R(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(E)&&e(B(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(T(F)),Q=()=>{const e=u((a=>I(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=q(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(J,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>I(i))),o=u((i=>b(i)));G();const y=u((i=>R(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(N())}),[y]),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||(w(!0),a(z(!1,!0)))}),[v,g,e,a]),M.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 j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${E}`]:[],eventCallback:(i,ee,O)=>{i.endsWith(E)&&O.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function le(){return r.jsxs(Y,{children:[r.jsx(h,{path:"/",element:r.jsx(Q,{})}),r.jsx(h,{path:"/new",element:r.jsx(x,{})}),r.jsx(h,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(h,{path:"*",element:r.jsx(W,{})})]})}export{le as R};
@@ -0,0 +1 @@
1
+ import{j as h}from"./liveblocks-DTaiayIC.js";import{a as m}from"./sentry-BRmieicQ.js";import{u as U,j as g,h as _,g as O,i as V,l as k}from"./core-DA_GbUVO.js";import{mq as $,YC as w,Yl as C,MQ as B,N1 as j,MY as A,MZ as E,YD as N,fE as L,MX as z}from"./zeni-epic-state-cafsD4rZ.js";import{z as F,E as P,a7 as q,c0 as K,n as M,bS as Q,c1 as W}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.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]="b7d771e4-0bd3-4e27-935c-cfa5b61b8655",e._sentryDebugIdIdentifier="sentry-dbid-b7d771e4-0bd3-4e27-935c-cfa5b61b8655")}catch{}})();function X(){const e=U(),s=m.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));m.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e($({})))}),[p,t,e])}const Z=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=M(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((f=>({type:"user",subType:void 0,userId:f.userId,idType:"user",isImplicitActor:!1}))),R=u.actors.selectedNonUsers.map((f=>{const y=(b=f.value,N(b)==null);var b;return{type:y?"attribute":"role",subType:f.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=I.concat(R);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function G(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),l=P(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=m.useState(!1);if(m.useEffect((()=>{a||(d(!0),s(B(!0)))})),m.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Z,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return N(e)==null}const H=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=M(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const f=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,Y=y.selectedRole?.selectedNonUsers??[];let D=[];b==="role"?D=Y.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";f.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),f},n=a.amountCriteria,v=a.vendorCriteria,S=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 R=S?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:R}),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:l,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"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>L(t))),{isApprovalRulesV3Enabled:s}=Q(e?.tenantId);return s?h.jsx(J,{}):h.jsx(G,{})}function J(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),l=P(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=m.useState(!1);if(X(),m.useEffect((()=>{a||(d(!0),s(B(!1)))})),m.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,X as u};
@@ -1,10 +1,10 @@
1
- import{j as s}from"./liveblocks-UOzcPsHa.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-B5mDy9pu.js";import{fF as V,Ns as ut,_G as ge,c8 as he,My as Le,ma as pt,MN as ce,MM as de,_H as bt,bn as fe,gV as _e,_I as gt,WF as ht,l$ as $e,WG as Ce,WH as ft,kN as St,YI as It,l0 as yt,Mm as Rt,C5 as vt,kU as At,N7 as Me,_J as Pe,_K as Ee,_L as kt,_M as Ct,_N as Et,MT as we,l6 as wt,YR as xt,ML as Bt,Mw as Tt,_O as Dt,Mv as jt,_P as Ft,MD as xe,MX as Ut,MW as Lt,MS as _t,_Q as Ne,S5 as $t,bo as Mt,MG as Pt,Np as Nt,_R as Ot,_S as Gt,N3 as zt,N0 as Be,Yc as Zt,Mt as Vt,_T as Oe,NS as Te,N_ as Wt,_U as Ht,_V as q,_W as Yt,_X as Ge,_Y as qt,_Z as ze,__ as Ze,Nf as ue,bu as Xt,bK as Se,cM as Ie,d_ as Ve,dZ as We,_$ as Jt,gh as Kt,Yp as Qt,$0 as en,$1 as He,Yt as tn,Zb as nn,$2 as an,ZA as sn,NX as De,NW as on,$3 as rn,$4 as ln,$5 as mn,$6 as cn,$7 as dn,YX as un,NN as pn,NR as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,U4 as yn,da as Rn,dd as vn,dc as An,cF as kn}from"./zeni-epic-state-7eY0g-Bc.js";import{bS as Cn,M as Ye,a1 as qe,N as oe,c as x,z as _,cT as Xe,a8 as re,j as C,aS as je,H as F,ae as se,af as En,G as Je,cU as wn,p as X,as as Ke,cV as xn,U as le,cW as Bn,aq as Tn,ab as Dn,a7 as ye,S as Qe,w as jn,bA as Fn,av as Un,ai as Ln,E as et,cX as _n,g as $n}from"./index-6nH5LMe4.js";import{n as P,S as Mn}from"./mui-Do6nLzGb.js";import pe from"./NotFoundScreen-BkYIKPgh.js";import{S as Fe}from"./SetupPagesScreen-DzNRL7Y-.js";import{F as tt}from"./FeaturePreviewScreen-5SleVFKv.js";import{a as h}from"./sentry-DHDsO12F.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-BsP5fVhq.js";import{u as nt}from"./useInitialThreadRequest-7Q8HJAH2.js";import{D as Pn}from"./DrawerScreen-BihZ_PpN.js";import{M as at}from"./MobileAppDrawer-0YtWXA3B.js";import{F as Nn}from"./ScreenRoutes-BYAPWka6.js";import{R as On}from"./ReimbursementApprovalRoutes-DAusugdf.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./BusinessVerificationPageScreen-CSruI1nV.js";import"./routePaths-uBvxqlLY.js";import"./analyticsHelper-CwB3kQvw.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-BG0Fkj9k.js";import"./getLocaleForTenant-DH5Avx3x.js";import"./ReimbursementApprovalRuleDetailScreen-phJuB98f.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]="3634aea4-5d67-4fd4-9b75-f911f85a6bc7",e._sentryDebugIdIdentifier="sentry-dbid-3634aea4-5d67-4fd4-9b75-f911f85a6bc7")}catch{}})();const st=e=>`/${e}/reimbursements`,Gn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),zn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:G,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,G))}),[O,W,G,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const $=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(zn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Zn=P.div`
1
+ import{j as s}from"./liveblocks-DTaiayIC.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as $,l as ee,q as ct,n as dt,o as w}from"./core-DA_GbUVO.js";import{fE as Z,MU as ut,_6 as ge,c8 as he,L_ as Le,m9 as pt,Md as ce,Mc as de,_7 as bt,bn as fe,gU as _e,_8 as gt,W4 as ht,l_ as Me,W5 as Ce,W6 as ft,kM as St,Y7 as It,k$ as yt,LO as Rt,Bx as vt,kT as At,Mz as $e,_9 as Pe,_a as Ee,_b as kt,_c as Ct,_d as Et,Mj as we,l5 as wt,Yg as xt,Mb as Bt,LY as Tt,_e as Dt,LX as jt,_f as Ft,M3 as xe,Mn as Ut,Mm as Lt,Mi as _t,_g as Ne,Rx as Mt,bo as $t,M6 as Pt,MR as Nt,_h as Ot,_i as zt,Mv as Gt,Ms as Be,XD as Vt,LV as Zt,_j as Oe,Ni as Te,Nq as Ht,_k as Wt,_l as Y,_m as qt,_n as ze,_o as Yt,_p as Ge,_q as Ve,MH as ue,bu as Xt,bK as Se,cM as Ie,dY as Ze,dX as He,_r as Jt,gg as Kt,XQ as Qt,_s as en,_t as We,XU as tn,YC as nn,_u as an,Y$ as sn,Nn as De,Nm as on,_v as rn,_w as ln,_x as mn,_y as cn,_z as dn,Ym as un,Nd as pn,Nh as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,Tw as yn,d9 as Rn,dc as vn,db as An,cF as kn}from"./zeni-epic-state-cafsD4rZ.js";import{bS as Cn,r as qe,a1 as Ye,M as oe,y as x,z as _,cR as Xe,a8 as re,h as C,aS as je,J as F,ae as se,af as En,G as Je,cS as wn,p as X,as as Ke,cT as xn,V as le,cU as Bn,aq as Tn,ab as Dn,a7 as ye,S as Qe,w as jn,bA as Fn,av as Un,ai as Ln,E as et,cV as _n,f as Mn}from"./index-CsnAk3jU.js";import{n as P,S as $n}from"./mui-yMDYeeMr.js";import pe from"./NotFoundScreen-DFQDCCRn.js";import{S as Fe}from"./SetupPagesScreen-Dzk7fHhk.js";import{F as tt}from"./FeaturePreviewScreen-BFU7MG_7.js";import{a as h}from"./sentry-BRmieicQ.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import{u as nt}from"./useInitialThreadRequest-BJ6-q-Ev.js";import{D as Pn}from"./DrawerScreen-DsFB_53j.js";import{M as at}from"./MobileAppDrawer-cBt39NZW.js";import{F as Nn}from"./ScreenRoutes-Bz0Iu7E_.js";import{R as On}from"./ReimbursementApprovalRoutes-DEDn1IHB.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./BusinessVerificationPageScreen-BT5PhS2R.js";import"./routePaths-DeWRBZpS.js";import"./analyticsHelper-BefphWIe.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.js";import"./getLocaleForTenant-BYa6QBcb.js";import"./ReimbursementApprovalRuleDetailScreen-QDei_Fzl.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]="06aa6960-53d9-4491-a97a-9e9bb8b8cc3d",e._sentryDebugIdIdentifier="sentry-dbid-06aa6960-53d9-4491-a97a-9e9bb8b8cc3d")}catch{}})();const st=e=>`/${e}/reimbursements`,zn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),Gn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Me(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=qe(),d=Ye(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>Z(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>Z(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:z,isLoading:H}=Cn(O),W=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||H||W==="Not-Started"&&p(ut(!0,!1,!1,z))}),[O,H,z,W,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const M=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Vn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Zn,{}):null,m&&d!=="small"?s.jsx(Hn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(qn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Yn,{windowSize:d,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Vn=P.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
5
5
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,Vn=P.div`
7
+ `,Zn=P.div`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
@@ -12,7 +12,7 @@ import{j as s}from"./liveblocks-UOzcPsHa.js";import{u as ae,j as v,h as Q,g as J
12
12
  bottom: 0;
13
13
  background-color: ${En.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,Wn=P.div`
15
+ `,Hn=P.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-UOzcPsHa.js";import{u as ae,j as v,h as Q,g as J
22
22
  display: flex;
23
23
  background-color: transparent;
24
24
  overflow: hidden;
25
- `,Hn=P.div`
25
+ `,Wn=P.div`
26
26
  position: fixed;
27
27
  top: 0;
28
28
  left: 0;
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-UOzcPsHa.js";import{u as ae,j as v,h as Q,g as J
33
33
  flex-direction: column;
34
34
  overflow-y: auto;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- `,Yn=P.button`
36
+ `,qn=P.button`
37
37
  align-self: flex-end;
38
38
  background: none;
39
39
  border: none;
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-UOzcPsHa.js";import{u as ae,j as v,h as Q,g as J
48
48
  width: ${F.sp4};
49
49
  height: ${F.sp4};
50
50
  }
51
- `,qn=P.div`
51
+ `,Yn=P.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Xn=ee((function(e,t){const n=Ne(e,t.reimbursementId),r=_.getSignedInUser(),c=fe(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Gt(t.currentTenant),r));const i=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=st(o),i=X(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Be(n,a.type,"")):e(Be(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=X(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Me(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Jn(){const e=Q(),t=ae(),n=J(),r=n.hash.substring(1),c=Ye(),{reimbursementId:d}=ie(),m=_.getSignedInUser(),o=v((R=>V(R))),a=v((R=>Ne(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=nt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:f}=oe(),{isFeatureEnabled:B}=f(x.isLimitedCategoryForReimbursement),[u,T]=h.useState(!1),[D,j]=h.useState(!1),[A,k]=h.useState(!1),{isFeatureEnabled:E}=f(x.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=f(x.isShowDeletedReimbursementsFeatureEnabled),g=v((R=>ge(R,d??""))),U=$t(o),L=Mt(o.userRole),$=a.fetchState;if(h.useEffect((()=>{u||d==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(T(!0),t(Pt(d,!1,I)))}),[u,d,t,$]),h.useEffect((()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?k(!1):k(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),h.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(j(!0),t(Le(!1,B,I,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(Xn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:E,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:A,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Kn=ee((function(e,t){return{remisReviewView:Oe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(q())},onCloseReviewItem:n=>{e(Ht(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Te("approved",r??""));break;case"reject":e(Te("rejected",r??""))}}}}))(Bn);function Qn({tenantEmailDomain:e}){const t=Q(),n=v((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((m=>Oe(m))),c=le(),d=c?.loggedInUserRole?.includes("admin")===!0;return h.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Kn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const Z=tn(),it="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:ea,common:me}=Je.getLocalizedStrings(),ta=ea.reimbursement.bulkActions,na=P.div`
56
+ `,Xn=ee((function(e,t){const n=Ne(e,t.reimbursementId),r=_.getSignedInUser(),c=fe(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Me(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=st(o),i=X(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Vt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Be(n,a.type,"")):e(Be(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=X(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Jn(){const e=Q(),t=ae(),n=J(),r=n.hash.substring(1),c=qe(),{reimbursementId:d}=ie(),m=_.getSignedInUser(),o=v((R=>Z(R))),a=v((R=>Ne(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=nt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:f}=oe(),{isFeatureEnabled:B}=f(x.isLimitedCategoryForReimbursement),[u,T]=h.useState(!1),[D,j]=h.useState(!1),[A,k]=h.useState(!1),{isFeatureEnabled:E}=f(x.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=f(x.isShowDeletedReimbursementsFeatureEnabled),g=v((R=>ge(R,d??""))),U=Mt(o),L=$t(o.userRole),M=a.fetchState;if(h.useEffect((()=>{u||d==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(T(!0),t(Pt(d,!1,I)))}),[u,d,t,M]),h.useEffect((()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?k(!1):k(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),h.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(j(!0),t(Le(!1,B,I,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(Xn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:E,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:A,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Kn=ee((function(e,t){return{remisReviewView:Oe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(Y())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Te("approved",r??""));break;case"reject":e(Te("rejected",r??""))}}}}))(Bn);function Qn({tenantEmailDomain:e}){const t=Q(),n=v((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((m=>Oe(m))),c=le(),d=c?.loggedInUserRole?.includes("admin")===!0;return h.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Kn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const V=tn(),it="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:ea,common:me}=Je.getLocalizedStrings(),ta=ea.reimbursement.bulkActions,na=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-UOzcPsHa.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
- `,aa=ee((function(e,t){const n=Ze(e,Z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=_.getSignedInUser(),d=fe(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((f=>f!=="deleted")));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((f=>f.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:Z,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(q()),e(Ge(o))},onSubtabChange:o=>{e(q()),e(ze(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=X(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=X(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=X(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ue(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(q())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(De("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(De("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(be)&&e(sn(!1))},onEventReceived:o=>{o===it&&e(an())}}}))(jn(Fn));function sa(){const e=Q(),t=ae(),n=J(),r=n.state,c=qe(),[d,m]=h.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;h.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Yt(r.tab.toString());S!=null?t(Ge(S)):console.log("Warning:Not a valid remiListTab");const z=qt(r.subTab.toString());z!=null?t(ze(z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(q())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:i}=a(x.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(x.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(x.isReimbursementCommentingEnabled),{isFeatureEnabled:f}=a(x.isReimbursementBulkActionEnabled),B=_.getSignedInUser(),u=v((S=>V(S))),[T,D]=h.useState(!1),[j,A]=h.useState(!1),k=le(),E=k?.loggedInUserRole?.includes("admin")===!0,I=v((S=>Ze(S,Z,f))),{areTenantIdsInSync:g}=Tn(),U=I.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Re({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:U==="Completed"}),h.useEffect((()=>{!j&&g&&(A(!0),t(ue(Z,!0,l,!1,!0)))}),[j,Z,t,g]),B==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&Xt(u),p=Se(k?.loggedInUserRoleMap),N=Ie(k?.loggedInUserRoleMap),O=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,G=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,W=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,H=v((S=>_e(S.companyState,u.companyId))),K=H?.company.featuresActivationInfo.connectedAccountProvider,ve=S=>{D(S)},{isFeatureEnabled:ot}=a(x.isDebitCardFeatureEnabled),rt=Ve(ot,u),lt=We(u),{remisProcessed:te,remisProcessing:Ae}=v((S=>Jt(S)));h.useEffect((()=>{te===Ae&&d!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:ta.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Qt(d)}]})),t(en()),setTimeout((()=>{t(ue(Z,!0,l,!1,!0,!0))}),3e3),m(null))}),[te,Ae]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${it}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(S,z,ke)=>{S.endsWith(be)?ke.onReimbursementApprovalRulesEventReceived?.(S):z.entity_type==="reimbursement"&&(m(z.operation_type),ke.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(tt,{}):G&&(!R||p)||N&&O?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(re,{analytics:C,onLoad:S=>(z=>z.trackPageLoaded(Qe.Event.reimbursementHome))(S)}):null,s.jsx(at,{isAppContentDrawerOpen:T,handleDrawerToggle:ve}),s.jsxs(na,{windowSize:c,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(q())},children:s.jsx(ra,{onClick:S=>S.stopPropagation(),children:s.jsx(Qn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(aa,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Z,isAdmin:E,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{ve(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:K,isBulkActionEnabled:f,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):W&&p?s.jsx(M,{to:"../setup"}):k!=null&&He(u,k.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=P(Mn)`
64
+ `,aa=ee((function(e,t){const n=Ve(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const c=_.getSignedInUser(),d=fe(c),m=e.tenantState.currentTenantId,o=Z(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((f=>f!=="deleted")));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((f=>f.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:V,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(Y()),e(ze(o))},onSubtabChange:o=>{e(Y()),e(Ge(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=X(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=X(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=X(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ue(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(Y())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(De("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(De("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(be)&&e(sn(!1))},onEventReceived:o=>{o===it&&e(an())}}}))(jn(Fn));function sa(){const e=Q(),t=ae(),n=J(),r=n.state,c=Ye(),[d,m]=h.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;h.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(ze(S)):console.log("Warning:Not a valid remiListTab");const G=Yt(r.subTab.toString());G!=null?t(Ge(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(Y())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:i}=a(x.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(x.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(x.isReimbursementCommentingEnabled),{isFeatureEnabled:f}=a(x.isReimbursementBulkActionEnabled),B=_.getSignedInUser(),u=v((S=>Z(S))),[T,D]=h.useState(!1),[j,A]=h.useState(!1),k=le(),E=k?.loggedInUserRole?.includes("admin")===!0,I=v((S=>Ve(S,V,f))),{areTenantIdsInSync:g}=Tn(),U=I.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:M}=Re({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:U==="Completed"}),h.useEffect((()=>{!j&&g&&(A(!0),t(ue(V,!0,l,!1,!0)))}),[j,V,t,g]),B==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&Xt(u),p=Se(k?.loggedInUserRoleMap),N=Ie(k?.loggedInUserRoleMap),O=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,z=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,W=v((S=>_e(S.companyState,u.companyId))),K=W?.company.featuresActivationInfo.connectedAccountProvider,ve=S=>{D(S)},{isFeatureEnabled:ot}=a(x.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=He(u),{remisProcessed:te,remisProcessing:Ae}=v((S=>Jt(S)));h.useEffect((()=>{te===Ae&&d!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:ta.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Qt(d)}]})),t(en()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),m(null))}),[te,Ae]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${it}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(S,G,ke)=>{S.endsWith(be)?ke.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ke.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(tt,{}):z&&(!R||p)||N&&O?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(re,{analytics:C,onLoad:S=>(G=>G.trackPageLoaded(Qe.Event.reimbursementHome))(S)}):null,s.jsx(at,{isAppContentDrawerOpen:T,handleDrawerToggle:ve}),s.jsxs(na,{windowSize:c,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(Y())},children:s.jsx(ra,{onClick:S=>S.stopPropagation(),children:s.jsx(Qn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(aa,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:V,isAdmin:E,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{ve(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:K,isBulkActionEnabled:f,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:M,...mt})]})]}):H&&p?s.jsx($,{to:"../setup"}):k!=null&&We(u,k.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=P($n)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,la=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:C,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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(_n),ma=()=>{const e=Ln(),t=Q(),n=J(),{tenantEmailDomain:r}=ie(),c=et(),[d,m]=h.useState(!1),o=v((A=>V(A))),a=_.getSignedInUserTenant(r)?.companyId??o.companyId,i=_.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=le(),f=Se(y?.loggedInUserRoleMap),B=Ie(y?.loggedInUserRoleMap),u=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,T=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{m(A)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return T&&B&&u?s.jsx(M,{to:"../../../reimbursements"}):D&&f?s.jsx(M,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!D||o.userReimbursementInfo&&B&&u===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:A=>(k=>k.trackPageLoaded(Qe.Event.reimbursementPromoPage))(A)}),s.jsx(at,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(la,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Oa(){const e=v((H=>V(H))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=et(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=oe(),{isFeatureEnabled:o}=m(x.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(x.isDebitCardFeatureEnabled),i=Ve(a,e),l=We(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),f=fn(t?.loggedInUserRoleMap),B=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=Se(t?.loggedInUserRoleMap),T=B&&u,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,j=D&&Sn(t?.loggedInUserRoleMap),A=$n(e,o,a)&&!b,k=A&&In(t?.loggedInUserRoleMap),E=yn(t?.loggedInUserRoleMap),I=Rn(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),U=D&&I,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=An(t?.loggedInUserRoleMap),R=kn(t?.loggedInUserRoleMap),p=Ie(t?.loggedInUserRoleMap),N=A&&$,{tenantEmailDomain:O}=ie(),G=J(),W=n===!0&&(u||p&&d);return s.jsxs(dt,{children:[G.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"verification",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"verification"})}),s.jsx(w,{path:"setup",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"setup"})}),s.jsx(w,{path:"promo",element:s.jsx(ma,{})}),s.jsx(w,{path:"approval-rules/*",element:T?s.jsx(On,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:N,tenantEmailDomain:O??""})}),W&&s.jsx(w,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(w,{path:"/*",element:s.jsx(tt,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../promo"})}),c&&u&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):G.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"new",element:s.jsx(Ue,{})}),s.jsx(w,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(w,{path:":reimbursementId/edit",element:s.jsx(Ue,{})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(w,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]})}export{Oa as default};
68
+ `,la=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:C,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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(_n),ma=()=>{const e=Ln(),t=Q(),n=J(),{tenantEmailDomain:r}=ie(),c=et(),[d,m]=h.useState(!1),o=v((A=>Z(A))),a=_.getSignedInUserTenant(r)?.companyId??o.companyId,i=_.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=le(),f=Se(y?.loggedInUserRoleMap),B=Ie(y?.loggedInUserRoleMap),u=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,T=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{m(A)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return T&&B&&u?s.jsx($,{to:"../../../reimbursements"}):D&&f?s.jsx($,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!D||o.userReimbursementInfo&&B&&u===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:A=>(k=>k.trackPageLoaded(Qe.Event.reimbursementPromoPage))(A)}),s.jsx(at,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(la,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Oa(){const e=v((W=>Z(W))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=et(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=oe(),{isFeatureEnabled:o}=m(x.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(x.isDebitCardFeatureEnabled),i=Ze(a,e),l=He(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),f=fn(t?.loggedInUserRoleMap),B=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=Se(t?.loggedInUserRoleMap),T=B&&u,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,j=D&&Sn(t?.loggedInUserRoleMap),A=Mn(e,o,a)&&!b,k=A&&In(t?.loggedInUserRoleMap),E=yn(t?.loggedInUserRoleMap),I=Rn(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),U=D&&I,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=An(t?.loggedInUserRoleMap),R=kn(t?.loggedInUserRoleMap),p=Ie(t?.loggedInUserRoleMap),N=A&&M,{tenantEmailDomain:O}=ie(),z=J(),H=n===!0&&(u||p&&d);return s.jsxs(dt,{children:[z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"verification",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"verification"})}),s.jsx(w,{path:"setup",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"setup"})}),s.jsx(w,{path:"promo",element:s.jsx(ma,{})}),s.jsx(w,{path:"approval-rules/*",element:T?s.jsx(On,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:N,tenantEmailDomain:O??""})}),H&&s.jsx(w,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(w,{path:"/*",element:s.jsx(tt,{})}),t!=null&&We(e,t?.loggedInUserRoleMap)&&s.jsx(w,{path:"*",element:s.jsx($,{to:"../promo"})}),c&&u&&s.jsx(w,{path:"*",element:s.jsx($,{to:"../setup"})})]}):z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"new",element:s.jsx(Ue,{})}),s.jsx(w,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(w,{path:":reimbursementId/edit",element:s.jsx(Ue,{})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(w,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]})}export{Oa as default};
@@ -0,0 +1 @@
1
+ import{j as p}from"./liveblocks-DTaiayIC.js";import{g as W,h as De,u as Fe,i as Oe,j as d,l as Ae,n as Pe,o as ee}from"./core-DA_GbUVO.js";import{fE as $,Dt as R,U1 as Ee,l_ as le,tA as ce,up as O,lF as Le,lO as A,lG as P,kJ as E,kA as L,kz as Me,CD as ie,uu as Be,bq as ve,U2 as Ve,bn as xe,DQ as ze,U3 as Ge,U4 as Ye,ci as S,Cw as He,U5 as ae,U6 as qe,U7 as Ne,U8 as $e,U9 as Qe,Ua as Ze,Ub as Je,Uc as Xe,Ud as Ke,Ue as We,Uf as ea,Ug as aa,Uh as sa,Ui as U,Uj as M,Uk as B,Ul as v,Um as V,Un as x,Uo as z,Up as G,Uq as Y,Ur as H,eb as ta,Du as oa,Dh as se,Di as te,DA as na,Dm as oe,DG as ra,Us as la,Ut as ca,Uu as ia,Uv as da,Uw as pa,Ux as _a,Uy as fa,Uz as ma,UA as ua,UB as ba,dY as ha,dX as ya}from"./zeni-epic-state-cafsD4rZ.js";import{an as wa,ao as Ca,ap as ga,a as Sa,a1 as Ia,M as de,y as q,z as pe,aq as Ra,V as Ta,d as Ua,ar as ja,as as ka,a8 as Da,h as N,S as Fa,v as Oa,p as _e,at as Aa,au as Pa,av as Ea}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import La from"./NotFoundScreen-DFQDCCRn.js";import{F as Ma}from"./FeaturePreviewScreen-BFU7MG_7.js";import{a as u}from"./sentry-BRmieicQ.js";import{u as Ba}from"./useInitialThreadRequest-BJ6-q-Ev.js";import{t as ne,a as re,b as va}from"./routePaths-DeWRBZpS.js";import{M as Va}from"./MobileAppDrawer-cBt39NZW.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.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]="201170a5-b4ea-4017-8173-4e403a9d41db",e._sentryDebugIdIdentifier="sentry-dbid-201170a5-b4ea-4017-8173-4e403a9d41db")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=$(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:N,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(U(a)),(I(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(V({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(V({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=S(t);l?(e(Xe({viewMode:a})),e(Ke({viewMode:a}))):r?(e(We({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(U(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(U(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(U(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e(Qe({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(qe({projectsToFilterOut:a})):I(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):e($e({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(Ye(a))},onUpdateReportFormat:a=>{za(e),e(Ge(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"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Aa);function Ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Pa(_),a=De(),s=Fe(),t=W(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(q.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=u.useState(!1),[Q,fe]=u.useState(!1),{isFeatureEnabled:Z}=l(q.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>$(n))),me=k.masterTOSInfo?.isMasterTOSAccepted??!1,ue=k.company?.companyInfo.firstMonthOfFY??1,be=Ba(Z?k?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),D=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),g=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),F=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(O(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Q&&C==="Completed"&&b&&(s(O(i.userId,!1,!0,!1)),fe(!0))}),[c,Q,C,b]),u.useEffect((()=>{if(c&&F.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(D){case"profit_and_loss":case"profit_and_loss_by_classes":s(Be(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(ie());break;case"balance_sheet":s(Me(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Le(h.timeframe))}}),[c,D,F,b,T,g]);const J=Ta(),Ce=J?.loggedInUserRole!=null&&ve(J?.loggedInUserRole)!==!0,[ge,Se]=u.useState(!1),X=n=>{Se(n)},Ie=Ua(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:Ue}=W(),K=wa(Ue??"")==="reports",je=Ca(Te),ke=u.useMemo((()=>K?xa:void 0),[K]);ga({canFetchSuggestedQuestions:je,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Da,{analytics:N,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Va,{isAppContentDrawerOpen:ge,handleDrawerToggle:X}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:D,analytics:N,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:F,handleDrawerToggle:X,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Z,initialOpenThreadRequest:be})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>$(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(q.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ma,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ya,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-DTaiayIC.js";import{z as j,a8 as v,h as u,S as E,e1 as N,M as k,y as C}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import g from"./NotFoundScreen-DFQDCCRn.js";import{a as c}from"./sentry-BRmieicQ.js";import{u as I,j as h,h as F,g as L,l as _,n as T,o as f,N as y}from"./core-DA_GbUVO.js";import{fE as U,a17 as w,a18 as p,D8 as P,p_ as V,a19 as z,D6 as G}from"./zeni-epic-state-cafsD4rZ.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.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]="3fd17aa0-d4b3-43f1-8e2c-3f6670937f80",e._sentryDebugIdIdentifier="sentry-dbid-3fd17aa0-d4b3-43f1-8e2c-3f6670937f80")}catch{}})();const M=_((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(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(N),R=()=>{const e=I(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),x=L(),d=j.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),b=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(v,{analytics:u,onLoad:o=>(S=>S.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:l,location:x,currentTenant:r,companyName:D,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -0,0 +1,25 @@
1
+ import{j as E}from"./liveblocks-DTaiayIC.js";import{a as I}from"./sentry-BRmieicQ.js";import{i as M,u as q,h as W,g as z,j as h,l as Z}from"./core-DA_GbUVO.js";import{V$ as be,W0 as we,l_ as H,rS as Je,s2 as Ne,sk as je,si as Oe,sl as Pe,so as _e,W1 as Ve,fE as F,U_ as oe,W2 as de,gZ as X,cB as Q,cC as ee,Ey as ge,W3 as Se,EC as Me,Sn as ie,Ew as Ge,Eq as Re,W4 as ue,Ei as $e,Eh as Fe,Ec as Ue,En as Ye,ED as Ke,W5 as U,W6 as re,Ej as We,U$ as te,gN as fe,ET as Ee,EM as De,W7 as ke,rY as Ce,EG as ye,EE as ve,W8 as Ae,E_ as Ie,EX as xe,EH as Te,EZ as Be}from"./zeni-epic-state-cafsD4rZ.js";import{a4 as ae,aY as ne,aZ as ze,z as qe,l as Ze,a7 as He,a8 as le,h as O,av as Xe,a_ as Qe,p as _,G as he,r as me,a$ as et,b0 as tt,b1 as at}from"./index-CsnAk3jU.js";import{n as pe}from"./mui-yMDYeeMr.js";import{p as nt}from"./pathToGoBack-nmNIndUw.js";import K from"./NotFoundScreen-DFQDCCRn.js";import{c as V}from"./routePaths-DeWRBZpS.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]="5500451b-4c9d-4e75-9d8e-b25373655fa8",e._sentryDebugIdIdentifier="sentry-dbid-5500451b-4c9d-4e75-9d8e-b25373655fa8")}catch{}})();function bt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:d}={}){const{accrualId:l}=M(),s=t??l,n=q(),u=W(),a=z(),{accrual:c,actionFetchState:o,detailFetchState:f,localData:D}=h((i=>be(i,s??""))),C=h((i=>we(i))),x=h((i=>H(i))),r=I.useCallback((()=>{const i=ae(a.state?.pathnameStackToGoBack);u(i.poppedPathname??nt(4),{state:{pathnameStackToGoBack:i.newStack}})}),[a.state,u]),k=I.useRef(!1);return I.useEffect((()=>{o.fetchState!=="In-Progress"&&k.current&&o.fetchState==="Completed"&&(k.current=!1,r())}),[o.fetchState,r]),I.useEffect((()=>{s!=null&&c==null&&f.fetchState==="Not-Started"&&n(Je(s))}),[s,c,f.fetchState]),I.useEffect((()=>{n(Ne({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(K,{}):c==null?f.fetchState==="Not-Started"||f.fetchState==="In-Progress"?E.jsx(ne,{}):E.jsx(K,{}):E.jsx(ze,{isRenderedInPanel:e,accrual:c,actionFetchState:o.fetchState,isAccountingClassesEnabled:x,localData:D,newAccrualAccountsView:C,onAccrualFormChange:(i,m)=>{n(Ve({accrualId:i,localData:m}))},onAccrualFormClear:i=>{n(_e({accrualId:i}))},onApproveAndPost:i=>{n(Pe(s,i))},onNavigateBack:d??r,onRevert:(i,m)=>{k.current=!0,n(Oe(s,i,m))},onSkip:(i,m)=>{n(je(s,i,m))}})}const lt=he.getLocalizedStrings(),st=Z((function(e,t){const d=de(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:d.linkBillExpenseView,transactions:d.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:d,location:l}=t;return{onTransactionSelect(s){e(Se({selectedTransaction:s}))},onBackClick:()=>{d("..",{relative:"path"})},onCancel(){e(Se({selectedTransaction:void 0})),e(Me()),d("..",{relative:"path"})},onTransactionClick:s=>{const n=`${V(s,t.tenantEmailDomain)}`,u=_(l.state?.pathnameStackToGoBack,l.pathname);d(n,{state:{pathnameStackToGoBack:u}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ge(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(Qe),wt=({setShouldNavigateBack:e})=>{const t=W(),d=z(),{scheduleDetailId:l,tenantEmailDomain:s}=M(),{scheduleType:n}=M();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const u=h((r=>F(r))),a=oe(n)??"accrued_expenses",c=qe.getSignedInUser();if(c==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=h((r=>de(r,a))),f=o.selectedJELinkRowIndex,D=h((r=>X(r,u.companyId))),C=Ze(o.updateStatus.fetchState);I.useEffect((()=>{C==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[C,o.updateStatus.fetchState]),I.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),I.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const x=o.linkBillExpenseView.fetchState==="Completed";return E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(He,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&f!=null?E.jsxs(E.Fragment,{children:[x===!0?E.jsx(le,{analytics:O,onLoad:()=>{ct(o,a,D)}}):null,E.jsx(st,{signedInUser:c,attachmentEndPoint:`${Xe}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:d,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:O,controllerUserDetails:D,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[f]})]}):null})},Le=e=>{const t=lt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},ct=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:u}=e.linkBillExpenseView,a=u.some((f=>f.isRecommendedTransaction===!0)),c=Q(d.controllers),o=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Le(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:c,controllerUserIds:o})},ot=pe.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 0 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,dt=Z((function(e){const t=F(e),d=e.entityAutoCompleteState.autoCompleteText.common,l=ue(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:d,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:d,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=ae(l.state?.pathnameStackToGoBack);n.poppedPathname==null?d("../schedules/accrued_expenses"):d(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ge(s,n))},onDelete:n=>{e(We(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,u)=>{n.trim().length>=2?e(re({searchString:n,entityType:u,searchOrigin:"common"})):n.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onEditAmount:(n,u)=>{e(Ke(s,n,u))},onJELinkClick:n=>{e(Ye({selectedJELinkRowIndex:n})),d("./edit_link")},onCancelAccrual:(n,u,a)=>{e(Ue(n,u,a))},onTransactionClick:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,u,a)=>{const{scheduleDetailsAccruedExpensesSection:c}=n,{amount:o,memo:f,months:D,scheduleAccruedExpenseCategory:C,scheduleClass:x,scheduleExpenseCategory:r,startDate:k,vendor:i}=c,m=x.selectedOption!=null?t.classList.find((T=>T.classId===x.selectedOption)):void 0,S=r.selectedOption!=null?t.accountList.find((T=>T.qboId===r.selectedOption)):void 0,L=C.selectedOption!=null?t.accruedAccountList.find((T=>T.qboId===C.selectedOption)):void 0,b=D?.selectedOption;e($e({scheduleType:s,localData:u,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||S?.accountId==null||t.isAccountingClassesEnabled!==!1&&m?.classId==null||L==null||i.selectedOption==null||f==null||o==null&&o==0||k==null||b==null||e(Fe({scheduleType:s}))}}}))(et),Jt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:d=!1,scheduleDetailIdOverride:l,onPanelNavigateBack:s}={})=>{const[n,u]=I.useState(!1),a=e??n,c=t??u,o=W(),f=z(),D=q(),C=me(),{tenantEmailDomain:x}=M(),[r,k]=I.useState(!1);if(x==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=M(),m=l??i;let S;m!=="new"&&(S=m);const L=it(m),b=h((B=>B.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),T="accrued_expenses",y=h((B=>de(B,"accrued_expenses"))),w=h((B=>ie(B))),J=h((B=>B.classListState.fetchState)),N=h((B=>H(B))),v=w!=="Completed"||J!=="Completed";I.useEffect((()=>{r===!1&&v?(D(Ge(T,S)),k(!0)):v===!1&&r===!1&&m!=="new"&&(D(Re(T,m)),k(!0))}),[r]);const j=h((B=>F(B))),P=h((B=>X(B,j.companyId))),A=y.fetchState,G=y.allAccountList,R=y.allClassList,$=y.allAccruedAccountList,Y=y.scheduleAccruedDetailsLocalData;if(L!==!0||y.fetchState==="Error")return E.jsx(K,{});const g=A==="Completed"&&r===!0,p=y.selectedJEAccruedSchedule!=null;return A==="Completed"||A==="Not-Started"||d===!0&&p?E.jsxs(ot,{children:[g===!0?E.jsx(le,{analytics:O,onLoad:()=>{ut(y,T,P)}}):null,E.jsx(dt,{isRenderedInPanel:d,onPanelNavigateBack:s,setShouldNavigateBack:c,scheduleAccruedDetailsView:y,location:f,navigate:o,classList:R,accountList:G,shouldNavigateBack:a,accruedAccountList:$,scheduleLocalData:Y,selectedJEScheduleKey:b,scheduleDetailId:S,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:x,analytics:O,controllerUserDetails:P,isAccountingClassesEnabled:N,status:y.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ne,{})},it=e=>e!=null,ut=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=Q(d.controllers),n=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{...Le(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},rt=pe.div`
10
+ display: flex;
11
+ min-height: 100%;
12
+ width: 100%;
13
+ flex: 1 0 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,se=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ht=Z((function(e){const t=F(e),d=te(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:d}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u="fixed_assets",a=n.flatMap((c=>c.error)).filter((c=>!!c))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const c=ae(t.location.state?.pathnameStackToGoBack);c.poppedPathname==null?d("../schedules/fixed_assets"):t.navigate(c.poppedPathname,{state:{pathnameStackToGoBack:c.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:c=>{e(Be(u,c,a.length>0))},onDelete:c=>{e(Te(u,c))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(u,t.selectedJEScheduleKey))},onEditAmount:(c,o)=>{e(Ie(u,c,o))},onJELinkClick:c=>{e(Ae({selectedJELinkRowIndex:c})),d("./edit_link")},onTransactionClick:c=>{const o=`${V(c,t.tenantEmailDomain)}`,f=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:f,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:c=>{const o=`${V(c,t.tenantEmailDomain)}`,f=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:f}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(c,o)=>{c.trim().length>=2?e(re({searchString:c,entityType:o,searchOrigin:"common"})):c.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(c,o)=>{const{scheduleDetailsFixedAssetsSection:f,scheduleDetailsListSection:D}=c,{scheduleClass:C,scheduleExpenseCategory:x,accumulatedDepreciationCategory:r,assetId:k,months:i,startDate:m,postingDate:S,vendor:L}=f,b=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((A=>A.id===L?.selectedOption)):void 0,T={id:b?.zeniId??L?.selectedOption??"",name:b?.name??L?.defaultOptions.find((A=>A.value===L?.selectedOption))?.label??"",logo:b?.logo},y=C.selectedOption!=null?t.classList.find((A=>A.classId===C.selectedOption)):void 0,w=x.selectedOption!=null?t.accountList.find((A=>A.qboId===x.selectedOption)):void 0,J=r.selectedOption!=null?t.depAccountList.find((A=>A.qboId===r.selectedOption)):void 0,N=i?.selectedOption,v=D.map(((A,G)=>({...t.scheduleLocalData.jeScheduleDetails[G],amount:{...t.scheduleLocalData.jeScheduleDetails[G].amount,amount:A.amount}}))),j=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,P=S.type==="lastDayOfMonth"||void 0;e(ye({scheduleType:u,localData:{selectedAccount:w?.accountId,selectedClass:y?.classId,selectedAccumulatedDepreciationCategory:J?.accountId,selectedDate:m,selectedMonths:N,assetId:k,jeScheduleDetails:v,lastDayOfMonth:P,selectedDayOfMonth:j,selectedVendor:T},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||J?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||w?.accountId==null||t.isAccountingClassesEnabled!==!1&&y?.classId==null||m==null||N==null||P!==!0&&j==null||e(ve({scheduleType:u}))}}}))(tt),Nt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelNavigateBack:d}={})=>{const l=W(),s=z(),n=q(),u=me(),{tenantEmailDomain:a}=M(),[c,o]=I.useState(!1),{scheduleDetailId:f}=M(),D=t??f,C=s.state?.message==="expenseAutomation",x=mt(D),r=h((g=>g.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{r!=null&&r.length!==0||D!=="new"||l("../schedules/fixed_assets")}),[r,D]);const k="fixed_assets",i=h((g=>te(g,k))),m=h((g=>g.entityAutoCompleteState.autoCompleteText.common)),S=h((g=>ue(g,"common"))),L=h((g=>ie(g))),b=h((g=>g.classListState.fetchState)),T=h((g=>H(g))),y=h((g=>fe(g).selectedPeriod)),w=L!=="Completed"||b!=="Completed";I.useEffect((()=>{c===!1&&w?(n(Ee(k,R,!0)),o(!0)):w===!1&&c===!1&&(n(De(k,D==="new"?void 0:D,!0)),o(!0))}),[c]),I.useEffect((()=>{if(i.markAsCompleteStatus.fetchState==="Completed")if(n(ke()),C===!0){const{month:g,year:p}=y;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else l("../schedules/fixed_assets")}),[i.markAsCompleteStatus.fetchState]);const J=h((g=>F(g))),N=h((g=>X(g,J.companyId))),v=i.fetchState,j=i.allAccountList,P=i.allClassList,A=i.allDepreciationAccountList,G=i.scheduleDetailsLocalData.fixed_assets;let R;if(D!=="new"&&(R=D),x!==!0||i.fetchState==="Error")return E.jsx(K,{});const $=v==="Completed"&&c===!0,Y=i.selectedJEScheduleTransaction!=null;return v==="Completed"||e===!0&&Y?E.jsxs(rt,{children:[$===!0?E.jsx(le,{analytics:O,onLoad:()=>{St(i,k,N)}}):null,E.jsx(ht,{isRenderedInPanel:e,onPanelNavigateBack:d,location:s,navigate:l,classList:P,vendorSearchEntityAutoCompleteView:S,vendorSearchAutoCompleteData:{autoCompleteText:m,entityAutoCompleteView:S},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{n(Ce(g,p))},accountList:j,depAccountList:A,scheduleLocalData:G,selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:i.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:u,tenantEmailDomain:a,analytics:O,controllerUserDetails:N,isAccountingClassesEnabled:T,status:i.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},mt=e=>e!=null,pt=e=>({transactionDate:e.date.format(se),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),St=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...pt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(se)??null,endMonth:a.endDate?.format(se)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:u})},gt=pe.div`
18
+ display: flex;
19
+ min-height: 100%;
20
+ width: 100%;
21
+ flex: 1 0 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,ce=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ft=Z((function(e,t){const d=F(e),l=te(e,t.scheduleTab);return{tenantName:d.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=ae(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?d("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Be(t.scheduleTab,a,u.length>0))},onDelete:a=>{e(Te(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,c)=>{e(Ie(t.scheduleTab,a,c))},onJELinkClick:a=>{e(Ae({selectedJELinkRowIndex:a})),d("./edit_link")},onTransactionClick:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,c)=>{a.trim().length>=2?e(re({searchString:a,entityType:c,searchOrigin:"common"})):a.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(a,c)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:f}=a,{scheduleClass:D,scheduleExpenseCategory:C,months:x,startDate:r,postingDate:k,vendor:i}=o,m=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((v=>v.id===i?.selectedOption)):void 0,S={id:m?.zeniId??i?.selectedOption??"",name:m?.name??i?.defaultOptions.find((v=>v.value===i?.selectedOption))?.label??"",logo:m?.logo},L=D.selectedOption!=null?t.classList.find((v=>v.classId===D.selectedOption)):void 0,b=C.selectedOption!=null?t.accountList.find((v=>v.qboId===C.selectedOption)):void 0,T=x?.selectedOption,y=f.map(((v,j)=>({...t.scheduleLocalData.jeScheduleDetails[j],amount:{...t.scheduleLocalData.jeScheduleDetails[j].amount,amount:v.amount}}))),w=k.type==="day"?k.dayOfMonth?k.dayOfMonth:1:void 0,J=k.type==="lastDayOfMonth"||void 0,N={selectedAccount:b?.accountId,selectedClass:L?.classId,selectedDate:r,selectedMonths:T,jeScheduleDetails:y,lastDayOfMonth:J,selectedVendor:S,selectedDayOfMonth:w};e(ye({scheduleType:t.scheduleTab,localData:N,selectedJeScheduleDetailId:t.scheduleDetailId})),c!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||b?.accountId==null||t.isAccountingClassesEnabled!==!1&&L?.classId==null||r==null||T==null||J!==!0&&w==null||e(ve({scheduleType:t.scheduleTab}))}}}))(at),jt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:d,onPanelNavigateBack:l}={})=>{const s=W(),n=z(),u=q(),a=me(),{tenantEmailDomain:c}=M(),[o,f]=I.useState(!1),D=n.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:x}=M(),r=t??x,k=Et(d??C,r),i=h((p=>p.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{i!=null&&i.length!==0||r!=="new"||s("../schedules/prepaid_expenses")}),[i,r]);const m=d??oe(C)??"prepaid_expenses",S=h((p=>te(p,m))),L=h((p=>p.entityAutoCompleteState.autoCompleteText.common)),b=h((p=>ue(p,"common"))),T=h((p=>ie(p))),y=h((p=>p.classListState.fetchState)),w=h((p=>H(p))),J=h((p=>fe(p).selectedPeriod)),N=T!=="Completed"||y!=="Completed";I.useEffect((()=>{o===!1&&N?(u(Ee(m,$,!0)),f(!0)):N===!1&&o===!1&&(u(De(m,r==="new"?void 0:r,!0)),f(!0))}),[o]),I.useEffect((()=>{if(S.markAsCompleteStatus.fetchState==="Completed")if(u(ke()),D===!0){const{month:p,year:B}=J;s(`../../month_end_close_checks/review/je_schedules/${p}-${B}`)}else s("../schedules/prepaid_expenses")}),[S.markAsCompleteStatus.fetchState]);const v=h((p=>F(p))),j=h((p=>X(p,v.companyId))),P=S.fetchState,A=S.allAccountList,G=S.allClassList,R=S.scheduleDetailsLocalData;let $;if(r!=="new"&&($=r),k!==!0||S.fetchState==="Error")return E.jsx(K,{});const Y=P==="Completed"&&o===!0,g=S.selectedJEScheduleTransaction!=null;return P==="Completed"||e===!0&&g?E.jsxs(gt,{children:[Y===!0?E.jsx(le,{analytics:O,onLoad:()=>{kt(S,m,j)}}):null,E.jsx(ft,{isRenderedInPanel:e,onPanelNavigateBack:l,location:n,vendorSearchEntityAutoCompleteView:b,vendorSearchAutoCompleteData:{autoCompleteText:L,entityAutoCompleteView:b},usedInExpenseAutomation:D,removeJeScheduleTransactionKey:(p,B)=>{u(Ce(p,B))},expenseAutomationSelectedPeriod:J,navigate:s,classList:G,accountList:A,scheduleLocalData:R[m],selectedJEScheduleKey:i,scheduleDetailId:$,selectedScheduledJournalEntries:S.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:c,scheduleTab:m,analytics:O,controllerUserDetails:j,isAccountingClassesEnabled:w,status:S.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},Et=(e,t)=>oe(e)!=null&&t!=null,Dt=e=>({transactionDate:e.date.format(ce),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),kt=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Dt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(ce)??null,endMonth:a.endDate?.format(ce)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:u})};export{bt as J,Nt as S,Jt as a,jt as b,wt as c};