@zeniai/web-app-ui 5.4.16-dev → 5.4.17-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/assets/{AccountMappingScreen-CDXqSiAc.js → AccountMappingScreen-DIZ1qWql.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-CLGyk8Pf.js → ActualMatchingMatchDetailScreen-C6MMW6xe.js} +1 -1
  3. package/dist/assets/AddressRoutes-DneYortX.js +1 -0
  4. package/dist/assets/AddressScreen-CxRV-hrD.js +9 -0
  5. package/dist/assets/AiCfoScreen-Ct8ctLoM.js +22 -0
  6. package/dist/assets/{AppDrawer-B2nKx9FM.js → AppDrawer-DDlKiLbC.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-DZgRuPl7.js → BillPayApprovalRoutes-WPV-16X0.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-DswppA7i.js → BillPayRoutes-PQbxiOB3.js} +1 -1
  9. package/dist/assets/BusinessVerificationPageScreen-DaAqJAwC.js +9 -0
  10. package/dist/assets/{CardsAiCfoScreen-BcEAv9Pt.js → CardsAiCfoScreen-CVenT1_U.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-DeJE6G2a.js → ChargeCardRoutes-uCAqAWIA.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-u9kNx3Tg.js → CompanyPassportScreen-DtXzsb3x.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-BC1VQ6tg.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-DGFpytn-.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-i8teYQ0f.js → CustomerOnboardingRoutes-B6np-cNh.js} +5 -5
  16. package/dist/assets/{DashboardRoutes-CVe5_3-I.js → DashboardRoutes-9dawbCei.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-D6T8HuT3.js → DefaultTenantHome-BgSSAKid.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-dIpkGH6g.js → DomesticWireDetailScreen-u2HKaCWA.js} +3 -3
  19. package/dist/assets/{DrawerScreen-Bl0Kb-2-.js → DrawerScreen-BmZb1i83.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-DDHIuX8U.js → EntityDetailRoutes-DV-gNWAZ.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-DgHZQYiA.js → ExpenseAutomationRoutes-DJyIDCG4.js} +1 -1
  22. package/dist/assets/{FallBackRoute-VU9noj8V.js → FallBackRoute--cXyuVDR.js} +2 -2
  23. package/dist/assets/FeaturePreviewScreen-DjPPDYKv.js +1 -0
  24. package/dist/assets/HubSpotOAuthCallbackScreen-DL6_G6pe.js +1 -0
  25. package/dist/assets/{InboxNotificationsProvider-BGgv9Z5e.js → InboxNotificationsProvider-Daf1RQwd.js} +1 -1
  26. package/dist/assets/{InvoicingRoutes-BsZlsusO.js → InvoicingRoutes-DKlu_pXq.js} +2 -2
  27. package/dist/assets/{MagicLinkRoutes-BhGsmEvC.js → MagicLinkRoutes-BkZcOPcj.js} +17 -17
  28. package/dist/assets/MagicLinkSignInScreen-CmIZfa-U.js +12 -0
  29. package/dist/assets/{MobileAppDrawer-BUD0j7G2.js → MobileAppDrawer-DTqKEh3f.js} +1 -1
  30. package/dist/assets/NotFoundScreen-CY-XFa3a.js +1 -0
  31. package/dist/assets/{NotificationRoutes-ZaAHYFIU.js → NotificationRoutes-BwTXq37O.js} +1 -1
  32. package/dist/assets/{OAuthConsentScreen-BKY_MZq1.js → OAuthConsentScreen-NPetpQky.js} +1 -1
  33. package/dist/assets/{PandLWithForecastRoutes-YG8pfDPq.js → PandLWithForecastRoutes-eI5sgFXq.js} +1 -1
  34. package/dist/assets/{PaymentLinkScreen-CO2Phrs3.js → PaymentLinkScreen-C3fxjzB1.js} +1 -1
  35. package/dist/assets/{PeopleRoutes-B0Fd7My2.js → PeopleRoutes-B4kdNKMm.js} +5 -5
  36. package/dist/assets/PerformanceRoutes-CT8b6LEZ.js +1 -0
  37. package/dist/assets/{Preview-CHNtDMAW.js → Preview-Cr2n9zp9.js} +1 -1
  38. package/dist/assets/{QBOConnectionScreen-C4tVfsJt.js → QBOConnectionScreen-BLLJy6Ug.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRoutes-fl_RHS7J.js → ReimbursementApprovalRoutes-DX03V50m.js} +1 -1
  40. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C-svNJCY.js → ReimbursementApprovalRuleDetailScreen-y6N7Iuxh.js} +1 -1
  41. package/dist/assets/{ReimbursementRoutes-D_O2yTEO.js → ReimbursementRoutes-50C6Ebhr.js} +1 -1
  42. package/dist/assets/{ReportsRoutes-DvldCkWE.js → ReportsRoutes-CPbwIPP-.js} +1 -1
  43. package/dist/assets/{RewardsRoutes-DUEA8SkB.js → RewardsRoutes-cADkol8X.js} +1 -1
  44. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-Cx-76x6C.js → ScheduleDetailsPrepaidExpensesScreen-Bb90T06-.js} +5 -5
  45. package/dist/assets/{ScreenRoutes-v-i1WS06.js → ScreenRoutes-BOM6GDiC.js} +2 -2
  46. package/dist/assets/{SettingsRoutes-B8JbWE0A.js → SettingsRoutes-Dd8PYfpt.js} +6 -6
  47. package/dist/assets/{SetupPagesScreen-QcHSEVBO.js → SetupPagesScreen-BY0N32JD.js} +1 -1
  48. package/dist/assets/SignInScreen-DGgeSRO8.js +1 -0
  49. package/dist/assets/SignOutScreen-DPsA_-Qd.js +9 -0
  50. package/dist/assets/{TaskListScreen-C4glK-a5.js → TaskListScreen-yze1VNuP.js} +2 -2
  51. package/dist/assets/{TaskRoutes-Bm5_wmyb.js → TaskRoutes-B5s7sZXk.js} +2 -2
  52. package/dist/assets/{TransactionDetailRoutes-Dv09esw0.js → TransactionDetailRoutes-D5llvRhv.js} +1 -1
  53. package/dist/assets/{TransactionDetailScreen-DvsztMnO.js → TransactionDetailScreen-CebcYk9B.js} +2 -2
  54. package/dist/assets/{TransactionListRoutes-B8IVQdNf.js → TransactionListRoutes-PnEvh6qc.js} +1 -1
  55. package/dist/assets/{TreasuryRoutes-CWptww3e.js → TreasuryRoutes-DbBm2doo.js} +4 -4
  56. package/dist/assets/{VendorsRoutes-BFk85yO0.js → VendorsRoutes-CQjAHjxC.js} +7 -7
  57. package/dist/assets/{WiseConfirmationScreen-Do34o9lu.js → WiseConfirmationScreen-d0_FJyyD.js} +1 -1
  58. package/dist/assets/{ZeniAccountRoutes-DLhkkoyT.js → ZeniAccountRoutes-CrROItmj.js} +8 -8
  59. package/dist/assets/{ZeniAccountStatementScreen-YKTGrgZ2.js → ZeniAccountStatementScreen-DiwM8zAQ.js} +1 -1
  60. package/dist/assets/{accountMappingHelper-DrXX0Mo9.js → accountMappingHelper-DHkHknqJ.js} +1 -1
  61. package/dist/assets/{analytics-Dt3suRsK.js → analytics-CabaUa1L.js} +1 -1
  62. package/dist/assets/{analyticsHelper-Cqab08I6.js → analyticsHelper-BOs1nNPv.js} +1 -1
  63. package/dist/assets/{core-BQjZS2e8.js → core-BQ6YlWys.js} +1 -1
  64. package/dist/assets/{decodeURIComponentSafe-CIIlt5ol.js → decodeURIComponentSafe-D_MvDEMm.js} +1 -1
  65. package/dist/assets/{dnd-DccPQo-x.js → dnd-DL41lZFs.js} +1 -1
  66. package/dist/assets/{empty-DGN7Wz7m.js → empty-CmBSqEpE.js} +1 -1
  67. package/dist/assets/{empty-CmsHIcyu.js → empty-mwfdcHvm.js} +1 -1
  68. package/dist/assets/{emptyVideoElement-CEk87dLW.js → emptyVideoElement-BIOkPHF6.js} +1 -1
  69. package/dist/assets/{epic-Cqfxkt7p.js → epic-PdviWWJR.js} +1 -1
  70. package/dist/assets/{expenseAutomationHelper-CTi3ttti.js → expenseAutomationHelper-Bn2j121J.js} +1 -1
  71. package/dist/assets/{getLocaleForTenant-DFe6xj72.js → getLocaleForTenant-jg4r2V28.js} +1 -1
  72. package/dist/assets/{index-But8NFor.js → index-B7zYAj-7.js} +1 -1
  73. package/dist/assets/{index-B2-Bbk9y.js → index-BNuLRh9K.js} +1 -1
  74. package/dist/assets/{index-hbfcGbz2.js → index-Bfsx1pdD.js} +1 -1
  75. package/dist/assets/{index-CbNzra9d.js → index-BiyVMPcR.js} +1 -1
  76. package/dist/assets/{index-CRxR6I-b.js → index-CamOdFyi.js} +1 -1
  77. package/dist/assets/{index-BkGKDMtv.js → index-DZBfE5XI.js} +3587 -3587
  78. package/dist/assets/{index-CZ1vtmNn.js → index-Deo5Hnb2.js} +1 -1
  79. package/dist/assets/{index-Bpok7EIX.js → index-Du1SP9oT.js} +2 -2
  80. package/dist/assets/{lexical-DQq5IX8L.js → lexical-BmxGnuDE.js} +1 -1
  81. package/dist/assets/{liveblocks-CueKZN6-.js → liveblocks-UAxYbctH.js} +1 -1
  82. package/dist/assets/{lottie-D6SetWLo.js → lottie-BPF4ysWw.js} +1 -1
  83. package/dist/assets/{mui-CQYR1UI4.js → mui-DYo6Z7Si.js} +1 -1
  84. package/dist/assets/{pathToGoBack-nfdDmjjO.js → pathToGoBack-CxX9ql3A.js} +1 -1
  85. package/dist/assets/{pdf-CqrelrTK.js → pdf-CHT1_0Mk.js} +3 -3
  86. package/dist/assets/{pdf-lib-CkerEMYe.js → pdf-lib-BMce44-8.js} +1 -1
  87. package/dist/assets/{plaid-Db_iti-b.js → plaid-BNcFec4W.js} +1 -1
  88. package/dist/assets/{pusher-DBCzLw-Z.js → pusher-C1AzfTgV.js} +1 -1
  89. package/dist/assets/{react-CT55RMnu.js → react-B13-Yejj.js} +1 -1
  90. package/dist/assets/{react-CQAnUX6b.js → react-BnffftLd.js} +1 -1
  91. package/dist/assets/{react-Bl0w5iM8.js → react-CSOME4pA.js} +1 -1
  92. package/dist/assets/{react-BazjfJbS.js → react-CT8AAIAI.js} +1 -1
  93. package/dist/assets/{react-Cg5Hbc0T.js → react-CjoLUzLz.js} +1 -1
  94. package/dist/assets/{react-H6VVspcR.js → react-DZjZzXEf.js} +1 -1
  95. package/dist/assets/{recharts-DNLEWX3j.js → recharts-VJtr9O-6.js} +1 -1
  96. package/dist/assets/{reportTimeframe-BsDWtESB.js → reportTimeframe-D2vFkQK6.js} +1 -1
  97. package/dist/assets/{routePaths-CiV55sI1.js → routePaths-CaZTJQOM.js} +1 -1
  98. package/dist/assets/{sentry-uvO3Tp8f.js → sentry-CQfqw6mU.js} +1 -1
  99. package/dist/assets/{stripSplatSuffix-C6Dmp1Fj.js → stripSplatSuffix-TzoGXcwz.js} +1 -1
  100. package/dist/assets/{url-CR4W537l.js → url-OL55dppf.js} +1 -1
  101. package/dist/assets/{url-BRJzriUX.js → url-dVvWrnA9.js} +1 -1
  102. package/dist/assets/{useActualMatchingMatchDetail-DY4J4jvo.js → useActualMatchingMatchDetail-DglThU_y.js} +1 -1
  103. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-U0l3bFxn.js → useAiCfoDashboardSuggestedQuestionsChips-B4OxQoVy.js} +1 -1
  104. package/dist/assets/useAskAiCfoHostNavButtonProps-DV6iNvbF.js +1 -0
  105. package/dist/assets/{useChargeCardPusherEvents-Ba7ulirt.js → useChargeCardPusherEvents-Gp7Qmy_v.js} +1 -1
  106. package/dist/assets/{useDeviceId-CgZjgOTE.js → useDeviceId-B6KB8W5T.js} +1 -1
  107. package/dist/assets/{useEmailConnectResultRefresh-BMjAwZWL.js → useEmailConnectResultRefresh-DJgvOf06.js} +1 -1
  108. package/dist/assets/{useEnsureVendorListLoaded-BSdY2ycY.js → useEnsureVendorListLoaded-BbjOUcqm.js} +1 -1
  109. package/dist/assets/{useInitialThreadRequest-E--3OsRP.js → useInitialThreadRequest-BpNcTGLt.js} +1 -1
  110. package/dist/assets/{useTaskManagerAccess-DzHDJDg5.js → useTaskManagerAccess-CP331xWN.js} +1 -1
  111. package/dist/assets/{useTaskManagerPusherEvents-BKgeoe5K.js → useTaskManagerPusherEvents-BmjCwNse.js} +1 -1
  112. package/dist/assets/{utils-BUB23Z37.js → utils-BpLD-La5.js} +1 -1
  113. package/dist/assets/{withTransactionSidePanel-D8qNv0pH.js → withTransactionSidePanel-7NlWHlVm.js} +1 -1
  114. package/dist/assets/{zeni-epic-state-DNah8dni.js → zeni-epic-state-j9Po26Lg.js} +3 -3
  115. package/dist/index.html +1 -1
  116. package/package.json +2 -2
  117. package/dist/assets/AddressRoutes-BTMFaoPH.js +0 -1
  118. package/dist/assets/AddressScreen-CS8bv4zo.js +0 -9
  119. package/dist/assets/AiCfoScreen-CLNLnVZu.js +0 -22
  120. package/dist/assets/BusinessVerificationPageScreen-ByDASFk9.js +0 -9
  121. package/dist/assets/ConnectionAuthScreen-DVi6hxMj.js +0 -11
  122. package/dist/assets/CustomerOnboardingAuthScreen-cEY6ZjCp.js +0 -1
  123. package/dist/assets/FeaturePreviewScreen-e7I8ExNO.js +0 -1
  124. package/dist/assets/HubSpotOAuthCallbackScreen-CU5AUU74.js +0 -1
  125. package/dist/assets/MagicLinkSignInScreen-BRRvS_-g.js +0 -12
  126. package/dist/assets/NotFoundScreen-Da0kpRnr.js +0 -1
  127. package/dist/assets/PerformanceRoutes-4RVlZlPh.js +0 -1
  128. package/dist/assets/SignInScreen-6YsvQGsU.js +0 -1
  129. package/dist/assets/SignOutScreen-50K2PKll.js +0 -9
  130. package/dist/assets/useAskAiCfoHostNavButtonProps-Ds1IYXBl.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-CueKZN6-.js";import{i as S,l as g,h as C,g as y,u as ee,t as te,j as E,N as ae,n as ne,o as p}from"./core-BQjZS2e8.js";import{Ve as k,Vf as v,Vg as V,K8 as D,JW as T,Vh as B,Vi as oe,Vj as ie,J_ as se,gl as $,K5 as le,K2 as re}from"./zeni-epic-state-DNah8dni.js";import{a2 as x,R as r,a3 as de,e as j,_ as K,a4 as ce,a5 as me,a6 as pe,v as G,p as ue,b as he,a7 as ge,k as xe,n as fe,a8 as be,a9 as we,a0 as Se,aa as ye,ab as ke,ac as ve,ad as je}from"./index-BkGKDMtv.js";import{n as m,u as $e}from"./mui-CQYR1UI4.js";import f from"./NotFoundScreen-Da0kpRnr.js";import{a as I}from"./sentry-uvO3Tp8f.js";import"./recharts-DNLEWX3j.js";import"./analytics-Dt3suRsK.js";import"./plaid-Db_iti-b.js";import"./dnd-DccPQo-x.js";import"./stripe-cKAAJElX.js";import"./lottie-D6SetWLo.js";import"./lexical-DQq5IX8L.js";import"./pdf-CqrelrTK.js";import"./utils-BUB23Z37.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]="15301c07-6e32-4399-b82a-96b268885018",e._sentryDebugIdIdentifier="sentry-dbid-15301c07-6e32-4399-b82a-96b268885018")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-UAxYbctH.js";import{i as S,l as g,h as C,g as y,u as ee,t as te,j as E,N as ae,n as ne,o as p}from"./core-BQ6YlWys.js";import{Ve as k,Vf as j,Vg as V,K8 as D,JW as T,Vh as B,Vi as oe,Vj as ie,J_ as se,gl as $,K5 as le,K2 as de}from"./zeni-epic-state-j9Po26Lg.js";import{a2 as x,R as d,a3 as re,d as v,_ as K,a4 as ce,a5 as me,a6 as pe,s as G,p as ue,N as he,a7 as ge,j as xe,m as fe,a8 as we,a9 as be,a0 as Se,aa as ye,ab as ke,ac as je,ad as ve}from"./index-DZBfE5XI.js";import{n as m,u as $e}from"./mui-DYo6Z7Si.js";import f from"./NotFoundScreen-CY-XFa3a.js";import{a as I}from"./sentry-CQfqw6mU.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.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]="34b29b45-dca4-4fa8-9ee4-e9765d9c514d",e._sentryDebugIdIdentifier="sentry-dbid-34b29b45-dca4-4fa8-9ee4-e9765d9c514d")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,8 +6,8 @@ import{j as t}from"./liveblocks-CueKZN6-.js";import{i as S,l as g,h as C,g as y,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,Ce=g((function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}}),(function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(D(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(V({data:l}))}}}))(de);function F(){const e=x(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const De=m.div`
9
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=g((function(e){const a=k(e),n=j(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}}),(function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(D(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(V({data:l}))}}}))(re);function F(){const e=x(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const De=m.div`
11
11
  display: flex;
12
12
  height: 100vh;
13
13
  width: 100%;
@@ -15,7 +15,7 @@ import{j as t}from"./liveblocks-CueKZN6-.js";import{i as S,l as g,h as C,g as y,
15
15
  flex-direction: column;
16
16
  align-items: center;
17
17
  background-color: ${e=>e.theme.colors.grey4};
18
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
18
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
19
  `,Be=g((function(e,a){const{isSubPage:n}=a;return{addressToEdit:B(e),googleAPIKey:K.googleMapsAPIKey,isSubPage:n}}),(function(e,a){const{navigate:n,location:o}=a,i=()=>{const l=me(o.state?.pathnameStackToGoBack),s=l.poppedPathname??Pe();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=ze(l);e(oe({addressToCreate:s})),i()},onCancel:()=>{i()}}}))(ce);function Ae({isSubPage:e}){const a=C(),n=y(),o=x();return t.jsx(t.Fragment,{children:t.jsx(De,{windowSize:o,children:t.jsx(Be,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:K.googleMapsAPIKey})})})}const Pe=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
20
20
  display: flex;
21
21
  height: 100%;
@@ -24,8 +24,8 @@ import{j as t}from"./liveblocks-CueKZN6-.js";import{i as S,l as g,h as C,g as y,
24
24
  flex-direction: column;
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=g((function(e){const a=k(e),n=v(e),o=B(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(V({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=G(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}}))(pe);function Ee(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
27
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Ne=g((function(e){const a=k(e),n=j(e),o=B(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(V({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),r=G(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}}))(pe);function Ee(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -33,13 +33,13 @@ import{j as t}from"./liveblocks-CueKZN6-.js";import{i as S,l as g,h as C,g as y,
33
33
  flex-direction: column;
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Ve=g((function(e){const a=k(e),n=v(e),o=B(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(ie({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=G(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}}))(ge);function Te(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Ve,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Ke={containerWidth:new ve(100,58)},Ge=m(ye)`
38
- width: ${r.sp4};
39
- height: ${r.sp4};
40
- margin-bottom: ${r.sp3};
41
- margin-top: ${r.sp3};
42
- margin-left: ${r.sp8};
36
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Ve=g((function(e){const a=k(e),n=j(e),o=B(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:r}=s;e(ie({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),r=G(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}}))(ge);function Te(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Ve,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Ke={containerWidth:new je(100,58)},Ge=m(ye)`
38
+ width: ${d.sp4};
39
+ height: ${d.sp4};
40
+ margin-bottom: ${d.sp3};
41
+ margin-top: ${d.sp3};
42
+ margin-left: ${d.sp8};
43
43
  cursor: pointer;
44
44
  position: absolute;
45
45
  color: ${e=>e.theme.colors.brandColorJade};
@@ -56,17 +56,17 @@ import{j as t}from"./liveblocks-CueKZN6-.js";import{i as S,l as g,h as C,g as y,
56
56
  flex-direction: column;
57
57
  width: ${e=>`${Ke.containerWidth.value(e.windowSize)}%`};
58
58
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
- padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
59
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
61
61
  `,He=m.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
65
65
  justify-content: center;
66
- padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
66
+ padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
67
67
  height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
68
  overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,We=g((function(e,a){return{file:a.file,type:a.type}}))(ke);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),d=s.get("token"),M=n.pathname.includes("address"),b=x(),_=xe(),A=$e(),w=fe(),H=()=>{_.toggle()},W=E((u=>k(u))),J=E((u=>v(u))),{authParams:U,fetchState:c,billAttachment:R,billFetchState:P,companyName:q,currencySymbol:O,amount:Q}=W,{tenantId:z,userId:L,sessionId:N}=U,{fetchState:X,internationalBankAccountCreateStatus:Y}=J;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{w&&c==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(le(i,o,d))}),[w,c,i,o,d,a]),I.useEffect((()=>{w&&c==="Completed"&&($(L,N,z),l!=null&&a(re(l)))}),[c,w,L,N,z,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(we,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",i??"",q,l??"",Je(n.pathname),O,Q))(u)}),t.jsxs(Me,{windowSize:b,children:[b!=="small"?t.jsx(Ge,{onClick:H}):null,t.jsx(He,{windowSize:b,isAddressPage:M,children:P==="In-Progress"?t.jsx(Se,{size:"ExtraLarge",start:!0}):t.jsx(We,{file:R,type:"bill"})}),t.jsx(_e,{windowSize:b,children:e})]})]})}const Je=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return t.jsx(je,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Ue,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Ae,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Te,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
72
+ `,We=g((function(e,a){return{file:a.file,type:a.type}}))(ke);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),r=s.get("token"),M=n.pathname.includes("address"),w=x(),_=xe(),A=$e(),b=fe(),H=()=>{_.toggle()},W=E((u=>k(u))),J=E((u=>j(u))),{authParams:U,fetchState:c,billAttachment:R,billFetchState:P,companyName:q,currencySymbol:O,amount:Q}=W,{tenantId:z,userId:L,sessionId:N}=U,{fetchState:X,internationalBankAccountCreateStatus:Y}=J;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{b&&c==="Not-Started"&&i!=null&&o!=null&&r!=null&&a(le(i,o,r))}),[b,c,i,o,r,a]),I.useEffect((()=>{b&&c==="Completed"&&($(L,N,z),l!=null&&a(de(l)))}),[c,b,L,N,z,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(we,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${A.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(be,{analytics:v,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",i??"",q,l??"",Je(n.pathname),O,Q))(u)}),t.jsxs(Me,{windowSize:w,children:[w!=="small"?t.jsx(Ge,{onClick:H}):null,t.jsx(He,{windowSize:w,isAddressPage:M,children:P==="In-Progress"?t.jsx(Se,{size:"ExtraLarge",start:!0}):t.jsx(We,{file:R,type:"bill"})}),t.jsx(_e,{windowSize:w,children:e})]})]})}const Je=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return t.jsx(ve,{})}function rt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Ue,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Ae,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Te,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{rt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-UAxYbctH.js";import{a as g}from"./sentry-CQfqw6mU.js";import{u as F,g as O,h as _,t as w,j as l,N as T}from"./core-BQ6YlWys.js";import{z as r,G as P,T as M,d as A,U as N,$,a0 as G,X as R}from"./index-DZBfE5XI.js";import{fI as W,UP as X,Vb as Y,h9 as q,gl as B,gn as H,V7 as J,gY as K,d3 as Q,Vc as Z,Vd as ee}from"./zeni-epic-state-j9Po26Lg.js";import{u as te,n as ne}from"./mui-DYo6Z7Si.js";import{u as se}from"./useDeviceId-B6KB8W5T.js";import{f as ae}from"./analyticsHelper-BOs1nNPv.js";import{t as ie}from"./getLocaleForTenant-jg4r2V28.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="df097ebf-34d3-41c6-a499-30bf59802b01",t._sentryDebugIdIdentifier="sentry-dbid-df097ebf-34d3-41c6-a499-30bf59802b01")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=F(),a=O(),m=_(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=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)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>W(e))),b=l((e=>X(e))),E=r.getSignedInUser(),v=te().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Y(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),g.useEffect((()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(q(b.tenantsInOrder),s.zeniSessionId),B(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(J("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),K().then((()=>{const e=R();e!=null&&M(e)})),setTimeout((()=>{A.trackLogin(N.Event.loginSuccess,"email",Q(o.productSettings))}),2e3))}),[I,S,y,s,o,b,v,a.state,t]);const U=g.useCallback((()=>{m("/signin/auth")}),[m]),V=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(Z(i,c,d))}),[i,d,t,c]),j=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(ee(e,i,c,d))}),[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx($,{phoneNumber:D,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:V,onVerifyOtp:j,onCancelVerifyDevice:U});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(G,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{Ce as default};
@@ -1 +1 @@
1
- import{j as _}from"./liveblocks-CueKZN6-.js";import{a as m}from"./sentry-uvO3Tp8f.js";import{u as te,j as t,i as $e,g as Ge,h as Me,q as F}from"./core-BQjZS2e8.js";import{fI as ne,UQ as Ne,UR as se,gc as Ue,fH as Ve,U_ as xe,UT as Re,UU as Pe,qd as Oe,gp as je,UX as b,V0 as Le,V1 as X,gq as Ze,V2 as qe,EM as ze,h5 as He,cM as Ye,V3 as Je,gb as Qe,gr as We}from"./zeni-epic-state-DNah8dni.js";import{w as Xe,h as Ke,k as ea,p as aa,m as ta,n as na,u as sa,b as c,i as oa,f as ia,z as ra,a as da,y as ca,A as la,F as ua,C as ma,D as K,c as fa,O as ha,Q as ba,v as g,e as ee,J as pa,S as ae,M as Sa,N as ga}from"./index-BkGKDMtv.js";import{D as ka}from"./mui-CQYR1UI4.js";import{u as Ea}from"./InboxNotificationsProvider-BGgv9Z5e.js";import{u as Ca}from"./useTaskManagerAccess-DzHDJDg5.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="7df9dc30-3112-44ae-9588-c75abe7aa6a6",l._sentryDebugIdIdentifier="sentry-dbid-7df9dc30-3112-44ae-9588-c75abe7aa6a6")}catch{}})();const Ta=Xe((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=$e(),a=Ge(),k=ea(),n=Me(),B=Ue(),r=te(),{useFeatureGate:d}=aa(),p=ta(),{isTaskManagerAccessEnabled:E}=Ca(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>Ve(e))),{status:ie}=t(xe),G=$.uiState.currentChatSessionId,C=na(),{setLoading:re}=sa(),[w,M]=m.useState(void 0),A=F("/:tenantEmailDomain/dashboard")!==null,N=F("/:tenantEmailDomain/reports")!==null,f=F("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:U}=d(c.isDebitCardFeatureEnabled),le=oa(o,ce,U),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),V=t((e=>Re(e))),{isFeatureEnabled:T}=d(c.isReferralFeatureEnabled),v=t((e=>Pe(e)));m.useEffect((()=>{C&&T&&!f&&v.fetchState==="Not-Started"&&r(Oe(!0))}),[C,T,v.fetchState,f]);const D=t((e=>e.tenantState)),me=t((e=>D.fetchState==="Completed"?je(e):[])),S=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:fe}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:he}=d(c.isArAgingFeatureEnabled),x=ia(),{isFeatureEnabled:be}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarNewYearAnimationEnabled),ke=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",Ee=t((e=>b(e).totalUnreadCount)),Ce=t((e=>b(e).reducedFetchCountState)),R=t((e=>b(e).notificationDetailsByTab.tasks.uiState.unreadCount)),P=t((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),O=t((e=>b(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:j,isLoading:L,isFetchingMore:Z,hasFetchedAll:q,fetchMore:Te}=Ea();m.useEffect((()=>{const e=setTimeout((()=>Te?.()),0);return()=>clearTimeout(e)})),m.useEffect((()=>{if(L===!1&&Z===!1&&q===!0)if(o?.companyId!=null&&j!=null){const e=`dashboard_${o.companyId}`;M(j.filter((u=>u.roomId===e&&u.readAt==null)).length)}else M(0)}),[L,Z,q]),m.useEffect((()=>{C&&E&&!f&&O.fetchState==="Not-Started"&&B.tenantId!=null&&r(Le("task_manager","dashboard"))}),[C,E,f,O.fetchState,B.tenantId,r]),m.useEffect((()=>{f||I.fetchState!=="Not-Started"||r(X({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,I.fetchState,r]),m.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(X({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ce,count:Ee},z=s!=null?ra.getSignedInUserTenant(s):null,H=t((e=>z?.tenantId!=null?Ze(e,z.tenantId):void 0)),h=[];fe===!1&&h.push("accounts_payable_aging"),he===!1&&h.push("accounts_receivable_aging"),h.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&h.push("rewards_card"),x===!1&&h.push("expense_automation_card");const Y=t((e=>qe(e,h).fetchState)),J=t((e=>ze(e).fetchState)),ye=A&&(Y==="Completed"||Y==="Error")||N&&(J==="Completed"||J==="Error")||!A&&!N?void 0:"disabled",we=m.useMemo((()=>He(o.userRole)),[o.userRole]),Ae=Ye(we),ve=o?.rewardsLastViewedTime==null,De=p?.userEmail!=null&&V.fetchState==="Completed"&&Je(V.notificationSettings,p.userEmail,U,o,E),Q=da(),Fe=Q&&ca(a);return _.jsx(ka,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:_.jsx(la,{signedInUser:p,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?me:H!=null?[H]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:K(a),isInvoicing:ma(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:Ae,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:ke,isNotificationsTabVisible:De,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:x,selectedMenu:ua(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:ve,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:Q,onNotificationIconClick:()=>{i(!1);let e=R===0&&P>0?"notifications/comments":"notifications/tasks";K(a)&&(e=R===0&&P>0?"../../notifications/comments":"../../notifications/tasks");const u=g(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=g(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:g(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void pa({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=g(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=g(a.state?.pathnameStackToGoBack,a.pathname),W=e.type,_e=ae(W)&&W!=="command_center";if(ae(e.type)&&S[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(S[o.tenantId].month,S[o.tenantId].year,"Sidebar"),_e&&S[o.tenantId]!=null){const y=S[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const Be=Sa(e.type);ga(e.type)?(G!=null&&r(We()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${Be}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(fa.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:ba(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{k.toggle()},isAiCfo:Fe,aiCfoView:$,isOnDashboard:A,updateCurrentChatSessionId:e=>{r(Qe({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:be,isTaskManagerAccessEnabled:E,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:Se,newYearAnimationEnabled:ge})})})),Ba=l=>{const i=te(),s=t((k=>ne(k))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,n)=>{Ke(n)&&Ne(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return _.jsx(Ta,{...l,...a})};export{Ba as M};
1
+ import{j as _}from"./liveblocks-UAxYbctH.js";import{a as m}from"./sentry-CQfqw6mU.js";import{u as te,j as t,i as $e,g as Ge,h as Me,q as F}from"./core-BQ6YlWys.js";import{fI as ne,UQ as xe,UR as se,gc as Ne,fH as Ue,U_ as Ve,UT as Re,UU as Pe,qd as Oe,gp as je,UX as b,V0 as Le,V1 as X,gq as Ze,V2 as qe,EM as ze,h5 as He,cM as Ye,V3 as Ke,gb as Qe,gr as We}from"./zeni-epic-state-j9Po26Lg.js";import{w as Xe,g as Je,j as ea,p as aa,k as ta,m as na,u as sa,N as c,i as oa,f as ia,z as ra,a as da,x as ca,y as la,E as ua,A as ma,C as J,b as fa,O as ha,Q as ba,s as S,d as ee,I as pa,S as ae,K as ga,M as Sa}from"./index-DZBfE5XI.js";import{D as Ea}from"./mui-DYo6Z7Si.js";import{u as ka}from"./InboxNotificationsProvider-Daf1RQwd.js";import{u as Ca}from"./useTaskManagerAccess-CP331xWN.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="296fa560-c47a-4252-9860-69e9def48cec",l._sentryDebugIdIdentifier="sentry-dbid-296fa560-c47a-4252-9860-69e9def48cec")}catch{}})();const Ta=Xe((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=$e(),a=Ge(),E=ea(),n=Me(),B=Ne(),r=te(),{useFeatureGate:d}=aa(),p=ta(),{isTaskManagerAccessEnabled:k}=Ca(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>Ue(e))),{status:ie}=t(Ve),G=$.uiState.currentChatSessionId,C=na(),{setLoading:re}=sa(),[w,M]=m.useState(void 0),A=F("/:tenantEmailDomain/dashboard")!==null,x=F("/:tenantEmailDomain/reports")!==null,f=F("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:N}=d(c.isDebitCardFeatureEnabled),le=oa(o,ce,N),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),U=t((e=>Re(e))),{isFeatureEnabled:T}=d(c.isReferralFeatureEnabled),v=t((e=>Pe(e)));m.useEffect((()=>{C&&T&&!f&&v.fetchState==="Not-Started"&&r(Oe(!0))}),[C,T,v.fetchState,f]);const D=t((e=>e.tenantState)),me=t((e=>D.fetchState==="Completed"?je(e):[])),g=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:fe}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:he}=d(c.isArAgingFeatureEnabled),V=ia(),{isFeatureEnabled:be}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarNewYearAnimationEnabled),Ee=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",ke=t((e=>b(e).totalUnreadCount)),Ce=t((e=>b(e).reducedFetchCountState)),R=t((e=>b(e).notificationDetailsByTab.tasks.uiState.unreadCount)),P=t((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),O=t((e=>b(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:j,isLoading:L,isFetchingMore:Z,hasFetchedAll:q,fetchMore:Te}=ka();m.useEffect((()=>{const e=setTimeout((()=>Te?.()),0);return()=>clearTimeout(e)})),m.useEffect((()=>{if(L===!1&&Z===!1&&q===!0)if(o?.companyId!=null&&j!=null){const e=`dashboard_${o.companyId}`;M(j.filter((u=>u.roomId===e&&u.readAt==null)).length)}else M(0)}),[L,Z,q]),m.useEffect((()=>{C&&k&&!f&&O.fetchState==="Not-Started"&&B.tenantId!=null&&r(Le("task_manager","dashboard"))}),[C,k,f,O.fetchState,B.tenantId,r]),m.useEffect((()=>{f||I.fetchState!=="Not-Started"||r(X({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,I.fetchState,r]),m.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(X({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ce,count:ke},z=s!=null?ra.getSignedInUserTenant(s):null,H=t((e=>z?.tenantId!=null?Ze(e,z.tenantId):void 0)),h=[];fe===!1&&h.push("accounts_payable_aging"),he===!1&&h.push("accounts_receivable_aging"),h.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&h.push("rewards_card"),V===!1&&h.push("expense_automation_card");const Y=t((e=>qe(e,h).fetchState)),K=t((e=>ze(e).fetchState)),ye=A&&(Y==="Completed"||Y==="Error")||x&&(K==="Completed"||K==="Error")||!A&&!x?void 0:"disabled",we=m.useMemo((()=>He(o.userRole)),[o.userRole]),Ae=Ye(we),ve=o?.rewardsLastViewedTime==null,De=p?.userEmail!=null&&U.fetchState==="Completed"&&Ke(U.notificationSettings,p.userEmail,N,o,k),Q=da(),Fe=Q&&ca(a);return _.jsx(Ea,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:_.jsx(la,{signedInUser:p,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?me:H!=null?[H]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:J(a),isInvoicing:ma(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:Ae,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:Ee,isNotificationsTabVisible:De,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:V,selectedMenu:ua(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:ve,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:Q,onNotificationIconClick:()=>{i(!1);let e=R===0&&P>0?"notifications/comments":"notifications/tasks";J(a)&&(e=R===0&&P>0?"../../notifications/comments":"../../notifications/tasks");const u=S(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=S(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:S(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void pa({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=S(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=S(a.state?.pathnameStackToGoBack,a.pathname),W=e.type,_e=ae(W)&&W!=="command_center";if(ae(e.type)&&g[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(g[o.tenantId].month,g[o.tenantId].year,"Sidebar"),_e&&g[o.tenantId]!=null){const y=g[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const Be=ga(e.type);Sa(e.type)?(G!=null&&r(We()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${Be}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(fa.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:ba(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{E.toggle()},isAiCfo:Fe,aiCfoView:$,isOnDashboard:A,updateCurrentChatSessionId:e=>{r(Qe({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:be,isTaskManagerAccessEnabled:k,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:ge,newYearAnimationEnabled:Se})})})),Ba=l=>{const i=te(),s=t((E=>ne(E))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(E,n)=>{Je(n)&&xe(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return _.jsx(Ta,{...l,...a})};export{Ba as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-UAxYbctH.js";import{h as r,l as i}from"./core-BQ6YlWys.js";import{d6 as n}from"./index-DZBfE5XI.js";import"./mui-DYo6Z7Si.js";import"./sentry-CQfqw6mU.js";import"./zeni-epic-state-j9Po26Lg.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="9aa67ded-70e9-4f18-a970-986bf2668dfb",o._sentryDebugIdIdentifier="sentry-dbid-9aa67ded-70e9-4f18-a970-986bf2668dfb")}catch{}})();const a=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{n as dt,a as lt,o as ft,j as N}from"./liveblocks-CueKZN6-.js";import ut from"./NotFoundScreen-Da0kpRnr.js";import{a as k}from"./sentry-uvO3Tp8f.js";import{h as ht,g as pt,i as kt,u as gt,j as b,l as bt,n as St,o as K}from"./core-BQjZS2e8.js";import{cr as It,UT as Q,fI as Y,h5 as Tt,UX as S,a3d as z,V1 as d,UR as y,AY as F,GK as Ct,a3e as At,UQ as yt,V3 as Et,B1 as _t,a3f as $,bv as j,gk as x,B5 as O,a3g as Nt,cD as Bt,cw as wt}from"./zeni-epic-state-DNah8dni.js";import{aC as xt,m as vt,p as Ut,b as Rt,al as Dt,e7 as Gt,v as B,e8 as Pt,w as Mt,e9 as $t,h as jt,a5 as Ft}from"./index-BkGKDMtv.js";import"./mui-CQYR1UI4.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-Ds1IYXBl.js";import{u as Wt}from"./useTaskManagerAccess-DzHDJDg5.js";import"./recharts-DNLEWX3j.js";import"./analytics-Dt3suRsK.js";import"./plaid-Db_iti-b.js";import"./dnd-DccPQo-x.js";import"./stripe-cKAAJElX.js";import"./lottie-D6SetWLo.js";import"./lexical-DQq5IX8L.js";import"./pdf-CqrelrTK.js";import"./utils-BUB23Z37.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]="6e0123fb-e0ac-4fcb-8c39-c00eb70d001e",t._sentryDebugIdIdentifier="sentry-dbid-6e0123fb-e0ac-4fcb-8c39-c00eb70d001e")}catch{}})();const qt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Lt=bt((function(t,l){const n=Q(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=S(t),f=Y(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:U}=l;return{onNotificationClick:(a,s,m,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}m==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,s,m)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){m==="unread"&&(I(a),t($([a],j())));let i=`/${h}/${r[1]}`;const T=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!wt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,s)=>{t(y(a,s))},onUpdateNotificationTabState:(a,s)=>{t(d(a,s))},onUpdateNotificationViewCurrentTabAndSubTab:(a,s)=>{t(z(a,s));const m=`../${a}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(m,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,s)=>{if(a==="tasks"){const m=[];s==="all"?m.push("read","unread"):s!=="mentions"&&m.push(s),t(F("task_manager","dashboard",m))}else U?.()},onUpdateNotificationStatus:(a,s,m,r)=>{a==="tasks"?t(O("task_manager",m,r)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{m==="read"&&(I(i),t($([i],j())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(d({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(d({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(o,I).then((()=>{t($(o,j())),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((s=>{t(d({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Mt($t)),Xt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=It(h??""),o=gt(),f=vt(),[I,U]=k.useState(!1),a=b((e=>Q(e))),s=b((e=>Y(e))),{useFeatureGate:m}=Ut(),{isFeatureEnabled:r}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:T}=Vt({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Z=Tt(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=b((e=>S(e).notificationDetailsByTab.tasks.fetchState)),W=b((e=>S(e).currentTab)),R=b((e=>S(e).currentSubTab)),tt=b((e=>S(e).notificationDetailsByTab.comments.fetchCountState)),D=b((e=>S(e).notificationDetailsByTab.comments.fetchState)),et=b((e=>S(e).notificationDetailsByTab.comments.uiState.unreadCount)),at=b((e=>S(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),st=Gt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:G,fetchMore:ot}=dt(),{threads:q,isLoading:L,fetchMore:X,isFetchingMore:H,hasFetchedAll:J}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(W!==c&&c!=null&&o(z(c)),c==null){const e=`../${W}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&C===!0&&s?.companyId!=null&&w!=null){const e=`dashboard_${s.companyId}`,p=w.filter((A=>A.roomId===e&&A.readAt==null)).length;o(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const P=E||G===!0||C!==!0||E||G===!0||C!==!0;k.useEffect((()=>{P&&D!=="In-Progress"?o(d({fetchState:"In-Progress",error:void 0},"comments")):P||D!=="In-Progress"||o(d({fetchState:"Completed",error:void 0},"comments"))}),[P,D]),k.useEffect((()=>{o(y({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&I===!1&&(U(!0),o(Ct()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&L===!1&&w!=null&&q!=null){const e=`dashboard_${s.companyId}`,p=w.filter((u=>u.roomId===e)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=q.find((mt=>{return mt.id===((v=u).kind==="thread"?v.threadId:"subjectId"in v?v.subjectId:void 0);var v}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(H||J===!0||X==null||X(),null)})).filter((u=>u!=null));o(d({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,G,H,C,J,L,w?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(jt(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];R==="all"?_.push("read","unread"):R!=="mentions"&&_.push(R),o(F("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Wt(f);return N.jsx(Lt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:et,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:at,isAiCfoAccessEnabled:i,onAskAiCfoClick:T,...nt})};function de(){return N.jsxs(St,{children:[N.jsx(K,{path:"/:selectedTab",element:N.jsx(Xt,{})}),N.jsx(K,{path:"*",element:N.jsx(ut,{})})]})}export{de as default};
1
+ import{n as mt,a as lt,o as ft,j as N}from"./liveblocks-UAxYbctH.js";import ut from"./NotFoundScreen-CY-XFa3a.js";import{a as k}from"./sentry-CQfqw6mU.js";import{h as ht,g as pt,i as kt,u as gt,j as b,l as bt,n as St,o as K}from"./core-BQ6YlWys.js";import{cr as It,UT as Q,fI as Y,h5 as Tt,UX as S,a3d as z,V1 as m,UR as y,AY as F,GK as Ct,a3e as At,UQ as yt,V3 as Et,B1 as _t,a3f as $,bv as j,gk as x,B5 as O,a3g as Nt,cD as Bt,cw as wt}from"./zeni-epic-state-j9Po26Lg.js";import{aC as xt,k as Ut,p as vt,N as Rt,al as Dt,e7 as Gt,s as B,e8 as Pt,w as Mt,e9 as $t,g as jt,a5 as Ft}from"./index-DZBfE5XI.js";import"./mui-DYo6Z7Si.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-DV6iNvbF.js";import{u as Wt}from"./useTaskManagerAccess-CP331xWN.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.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]="80b3a6b5-5936-480d-ac6d-795b00fa6bfc",t._sentryDebugIdIdentifier="sentry-dbid-80b3a6b5-5936-480d-ac6d-795b00fa6bfc")}catch{}})();const qt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Lt=bt((function(t,l){const n=Q(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=S(t),f=Y(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}d==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(a),t($([a],j())));let i=`/${h}/${r[1]}`;const T=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!wt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,s)=>{t(y(a,s))},onUpdateNotificationTabState:(a,s)=>{t(m(a,s))},onUpdateNotificationViewCurrentTabAndSubTab:(a,s)=>{t(z(a,s));const d=`../${a}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,s)=>{if(a==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(F("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(a,s,d,r)=>{a==="tasks"?t(O("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t($([i],j())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(o,I).then((()=>{t($(o,j())),t(m({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((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Mt($t)),Xt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=It(h??""),o=gt(),f=Ut(),[I,v]=k.useState(!1),a=b((e=>Q(e))),s=b((e=>Y(e))),{useFeatureGate:d}=vt(),{isFeatureEnabled:r}=d(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:T}=Vt({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Z=Tt(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=b((e=>S(e).notificationDetailsByTab.tasks.fetchState)),W=b((e=>S(e).currentTab)),R=b((e=>S(e).currentSubTab)),tt=b((e=>S(e).notificationDetailsByTab.comments.fetchCountState)),D=b((e=>S(e).notificationDetailsByTab.comments.fetchState)),et=b((e=>S(e).notificationDetailsByTab.comments.uiState.unreadCount)),at=b((e=>S(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),st=Gt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:G,fetchMore:ot}=mt(),{threads:q,isLoading:L,fetchMore:X,isFetchingMore:H,hasFetchedAll:J}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(W!==c&&c!=null&&o(z(c)),c==null){const e=`../${W}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&C===!0&&s?.companyId!=null&&w!=null){const e=`dashboard_${s.companyId}`,p=w.filter((A=>A.roomId===e&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const P=E||G===!0||C!==!0||E||G===!0||C!==!0;k.useEffect((()=>{P&&D!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):P||D!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[P,D]),k.useEffect((()=>{o(y({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&I===!1&&(v(!0),o(Ct()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&L===!1&&w!=null&&q!=null){const e=`dashboard_${s.companyId}`,p=w.filter((u=>u.roomId===e)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=q.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(H||J===!0||X==null||X(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,G,H,C,J,L,w?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(jt(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];R==="all"?_.push("read","unread"):R!=="mentions"&&_.push(R),o(F("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Wt(f);return N.jsx(Lt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:et,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:at,isAiCfoAccessEnabled:i,onAskAiCfoClick:T,...nt})};function me(){return N.jsxs(St,{children:[N.jsx(K,{path:"/:selectedTab",element:N.jsx(Xt,{})}),N.jsx(K,{path:"*",element:N.jsx(ut,{})})]})}export{me as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-CueKZN6-.js";import{a as r}from"./sentry-uvO3Tp8f.js";import{u as A,g as j,j as o,N as C}from"./core-BQjZS2e8.js";import{Vo as P,fI as V,gp as x,Vp as z,Vq as D,Vr as M,Vs as R,hd as k,U9 as q}from"./zeni-epic-state-DNah8dni.js";import{z as h,ai as I}from"./index-BkGKDMtv.js";import"./mui-CQYR1UI4.js";import"./recharts-DNLEWX3j.js";import"./analytics-Dt3suRsK.js";import"./plaid-Db_iti-b.js";import"./dnd-DccPQo-x.js";import"./stripe-cKAAJElX.js";import"./lottie-D6SetWLo.js";import"./lexical-DQq5IX8L.js";import"./pdf-CqrelrTK.js";import"./utils-BUB23Z37.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]="1db0dca8-6f02-44dd-beb5-b6b34ac10d3f",n._sentryDebugIdIdentifier="sentry-dbid-1db0dca8-6f02-44dd-beb5-b6b34ac10d3f")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo((()=>P(s.search)),[s.search]),b=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o((e=>V(e))),d=o((e=>x(e))),l=o((e=>e.tenantState.fetchState)),w=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,U]=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((()=>{p&&a!=null&&!g.current&&(l!=="Not-Started"&&l!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[p,a,l,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&d.some((T=>T.tenantId===e))?e:d.length===1?d[0].tenantId:null}),[f?.tenantId,d]),u=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:b,userEmail:a?.userEmail,isInitializing:l!=="Completed",tenants:d,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:w==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(q(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{U("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-UAxYbctH.js";import{a as r}from"./sentry-CQfqw6mU.js";import{u as A,g as j,j as o,N as C}from"./core-BQ6YlWys.js";import{Vo as P,fI as V,gp as x,Vp as z,Vq as D,Vr as M,Vs as R,hd as k,U9 as q}from"./zeni-epic-state-j9Po26Lg.js";import{z as h,ai as I}from"./index-DZBfE5XI.js";import"./mui-DYo6Z7Si.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.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]="1db0dca8-6f02-44dd-beb5-b6b34ac10d3f",n._sentryDebugIdIdentifier="sentry-dbid-1db0dca8-6f02-44dd-beb5-b6b34ac10d3f")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo((()=>P(s.search)),[s.search]),b=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o((e=>V(e))),d=o((e=>x(e))),l=o((e=>e.tenantState.fetchState)),w=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,U]=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((()=>{p&&a!=null&&!g.current&&(l!=="Not-Started"&&l!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[p,a,l,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&d.some((T=>T.tenantId===e))?e:d.length===1?d[0].tenantId:null}),[f?.tenantId,d]),u=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:b,userEmail:a?.userEmail,isInitializing:l!=="Completed",tenants:d,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:w==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(q(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{U("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-CueKZN6-.js";import{h as W,u as Y,g as z,i as J,j as d,l as X,n as Z,o as C}from"./core-BQjZS2e8.js";import{fI as v,AJ as R,vm as H,a1V as w,vh as T,bp as K,d$ as Q,vi as ee,a1W as ae,Z3 as S,ei as te,EB as se,a1X as oe,E_ as re,eq as ne,ep as ce}from"./zeni-epic-state-DNah8dni.js";import{az as ie,z as le,aC as de,al as fe,V as me,a9 as pe,e as M,dl as ue,v as he,p as be,b as Fe}from"./index-BkGKDMtv.js";import"./mui-CQYR1UI4.js";import ge from"./NotFoundScreen-Da0kpRnr.js";import{F as Ie}from"./FeaturePreviewScreen-e7I8ExNO.js";import{a as b}from"./sentry-uvO3Tp8f.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-Ds1IYXBl.js";import{u as Se}from"./useInitialThreadRequest-E--3OsRP.js";import{a as Te}from"./routePaths-CiV55sI1.js";import{M as ye}from"./MobileAppDrawer-BUD0j7G2.js";import"./recharts-DNLEWX3j.js";import"./analytics-Dt3suRsK.js";import"./plaid-Db_iti-b.js";import"./dnd-DccPQo-x.js";import"./stripe-cKAAJElX.js";import"./lottie-D6SetWLo.js";import"./lexical-DQq5IX8L.js";import"./pdf-CqrelrTK.js";import"./utils-BUB23Z37.js";import"./InboxNotificationsProvider-BGgv9Z5e.js";import"./useTaskManagerAccess-DzHDJDg5.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]="b7ab0a3c-6237-4feb-b13b-fe79fe43fd8a",s._sentryDebugIdIdentifier="sentry-dbid-b7ab0a3c-6237-4feb-b13b-fe79fe43fd8a")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=X((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),f=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:f,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=W(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=J(),[p,u]=b.useState(!1),[f,A]=b.useState(!1),F=le.getSignedInUser(),x=d((t=>v(t))),_=x.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),D=d((t=>t.profitAndLossState)),j=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>D.pandLByForecastID[t]!=null&&ee(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=de();fe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect((()=>{if(!p&&g)u(!0),l||a(H());else if(l&&!f){A(!0);const t=((m,P,O)=>P!=null?m.forecasts.findIndex((I=>I.id===P)):O!=null?m.forecasts.findIndex((I=>I.id===O)):m.forecasts.length>0?0:-1)(i,r,j?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=j?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!k(i.forecasts[t].id)&&g&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,f,A,R,T,g]);const E=me(),$=E?.loggedInUserRole!=null&&K(E.loggedInUserRole),q=Se(x?.companyId,{clearParams:l&&f}),[V,G]=b.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",F?.firstName??""),h.searchParams.set("lastname",F?.lastName??""),h.searchParams.set("email",F?.userEmail??"");const L=t=>{G(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:_,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:k,meetingUrl:Q(h.toString()),hasTransactionAccess:$,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,initialOpenThreadRequest:q,onClickMenuIcon:()=>{L(!0)}})]})}function Je(){const s=d((c=>v(c))),{useFeatureGate:e}=be(),{isFeatureEnabled:a}=e(Fe.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Z,{children:[n.jsx(C,{path:"/",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(ge,{})})]})}export{Je as default};
1
+ import{j as n}from"./liveblocks-UAxYbctH.js";import{h as W,u as Y,g as z,i as J,j as d,l as X,n as Z,o as C}from"./core-BQ6YlWys.js";import{fI as v,AJ as R,vm as H,a1V as w,vh as T,bp as K,d$ as Q,vi as ee,a1W as ae,Z3 as S,ei as te,EB as se,a1X as oe,E_ as re,eq as ne,ep as ce}from"./zeni-epic-state-j9Po26Lg.js";import{az as ie,z as le,aC as de,al as me,V as fe,a9 as pe,d as M,dl as ue,s as he,p as be,N as Fe}from"./index-DZBfE5XI.js";import"./mui-DYo6Z7Si.js";import ge from"./NotFoundScreen-CY-XFa3a.js";import{F as Ie}from"./FeaturePreviewScreen-DjPPDYKv.js";import{a as b}from"./sentry-CQfqw6mU.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-DV6iNvbF.js";import{u as Se}from"./useInitialThreadRequest-BpNcTGLt.js";import{a as Te}from"./routePaths-CaZTJQOM.js";import{M as ye}from"./MobileAppDrawer-DTqKEh3f.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";import"./InboxNotificationsProvider-Daf1RQwd.js";import"./useTaskManagerAccess-CP331xWN.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]="6cebc7b8-cc72-41f5-b253-b7d5c782bbf0",s._sentryDebugIdIdentifier="sentry-dbid-6cebc7b8-cc72-41f5-b253-b7d5c782bbf0")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=X((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=W(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=J(),[p,u]=b.useState(!1),[m,A]=b.useState(!1),F=le.getSignedInUser(),x=d((t=>v(t))),N=x.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),D=d((t=>t.profitAndLossState)),j=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>D.pandLByForecastID[t]!=null&&ee(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect((()=>{if(!p&&g)u(!0),l||a(H());else if(l&&!m){A(!0);const t=((f,P,O)=>P!=null?f.forecasts.findIndex((I=>I.id===P)):O!=null?f.forecasts.findIndex((I=>I.id===O)):f.forecasts.length>0?0:-1)(i,r,j?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=j?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!k(i.forecasts[t].id)&&g&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,R,T,g]);const E=fe(),$=E?.loggedInUserRole!=null&&K(E.loggedInUserRole),q=Se(x?.companyId,{clearParams:l&&m}),[V,G]=b.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",F?.firstName??""),h.searchParams.set("lastname",F?.lastName??""),h.searchParams.set("email",F?.userEmail??"");const L=t=>{G(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:N,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:k,meetingUrl:Q(h.toString()),hasTransactionAccess:$,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,initialOpenThreadRequest:q,onClickMenuIcon:()=>{L(!0)}})]})}function Je(){const s=d((c=>v(c))),{useFeatureGate:e}=be(),{isFeatureEnabled:a}=e(Fe.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Z,{children:[n.jsx(C,{path:"/",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(ge,{})})]})}export{Je as default};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-CueKZN6-.js";import{a as p}from"./sentry-uvO3Tp8f.js";import{R as a,aa as u,ae as f,af as h}from"./index-BkGKDMtv.js";import{s as d}from"./mui-CQYR1UI4.js";import{i as y}from"./core-BQjZS2e8.js";import"./zeni-epic-state-DNah8dni.js";import"./recharts-DNLEWX3j.js";import"./analytics-Dt3suRsK.js";import"./plaid-Db_iti-b.js";import"./dnd-DccPQo-x.js";import"./stripe-cKAAJElX.js";import"./lottie-D6SetWLo.js";import"./lexical-DQq5IX8L.js";import"./pdf-CqrelrTK.js";import"./utils-BUB23Z37.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]="d17b17a2-d5a4-455d-b47f-e032ee88dffe",e._sentryDebugIdIdentifier="sentry-dbid-d17b17a2-d5a4-455d-b47f-e032ee88dffe")}catch{}})();const g=d("div")`
1
+ import{j as r}from"./liveblocks-UAxYbctH.js";import{a as p}from"./sentry-CQfqw6mU.js";import{R as a,aa as u,ae as f,af as h}from"./index-DZBfE5XI.js";import{s as d}from"./mui-DYo6Z7Si.js";import{i as y}from"./core-BQ6YlWys.js";import"./zeni-epic-state-j9Po26Lg.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.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]="d17b17a2-d5a4-455d-b47f-e032ee88dffe",e._sentryDebugIdIdentifier="sentry-dbid-d17b17a2-d5a4-455d-b47f-e032ee88dffe")}catch{}})();const g=d("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
@@ -1,22 +1,22 @@
1
- import{j as a}from"./liveblocks-CueKZN6-.js";import{_l as re,fI as N,ma as G,eq as Y,ep as le,T8 as Q,V$ as ce,Dr as Pe,_m as J,Dg as je,DB as Le,Dv as de,Dk as pe,Dz as ve,Dw as Te,_n as ue,sH as Re,g9 as Ve,gG as Ae,_o as z,Do as me,Dn as ge,DE as Fe,c7 as Oe}from"./zeni-epic-state-DNah8dni.js";import{a2 as fe,p as X,b as H,z as K,i as he,L as Ce,ag as ye,aL as be,bZ as Ze,ac as De,R as F,ah as Se,G as M,b_ as Be,aC as Ue,al as $e,a9 as _e,e as we,U as ze,v as He,b$ as Ge,V as Ke}from"./index-BkGKDMtv.js";import{D as xe,n as W,S as Ie}from"./mui-CQYR1UI4.js";import ae from"./NotFoundScreen-Da0kpRnr.js";import{a as c}from"./sentry-uvO3Tp8f.js";import{u as ee,i as Me,j as g,h as We,g as qe,l as Je,n as se,o as _}from"./core-BQjZS2e8.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-Ds1IYXBl.js";import{M as Ye}from"./MobileAppDrawer-BUD0j7G2.js";import"./recharts-DNLEWX3j.js";import"./analytics-Dt3suRsK.js";import"./plaid-Db_iti-b.js";import"./dnd-DccPQo-x.js";import"./stripe-cKAAJElX.js";import"./lottie-D6SetWLo.js";import"./lexical-DQq5IX8L.js";import"./pdf-CqrelrTK.js";import"./utils-BUB23Z37.js";import"./InboxNotificationsProvider-BGgv9Z5e.js";import"./useTaskManagerAccess-DzHDJDg5.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]="c3441a1f-839a-48ab-aedd-470fe9484706",e._sentryDebugIdIdentifier="sentry-dbid-c3441a1f-839a-48ab-aedd-470fe9484706")}catch{}})();const Qe={overlayWidth:new De(100,100,48)},te=M.getLocalizedStrings().peoplePage.invitePage,ne=M.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,Z]=c.useState(!1),[k,D]=c.useState(!1),{userId:S}=Me(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>G(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),P=Y(I,p),v=le(p),T=Q(p),B=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},R=()=>{O===!0?D(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(H.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:V}=Ce(p?.tenantId),y=!L||V,A=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:A===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:R,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return c.useEffect((()=>{w===!1&&S!=null&&m(Pe(S))}),[w,S]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:R,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ze,{...s})]})})},ea=W(Ie)`
1
+ import{j as a}from"./liveblocks-UAxYbctH.js";import{_l as re,fI as N,ma as G,eq as Y,ep as le,T8 as Q,V$ as ce,Dr as Pe,_m as J,Dg as je,DB as Le,Dv as de,Dk as pe,Dz as ve,Dw as Te,_n as ue,sH as Re,g9 as Ve,gG as Ae,_o as z,Do as me,Dn as ge,DE as Fe,c7 as Oe}from"./zeni-epic-state-j9Po26Lg.js";import{a2 as fe,p as X,N as H,z as K,i as he,L as Ce,ag as be,aL as ye,bZ as Ze,ac as De,R as F,ah as Se,G as W,b_ as Be,aC as Ue,al as $e,a9 as _e,d as we,U as ze,s as He,b$ as Ge,V as Ke}from"./index-DZBfE5XI.js";import{D as xe,n as M,S as Ie}from"./mui-DYo6Z7Si.js";import ae from"./NotFoundScreen-CY-XFa3a.js";import{a as c}from"./sentry-CQfqw6mU.js";import{u as ee,i as We,j as g,h as Me,g as qe,l as Je,n as se,o as _}from"./core-BQ6YlWys.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-DV6iNvbF.js";import{M as Ye}from"./MobileAppDrawer-DTqKEh3f.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";import"./InboxNotificationsProvider-Daf1RQwd.js";import"./useTaskManagerAccess-CP331xWN.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]="1a5d8a26-145f-4dd6-bcf1-9cfdc3bc5c81",e._sentryDebugIdIdentifier="sentry-dbid-1a5d8a26-145f-4dd6-bcf1-9cfdc3bc5c81")}catch{}})();const Qe={overlayWidth:new De(100,100,48)},te=W.getLocalizedStrings().peoplePage.invitePage,ne=W.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=fe(),m=ee(),[O,Z]=c.useState(!1),[k,D]=c.useState(!1),{userId:S}=We(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>G(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),P=Y(I,p),v=le(p),T=Q(p),B=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),y()},R=()=>{O===!0?D(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(H.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:V}=Ce(p?.tenantId),b=!L||V,A=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:A===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:R,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return c.useEffect((()=>{w===!1&&S!=null&&m(Pe(S))}),[w,S]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:R,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(ye,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ze,{...s})]})})},ea=M(Ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,ke=W(Se.H6Regular)`
5
+ `,ke=M(Se.H6Regular)`
6
6
  margin-top: ${F.sp7};
7
7
  padding-left: ${F.sp8};
8
8
  padding-right: ${F.sp8};
9
9
  color: ${e=>e.theme.colors.primary};
10
10
  word-break: break-word;
11
- `,Ee=W(Se.LargeRegularSp)`
11
+ `,Ee=M(Se.LargeRegularSp)`
12
12
  color: ${e=>e.theme.colors.hero};
13
13
  padding-left: ${F.sp8};
14
14
  padding-right: ${F.sp8};
15
15
  margin-bottom: 30px;
16
16
  margin-top: ${F.sp4};
17
17
  white-space: pre-line;
18
- `,aa={overlayWidth:new De(100,100,48)},oe=M.getLocalizedStrings().peoplePage.invitePage,ie=M.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,Z]=c.useState(!1),[k,D]=c.useState(!1),S=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>G(o))),{useFeatureGate:E}=X(),{isFeatureEnabled:x}=E(H.isDebitCardFeatureEnabled),I=Y(x,r),P=le(r),v=Q(r),T=ce(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{b(),m(J())},C=()=>{O===!0?D(!0):w()},R={onOkClick:()=>{D(!1),w()},onCancelClick:()=>{D(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(H.isChargeCardFeatureEnabled),L=he(r,j,x),{isCardsHidden:V}=Ce(r?.tenantId),y=!L||V,A=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),Z(!0)},onResetClick:w,onSaveClick:()=>{m(f==="zeni_only"?ve(e):Te())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:A===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return c.useEffect((()=>{S.invitePersonState.fetchState==="Completed"&&(b(),m(J()))}),[S.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:R}):null,a.jsx(Be,{...s})]})})},ta=W(Ie)`
18
+ `,aa={overlayWidth:new De(100,100,48)},oe=W.getLocalizedStrings().peoplePage.invitePage,ie=W.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=fe(),m=ee(),[O,Z]=c.useState(!1),[k,D]=c.useState(!1),S=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>G(o))),{useFeatureGate:E}=X(),{isFeatureEnabled:x}=E(H.isDebitCardFeatureEnabled),I=Y(x,r),P=le(r),v=Q(r),T=ce(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{y(),m(J())},C=()=>{O===!0?D(!0):w()},R={onOkClick:()=>{D(!1),w()},onCancelClick:()=>{D(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(H.isChargeCardFeatureEnabled),L=he(r,j,x),{isCardsHidden:V}=Ce(r?.tenantId),b=!L||V,A=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),Z(!0)},onResetClick:w,onSaveClick:()=>{m(f==="zeni_only"?ve(e):Te())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:A===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return c.useEffect((()=>{S.invitePersonState.fetchState==="Completed"&&(y(),m(J()))}),[S.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(ye,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:R}):null,a.jsx(Be,{...s})]})})},ta=M(Ie)`
19
19
  display: flex;
20
20
  min-height: 100%;
21
21
  flex-direction: column;
22
- `,na=Je((function(e,t){const d=ue(e),n=K.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:we}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Fe(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(z({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(z({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=We(),n=ee(),f=qe(),{areTenantIdsInSync:i}=Ue(),b=K.getSignedInUser(),h=g((s=>N(s))),{useFeatureGate:m}=X(),{isFeatureEnabled:O}=m(H.isDebitCardFeatureEnabled),Z=g((s=>G(s))),k=!Y(O,h)&&Z,D=Q(h),S=h?.tenantId,{tenantEmailDomain:r}=h,[p,E]=c.useState(!1),[x,I]=c.useState(!1),[P,v]=c.useState(!1),[T,B]=c.useState("off"),[U,w]=c.useState(!1),C=s=>{w(s)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Re(s.classState,s.classListState))),L=g((s=>Ve(s.userState,s.userRoleState,s.userListViewState,"manager"))),V=g((s=>Ae(s))),y=h?.companyId;c.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(z({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),E(!0),n(me()))}),[p,b,S,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),v(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(z({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const A=()=>{I(!1),v(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(_e,{analytics:we,onLoad:s=>s.trackPageLoaded(ze.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:A,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:A,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:h.isZeni,isZeniTenant:D,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(z({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(f.state?.pathnameStackToGoBack,f.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:R,onAskAiCfoClick:$})]})}function ka(){const e=Ke();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(_,{path:"/",element:a.jsx(q,{})}),a.jsx(_,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(_,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(_,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(_,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
22
+ `,na=Je((function(e,t){const d=ue(e),n=K.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:we}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,y)=>{e(pe(i,y))},onResendInvite:i=>{e(Fe(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(z({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(z({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Me(),n=ee(),f=qe(),{areTenantIdsInSync:i}=Ue(),y=K.getSignedInUser(),h=g((s=>N(s))),{useFeatureGate:m}=X(),{isFeatureEnabled:O}=m(H.isDebitCardFeatureEnabled),Z=g((s=>G(s))),k=!Y(O,h)&&Z,D=Q(h),S=h?.tenantId,{tenantEmailDomain:r}=h,[p,E]=c.useState(!1),[x,I]=c.useState(!1),[P,v]=c.useState(!1),[T,B]=c.useState("off"),[U,w]=c.useState(!1),C=s=>{w(s)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Re(s.classState,s.classListState))),L=g((s=>Ve(s.userState,s.userRoleState,s.userListViewState,"manager"))),V=g((s=>Ae(s))),b=h?.companyId;c.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(z({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),E(!0),n(me()))}),[p,y,S,n,u.uiState.mode,i]),c.useEffect((()=>{b!=null&&i&&n(ge(b,k))}),[b,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),v(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(z({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const A=()=>{I(!1),v(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(_e,{analytics:we,onLoad:s=>s.trackPageLoaded(ze.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:A,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:V,classListView:j,companyId:b,mode:u.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:A,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:V,classListView:j,companyId:b,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(na,{navigate:d,signedInUser:y,isZeni:h.isZeni,isZeniTenant:D,peopleUIState:u.uiState,companyId:b,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(z({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(f.state?.pathnameStackToGoBack,f.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:R,onAskAiCfoClick:$})]})}function ka(){const e=Ke();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(_,{path:"/",element:a.jsx(q,{})}),a.jsx(_,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(_,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(_,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(_,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-UAxYbctH.js";import E from"./NotFoundScreen-CY-XFa3a.js";import{a as r}from"./sentry-CQfqw6mU.js";import{h as _,g as v,j as p,i as M,u as U,N as P,l as z,n as O,o as h}from"./core-BQ6YlWys.js";import{fI as B,a3h as b,bn as F,bm as N,iW as V,gk as W}from"./zeni-epic-state-j9Po26Lg.js";import{j as $,z as I,al as q,ea as G}from"./index-DZBfE5XI.js";import"./mui-DYo6Z7Si.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-DV6iNvbF.js";import{M as J}from"./MobileAppDrawer-DTqKEh3f.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";import"./InboxNotificationsProvider-Daf1RQwd.js";import"./useTaskManagerAccess-CP331xWN.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]="37501589-e72f-4b02-950c-a0233c0cfcb3",e._sentryDebugIdIdentifier="sentry-dbid-37501589-e72f-4b02-950c-a0233c0cfcb3")}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)}}}))(G),L=()=>{const e=_(),t=v(),c=$(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,j=N(d),x=C||k||j,l=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(W({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0}),[n?.fetchState,l]),D=r.useCallback(((a,i)=>{l(a,i,!1)}),[l]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({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:d,tenantEmailDomain:f,onReload:y,onTimeRangeSelect:D,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1 +1 @@
1
- import{a as h,R as a}from"./sentry-uvO3Tp8f.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
1
+ import{a as h,R as a}from"./sentry-CQfqw6mU.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-CueKZN6-.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-uvO3Tp8f.js";import{L as ge,d$ as xc,fI as kc,UP as Tc,a1h as jl,c7 as xl}from"./zeni-epic-state-DNah8dni.js";import{a as pe,b as kl,d as Tl,e as Al,f as un,g as Rl,h as Pl,i as Il,j as Ve,k as Ac,l as ot,m as xt,o as Ll,p as ct,q as Nl}from"./utils-BUB23Z37.js";import{r as cn}from"./empty-CmsHIcyu.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-CkerEMYe.js";import{r as Ye,a as Fl}from"./index-hbfcGbz2.js";import{r as Ul}from"./index-But8NFor.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-BQjZS2e8.js";import{d4 as Zl,_ as Hl,u as Vl,z as Rc,c as Yl,d5 as Wl,O as Kl}from"./index-BkGKDMtv.js";import"./mui-CQYR1UI4.js";import{d as It}from"./decodeURIComponentSafe-CIIlt5ol.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]="e6b8b1ac-9966-48fc-9ff6-9d9adaac0894",e._sentryDebugIdIdentifier="sentry-dbid-e6b8b1ac-9966-48fc-9ff6-9d9adaac0894")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
1
+ import{j as _l}from"./liveblocks-UAxYbctH.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-CQfqw6mU.js";import{L as ge,d$ as xc,fI as kc,UP as Tc,a1h as jl,c7 as xl}from"./zeni-epic-state-j9Po26Lg.js";import{a as pe,b as kl,d as Tl,e as Al,f as un,g as Rl,h as Pl,i as Il,j as Ve,k as Ac,l as ot,m as xt,o as Ll,p as ct,q as Nl}from"./utils-BpLD-La5.js";import{r as cn}from"./empty-mwfdcHvm.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-BMce44-8.js";import{r as Ye,a as Fl}from"./index-Bfsx1pdD.js";import{r as Ul}from"./index-B7zYAj-7.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-BQ6YlWys.js";import{d4 as Zl,_ as Hl,u as Vl,z as Rc,b as Yl,d5 as Wl,O as Kl}from"./index-DZBfE5XI.js";import"./mui-DYo6Z7Si.js";import{d as It}from"./decodeURIComponentSafe-D_MvDEMm.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]="702b8bc2-8e60-4ecd-9146-c2a2cec2dea0",e._sentryDebugIdIdentifier="sentry-dbid-702b8bc2-8e60-4ecd-9146-c2a2cec2dea0")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
2
2
  `),I=S(E).split(`
3
3
  `),k=0,C="";if(O==="strictEqual"&&l(j)==="object"&&l(E)==="object"&&j!==null&&E!==null&&(O="strictEqualObject"),R.length===1&&I.length===1&&R[0]!==I[0]){var H=R[0].length+I[0].length;if(H<=10){if(!(l(j)==="object"&&j!==null||l(E)==="object"&&E!==null||j===0&&E===0))return"".concat(_[O],`
4
4
 
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-CueKZN6-.js";import X from"./NotFoundScreen-Da0kpRnr.js";import{a as p}from"./sentry-uvO3Tp8f.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as z,o as g}from"./core-BQjZS2e8.js";import{fI as E,Y7 as h,XL as w,On as L,Oj as N,Om as f,Oc as U,XN as B,Og as K,Op as Y}from"./zeni-epic-state-DNah8dni.js";import{z as T,w as $,bl as q,D as W,b0 as F,bm as G}from"./index-BkGKDMtv.js";import"./mui-CQYR1UI4.js";import{u as H}from"./useEnsureVendorListLoaded-BSdY2ycY.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-C-svNJCY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="33408bb8-619a-45c1-a774-9cabbc639915",e._sentryDebugIdIdentifier="sentry-dbid-33408bb8-619a-45c1-a774-9cabbc639915")}catch{}})();const j="reimbursement-approval-rule-update",J=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(U(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))($(q)),M=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),b=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),S=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&a(L())}),[S]),p.useEffect((()=>{t||b!=="Not-Started"||e||(l(!0),a(N(!0,!1,!1,!1)))}),[t,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(U(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(Y(t,!0))}}}))($(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=F(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(M,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[b,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),S=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));H();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(L())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(N(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||S!=="Not-Started"||e||(R(!0),a(K(!1,!0)))}),[v,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(b||(c(!0),a(f())),s("./new"))}),[b,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(A)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(Q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(X,{})})]})}export{ue as R};
1
+ import{j as r}from"./liveblocks-UAxYbctH.js";import X from"./NotFoundScreen-CY-XFa3a.js";import{a as p}from"./sentry-CQfqw6mU.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as z,o as b}from"./core-BQ6YlWys.js";import{fI as E,Y7 as h,XL as w,On as L,Oj as N,Om as f,Oc as U,XN as B,Og as K,Op as Y}from"./zeni-epic-state-j9Po26Lg.js";import{z as T,w as $,bl as q,C as W,b0 as F,bm as G}from"./index-DZBfE5XI.js";import"./mui-DYo6Z7Si.js";import{u as H}from"./useEnsureVendorListLoaded-BbjOUcqm.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-y6N7Iuxh.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="8dd21c26-ef41-411d-89ad-2886e6dc44f6",e._sentryDebugIdIdentifier="sentry-dbid-8dd21c26-ef41-411d-89ad-2886e6dc44f6")}catch{}})();const j="reimbursement-approval-rule-update",J=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(U(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))($(q)),M=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),g=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(L())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(N(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(U(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(Y(t,!0))}}}))($(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=F(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(M,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));H();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(L())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(N(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(K(!1,!0)))}),[v,g,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(A)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return r.jsxs(z,{children:[r.jsx(b,{path:"/",element:r.jsx(Q,{})}),r.jsx(b,{path:"/new",element:r.jsx(x,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(b,{path:"*",element:r.jsx(X,{})})]})}export{ue as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-CueKZN6-.js";import{a as y}from"./sentry-uvO3Tp8f.js";import{h as x,u as _,g as C,i as V,j as R,l as k}from"./core-BQjZS2e8.js";import{XL as E,Y7 as T,Of as j,Os as B,On as A,Oo as w,YG as F,fI as Y,Om as z}from"./zeni-epic-state-DNah8dni.js";import{z as N,a8 as P,bn as G,D as $,b0 as K,bo as W}from"./index-BkGKDMtv.js";import{u as q}from"./mui-CQYR1UI4.js";import{u as X}from"./useEnsureVendorListLoaded-BSdY2ycY.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]="7119c013-42d9-4757-a44c-0a0b2bbdf2c9",e._sentryDebugIdIdentifier="sentry-dbid-7119c013-42d9-4757-a44c-0a0b2bbdf2c9")}catch{}})();const H=k((function(e,o){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return o.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===o.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const b=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=b.concat(I);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function J(){const e=x(),o=_(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>E(n))),l=R((n=>T(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),o(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function se(e){return F(e)==null}const M=k((function(e,o){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:s,vendorNamesById:i,editingRuleId:p==="approval_update"?o.approvalRuleId:void 0,allApprovalRulesWithUser:T(e).allApprovalRules}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,L=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=L.map((O=>({type:"attribute",subType:O.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((O=>({type:"user",subType:void 0,userId:O.userId,idType:"user",isImplicitActor:!1}))));const U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const b=v?.selection.selectedOptions??[];b.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:b});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=R((t=>Y(t))),{isApprovalRulesV3Enabled:o}=K(e?.tenantId);return o?g.jsx(Q,{}):g.jsx(J,{})}function Q(){const e=x(),o=_(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>E(n))),l=R((n=>T(n))),[a,d]=y.useState(!1);if(X(),y.useEffect((()=>{a||(d(!0),o(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,se as i};
1
+ import{j as g}from"./liveblocks-UAxYbctH.js";import{a as y}from"./sentry-CQfqw6mU.js";import{h as x,u as C,g as _,i as V,j as R,l as k}from"./core-BQ6YlWys.js";import{XL as w,Y7 as T,Of as j,Os as B,On as A,Oo as E,YG as F,fI as Y,Om as z}from"./zeni-epic-state-j9Po26Lg.js";import{z as N,a8 as P,bn as G,C as $,b0 as K,bo as W}from"./index-DZBfE5XI.js";import{u as q}from"./mui-DYo6Z7Si.js";import{u as X}from"./useEnsureVendorListLoaded-BbjOUcqm.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]="e4f09343-c4fa-4de0-b405-5581b7d1dc00",e._sentryDebugIdIdentifier="sentry-dbid-e4f09343-c4fa-4de0-b405-5581b7d1dc00")}catch{}})();const H=k((function(e,o){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return o.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===o.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function J(){const e=x(),o=C(),t=_(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>w(n))),l=R((n=>T(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),o(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function se(e){return F(e)==null}const M=k((function(e,o){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:s,vendorNamesById:i,editingRuleId:p==="approval_update"?o.approvalRuleId:void 0,allApprovalRulesWithUser:T(e).allApprovalRules}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,L=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=L.map((O=>({type:"attribute",subType:O.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((O=>({type:"user",subType:void 0,userId:O.userId,idType:"user",isImplicitActor:!1}))));const U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=R((t=>Y(t))),{isApprovalRulesV3Enabled:o}=K(e?.tenantId);return o?g.jsx(Q,{}):g.jsx(J,{})}function Q(){const e=x(),o=C(),t=_(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>w(n))),l=R((n=>T(n))),[a,d]=y.useState(!1);if(X(),y.useEffect((()=>{a||(d(!0),o(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,se as i};