@zeniai/web-app-ui 5.1.58-dev → 5.1.58-prod

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 (102) hide show
  1. package/dist/assets/AddressRoutes-BgsU_Okh.js +1 -0
  2. package/dist/assets/{AddressScreen-BrRyijJp.js → AddressScreen--WIqRgrV.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-CicMJAHj.js → AiCfoScreen-CoPeR2xU.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CDu2EgPZ.js → BillPayApprovalRoutes-DYMBL1ls.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-qpaKIKLh.js → BillPayRoutes-DaVHyKeL.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-NuRsHlJi.js → BusinessVerificationPageScreen-IAE8wqiZ.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-DGkxpdY7.js → ChargeCardRoutes-FfSxsDh4.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-CG5-5eoy.js → CompanyPassportScreen-CvwFg4o5.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-Bn_8LVY-.js → ConnectionAuthScreen-Dxtu9_tn.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-sbckobAD.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BWH4fb9z.js → CustomerOnboardingRoutes-DqSVkTbK.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-9HsT8T2z.js → DashboardRoutes-CPcUsXhh.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-CwgycKYc.js → DefaultTenantHome-BTiWtLoa.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-Dd35H5gU.js → DomesticWireDetailScreen-BRIlfivD.js} +1 -1
  15. package/dist/assets/{DrawerScreen-C5n2KCQV.js → DrawerScreen-CeWWRowW.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-DLIsh6TE.js → EntityDetailRoutes-C6p3kpjg.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-C0zzACQj.js → ExpenseAutomationRoutes-BZ463ap1.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-BeSvOfyq.js → FeaturePreviewScreen-cS3TjewG.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-QEO5L34X.js → HubSpotOAuthCallbackScreen-CmOy4S6b.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-CWoYIOYU.js → MagicLinkRoutes-BDT99fKy.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-D_t_Me45.js → MagicLinkSignInScreen-BNCaoIGT.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-BG5P4V6f.js → MobileAppDrawer-BSNByW4q.js} +1 -1
  23. package/dist/assets/NotFoundScreen-BxRW8iSE.js +1 -0
  24. package/dist/assets/{NotificationRoutes-CQ3pB1c-.js → NotificationRoutes-CrUNwMpl.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-rh4Splr8.js → OAuthConsentScreen-C_TPmOtR.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-C321jz-9.js → PandLWithForecastRoutes-DGvo0ivG.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-tz6kKz-A.js → PeopleRoutes-D0ezboTZ.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-CeebcaT1.js → PerformanceRoutes-Bvmqae0w.js} +1 -1
  29. package/dist/assets/{Preview-Dw6WgJ9D.js → Preview-jjf7AG4Q.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DmBrRYj5.js → QBOConnectionScreen-BZ7C0R0e.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-Lnl80ls5.js → ReferralListScreen-CUw6yDPF.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-U1jW3SNW.js → ReimbursementApprovalRoutes-yVKhe2D7.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C7v9N8Xz.js → ReimbursementApprovalRuleDetailScreen-BWE2MFN_.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-CrSmjoHG.js → ReimbursementRoutes-CKErcVef.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-CVQ3KrxC.js → ReportsRoutes-Cq602MqT.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-CuXw1sC8.js → RewardsRoutes-D2tfTs3V.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-Bm5EazfY.js → ScreenRoutes-hWGFDEdS.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-BdwvZMwv.js → SettingsRoutes-DElI6Clf.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-DPjCUjqg.js → SetupPagesScreen-IadKJboD.js} +1 -1
  40. package/dist/assets/{SignInScreen-C1EKfqaQ.js → SignInScreen-DQieyLQW.js} +1 -1
  41. package/dist/assets/{SignOutScreen-DK40OwVP.js → SignOutScreen-CsbBN_l2.js} +1 -1
  42. package/dist/assets/{TaskListScreen-d8fI83l2.js → TaskListScreen-BGrTsK9N.js} +1 -1
  43. package/dist/assets/{TaskRoutes-jKlcwy0X.js → TaskRoutes-ux9-CFSl.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-CCDdwe13.js → TransactionDetailRoutes-C5RuERJ2.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-DmE69GP7.js → TransactionDetailScreen-DlO6JSNv.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-BU6W03tb.js → TransactionListRoutes-BAeH4FP3.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-Bm8WTWLC.js → TreasuryRoutes-BaUXZjoz.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-B1U9Gev2.js → VendorsRoutes-CB55FL5s.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-BsEe1BHV.js → WiseConfirmationScreen-eOzYHpOS.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-DjEDHzor.js → ZeniAccountRoutes-scemMtxD.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-Cu_59prd.js → ZeniAccountStatementScreen-Btb9IXLC.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-JvNPAAYV.js → accountMappingHelper-Bxlohg14.js} +1 -1
  53. package/dist/assets/{analytics-wiEk3GGD.js → analytics-3hn1PHMf.js} +1 -1
  54. package/dist/assets/{analyticsHelper-CScMfb2z.js → analyticsHelper-Cq0mRXjH.js} +1 -1
  55. package/dist/assets/{core-DUPexJ3H.js → core-DxUEO8V7.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-jbE9T9Sc.js → decodeURIComponentSafe-D-eyLU1Q.js} +1 -1
  57. package/dist/assets/{dnd-O-LDWVRl.js → dnd-DoXFfj_C.js} +1 -1
  58. package/dist/assets/{empty-B5snx4g9.js → empty-Cb-RCBny.js} +1 -1
  59. package/dist/assets/{empty-DtHXOIj5.js → empty-HhkMKxcj.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-6tVV7Q67.js → emptyVideoElement-NMaUJdkf.js} +1 -1
  61. package/dist/assets/{epic-DdqgmVvM.js → epic-DuC-BOmR.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-BQer3J3i.js → getLocaleForTenant-BIQ9TzYh.js} +1 -1
  63. package/dist/assets/{index-C4rqoBpF.js → index-0yPocX6u.js} +1 -1
  64. package/dist/assets/{index-BhL3T4qt.js → index-BByXbkNq.js} +1 -1
  65. package/dist/assets/{index-iv31G9Nr.js → index-BQsrDmTK.js} +1 -1
  66. package/dist/assets/{index-fhWfMdvB.js → index-ByasA2vr.js} +2 -2
  67. package/dist/assets/{index-R3FzVapp.js → index-CeTZVlTD.js} +1 -1
  68. package/dist/assets/{index-CFjZqjGQ.js → index-CvVxCESr.js} +1 -1
  69. package/dist/assets/{index-B_Z_hpYg.js → index-Dim5XAOV.js} +7 -7
  70. package/dist/assets/{index-D9U_bKAc.js → index-kn_l9znL.js} +1 -1
  71. package/dist/assets/{lexical-D7D3BWIv.js → lexical-JHd27Z9F.js} +1 -1
  72. package/dist/assets/{liveblocks-CpSeBLzv.js → liveblocks-Bt3XeUJT.js} +1 -1
  73. package/dist/assets/{lottie-BpJoufaA.js → lottie-CyD2mde2.js} +1 -1
  74. package/dist/assets/{mui-BYcLUAn-.js → mui-DNEdAZu2.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DOYIxcIl.js → pathToGoBack-qg28rklz.js} +1 -1
  76. package/dist/assets/{pdf--1Oee4-D.js → pdf-CbfL1Alg.js} +3 -3
  77. package/dist/assets/{pdf-lib-DIbgSioz.js → pdf-lib-ax0awAC_.js} +1 -1
  78. package/dist/assets/{plaid-DSCHiplf.js → plaid-BEZgLMsV.js} +1 -1
  79. package/dist/assets/{pusher-DWPsZ62H.js → pusher-Cx_10Jt5.js} +1 -1
  80. package/dist/assets/{react-BYOk0YaM.js → react-BZ6oJQYu.js} +1 -1
  81. package/dist/assets/{react-CA9dc_Y6.js → react-Bd1v_z14.js} +1 -1
  82. package/dist/assets/{react-B3g-qTY7.js → react-CHREJLF-.js} +1 -1
  83. package/dist/assets/{react-CD_enKrG.js → react-CWjmAoc4.js} +1 -1
  84. package/dist/assets/{react-BQJ3WCCJ.js → react-DKz7w7-U.js} +1 -1
  85. package/dist/assets/{react-C2LzYoMn.js → react-ec9vqu6o.js} +1 -1
  86. package/dist/assets/{recharts-Dp6Vlg5X.js → recharts-COiUNsb4.js} +1 -1
  87. package/dist/assets/{routePaths-DpeDFIQv.js → routePaths-BU5vRFSx.js} +1 -1
  88. package/dist/assets/{sentry-BxlhxHUi.js → sentry-BGGJRLwL.js} +1 -1
  89. package/dist/assets/{url-Cto2mSPb.js → url-D8Z8Qw2z.js} +1 -1
  90. package/dist/assets/{url-DLyO75wK.js → url-DWuBQiED.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BK9arDN4.js → useAiCfoDashboardSuggestedQuestionsChips-BLctQpl3.js} +1 -1
  92. package/dist/assets/{useAskAiCfoHostNavButtonProps-D8UKtiUm.js → useAskAiCfoHostNavButtonProps-ClhVQ_m_.js} +1 -1
  93. package/dist/assets/{useDeviceId-6JqjTKKJ.js → useDeviceId-CUymRPxJ.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-hFu4tb2i.js → useInitialThreadRequest-BQJHk8Et.js} +1 -1
  95. package/dist/assets/{utils-BI-ymB94.js → utils-CCpBLrce.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-DXm_Rajk.js → withTransactionSidePanel-D_gLkUWJ.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-DP595dtC.js → zeni-epic-state-aJLWoHYu.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +1 -1
  100. package/dist/assets/AddressRoutes-Jvk5ZIh7.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-Bgpl9puf.js +0 -1
  102. package/dist/assets/NotFoundScreen-DcBza--g.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-CpSeBLzv.js";import{i as S,n as x,h as C,g as y,u as ee,s as te,j as E,N as ae,o as ne,p}from"./core-DUPexJ3H.js";import{Ka as k,Kb as v,Kc as K,A7 as A,zV as T,Kd as B,Ke as oe,Kf as se,zZ as ie,eX as $,A4 as le,A1 as de}from"./zeni-epic-state-DP595dtC.js";import{J as g,o as d,V as re,c as j,h as G,n as ce,p as me,Q as pe,q as H,s as ue,U as he,r as xe,H as ge,m as fe,v as be,B as we,x as Se,j as ye,S as ke,y as ve,A as je,G as $e}from"./index-B_Z_hpYg.js";import{n as m}from"./mui-BYcLUAn-.js";import f from"./NotFoundScreen-DcBza--g.js";import{a as I}from"./sentry-BxlhxHUi.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.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]="d7ce5708-004b-49b0-8187-1d868e8ebd03",e._sentryDebugIdIdentifier="sentry-dbid-d7ce5708-004b-49b0-8187-1d868e8ebd03")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-Bt3XeUJT.js";import{i as S,n as x,h as C,g as y,u as ee,s as te,j as E,N as ae,o as ne,p}from"./core-DxUEO8V7.js";import{Ka as k,Kb as v,Kc as K,A7 as A,zV as T,Kd as B,Ke as oe,Kf as se,zZ as ie,eX as $,A4 as le,A1 as de}from"./zeni-epic-state-aJLWoHYu.js";import{J as g,o as d,V as re,c as j,h as G,n as ce,p as me,Q as pe,q as H,s as ue,U as he,r as xe,H as ge,m as fe,v as be,B as we,x as Se,j as ye,S as ke,y as ve,A as je,G as $e}from"./index-Dim5XAOV.js";import{n as m}from"./mui-DNEdAZu2.js";import f from"./NotFoundScreen-BxRW8iSE.js";import{a as I}from"./sentry-BGGJRLwL.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.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]="d7ce5708-004b-49b0-8187-1d868e8ebd03",e._sentryDebugIdIdentifier="sentry-dbid-d7ce5708-004b-49b0-8187-1d868e8ebd03")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CpSeBLzv.js";import{a as g}from"./sentry-BxlhxHUi.js";import{u as U,g as _,h as w,s as M,j as l,N as D}from"./core-DUPexJ3H.js";import{z as r,m as P,D as V,d as A,c as K,e as N,i as J,j as X,g as Q}from"./index-B_Z_hpYg.js";import{eQ as R,JX as W,K5 as Y,JY as $,eX as q,fo as B,K1 as G,fM as H,cS as Z,K6 as ee,K7 as te}from"./zeni-epic-state-DP595dtC.js";import{n as ne}from"./mui-BYcLUAn-.js";import{u as ae}from"./useDeviceId-6JqjTKKJ.js";import{f as se}from"./analyticsHelper-CScMfb2z.js";import{t as ie}from"./getLocaleForTenant-BQer3J3i.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="a15f6548-fa1c-4a05-9049-da354bbc5079",t._sentryDebugIdIdentifier="sentry-dbid-a15f6548-fa1c-4a05-9049-da354bbc5079")}catch{}})();const T=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function Te(){const t=U(),s=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>R(e)),b=l(e=>W(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Y(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants($(b.tenantsInOrder),a.zeniSessionId),q(a.userId,a.zeniSessionId,o.tenantId),t(B(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(G("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,b.tenantsInOrder),H().then(()=>{const e=Q();e!=null&&A(e)}),setTimeout(()=>{K.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,y,a,o,b,v,s.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(J,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(D,{to:e,state:{...s.state,origin:""}})}if(!T(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(X,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-Bt3XeUJT.js";import{a as g}from"./sentry-BGGJRLwL.js";import{u as U,g as _,h as w,s as M,j as l,N as D}from"./core-DxUEO8V7.js";import{z as r,m as P,D as V,d as A,c as K,e as N,i as J,j as X,g as Q}from"./index-Dim5XAOV.js";import{eQ as R,JX as W,K5 as Y,JY as $,eX as q,fo as B,K1 as G,fM as H,cS as Z,K6 as ee,K7 as te}from"./zeni-epic-state-aJLWoHYu.js";import{n as ne}from"./mui-DNEdAZu2.js";import{u as ae}from"./useDeviceId-CUymRPxJ.js";import{f as se}from"./analyticsHelper-Cq0mRXjH.js";import{t as ie}from"./getLocaleForTenant-BIQ9TzYh.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="a15f6548-fa1c-4a05-9049-da354bbc5079",t._sentryDebugIdIdentifier="sentry-dbid-a15f6548-fa1c-4a05-9049-da354bbc5079")}catch{}})();const T=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function Te(){const t=U(),s=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>R(e)),b=l(e=>W(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Y(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants($(b.tenantsInOrder),a.zeniSessionId),q(a.userId,a.zeniSessionId,o.tenantId),t(B(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(G("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,b.tenantsInOrder),H().then(()=>{const e=Q();e!=null&&A(e)}),setTimeout(()=>{K.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,y,a,o,b,v,s.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(J,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(D,{to:e,state:{...s.state,origin:""}})}if(!T(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(X,{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 N}from"./liveblocks-CpSeBLzv.js";import{a as c}from"./sentry-BxlhxHUi.js";import{u as me,j as n,i as Qe,g as We,h as Je,l as G}from"./core-DUPexJ3H.js";import{eQ as be,f0 as Ke,f1 as pe,eU as Xe,bn as ea,eP as aa,f2 as ta,f3 as na,f5 as sa,f8 as oa,fh as ia,f9 as g,fb as ra,fc as le,ff as da,fd as la,fe as ca,fg as ua,cI as fa,fj as ma,cN as ba,eT as pa,fo as ha,fp as Sa,fn as ga}from"./zeni-epic-state-DP595dtC.js";import{a7 as Ea,a8 as ka,H as Ca,s as ya,z as k,v as Ia,u as Ta,U as r,a9 as wa,T as Aa,aa as _a,k as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as xa,ae as ce,af as ue,L as Ga,ag as Ma,ah as fe,c as M,$ as Ra,q as A,ai as R,aj as Na}from"./index-B_Z_hpYg.js";import{D as Ua}from"./mui-BYcLUAn-.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]="976ba1b1-7b6f-4eb0-a0d0-fdaa99b2261b",f._sentryDebugIdIdentifier="sentry-dbid-976ba1b1-7b6f-4eb0-a0d0-fdaa99b2261b")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Qe(),a=We(),C=Ca(),o=Je(),U=Xe(),m=me(),{useFeatureGate:i}=ya(),V=k.getSignedInUser(),P=ea(V),s=n(e=>be(e)),he=s.masterTOSInfo?.isMasterTOSAccepted??!1,j=n(e=>aa(e)),O=j.uiState.currentChatSessionId,y=Ia(),{setLoading:Se}=Ta(),[_,L]=c.useState(void 0),F=G("/:tenantEmailDomain/dashboard")!==null,z=G("/:tenantEmailDomain/reports")!==null,I=G("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),Ee=wa(s,ge,Y),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Z=n(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n(e=>na(e));c.useEffect(()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(sa(!0))},[y,T,D.fetchState,I]);const h=k.getSignedInUser(),v=n(e=>e.tenantState),Ce=n(e=>v.fetchState==="Completed"?oa(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),q=Aa(),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=P||!P&&$e,xe=s.company!=null&&ia(s.company),w=ve&&xe,Ge=n(e=>g(e).totalUnreadCount),Me=n(e=>g(e).reducedFetchCountState),Q=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),W=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:J,isLoading:K,isFetchingMore:X,hasFetchedAll:ee,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(K===!1&&X===!1&&ee===!0)if(s?.companyId!=null&&J!=null){const e=`dashboard_${s.companyId}`;L(J.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[K,X,ee]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&$.fetchState==="In-Progress"&&(m(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:_},"comments")))},[_,$.fetchState]);const Ue={fetchStatus:Me,count:Ge},ae=t!=null?k.getSignedInUserTenant(t):null,te=n(e=>ae?.tenantId!=null?da(e,ae.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=Fa(),ne=n(e=>la(e,S,h,we,Te,w).fetchState),se=n(e=>ca(e).fetchState),Pe=F&&(ne==="Completed"||ne==="Error")||z&&(se==="Completed"||se==="Error")||!F&&!z?void 0:"disabled",je=c.useMemo(()=>ua(s.userRole),[s.userRole]),Oe=fa(je),Le=s?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,s),oe=Da(),He=oe&&va(a),ie=ba(Ve?.loggedInUserRoleMap),re=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,B=c.useCallback(()=>w&&ie&&!k.getTreasuryPopupSeen(t??"")&&re===!1&&$a(a.pathname)!=="treasury",[w,ie,re,a.pathname,t]),[Ye,de]=c.useState(B);c.useEffect(()=>{de(B())},[B]);const Ze=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Ba(Ze);return N.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:N.jsx(xa,{signedInUser:V,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ce:te!=null?[te]:[],currentTenant:s,isTenantDropdownDisabled:Pe,isSettings:ue(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Oe,isZeniAccountEnabled:H,isChargeCardEnabled:Ee,isTreasuryEnabled:w,treasuryYieldPercentage:qe,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:q,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:oe,onNotificationIconClick:()=>{d(!1);let e=Q===0&&W>0?"notifications/comments":"notifications/tasks";ue(a)&&(e=Q===0&&W>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(M.trackAICFOChatScreenStateChanged("viewed","left_menu",O??null,null),!he)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=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&M.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);fe(e.type)?(O!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{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=>{Se(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=ce(a);let b=`/${encodeURIComponent(u)}/`;const x=R(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(l)?b+="settings/my_profile":fe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;M.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),de(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:He,aiCfoView:j,isOnDashboard:F,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Ya=f=>{const d=me(),t=n(C=>be(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Ke(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...a})};export{Ya as M};
1
+ import{j as N}from"./liveblocks-Bt3XeUJT.js";import{a as c}from"./sentry-BGGJRLwL.js";import{u as me,j as n,i as Qe,g as We,h as Je,l as G}from"./core-DxUEO8V7.js";import{eQ as be,f0 as Ke,f1 as pe,eU as Xe,bn as ea,eP as aa,f2 as ta,f3 as na,f5 as sa,f8 as oa,fh as ia,f9 as g,fb as ra,fc as le,ff as da,fd as la,fe as ca,fg as ua,cI as fa,fj as ma,cN as ba,eT as pa,fo as ha,fp as Sa,fn as ga}from"./zeni-epic-state-aJLWoHYu.js";import{a7 as Ea,a8 as ka,H as Ca,s as ya,z as k,v as Ia,u as Ta,U as r,a9 as wa,T as Aa,aa as _a,k as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as xa,ae as ce,af as ue,L as Ga,ag as Ma,ah as fe,c as M,$ as Ra,q as A,ai as R,aj as Na}from"./index-Dim5XAOV.js";import{D as Ua}from"./mui-DNEdAZu2.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]="976ba1b1-7b6f-4eb0-a0d0-fdaa99b2261b",f._sentryDebugIdIdentifier="sentry-dbid-976ba1b1-7b6f-4eb0-a0d0-fdaa99b2261b")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Qe(),a=We(),C=Ca(),o=Je(),U=Xe(),m=me(),{useFeatureGate:i}=ya(),V=k.getSignedInUser(),P=ea(V),s=n(e=>be(e)),he=s.masterTOSInfo?.isMasterTOSAccepted??!1,j=n(e=>aa(e)),O=j.uiState.currentChatSessionId,y=Ia(),{setLoading:Se}=Ta(),[_,L]=c.useState(void 0),F=G("/:tenantEmailDomain/dashboard")!==null,z=G("/:tenantEmailDomain/reports")!==null,I=G("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),Ee=wa(s,ge,Y),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Z=n(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n(e=>na(e));c.useEffect(()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(sa(!0))},[y,T,D.fetchState,I]);const h=k.getSignedInUser(),v=n(e=>e.tenantState),Ce=n(e=>v.fetchState==="Completed"?oa(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),q=Aa(),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=P||!P&&$e,xe=s.company!=null&&ia(s.company),w=ve&&xe,Ge=n(e=>g(e).totalUnreadCount),Me=n(e=>g(e).reducedFetchCountState),Q=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),W=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:J,isLoading:K,isFetchingMore:X,hasFetchedAll:ee,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(K===!1&&X===!1&&ee===!0)if(s?.companyId!=null&&J!=null){const e=`dashboard_${s.companyId}`;L(J.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[K,X,ee]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&$.fetchState==="In-Progress"&&(m(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:_},"comments")))},[_,$.fetchState]);const Ue={fetchStatus:Me,count:Ge},ae=t!=null?k.getSignedInUserTenant(t):null,te=n(e=>ae?.tenantId!=null?da(e,ae.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=Fa(),ne=n(e=>la(e,S,h,we,Te,w).fetchState),se=n(e=>ca(e).fetchState),Pe=F&&(ne==="Completed"||ne==="Error")||z&&(se==="Completed"||se==="Error")||!F&&!z?void 0:"disabled",je=c.useMemo(()=>ua(s.userRole),[s.userRole]),Oe=fa(je),Le=s?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,s),oe=Da(),He=oe&&va(a),ie=ba(Ve?.loggedInUserRoleMap),re=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,B=c.useCallback(()=>w&&ie&&!k.getTreasuryPopupSeen(t??"")&&re===!1&&$a(a.pathname)!=="treasury",[w,ie,re,a.pathname,t]),[Ye,de]=c.useState(B);c.useEffect(()=>{de(B())},[B]);const Ze=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Ba(Ze);return N.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:N.jsx(xa,{signedInUser:V,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ce:te!=null?[te]:[],currentTenant:s,isTenantDropdownDisabled:Pe,isSettings:ue(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Oe,isZeniAccountEnabled:H,isChargeCardEnabled:Ee,isTreasuryEnabled:w,treasuryYieldPercentage:qe,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:q,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:oe,onNotificationIconClick:()=>{d(!1);let e=Q===0&&W>0?"notifications/comments":"notifications/tasks";ue(a)&&(e=Q===0&&W>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(M.trackAICFOChatScreenStateChanged("viewed","left_menu",O??null,null),!he)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=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&M.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);fe(e.type)?(O!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{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=>{Se(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=ce(a);let b=`/${encodeURIComponent(u)}/`;const x=R(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(l)?b+="settings/my_profile":fe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;M.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),de(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:He,aiCfoView:j,isOnDashboard:F,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Ya=f=>{const d=me(),t=n(C=>be(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Ke(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...a})};export{Ya as M};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-Bt3XeUJT.js";import{h as r,n}from"./core-DxUEO8V7.js";import{N as i}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import"./sentry-BGGJRLwL.js";import"./zeni-epic-state-aJLWoHYu.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.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]="0d8bbeee-ef94-478e-b36a-0f30a9be8cda",e._sentryDebugIdIdentifier="sentry-dbid-0d8bbeee-ef94-478e-b36a-0f30a9be8cda")}catch{}})();const a=n(null,function(e,o){return{onGoBack:()=>{o.navigate(-1)},onGoHome:()=>{o.navigate("/")}}})(i);function _(){const e=r();return t.jsx(a,{navigate:e})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-CpSeBLzv.js";import lt from"./NotFoundScreen-DcBza--g.js";import{a as k}from"./sentry-BxlhxHUi.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 H}from"./core-DUPexJ3H.js";import{cq as St,f2 as K,eQ as Y,fg as bt,f9 as b,Qz as O,fc as d,f1 as y,rw as j,wU as It,QA as Ct,f0 as Tt,fj as yt,rB as _t,QB as F,bo as $,gU as x,rF as J,QC as At,cB as Et,cv as Bt}from"./zeni-epic-state-DP595dtC.js";import{Y as Nt,z as wt,s as xt,U as Ut,_ as Dt,cD as Rt,q as B,a7 as vt,cE as Gt,a8 as Pt,p as Ft}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-D8UKtiUm.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.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]="c86ffe42-e791-46c5-8c95-7c5c0ac04a93",t._sentryDebugIdIdentifier="sentry-dbid-c86ffe42-e791-46c5-8c95-7c5c0ac04a93")}catch{}})();const jt=(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)})}),Mt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Y(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:N,fetchMoreCommentsNotifications:U}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(N(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=B(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Bt(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=B(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(j("task_manager","dashboard",m))}else U?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(N(r),t(F([r],$())))})).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")),jt(s,N).then(()=>{t(F(s,$())),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=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Nt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[N,U]=k.useState(!1),a=S(e=>K(e)),o=S(e=>Y(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Dt({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 M=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),D=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=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=Rt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:Q,isLoading:q,fetchMore:L,isFetchingMore:z,hasFetchedAll:W}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=B(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&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{M!=="In-Progress"&&g&&s(j("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||v===!0||C!==!0||_||v===!0||C!==!0;k.useEffect(()=>{G&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&N===!1&&(U(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&q===!1&&w!=null&&Q!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=Q.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||W===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,v,z,C,W,q,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),M!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(j("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(Mt,{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(H,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(H,{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-Bt3XeUJT.js";import lt from"./NotFoundScreen-BxRW8iSE.js";import{a as k}from"./sentry-BGGJRLwL.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 H}from"./core-DxUEO8V7.js";import{cq as St,f2 as K,eQ as Y,fg as bt,f9 as b,Qz as O,fc as d,f1 as y,rw as j,wU as It,QA as Ct,f0 as Tt,fj as yt,rB as _t,QB as F,bo as $,gU as x,rF as J,QC as At,cB as Et,cv as Bt}from"./zeni-epic-state-aJLWoHYu.js";import{Y as Nt,z as wt,s as xt,U as Ut,_ as Dt,cD as Rt,q as B,a7 as vt,cE as Gt,a8 as Pt,p as Ft}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-ClhVQ_m_.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.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]="c86ffe42-e791-46c5-8c95-7c5c0ac04a93",t._sentryDebugIdIdentifier="sentry-dbid-c86ffe42-e791-46c5-8c95-7c5c0ac04a93")}catch{}})();const jt=(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)})}),Mt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Y(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:N,fetchMoreCommentsNotifications:U}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(N(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=B(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Bt(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=B(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(j("task_manager","dashboard",m))}else U?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(N(r),t(F([r],$())))})).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")),jt(s,N).then(()=>{t(F(s,$())),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=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Nt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[N,U]=k.useState(!1),a=S(e=>K(e)),o=S(e=>Y(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Dt({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 M=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),D=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=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=Rt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:Q,isLoading:q,fetchMore:L,isFetchingMore:z,hasFetchedAll:W}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=B(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&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{M!=="In-Progress"&&g&&s(j("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||v===!0||C!==!0||_||v===!0||C!==!0;k.useEffect(()=>{G&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&N===!1&&(U(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&q===!1&&w!=null&&Q!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=Q.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||W===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,v,z,C,W,q,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),M!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(j("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(Mt,{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(H,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(H,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-CpSeBLzv.js";import{a as r}from"./sentry-BxlhxHUi.js";import{u as A,g as j,j as o,N as C}from"./core-DUPexJ3H.js";import{Kk as K,eQ as P,f8 as x,Kl as z,Km as D,Kn as M,Ko as R,nf as k,Jg as L}from"./zeni-epic-state-DP595dtC.js";import{z as h,F as I}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="0b84bf70-f8ca-4a47-8cfe-ce8230c7f4c8",n._sentryDebugIdIdentifier="sentry-dbid-0b84bf70-f8ca-4a47-8cfe-ce8230c7f4c8")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo(()=>K(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>P(e)),l=o(e=>x(e)),c=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),d=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(c!=="Not-Started"&&c!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,c,n]),r.useEffect(()=>{d!=null&&d!==""&&(window.location.href=d)},[d]);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]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:c!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,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(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-Bt3XeUJT.js";import{a as r}from"./sentry-BGGJRLwL.js";import{u as A,g as j,j as o,N as C}from"./core-DxUEO8V7.js";import{Kk as K,eQ as P,f8 as x,Kl as z,Km as D,Kn as M,Ko as R,nf as k,Jg as L}from"./zeni-epic-state-aJLWoHYu.js";import{z as h,F as I}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="0b84bf70-f8ca-4a47-8cfe-ce8230c7f4c8",n._sentryDebugIdIdentifier="sentry-dbid-0b84bf70-f8ca-4a47-8cfe-ce8230c7f4c8")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo(()=>K(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>P(e)),l=o(e=>x(e)),c=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),d=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(c!=="Not-Started"&&c!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,c,n]),r.useEffect(()=>{d!=null&&d!==""&&(window.location.href=d)},[d]);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]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:c!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,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(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-CpSeBLzv.js";import{h as Y,u as Q,g as Z,i as z,j as d,n as H,o as J,p as I}from"./core-DUPexJ3H.js";import{eQ as v,rk as R,qU as X,KS as O,qP as T,bs as ee,bn as ae,bT as te,qQ as se,KT as oe,KE as C,dD as re,uR as ne,KU as ce,vc as ie,e$ as le,eZ as de}from"./zeni-epic-state-DP595dtC.js";import{z as me,Y as fe,_ as pe,k as ue,s as q,U as M,x as he,c as $,ao as be,q as ge}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import Fe from"./NotFoundScreen-DcBza--g.js";import{F as Ie}from"./FeaturePreviewScreen-BeSvOfyq.js";import{a as b}from"./sentry-BxlhxHUi.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-D8UKtiUm.js";import{u as Te}from"./useInitialThreadRequest-hFu4tb2i.js";import{t as Se}from"./routePaths-DpeDFIQv.js";import{M as ye}from"./MobileAppDrawer-BG5P4V6f.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.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]="2b1b85d1-cd19-4982-9b83-90cb47546756",s._sentryDebugIdIdentifier="sentry-dbid-2b1b85d1-cd19-4982-9b83-90cb47546756")}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=H(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:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(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=ge(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("../../")}}})(be);function U(){const s=Y(),e=Q(),a=Z(),{forecastId:o,tenantEmailDomain:r}=z(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d(t=>v(t)),w=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),x=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(F=>F.id===L):P!=null?f.forecasts.findIndex(F=>F.id===P):f.forecasts.length>0?0:-1)(i,o,x?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=x?.index?(e(O(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&&!D(i.forecasts[t].id)&&g&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,T,g]);const A=ue(),N=A?.loggedInUserRole!=null&&ee(A.loggedInUserRole),{useFeatureGate:W}=q(),{isFeatureEnabled:E}=W(M.isReportsCommentingEnabled),G=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[K,V]=b.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:K,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:w,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:N,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>v(c)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(J,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
1
+ import{j as n}from"./liveblocks-Bt3XeUJT.js";import{h as Y,u as Q,g as Z,i as z,j as d,n as H,o as J,p as I}from"./core-DxUEO8V7.js";import{eQ as v,rk as R,qU as X,KS as O,qP as T,bs as ee,bn as ae,bT as te,qQ as se,KT as oe,KE as C,dD as re,uR as ne,KU as ce,vc as ie,e$ as le,eZ as de}from"./zeni-epic-state-aJLWoHYu.js";import{z as me,Y as fe,_ as pe,k as ue,s as q,U as M,x as he,c as $,ao as be,q as ge}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import Fe from"./NotFoundScreen-BxRW8iSE.js";import{F as Ie}from"./FeaturePreviewScreen-cS3TjewG.js";import{a as b}from"./sentry-BGGJRLwL.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-ClhVQ_m_.js";import{u as Te}from"./useInitialThreadRequest-BQJHk8Et.js";import{t as Se}from"./routePaths-BU5vRFSx.js";import{M as ye}from"./MobileAppDrawer-BSNByW4q.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.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]="2b1b85d1-cd19-4982-9b83-90cb47546756",s._sentryDebugIdIdentifier="sentry-dbid-2b1b85d1-cd19-4982-9b83-90cb47546756")}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=H(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:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(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=ge(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("../../")}}})(be);function U(){const s=Y(),e=Q(),a=Z(),{forecastId:o,tenantEmailDomain:r}=z(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d(t=>v(t)),w=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),x=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(F=>F.id===L):P!=null?f.forecasts.findIndex(F=>F.id===P):f.forecasts.length>0?0:-1)(i,o,x?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=x?.index?(e(O(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&&!D(i.forecasts[t].id)&&g&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,T,g]);const A=ue(),N=A?.loggedInUserRole!=null&&ee(A.loggedInUserRole),{useFeatureGate:W}=q(),{isFeatureEnabled:E}=W(M.isReportsCommentingEnabled),G=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[K,V]=b.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:K,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:w,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:N,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>v(c)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(J,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CpSeBLzv.js";import{KN as te,eQ as J,jH as z,e$ as Y,eZ as ne,Id as q,Kr as oe,tP as Ee,KO as N,tD as ke,tY as Pe,tS as ie,tH as re,tW as Ie,tT as je,KP as le,vD as Te,KQ as Le,fC as ve,KR as K,tM as de,tK as ce,t$ as Fe,c1 as Re}from"./zeni-epic-state-DP595dtC.js";import{J as pe,s as X,U as E,z as G,a9 as ue,C as me,ak as ge,al as Ae,A as he,o as A,E as fe,D as Ce,am as Oe,Y as Ve,_ as Ue,x as Ze,c as be,e as $e,q as Be,an as Ke,k as _e}from"./index-B_Z_hpYg.js";import{D as ye,n as M,S as Se}from"./mui-BYcLUAn-.js";import ae from"./NotFoundScreen-DcBza--g.js";import{a as r}from"./sentry-BxlhxHUi.js";import{u as ee,i as He,j as m,h as ze,g as Ge,n as Me,o as se,p as B}from"./core-DUPexJ3H.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-D8UKtiUm.js";import{M as Qe}from"./MobileAppDrawer-BG5P4V6f.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.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]="79cee08c-ff04-4db3-b20e-7e79d3e59f85",a._sentryDebugIdIdentifier="sentry-dbid-79cee08c-ff04-4db3-b20e-7e79d3e59f85")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[P,S]=r.useState(!1),{userId:w}=He(),d=m(e=>te(e)),u=m(e=>J(e)),D=m(e=>z(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),I=Y(k,u),L=ne(u),v=q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!I&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?S(!0):C()},$=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:R}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:$,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:R===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:I,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):Pe(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{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(Ye,{onClick:e=>e.stopPropagation(),children:[P===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Ae,{...b})]})})},Ye=M(Se)`
1
+ import{j as s}from"./liveblocks-Bt3XeUJT.js";import{KN as te,eQ as J,jH as z,e$ as Y,eZ as ne,Id as q,Kr as oe,tP as Ee,KO as N,tD as ke,tY as Pe,tS as ie,tH as re,tW as Ie,tT as je,KP as le,vD as Te,KQ as Le,fC as ve,KR as K,tM as de,tK as ce,t$ as Fe,c1 as Re}from"./zeni-epic-state-aJLWoHYu.js";import{J as pe,s as X,U as E,z as G,a9 as ue,C as me,ak as ge,al as Ae,A as he,o as A,E as fe,D as Ce,am as Oe,Y as Ve,_ as Ue,x as Ze,c as be,e as $e,q as Be,an as Ke,k as _e}from"./index-Dim5XAOV.js";import{D as ye,n as M,S as Se}from"./mui-DNEdAZu2.js";import ae from"./NotFoundScreen-BxRW8iSE.js";import{a as r}from"./sentry-BGGJRLwL.js";import{u as ee,i as He,j as m,h as ze,g as Ge,n as Me,o as se,p as B}from"./core-DxUEO8V7.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-ClhVQ_m_.js";import{M as Qe}from"./MobileAppDrawer-BSNByW4q.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.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]="79cee08c-ff04-4db3-b20e-7e79d3e59f85",a._sentryDebugIdIdentifier="sentry-dbid-79cee08c-ff04-4db3-b20e-7e79d3e59f85")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[P,S]=r.useState(!1),{userId:w}=He(),d=m(e=>te(e)),u=m(e=>J(e)),D=m(e=>z(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),I=Y(k,u),L=ne(u),v=q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!I&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?S(!0):C()},$=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:R}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:$,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:R===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:I,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):Pe(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{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(Ye,{onClick:e=>e.stopPropagation(),children:[P===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Ae,{...b})]})})},Ye=M(Se)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CpSeBLzv.js";import E from"./NotFoundScreen-DcBza--g.js";import{a as r}from"./sentry-BxlhxHUi.js";import{h as _,g as U,j as p,i as v,u as M,N as P,n as z,o as F,p as h}from"./core-DUPexJ3H.js";import{eQ as B,QD as b,bq as H,bn as N,ho as O,gU as Q}from"./zeni-epic-state-DP595dtC.js";import{H as V,z as I,_ as q,cF as $}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-D8UKtiUm.js";import{M as J}from"./MobileAppDrawer-BG5P4V6f.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.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]="b3f51ee0-bff2-4c8e-b032-3cca5feed4de",e._sentryDebugIdIdentifier="sentry-dbid-b3f51ee0-bff2-4c8e-b032-3cca5feed4de")}catch{}})();const K=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})($),L=()=>{const e=_(),t=U(),c=V(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=v(),u=M(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=H(o?.userRole??[]),D=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(l),x=C||D||k,d=r.useCallback((a,i,T)=>{u(O({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 y=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-Bt3XeUJT.js";import E from"./NotFoundScreen-BxRW8iSE.js";import{a as r}from"./sentry-BGGJRLwL.js";import{h as _,g as U,j as p,i as v,u as M,N as P,n as z,o as F,p as h}from"./core-DxUEO8V7.js";import{eQ as B,QD as b,bq as H,bn as N,ho as O,gU as Q}from"./zeni-epic-state-aJLWoHYu.js";import{H as V,z as I,_ as q,cF as $}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-ClhVQ_m_.js";import{M as J}from"./MobileAppDrawer-BSNByW4q.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.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]="b3f51ee0-bff2-4c8e-b032-3cca5feed4de",e._sentryDebugIdIdentifier="sentry-dbid-b3f51ee0-bff2-4c8e-b032-3cca5feed4de")}catch{}})();const K=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})($),L=()=>{const e=_(),t=U(),c=V(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=v(),u=M(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=H(o?.userRole??[]),D=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(l),x=C||D||k,d=r.useCallback((a,i,T)=>{u(O({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 y=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-BxlhxHUi.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-BGGJRLwL.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-CpSeBLzv.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BxlhxHUi.js";import{L as dt,bT as Tc,eQ as Ac,JX as Rc,Kp as kl,c1 as Tl,fo as Al,fp as Rl}from"./zeni-epic-state-DP595dtC.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-BI-ymB94.js";import{r as un}from"./empty-DtHXOIj5.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DIbgSioz.js";import{r as Gl}from"./index-BhL3T4qt.js";import{r as zl}from"./index-iv31G9Nr.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-DUPexJ3H.js";import{u as Kl,z as Pc,L as Wl,K as Jl,M as Xl,h as Ql,c as tf}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import{d as Pe}from"./decodeURIComponentSafe-jbE9T9Sc.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]="b16d0288-405a-4673-89a8-9d1d428aba02",t._sentryDebugIdIdentifier="sentry-dbid-b16d0288-405a-4673-89a8-9d1d428aba02")}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-Bt3XeUJT.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BGGJRLwL.js";import{L as dt,bT as Tc,eQ as Ac,JX as Rc,Kp as kl,c1 as Tl,fo as Al,fp as Rl}from"./zeni-epic-state-aJLWoHYu.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-CCpBLrce.js";import{r as un}from"./empty-HhkMKxcj.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-ax0awAC_.js";import{r as Gl}from"./index-BByXbkNq.js";import{r as zl}from"./index-BQsrDmTK.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-DxUEO8V7.js";import{u as Kl,z as Pc,L as Wl,K as Jl,M as Xl,h as Ql,c as tf}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import{d as Pe}from"./decodeURIComponentSafe-D-eyLU1Q.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]="b16d0288-405a-4673-89a8-9d1d428aba02",t._sentryDebugIdIdentifier="sentry-dbid-b16d0288-405a-4673-89a8-9d1d428aba02")}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-CpSeBLzv.js";import{a as o}from"./sentry-BxlhxHUi.js";import{j as f,h as L,u as N,g as _,n as V}from"./core-DUPexJ3H.js";import{m as F,J as M,z as R,bb as W,A as U,Y as $,_ as z,x as Q,c as l,e as Y,a7 as J,bc as q}from"./index-B_Z_hpYg.js";import{f3 as G,eQ as K,Nf as P,Ng as X,uH as Z,ux as g,f5 as ee,bO as ae,uC as re,Nh as ne}from"./zeni-epic-state-DP595dtC.js";import{D as te,e as se,n as oe,S as ie}from"./mui-BYcLUAn-.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-D8UKtiUm.js";import{M as ce}from"./MobileAppDrawer-BG5P4V6f.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]="a10c7f3f-650a-4fc1-b82f-3b7e8d3191e5",e._sentryDebugIdIdentifier="sentry-dbid-a10c7f3f-650a-4fc1-b82f-3b7e8d3191e5")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=F(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>G(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.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:c=>c.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-Bt3XeUJT.js";import{a as o}from"./sentry-BGGJRLwL.js";import{j as f,h as L,u as N,g as _,n as V}from"./core-DxUEO8V7.js";import{m as F,J as M,z as R,bb as W,A as U,Y as $,_ as z,x as Q,c as l,e as Y,a7 as J,bc as q}from"./index-Dim5XAOV.js";import{f3 as G,eQ as K,Nf as P,Ng as X,uH as Z,ux as g,f5 as ee,bO as ae,uC as re,Nh as ne}from"./zeni-epic-state-aJLWoHYu.js";import{D as te,e as se,n as oe,S as ie}from"./mui-DNEdAZu2.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-ClhVQ_m_.js";import{M as ce}from"./MobileAppDrawer-BSNByW4q.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]="a10c7f3f-650a-4fc1-b82f-3b7e8d3191e5",e._sentryDebugIdIdentifier="sentry-dbid-a10c7f3f-650a-4fc1-b82f-3b7e8d3191e5")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=F(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>G(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.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:c=>c.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-CpSeBLzv.js";import x from"./NotFoundScreen-DcBza--g.js";import{a as p}from"./sentry-BxlhxHUi.js";import{h as D,g as I,u as C,j as c,N as A,n as E,o as k,p as u}from"./core-DUPexJ3H.js";import{eQ as O,O9 as g,Op as S,DE as T,CN as V,DD as m,Du as U,OG as _}from"./zeni-epic-state-DP595dtC.js";import{m as N,z as $,B,a7 as W,bS as z,af as G}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-C7v9N8Xz.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]="7656b8ea-cf37-42e8-a4b7-27ee648b8ecc",e._sentryDebugIdIdentifier="sentry-dbid-7656b8ea-cf37-42e8-a4b7-27ee648b8ecc")}catch{}})();const d="reimbursement-approval-rule-update",P=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(d)&&e(_(!1))},onBackClick:()=>{G(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})(W(z)),Q=()=>{const e=D(),r=I(),a=C(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=c(n=>n.remiSetupApproverViewState.fetchState),o=c(n=>O(n)),w=N(),i=c(n=>g(n)),h=c(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(V(!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(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${d}`]:[],eventCallback:(n,q,R)=>{n.endsWith(d)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(A,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(B,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(P,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(u,{path:"/",element:t.jsx(Q,{})}),t.jsx(u,{path:"/new",element:t.jsx(v,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
1
+ import{j as t}from"./liveblocks-Bt3XeUJT.js";import x from"./NotFoundScreen-BxRW8iSE.js";import{a as p}from"./sentry-BGGJRLwL.js";import{h as D,g as I,u as C,j as c,N as A,n as E,o as k,p as u}from"./core-DxUEO8V7.js";import{eQ as O,O9 as g,Op as S,DE as T,CN as V,DD as m,Du as U,OG as _}from"./zeni-epic-state-aJLWoHYu.js";import{m as N,z as $,B,a7 as W,bS as z,af as G}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-BWE2MFN_.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]="7656b8ea-cf37-42e8-a4b7-27ee648b8ecc",e._sentryDebugIdIdentifier="sentry-dbid-7656b8ea-cf37-42e8-a4b7-27ee648b8ecc")}catch{}})();const d="reimbursement-approval-rule-update",P=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(d)&&e(_(!1))},onBackClick:()=>{G(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})(W(z)),Q=()=>{const e=D(),r=I(),a=C(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=c(n=>n.remiSetupApproverViewState.fetchState),o=c(n=>O(n)),w=N(),i=c(n=>g(n)),h=c(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(V(!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(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${d}`]:[],eventCallback:(n,q,R)=>{n.endsWith(d)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(A,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(B,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(P,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(u,{path:"/",element:t.jsx(Q,{})}),t.jsx(u,{path:"/new",element:t.jsx(v,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-CpSeBLzv.js";import{a as y}from"./sentry-BxlhxHUi.js";import{h as w,u as A,g as T,i as E,j as b,n as U}from"./core-DUPexJ3H.js";import{Op as D,O9 as x,Dx as C,DG as _,DE as S,DF as h,Oq as B}from"./zeni-epic-state-DP595dtC.js";import{z as O,m as k,B as V,bJ as F,af as j}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.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]="a600c138-a9e6-4ab2-b239-8351dc2c2c8b",e._sentryDebugIdIdentifier="sentry-dbid-a600c138-a9e6-4ab2-b239-8351dc2c2c8b")}catch{}})();function $(e){return B(e)==null}const N=U(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=j(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const v=[];return p.forEach(u=>{const R=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const f=!!$(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:u.stepType.selectedOption,actors:m,operator:m.length>1?u.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:c(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:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function H(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=E(),n=O.getSignedInUser(),l=k(),r=b(p=>D(p)),i=b(p=>x(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(C(!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(N,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
1
+ import{j as g}from"./liveblocks-Bt3XeUJT.js";import{a as y}from"./sentry-BGGJRLwL.js";import{h as w,u as A,g as T,i as E,j as b,n as U}from"./core-DxUEO8V7.js";import{Op as D,O9 as x,Dx as C,DG as _,DE as S,DF as h,Oq as B}from"./zeni-epic-state-aJLWoHYu.js";import{z as O,m as k,B as V,bJ as F,af as j}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.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]="a600c138-a9e6-4ab2-b239-8351dc2c2c8b",e._sentryDebugIdIdentifier="sentry-dbid-a600c138-a9e6-4ab2-b239-8351dc2c2c8b")}catch{}})();function $(e){return B(e)==null}const N=U(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=j(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const v=[];return p.forEach(u=>{const R=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const f=!!$(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:u.stepType.selectedOption,actors:m,operator:m.length>1?u.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:c(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:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function H(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=E(),n=O.getSignedInUser(),l=k(),r=b(p=>D(p)),i=b(p=>x(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(C(!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(N,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CpSeBLzv.js";import{h as q,u as re,g as Z,i as Q,j as E,N as M,n as J,l as mt,o as ct,p as C}from"./core-DUPexJ3H.js";import{eQ as V,OH as le,c1 as me,CI as Be,jS as dt,CV as ne,CU as ae,OI as ut,bn as ce,fN as De,OJ as pt,L2 as bt,jH as Te,L3 as Se,L4 as gt,iC as ht,NX as ft,iR as St,Cw as It,tb as yt,iJ as Rt,Dg as je,OK as Fe,OL as At,OM as kt,ON as vt,OO as Ct,OP as Et,D0 as Ie,iX as wt,O4 as xt,CW as Bt,CG as Dt,OQ as Tt,CF as jt,OR as Ft,CO as ye,D4 as Ut,D3 as Lt,C$ as Pt,OS as Ue,Id as Ot,bq as $t,CR as Mt,Dy as _t,OT as Nt,OU as Gt,Dc as zt,D9 as Re,Nq as Ht,CD as Zt,OV as Le,DX as Ae,E3 as Vt,OW as Wt,OX as z,OY as qt,OZ as Pe,O_ as Jt,O$ as Oe,P0 as $e,Do as se,bu as Xt,bG as de,cB as ue,e$ as Me,eZ as _e,P1 as Kt,gU as Qt,ND as Yt,P2 as en,P3 as Ne,NH as tn,Op as nn,P4 as an,OG as sn,E0 as ke,D$ as on,P5 as rn,P6 as ln,P7 as mn,P8 as cn,P9 as dn,Oa as un,DS as pn,DW as bn,bs as gn,bF as hn,cw as fn,ck as Sn,bt as In,JZ as yn,cL as Rn,cN as An,cM as kn,cv as vn}from"./zeni-epic-state-DP595dtC.js";import{H as Ge,J as ze,s as Y,U as k,z as O,bT as He,x as ee,c as v,aH as ve,o as j,at as K,C as Cn,D as Ze,bU as En,q as H,_ as Ve,bV as wn,k as te,bW as xn,Y as Bn,A as Dn,B as pe,e as We,a7 as Tn,bk as jn,a2 as Fn,m as qe,bX as Un,a9 as Ln}from"./index-B_Z_hpYg.js";import{n as _,S as Pn}from"./mui-BYcLUAn-.js";import ie from"./NotFoundScreen-DcBza--g.js";import{S as Ce}from"./SetupPagesScreen-DPjCUjqg.js";import{F as Je}from"./FeaturePreviewScreen-BeSvOfyq.js";import{a as f}from"./sentry-BxlhxHUi.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-D8UKtiUm.js";import{u as Xe}from"./useInitialThreadRequest-hFu4tb2i.js";import{D as On}from"./DrawerScreen-C5n2KCQV.js";import{M as Ke}from"./MobileAppDrawer-BG5P4V6f.js";import{R as $n}from"./ReimbursementApprovalRoutes-U1jW3SNW.js";import{FallBackRoute as Mn}from"./ScreenRoutes-Bm5EazfY.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.js";import"./analyticsHelper-CScMfb2z.js";import"./routePaths-DpeDFIQv.js";import"./BusinessVerificationPageScreen-NuRsHlJi.js";import"./ReimbursementApprovalRuleDetailScreen-C7v9N8Xz.js";import"./getLocaleForTenant-BQer3J3i.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]="34ec4ba9-1fda-4ee4-a00a-e9374779e1c6",e._sentryDebugIdIdentifier="sentry-dbid-34ec4ba9-1fda-4ee4-a00a-e9374779e1c6")}catch{}})();const Qe=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Nn=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=O.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=De(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 D=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:D,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:Te(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=O.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(Pt(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(Tt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Dt({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(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Qe(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=q(),t=re(),n=Z(),{reimbursementId:r}=Q(),d=Ge(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:D,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,T=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=O.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),P=Xe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||T&&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(Gn,{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(zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.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(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.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(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:D,onAskAiCfoClick:u})})]})}const Gn=_.div`
1
+ import{j as s}from"./liveblocks-Bt3XeUJT.js";import{h as q,u as re,g as Z,i as Q,j as E,N as M,n as J,l as mt,o as ct,p as C}from"./core-DxUEO8V7.js";import{eQ as V,OH as le,c1 as me,CI as Be,jS as dt,CV as ne,CU as ae,OI as ut,bn as ce,fN as De,OJ as pt,L2 as bt,jH as Te,L3 as Se,L4 as gt,iC as ht,NX as ft,iR as St,Cw as It,tb as yt,iJ as Rt,Dg as je,OK as Fe,OL as At,OM as kt,ON as vt,OO as Ct,OP as Et,D0 as Ie,iX as wt,O4 as xt,CW as Bt,CG as Dt,OQ as Tt,CF as jt,OR as Ft,CO as ye,D4 as Ut,D3 as Lt,C$ as Pt,OS as Ue,Id as Ot,bq as $t,CR as Mt,Dy as _t,OT as Nt,OU as Gt,Dc as zt,D9 as Re,Nq as Ht,CD as Zt,OV as Le,DX as Ae,E3 as Vt,OW as Wt,OX as z,OY as qt,OZ as Pe,O_ as Jt,O$ as Oe,P0 as $e,Do as se,bu as Xt,bG as de,cB as ue,e$ as Me,eZ as _e,P1 as Kt,gU as Qt,ND as Yt,P2 as en,P3 as Ne,NH as tn,Op as nn,P4 as an,OG as sn,E0 as ke,D$ as on,P5 as rn,P6 as ln,P7 as mn,P8 as cn,P9 as dn,Oa as un,DS as pn,DW as bn,bs as gn,bF as hn,cw as fn,ck as Sn,bt as In,JZ as yn,cL as Rn,cN as An,cM as kn,cv as vn}from"./zeni-epic-state-aJLWoHYu.js";import{H as Ge,J as ze,s as Y,U as k,z as O,bT as He,x as ee,c as v,aH as ve,o as j,at as K,C as Cn,D as Ze,bU as En,q as H,_ as Ve,bV as wn,k as te,bW as xn,Y as Bn,A as Dn,B as pe,e as We,a7 as Tn,bk as jn,a2 as Fn,m as qe,bX as Un,a9 as Ln}from"./index-Dim5XAOV.js";import{n as _,S as Pn}from"./mui-DNEdAZu2.js";import ie from"./NotFoundScreen-BxRW8iSE.js";import{S as Ce}from"./SetupPagesScreen-IadKJboD.js";import{F as Je}from"./FeaturePreviewScreen-cS3TjewG.js";import{a as f}from"./sentry-BGGJRLwL.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-ClhVQ_m_.js";import{u as Xe}from"./useInitialThreadRequest-BQJHk8Et.js";import{D as On}from"./DrawerScreen-CeWWRowW.js";import{M as Ke}from"./MobileAppDrawer-BSNByW4q.js";import{R as $n}from"./ReimbursementApprovalRoutes-yVKhe2D7.js";import{FallBackRoute as Mn}from"./ScreenRoutes-hWGFDEdS.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.js";import"./analyticsHelper-Cq0mRXjH.js";import"./routePaths-BU5vRFSx.js";import"./BusinessVerificationPageScreen-IAE8wqiZ.js";import"./ReimbursementApprovalRuleDetailScreen-BWE2MFN_.js";import"./getLocaleForTenant-BIQ9TzYh.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]="34ec4ba9-1fda-4ee4-a00a-e9374779e1c6",e._sentryDebugIdIdentifier="sentry-dbid-34ec4ba9-1fda-4ee4-a00a-e9374779e1c6")}catch{}})();const Qe=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Nn=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=O.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=De(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 D=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:D,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:Te(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=O.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(Pt(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(Tt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Dt({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(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Qe(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=q(),t=re(),n=Z(),{reimbursementId:r}=Q(),d=Ge(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:D,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,T=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=O.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),P=Xe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||T&&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(Gn,{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(zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.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(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.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(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:D,onAskAiCfoClick:u})})]})}const Gn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-CpSeBLzv.js";import{g as z,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-DUPexJ3H.js";import{eQ as L,fe as I,Kq as Te,jH as J,pZ as W,qO as F,jv as Re,iz as Oe,ub as X,qT as Ae,bs as Fe,Kr as ke,bn as De,vk as je,Ks as Ee,Kt as Pe,u3 as ve,Ku as H,Kv as Le,Kw as Me,Kx as Be,Ky as Ke,Kz as w,KA as k,KB as D,KC as Y,KD as j,KE as E,dD as Ve,v0 as Ue,uQ as q,uR as N,v6 as xe,uV as $,vc as ze,KF as Ge,KG as He,KH as Ye,KI as qe,KJ as Ne,e$ as $e,eZ as Ze}from"./zeni-epic-state-DP595dtC.js";import{O as Qe,R as Je,W as We,X as Xe,J as ea,s as ee,U as P,z as ae,Y as aa,k as sa,a as ta,Z as oa,_ as na,x as ra,c as v,e as ia,$ as la,q as se,a0 as ca,a1 as da,a2 as pa}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import ma from"./NotFoundScreen-DcBza--g.js";import{F as fa}from"./FeaturePreviewScreen-BeSvOfyq.js";import{a as _}from"./sentry-BxlhxHUi.js";import{u as ua}from"./useInitialThreadRequest-hFu4tb2i.js";import{t as Z,a as Q,b as _a}from"./routePaths-DpeDFIQv.js";import{M as ha}from"./MobileAppDrawer-BG5P4V6f.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.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]="bcc68d0c-8e5d-45ee-b7b9-805b7d566323",e._sentryDebugIdIdentifier="sentry-dbid-bcc68d0c-8e5d-45ee-b7b9-805b7d566323")}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(He()),e(Ye()),e(qe()),e(Ne())},ga=we(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},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:v,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:c}=l;let i=[...f];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(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),f.length>0&&e(N(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(w(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(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(N(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(Ue({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=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(c,{state:{pathnameStackToGoBack:i,referrer:S(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(Y({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(Y({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:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ke({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(ve()),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(),m=ea(),u=da(m),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:f}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=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(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),K=d(n=>J(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&&!M&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,M,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,K,O]);const V=sa(),de=V?.loggedInUserRole!=null&&Fe(V?.loggedInUserRole)!==!0,[pe,me]=_.useState(!1),U=n=>{me(n)},fe=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=Qe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>x?ba:void 0,[x]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:v,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:ce,selectedReportID:R,analytics:v,filter:b,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&fe&&!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:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=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 xa(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(P.isDebitCardFeatureEnabled),u=$e(m,e),a=Ze(e);return u===!0||a===!0?p.jsx(fa,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(ma,{})})]})}export{xa as default};
1
+ import{j as p}from"./liveblocks-Bt3XeUJT.js";import{g as z,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-DxUEO8V7.js";import{eQ as L,fe as I,Kq as Te,jH as J,pZ as W,qO as F,jv as Re,iz as Oe,ub as X,qT as Ae,bs as Fe,Kr as ke,bn as De,vk as je,Ks as Ee,Kt as Pe,u3 as ve,Ku as H,Kv as Le,Kw as Me,Kx as Be,Ky as Ke,Kz as w,KA as k,KB as D,KC as Y,KD as j,KE as E,dD as Ve,v0 as Ue,uQ as q,uR as N,v6 as xe,uV as $,vc as ze,KF as Ge,KG as He,KH as Ye,KI as qe,KJ as Ne,e$ as $e,eZ as Ze}from"./zeni-epic-state-aJLWoHYu.js";import{O as Qe,R as Je,W as We,X as Xe,J as ea,s as ee,U as P,z as ae,Y as aa,k as sa,a as ta,Z as oa,_ as na,x as ra,c as v,e as ia,$ as la,q as se,a0 as ca,a1 as da,a2 as pa}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import ma from"./NotFoundScreen-BxRW8iSE.js";import{F as fa}from"./FeaturePreviewScreen-cS3TjewG.js";import{a as _}from"./sentry-BGGJRLwL.js";import{u as ua}from"./useInitialThreadRequest-BQJHk8Et.js";import{t as Z,a as Q,b as _a}from"./routePaths-BU5vRFSx.js";import{M as ha}from"./MobileAppDrawer-BSNByW4q.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.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]="bcc68d0c-8e5d-45ee-b7b9-805b7d566323",e._sentryDebugIdIdentifier="sentry-dbid-bcc68d0c-8e5d-45ee-b7b9-805b7d566323")}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(He()),e(Ye()),e(qe()),e(Ne())},ga=we(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},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:v,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:c}=l;let i=[...f];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(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),f.length>0&&e(N(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(w(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(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(N(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(Ue({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=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(c,{state:{pathnameStackToGoBack:i,referrer:S(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(Y({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(Y({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:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ke({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(ve()),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(),m=ea(),u=da(m),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:f}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=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(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),K=d(n=>J(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&&!M&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,M,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,K,O]);const V=sa(),de=V?.loggedInUserRole!=null&&Fe(V?.loggedInUserRole)!==!0,[pe,me]=_.useState(!1),U=n=>{me(n)},fe=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=Qe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>x?ba:void 0,[x]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:v,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:ce,selectedReportID:R,analytics:v,filter:b,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&fe&&!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:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=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 xa(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(P.isDebitCardFeatureEnabled),u=$e(m,e),a=Ze(e);return u===!0||a===!0?p.jsx(fa,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(ma,{})})]})}export{xa as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-CpSeBLzv.js";import{s as j,z as w,aN as y,x as I,c as p,e as F,cQ as R,U as L}from"./index-B_Z_hpYg.js";import"./mui-BYcLUAn-.js";import l from"./NotFoundScreen-DcBza--g.js";import{a as u}from"./sentry-BxlhxHUi.js";import{u as P,j as b,h as T,g as U,n as V,o as z,p as d}from"./core-DUPexJ3H.js";import{eQ as A,Rf as C,NQ as Q,Rg as N,uH as Y,f5 as G,Rh as H,uF as O}from"./zeni-epic-state-DP595dtC.js";import{R as x}from"./ReferralListScreen-Lnl80ls5.js";import"./recharts-Dp6Vlg5X.js";import"./analytics-wiEk3GGD.js";import"./plaid-DSCHiplf.js";import"./dnd-O-LDWVRl.js";import"./stripe-DMRn4zHo.js";import"./lottie-BpJoufaA.js";import"./lexical-D7D3BWIv.js";import"./pdf--1Oee4-D.js";import"./utils-BI-ymB94.js";import"./useAskAiCfoHostNavButtonProps-D8UKtiUm.js";import"./MobileAppDrawer-BG5P4V6f.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]="199caa9d-8e12-4a2f-8031-49f7d5ebc806",e._sentryDebugIdIdentifier="sentry-dbid-199caa9d-8e12-4a2f-8031-49f7d5ebc806")}catch{}})();const q=V(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=w.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(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(R),B=()=>{const e=P(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>A(o)),c=T(),_=U(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),k=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),D=Q(v);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 S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:_,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(z,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
1
+ import{j as a}from"./liveblocks-Bt3XeUJT.js";import{s as j,z as w,aN as y,x as I,c as p,e as F,cQ as R,U as L}from"./index-Dim5XAOV.js";import"./mui-DNEdAZu2.js";import l from"./NotFoundScreen-BxRW8iSE.js";import{a as u}from"./sentry-BGGJRLwL.js";import{u as P,j as b,h as T,g as U,n as V,o as z,p as d}from"./core-DxUEO8V7.js";import{eQ as A,Rf as C,NQ as Q,Rg as N,uH as Y,f5 as G,Rh as H,uF as O}from"./zeni-epic-state-aJLWoHYu.js";import{R as x}from"./ReferralListScreen-CUw6yDPF.js";import"./recharts-COiUNsb4.js";import"./analytics-3hn1PHMf.js";import"./plaid-BEZgLMsV.js";import"./dnd-DoXFfj_C.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD2mde2.js";import"./lexical-JHd27Z9F.js";import"./pdf-CbfL1Alg.js";import"./utils-CCpBLrce.js";import"./useAskAiCfoHostNavButtonProps-ClhVQ_m_.js";import"./MobileAppDrawer-BSNByW4q.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]="199caa9d-8e12-4a2f-8031-49f7d5ebc806",e._sentryDebugIdIdentifier="sentry-dbid-199caa9d-8e12-4a2f-8031-49f7d5ebc806")}catch{}})();const q=V(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=w.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(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(R),B=()=>{const e=P(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>A(o)),c=T(),_=U(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),k=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),D=Q(v);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 S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:_,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(z,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{de as default};