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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/assets/AddressRoutes-BgG3fjpG.js +1 -0
  2. package/dist/assets/{AddressScreen-C2Pdt_bq.js → AddressScreen-B5d2oxIz.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-Bpnjeq7V.js → AiCfoScreen-D9r_UxpW.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-WIACRA6B.js → BillPayApprovalRoutes-Bq753rTI.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-Cl3RqP7N.js → BillPayRoutes-BPjOyQd9.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BaDjUQw1.js → BusinessVerificationPageScreen-BW9_l0ih.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-CC5bDkHl.js → ChargeCardRoutes-Bzb0MJ_j.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-DSjn5RV_.js → CompanyPassportScreen-DIVButb9.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-BmM-FOt_.js → ConnectionAuthScreen-CBVzNRAr.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CSGzUise.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-B3jdgE0f.js → CustomerOnboardingRoutes-CAhuciQG.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DdT_Y42s.js → DashboardRoutes-D38asGsh.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-DamwtKVm.js → DefaultTenantHome-BDfv3l49.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-Dq7eTlwY.js → DomesticWireDetailScreen-BH4s0VZE.js} +1 -1
  15. package/dist/assets/{DrawerScreen-CZJI9dis.js → DrawerScreen-3vtWe4MN.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-CCZjRoaK.js → EntityDetailRoutes-BRxE1gXs.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-C0g_h5Bq.js → ExpenseAutomationRoutes-BGWKWxKi.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-Dtyet701.js → FeaturePreviewScreen-Beu7_BUA.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-OTGKhSFN.js → MagicLinkRoutes-DI6rpk7d.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-DVEUwpX5.js → MagicLinkSignInScreen-BytCCWE1.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-D25b_bdO.js → MobileAppDrawer-BuJW5cST.js} +1 -1
  22. package/dist/assets/NotFoundScreen-CKucympc.js +1 -0
  23. package/dist/assets/{NotificationRoutes-BoTdon-B.js → NotificationRoutes-BJIlt9ug.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-B2ImYfbh.js → PandLWithForecastRoutes-CPbktWsV.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-CVo7q-3K.js → PeopleRoutes-Cxj6W34l.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-CEQsEs7o.js → PerformanceRoutes-rJuJzOMj.js} +1 -1
  27. package/dist/assets/{Preview-Unt76wQt.js → Preview-C-kYO1Sd.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-CgvXukjZ.js → QBOConnectionScreen-BmvFp4HA.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-2ts8iKsm.js → ReferralListScreen-Bcsyrif0.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRoutes-SIsIp9uZ.js → ReimbursementApprovalRoutes-IFnoykyS.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-EvJFbHZ_.js → ReimbursementApprovalRuleDetailScreen-CTc4fu7W.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-Ddbd312R.js → ReimbursementRoutes-CiM5_hoN.js} +1 -1
  33. package/dist/assets/{ReportsRoutes-Cy_IpMxr.js → ReportsRoutes-DW4Lvua2.js} +1 -1
  34. package/dist/assets/{RewardsRoutes-BYadKe9G.js → RewardsRoutes-DCemfpba.js} +1 -1
  35. package/dist/assets/{ScreenRoutes-bFwU6xQj.js → ScreenRoutes-CoeN_n6E.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-n0JcYOBn.js → SettingsRoutes-CrNZ8nLT.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-BUHI1NUC.js → SetupPagesScreen-B7fAoVY5.js} +1 -1
  38. package/dist/assets/{SignInScreen-D17U0n02.js → SignInScreen-COmELmB6.js} +1 -1
  39. package/dist/assets/{SignOutScreen--k3X_izn.js → SignOutScreen-DqP8i8ew.js} +1 -1
  40. package/dist/assets/{TaskListScreen-CzZw-t2z.js → TaskListScreen-Vx58OWx-.js} +1 -1
  41. package/dist/assets/{TaskRoutes-CRYjlzbB.js → TaskRoutes-CKnEGxnr.js} +1 -1
  42. package/dist/assets/TransactionDetailRoutes-dAhP_gCB.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-Cn7pRp3Q.js → TransactionDetailScreen-BabMxJp1.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-D12F9dhf.js → TransactionListRoutes-BpC1aNv-.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-BUlDXs_P.js → TreasuryRoutes-A47Z9LBV.js} +1 -1
  46. package/dist/assets/{VendorsRoutes-CD5smolJ.js → VendorsRoutes-B5epP984.js} +1 -1
  47. package/dist/assets/{WiseConfirmationScreen-DPEiJ8-l.js → WiseConfirmationScreen-CogAVWSI.js} +1 -1
  48. package/dist/assets/{ZeniAccountRoutes-DcXqQtKj.js → ZeniAccountRoutes-6OZDjfTY.js} +1 -1
  49. package/dist/assets/{ZeniAccountStatementScreen-BuItZxm7.js → ZeniAccountStatementScreen-sqtSdDtO.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-CHBH046Z.js → accountMappingHelper-DQry8vuU.js} +1 -1
  51. package/dist/assets/{analytics-CjaLm2aW.js → analytics-C_YuIGuR.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CN7Nq3lV.js → analyticsHelper-DgG_eN0U.js} +1 -1
  53. package/dist/assets/{core-CNW5dhSg.js → core-DYR9i5id.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-B2xCvVcj.js → decodeURIComponentSafe-jUJvXFoR.js} +1 -1
  55. package/dist/assets/{dnd-ClE4Qbeo.js → dnd-YBJMUV5c.js} +1 -1
  56. package/dist/assets/{empty-Cv4UzZSs.js → empty-CThspqRB.js} +1 -1
  57. package/dist/assets/{empty-CzR1IqVo.js → empty-DMHTn4jL.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-BfLoCNri.js → emptyVideoElement-uklfgsNM.js} +1 -1
  59. package/dist/assets/{epic-lJxVH4pZ.js → epic-VigLk0vx.js} +1 -1
  60. package/dist/assets/{getLocaleForTenant-BfZYl7x_.js → getLocaleForTenant-yVGyr-Ah.js} +1 -1
  61. package/dist/assets/{index-D49e6fWF.js → index-7Qcu9V7y.js} +7 -7
  62. package/dist/assets/{index-2XXzCcMZ.js → index-B1RNmiHY.js} +1 -1
  63. package/dist/assets/{index-xdNu2kl-.js → index-BQHcqGwi.js} +2 -2
  64. package/dist/assets/{index-CloG9Nyt.js → index-CSC7JM42.js} +1 -1
  65. package/dist/assets/{index-Cme59vnn.js → index-CZ0AqUEL.js} +1 -1
  66. package/dist/assets/{index-VPfWeHIr.js → index-DSYahTVA.js} +1 -1
  67. package/dist/assets/{index-B3PgHzaN.js → index-YWr-biWP.js} +1 -1
  68. package/dist/assets/{lexical-DEVzuyw-.js → lexical-B0v2dFpm.js} +1 -1
  69. package/dist/assets/{liveblocks-BDeoGIJv.js → liveblocks-6kHh7NcJ.js} +1 -1
  70. package/dist/assets/{lottie-CQ8A0eX4.js → lottie-D_WL55u0.js} +1 -1
  71. package/dist/assets/{mui-B2x4GL6c.js → mui-DDBWVnth.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BIOg1-1o.js → pathToGoBack-BQooRrY4.js} +1 -1
  73. package/dist/assets/{pdf-BMb5In2P.js → pdf-BJwNP7gO.js} +3 -3
  74. package/dist/assets/{pdf-lib-C4_ugcOf.js → pdf-lib--WQ5Q4Dt.js} +1 -1
  75. package/dist/assets/{plaid-HF30yiu5.js → plaid-CMj0RgAb.js} +1 -1
  76. package/dist/assets/{pusher-DH-SktSp.js → pusher-C5xrXBSE.js} +1 -1
  77. package/dist/assets/{react-WbcpzszY.js → react-B5brvPoB.js} +1 -1
  78. package/dist/assets/{react-BM3p6urJ.js → react-BDJF6e3A.js} +1 -1
  79. package/dist/assets/{react-8CEPj-fD.js → react-BqYh17ej.js} +1 -1
  80. package/dist/assets/{react-CEJ6LOB9.js → react-Bqgi61Ge.js} +1 -1
  81. package/dist/assets/{react-TPqJ8Ki2.js → react-CLvKOlzM.js} +1 -1
  82. package/dist/assets/{react-ChWdjMb7.js → react-Q8-xl0Hz.js} +1 -1
  83. package/dist/assets/{recharts-BNFkXXxt.js → recharts-tHwhBmfE.js} +1 -1
  84. package/dist/assets/{routePaths-CISchqL4.js → routePaths-rRL_rkmv.js} +1 -1
  85. package/dist/assets/{sentry-DjiAD8iq.js → sentry-ChHN7-iq.js} +1 -1
  86. package/dist/assets/{url-DtTK63_K.js → url-CIXgNG7Z.js} +1 -1
  87. package/dist/assets/{url-o9f2bKFL.js → url-Dd4g81lS.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js → useAskAiCfoHostNavButtonProps-DhFKV-ID.js} +1 -1
  89. package/dist/assets/{useDeviceId-BaDJArGA.js → useDeviceId-CnRHGVBn.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js → useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-D5k70f5t.js → useInitialThreadRequest-8CnQ_kPf.js} +1 -1
  92. package/dist/assets/{utils-C3tzQnc0.js → utils-BS7Du9ue.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-Crse1y6I.js → withTransactionSidePanel-CyEXLPB4.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-km4S-bKq.js → zeni-epic-state-BCudzeg6.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +1 -1
  97. package/dist/assets/AddressRoutes-g_S9tXfT.js +0 -1
  98. package/dist/assets/CustomerOnboardingAuthScreen-D6Wjhidr.js +0 -1
  99. package/dist/assets/NotFoundScreen-C_R6jGEp.js +0 -1
  100. package/dist/assets/TransactionDetailRoutes-BTWL8leD.js +0 -1
@@ -1 +1 @@
1
- import{j as V}from"./liveblocks-BDeoGIJv.js";import{a as c}from"./sentry-DjiAD8iq.js";import{h as pe,g as t,l as We,u as Xe,j as qe,i as M}from"./core-CNW5dhSg.js";import{eN as he,eU as Je,eV as Se,eP as Ke,bn as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cH as ua,fd as ma,cN as fa,bv as ba,eM as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-km4S-bKq.js";import{a1 as Ea,a2 as ka,w as Ca,a as ya,z as k,a3 as Ia,u as Ta,d as r,a4 as wa,a5 as Aa,A as Fa,c as _a,a6 as Da,V as va,a7 as $a,a8 as Ba,a9 as me,aa as fe,L as Ga,ab as Pa,ac as be,e as R,s as A,ad as N,ae as Ma}from"./index-D49e6fWF.js";import{D as Ra}from"./mui-B2x4GL6c.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="7c11ee8e-de15-4253-98e7-3802047681ef",m._sentryDebugIdIdentifier="sentry-dbid-7c11ee8e-de15-4253-98e7-3802047681ef")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=We(),a=Xe(),C=Ca(),o=qe(),U=Ke(),f=pe(),{useFeatureGate:i}=ya(),x=k.getSignedInUser(),F=Qe(x),s=t(e=>he(e)),j=t(e=>ea(e)),L=j.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Y),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),Z=t(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=t(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&f(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=t(e=>e.tenantState),ye=t(e=>$.fetchState==="Completed"?sa(e):[]),E=t(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&F,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=F||!F&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Ge=t(e=>g(e).totalUnreadCount),Pe=t(e=>g(e).reducedFetchCountState),J=t(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=t(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=t(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=t(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Re}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Re?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&U.tenantId!=null&&f(ia("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||f(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(f(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),f(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ne={fetchStatus:Pe,count:Ge},ne=n!=null?k.getSignedInUserTenant(n):null,se=t(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=t(e=>da(e,S,h,X,W,w).fetchState),ie=t(e=>la(e).fetchState),Ue=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ca(s.userRole),[s.userRole]),je=ua(xe),Le=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,s),re=_a(),ze=re&&Da(a),de=fa(Ve?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(n??"")&&le===!1&&va(a.pathname)!=="treasury",[w,de,le,a.pathname,n]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ye=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Ze=$a(Ye);return V.jsx(Ra,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Ba,{signedInUser:x,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:fe(a),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:Ze,isTreasuryPopupVisible:He,isNotificationsTabVisible:Oe,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:me(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";fe(a)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=A(a.state?.pathnameStackToGoBack,a.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),void o(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[s.tenantId]!=null&&R.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${n}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ma(e.type);be(e.type)?(L!=null&&f(ga()),o(`/${n}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${n}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${n}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${n}/rewards`)},handleBackClick:()=>{o(`/${n}/dashboard`)},handleTenantSelect:e=>{ge(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=me(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(f(ha(e.tenantId)),f(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:j,isOnDashboard:D,updateCurrentChatSessionId:e=>{f(pa({sessionId:e,agentId:"controller"})),o(`/${n}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:_e})})}),za=m=>{const d=pe(),n=t(C=>he(C)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Na,{...m,...a})};export{za as M};
1
+ import{j as V}from"./liveblocks-6kHh7NcJ.js";import{a as c}from"./sentry-ChHN7-iq.js";import{h as pe,g as t,l as We,u as Xe,j as qe,i as M}from"./core-DYR9i5id.js";import{eN as he,eU as Je,eV as Se,eP as Ke,bn as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cH as ua,fd as ma,cN as fa,bv as ba,eM as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-BCudzeg6.js";import{a1 as Ea,a2 as ka,w as Ca,a as ya,z as k,a3 as Ia,u as Ta,d as r,a4 as wa,a5 as Aa,A as Fa,c as _a,a6 as Da,V as va,a7 as $a,a8 as Ba,a9 as me,aa as fe,L as Ga,ab as Pa,ac as be,e as R,s as A,ad as N,ae as Ma}from"./index-7Qcu9V7y.js";import{D as Ra}from"./mui-DDBWVnth.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="7c11ee8e-de15-4253-98e7-3802047681ef",m._sentryDebugIdIdentifier="sentry-dbid-7c11ee8e-de15-4253-98e7-3802047681ef")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=We(),a=Xe(),C=Ca(),o=qe(),U=Ke(),f=pe(),{useFeatureGate:i}=ya(),x=k.getSignedInUser(),F=Qe(x),s=t(e=>he(e)),j=t(e=>ea(e)),L=j.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Y),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),Z=t(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=t(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&f(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=t(e=>e.tenantState),ye=t(e=>$.fetchState==="Completed"?sa(e):[]),E=t(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&F,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=F||!F&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Ge=t(e=>g(e).totalUnreadCount),Pe=t(e=>g(e).reducedFetchCountState),J=t(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=t(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=t(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=t(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Re}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Re?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&U.tenantId!=null&&f(ia("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||f(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(f(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),f(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ne={fetchStatus:Pe,count:Ge},ne=n!=null?k.getSignedInUserTenant(n):null,se=t(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=t(e=>da(e,S,h,X,W,w).fetchState),ie=t(e=>la(e).fetchState),Ue=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ca(s.userRole),[s.userRole]),je=ua(xe),Le=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,s),re=_a(),ze=re&&Da(a),de=fa(Ve?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(n??"")&&le===!1&&va(a.pathname)!=="treasury",[w,de,le,a.pathname,n]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ye=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Ze=$a(Ye);return V.jsx(Ra,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Ba,{signedInUser:x,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:fe(a),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:Ze,isTreasuryPopupVisible:He,isNotificationsTabVisible:Oe,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:me(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";fe(a)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=A(a.state?.pathnameStackToGoBack,a.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),void o(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[s.tenantId]!=null&&R.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${n}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ma(e.type);be(e.type)?(L!=null&&f(ga()),o(`/${n}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${n}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${n}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${n}/rewards`)},handleBackClick:()=>{o(`/${n}/dashboard`)},handleTenantSelect:e=>{ge(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=me(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(f(ha(e.tenantId)),f(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:j,isOnDashboard:D,updateCurrentChatSessionId:e=>{f(pa({sessionId:e,agentId:"controller"})),o(`/${n}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:_e})})}),za=m=>{const d=pe(),n=t(C=>he(C)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Na,{...m,...a})};export{za as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-6kHh7NcJ.js";import{j as r,k as i}from"./core-DYR9i5id.js";import{U as n}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import"./sentry-ChHN7-iq.js";import"./zeni-epic-state-BCudzeg6.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="9eddbf1e-8177-43b2-add6-c91ac38fa63c",o._sentryDebugIdIdentifier="sentry-dbid-9eddbf1e-8177-43b2-add6-c91ac38fa63c")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(a,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-BDeoGIJv.js";import ut from"./NotFoundScreen-C_R6jGEp.js";import{a as k}from"./sentry-DjiAD8iq.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as J}from"./core-CNW5dhSg.js";import{cp as It,eW as K,eN as X,fa as Ct,f2 as b,OG as Q,f6 as d,eV as A,qr as M,vF as Tt,OH as At,eU as yt,fd as Et,qw as _t,OI as F,bq as $,gD as x,qA as H,OJ as Nt,cA as Bt,cu as wt}from"./zeni-epic-state-km4S-bKq.js";import{J as xt,z as Dt,a as Rt,d as Ut,I as vt,cq as Gt,s as N,a1 as Pt,cr as Ft,a2 as $t,p as Mt}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="d74426ec-84e6-4989-9030-329bd88d6f5c",t._sentryDebugIdIdentifier="sentry-dbid-d74426ec-84e6-4989-9030-329bd88d6f5c")}catch{}})();const qt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),Vt=St(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:D}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(H("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!wt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(A(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else D?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(H("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(A({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(s,B).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(A({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Mt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ft)),Lt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=Dt.getSignedInUser(),[B,D]=k.useState(!1),a=S(e=>K(e)),o=S(e=>X(e)),{useFeatureGate:m}=Rt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=vt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),O=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:w,isLoading:y,hasFetchedAll:C,isFetchingMore:v,fetchMore:nt}=dt(),{threads:q,isLoading:V,fetchMore:L,isFetchingMore:W,hasFetchedAll:z}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(Q(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(y===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(A({unreadCount:p},"comments"))}},[y,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=y||v===!0||C!==!0||y||v===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(A({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(D(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(y===!1&&V===!1&&w!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=q.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(W||z===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(A({totalCount:E.length,unreadCount:T.length},"comments")),s(At(ct))}},[y,v,W,C,z,V,w?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if($t(p)){const T=yt(p.mode);if(T==="dashboard"&&s(A({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s(M("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(Vt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(J,{path:"/:selectedTab",element:_.jsx(Lt,{})}),_.jsx(J,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
1
+ import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-6kHh7NcJ.js";import ut from"./NotFoundScreen-CKucympc.js";import{a as k}from"./sentry-ChHN7-iq.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as J}from"./core-DYR9i5id.js";import{cp as It,eW as K,eN as X,fa as Ct,f2 as b,OG as Q,f6 as d,eV as A,qr as M,vF as Tt,OH as At,eU as yt,fd as Et,qw as _t,OI as F,bq as $,gD as x,qA as H,OJ as Nt,cA as Bt,cu as wt}from"./zeni-epic-state-BCudzeg6.js";import{J as xt,z as Dt,a as Rt,d as Ut,I as vt,cq as Gt,s as N,a1 as Pt,cr as Ft,a2 as $t,p as Mt}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-DhFKV-ID.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="d74426ec-84e6-4989-9030-329bd88d6f5c",t._sentryDebugIdIdentifier="sentry-dbid-d74426ec-84e6-4989-9030-329bd88d6f5c")}catch{}})();const qt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),Vt=St(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:D}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(H("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!wt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(A(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else D?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(H("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(A({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(s,B).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(A({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Mt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ft)),Lt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=Dt.getSignedInUser(),[B,D]=k.useState(!1),a=S(e=>K(e)),o=S(e=>X(e)),{useFeatureGate:m}=Rt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=vt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),O=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:w,isLoading:y,hasFetchedAll:C,isFetchingMore:v,fetchMore:nt}=dt(),{threads:q,isLoading:V,fetchMore:L,isFetchingMore:W,hasFetchedAll:z}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(Q(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(y===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(A({unreadCount:p},"comments"))}},[y,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=y||v===!0||C!==!0||y||v===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(A({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(D(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(y===!1&&V===!1&&w!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=q.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(W||z===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(A({totalCount:E.length,unreadCount:T.length},"comments")),s(At(ct))}},[y,v,W,C,z,V,w?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if($t(p)){const T=yt(p.mode);if(T==="dashboard"&&s(A({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s(M("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(Vt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(J,{path:"/:selectedTab",element:_.jsx(Lt,{})}),_.jsx(J,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-BDeoGIJv.js";import{j as Z,h as K,u as H,l as Q,g as d,k as X,n as ee,o as C}from"./core-CNW5dhSg.js";import{eN as M,qf as v,pP as ae,J8 as $,pK as A,bv as te,bn as se,bR as oe,pL as re,J9 as ne,IV as T,dB as ie,tC as ce,Ja as le,tZ as de,eT as fe,eR as me}from"./zeni-epic-state-km4S-bKq.js";import{I as pe,z as ue,J as he,A as ge,a as w,d as N,x as Fe,e as B,aj as Ie,s as be}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import Ce from"./NotFoundScreen-C_R6jGEp.js";import{F as Te}from"./FeaturePreviewScreen-Dtyet701.js";import{a as h}from"./sentry-DjiAD8iq.js";import{u as Ae}from"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import{u as ye}from"./useInitialThreadRequest-D5k70f5t.js";import{t as xe}from"./routePaths-CISchqL4.js";import{M as ke}from"./MobileAppDrawer-D25b_bdO.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="1bf7f67d-3a0a-4776-82ea-f7583d2c0d23",s._sentryDebugIdIdentifier="sentry-dbid-1bf7f67d-3a0a-4776-82ea-f7583d2c0d23")}catch{}})();const S=(s,a,e,o)=>{if(s!=a){const r=o??"";s!=null&&s.length>0?e(`../${a}${r}`,{replace:!0}):e(`${a}${r}`,{replace:!0})}},De=X(function(s){const a=ne(s),e={},o=a.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{e[r]=o[r]===!1}),{selectedTimeframe:a.selectedTimeframe,isForecastVsActualOn:a.isForecastVsActualOn,compareMode:a.compareMode,forecastList:a.forecastList,selectedForecast:a.selectedForecast,pandLreport:a.pandLReportWithForecast,scrollPosition:a.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:e,type:"name+balances_forecast",analytics:B}},function(s,a){return{onForecastSelectionChanged:(e,o)=>{s($(e,o)),a.isPandLReportFetched(e)||s(A(e)),S(a.forecastIdFromUrlPath,e,a.navigate)},onTimeframeChanged:e=>{s(de(e))},onForecastVsActualsCompareToggle:e=>{s(le(e)),s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:e=>{s(ce(a.firstMonthOfFY,e,0,[]))},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(e,o)=>{let r,i;const g=e.accountName===""?e.accountDescription:e.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=ie(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=xe(a.tenantEmailDomain,e.accountId,e.accountType,g,r,i),p=be(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(m,{state:{pathnameStackToGoBack:p,referrer:"Forecast"}})}},onNodeCollapseToggled:(e,o)=>{s(T({forecastId:a.forecastIdFromUrlPath,nodeCollapseState:{nodeId:e,isCollapsed:o===!1}}))},onTableScroll:e=>{s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:e}))},onBackClick:()=>{a.navigate("../../")}}})(Ie);function U(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=K(),r=H(),{forecastId:i,tenantEmailDomain:g}=Q(),[m,p]=h.useState(!1),[F,y]=h.useState(!1),u=ue.getSignedInUser(),x=d(t=>M(t)),q=x.company?.companyInfo.firstMonthOfFY??1,c=d(t=>v(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),D=d(t=>t.reportUIOptionsState.selectedForecast),j=t=>k.pandLByForecastID[t]!=null&&re(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=he();Se({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=Ae({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!m&&I)p(!0),l||o(ae());else if(l&&!F){y(!0);const t=((f,R,P)=>R!=null?f.forecasts.findIndex(b=>b.id===R):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(c,i,D?.id);t===-1&&i!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=D?.index?(o($(c.forecasts[t].id,t)),S(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&S(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!j(c.forecasts[t].id)&&I&&o(A(c.forecasts[t].id))}},[m,p,o,l,c,F,y,v,A,I]);const L=ge(),J=L?.loggedInUserRole!=null&&te(L.loggedInUserRole),{useFeatureGate:V}=w(),{isFeatureEnabled:E}=V(N.isReportsCommentingEnabled),W=ye(E?x?.companyId:void 0,{clearParams:l&&F}),[Y,z]=h.useState(!1),O=t=>{z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(Fe,{analytics:B,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ke,{isAppContentDrawerOpen:Y,handleDrawerToggle:O}),n.jsx(De,{firstMonthOfFY:q,tenantEmailDomain:g,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:j,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:J,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:E,isZeniUser:se(u),initialOpenThreadRequest:W,onClickMenuIcon:()=>{O(!0)}})]})}function Ke(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(N.isDebitCardFeatureEnabled),o=fe(e,s),r=me(s);return o===!0||r===!0?n.jsx(Te,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Ke as PandLWithForecastRoutes,Ke as default};
1
+ import{j as n}from"./liveblocks-6kHh7NcJ.js";import{j as Z,h as K,u as H,l as Q,g as d,k as X,n as ee,o as C}from"./core-DYR9i5id.js";import{eN as M,qf as v,pP as ae,J8 as $,pK as A,bv as te,bn as se,bR as oe,pL as re,J9 as ne,IV as T,dB as ie,tC as ce,Ja as le,tZ as de,eT as fe,eR as me}from"./zeni-epic-state-BCudzeg6.js";import{I as pe,z as ue,J as he,A as ge,a as w,d as N,x as Fe,e as B,aj as Ie,s as be}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import Ce from"./NotFoundScreen-CKucympc.js";import{F as Te}from"./FeaturePreviewScreen-Beu7_BUA.js";import{a as h}from"./sentry-ChHN7-iq.js";import{u as Ae}from"./useAskAiCfoHostNavButtonProps-DhFKV-ID.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import{u as ye}from"./useInitialThreadRequest-8CnQ_kPf.js";import{t as xe}from"./routePaths-rRL_rkmv.js";import{M as ke}from"./MobileAppDrawer-BuJW5cST.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="1bf7f67d-3a0a-4776-82ea-f7583d2c0d23",s._sentryDebugIdIdentifier="sentry-dbid-1bf7f67d-3a0a-4776-82ea-f7583d2c0d23")}catch{}})();const S=(s,a,e,o)=>{if(s!=a){const r=o??"";s!=null&&s.length>0?e(`../${a}${r}`,{replace:!0}):e(`${a}${r}`,{replace:!0})}},De=X(function(s){const a=ne(s),e={},o=a.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{e[r]=o[r]===!1}),{selectedTimeframe:a.selectedTimeframe,isForecastVsActualOn:a.isForecastVsActualOn,compareMode:a.compareMode,forecastList:a.forecastList,selectedForecast:a.selectedForecast,pandLreport:a.pandLReportWithForecast,scrollPosition:a.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:e,type:"name+balances_forecast",analytics:B}},function(s,a){return{onForecastSelectionChanged:(e,o)=>{s($(e,o)),a.isPandLReportFetched(e)||s(A(e)),S(a.forecastIdFromUrlPath,e,a.navigate)},onTimeframeChanged:e=>{s(de(e))},onForecastVsActualsCompareToggle:e=>{s(le(e)),s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:e=>{s(ce(a.firstMonthOfFY,e,0,[]))},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(e,o)=>{let r,i;const g=e.accountName===""?e.accountDescription:e.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=ie(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=xe(a.tenantEmailDomain,e.accountId,e.accountType,g,r,i),p=be(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(m,{state:{pathnameStackToGoBack:p,referrer:"Forecast"}})}},onNodeCollapseToggled:(e,o)=>{s(T({forecastId:a.forecastIdFromUrlPath,nodeCollapseState:{nodeId:e,isCollapsed:o===!1}}))},onTableScroll:e=>{s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:e}))},onBackClick:()=>{a.navigate("../../")}}})(Ie);function U(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=K(),r=H(),{forecastId:i,tenantEmailDomain:g}=Q(),[m,p]=h.useState(!1),[F,y]=h.useState(!1),u=ue.getSignedInUser(),x=d(t=>M(t)),q=x.company?.companyInfo.firstMonthOfFY??1,c=d(t=>v(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),D=d(t=>t.reportUIOptionsState.selectedForecast),j=t=>k.pandLByForecastID[t]!=null&&re(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=he();Se({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=Ae({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!m&&I)p(!0),l||o(ae());else if(l&&!F){y(!0);const t=((f,R,P)=>R!=null?f.forecasts.findIndex(b=>b.id===R):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(c,i,D?.id);t===-1&&i!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=D?.index?(o($(c.forecasts[t].id,t)),S(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&S(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!j(c.forecasts[t].id)&&I&&o(A(c.forecasts[t].id))}},[m,p,o,l,c,F,y,v,A,I]);const L=ge(),J=L?.loggedInUserRole!=null&&te(L.loggedInUserRole),{useFeatureGate:V}=w(),{isFeatureEnabled:E}=V(N.isReportsCommentingEnabled),W=ye(E?x?.companyId:void 0,{clearParams:l&&F}),[Y,z]=h.useState(!1),O=t=>{z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(Fe,{analytics:B,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ke,{isAppContentDrawerOpen:Y,handleDrawerToggle:O}),n.jsx(De,{firstMonthOfFY:q,tenantEmailDomain:g,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:j,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:J,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:E,isZeniUser:se(u),initialOpenThreadRequest:W,onClickMenuIcon:()=>{O(!0)}})]})}function Ke(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(N.isDebitCardFeatureEnabled),o=fe(e,s),r=me(s);return o===!0||r===!0?n.jsx(Te,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Ke as PandLWithForecastRoutes,Ke as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BDeoGIJv.js";import{J3 as oe,eN as q,jr as z,eT as Q,eR as ie,GE as Y,IH as re,sK as ke,J4 as X,sy as Pe,sT as je,sN as le,sC as de,sR as Te,sO as Le,J5 as ce,uo as ve,J6 as Fe,fx as Ae,J7 as H,sH as pe,sF as ue,sW as Oe,c0 as Re}from"./zeni-epic-state-km4S-bKq.js";import{q as me,a as ee,d as E,z as W,a4 as ge,F as fe,af as he,ag as Ve,y as Ce,o as A,G as ye,D as be,ah as Ue,J as Be,I as Ze,x as $e,e as Se,g as Ge,s as He,ai as Je,A as _e}from"./index-D49e6fWF.js";import{D as we,n as K,S as De}from"./mui-B2x4GL6c.js";import te from"./NotFoundScreen-C_R6jGEp.js";import{a as l}from"./sentry-DjiAD8iq.js";import{h as se,l as ze,g,j as We,u as Ke,k as Me,n as ne,o as G}from"./core-CNW5dhSg.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import{M as qe}from"./MobileAppDrawer-D25b_bdO.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="63820243-f075-4af1-b211-9fd82cae2911",e._sentryDebugIdIdentifier="sentry-dbid-63820243-f075-4af1-b211-9fd82cae2911")}catch{}})();const Qe={overlayWidth:new Ce(100,100,48)},J=be.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),u=se(),[O,R]=l.useState(!1),[k,S]=l.useState(!1),{userId:w}=ze(),c=g(t=>oe(t)),m=g(t=>q(t)),D=g(t=>z(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=Q(I,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const y=()=>{u(X()),b()},F=()=>{O===!0?S(!0):y()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:f,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:y,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(f==="zeni_only"?Pe(e):je(v))},onCloseClick:F,isLoading:x||c.person==null},r={onOkClick:()=>{S(!1),y()},onCancelClick:()=>{S(!1)}};return l.useEffect(()=>{x===!1&&w!=null&&u(ke(w))},[x,w]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&y()},[c.updatePersonState.fetchState]),s.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:J.discardTitle}),descriptionComponent:s.jsx(Ee,{children:J.discardDescription}),primaryButtonText:J.discard,secondaryButtonText:J.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=K(De)`
1
+ import{j as s}from"./liveblocks-6kHh7NcJ.js";import{J3 as oe,eN as q,jr as z,eT as Q,eR as ie,GE as Y,IH as re,sK as ke,J4 as X,sy as Pe,sT as je,sN as le,sC as de,sR as Te,sO as Le,J5 as ce,uo as ve,J6 as Fe,fx as Ae,J7 as H,sH as pe,sF as ue,sW as Oe,c0 as Re}from"./zeni-epic-state-BCudzeg6.js";import{q as me,a as ee,d as E,z as W,a4 as ge,F as fe,af as he,ag as Ve,y as Ce,o as A,G as ye,D as be,ah as Ue,J as Be,I as Ze,x as $e,e as Se,g as Ge,s as He,ai as Je,A as _e}from"./index-7Qcu9V7y.js";import{D as we,n as K,S as De}from"./mui-DDBWVnth.js";import te from"./NotFoundScreen-CKucympc.js";import{a as l}from"./sentry-ChHN7-iq.js";import{h as se,l as ze,g,j as We,u as Ke,k as Me,n as ne,o as G}from"./core-DYR9i5id.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-DhFKV-ID.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import{M as qe}from"./MobileAppDrawer-BuJW5cST.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="63820243-f075-4af1-b211-9fd82cae2911",e._sentryDebugIdIdentifier="sentry-dbid-63820243-f075-4af1-b211-9fd82cae2911")}catch{}})();const Qe={overlayWidth:new Ce(100,100,48)},J=be.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),u=se(),[O,R]=l.useState(!1),[k,S]=l.useState(!1),{userId:w}=ze(),c=g(t=>oe(t)),m=g(t=>q(t)),D=g(t=>z(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=Q(I,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const y=()=>{u(X()),b()},F=()=>{O===!0?S(!0):y()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:f,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:y,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(f==="zeni_only"?Pe(e):je(v))},onCloseClick:F,isLoading:x||c.person==null},r={onOkClick:()=>{S(!1),y()},onCancelClick:()=>{S(!1)}};return l.useEffect(()=>{x===!1&&w!=null&&u(ke(w))},[x,w]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&y()},[c.updatePersonState.fetchState]),s.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:J.discardTitle}),descriptionComponent:s.jsx(Ee,{children:J.discardDescription}),primaryButtonText:J.discard,secondaryButtonText:J.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=K(De)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-BDeoGIJv.js";import _ from"./NotFoundScreen-C_R6jGEp.js";import{a as o}from"./sentry-DjiAD8iq.js";import{j as v,u as M,g,l as U,h as P,N as z,k as N,n as V,o as h}from"./core-CNW5dhSg.js";import{eN as B,OK as b,bo as F,bn as K,h7 as H,gD as $}from"./zeni-epic-state-km4S-bKq.js";import{w as q,z as I,I as G,cs as J}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import{u as L}from"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import{c as Q}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import{M as W}from"./MobileAppDrawer-D25b_bdO.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.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]="42cac1b1-b870-4dc3-9b6e-c3d45515da7f",e._sentryDebugIdIdentifier="sentry-dbid-42cac1b1-b870-4dc3-9b6e-c3d45515da7f")}catch{}})();const X=N(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:r,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(J),Y=()=>{const e=v(),t=M(),c=q(),r=g(s=>B(s)),{aggregatedReportViewState:n}=g(s=>b(s)),{tenantEmailDomain:m}=U(),p=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=o.useRef(!1),[C,w]=o.useState(!1),S=F(r?.userRole??[]),k=r?.userRole?.includes("bookkeeping_admin")??!1,D=K(l),A=S||k||D,d=o.useCallback((s,i,O)=>{p(H({fromMonth:s,toMonth:i,cacheOverride:O}))},[]);o.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(p($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const x=o.useCallback((s,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(s,i,!0),f.current=!0},[n?.fetchState,d]),y=o.useCallback((s,i)=>{d(s,i,!1)},[d]),u=s=>{w(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=L({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return Q({isDataReady:n?.fetchState==="Completed"}),A?a.jsxs(a.Fragment,{children:[a.jsx(W,{isAppContentDrawerOpen:C,handleDrawerToggle:u}),a.jsx(X,{navigate:e,location:t,themeState:c,currentTenant:r,signedInUser:l,tenantEmailDomain:m,onReload:x,onTimeRangeSelect:y,handleDrawerToggle:u,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):a.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return a.jsxs(V,{children:[a.jsx(h,{path:"*",element:a.jsx(Y,{})}),a.jsx(h,{path:"*",element:a.jsx(_,{})})]})}export{Ie as default};
1
+ import{j as a}from"./liveblocks-6kHh7NcJ.js";import _ from"./NotFoundScreen-CKucympc.js";import{a as o}from"./sentry-ChHN7-iq.js";import{j as v,u as M,g,l as U,h as P,N as z,k as N,n as V,o as h}from"./core-DYR9i5id.js";import{eN as B,OK as b,bo as F,bn as K,h7 as H,gD as $}from"./zeni-epic-state-BCudzeg6.js";import{w as q,z as I,I as G,cs as J}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import{u as L}from"./useAskAiCfoHostNavButtonProps-DhFKV-ID.js";import{c as Q}from"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import{M as W}from"./MobileAppDrawer-BuJW5cST.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.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]="42cac1b1-b870-4dc3-9b6e-c3d45515da7f",e._sentryDebugIdIdentifier="sentry-dbid-42cac1b1-b870-4dc3-9b6e-c3d45515da7f")}catch{}})();const X=N(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:r,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(J),Y=()=>{const e=v(),t=M(),c=q(),r=g(s=>B(s)),{aggregatedReportViewState:n}=g(s=>b(s)),{tenantEmailDomain:m}=U(),p=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=o.useRef(!1),[C,w]=o.useState(!1),S=F(r?.userRole??[]),k=r?.userRole?.includes("bookkeeping_admin")??!1,D=K(l),A=S||k||D,d=o.useCallback((s,i,O)=>{p(H({fromMonth:s,toMonth:i,cacheOverride:O}))},[]);o.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(p($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const x=o.useCallback((s,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(s,i,!0),f.current=!0},[n?.fetchState,d]),y=o.useCallback((s,i)=>{d(s,i,!1)},[d]),u=s=>{w(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=L({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return Q({isDataReady:n?.fetchState==="Completed"}),A?a.jsxs(a.Fragment,{children:[a.jsx(W,{isAppContentDrawerOpen:C,handleDrawerToggle:u}),a.jsx(X,{navigate:e,location:t,themeState:c,currentTenant:r,signedInUser:l,tenantEmailDomain:m,onReload:x,onTimeRangeSelect:y,handleDrawerToggle:u,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):a.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return a.jsxs(V,{children:[a.jsx(h,{path:"*",element:a.jsx(Y,{})}),a.jsx(h,{path:"*",element:a.jsx(_,{})})]})}export{Ie as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-DjiAD8iq.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`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:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-ChHN7-iq.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`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:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-BDeoGIJv.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DjiAD8iq.js";import{L as dt,bR as Tc,eN as Ac,Ij as Rc,I$ as kl,c0 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-km4S-bKq.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-C3tzQnc0.js";import{r as un}from"./empty-CzR1IqVo.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-C4_ugcOf.js";import{r as Gl}from"./index-Cme59vnn.js";import{r as zl}from"./index-2XXzCcMZ.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-CNW5dhSg.js";import{u as Kl,z as Pc,L as Wl,W as Jl,R as Xl,k as Ql,e as tf}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import{d as Pe}from"./decodeURIComponentSafe-B2xCvVcj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="a89336ed-2ab3-43ab-b96d-da01ad2e041c",t._sentryDebugIdIdentifier="sentry-dbid-a89336ed-2ab3-43ab-b96d-da01ad2e041c")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)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 f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(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=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,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}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,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)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(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 i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(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,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("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),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),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 ef(){if(xn)return jn;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 f(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){m(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 m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(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,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(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 o(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 i(k){var E=typeof Map=="function"?new Map:void 0;return i=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 u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=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},u.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)}xn=1;var h=lt().inspect,d=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="",c="",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-6kHh7NcJ.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-ChHN7-iq.js";import{L as dt,bR as Tc,eN as Ac,Ij as Rc,I$ as kl,c0 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-BCudzeg6.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-BS7Du9ue.js";import{r as un}from"./empty-DMHTn4jL.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib--WQ5Q4Dt.js";import{r as Gl}from"./index-CZ0AqUEL.js";import{r as zl}from"./index-B1RNmiHY.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DYR9i5id.js";import{u as Kl,z as Pc,L as Wl,W as Jl,R as Xl,k as Ql,e as tf}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import{d as Pe}from"./decodeURIComponentSafe-jUJvXFoR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="a89336ed-2ab3-43ab-b96d-da01ad2e041c",t._sentryDebugIdIdentifier="sentry-dbid-a89336ed-2ab3-43ab-b96d-da01ad2e041c")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)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 f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(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=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,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}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,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)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(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 i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(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,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("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),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),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 ef(){if(xn)return jn;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 f(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){m(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 m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(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,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(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 o(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 i(k){var E=typeof Map=="function"?new Map:void 0;return i=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 u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=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},u.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)}xn=1;var h=lt().inspect,d=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="",c="",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
 
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BDeoGIJv.js";import{a as o}from"./sentry-DjiAD8iq.js";import{g as f,j as N,h as V,u as W,k as M}from"./core-CNW5dhSg.js";import{h as _,q as z,z as R,b2 as U,y as $,J as q,I as J,x as X,e as l,g as Z,a1 as G,b3 as Q}from"./index-D49e6fWF.js";import{eX as K,eN as Y,Ly as I,Lz as ee,ts as ae,ti as g,eZ as re,bM as ne,tn as te,LA as se}from"./zeni-epic-state-km4S-bKq.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-B2x4GL6c.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import{M as ue}from"./MobileAppDrawer-D25b_bdO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="c867e796-2375-4ae0-ae24-1e13faf49f49",e._sentryDebugIdIdentifier="sentry-dbid-c867e796-2375-4ae0-ae24-1e13faf49f49")}catch{}})();const pe={overlayWidth:new $(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=z();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>K(c));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
1
+ import{j as s}from"./liveblocks-6kHh7NcJ.js";import{a as o}from"./sentry-ChHN7-iq.js";import{g as f,j as N,h as V,u as W,k as M}from"./core-DYR9i5id.js";import{h as _,q as z,z as R,b2 as U,y as $,J as q,I as J,x as X,e as l,g as Z,a1 as G,b3 as Q}from"./index-7Qcu9V7y.js";import{eX as K,eN as Y,Ly as I,Lz as ee,ts as ae,ti as g,eZ as re,bM as ne,tn as te,LA as se}from"./zeni-epic-state-BCudzeg6.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-DDBWVnth.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-DhFKV-ID.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import{M as ue}from"./MobileAppDrawer-BuJW5cST.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="c867e796-2375-4ae0-ae24-1e13faf49f49",e._sentryDebugIdIdentifier="sentry-dbid-c867e796-2375-4ae0-ae24-1e13faf49f49")}catch{}})();const pe={overlayWidth:new $(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=z();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>K(c));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-BDeoGIJv.js";import R from"./NotFoundScreen-C_R6jGEp.js";import{a as p}from"./sentry-DjiAD8iq.js";import{j as x,u as C,h as A,g as u,N as E,k,n as D,o as c}from"./core-CNW5dhSg.js";import{eN as T,Ms as g,MI as S,Cp as V,By as U,Co as m,Cf as _,MX as B}from"./zeni-epic-state-km4S-bKq.js";import{h as M,z as N,B as $,a1 as O,bI as W,aa as z}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-EvJFbHZ_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b",e._sentryDebugIdIdentifier="sentry-dbid-8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b")}catch{}})();const d="reimbursement-approval-rule-update",P=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(d)&&e(B(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(_(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),X=()=>{const e=x(),r=C(),a=A(),[l,n]=p.useState(!1),[f,y]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),w=M(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(U(!0)))},[l,b,a]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${d}`]:[],eventCallback:(s,q,I)=>{s.endsWith(d)&&I.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(P,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(X,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
1
+ import{j as t}from"./liveblocks-6kHh7NcJ.js";import R from"./NotFoundScreen-CKucympc.js";import{a as p}from"./sentry-ChHN7-iq.js";import{j as x,u as C,h as A,g as u,N as E,k,n as D,o as c}from"./core-DYR9i5id.js";import{eN as T,Ms as g,MI as S,Cp as V,By as U,Co as m,Cf as _,MX as B}from"./zeni-epic-state-BCudzeg6.js";import{h as M,z as N,B as $,a1 as O,bI as W,aa as z}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-CTc4fu7W.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b",e._sentryDebugIdIdentifier="sentry-dbid-8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b")}catch{}})();const d="reimbursement-approval-rule-update",P=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(d)&&e(B(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(_(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),X=()=>{const e=x(),r=C(),a=A(),[l,n]=p.useState(!1),[f,y]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),w=M(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(U(!0)))},[l,b,a]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${d}`]:[],eventCallback:(s,q,I)=>{s.endsWith(d)&&I.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(P,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(X,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-BDeoGIJv.js";import{a as y}from"./sentry-DjiAD8iq.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-CNW5dhSg.js";import{MI as R,Ms as E,Ci as x,Cr as _,Cp as S,Cq as h,MJ as B}from"./zeni-epic-state-km4S-bKq.js";import{z as k,h as V,B as j,bz as F,aa as O}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="f365dc0b-f143-456b-a827-b32eaa25d66f",e._sentryDebugIdIdentifier="sentry-dbid-f365dc0b-f143-456b-a827-b32eaa25d66f")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const f=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=D.concat(I);f.push({action:c.stepType.selectedOption,actors:v,operator:v.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,$ as i};
1
+ import{j as g}from"./liveblocks-6kHh7NcJ.js";import{a as y}from"./sentry-ChHN7-iq.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-DYR9i5id.js";import{MI as R,Ms as E,Ci as x,Cr as _,Cp as S,Cq as h,MJ as B}from"./zeni-epic-state-BCudzeg6.js";import{z as k,h as V,B as j,bz as F,aa as O}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="f365dc0b-f143-456b-a827-b32eaa25d66f",e._sentryDebugIdIdentifier="sentry-dbid-f365dc0b-f143-456b-a827-b32eaa25d66f")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const f=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=D.concat(I);f.push({action:c.stepType.selectedOption,actors:v,operator:v.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,$ as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BDeoGIJv.js";import{j as q,h as me,u as V,l as Y,g as B,N as _,k as K,i as ut,n as pt,o as E}from"./core-CNW5dhSg.js";import{eN as J,MY as ce,c0 as de,Bt as je,jC as bt,BG as se,BF as ie,MZ as gt,bn as ue,fI as Fe,M_ as ht,Jk as ft,jr as Ue,Jl as Ae,Jm as St,il as It,Me as yt,iB as At,Bh as Rt,s6 as Ct,it as vt,C1 as Le,M$ as Ne,N0 as kt,N1 as Et,N2 as Bt,N3 as wt,N4 as xt,BN as Re,iH as Tt,Mn as Dt,BH as jt,Br as Ft,N5 as Ut,Bq as Lt,N6 as Nt,Bz as Ce,BR as Mt,BQ as Pt,BM as $t,N7 as Me,GE as _t,bo as Ot,BC as zt,Cj as Gt,N8 as Ht,N9 as Zt,BZ as Wt,BW as ve,LJ as Vt,Bo as Jt,Na as Pe,CI as ke,CQ as qt,Nb as Kt,Nc as Z,Nd as Qt,Ne as $e,Nf as Xt,Ng as _e,Nh as Oe,C9 as oe,bt as Yt,bE as pe,cA as be,eT as ze,eR as Ge,Ni as en,gD as tn,LW as nn,Nj as an,Nk as He,L_ as sn,MI as on,Nl as rn,MX as ln,CN as Ee,CM as mn,Nm as cn,Nn as dn,No as un,Np as pn,Nq as bn,Mt as gn,CD as hn,CH as fn,bv as Sn,bD as In,cv as yn,cj as An,bs as Rn,Il as Cn,cL as vn,cN as kn,cM as En,cu as Bn}from"./zeni-epic-state-km4S-bKq.js";import{w as Ze,q as We,a as ee,d as v,I as ge,z as P,bJ as Ve,x as te,e as k,aC as Be,o as F,ao as X,F as wn,D as Je,bK as xn,s as W,bL as Tn,A as ne,bM as Dn,J as jn,y as Fn,B as he,g as qe,a1 as Un,ba as Ln,N as Nn,h as Ke,bN as Mn,a4 as Pn}from"./index-D49e6fWF.js";import{n as O,S as $n}from"./mui-B2x4GL6c.js";import re from"./NotFoundScreen-C_R6jGEp.js";import{S as we}from"./SetupPagesScreen-BUHI1NUC.js";import{F as Qe}from"./FeaturePreviewScreen-Dtyet701.js";import{a as h}from"./sentry-DjiAD8iq.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import{u as Xe}from"./useInitialThreadRequest-D5k70f5t.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import{D as _n}from"./DrawerScreen-CZJI9dis.js";import{M as et}from"./MobileAppDrawer-D25b_bdO.js";import{R as On}from"./ReimbursementApprovalRoutes-SIsIp9uZ.js";import{FallBackRoute as zn}from"./ScreenRoutes-bFwU6xQj.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.js";import"./analyticsHelper-CN7Nq3lV.js";import"./routePaths-CISchqL4.js";import"./BusinessVerificationPageScreen-BaDjUQw1.js";import"./ReimbursementApprovalRuleDetailScreen-EvJFbHZ_.js";import"./getLocaleForTenant-BfZYl7x_.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]="ed312c1d-0e22-4946-8961-c16fb79d4159",e._sentryDebugIdIdentifier="sentry-dbid-ed312c1d-0e22-4946-8961-c16fb79d4159")}catch{}})();const tt=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"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Je.getLocalizedStrings(),Hn=K(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=P.getSignedInUser(),d=ue(c),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ce(e,t.reimbursementId),u=ht(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,I=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,I=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,A=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:A},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:de(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:u.bankAccountCreationState,bankAccounts:u.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:I,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Ue(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,u)=>{i!=null&&e(ie(i,l,u,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ce(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Mt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ce(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Nt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,u)=>{e(Ut({reimbursementId:u,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,u)=>{e(Ft({reimbursementId:u,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(jt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Re(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Dt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Re("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(se({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Ne()),e(kt());const i=tt(o),l=W(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Ct("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(At(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(xn);function xe(){const e=q(),t=me(),n=V(),{reimbursementId:r}=Y(),c=Ze(),d=We(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:u}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:I}=l(v.isReimbursementCommentingEnabled),{isAiCfoOpen:x,setIsAiCfoOpen:A}=ge(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:p}=fe({isAiCfoOpen:x,setIsAiCfoOpen:A,mobileExploreReferrer:"Reimbursement Details"}),C=V().pathname,j=C.includes("edit"),N=C.includes("reimbursement/new"),[z,D]=h.useState(!1),w=P.getSignedInUser(),S=B(g=>J(g)),b=B(g=>ce(g,r)),M=Xe(S?.companyId,{clearParams:b.fetchState==="Completed"}),U=de(S?.userRole??[]);h.useEffect(()=>{(N&&!z||j&&b.fetchState!="Completed"&&b.fetchState!="In-Progress")&&(D(!0),t(je(!1,u,y,r)))});const $=B(g=>bt(g.accountState,g.accountListState,"reimbursementAccountList"));if(w==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return b.isDeleted===!0||b.billStage=="paid"||b.billStage=="scheduled"||b.fetchState=="Not-Started"||U&&b.billStatus==="rejected"||U===!1&&b.billStage==="pending_approval"&&b.billStatus!=="rejected"?s.jsx(_,{to:R}):b.deleteStatus.fetchState==="In-Progress"||b.fetchState!=="Completed"?s.jsx(Ve,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:k,onLoad:g=>(ae=>{r!=null&&b.deleteStatus.fetchState!=="Completed"&&ae.trackReimbursementEditReimbursement(r)})(g)}),m&&d!=="small"?s.jsx(Wn,{}):null,m&&d!=="small"?s.jsx(Vn,{children:s.jsx(Be,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:w?.userId??"",sessionId:w?.zeniSessionId??"",tenantId:S?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:g=>{g!=null&&t(ie(g,a,!0,r,w?.userId))},updateInvoiceUploadFetchState:g=>{t(se({reimbursementId:r,fetchState:g}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Jn,{children:[s.jsx(qn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(Be,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:w?.userId??"",sessionId:w?.zeniSessionId??"",tenantId:S?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:g=>{g!=null&&t(ie(g,a,!0,r,w?.userId))},updateInvoiceUploadFetchState:g=>{t(se({reimbursementId:r,fetchState:g}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Kn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:M??void 0,isReimbursementCommentingEnabled:I,location:n,navigate:e,currentTenant:S,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:p})})]})}const Zn=O.div`
1
+ import{j as s}from"./liveblocks-6kHh7NcJ.js";import{j as q,h as me,u as V,l as Y,g as B,N as _,k as K,i as ut,n as pt,o as E}from"./core-DYR9i5id.js";import{eN as J,MY as ce,c0 as de,Bt as je,jC as bt,BG as se,BF as ie,MZ as gt,bn as ue,fI as Fe,M_ as ht,Jk as ft,jr as Ue,Jl as Ae,Jm as St,il as It,Me as yt,iB as At,Bh as Rt,s6 as Ct,it as vt,C1 as Le,M$ as Ne,N0 as kt,N1 as Et,N2 as Bt,N3 as wt,N4 as xt,BN as Re,iH as Tt,Mn as Dt,BH as jt,Br as Ft,N5 as Ut,Bq as Lt,N6 as Nt,Bz as Ce,BR as Mt,BQ as Pt,BM as $t,N7 as Me,GE as _t,bo as Ot,BC as zt,Cj as Gt,N8 as Ht,N9 as Zt,BZ as Wt,BW as ve,LJ as Vt,Bo as Jt,Na as Pe,CI as ke,CQ as qt,Nb as Kt,Nc as Z,Nd as Qt,Ne as $e,Nf as Xt,Ng as _e,Nh as Oe,C9 as oe,bt as Yt,bE as pe,cA as be,eT as ze,eR as Ge,Ni as en,gD as tn,LW as nn,Nj as an,Nk as He,L_ as sn,MI as on,Nl as rn,MX as ln,CN as Ee,CM as mn,Nm as cn,Nn as dn,No as un,Np as pn,Nq as bn,Mt as gn,CD as hn,CH as fn,bv as Sn,bD as In,cv as yn,cj as An,bs as Rn,Il as Cn,cL as vn,cN as kn,cM as En,cu as Bn}from"./zeni-epic-state-BCudzeg6.js";import{w as Ze,q as We,a as ee,d as v,I as ge,z as P,bJ as Ve,x as te,e as k,aC as Be,o as F,ao as X,F as wn,D as Je,bK as xn,s as W,bL as Tn,A as ne,bM as Dn,J as jn,y as Fn,B as he,g as qe,a1 as Un,ba as Ln,N as Nn,h as Ke,bN as Mn,a4 as Pn}from"./index-7Qcu9V7y.js";import{n as O,S as $n}from"./mui-DDBWVnth.js";import re from"./NotFoundScreen-CKucympc.js";import{S as we}from"./SetupPagesScreen-B7fAoVY5.js";import{F as Qe}from"./FeaturePreviewScreen-Beu7_BUA.js";import{a as h}from"./sentry-ChHN7-iq.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DhFKV-ID.js";import{u as Xe}from"./useInitialThreadRequest-8CnQ_kPf.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import{D as _n}from"./DrawerScreen-3vtWe4MN.js";import{M as et}from"./MobileAppDrawer-BuJW5cST.js";import{R as On}from"./ReimbursementApprovalRoutes-IFnoykyS.js";import{FallBackRoute as zn}from"./ScreenRoutes-CoeN_n6E.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.js";import"./analyticsHelper-DgG_eN0U.js";import"./routePaths-rRL_rkmv.js";import"./BusinessVerificationPageScreen-BW9_l0ih.js";import"./ReimbursementApprovalRuleDetailScreen-CTc4fu7W.js";import"./getLocaleForTenant-yVGyr-Ah.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]="ed312c1d-0e22-4946-8961-c16fb79d4159",e._sentryDebugIdIdentifier="sentry-dbid-ed312c1d-0e22-4946-8961-c16fb79d4159")}catch{}})();const tt=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"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Je.getLocalizedStrings(),Hn=K(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=P.getSignedInUser(),d=ue(c),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ce(e,t.reimbursementId),u=ht(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,I=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,I=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,A=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:A},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:de(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:u.bankAccountCreationState,bankAccounts:u.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:I,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Ue(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,u)=>{i!=null&&e(ie(i,l,u,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ce(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Mt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ce(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Nt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,u)=>{e(Ut({reimbursementId:u,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,u)=>{e(Ft({reimbursementId:u,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(jt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Re(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Dt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Re("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(se({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Ne()),e(kt());const i=tt(o),l=W(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Ct("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(At(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(xn);function xe(){const e=q(),t=me(),n=V(),{reimbursementId:r}=Y(),c=Ze(),d=We(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:u}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:I}=l(v.isReimbursementCommentingEnabled),{isAiCfoOpen:x,setIsAiCfoOpen:A}=ge(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:p}=fe({isAiCfoOpen:x,setIsAiCfoOpen:A,mobileExploreReferrer:"Reimbursement Details"}),C=V().pathname,j=C.includes("edit"),N=C.includes("reimbursement/new"),[z,D]=h.useState(!1),w=P.getSignedInUser(),S=B(g=>J(g)),b=B(g=>ce(g,r)),M=Xe(S?.companyId,{clearParams:b.fetchState==="Completed"}),U=de(S?.userRole??[]);h.useEffect(()=>{(N&&!z||j&&b.fetchState!="Completed"&&b.fetchState!="In-Progress")&&(D(!0),t(je(!1,u,y,r)))});const $=B(g=>bt(g.accountState,g.accountListState,"reimbursementAccountList"));if(w==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return b.isDeleted===!0||b.billStage=="paid"||b.billStage=="scheduled"||b.fetchState=="Not-Started"||U&&b.billStatus==="rejected"||U===!1&&b.billStage==="pending_approval"&&b.billStatus!=="rejected"?s.jsx(_,{to:R}):b.deleteStatus.fetchState==="In-Progress"||b.fetchState!=="Completed"?s.jsx(Ve,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:k,onLoad:g=>(ae=>{r!=null&&b.deleteStatus.fetchState!=="Completed"&&ae.trackReimbursementEditReimbursement(r)})(g)}),m&&d!=="small"?s.jsx(Wn,{}):null,m&&d!=="small"?s.jsx(Vn,{children:s.jsx(Be,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:w?.userId??"",sessionId:w?.zeniSessionId??"",tenantId:S?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:g=>{g!=null&&t(ie(g,a,!0,r,w?.userId))},updateInvoiceUploadFetchState:g=>{t(se({reimbursementId:r,fetchState:g}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Jn,{children:[s.jsx(qn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(Be,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:w?.userId??"",sessionId:w?.zeniSessionId??"",tenantId:S?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:g=>{g!=null&&t(ie(g,a,!0,r,w?.userId))},updateInvoiceUploadFetchState:g=>{t(se({reimbursementId:r,fetchState:g}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Kn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:M??void 0,isReimbursementCommentingEnabled:I,location:n,navigate:e,currentTenant:S,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:p})})]})}const Zn=O.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-BDeoGIJv.js";import{u as x,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-CNW5dhSg.js";import{eN as E,f8 as g,IG as Ie,pJ as O,jf as ye,ii as Ce,t2 as ge,pO as Se,bv as we,IH as Te,II as Re,jr as Oe,bn as Fe,u5 as ke,IJ as Ae,IK as De,s_ as je,t6 as Pe,IL as G,IM as Ee,IN as Le,IO as Me,IP as Be,IQ as S,IR as F,IS as k,IT as H,IU as A,IV as D,dB as ve,tN as Ue,tB as N,tC as Y,tT as Ve,tG as q,tZ as xe,IW as ze,IX as Ge,IY as He,IZ as Ne,I_ as Ye,eT as qe,eR as $e}from"./zeni-epic-state-km4S-bKq.js";import{H as Ze,I as Je,q as Qe,a as J,d as j,z as Q,J as Ke,A as We,c as Xe,x as ea,e as P,g as aa,s as K,Y as sa,M as ta,N as oa}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import na from"./NotFoundScreen-C_R6jGEp.js";import{F as ra}from"./FeaturePreviewScreen-Dtyet701.js";import{a as h}from"./sentry-DjiAD8iq.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import{u as pa}from"./useInitialThreadRequest-D5k70f5t.js";import{t as $,a as Z}from"./routePaths-CISchqL4.js";import{M as fa}from"./MobileAppDrawer-D25b_bdO.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.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]="ab8f6b00-bc7d-4de5-b195-cdcc9482cfb4",e._sentryDebugIdIdentifier="sentry-dbid-ab8f6b00-bc7d-4de5-b195-cdcc9482cfb4")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ne()),e(Ye())},_a=he(function(e){const o=Q.getSignedInUser(),p=e.tenantState.currentTenantId,u=E(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Te(u);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,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Oe(e),isAccountingProjectsEnabled:Re(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(Y(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(Y(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return $(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?$(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({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(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Me({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Ee({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Pe())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),p=Qe(),u=ta(p),a=me(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=J(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=Q.getSignedInUser(),[i,y]=h.useState(!1),[L,W]=h.useState(!1),{isFeatureEnabled:M}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>E(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(M?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),T=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),R=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!L&&C==="Completed"&&b&&(s(O(l.userId,!1,!0,!1)),W(!0))},[i,L,C,b]),h.useEffect(()=>{if(i&&R.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(T){case"profit_and_loss":case"profit_and_loss_by_classes":s(Se(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,T,R,b]);const v=We(),oe=v?.loggedInUserRole!=null&&we(v?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),U=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),V=Ze(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>V?ma:void 0,[V]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:P,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:U}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:T,analytics:P,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:R,handleDrawerToggle:U,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:M,initialOpenThreadRequest:ee})]})}const w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=m(s=>E(s)),{useFeatureGate:o}=J(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=qe(p,e),a=$e(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Ua as default};
1
+ import{j as d}from"./liveblocks-6kHh7NcJ.js";import{u as x,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-DYR9i5id.js";import{eN as E,f8 as g,IG as Ie,pJ as O,jf as ye,ii as Ce,t2 as ge,pO as Se,bv as we,IH as Te,II as Re,jr as Oe,bn as Fe,u5 as ke,IJ as Ae,IK as De,s_ as je,t6 as Pe,IL as G,IM as Ee,IN as Le,IO as Me,IP as Be,IQ as S,IR as F,IS as k,IT as H,IU as A,IV as D,dB as ve,tN as Ue,tB as N,tC as Y,tT as Ve,tG as q,tZ as xe,IW as ze,IX as Ge,IY as He,IZ as Ne,I_ as Ye,eT as qe,eR as $e}from"./zeni-epic-state-BCudzeg6.js";import{H as Ze,I as Je,q as Qe,a as J,d as j,z as Q,J as Ke,A as We,c as Xe,x as ea,e as P,g as aa,s as K,Y as sa,M as ta,N as oa}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import na from"./NotFoundScreen-CKucympc.js";import{F as ra}from"./FeaturePreviewScreen-Beu7_BUA.js";import{a as h}from"./sentry-ChHN7-iq.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import{u as pa}from"./useInitialThreadRequest-8CnQ_kPf.js";import{t as $,a as Z}from"./routePaths-rRL_rkmv.js";import{M as fa}from"./MobileAppDrawer-BuJW5cST.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.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]="ab8f6b00-bc7d-4de5-b195-cdcc9482cfb4",e._sentryDebugIdIdentifier="sentry-dbid-ab8f6b00-bc7d-4de5-b195-cdcc9482cfb4")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ne()),e(Ye())},_a=he(function(e){const o=Q.getSignedInUser(),p=e.tenantState.currentTenantId,u=E(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Te(u);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,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Oe(e),isAccountingProjectsEnabled:Re(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(Y(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(Y(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return $(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?$(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({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(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Me({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Ee({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Pe())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),p=Qe(),u=ta(p),a=me(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=J(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=Q.getSignedInUser(),[i,y]=h.useState(!1),[L,W]=h.useState(!1),{isFeatureEnabled:M}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>E(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(M?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),T=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),R=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!L&&C==="Completed"&&b&&(s(O(l.userId,!1,!0,!1)),W(!0))},[i,L,C,b]),h.useEffect(()=>{if(i&&R.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(T){case"profit_and_loss":case"profit_and_loss_by_classes":s(Se(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,T,R,b]);const v=We(),oe=v?.loggedInUserRole!=null&&we(v?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),U=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),V=Ze(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>V?ma:void 0,[V]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:P,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:U}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:T,analytics:P,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:R,handleDrawerToggle:U,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:M,initialOpenThreadRequest:ee})]})}const w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=m(s=>E(s)),{useFeatureGate:o}=J(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=qe(p,e),a=$e(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Ua as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-BDeoGIJv.js";import{a as j,z as w,aI as y,x as E,e as p,g as F,cC as P,d as L}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import l from"./NotFoundScreen-C_R6jGEp.js";import{a as d}from"./sentry-DjiAD8iq.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as u}from"./core-CNW5dhSg.js";import{eN as z,Ph as C,M7 as Y,Pi as k,ts as q,eZ as G,Pj as M,tq as O}from"./zeni-epic-state-km4S-bKq.js";import{R as x}from"./ReferralListScreen-2ts8iKsm.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.js";import"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import"./MobileAppDrawer-D25b_bdO.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]="7498f537-8dc2-41aa-bcdd-2292932ee7b6",e._sentryDebugIdIdentifier="sentry-dbid-7498f537-8dc2-41aa-bcdd-2292932ee7b6")}catch{}})();const Z=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=w.getSignedInUser();return{onDismissClick:()=>{e(k()),n("..")},onSendClick:()=>{if(o!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(M({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=d.useState(!1),[o,s]=d.useState(!1),r=b(i=>z(i)),c=V(),v=A(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(i=>C(i)),_=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),I=Y(D);d.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&o===!1&&(e(q()),s(!0))},[]),d.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:i=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,a.jsx(Z,{navigate:c,location:v,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
1
+ import{j as a}from"./liveblocks-6kHh7NcJ.js";import{a as j,z as w,aI as y,x as E,e as p,g as F,cC as P,d as L}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import l from"./NotFoundScreen-CKucympc.js";import{a as d}from"./sentry-ChHN7-iq.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as u}from"./core-DYR9i5id.js";import{eN as z,Ph as C,M7 as Y,Pi as k,ts as q,eZ as G,Pj as M,tq as O}from"./zeni-epic-state-BCudzeg6.js";import{R as x}from"./ReferralListScreen-Bcsyrif0.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.js";import"./useAskAiCfoHostNavButtonProps-DhFKV-ID.js";import"./useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js";import"./MobileAppDrawer-BuJW5cST.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]="7498f537-8dc2-41aa-bcdd-2292932ee7b6",e._sentryDebugIdIdentifier="sentry-dbid-7498f537-8dc2-41aa-bcdd-2292932ee7b6")}catch{}})();const Z=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=w.getSignedInUser();return{onDismissClick:()=>{e(k()),n("..")},onSendClick:()=>{if(o!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(M({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=d.useState(!1),[o,s]=d.useState(!1),r=b(i=>z(i)),c=V(),v=A(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(i=>C(i)),_=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),I=Y(D);d.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&o===!1&&(e(q()),s(!0))},[]),d.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:i=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,a.jsx(Z,{navigate:c,location:v,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DdT_Y42s.js","assets/sentry-DjiAD8iq.js","assets/core-CNW5dhSg.js","assets/zeni-epic-state-km4S-bKq.js","assets/index-D49e6fWF.js","assets/mui-B2x4GL6c.js","assets/analytics-CjaLm2aW.js","assets/utils-C3tzQnc0.js","assets/withTransactionSidePanel-Crse1y6I.js","assets/useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js","assets/useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js","assets/TransactionDetailScreen-Cn7pRp3Q.js","assets/decodeURIComponentSafe-B2xCvVcj.js","assets/routePaths-CISchqL4.js","assets/NotFoundScreen-C_R6jGEp.js","assets/analyticsHelper-CN7Nq3lV.js","assets/CompanyPassportScreen-DSjn5RV_.js","assets/MobileAppDrawer-D25b_bdO.js","assets/FeaturePreviewScreen-Dtyet701.js","assets/ReferralListScreen-2ts8iKsm.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-Cl3RqP7N.js","assets/AddressScreen-C2Pdt_bq.js","assets/DomesticWireDetailScreen-Dq7eTlwY.js","assets/useInitialThreadRequest-D5k70f5t.js","assets/DrawerScreen-CZJI9dis.js","assets/SetupPagesScreen-BUHI1NUC.js","assets/BusinessVerificationPageScreen-BaDjUQw1.js","assets/BillPayApprovalRoutes-WIACRA6B.js","assets/ReimbursementApprovalRuleDetailScreen-EvJFbHZ_.js","assets/getLocaleForTenant-BfZYl7x_.js","assets/ReimbursementRoutes-Ddbd312R.js","assets/ReimbursementApprovalRoutes-SIsIp9uZ.js","assets/TransactionListRoutes-D12F9dhf.js","assets/ZeniAccountStatementScreen-BuItZxm7.js","assets/SettingsRoutes-n0JcYOBn.js","assets/accountMappingHelper-CHBH046Z.js","assets/QBOConnectionScreen-CgvXukjZ.js","assets/empty-CzR1IqVo.js","assets/index-Cme59vnn.js","assets/url-DtTK63_K.js","assets/index-2XXzCcMZ.js","assets/ReportsRoutes-Cy_IpMxr.js","assets/ChargeCardRoutes-CC5bDkHl.js","assets/PeopleRoutes-CVo7q-3K.js","assets/ExpenseAutomationRoutes-C0g_h5Bq.js","assets/TreasuryRoutes-BUlDXs_P.js","assets/VendorsRoutes-CD5smolJ.js","assets/pathToGoBack-BIOg1-1o.js","assets/ZeniAccountRoutes-DcXqQtKj.js","assets/AddressRoutes-g_S9tXfT.js","assets/PandLWithForecastRoutes-B2ImYfbh.js","assets/CustomerOnboardingRoutes-B3jdgE0f.js","assets/TransactionDetailRoutes-BTWL8leD.js","assets/EntityDetailRoutes-CCZjRoaK.js","assets/NotificationRoutes-BoTdon-B.js","assets/PerformanceRoutes-CEQsEs7o.js","assets/RewardsRoutes-BYadKe9G.js","assets/TaskRoutes-CRYjlzbB.js","assets/TaskListScreen-CzZw-t2z.js","assets/AiCfoScreen-Bpnjeq7V.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eN as ls,eT as cs,eR as ds,eS as ms,fD as us,eP as _s,cO as Ae,cv as As,f9 as Es,cn as ps,bC as Is,bq as gs,fe as xs,v as Ts,Ik as hs,bv as js,Il as Us,bE as fs,fb as bs,bD as Ds,bs as Hs,cj as Rs,Im as ys,In as Cs,cL as vs,cN as Os,cM as Ps,cu as Fs,cA as Ls,mm as Ee,eO as pe,fN as Bs,fi as Ie,fK as ge,fL as xe,fj as ks}from"./zeni-epic-state-km4S-bKq.js";import{j as e}from"./liveblocks-BDeoGIJv.js";import{a as v}from"./sentry-DjiAD8iq.js";import{h as Vs,j as Ns,l as Ss,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-CNW5dhSg.js";import{h as ws,u as zs,z as b,a as Gs,c as $s,E as Ys,d as L,A as qs,L as B,D as he,t as _,P as Ws,e as X,l}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import{f as je}from"./analyticsHelper-CN7Nq3lV.js";import{t as Ks}from"./getLocaleForTenant-BfZYl7x_.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="bf489b18-44e5-48f4-91fc-a2f0f52df4f3",i._sentryDebugIdIdentifier="sentry-dbid-bf489b18-44e5-48f4-91fc-a2f0f52df4f3")}catch{}})();const Js={dashboard:()=>n(()=>import("./DashboardRoutes-DdT_Y42s.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-Cl3RqP7N.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-Ddbd312R.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-D12F9dhf.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-n0JcYOBn.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-Cy_IpMxr.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-CC5bDkHl.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-CVo7q-3K.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-C0g_h5Bq.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-BUlDXs_P.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-CD5smolJ.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-DcXqQtKj.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-Cy_IpMxr.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-g_S9tXfT.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-CVo7q-3K.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-B2ImYfbh.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-B3jdgE0f.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-CD5smolJ.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-BTWL8leD.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-CCZjRoaK.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-DdT_Y42s.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),fe=l(()=>n(()=>import("./BillPayRoutes-Cl3RqP7N.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-n0JcYOBn.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),be=l(()=>n(()=>import("./ReimbursementRoutes-Ddbd312R.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-DcXqQtKj.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-BUlDXs_P.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-D12F9dhf.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-CC5bDkHl.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-BoTdon-B.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),An=l(()=>n(()=>import("./PerformanceRoutes-CEQsEs7o.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),En=l(()=>n(()=>import("./ExpenseAutomationRoutes-C0g_h5Bq.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-BYadKe9G.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-CRYjlzbB.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-Bpnjeq7V.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),R=l(()=>n(()=>import("./NotFoundScreen-C_R6jGEp.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-CzZw-t2z.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ns(),{tenantEmailDomain:o}=Ss(),N=ws().mode,{setLoading:y,clearAllLoading:O,clearLoading:Z}=zs(),H=b.getSignedInUserTenant(o)?.tenantId,h=b.getSignedInUser(),K=os(h),G=Ms(),[S,He]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=Gs(),J=$s(),Re=Ys(),{isFeatureEnabled:ye}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||ye&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),E=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=b.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,N)}const w={tenantId:H,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),A=qs(),Ne=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Se=As(A?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?Es(a,w.tenantId):void 0);v.useEffect(()=>{y(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&H!=null){const a=Q.params.selectedPeriod;if(a!=null){const f=a.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(H,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,H]),v.useEffect(()=>{S||(He(!0),y(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&b.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,f,d,s){if(pe(f?.userId,f?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=b.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,b]),v.useEffect(()=>{b.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,f,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=b.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(f==="Completed"||f==="Error");a==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,H,h,y,U))},[H,E]),v.useEffect(()=>{b.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),b.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,N,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&y(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&H!=null?(O(),_.markActiveTenantFetchCompleted(H)):E==="Error"&&H!=null&&(_.markActiveTenantFetchFailed(H),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,H,S]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&S&&(ie.current=!0,function(a=Qs,f=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Js[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},f)}())},[E,S]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&fs(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&bs(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Ds(A?.loggedInUserRoleMap),Ke=oe&&Hs(A?.loggedInUserRoleMap),Je=me&&Rs(A?.loggedInUserRoleMap),Qe=ys(A?.loggedInUserRoleMap),Xe=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Se===!0||Ge===!0||Qe===!0||Xe===!0;return b.isSignedIn()?H==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!S||le!==!1||te||K?S&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Je||Ke?e.jsx(en,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(R,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(R,{})}),e.jsx(t,{path:"performance",element:Re?e.jsx(An,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(En,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Ne?e.jsx(tn,{}):e.jsx(R,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(fe,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(fe,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(be,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(be,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(R,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(R,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(R,{})}),e.jsx(t,{path:"/ai-cfo",element:J?e.jsx(c,{to:"explore"}):e.jsx(R,{})}),e.jsx(t,{path:"/ai-cfo/",element:J?e.jsx(c,{to:"explore"}):e.jsx(R,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:J?e.jsx(gn,{isFileUploadEnabled:Ve}):e.jsx(R,{})}),e.jsx(t,{path:"*",element:e.jsx(R,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:N,isUserHasTreasuryAccess:y,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):y?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):N?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:N,isTenantBankingOnly:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(fn,{tenantEmailDomain:O}):N?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(bn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(R,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),fn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),De=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,wn as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-D38asGsh.js","assets/sentry-ChHN7-iq.js","assets/core-DYR9i5id.js","assets/zeni-epic-state-BCudzeg6.js","assets/index-7Qcu9V7y.js","assets/mui-DDBWVnth.js","assets/analytics-C_YuIGuR.js","assets/utils-BS7Du9ue.js","assets/withTransactionSidePanel-CyEXLPB4.js","assets/useAskAiCfoHostNavButtonProps-DhFKV-ID.js","assets/useFetchSuggestedQuestionsWhenReady-kbmuYOBC.js","assets/TransactionDetailScreen-BabMxJp1.js","assets/decodeURIComponentSafe-jUJvXFoR.js","assets/routePaths-rRL_rkmv.js","assets/NotFoundScreen-CKucympc.js","assets/analyticsHelper-DgG_eN0U.js","assets/CompanyPassportScreen-DIVButb9.js","assets/MobileAppDrawer-BuJW5cST.js","assets/FeaturePreviewScreen-Beu7_BUA.js","assets/ReferralListScreen-Bcsyrif0.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-BPjOyQd9.js","assets/AddressScreen-B5d2oxIz.js","assets/DomesticWireDetailScreen-BH4s0VZE.js","assets/useInitialThreadRequest-8CnQ_kPf.js","assets/DrawerScreen-3vtWe4MN.js","assets/SetupPagesScreen-B7fAoVY5.js","assets/BusinessVerificationPageScreen-BW9_l0ih.js","assets/BillPayApprovalRoutes-Bq753rTI.js","assets/ReimbursementApprovalRuleDetailScreen-CTc4fu7W.js","assets/getLocaleForTenant-yVGyr-Ah.js","assets/ReimbursementRoutes-CiM5_hoN.js","assets/ReimbursementApprovalRoutes-IFnoykyS.js","assets/TransactionListRoutes-BpC1aNv-.js","assets/ZeniAccountStatementScreen-sqtSdDtO.js","assets/SettingsRoutes-CrNZ8nLT.js","assets/accountMappingHelper-DQry8vuU.js","assets/QBOConnectionScreen-BmvFp4HA.js","assets/empty-DMHTn4jL.js","assets/index-CZ0AqUEL.js","assets/url-CIXgNG7Z.js","assets/index-B1RNmiHY.js","assets/ReportsRoutes-DW4Lvua2.js","assets/ChargeCardRoutes-Bzb0MJ_j.js","assets/PeopleRoutes-Cxj6W34l.js","assets/ExpenseAutomationRoutes-BGWKWxKi.js","assets/TreasuryRoutes-A47Z9LBV.js","assets/VendorsRoutes-B5epP984.js","assets/pathToGoBack-BQooRrY4.js","assets/ZeniAccountRoutes-6OZDjfTY.js","assets/AddressRoutes-BgG3fjpG.js","assets/PandLWithForecastRoutes-CPbktWsV.js","assets/CustomerOnboardingRoutes-CAhuciQG.js","assets/TransactionDetailRoutes-dAhP_gCB.js","assets/EntityDetailRoutes-BRxE1gXs.js","assets/NotificationRoutes-BJIlt9ug.js","assets/PerformanceRoutes-rJuJzOMj.js","assets/RewardsRoutes-DCemfpba.js","assets/TaskRoutes-CKnEGxnr.js","assets/TaskListScreen-Vx58OWx-.js","assets/AiCfoScreen-D9r_UxpW.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eN as ls,eT as cs,eR as ds,eS as ms,fD as us,eP as _s,cO as Ae,cv as As,f9 as Es,cn as ps,bC as Is,bq as gs,fe as xs,v as Ts,Ik as hs,bv as js,Il as Us,bE as fs,fb as bs,bD as Ds,bs as Hs,cj as Rs,Im as ys,In as Cs,cL as vs,cN as Os,cM as Ps,cu as Fs,cA as Ls,mm as Ee,eO as pe,fN as Bs,fi as Ie,fK as ge,fL as xe,fj as ks}from"./zeni-epic-state-BCudzeg6.js";import{j as e}from"./liveblocks-6kHh7NcJ.js";import{a as v}from"./sentry-ChHN7-iq.js";import{h as Vs,j as Ns,l as Ss,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-DYR9i5id.js";import{h as ws,u as zs,z as b,a as Gs,c as $s,E as Ys,d as L,A as qs,L as B,D as he,t as _,P as Ws,e as X,l}from"./index-7Qcu9V7y.js";import"./mui-DDBWVnth.js";import{f as je}from"./analyticsHelper-DgG_eN0U.js";import{t as Ks}from"./getLocaleForTenant-yVGyr-Ah.js";import"./recharts-tHwhBmfE.js";import"./analytics-C_YuIGuR.js";import"./plaid-CMj0RgAb.js";import"./dnd-YBJMUV5c.js";import"./stripe-DMRn4zHo.js";import"./lottie-D_WL55u0.js";import"./lexical-B0v2dFpm.js";import"./pdf-BJwNP7gO.js";import"./utils-BS7Du9ue.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="bf489b18-44e5-48f4-91fc-a2f0f52df4f3",i._sentryDebugIdIdentifier="sentry-dbid-bf489b18-44e5-48f4-91fc-a2f0f52df4f3")}catch{}})();const Js={dashboard:()=>n(()=>import("./DashboardRoutes-D38asGsh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-BPjOyQd9.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-CiM5_hoN.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-BpC1aNv-.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-CrNZ8nLT.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-DW4Lvua2.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-Bzb0MJ_j.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-Cxj6W34l.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-BGWKWxKi.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-A47Z9LBV.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-B5epP984.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-6OZDjfTY.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-DW4Lvua2.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-BgG3fjpG.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-Cxj6W34l.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-CPbktWsV.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-CAhuciQG.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-B5epP984.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-dAhP_gCB.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-BRxE1gXs.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-D38asGsh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),fe=l(()=>n(()=>import("./BillPayRoutes-BPjOyQd9.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-CrNZ8nLT.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),be=l(()=>n(()=>import("./ReimbursementRoutes-CiM5_hoN.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-6OZDjfTY.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-A47Z9LBV.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-BpC1aNv-.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-Bzb0MJ_j.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-BJIlt9ug.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),An=l(()=>n(()=>import("./PerformanceRoutes-rJuJzOMj.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),En=l(()=>n(()=>import("./ExpenseAutomationRoutes-BGWKWxKi.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-DCemfpba.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-CKnEGxnr.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-D9r_UxpW.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),R=l(()=>n(()=>import("./NotFoundScreen-CKucympc.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-Vx58OWx-.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ns(),{tenantEmailDomain:o}=Ss(),N=ws().mode,{setLoading:y,clearAllLoading:O,clearLoading:Z}=zs(),H=b.getSignedInUserTenant(o)?.tenantId,h=b.getSignedInUser(),K=os(h),G=Ms(),[S,He]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=Gs(),J=$s(),Re=Ys(),{isFeatureEnabled:ye}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||ye&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),E=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=b.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,N)}const w={tenantId:H,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),A=qs(),Ne=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Se=As(A?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?Es(a,w.tenantId):void 0);v.useEffect(()=>{y(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&H!=null){const a=Q.params.selectedPeriod;if(a!=null){const f=a.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(H,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,H]),v.useEffect(()=>{S||(He(!0),y(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&b.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,f,d,s){if(pe(f?.userId,f?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=b.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,b]),v.useEffect(()=>{b.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,f,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=b.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(f==="Completed"||f==="Error");a==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,H,h,y,U))},[H,E]),v.useEffect(()=>{b.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),b.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,N,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&y(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&H!=null?(O(),_.markActiveTenantFetchCompleted(H)):E==="Error"&&H!=null&&(_.markActiveTenantFetchFailed(H),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,H,S]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&S&&(ie.current=!0,function(a=Qs,f=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Js[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},f)}())},[E,S]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&fs(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&bs(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Ds(A?.loggedInUserRoleMap),Ke=oe&&Hs(A?.loggedInUserRoleMap),Je=me&&Rs(A?.loggedInUserRoleMap),Qe=ys(A?.loggedInUserRoleMap),Xe=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Se===!0||Ge===!0||Qe===!0||Xe===!0;return b.isSignedIn()?H==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!S||le!==!1||te||K?S&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Je||Ke?e.jsx(en,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(R,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(R,{})}),e.jsx(t,{path:"performance",element:Re?e.jsx(An,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(En,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Ne?e.jsx(tn,{}):e.jsx(R,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(fe,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(fe,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(be,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(be,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(R,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(R,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(R,{})}),e.jsx(t,{path:"/ai-cfo",element:J?e.jsx(c,{to:"explore"}):e.jsx(R,{})}),e.jsx(t,{path:"/ai-cfo/",element:J?e.jsx(c,{to:"explore"}):e.jsx(R,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:J?e.jsx(gn,{isFileUploadEnabled:Ve}):e.jsx(R,{})}),e.jsx(t,{path:"*",element:e.jsx(R,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:N,isUserHasTreasuryAccess:y,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):y?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):N?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:N,isTenantBankingOnly:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(fn,{tenantEmailDomain:O}):N?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(bn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(R,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),fn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),De=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,wn as default};