@zeniai/web-app-ui 5.0.95-dev → 5.0.95-qa

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 (60) hide show
  1. package/dist/assets/{AddressRoutes-0Eyzeqmo.js → AddressRoutes-CjTHTSuI.js} +1 -1
  2. package/dist/assets/{AddressScreen-C1kNIoFW.js → AddressScreen-CqBa6_-n.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-DiEWR7_7.js → AiCfoScreen-BXUvjbhu.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-BFuKAoJn.js → BillPayApprovalRoutes-DLpMtIRS.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-yYgD8ElZ.js → BillPayRoutes-B5l3Tw20.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-LVeN_2_9.js → BusinessVerificationPageScreen-CSKO8lFK.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-Dqh0dx38.js → ChargeCardRoutes-jWkInVo_.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-CoCoQTkp.js → CompanyPassportScreen-CKvp1ssr.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-B7BFXXXS.js → ConnectionAuthScreen-B4RQUYL_.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-D5Bh3dbO.js → CustomerOnboardingAuthScreen-BGqU9gPw.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-BeOSK0bV.js → CustomerOnboardingRoutes-Dr5zRy1K.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DeXVvCqq.js → DashboardRoutes-pJhHX-2b.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-DZiebdrx.js → DefaultTenantHome-DPWdITeE.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BU_VenPR.js → DomesticWireDetailScreen-SKLAPI0e.js} +1 -1
  15. package/dist/assets/{DrawerScreen-BbhUunYL.js → DrawerScreen-D5UV8-Be.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-DdiBSVG3.js → EntityDetailRoutes-gOpFte8h.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-hIKcsGeT.js → ExpenseAutomationRoutes-ARewAzCQ.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-C1-h6LMu.js → FeaturePreviewScreen-CWGIZoD1.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-C_sETmGk.js → HubSpotOAuthCallbackScreen-DZdAM3r7.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-DZdU0REk.js → MagicLinkRoutes-GUUoK2nF.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-BDghb4vk.js → MagicLinkSignInScreen-Im4VESmI.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-CgbJlL9u.js → MobileAppDrawer-DjZLcHYq.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-DjvK1NbN.js → NotFoundScreen-GGUH6kfI.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-HNy89jXR.js → NotificationRoutes-BoplnVa2.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-BRyPWMqe.js → OAuthConsentScreen-DxwRtYz2.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-CBP1v8tZ.js → PandLWithForecastRoutes-D8O3Fecf.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-B7-ewz69.js → PeopleRoutes-DreG0KS5.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-COR3BTZa.js → PerformanceRoutes-BWWDxy3D.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-BRbkYHuP.js → QBOConnectionScreen-DckktUOs.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-C5_wj8jW.js → ReferralListScreen-deq5DiBs.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-DNyMDR4t.js → ReimbursementApprovalRoutes-XhXfCwat.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CO_HtFbP.js → ReimbursementApprovalRuleDetailScreen-BK03a97e.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-pmb5ZMBe.js → ReimbursementRoutes-BOTzgYhv.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-C9h_dCJo.js → ReportsRoutes-d5fJ62NK.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-COWJicvP.js → RewardsRoutes-C4s9WH-A.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-DB3q5PNA.js → ScreenRoutes-D5644a5x.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-DEx1uOuX.js → SettingsRoutes-DOALXrsx.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-DM0dhGt1.js → SetupPagesScreen-BYhmd0-N.js} +1 -1
  39. package/dist/assets/{SignInScreen-BIF8y6r_.js → SignInScreen-CLFmIoF3.js} +1 -1
  40. package/dist/assets/{SignOutScreen-D0ouX99i.js → SignOutScreen-GZOa1gnF.js} +1 -1
  41. package/dist/assets/{TaskListScreen-CQTVeDwe.js → TaskListScreen-DXLUHaMY.js} +1 -1
  42. package/dist/assets/{TaskRoutes-DzCuQY-E.js → TaskRoutes-CBpVhxjZ.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-BjnNsU6t.js → TransactionDetailRoutes-BM0mSWXo.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-BSarw1vq.js → TransactionDetailScreen-Mjv-0Vsi.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-CXfUmvjI.js → TransactionListRoutes-DX4_qMdv.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-CDE_tE4t.js → TreasuryRoutes-33SOS81s.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-Cz9uX3LH.js → VendorsRoutes-D8t3eTpL.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-B9n09x9Y.js → WiseConfirmationScreen-C9nK-3Oh.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-DIt49_h_.js → ZeniAccountRoutes-BhbbjK45.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-Dafm8AUT.js → ZeniAccountStatementScreen-BSfOyBC_.js} +1 -1
  51. package/dist/assets/{analyticsHelper-D8sAsSDg.js → analyticsHelper-Cnf9wNpk.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-ht-6GSU5.js → getLocaleForTenant-DX4sTRBy.js} +1 -1
  53. package/dist/assets/{index-D8hCAHx9.js → index-CtCI_jgi.js} +5 -5
  54. package/dist/assets/{routePaths-XreQojZr.js → routePaths-Bd-gFJIO.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CvDMoudE.js → useAiCfoDashboardSuggestedQuestionsChips-CjjIkZeq.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-CDnIxewv.js → useAskAiCfoHostNavButtonProps-CMgniebB.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-BHiBt2ra.js → useInitialThreadRequest-CHUXHA4e.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-C7OFQuvJ.js → withTransactionSidePanel-KXh--JtC.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BSDLCmF2.js";import{a as g}from"./sentry-67DqaLi1.js";import{u as U,g as w,h as _,s as J,j as l,N as T}from"./core-B20PugrR.js";import{z as r,m as P,O as M,e as V,d as A,f as N,j as W,T as R,h as $}from"./index-D8hCAHx9.js";import{eP as q,Jl as B,Jv as G,Jm as H,eW as K,fn as Q,Jr as X,fL as Y,cT as Z,Jw as ee,Jx as te}from"./zeni-epic-state-B3AwsZqW.js";import{n as ne}from"./mui-BBkBdMVO.js";import{u as se}from"./useDeviceId-CZrGGxHD.js";import{f as ae}from"./analyticsHelper-D8sAsSDg.js";import{t as ie}from"./getLocaleForTenant-ht-6GSU5.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="724808a0-9489-494a-9525-88bcd35e5214",t._sentryDebugIdIdentifier="sentry-dbid-724808a0-9489-494a-9525-88bcd35e5214")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=U(),a=w(),f=_(),[y]=J(),n=y.get("token"),p=y.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:z,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),k=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),M.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,b,s,o,k,v,a.state,t]);const j=g.useCallback(()=>{f("/signin/auth")},[f]),O=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:z,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:O,onVerifyOtp:F,onCancelVerifyDevice:j});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||m==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-BSDLCmF2.js";import{a as g}from"./sentry-67DqaLi1.js";import{u as U,g as w,h as _,s as J,j as l,N as T}from"./core-B20PugrR.js";import{z as r,m as P,O as M,e as V,d as A,f as N,j as W,T as R,h as $}from"./index-CtCI_jgi.js";import{eP as q,Jl as B,Jv as G,Jm as H,eW as K,fn as Q,Jr as X,fL as Y,cT as Z,Jw as ee,Jx as te}from"./zeni-epic-state-B3AwsZqW.js";import{n as ne}from"./mui-BBkBdMVO.js";import{u as se}from"./useDeviceId-CZrGGxHD.js";import{f as ae}from"./analyticsHelper-Cnf9wNpk.js";import{t as ie}from"./getLocaleForTenant-DX4sTRBy.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="724808a0-9489-494a-9525-88bcd35e5214",t._sentryDebugIdIdentifier="sentry-dbid-724808a0-9489-494a-9525-88bcd35e5214")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=U(),a=w(),f=_(),[y]=J(),n=y.get("token"),p=y.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:z,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),k=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),M.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,b,s,o,k,v,a.state,t]);const j=g.useCallback(()=>{f("/signin/auth")},[f]),O=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:z,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:O,onVerifyOtp:F,onCancelVerifyDevice:j});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||m==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1 +1 @@
1
- import{j as U}from"./liveblocks-BSDLCmF2.js";import{a as c}from"./sentry-67DqaLi1.js";import{u as pe,j as s,i as We,g as qe,h as Ke,l as M}from"./core-B20PugrR.js";import{eP as he,e$ as Qe,f0 as Se,eT as Xe,bn as ea,eO as aa,f1 as ta,f2 as na,f4 as sa,f7 as oa,fg as ia,f8 as g,fa as ra,fb as ue,fe as da,fc as la,fd as ca,ff as ua,cJ as fa,fi as ma,cO as ba,bt as pa,eS as ha,fn as Sa,fo as ga,fm as Ea}from"./zeni-epic-state-B3AwsZqW.js";import{a7 as ka,a8 as Ca,F as ya,w as Ia,z as k,v as Ta,u as wa,I as r,a9 as Aa,aa as Fa,k as _a,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ga,ae as fe,af as me,L as Pa,ag as Ma,ah as be,d as R,$ as Ra,s as A,ai as N,aj as Na}from"./index-D8hCAHx9.js";import{D as Ua}from"./mui-BBkBdMVO.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="73237f0c-2085-4fde-aaf7-8715c54bf51c",f._sentryDebugIdIdentifier="sentry-dbid-73237f0c-2085-4fde-aaf7-8715c54bf51c")}catch{}})();const Va=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=qe(),C=ya(),o=Ke(),V=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=k.getSignedInUser(),F=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,x=s(e=>aa(e)),j=x.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[_,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,H),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabledV2),q=W||J&&F,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=F||!F&&$e,Ge=n.company!=null&&ia(n.company),w=ve&&Ge,Pe=s(e=>g(e).totalUnreadCount),Me=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ue={fetchStatus:Me,count:Pe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=_a(),oe=s(e=>la(e,S,h,W,J,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(xe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,H,n),re=Da(),Ye=re&&va(a),de=ba(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Je=Ba(Ze);return U.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ga,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:Je,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:q&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>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),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/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[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(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&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:_e,newYearAnimationEnabled:De})})}),Ha=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Ha as M};
1
+ import{j as U}from"./liveblocks-BSDLCmF2.js";import{a as c}from"./sentry-67DqaLi1.js";import{u as pe,j as s,i as We,g as qe,h as Ke,l as M}from"./core-B20PugrR.js";import{eP as he,e$ as Qe,f0 as Se,eT as Xe,bn as ea,eO as aa,f1 as ta,f2 as na,f4 as sa,f7 as oa,fg as ia,f8 as g,fa as ra,fb as ue,fe as da,fc as la,fd as ca,ff as ua,cJ as fa,fi as ma,cO as ba,bt as pa,eS as ha,fn as Sa,fo as ga,fm as Ea}from"./zeni-epic-state-B3AwsZqW.js";import{a7 as ka,a8 as Ca,F as ya,w as Ia,z as k,v as Ta,u as wa,I as r,a9 as Aa,aa as Fa,k as _a,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ga,ae as fe,af as me,L as Pa,ag as Ma,ah as be,d as R,$ as Ra,s as A,ai as N,aj as Na}from"./index-CtCI_jgi.js";import{D as Ua}from"./mui-BBkBdMVO.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="73237f0c-2085-4fde-aaf7-8715c54bf51c",f._sentryDebugIdIdentifier="sentry-dbid-73237f0c-2085-4fde-aaf7-8715c54bf51c")}catch{}})();const Va=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=qe(),C=ya(),o=Ke(),V=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=k.getSignedInUser(),F=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,x=s(e=>aa(e)),j=x.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[_,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,H),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabledV2),q=W||J&&F,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=F||!F&&$e,Ge=n.company!=null&&ia(n.company),w=ve&&Ge,Pe=s(e=>g(e).totalUnreadCount),Me=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ue={fetchStatus:Me,count:Pe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=_a(),oe=s(e=>la(e,S,h,W,J,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(xe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,H,n),re=Da(),Ye=re&&va(a),de=ba(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Je=Ba(Ze);return U.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ga,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:Je,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:q&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>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),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/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[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(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&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:_e,newYearAnimationEnabled:De})})}),Ha=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Ha as M};
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-BSDLCmF2.js";import{h as r,n}from"./core-B20PugrR.js";import{Q as i}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import"./sentry-67DqaLi1.js";import"./zeni-epic-state-B3AwsZqW.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="e552295f-ad8f-4911-819f-e7382b348622",o._sentryDebugIdIdentifier="sentry-dbid-e552295f-ad8f-4911-819f-e7382b348622")}catch{}})();const f=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
1
+ import{j as e}from"./liveblocks-BSDLCmF2.js";import{h as r,n}from"./core-B20PugrR.js";import{Q as i}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import"./sentry-67DqaLi1.js";import"./zeni-epic-state-B3AwsZqW.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="e552295f-ad8f-4911-819f-e7382b348622",o._sentryDebugIdIdentifier="sentry-dbid-e552295f-ad8f-4911-819f-e7382b348622")}catch{}})();const f=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-BSDLCmF2.js";import lt from"./NotFoundScreen-DjvK1NbN.js";import{a as k}from"./sentry-67DqaLi1.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as J}from"./core-B20PugrR.js";import{cr as St,f1 as Y,eP as H,ff as bt,f8 as b,PS as O,fb as d,f0 as y,q_ as M,wl as It,PT as Ct,e$ as Tt,fi as yt,r3 as _t,PU as $,bq as F,gQ as x,r7 as K,PV as At,cC as Et,cw as Nt}from"./zeni-epic-state-B3AwsZqW.js";import{Y as wt,z as Bt,w as xt,I as Pt,_ as Rt,cA as Ut,s as N,a7 as Dt,cB as vt,a8 as Gt,r as $t}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="963c1e6c-1b11-431d-8251-b8d8505880d6",t._sentryDebugIdIdentifier="sentry-dbid-963c1e6c-1b11-431d-8251-b8d8505880d6")}catch{}})();const Mt=(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)})}),jt=kt(function(t,l){const n=Y(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(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:w,fetchMoreCommentsNotifications:P}=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(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(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 P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(w(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({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")),Mt(s,w).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({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=$t(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}})}}})(Dt(vt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[w,P]=k.useState(!1),a=S(e=>Y(e)),o=S(e=>H(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const X=bt(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),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Ut().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:L,hasFetchedAll:Q}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const v=_||D===!0||C!==!0||_||D===!0||C!==!0;k.useEffect(()=>{v&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):v||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[v,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&B!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(L||Q===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,D,L,C,Q,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:X,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(J,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(J,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
1
+ import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-BSDLCmF2.js";import lt from"./NotFoundScreen-GGUH6kfI.js";import{a as k}from"./sentry-67DqaLi1.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as J}from"./core-B20PugrR.js";import{cr as St,f1 as Y,eP as H,ff as bt,f8 as b,PS as O,fb as d,f0 as y,q_ as M,wl as It,PT as Ct,e$ as Tt,fi as yt,r3 as _t,PU as $,bq as F,gQ as x,r7 as K,PV as At,cC as Et,cw as Nt}from"./zeni-epic-state-B3AwsZqW.js";import{Y as wt,z as Bt,w as xt,I as Pt,_ as Rt,cA as Ut,s as N,a7 as Dt,cB as vt,a8 as Gt,r as $t}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="963c1e6c-1b11-431d-8251-b8d8505880d6",t._sentryDebugIdIdentifier="sentry-dbid-963c1e6c-1b11-431d-8251-b8d8505880d6")}catch{}})();const Mt=(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)})}),jt=kt(function(t,l){const n=Y(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(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:w,fetchMoreCommentsNotifications:P}=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(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(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 P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(w(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({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")),Mt(s,w).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({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=$t(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}})}}})(Dt(vt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[w,P]=k.useState(!1),a=S(e=>Y(e)),o=S(e=>H(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const X=bt(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),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Ut().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:L,hasFetchedAll:Q}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const v=_||D===!0||C!==!0||_||D===!0||C!==!0;k.useEffect(()=>{v&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):v||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[v,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&B!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(L||Q===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,D,L,C,Q,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:X,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(J,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(J,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-BSDLCmF2.js";import{a as r}from"./sentry-67DqaLi1.js";import{u as A,g as P,j as o,N as j}from"./core-B20PugrR.js";import{JK as C,eP as J,f7 as M,JL as x,JM as z,JN as D,JO as L,mT as N,IG as R}from"./zeni-epic-state-B3AwsZqW.js";import{z as h,G as I}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="7f5bbf47-5f96-4d42-af15-bb4aa28376bf",n._sentryDebugIdIdentifier="sentry-dbid-7f5bbf47-5f96-4d42-af15-bb4aa28376bf")}catch{}})();function ee(){const n=A(),a=P(),{params:t,error:i}=r.useMemo(()=>C(a.search),[a.search]),b=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),f=h.isSignedIn(),s=h.getSignedInUser(),p=o(e=>J(e)),l=o(e=>M(e)),d=o(e=>e.tenantState.fetchState),w=o(x),y=o(z),u=o(D),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(N(s.userId,s.zeniSessionId??void 0))))},[f,s,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),c=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:b,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??y,isApproving:w==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(R(s.userId,s.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-BSDLCmF2.js";import{a as r}from"./sentry-67DqaLi1.js";import{u as A,g as P,j as o,N as j}from"./core-B20PugrR.js";import{JK as C,eP as J,f7 as M,JL as x,JM as z,JN as D,JO as L,mT as N,IG as R}from"./zeni-epic-state-B3AwsZqW.js";import{z as h,G as I}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="7f5bbf47-5f96-4d42-af15-bb4aa28376bf",n._sentryDebugIdIdentifier="sentry-dbid-7f5bbf47-5f96-4d42-af15-bb4aa28376bf")}catch{}})();function ee(){const n=A(),a=P(),{params:t,error:i}=r.useMemo(()=>C(a.search),[a.search]),b=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),f=h.isSignedIn(),s=h.getSignedInUser(),p=o(e=>J(e)),l=o(e=>M(e)),d=o(e=>e.tenantState.fetchState),w=o(x),y=o(z),u=o(D),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(N(s.userId,s.zeniSessionId??void 0))))},[f,s,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),c=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:b,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??y,isApproving:w==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(R(s.userId,s.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-BSDLCmF2.js";import{h as V,u as z,g as Z,i as H,j as d,n as J,o as Q,p as I}from"./core-B20PugrR.js";import{eP as U,qO as O,qm as X,Kg as v,qh as T,bt as ee,bn as ae,bT as te,qi as se,Kh as oe,K2 as C,dE as re,ui as ne,Ki as ce,uF as ie,e_ as le,eY as de}from"./zeni-epic-state-B3AwsZqW.js";import{z as me,Y as fe,_ as pe,k as ue,w as q,I as w,N as he,d as M,ao as ge,s as Fe}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import be from"./NotFoundScreen-DjvK1NbN.js";import{F as Ie}from"./FeaturePreviewScreen-C1-h6LMu.js";import{a as g}from"./sentry-67DqaLi1.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import{u as Te}from"./useInitialThreadRequest-BHiBt2ra.js";import{t as Se}from"./routePaths-XreQojZr.js";import{M as ye}from"./MobileAppDrawer-CgbJlL9u.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="45b14526-c464-4c97-9de3-bca93c8b5c7a",s._sentryDebugIdIdentifier="sentry-dbid-45b14526-c464-4c97-9de3-bca93c8b5c7a")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=J(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(ge);function R(){const s=V(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>U(t)),$=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>O(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(b=>b.id===L):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,O,T,F]);const D=ue(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:W}=q(),{isFeatureEnabled:E}=W(w.isReportsCommentingEnabled),Y=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[G,K]=g.useState(!1),j=t=>{K(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:_,onAskAiCfoClick:N,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{j(!0)}})]})}function Ke(){const s=d(c=>U(c)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ke as PandLWithForecastRoutes,Ke as default};
1
+ import{j as n}from"./liveblocks-BSDLCmF2.js";import{h as V,u as z,g as Z,i as H,j as d,n as J,o as Q,p as I}from"./core-B20PugrR.js";import{eP as U,qO as O,qm as X,Kg as v,qh as T,bt as ee,bn as ae,bT as te,qi as se,Kh as oe,K2 as C,dE as re,ui as ne,Ki as ce,uF as ie,e_ as le,eY as de}from"./zeni-epic-state-B3AwsZqW.js";import{z as me,Y as fe,_ as pe,k as ue,w as q,I as w,N as he,d as M,ao as ge,s as Fe}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import be from"./NotFoundScreen-GGUH6kfI.js";import{F as Ie}from"./FeaturePreviewScreen-CWGIZoD1.js";import{a as g}from"./sentry-67DqaLi1.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import{u as Te}from"./useInitialThreadRequest-CHUXHA4e.js";import{t as Se}from"./routePaths-Bd-gFJIO.js";import{M as ye}from"./MobileAppDrawer-DjZLcHYq.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="45b14526-c464-4c97-9de3-bca93c8b5c7a",s._sentryDebugIdIdentifier="sentry-dbid-45b14526-c464-4c97-9de3-bca93c8b5c7a")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=J(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(ge);function R(){const s=V(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>U(t)),$=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>O(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(b=>b.id===L):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,O,T,F]);const D=ue(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:W}=q(),{isFeatureEnabled:E}=W(w.isReportsCommentingEnabled),Y=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[G,K]=g.useState(!1),j=t=>{K(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:_,onAskAiCfoClick:N,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{j(!0)}})]})}function Ke(){const s=d(c=>U(c)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ke as PandLWithForecastRoutes,Ke as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BSDLCmF2.js";import{Kb as te,eP as Q,jD as G,e_ as J,eY as ne,HD as q,JR as oe,to as Ee,Kc as N,tc as ke,tx as Ie,tr as ie,tg as re,tv as Pe,ts as je,Kd as le,v4 as ve,Ke as Le,fB as Te,Kf as K,tl as de,tj as ce,tA as Fe,c2 as Ae}from"./zeni-epic-state-B3AwsZqW.js";import{p as pe,w as X,I as E,z as H,a9 as ue,C as me,ak as ge,al as Re,y as he,o as R,D as fe,O as Ce,am as Oe,Y as Ve,_ as Ue,N as Be,d as ye,f as Ze,s as $e,an as Ke,k as _e}from"./index-D8hCAHx9.js";import{D as be,n as M,S as we}from"./mui-BBkBdMVO.js";import ae from"./NotFoundScreen-DjvK1NbN.js";import{a as r}from"./sentry-67DqaLi1.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as Me,o as se,p as $}from"./core-B20PugrR.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import{M as Ye}from"./MobileAppDrawer-CgbJlL9u.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="8395224a-5198-405d-a84d-279955a3dc4c",a._sentryDebugIdIdentifier="sentry-dbid-8395224a-5198-405d-a84d-279955a3dc4c")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:b})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>G(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=J(k,u),L=ne(u),T=q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),b()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),v=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),y={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:T,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:v===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(T))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(be,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Je,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...y})]})})},Je=M(we)`
1
+ import{j as s}from"./liveblocks-BSDLCmF2.js";import{Kb as te,eP as Q,jD as G,e_ as J,eY as ne,HD as q,JR as oe,to as Ee,Kc as N,tc as ke,tx as Ie,tr as ie,tg as re,tv as Pe,ts as je,Kd as le,v4 as ve,Ke as Le,fB as Te,Kf as K,tl as de,tj as ce,tA as Fe,c2 as Ae}from"./zeni-epic-state-B3AwsZqW.js";import{p as pe,w as X,I as E,z as H,a9 as ue,C as me,ak as ge,al as Re,y as he,o as R,D as fe,O as Ce,am as Oe,Y as Ve,_ as Ue,N as Be,d as ye,f as Ze,s as $e,an as Ke,k as _e}from"./index-CtCI_jgi.js";import{D as be,n as M,S as we}from"./mui-BBkBdMVO.js";import ae from"./NotFoundScreen-GGUH6kfI.js";import{a as r}from"./sentry-67DqaLi1.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as Me,o as se,p as $}from"./core-B20PugrR.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import{M as Ye}from"./MobileAppDrawer-DjZLcHYq.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="8395224a-5198-405d-a84d-279955a3dc4c",a._sentryDebugIdIdentifier="sentry-dbid-8395224a-5198-405d-a84d-279955a3dc4c")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:b})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>G(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=J(k,u),L=ne(u),T=q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),b()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),v=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),y={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:T,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:v===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(T))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(be,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Je,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...y})]})})},Je=M(we)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BSDLCmF2.js";import E from"./NotFoundScreen-DjvK1NbN.js";import{a as r}from"./sentry-67DqaLi1.js";import{h as _,g as P,j as p,i as v,u as M,N as U,n as z,o as F,p as h}from"./core-B20PugrR.js";import{eP as O,PW as b,bo as B,bn as N,hk as V,gQ as Q}from"./zeni-epic-state-B3AwsZqW.js";import{F as W,z as I,_ as $,cC as q}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import{M as H}from"./MobileAppDrawer-CgbJlL9u.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="42670c5f-f725-46eb-a967-09311a075411",e._sentryDebugIdIdentifier="sentry-dbid-42670c5f-f725-46eb-a967-09311a075411")}catch{}})();const J=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(q),K=()=>{const e=_(),t=P(),c=W(),o=p(a=>O(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=v(),u=M(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,C]=r.useState(!1),S=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(Q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-BSDLCmF2.js";import E from"./NotFoundScreen-GGUH6kfI.js";import{a as r}from"./sentry-67DqaLi1.js";import{h as _,g as P,j as p,i as v,u as M,N as U,n as z,o as F,p as h}from"./core-B20PugrR.js";import{eP as O,PW as b,bo as B,bn as N,hk as V,gQ as Q}from"./zeni-epic-state-B3AwsZqW.js";import{F as W,z as I,_ as $,cC as q}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import{M as H}from"./MobileAppDrawer-DjZLcHYq.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="42670c5f-f725-46eb-a967-09311a075411",e._sentryDebugIdIdentifier="sentry-dbid-42670c5f-f725-46eb-a967-09311a075411")}catch{}})();const J=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(q),K=()=>{const e=_(),t=P(),c=W(),o=p(a=>O(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=v(),u=M(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,C]=r.useState(!1),S=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(Q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-BSDLCmF2.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-67DqaLi1.js";import{L as dt,bT as Tc,eP as Ac,Jl as Rc,JP as kl,c2 as Tl,fn as Al,fo as Rl}from"./zeni-epic-state-B3AwsZqW.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-C7uJ9upL.js";import{r as un}from"./empty-DbjE3Pml.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-BqwRJQ00.js";import{r as Gl}from"./index-qbNk-Sh2.js";import{r as zl}from"./index-Dx-tgz0s.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-B20PugrR.js";import{u as Kl,z as Pc,L as Wl,J as Jl,M as Xl,i as Ql,d as tf}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import{d as Pe}from"./decodeURIComponentSafe-HZX6LUOb.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]="5cdd7358-4002-442e-9c03-d8e8ef7c9ef4",t._sentryDebugIdIdentifier="sentry-dbid-5cdd7358-4002-442e-9c03-d8e8ef7c9ef4")}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-BSDLCmF2.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-67DqaLi1.js";import{L as dt,bT as Tc,eP as Ac,Jl as Rc,JP as kl,c2 as Tl,fn as Al,fo as Rl}from"./zeni-epic-state-B3AwsZqW.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-C7uJ9upL.js";import{r as un}from"./empty-DbjE3Pml.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-BqwRJQ00.js";import{r as Gl}from"./index-qbNk-Sh2.js";import{r as zl}from"./index-Dx-tgz0s.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-B20PugrR.js";import{u as Kl,z as Pc,L as Wl,J as Jl,M as Xl,i as Ql,d as tf}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import{d as Pe}from"./decodeURIComponentSafe-HZX6LUOb.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]="5cdd7358-4002-442e-9c03-d8e8ef7c9ef4",t._sentryDebugIdIdentifier="sentry-dbid-5cdd7358-4002-442e-9c03-d8e8ef7c9ef4")}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-BSDLCmF2.js";import{a as o}from"./sentry-67DqaLi1.js";import{j as f,h as H,u as L,g as F,n as M}from"./core-B20PugrR.js";import{m as N,p as V,z as R,b9 as W,y as U,Y as $,_ as z,N as G,d,f as Y,a7 as q,ba as J}from"./index-D8hCAHx9.js";import{f2 as K,eP as Q,MG as P,MH as X,u8 as Z,t_ as g,f4 as ee,bO as ae,u3 as re,MI as ne}from"./zeni-epic-state-B3AwsZqW.js";import{D as te,e as se,n as oe,S as ie}from"./mui-BBkBdMVO.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import{M as le}from"./MobileAppDrawer-CgbJlL9u.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]="fd8713dd-b97e-4298-ac98-dbda555b0b41",e._sentryDebugIdIdentifier="sentry-dbid-fd8713dd-b97e-4298-ac98-dbda555b0b41")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=N(),n=V();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(l=>K(l));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:l=>l.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-BSDLCmF2.js";import{a as o}from"./sentry-67DqaLi1.js";import{j as f,h as H,u as L,g as F,n as M}from"./core-B20PugrR.js";import{m as N,p as V,z as R,b9 as W,y as U,Y as $,_ as z,N as G,d,f as Y,a7 as q,ba as J}from"./index-CtCI_jgi.js";import{f2 as K,eP as Q,MG as P,MH as X,u8 as Z,t_ as g,f4 as ee,bO as ae,u3 as re,MI as ne}from"./zeni-epic-state-B3AwsZqW.js";import{D as te,e as se,n as oe,S as ie}from"./mui-BBkBdMVO.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import{M as le}from"./MobileAppDrawer-DjZLcHYq.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]="fd8713dd-b97e-4298-ac98-dbda555b0b41",e._sentryDebugIdIdentifier="sentry-dbid-fd8713dd-b97e-4298-ac98-dbda555b0b41")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=N(),n=V();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(l=>K(l));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:l=>l.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-BSDLCmF2.js";import R from"./NotFoundScreen-DjvK1NbN.js";import{a as p}from"./sentry-67DqaLi1.js";import{h as C,g as I,u as A,j as u,N as D,n as E,o as k,p as m}from"./core-B20PugrR.js";import{eP as T,NA as g,NQ as S,D5 as V,Ce as N,D4 as d,CX as U,O4 as _}from"./zeni-epic-state-B3AwsZqW.js";import{m as O,z as $,x as P,a7 as Q,bQ as W,af as z}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-CO_HtFbP.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]="28b52771-2e68-4e8b-993a-f9010973d8d5",e._sentryDebugIdIdentifier="sentry-dbid-28b52771-2e68-4e8b-993a-f9010973d8d5")}catch{}})();const c="reimbursement-approval-rule-update",B=E(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(c)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(d(s)),a(`./${s}/edit`)):(e(d()),a("./new"))}}})(Q(W)),X=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>T(n)),w=O(),i=u(n=>g(n)),h=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(N(!0)))},[l,b,a]),$.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(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${c}`]:[],eventCallback:(n,q,x)=>{n.endsWith(c)&&x.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(D,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(P,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(B,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(m,{path:"/",element:t.jsx(X,{})}),t.jsx(m,{path:"/new",element:t.jsx(v,{})}),t.jsx(m,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(m,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
1
+ import{j as t}from"./liveblocks-BSDLCmF2.js";import R from"./NotFoundScreen-GGUH6kfI.js";import{a as p}from"./sentry-67DqaLi1.js";import{h as C,g as I,u as A,j as u,N as D,n as E,o as k,p as m}from"./core-B20PugrR.js";import{eP as T,NA as g,NQ as S,D5 as V,Ce as N,D4 as d,CX as U,O4 as _}from"./zeni-epic-state-B3AwsZqW.js";import{m as O,z as $,x as P,a7 as Q,bQ as W,af as z}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-BK03a97e.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]="28b52771-2e68-4e8b-993a-f9010973d8d5",e._sentryDebugIdIdentifier="sentry-dbid-28b52771-2e68-4e8b-993a-f9010973d8d5")}catch{}})();const c="reimbursement-approval-rule-update",B=E(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(c)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(d(s)),a(`./${s}/edit`)):(e(d()),a("./new"))}}})(Q(W)),X=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>T(n)),w=O(),i=u(n=>g(n)),h=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(N(!0)))},[l,b,a]),$.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(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${c}`]:[],eventCallback:(n,q,x)=>{n.endsWith(c)&&x.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(D,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(P,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(B,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(m,{path:"/",element:t.jsx(X,{})}),t.jsx(m,{path:"/new",element:t.jsx(v,{})}),t.jsx(m,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(m,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-BSDLCmF2.js";import{a as y}from"./sentry-67DqaLi1.js";import{h as A,u as w,g as T,i as U,j as b,n as E}from"./core-B20PugrR.js";import{NQ as D,NA as C,C_ as x,D7 as _,D5 as S,D6 as h,NR as B}from"./zeni-epic-state-B3AwsZqW.js";import{z as k,m as N,x as V,bH as j,af as F}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.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]="7f565215-24de-43c4-9ba4-ba238aa1e2dd",e._sentryDebugIdIdentifier="sentry-dbid-7f565215-24de-43c4-9ba4-ba238aa1e2dd")}catch{}})();function O(e){return B(e)==null}const $=E(function(e,a){const t=D(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=F(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const R=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=R.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};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("../")}}})(j);function G(){const e=A(),a=w(),t=T(),{approvalRuleId:s}=U(),n=k.getSignedInUser(),l=N(),r=b(p=>D(p)),i=b(p=>C(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(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,O as i};
1
+ import{j as g}from"./liveblocks-BSDLCmF2.js";import{a as y}from"./sentry-67DqaLi1.js";import{h as A,u as w,g as T,i as U,j as b,n as E}from"./core-B20PugrR.js";import{NQ as D,NA as C,C_ as x,D7 as _,D5 as S,D6 as h,NR as B}from"./zeni-epic-state-B3AwsZqW.js";import{z as k,m as N,x as V,bH as j,af as F}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.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]="7f565215-24de-43c4-9ba4-ba238aa1e2dd",e._sentryDebugIdIdentifier="sentry-dbid-7f565215-24de-43c4-9ba4-ba238aa1e2dd")}catch{}})();function O(e){return B(e)==null}const $=E(function(e,a){const t=D(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=F(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const R=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=R.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};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("../")}}})(j);function G(){const e=A(),a=w(),t=T(),{approvalRuleId:s}=U(),n=k.getSignedInUser(),l=N(),r=b(p=>D(p)),i=b(p=>C(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(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,O as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as K,u as re,g as Z,i as Y,j as E,N as M,n as q,l as mt,o as ct,p as k}from"./core-B20PugrR.js";import{eP as V,O5 as le,c2 as me,C9 as Be,jO as dt,Cm as ne,Cl as ae,O6 as ut,bn as ce,fM as Te,O7 as pt,Ks as bt,jD as De,Kt as Se,Ku as gt,iy as ht,Nm as ft,iN as St,BZ as It,sM as yt,iF as Rt,CJ as je,O8 as Fe,O9 as Ct,Oa as At,Ob as vt,Oc as kt,Od as Et,Ct as Ie,iT as wt,Nv as xt,Cn as Bt,C7 as Tt,Oe as Dt,C6 as jt,Of as Ft,Cf as ye,Cx as Ut,Cw as Lt,Cs as Ot,Og as Ue,HD as Pt,bo as $t,Ci as Mt,C$ as Nt,Oh as _t,Oi as zt,CF as Gt,CC as Re,MR as Ht,C4 as Zt,Oj as Le,Do as Ce,Dw as Vt,Ok as Wt,Ol as G,Om as Kt,On as Oe,Oo as qt,Op as Pe,Oq as $e,CR as se,bu as Jt,bG as de,cC as ue,e_ as Me,eY as Ne,Or as Qt,gQ as Yt,N2 as Xt,Os as en,Ot as _e,N6 as tn,NQ as nn,Ou as an,O4 as sn,Dt as Ae,Ds as on,Ov as rn,Ow as ln,Ox as mn,Oy as cn,Oz as dn,NB as un,Dj as pn,Dn as bn,bt as gn,bF as hn,cx as fn,cl as Sn,bs as In,Jn as yn,cM as Rn,cO as Cn,cN as An,cw as vn}from"./zeni-epic-state-B3AwsZqW.js";import{F as ze,p as Ge,w as X,I as A,z as P,bR as He,N as ee,d as v,aH as ve,o as j,at as Q,C as kn,O as Ze,bS as En,s as H,_ as Ve,bT as wn,k as te,bU as xn,Y as Bn,y as Tn,x as pe,f as We,a7 as Dn,bi as jn,a2 as Fn,m as Ke,bV as Un,a9 as Ln}from"./index-D8hCAHx9.js";import{n as N,S as On}from"./mui-BBkBdMVO.js";import ie from"./NotFoundScreen-DjvK1NbN.js";import{S as ke}from"./SetupPagesScreen-DM0dhGt1.js";import{F as qe}from"./FeaturePreviewScreen-C1-h6LMu.js";import{a as f}from"./sentry-67DqaLi1.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import{u as Je}from"./useInitialThreadRequest-BHiBt2ra.js";import{D as Pn}from"./DrawerScreen-BbhUunYL.js";import{M as Qe}from"./MobileAppDrawer-CgbJlL9u.js";import{R as $n}from"./ReimbursementApprovalRoutes-DNyMDR4t.js";import{FallBackRoute as Mn}from"./ScreenRoutes-DB3q5PNA.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./analyticsHelper-D8sAsSDg.js";import"./routePaths-XreQojZr.js";import"./BusinessVerificationPageScreen-LVeN_2_9.js";import"./ReimbursementApprovalRuleDetailScreen-CO_HtFbP.js";import"./getLocaleForTenant-ht-6GSU5.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]="6659e41a-2eca-44b4-88a6-e508bb3384d3",e._sentryDebugIdIdentifier="sentry-dbid-6659e41a-2eca-44b4-88a6-e508bb3384d3")}catch{}})();const Ye=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),_n=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ot(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(Ct());const i=Ye(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=K(),t=re(),n=Z(),{reimbursementId:r}=Y(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(A.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(A.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(A.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),C=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),O=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(C&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.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(Wn,{windowSize:c,children:s.jsx(_n,{initialOpenThreadRequest:O??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
1
+ import{j as s}from"./liveblocks-BSDLCmF2.js";import{h as K,u as re,g as Z,i as Y,j as E,N as M,n as q,l as mt,o as ct,p as k}from"./core-B20PugrR.js";import{eP as V,O5 as le,c2 as me,C9 as Be,jO as dt,Cm as ne,Cl as ae,O6 as ut,bn as ce,fM as Te,O7 as pt,Ks as bt,jD as De,Kt as Se,Ku as gt,iy as ht,Nm as ft,iN as St,BZ as It,sM as yt,iF as Rt,CJ as je,O8 as Fe,O9 as Ct,Oa as At,Ob as vt,Oc as kt,Od as Et,Ct as Ie,iT as wt,Nv as xt,Cn as Bt,C7 as Tt,Oe as Dt,C6 as jt,Of as Ft,Cf as ye,Cx as Ut,Cw as Lt,Cs as Ot,Og as Ue,HD as Pt,bo as $t,Ci as Mt,C$ as Nt,Oh as _t,Oi as zt,CF as Gt,CC as Re,MR as Ht,C4 as Zt,Oj as Le,Do as Ce,Dw as Vt,Ok as Wt,Ol as G,Om as Kt,On as Oe,Oo as qt,Op as Pe,Oq as $e,CR as se,bu as Jt,bG as de,cC as ue,e_ as Me,eY as Ne,Or as Qt,gQ as Yt,N2 as Xt,Os as en,Ot as _e,N6 as tn,NQ as nn,Ou as an,O4 as sn,Dt as Ae,Ds as on,Ov as rn,Ow as ln,Ox as mn,Oy as cn,Oz as dn,NB as un,Dj as pn,Dn as bn,bt as gn,bF as hn,cx as fn,cl as Sn,bs as In,Jn as yn,cM as Rn,cO as Cn,cN as An,cw as vn}from"./zeni-epic-state-B3AwsZqW.js";import{F as ze,p as Ge,w as X,I as A,z as P,bR as He,N as ee,d as v,aH as ve,o as j,at as Q,C as kn,O as Ze,bS as En,s as H,_ as Ve,bT as wn,k as te,bU as xn,Y as Bn,y as Tn,x as pe,f as We,a7 as Dn,bi as jn,a2 as Fn,m as Ke,bV as Un,a9 as Ln}from"./index-CtCI_jgi.js";import{n as N,S as On}from"./mui-BBkBdMVO.js";import ie from"./NotFoundScreen-GGUH6kfI.js";import{S as ke}from"./SetupPagesScreen-BYhmd0-N.js";import{F as qe}from"./FeaturePreviewScreen-CWGIZoD1.js";import{a as f}from"./sentry-67DqaLi1.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import{u as Je}from"./useInitialThreadRequest-CHUXHA4e.js";import{D as Pn}from"./DrawerScreen-D5UV8-Be.js";import{M as Qe}from"./MobileAppDrawer-DjZLcHYq.js";import{R as $n}from"./ReimbursementApprovalRoutes-XhXfCwat.js";import{FallBackRoute as Mn}from"./ScreenRoutes-D5644a5x.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./analyticsHelper-Cnf9wNpk.js";import"./routePaths-Bd-gFJIO.js";import"./BusinessVerificationPageScreen-CSKO8lFK.js";import"./ReimbursementApprovalRuleDetailScreen-BK03a97e.js";import"./getLocaleForTenant-DX4sTRBy.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]="6659e41a-2eca-44b4-88a6-e508bb3384d3",e._sentryDebugIdIdentifier="sentry-dbid-6659e41a-2eca-44b4-88a6-e508bb3384d3")}catch{}})();const Ye=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),_n=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ot(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(Ct());const i=Ye(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=K(),t=re(),n=Z(),{reimbursementId:r}=Y(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(A.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(A.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(A.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),C=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),O=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(C&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.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(Wn,{windowSize:c,children:s.jsx(_n,{initialOpenThreadRequest:O??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-BSDLCmF2.js";import{g as J,h as ge,u as Ce,i as Ie,j as d,n as Se,o as we,p as Y}from"./core-B20PugrR.js";import{eP as L,fd as I,JQ as Te,jD as Q,py as W,qg as F,jr as Re,iv as Oe,tM as X,ql as Ae,bt as Fe,JR as ke,bn as De,uN as je,JS as Ee,JT as Pe,tE as Me,JU as G,JV as Le,JW as Be,JX as ve,JY as Ve,JZ as S,J_ as k,J$ as D,K0 as H,K1 as j,K2 as E,dE as Ue,ut as xe,uh as N,ui as K,uz as ze,um as $,uF as Je,K3 as Ye,K4 as Ge,K5 as He,K6 as Ne,K7 as Ke,e_ as $e,eY as qe}from"./zeni-epic-state-B3AwsZqW.js";import{R as Ze,U as Qe,V as We,W as Xe,p as ea,w as ee,I as P,z as ae,Y as aa,k as sa,a as ta,Z as oa,_ as na,N as ra,d as M,f as ia,$ as la,s as se,a0 as ca,a1 as da,a2 as pa}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import fa from"./NotFoundScreen-DjvK1NbN.js";import{F as ma}from"./FeaturePreviewScreen-C1-h6LMu.js";import{a as _}from"./sentry-67DqaLi1.js";import{u as ua}from"./useInitialThreadRequest-BHiBt2ra.js";import{t as q,a as Z,b as _a}from"./routePaths-XreQojZr.js";import{M as ha}from"./MobileAppDrawer-CgbJlL9u.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="c2b5b52b-60eb-47a5-89ad-f7a0c7ab0d88",e._sentryDebugIdIdentifier="sentry-dbid-c2b5b52b-60eb-47a5-89ad-f7a0c7ab0d88")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ge()),e(He()),e(Ne()),e(Ke())},ga=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(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:M,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Je(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(K(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(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($({numberOfPeriods:1,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"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(K(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(k({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(ve({viewMode:a})),e(Ve({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"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Me()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=J(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Q(n)),O=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),A=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(F(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!B&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,B,C,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(X());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,V,O]);const U=sa(),de=U?.loggedInUserRole!=null&&Fe(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=J(),z=Ze(he??"")==="reports",be=Qe(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:M,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:M,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:v,initialOpenThreadRequest:re})]})}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 za(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=$e(f,e),a=qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(we,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-BSDLCmF2.js";import{g as J,h as ge,u as Ce,i as Ie,j as d,n as Se,o as we,p as Y}from"./core-B20PugrR.js";import{eP as L,fd as I,JQ as Te,jD as Q,py as W,qg as F,jr as Re,iv as Oe,tM as X,ql as Ae,bt as Fe,JR as ke,bn as De,uN as je,JS as Ee,JT as Pe,tE as Me,JU as G,JV as Le,JW as Be,JX as ve,JY as Ve,JZ as S,J_ as k,J$ as D,K0 as H,K1 as j,K2 as E,dE as Ue,ut as xe,uh as N,ui as K,uz as ze,um as $,uF as Je,K3 as Ye,K4 as Ge,K5 as He,K6 as Ne,K7 as Ke,e_ as $e,eY as qe}from"./zeni-epic-state-B3AwsZqW.js";import{R as Ze,U as Qe,V as We,W as Xe,p as ea,w as ee,I as P,z as ae,Y as aa,k as sa,a as ta,Z as oa,_ as na,N as ra,d as M,f as ia,$ as la,s as se,a0 as ca,a1 as da,a2 as pa}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import fa from"./NotFoundScreen-GGUH6kfI.js";import{F as ma}from"./FeaturePreviewScreen-CWGIZoD1.js";import{a as _}from"./sentry-67DqaLi1.js";import{u as ua}from"./useInitialThreadRequest-CHUXHA4e.js";import{t as q,a as Z,b as _a}from"./routePaths-Bd-gFJIO.js";import{M as ha}from"./MobileAppDrawer-DjZLcHYq.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="c2b5b52b-60eb-47a5-89ad-f7a0c7ab0d88",e._sentryDebugIdIdentifier="sentry-dbid-c2b5b52b-60eb-47a5-89ad-f7a0c7ab0d88")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ge()),e(He()),e(Ne()),e(Ke())},ga=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(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:M,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Je(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(K(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(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($({numberOfPeriods:1,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"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(K(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(k({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(ve({viewMode:a})),e(Ve({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"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Me()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=J(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Q(n)),O=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),A=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(F(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!B&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,B,C,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(X());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,V,O]);const U=sa(),de=U?.loggedInUserRole!=null&&Fe(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=J(),z=Ze(he??"")==="reports",be=Qe(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:M,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:M,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:v,initialOpenThreadRequest:re})]})}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 za(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=$e(f,e),a=qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(we,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-BSDLCmF2.js";import{w,z as x,aN as b,N as E,d as p,f as F,cM as P,I as L}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import l from"./NotFoundScreen-DjvK1NbN.js";import{a as u}from"./sentry-67DqaLi1.js";import{u as T,j as y,h as V,g as A,n as R,o as U,p as f}from"./core-B20PugrR.js";import{eP as z,Qt as C,Nf as Q,Qu as N,u8 as Y,f4 as G,Qv as M,u6 as O}from"./zeni-epic-state-B3AwsZqW.js";import{R as j}from"./ReferralListScreen-C5_wj8jW.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import"./MobileAppDrawer-CgbJlL9u.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]="38ce65bf-1252-4d9b-a63c-4d9fab132ae2",e._sentryDebugIdIdentifier="sentry-dbid-38ce65bf-1252-4d9b-a63c-4d9fab132ae2")}catch{}})();const q=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,i=x.getSignedInUser();return{onDismissClick:()=>{e(N()),n("..")},onSendClick:()=>{if(i!=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:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=y(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=w(),d=x.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=y(o=>C(o)),v=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:k}=g(b.zeniAccountsConfig),D=Q(k);u.useEffect(()=>{e(N()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:_,currentTenant:r,companyName:I,userName:v,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(j,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(f,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
1
+ import{j as a}from"./liveblocks-BSDLCmF2.js";import{w,z as x,aN as b,N as E,d as p,f as F,cM as P,I as L}from"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import l from"./NotFoundScreen-GGUH6kfI.js";import{a as u}from"./sentry-67DqaLi1.js";import{u as T,j as y,h as V,g as A,n as R,o as U,p as f}from"./core-B20PugrR.js";import{eP as z,Qt as C,Nf as Q,Qu as N,u8 as Y,f4 as G,Qv as M,u6 as O}from"./zeni-epic-state-B3AwsZqW.js";import{R as j}from"./ReferralListScreen-deq5DiBs.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import"./MobileAppDrawer-DjZLcHYq.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]="38ce65bf-1252-4d9b-a63c-4d9fab132ae2",e._sentryDebugIdIdentifier="sentry-dbid-38ce65bf-1252-4d9b-a63c-4d9fab132ae2")}catch{}})();const q=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,i=x.getSignedInUser();return{onDismissClick:()=>{e(N()),n("..")},onSendClick:()=>{if(i!=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:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=y(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=w(),d=x.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=y(o=>C(o)),v=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:k}=g(b.zeniAccountsConfig),D=Q(k);u.useEffect(()=>{e(N()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:_,currentTenant:r,companyName:I,userName:v,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(j,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(f,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};