@zeniai/web-app-ui 5.3.86-qa → 5.3.87-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 (137) hide show
  1. package/dist/assets/{AccountMappingScreen-Bw4c-OTY.js → AccountMappingScreen-9MHulU9s.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-Dqmk7UI6.js → ActualMatchingMatchDetailScreen-Db6bbB6u.js} +1 -1
  3. package/dist/assets/AddressRoutes-DHraPu2z.js +1 -0
  4. package/dist/assets/AddressScreen-BOTH_mRu.js +9 -0
  5. package/dist/assets/{AiCfoScreen-CaLpGxXY.js → AiCfoScreen-bjaeBeb9.js} +1 -1
  6. package/dist/assets/{AppDrawer-AghksXeW.js → AppDrawer-UbqqLXJe.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-ZTOM-vTw.js → BillPayApprovalRoutes-CYDv31qk.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-BENok0fa.js → BillPayRoutes-C4GXOC5A.js} +6 -6
  9. package/dist/assets/BusinessVerificationPageScreen-CqSHzLo6.js +9 -0
  10. package/dist/assets/{CardsAiCfoScreen-X41sXv_t.js → CardsAiCfoScreen-DZorjbaf.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-xwG2FIS5.js → ChargeCardRoutes-C7tzEoGV.js} +6 -6
  12. package/dist/assets/CompanyPassportScreen-DViAGsze.js +1 -0
  13. package/dist/assets/{ConnectionAuthScreen-DaExPGM-.js → ConnectionAuthScreen-yW3T26AI.js} +3 -3
  14. package/dist/assets/CustomerOnboardingAuthScreen-CEs020qJ.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-Dp9Junfs.js → CustomerOnboardingRoutes-B2flxgjR.js} +5 -5
  16. package/dist/assets/{DashboardRoutes-C9EW0dsE.js → DashboardRoutes-D6igUQ_c.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-8X-DX6yV.js → DefaultTenantHome-CMpQllfi.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-D-XdJZt2.js +18 -0
  19. package/dist/assets/{DrawerScreen-BU5zwjE0.js → DrawerScreen-DquM7PdJ.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-B7vzEsHl.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-CRBrsd2-.js → ExpenseAutomationRoutes-o1rALTgt.js} +6 -6
  22. package/dist/assets/{FeaturePreviewScreen-ewOkPlMD.js → FeaturePreviewScreen-B0SxkBd3.js} +1 -1
  23. package/dist/assets/HubSpotOAuthCallbackScreen-CYGRU6le.js +1 -0
  24. package/dist/assets/{InboxNotificationsProvider-T1CjerOs.js → InboxNotificationsProvider-DPgK9Ai7.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-CjO8mgKL.js → InvoicingRoutes-BroIFZYm.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-DjhOtMOO.js → MagicLinkRoutes-BYZevXyH.js} +5 -5
  27. package/dist/assets/MagicLinkSignInScreen-DqgSvyNq.js +12 -0
  28. package/dist/assets/{MobileAppDrawer-CPL93Y69.js → MobileAppDrawer-C6gfQS8M.js} +1 -1
  29. package/dist/assets/NotFoundScreen-0hF8kIyY.js +1 -0
  30. package/dist/assets/NotificationRoutes-BRYauJLR.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-B_ncopNh.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-BU_XWD0n.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-CZEdV4nN.js → PaymentLinkScreen-6qwvkVJe.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-C96ZKFB6.js → PeopleRoutes-BT10_5ZZ.js} +5 -5
  35. package/dist/assets/{PerformanceRoutes--XSdDfSH.js → PerformanceRoutes-DEM0F09k.js} +1 -1
  36. package/dist/assets/{Preview-C3KwiSeU.js → Preview-xYIpXmh0.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-CscsyiY4.js → QBOConnectionScreen-CPdRdNFp.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-C6gQSVx5.js → ReimbursementApprovalRoutes-kSFV0KaQ.js} +1 -1
  39. package/dist/assets/ReimbursementApprovalRuleDetailScreen-CD8m8c7W.js +1 -0
  40. package/dist/assets/{ReimbursementRoutes-DYrF93fy.js → ReimbursementRoutes-B7HRPmdv.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-BGTG4ExY.js → ReportsRoutes-CkYyyTje.js} +1 -1
  42. package/dist/assets/{RewardsRoutes-XJQVfvVO.js → RewardsRoutes-kEA_DefW.js} +1 -1
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-B39F7s78.js → ScheduleDetailsPrepaidExpensesScreen-DH-G2ABB.js} +4 -4
  44. package/dist/assets/{ScreenRoutes-StBt4FAk.js → ScreenRoutes-C72NzSAe.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-4XW9rHGl.js → SettingsRoutes-gBgMK1MW.js} +5 -5
  46. package/dist/assets/{SetupPagesScreen-BYB1gkfH.js → SetupPagesScreen-CIrP22mo.js} +4 -4
  47. package/dist/assets/{SignInScreen-e-cO4V-V.js → SignInScreen-DAl9_AVs.js} +1 -1
  48. package/dist/assets/SignOutScreen-CvQRUG30.js +9 -0
  49. package/dist/assets/TaskListScreen-DI37lN7R.js +9 -0
  50. package/dist/assets/TaskRoutes-Sr-eq5Xy.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-DHOAhb5X.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-CKbaQP7k.js → TransactionDetailScreen-BfwmFu4d.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-CxMRgLBL.js → TransactionListRoutes-CcqGcmw0.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-hS83AJiS.js → TreasuryRoutes-S1BfnYGO.js} +5 -5
  55. package/dist/assets/{VendorsRoutes-BCpQu0LL.js → VendorsRoutes-D9wt7kTI.js} +1 -1
  56. package/dist/assets/WiseConfirmationScreen-CBCiP645.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-1wf8Rwnb.js → ZeniAccountRoutes-CgUN5fCf.js} +9 -9
  58. package/dist/assets/ZeniAccountStatementScreen-jmmjZcA9.js +9 -0
  59. package/dist/assets/{accountMappingHelper-Cl-vw8fd.js → accountMappingHelper-BYw-4sqP.js} +1 -1
  60. package/dist/assets/{analytics-bcpq8FmH.js → analytics-UPQyZr49.js} +1 -1
  61. package/dist/assets/{analyticsHelper-C6bHmUJl.js → analyticsHelper-nRPDDcpi.js} +1 -1
  62. package/dist/assets/{core-CLbwxogo.js → core-D4EC26kf.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-CTII6a9j.js → decodeURIComponentSafe-CDB32jt8.js} +1 -1
  64. package/dist/assets/{dnd-D7kr6gj3.js → dnd-CQ9igkkh.js} +1 -1
  65. package/dist/assets/{empty-BdckjUGv.js → empty-CI6RvMsS.js} +1 -1
  66. package/dist/assets/{empty-BIuVl5i4.js → empty-D2f6MViE.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-CsPLODSh.js → emptyVideoElement-DMQKfl7Z.js} +1 -1
  68. package/dist/assets/epic-pH_zo6MR.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-DLTA8kBq.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-yQGxhPnt.js → getLocaleForTenant-B07LkoV2.js} +1 -1
  71. package/dist/assets/{index-COZnX9q1.js → index-B_bOZ9_a.js} +1 -1
  72. package/dist/assets/{index-C31Y0QTF.js → index-CEVAJ-IM.js} +1 -1
  73. package/dist/assets/{index-DPWxOeVp.js → index-CWHRX-bO.js} +1 -1
  74. package/dist/assets/{index-DGwZLIGK.js → index-Ch-ATQTq.js} +12598 -12590
  75. package/dist/assets/{index-CFqdtjWk.js → index-Cjagh0U7.js} +2 -2
  76. package/dist/assets/{index-CtHN3MJR.js → index-CllzBMQZ.js} +1 -1
  77. package/dist/assets/{index-CGtk3Boq.js → index-D7USIDVj.js} +1 -1
  78. package/dist/assets/{index-BGZGT2EB.js → index-DIih7oGD.js} +1 -1
  79. package/dist/assets/{lexical-DBQnrckW.js → lexical-DvwBeJWJ.js} +1 -1
  80. package/dist/assets/{liveblocks-B8NMVuJ_.js → liveblocks-DcDE-V-o.js} +1 -1
  81. package/dist/assets/{lottie-DZboDKA6.js → lottie-DBrmrNFb.js} +1 -1
  82. package/dist/assets/{mui-DB2eP-4H.js → mui-BCH_ILdb.js} +1 -1
  83. package/dist/assets/{pathToGoBack-kLAH7lQZ.js → pathToGoBack-rzbozB31.js} +1 -1
  84. package/dist/assets/{pdf-lib-B2sKhaXv.js → pdf-lib-CbTEittW.js} +1 -1
  85. package/dist/assets/{pdf-ByO6Vz9p.js → pdf-zGCHYG6q.js} +4 -4
  86. package/dist/assets/{plaid-BjkLQcpb.js → plaid-a-pmhWdo.js} +1 -1
  87. package/dist/assets/{pusher-DLAXsv5D.js → pusher-DTPJtuD1.js} +1 -1
  88. package/dist/assets/{react-Bnoavnug.js → react-BxMK-s19.js} +1 -1
  89. package/dist/assets/{react-CSeNOqFc.js → react-C83CKqL4.js} +1 -1
  90. package/dist/assets/{react-DnFO_FFm.js → react-CW0JS27q.js} +1 -1
  91. package/dist/assets/{react-6e8jc3Wj.js → react-Cc6y9hJ0.js} +1 -1
  92. package/dist/assets/{react-Bdnz9ur-.js → react-DEi14qD-.js} +1 -1
  93. package/dist/assets/{react-3YBksWOJ.js → react-Dom5mok4.js} +1 -1
  94. package/dist/assets/{recharts-DLaK4yUy.js → recharts-BRIJ8RH5.js} +1 -1
  95. package/dist/assets/{routePaths-DzyLeDiT.js → routePaths-D0-Tropc.js} +1 -1
  96. package/dist/assets/{sentry-Di8VmQH9.js → sentry-DB4rU-NW.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-vknm6I0a.js → stripSplatSuffix-DDkMarxH.js} +1 -1
  98. package/dist/assets/{url-DQtqpgyq.js → url-B6fk1MD4.js} +1 -1
  99. package/dist/assets/{url-D-LhAzLP.js → url-C0P0ff3A.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-BNN20aCx.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Cr6luKDu.js → useAiCfoDashboardSuggestedQuestionsChips-DOmg3jmM.js} +1 -1
  102. package/dist/assets/{useAskAiCfoHostNavButtonProps-D5_P3HNy.js → useAskAiCfoHostNavButtonProps-CBSVhkeG.js} +1 -1
  103. package/dist/assets/{useChargeCardPusherEvents-C1nzPXUi.js → useChargeCardPusherEvents-WOovjOqT.js} +1 -1
  104. package/dist/assets/{useDeviceId-D9wKXTe6.js → useDeviceId-Dy35NfBh.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-27P04Izm.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-CeTvaTKT.js → useInitialThreadRequest-Da3K5Ksw.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-qNZrVl0I.js → useTaskManagerAccess-CX5toJpg.js} +1 -1
  108. package/dist/assets/{useTaskManagerPusherEvents-BSW8U7bw.js → useTaskManagerPusherEvents-BiZinOaM.js} +1 -1
  109. package/dist/assets/{utils-cD9C-nwV.js → utils-CU_Pr3K6.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-CIkuH_-8.js → withTransactionSidePanel-CCvid0cv.js} +1 -1
  111. package/dist/assets/{zeni-epic-state-DuYWeJse.js → zeni-epic-state-Bl3gAQPi.js} +5 -5
  112. package/dist/index.html +1 -1
  113. package/package.json +4 -4
  114. package/dist/assets/AddressRoutes-CxV_qjF-.js +0 -1
  115. package/dist/assets/AddressScreen-DXT-nr0u.js +0 -9
  116. package/dist/assets/BusinessVerificationPageScreen-tLWoFynI.js +0 -9
  117. package/dist/assets/CompanyPassportScreen-CFUvDa_W.js +0 -1
  118. package/dist/assets/CustomerOnboardingAuthScreen-BFogjCA3.js +0 -1
  119. package/dist/assets/DomesticWireDetailScreen-C28OaNCO.js +0 -18
  120. package/dist/assets/EntityDetailRoutes-CsJo2X-K.js +0 -1
  121. package/dist/assets/HubSpotOAuthCallbackScreen-BIuyfhFA.js +0 -1
  122. package/dist/assets/MagicLinkSignInScreen-MXXKrN54.js +0 -12
  123. package/dist/assets/NotFoundScreen-BXBXaauZ.js +0 -1
  124. package/dist/assets/NotificationRoutes-ut5MaNgq.js +0 -1
  125. package/dist/assets/OAuthConsentScreen-Bf1rYpl7.js +0 -1
  126. package/dist/assets/PandLWithForecastRoutes-F6OIQgEa.js +0 -1
  127. package/dist/assets/ReimbursementApprovalRuleDetailScreen-jax_ZsZC.js +0 -1
  128. package/dist/assets/SignOutScreen-BQhhmjwo.js +0 -9
  129. package/dist/assets/TaskListScreen-BcIzTLTu.js +0 -9
  130. package/dist/assets/TaskRoutes-Dpw7ZtcI.js +0 -9
  131. package/dist/assets/TransactionDetailRoutes-50cOavRx.js +0 -1
  132. package/dist/assets/WiseConfirmationScreen-DYHtqZdc.js +0 -12
  133. package/dist/assets/ZeniAccountStatementScreen-BFtfYBFw.js +0 -9
  134. package/dist/assets/epic-AKFDmlZB.js +0 -2
  135. package/dist/assets/expenseAutomationHelper-C40iB_7D.js +0 -1
  136. package/dist/assets/useActualMatchingMatchDetail-Ck-fc_9u.js +0 -1
  137. package/dist/assets/useEmailConnectResultRefresh-8_bhZ07K.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-B8NMVuJ_.js";import{a as p}from"./sentry-Di8VmQH9.js";import{E as a,a7 as u,ab as f,ac as h}from"./index-DGwZLIGK.js";import{s as d}from"./mui-DB2eP-4H.js";import{i as y}from"./core-CLbwxogo.js";import"./zeni-epic-state-DuYWeJse.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.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]="8e7dd9f4-06b5-4f16-8d32-9e3d111e8904",e._sentryDebugIdIdentifier="sentry-dbid-8e7dd9f4-06b5-4f16-8d32-9e3d111e8904")}catch{}})();const g=d("div")`
1
+ import{j as r}from"./liveblocks-DcDE-V-o.js";import{a as p}from"./sentry-DB4rU-NW.js";import{E as a,a7 as u,ab as f,ac as h}from"./index-Ch-ATQTq.js";import{s as d}from"./mui-BCH_ILdb.js";import{i as y}from"./core-D4EC26kf.js";import"./zeni-epic-state-Bl3gAQPi.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.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]="8e7dd9f4-06b5-4f16-8d32-9e3d111e8904",e._sentryDebugIdIdentifier="sentry-dbid-8e7dd9f4-06b5-4f16-8d32-9e3d111e8904")}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-B8NMVuJ_.js";import{VS as re,fI as N,m3 as _,e0 as Y,d$ as le,SJ as Q,Vf as ce,Df as Pe,VT as q,D4 as je,Dp as Le,Dj as de,D8 as pe,Dn as Te,Dk as ve,VU as ue,sx as Ve,g9 as Ae,gG as Fe,VV as G,Dc as me,Db as ge,Ds as Re,c9 as Oe}from"./zeni-epic-state-DuYWeJse.js";import{$ as fe,W as X,A as H,z as W,f as he,J as Ce,ad as ye,ax as be,ay as Ze,a9 as Se,E as R,ae as De,G as K,az as Ue,ao as Be,aq as $e,a6 as ze,h as we,N as Ge,p as He,aA as _e,V as We}from"./index-DGwZLIGK.js";import{D as xe,n as J,S as Ie}from"./mui-DB2eP-4H.js";import ae from"./NotFoundScreen-BXBXaauZ.js";import{a as c}from"./sentry-Di8VmQH9.js";import{u as ee,i as Ke,j as g,h as Je,g as Me,l as qe,n as se,o as z}from"./core-CLbwxogo.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-D5_P3HNy.js";import{M as Ye}from"./MobileAppDrawer-CPL93Y69.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./InboxNotificationsProvider-T1CjerOs.js";import"./useTaskManagerAccess-qNZrVl0I.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]="2bb760fe-729a-4f82-ac69-1bc5d6cf4ce5",e._sentryDebugIdIdentifier="sentry-dbid-2bb760fe-729a-4f82-ac69-1bc5d6cf4ce5")}catch{}})();const Qe={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.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,S]=c.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>_(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),P=Y(I,p),T=le(p),v=Q(p),U=ce(p),B=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(q()),b()},V=()=>{O===!0?S(!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:A}=Ce(p?.tenantId),y=!L||A,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,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(v))},onCloseClick:V,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),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:V,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=J(Ie)`
1
+ import{j as a}from"./liveblocks-DcDE-V-o.js";import{VT as re,fI as N,m3 as _,e0 as Y,d$ as le,SJ as Q,Vg as de,Df as Pe,VU as q,D4 as je,Dp as Le,Dj as ce,D8 as pe,Dn as Te,Dk as ve,VV as ue,sx as Ve,g9 as Ae,gG as Fe,VW as G,Dc as me,Db as ge,Ds as Re,c9 as Oe}from"./zeni-epic-state-Bl3gAQPi.js";import{$ as fe,W as X,A as H,z as W,g as he,J as Ce,ad as be,ax as ye,ay as Ze,a9 as Se,E as R,ae as De,G as K,az as Ue,ao as Be,aq as $e,a6 as ze,j as we,N as Ge,p as He,aA as _e,V as We}from"./index-Ch-ATQTq.js";import{D as xe,n as M,S as Ie}from"./mui-BCH_ILdb.js";import ae from"./NotFoundScreen-0hF8kIyY.js";import{a as d}from"./sentry-DB4rU-NW.js";import{u as ee,i as Ke,j as g,h as Me,g as Je,l as qe,n as se,o as z}from"./core-D4EC26kf.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-CBSVhkeG.js";import{M as Ye}from"./MobileAppDrawer-C6gfQS8M.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.js";import"./InboxNotificationsProvider-DPgK9Ai7.js";import"./useTaskManagerAccess-CX5toJpg.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]="e4f0f372-5b00-41bd-99ec-f4bf6dbd3483",e._sentryDebugIdIdentifier="sentry-dbid-e4f0f372-5b00-41bd-99ec-f4bf6dbd3483")}catch{}})();const Qe={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=fe(),m=ee(),[O,Z]=d.useState(!1),[k,S]=d.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>_(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),P=Y(I,p),T=le(p),v=Q(p),U=de(p),B=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(q()),y()},V=()=>{O===!0?S(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(H.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:A}=Ce(p?.tenantId),b=!L||A,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(v))},onCloseClick:V,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),d.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:V,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=J(De.H6Regular)`
5
+ `,ke=M(De.H6Regular)`
6
6
  margin-top: ${R.sp7};
7
7
  padding-left: ${R.sp8};
8
8
  padding-right: ${R.sp8};
9
9
  color: ${e=>e.theme.colors.primary};
10
10
  word-break: break-word;
11
- `,Ee=J(De.LargeRegularSp)`
11
+ `,Ee=M(De.LargeRegularSp)`
12
12
  color: ${e=>e.theme.colors.hero};
13
13
  padding-left: ${R.sp8};
14
14
  padding-right: ${R.sp8};
15
15
  margin-bottom: 30px;
16
16
  margin-top: ${R.sp4};
17
17
  white-space: pre-line;
18
- `,aa={overlayWidth:new Se(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.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,S]=c.useState(!1),D=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>_(o))),{useFeatureGate:E}=X(),{isFeatureEnabled:x}=E(H.isDebitCardFeatureEnabled),I=Y(x,r),P=le(r),T=Q(r),v=ce(r),U=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{b(),m(q())},C=()=>{O===!0?S(!0):w()},V={onOkClick:()=>{S(!1),w()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(H.isChargeCardFeatureEnabled),L=he(r,j,x),{isCardsHidden:A}=Ce(r?.tenantId),y=!L||A,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),Z(!0)},onResetClick:w,onSaveClick:()=>{m(f==="zeni_only"?Te(e):ve())},onCloseClick:C,peopleDetails:D,isAccountingClassesEnabled:p,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:B};return c.useEffect((()=>{D.invitePersonState.fetchState==="Completed"&&(b(),m(q()))}),[D.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:V}):null,a.jsx(Ue,{...s})]})})},ta=J(Ie)`
18
+ `,aa={overlayWidth:new Se(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=fe(),m=ee(),[O,Z]=d.useState(!1),[k,S]=d.useState(!1),D=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>_(o))),{useFeatureGate:E}=X(),{isFeatureEnabled:x}=E(H.isDebitCardFeatureEnabled),I=Y(x,r),P=le(r),T=Q(r),v=de(r),U=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{y(),m(q())},C=()=>{O===!0?S(!0):w()},V={onOkClick:()=>{S(!1),w()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(H.isChargeCardFeatureEnabled),L=he(r,j,x),{isCardsHidden:A}=Ce(r?.tenantId),b=!L||A,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(ce({peopleLocalData:o})),Z(!0)},onResetClick:w,onSaveClick:()=>{m(f==="zeni_only"?Te(e):ve())},onCloseClick:C,peopleDetails:D,isAccountingClassesEnabled:p,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:B};return d.useEffect((()=>{D.invitePersonState.fetchState==="Completed"&&(y(),m(q()))}),[D.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:V}):null,a.jsx(Ue,{...s})]})})},ta=M(Ie)`
19
19
  display: flex;
20
20
  min-height: 100%;
21
21
  flex-direction: column;
22
- `,na=qe((function(e,t){const d=ue(e),n=W.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:_(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(Re(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}}))(_e);function M({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Je(),n=ee(),f=Me(),{areTenantIdsInSync:i}=Be(),b=W.getSignedInUser(),h=g((s=>N(s))),{useFeatureGate:m}=X(),{isFeatureEnabled:O}=m(H.isDebitCardFeatureEnabled),Z=g((s=>_(s))),k=!Y(O,h)&&Z,S=Q(h),D=h?.tenantId,{tenantEmailDomain:r}=h,[p,E]=c.useState(!1),[x,I]=c.useState(!1),[P,T]=c.useState(!1),[v,U]=c.useState("off"),[B,w]=c.useState(!1),C=s=>{w(s)},{isAiCfoAccessEnabled:V,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ve(s.classState,s.classListState))),L=g((s=>Ae(s.userState,s.userRoleState,s.userListViewState,"manager"))),A=g((s=>Fe(s))),y=h?.companyId;c.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(u.uiState.mode),E(!0),n(me()))}),[p,b,D,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),T(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:we,onLoad:s=>s.trackPageLoaded(Ge.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:A,classListView:j,companyId:y,mode:u.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(G({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:V,onAskAiCfoClick:$})]})}function ka(){const e=We();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(M,{})}),a.jsx(z,{path:"new",element:a.jsx(M,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(M,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
22
+ `,na=qe((function(e,t){const c=ue(e),n=W.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:_(e),analytics:we}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,y)=>{e(pe(i,y))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}}))(_e);function J({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=Me(),n=ee(),f=Je(),{areTenantIdsInSync:i}=Be(),y=W.getSignedInUser(),h=g((s=>N(s))),{useFeatureGate:m}=X(),{isFeatureEnabled:O}=m(H.isDebitCardFeatureEnabled),Z=g((s=>_(s))),k=!Y(O,h)&&Z,S=Q(h),D=h?.tenantId,{tenantEmailDomain:r}=h,[p,E]=d.useState(!1),[x,I]=d.useState(!1),[P,T]=d.useState(!1),[v,U]=d.useState("off"),[B,w]=d.useState(!1),C=s=>{w(s)},{isAiCfoAccessEnabled:V,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ve(s.classState,s.classListState))),L=g((s=>Ae(s.userState,s.userRoleState,s.userListViewState,"manager"))),A=g((s=>Fe(s))),b=h?.companyId;d.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(u.uiState.mode),E(!0),n(me()))}),[p,y,D,n,u.uiState.mode,i]),d.useEffect((()=>{b!=null&&i&&n(ge(b,k))}),[b,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),T(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:we,onLoad:s=>s.trackPageLoaded(Ge.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:u.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),a.jsx(na,{navigate:c,signedInUser:y,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:b,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(G({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(f.state?.pathnameStackToGoBack,f.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:V,onAskAiCfoClick:$})]})}function ka(){const e=We();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(J,{})}),a.jsx(z,{path:"new",element:a.jsx(J,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(J,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B8NMVuJ_.js";import E from"./NotFoundScreen-BXBXaauZ.js";import{a as r}from"./sentry-Di8VmQH9.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as O,o as b}from"./core-CLbwxogo.js";import{fI as B,a1v as h,bo as F,bn as N,iP as V,gk as q}from"./zeni-epic-state-DuYWeJse.js";import{o as L,z as I,aq as $,dL as G}from"./index-DGwZLIGK.js";import"./mui-DB2eP-4H.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-D5_P3HNy.js";import{M as J}from"./MobileAppDrawer-CPL93Y69.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./InboxNotificationsProvider-T1CjerOs.js";import"./useTaskManagerAccess-qNZrVl0I.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]="dfd9fb3c-08ff-42b5-928c-a5449f731bd6",e._sentryDebugIdIdentifier="sentry-dbid-dfd9fb3c-08ff-42b5-928c-a5449f731bd6")}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}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),Q=()=>{const e=_(),t=v(),c=L(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function be(){return s.jsxs(O,{children:[s.jsx(b,{path:"*",element:s.jsx(Q,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
1
+ import{j as s}from"./liveblocks-DcDE-V-o.js";import E from"./NotFoundScreen-0hF8kIyY.js";import{a as r}from"./sentry-DB4rU-NW.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as O,o as h}from"./core-D4EC26kf.js";import{fI as B,a1w as b,bo as F,bn as N,iP as V,gk as q}from"./zeni-epic-state-Bl3gAQPi.js";import{e as L,z as I,aq as $,dL as G}from"./index-Ch-ATQTq.js";import"./mui-BCH_ILdb.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-CBSVhkeG.js";import{M as J}from"./MobileAppDrawer-C6gfQS8M.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.js";import"./InboxNotificationsProvider-DPgK9Ai7.js";import"./useTaskManagerAccess-CX5toJpg.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]="d7883fc5-3676-4540-a4fc-afb4dfe484e4",e._sentryDebugIdIdentifier="sentry-dbid-d7883fc5-3676-4540-a4fc-afb4dfe484e4")}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),Q=()=>{const e=_(),t=v(),c=L(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:m}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function he(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1 +1 @@
1
- import{a as h,R as a}from"./sentry-Di8VmQH9.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-DB4rU-NW.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-B8NMVuJ_.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-Di8VmQH9.js";import{L as ge,c0 as xc,fI as kc,Un as Tc,Vd as jl,c9 as xl}from"./zeni-epic-state-DuYWeJse.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-cD9C-nwV.js";import{r as cn}from"./empty-BdckjUGv.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-B2sKhaXv.js";import{a as Ye,r as Fl}from"./index-C31Y0QTF.js";import{r as Ul}from"./index-CtHN3MJR.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-CLbwxogo.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,T as Wl,C as Kl}from"./index-DGwZLIGK.js";import"./mui-DB2eP-4H.js";import{d as It}from"./decodeURIComponentSafe-CTII6a9j.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]="9271f70e-4ca5-431b-8979-75fa92c2d00e",e._sentryDebugIdIdentifier="sentry-dbid-9271f70e-4ca5-431b-8979-75fa92c2d00e")}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-DcDE-V-o.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-DB4rU-NW.js";import{L as ge,c0 as xc,fI as kc,Uo as Tc,Ve as jl,c9 as xl}from"./zeni-epic-state-Bl3gAQPi.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-CU_Pr3K6.js";import{r as cn}from"./empty-CI6RvMsS.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-CbTEittW.js";import{a as Ye,r as Fl}from"./index-CEVAJ-IM.js";import{r as Ul}from"./index-CllzBMQZ.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-D4EC26kf.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,T as Wl,C as Kl}from"./index-Ch-ATQTq.js";import"./mui-BCH_ILdb.js";import{d as It}from"./decodeURIComponentSafe-CDB32jt8.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]="ec0b2f46-ff2e-414a-b35d-fc7a2f771242",e._sentryDebugIdIdentifier="sentry-dbid-ec0b2f46-ff2e-414a-b35d-fc7a2f771242")}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-B8NMVuJ_.js";import z from"./NotFoundScreen-BXBXaauZ.js";import{a as p}from"./sentry-Di8VmQH9.js";import{h as C,g as D,u as V,j as u,N as k,l as N,n as Z,o as g}from"./core-CLbwxogo.js";import{fI as E,Zz as h,ZR as R,O5 as O,O1 as U,O4 as f,NW as L,_e as B,N_ as K,O7 as q}from"./zeni-epic-state-DuYWeJse.js";import{z as T,w as _,c8 as F,l as $,bR as G,c9 as H}from"./index-DGwZLIGK.js";import"./mui-DB2eP-4H.js";import{u as J,R as x}from"./ReimbursementApprovalRuleDetailScreen-jax_ZsZC.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]="c597d176-54ea-4ffe-b058-b219237dc3c9",e._sentryDebugIdIdentifier="sentry-dbid-c597d176-54ea-4ffe-b058-b219237dc3c9")}catch{}})();const j="reimbursement-approval-rule-update",M=N((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:R(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(_(F)),P=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),b=u((o=>R(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(O())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(U(!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||(w(!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(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",Q=N((function(e){const s=h(e),n=R(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(q(t,!0))}}}))(_(H)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=G(e?.tenantId);return s?r.jsx(Y,{isLoading:n}):r.jsx(P,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));J();const y=u((i=>R(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(O())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(U(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(w(!0),a(K(!1,!0)))}),[v,b,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,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(Q,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(Z,{children:[r.jsx(g,{path:"/",element:r.jsx(X,{})}),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(z,{})})]})}export{le as R};
1
+ import{j as r}from"./liveblocks-DcDE-V-o.js";import Z from"./NotFoundScreen-0hF8kIyY.js";import{a as p}from"./sentry-DB4rU-NW.js";import{h as C,g as D,u as V,j as u,N as k,l as N,n as z,o as g}from"./core-D4EC26kf.js";import{fI as E,ZA as h,ZS as R,O5 as O,O1 as U,O4 as m,NW as L,_f as B,N_ as K,O7 as q}from"./zeni-epic-state-Bl3gAQPi.js";import{z as T,w as _,c8 as F,n as $,bR as G,c9 as H}from"./index-Ch-ATQTq.js";import"./mui-BCH_ILdb.js";import{u as J,R as x}from"./ReimbursementApprovalRuleDetailScreen-CD8m8c7W.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]="ca9fe1a4-b378-45bf-8ab7-0c9effe95ad7",e._sentryDebugIdIdentifier="sentry-dbid-ca9fe1a4-b378-45bf-8ab7-0c9effe95ad7")}catch{}})();const j="reimbursement-approval-rule-update",M=N((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:R(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(m(t)),n(`./${t}/edit`)):(e(m()),n("./new"))}}}))(_(F)),P=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),b=u((o=>R(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(O())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(U(!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||(w(!0),a(m())),s("./new"))}),[v,d,a]);const f={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(M,{currentTenant:c,location:n,navigate:s,...f})},A="reimbursement-approval-rule-update",Q=N((function(e){const s=h(e),n=R(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(m(t)),n(`./${t}/edit`)):(e(m()),n("./new"))},onReorderRules:t=>{e(q(t,!0))}}}))(_(H)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=G(e?.tenantId);return s?r.jsx(Y,{isLoading:n}):r.jsx(P,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),f=u((i=>E(i))),o=u((i=>h(i)));J();const y=u((i=>R(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(O())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(U(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(w(!0),a(K(!1,!0)))}),[v,b,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(m())),s("./new"))}),[S,o,a]);const I={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return f?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(Q,{currentTenant:f,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(X,{})}),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(Z,{})})]})}export{le as R};
@@ -0,0 +1 @@
1
+ import{j as h}from"./liveblocks-DcDE-V-o.js";import{a as f}from"./sentry-DB4rU-NW.js";import{u as O,j as g,h as C,g as _,i as V,l as k}from"./core-D4EC26kf.js";import{mv as L,ZS as T,ZA as U,NZ as B,Oa as j,O5 as A,O6 as E,ZT as N,fI as z,O4 as K}from"./zeni-epic-state-Bl3gAQPi.js";import{z as F,a5 as P,b$ as W,n as $,bR as G,c0 as H}from"./index-Ch-ATQTq.js";import{u as Z}from"./mui-BCH_ILdb.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]="af969338-2fbd-4d74-901b-2b49141cda56",e._sentryDebugIdIdentifier="sentry-dbid-af969338-2fbd-4d74-901b-2b49141cda56")}catch{}})();function J(){const e=O(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const M=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];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 y=(R=m.value,N(R)==null);var R;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=b.concat(I);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=C(),s=O(),t=_(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=Z(),r=g((n=>T(n))),l=g((n=>U(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(B(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return N(e)==null}const X=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const R=y.actorKind?.selectedOption,q=y.selectedRole?.selectedNonUsers??[];let D=[];R==="role"?D=q.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):R==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const b=v?.selection.selectedOptions??[];b.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:b});const I=S?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:S?.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(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("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=G(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(Q,{})}function Y(){const e=C(),s=O(),t=_(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=Z(),r=g((n=>T(n))),l=g((n=>U(n))),[a,d]=f.useState(!1);if(J(),f.useEffect((()=>{a||(d(!0),s(B(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,J as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-B8NMVuJ_.js";import{u as ne,j as k,h as Q,g as K,i as se,N as M,l as Y,q as lt,n as mt,o as x}from"./core-CLbwxogo.js";import{fI as V,O1 as ct,$k as be,c9 as ge,N7 as $e,me as dt,Nm as me,Nl as ce,$l as ut,bn as he,gZ as Ue,$m as pt,Xh as bt,m3 as Fe,Xi as Ae,Xj as gt,kR as ht,Zl as ft,l4 as St,MX as It,Cx as yt,kY as vt,NI as Le,$n as Ne,$o as ke,$p as Rt,$q as At,$r as kt,Ns as Ce,la as Ct,Zu as wt,Nk as xt,N5 as Et,$s as Bt,N4 as Tt,$t as Dt,Nc as we,Nw as jt,Nv as $t,Nr as Ut,$u as Pe,SJ as Ft,bo as Lt,Nf as Nt,N_ as Pt,$v as Mt,$w as _t,NE as Ot,NB as xe,YR as zt,N2 as Zt,$x as Me,Or as Ee,Oz as Gt,$y as Vt,$z as X,$A as Ht,$B as _e,$C as Wt,$D as Oe,$E as ze,NQ as de,bv as qt,bL as fe,cN as Se,e0 as Ze,d$ as Ge,$F as Xt,gk as Jt,Z2 as Kt,$G as Qt,$H as Ve,Z6 as Yt,ZR as en,$I as tn,_e as nn,Ow as Be,Ov as an,$J as sn,$K as on,$L as rn,$M as ln,$N as mn,ZA as cn,Om as dn,Oq as un,bq as pn,bK as bn,cH as gn,cv as hn,bu as fn,UI as Sn,db as In,de as yn,dd as vn,cG as Rn}from"./zeni-epic-state-DuYWeJse.js";import{bR as An,o as He,$ as We,W as ie,A as j,z as F,cQ as qe,a6 as oe,h as C,aQ as Te,E as D,ac as ae,ad as kn,G as Xe,cR as Cn,p as J,aq as Je,cS as wn,V as re,cT as xn,ao as En,a9 as Bn,a5 as Ie,N as Ke,w as Tn,bz as Dn,at as jn,ag as $n,cU as Un,f as Fn}from"./index-DGwZLIGK.js";import{n as _,S as Ln,u as Qe}from"./mui-DB2eP-4H.js";import ue from"./NotFoundScreen-BXBXaauZ.js";import{S as De}from"./SetupPagesScreen-BYB1gkfH.js";import{F as Ye}from"./FeaturePreviewScreen-ewOkPlMD.js";import{a as f}from"./sentry-Di8VmQH9.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-D5_P3HNy.js";import{u as et}from"./useInitialThreadRequest-CeTvaTKT.js";import{D as Nn}from"./DrawerScreen-BU5zwjE0.js";import{M as tt}from"./MobileAppDrawer-CPL93Y69.js";import{F as Pn}from"./ScreenRoutes-StBt4FAk.js";import{R as Mn}from"./ReimbursementApprovalRoutes-C6gQSVx5.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./BusinessVerificationPageScreen-tLWoFynI.js";import"./routePaths-DzyLeDiT.js";import"./analyticsHelper-C6bHmUJl.js";import"./InboxNotificationsProvider-T1CjerOs.js";import"./useTaskManagerAccess-qNZrVl0I.js";import"./getLocaleForTenant-yQGxhPnt.js";import"./ReimbursementApprovalRuleDetailScreen-jax_ZsZC.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]="300eb2e3-aec6-475e-a22f-7374427da2fd",e._sentryDebugIdIdentifier="sentry-dbid-300eb2e3-aec6-475e-a22f-7374427da2fd")}catch{}})();const nt=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Xe.getLocalizedStrings(),On=Y((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=F.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const E=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:E,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=F.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Et({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(ke({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Rt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Ne()),e(ke({}));const i=nt(o),l=J(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function je(){const e=Q(),t=ne(),n=K(),{reimbursementId:r}=se(),c=He(),d=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l(j.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(j.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:E}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=K().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[v,w]=f.useState(!1),h=F.getSignedInUser(),R=k((p=>V(p))),g=k((p=>be(p,r))),L=et(R?.companyId,{clearParams:g.fetchState==="Completed"}),$=ge(R?.userRole??[]);(function(){const p=ne(),N=k((P=>V(P))),O=N?.tenantId,{isApprovalRulesV3Enabled:H,isLoading:z}=An(O),W=k((P=>P.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||z||W==="Not-Started"&&p(ct(!0,!1,!1,H))}),[O,z,H,W,p])})(),f.useEffect((()=>{(T&&!v||B&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t($e(!1,b,y,r)))}));const U=k((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const A={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||$&&g.billStatus==="rejected"||$===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:A}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Zn,{}):null,m&&d!=="small"?s.jsx(Gn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:c,uncategorizedAccounts:U,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:E})})]})}const zn=_.div`
1
+ import{j as s}from"./liveblocks-DcDE-V-o.js";import{u as ne,j as k,h as Q,g as K,i as se,N as M,l as Y,q as lt,n as mt,o as x}from"./core-D4EC26kf.js";import{fI as V,O1 as ct,$l as be,c9 as ge,N7 as $e,me as dt,Nm as me,Nl as ce,$m as ut,bn as he,gZ as Ue,$n as pt,Xi as bt,m3 as Fe,Xj as Ae,Xk as gt,kR as ht,Zm as ft,l4 as St,MX as It,Cx as yt,kY as vt,NI as Le,$o as Ne,$p as ke,$q as Rt,$r as At,$s as kt,Ns as Ce,la as Ct,Zv as wt,Nk as xt,N5 as Et,$t as Bt,N4 as Tt,$u as Dt,Nc as we,Nw as jt,Nv as $t,Nr as Ut,$v as Pe,SJ as Ft,bo as Lt,Nf as Nt,N_ as Pt,$w as Mt,$x as _t,NE as Ot,NB as xe,YS as zt,N2 as Zt,$y as Me,Or as Ee,Oz as Gt,$z as Vt,$A as J,$B as Ht,$C as _e,$D as Wt,$E as Oe,$F as ze,NQ as de,bv as qt,bL as fe,cN as Se,e0 as Ze,d$ as Ge,$G as Jt,gk as Xt,Z3 as Kt,$H as Qt,$I as Ve,Z7 as Yt,ZS as en,$J as tn,_f as nn,Ow as Be,Ov as an,$K as sn,$L as on,$M as rn,$N as ln,$O as mn,ZB as cn,Om as dn,Oq as un,bq as pn,bK as bn,cH as gn,cv as hn,bu as fn,UJ as Sn,db as In,de as yn,dd as vn,cG as Rn}from"./zeni-epic-state-Bl3gAQPi.js";import{bR as An,e as He,$ as We,W as ie,A as j,z as F,cQ as qe,a6 as oe,j as C,aQ as Te,E as D,ac as ae,ad as kn,G as Je,cR as Cn,p as X,aq as Xe,cS as wn,V as re,cT as xn,ao as En,a9 as Bn,a5 as Ie,N as Ke,w as Tn,bz as Dn,at as jn,ag as $n,cU as Un,g as Fn}from"./index-Ch-ATQTq.js";import{n as _,S as Ln,u as Qe}from"./mui-BCH_ILdb.js";import ue from"./NotFoundScreen-0hF8kIyY.js";import{S as De}from"./SetupPagesScreen-CIrP22mo.js";import{F as Ye}from"./FeaturePreviewScreen-B0SxkBd3.js";import{a as f}from"./sentry-DB4rU-NW.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-CBSVhkeG.js";import{u as et}from"./useInitialThreadRequest-Da3K5Ksw.js";import{D as Nn}from"./DrawerScreen-DquM7PdJ.js";import{M as tt}from"./MobileAppDrawer-C6gfQS8M.js";import{F as Pn}from"./ScreenRoutes-C72NzSAe.js";import{R as Mn}from"./ReimbursementApprovalRoutes-kSFV0KaQ.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.js";import"./BusinessVerificationPageScreen-CqSHzLo6.js";import"./routePaths-D0-Tropc.js";import"./analyticsHelper-nRPDDcpi.js";import"./InboxNotificationsProvider-DPgK9Ai7.js";import"./useTaskManagerAccess-CX5toJpg.js";import"./getLocaleForTenant-B07LkoV2.js";import"./ReimbursementApprovalRuleDetailScreen-CD8m8c7W.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]="8d5efe72-3e09-4be7-a8dd-c53475bbe7d8",e._sentryDebugIdIdentifier="sentry-dbid-8d5efe72-3e09-4be7-a8dd-c53475bbe7d8")}catch{}})();const nt=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Je.getLocalizedStrings(),On=Y((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=F.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const E=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:E,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=F.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Et({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(ke({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Rt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Ne()),e(ke({}));const i=nt(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function je(){const e=Q(),t=ne(),n=K(),{reimbursementId:r}=se(),c=He(),d=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l(j.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(j.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:E}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=K().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[v,w]=f.useState(!1),h=F.getSignedInUser(),R=k((p=>V(p))),g=k((p=>be(p,r))),L=et(R?.companyId,{clearParams:g.fetchState==="Completed"}),$=ge(R?.userRole??[]);(function(){const p=ne(),N=k((P=>V(P))),O=N?.tenantId,{isApprovalRulesV3Enabled:H,isLoading:z}=An(O),W=k((P=>P.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||z||W==="Not-Started"&&p(ct(!0,!1,!1,H))}),[O,z,H,W,p])})(),f.useEffect((()=>{(T&&!v||B&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t($e(!1,b,y,r)))}));const U=k((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const A={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||$&&g.billStatus==="rejected"||$===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:A}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Zn,{}):null,m&&d!=="small"?s.jsx(Gn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:c,uncategorizedAccounts:U,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:E})})]})}const zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-B8NMVuJ_.js";import{u as ne,j as k,h as Q,g as K
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=Y((function(e,t){const n=Pe(e,t.reimbursementId),r=F.getSignedInUser(),c=he(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Mt(n.remiActivities,_t(t.currentTenant),r));const i=ge(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Ne());const a=nt(o),i=J(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=J(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Le(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(wn);function Xn(){const e=Q(),t=ne(),n=K(),r=n.hash.substring(1),c=He(),{reimbursementId:d}=se(),m=F.getSignedInUser(),o=k((A=>V(A))),a=k((A=>Pe(A,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=ye({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=ie(),{isFeatureEnabled:E}=u(j.isLimitedCategoryForReimbursement),[I,B]=f.useState(!1),[T,v]=f.useState(!1),[w,h]=f.useState(!1),{isFeatureEnabled:R}=u(j.isShowDeletedReimbursementsFeatureEnabled),g=k((A=>be(A,d??""))),L=Ft(o),$=Lt(o.userRole),U=a.fetchState;if(f.useEffect((()=>{I||d==null?I==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(d,!1,R)))}),[I,d,t,U]),f.useEffect((()=>{R&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?h(!1):h(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((A=>A.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,o.isZeni,L,m]),f.useEffect((()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t($e(!1,E,R,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[T,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:A=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(A)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:R,location:n,navigate:e,isRealTimeApprovalEnabled:w,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Jn=Y((function(e,t){return{remisReviewView:Me(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(xn);function Kn({tenantEmailDomain:e}){const t=Q(),n=k((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=k((m=>Me(m))),c=re(),d=c?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Jn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const G=Yt(),at="bulk-operation-update",pe="reimbursement-approval-rule-update",{spendManagement:Qn,common:le}=Xe.getLocalizedStrings(),Yn=Qn.reimbursement.bulkActions,ea=_.div`
56
+ `,qn=Y((function(e,t){const n=Pe(e,t.reimbursementId),r=F.getSignedInUser(),c=he(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Mt(n.remiActivities,_t(t.currentTenant),r));const i=ge(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Ne());const a=nt(o),i=X(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=X(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Le(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(wn);function Jn(){const e=Q(),t=ne(),n=K(),r=n.hash.substring(1),c=He(),{reimbursementId:d}=se(),m=F.getSignedInUser(),o=k((A=>V(A))),a=k((A=>Pe(A,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=ye({mobileExploreReferrer:"Reimbursement Details"});Xe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=ie(),{isFeatureEnabled:E}=u(j.isLimitedCategoryForReimbursement),[I,B]=f.useState(!1),[T,v]=f.useState(!1),[w,h]=f.useState(!1),{isFeatureEnabled:R}=u(j.isShowDeletedReimbursementsFeatureEnabled),g=k((A=>be(A,d??""))),L=Ft(o),$=Lt(o.userRole),U=a.fetchState;if(f.useEffect((()=>{I||d==null?I==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(d,!1,R)))}),[I,d,t,U]),f.useEffect((()=>{R&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?h(!1):h(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((A=>A.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,o.isZeni,L,m]),f.useEffect((()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t($e(!1,E,R,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[T,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:A=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(A)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:R,location:n,navigate:e,isRealTimeApprovalEnabled:w,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Xn=Y((function(e,t){return{remisReviewView:Me(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(J())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(xn);function Kn({tenantEmailDomain:e}){const t=Q(),n=k((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=k((m=>Me(m))),c=re(),d=c?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Xn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const G=Yt(),at="bulk-operation-update",pe="reimbursement-approval-rule-update",{spendManagement:Qn,common:le}=Je.getLocalizedStrings(),Yn=Qn.reimbursement.bulkActions,ea=_.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-B8NMVuJ_.js";import{u as ne,j as k,h as Q,g as K
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ta=Y((function(e,t){const n=ze(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=F.getSignedInUser(),d=he(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const b=n.fetchState,y=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(X()),e(_e(o))},onSubtabChange:o=>{e(X()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=J(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=J(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=J(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(mn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(ln(o))},onFiltersChange:o=>{e(rn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(de(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(sn(o))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(an(o,a??""));break;case"send_for_approval":e(Be("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Be("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(pe)&&e(nn(!1))},onEventReceived:o=>{o===at&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ne(),n=K(),r=n.state,c=We(),[d,m]=f.useState(null),o=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Ht(r.tab.toString());S!=null?t(_e(S)):console.log("Warning:Not a valid remiListTab");const Z=Wt(r.subTab.toString());Z!=null?t(Oe(Z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=ie(),{isFeatureEnabled:i}=a(j.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(j.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(j.isReimbursementBulkActionEnabled),y=F.getSignedInUser(),u=k((S=>V(S))),[E,I]=f.useState(!1),[B,T]=f.useState(!1),v=re(),w=v?.loggedInUserRole?.includes("admin")===!0,h=k((S=>ze(S,G,b))),{areTenantIdsInSync:R}=En(),g=h.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=ye({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:g==="Completed"}),f.useEffect((()=>{!B&&R&&(T(!0),t(de(G,!0,l,!1,!0)))}),[B,G,t,R]),y==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),A=fe(v?.loggedInUserRoleMap),p=Se(v?.loggedInUserRoleMap),N=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,z=k((S=>Ue(S.companyState,u.companyId))),W=z?.company.featuresActivationInfo.connectedAccountProvider,P=S=>{I(S)},{isFeatureEnabled:st}=a(j.isDebitCardFeatureEnabled),it=Ze(st,u),ot=Ge(u),{remisProcessed:ee,remisProcessing:ve}=k((S=>Xt(S)));f.useEffect((()=>{ee===ve&&d!=null&&(t(Jt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:ee>1?le.texts.reports2:Yn.report},{variableName:"_has_",variableValue:ee>1?le.texts.have:le.texts.has},{variableName:"_action_",variableValue:Kt(d)}]})),t(Qt()),setTimeout((()=>{t(de(G,!0,l,!1,!0,!0))}),3e3),m(null))}),[ee,ve]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${pe}`]:[],eventCallback:(S,Z,Re)=>{S.endsWith(pe)?Re.onReimbursementApprovalRulesEventReceived?.(S):Z.entity_type==="reimbursement"&&(m(Z.operation_type),Re.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(Ye,{}):O&&(!U||A)||p&&N?s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(oe,{analytics:C,onLoad:S=>(Z=>Z.trackPageLoaded(Ke.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:E,handleDrawerToggle:P}),s.jsxs(ea,{windowSize:c,children:[s.jsx(Nn,{isOpen:o,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:G,isAdmin:w,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{P(!0)},createdByUserList:h.createdByUserList,createdByUserListFetchState:h.createdByUserListFetchState,isDownloadEnabled:h.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:b,bulkSubmissionLimit:h.remiBulkSubmissionLimit,bulkSubmissionFetchState:h.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...rt})]})]}):H&&A?s.jsx(M,{to:"../setup"}):v!=null&&Ve(u,v.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(Ie,{fetchState:"In-Progress"}):s.jsx(ue,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=_(Ln)`
64
+ `,ta=Y((function(e,t){const n=ze(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=F.getSignedInUser(),d=he(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const b=n.fetchState,y=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(J()),e(_e(o))},onSubtabChange:o=>{e(J()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=X(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=X(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=X(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(mn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(ln(o))},onFiltersChange:o=>{e(rn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(de(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(sn(o))},removeAllTransactionsFromBulkActionList:()=>{e(J())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(an(o,a??""));break;case"send_for_approval":e(Be("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Be("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(pe)&&e(nn(!1))},onEventReceived:o=>{o===at&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ne(),n=K(),r=n.state,c=We(),[d,m]=f.useState(null),o=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Ht(r.tab.toString());S!=null?t(_e(S)):console.log("Warning:Not a valid remiListTab");const Z=Wt(r.subTab.toString());Z!=null?t(Oe(Z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(J())}}),[]);const{useFeatureGate:a}=ie(),{isFeatureEnabled:i}=a(j.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(j.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(j.isReimbursementBulkActionEnabled),y=F.getSignedInUser(),u=k((S=>V(S))),[E,I]=f.useState(!1),[B,T]=f.useState(!1),v=re(),w=v?.loggedInUserRole?.includes("admin")===!0,h=k((S=>ze(S,G,b))),{areTenantIdsInSync:R}=En(),g=h.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=ye({mobileExploreReferrer:"Reimbursement List"});if(Xe({isDataReady:g==="Completed"}),f.useEffect((()=>{!B&&R&&(T(!0),t(de(G,!0,l,!1,!0)))}),[B,G,t,R]),y==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),A=fe(v?.loggedInUserRoleMap),p=Se(v?.loggedInUserRoleMap),N=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,z=k((S=>Ue(S.companyState,u.companyId))),W=z?.company.featuresActivationInfo.connectedAccountProvider,P=S=>{I(S)},{isFeatureEnabled:st}=a(j.isDebitCardFeatureEnabled),it=Ze(st,u),ot=Ge(u),{remisProcessed:ee,remisProcessing:ve}=k((S=>Jt(S)));f.useEffect((()=>{ee===ve&&d!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:ee>1?le.texts.reports2:Yn.report},{variableName:"_has_",variableValue:ee>1?le.texts.have:le.texts.has},{variableName:"_action_",variableValue:Kt(d)}]})),t(Qt()),setTimeout((()=>{t(de(G,!0,l,!1,!0,!0))}),3e3),m(null))}),[ee,ve]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${pe}`]:[],eventCallback:(S,Z,Re)=>{S.endsWith(pe)?Re.onReimbursementApprovalRulesEventReceived?.(S):Z.entity_type==="reimbursement"&&(m(Z.operation_type),Re.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(Ye,{}):O&&(!U||A)||p&&N?s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(oe,{analytics:C,onLoad:S=>(Z=>Z.trackPageLoaded(Ke.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:E,handleDrawerToggle:P}),s.jsxs(ea,{windowSize:c,children:[s.jsx(Nn,{isOpen:o,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(J())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:G,isAdmin:w,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{P(!0)},createdByUserList:h.createdByUserList,createdByUserListFetchState:h.createdByUserListFetchState,isDownloadEnabled:h.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:b,bulkSubmissionLimit:h.remiBulkSubmissionLimit,bulkSubmissionFetchState:h.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...rt})]})]}):H&&A?s.jsx(M,{to:"../setup"}):v!=null&&Ve(u,v.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(Ie,{fetchState:"In-Progress"}):s.jsx(ue,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=_(Ln)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,oa=Y((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),ra=()=>{const e=$n(),t=Q(),n=K(),{tenantEmailDomain:r}=se(),c=Qe(),[d,m]=f.useState(!1),o=k((w=>V(w))),a=F.getSignedInUserTenant(r)?.companyId??o.companyId,i=F.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=re(),u=fe(y?.loggedInUserRoleMap),E=Se(y?.loggedInUserRoleMap),I=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,T=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,v=w=>{m(w)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&E&&I?s.jsx(M,{to:"../../../reimbursements"}):T&&u?s.jsx(M,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!T||o.userReimbursementInfo&&E&&I===!1?s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:w=>(h=>h.trackPageLoaded(Ke.Event.reimbursementPromoPage))(w)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:v}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{v(!0)}})]}):s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Ma(){const e=k((P=>V(P))),t=re(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ie(),{isFeatureEnabled:o}=m(j.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(j.isDebitCardFeatureEnabled),i=Ze(a,e),l=Ge(e),b=e?.userRole!=null&&pn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),E=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,I=fe(t?.loggedInUserRoleMap),B=E&&I,T=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=T&&hn(t?.loggedInUserRoleMap),w=Fn(e,o,a)&&!b,h=w&&fn(t?.loggedInUserRoleMap),R=Sn(t?.loggedInUserRoleMap),g=In(t?.loggedInUserRoleMap),L=yn(t?.loggedInUserRoleMap),$=T&&g,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&L,A=vn(t?.loggedInUserRoleMap),p=Rn(t?.loggedInUserRoleMap),N=Se(t?.loggedInUserRoleMap),O=w&&A,{tenantEmailDomain:H}=se(),z=K(),W=n===!0&&(I||N&&d);return s.jsxs(mt,{children:[z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:R,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:R,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(Mn,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:N,showTreasuryRoute:U,isTenantBankingOnly:i,showChargeCardRoute:O,tenantEmailDomain:H??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(M,{to:"../promo"})}),c&&I&&s.jsx(x,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(je,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(je,{})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]}):s.jsx(x,{path:"*",element:s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]})}export{Ma as default};
68
+ `,oa=Y((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),ra=()=>{const e=$n(),t=Q(),n=K(),{tenantEmailDomain:r}=se(),c=Qe(),[d,m]=f.useState(!1),o=k((w=>V(w))),a=F.getSignedInUserTenant(r)?.companyId??o.companyId,i=F.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=re(),u=fe(y?.loggedInUserRoleMap),E=Se(y?.loggedInUserRoleMap),I=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,T=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,v=w=>{m(w)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&E&&I?s.jsx(M,{to:"../../../reimbursements"}):T&&u?s.jsx(M,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!T||o.userReimbursementInfo&&E&&I===!1?s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:w=>(h=>h.trackPageLoaded(Ke.Event.reimbursementPromoPage))(w)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:v}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{v(!0)}})]}):s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Ma(){const e=k((P=>V(P))),t=re(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ie(),{isFeatureEnabled:o}=m(j.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(j.isDebitCardFeatureEnabled),i=Ze(a,e),l=Ge(e),b=e?.userRole!=null&&pn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),E=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,I=fe(t?.loggedInUserRoleMap),B=E&&I,T=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=T&&hn(t?.loggedInUserRoleMap),w=Fn(e,o,a)&&!b,h=w&&fn(t?.loggedInUserRoleMap),R=Sn(t?.loggedInUserRoleMap),g=In(t?.loggedInUserRoleMap),L=yn(t?.loggedInUserRoleMap),$=T&&g,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&L,A=vn(t?.loggedInUserRoleMap),p=Rn(t?.loggedInUserRoleMap),N=Se(t?.loggedInUserRoleMap),O=w&&A,{tenantEmailDomain:H}=se(),z=K(),W=n===!0&&(I||N&&d);return s.jsxs(mt,{children:[z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:R,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:R,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(Mn,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:N,showTreasuryRoute:U,isTenantBankingOnly:i,showChargeCardRoute:O,tenantEmailDomain:H??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(M,{to:"../promo"})}),c&&I&&s.jsx(x,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(je,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(je,{})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]}):s.jsx(x,{path:"*",element:s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]})}export{Ma as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-B8NMVuJ_.js";import{g as Q,h as ke,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-CLbwxogo.js";import{fI as q,Ev as R,Ve as Ee,m3 as ne,uh as re,v6 as D,lK as Pe,lT as A,lL as E,kO as P,kF as L,kE as Le,DD as le,vb as Me,bq as ve,Vf as Be,bn as Ue,ES as xe,Vg as ze,Vh as Ge,cj as S,Dw as He,Vi as X,Vj as Ne,Vk as Ye,Vl as qe,Vm as $e,Vn as Ke,Vo as Ze,Vp as Je,Vq as Qe,Vr as We,Vs as Xe,Vt as ea,Vu as aa,Vv as T,Vw as M,Vx as v,Vy as B,Vz as U,VA as x,VB as z,VC as G,VD as H,VE as N,ek as sa,Ew as ta,Ej as ee,Ek as ae,EC as oa,Eo as se,EI as na,VF as ra,VG as la,VH as ca,VI as ia,VJ as da,VK as pa,VL as _a,VM as fa,VN as ma,VO as ua,e0 as ba,d$ as ha}from"./zeni-epic-state-DuYWeJse.js";import{al as ya,am as wa,an as Ca,a as Ia,$ as Sa,W as ce,A as ie,z as de,ao as ga,V as Ra,d as Va,ap as Ta,aq as ja,a6 as ka,h as Y,N as Fa,v as Oa,p as pe,ar as Da,as as Aa,at as Ea}from"./index-DGwZLIGK.js";import"./mui-DB2eP-4H.js";import Pa from"./NotFoundScreen-BXBXaauZ.js";import{F as La}from"./FeaturePreviewScreen-ewOkPlMD.js";import{a as u}from"./sentry-Di8VmQH9.js";import{u as Ma}from"./useInitialThreadRequest-CeTvaTKT.js";import{t as te,a as oe,b as va}from"./routePaths-DzyLeDiT.js";import{M as Ba}from"./MobileAppDrawer-CPL93Y69.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./InboxNotificationsProvider-T1CjerOs.js";import"./useTaskManagerAccess-qNZrVl0I.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]="8e72373f-d0d6-4e80-b48f-32c9bc1395e1",e._sentryDebugIdIdentifier="sentry-dbid-8e72373f-d0d6-4e80-b48f-32c9bc1395e1")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(v({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Be(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:Y,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(T(a)),(g(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ta({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=sa(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(N({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(v({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=g(t),l=S(t);l?(e(Je({viewMode:a})),e(Qe({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(T(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(T(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(T(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Ze({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?E():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?P():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):E(!0):P(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ia(),_=Sa(),m=Aa(_),a=ke(),s=Fe(),t=Q(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[$,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>q(n))),fe=k.masterTOSInfo?.isMasterTOSAccepted??!1,me=k.company?.companyInfo.firstMonthOfFY??1,ue=Ma(k?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Ee(n))),{areTenantIdsInSync:b}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>ne(n))),I=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!$&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":I&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":V&&s(L());break;case"balance_sheet_by_projects":I&&s(P());break;case"cash_flow_by_classes":V&&s(E());break;case"cash_flow_by_projects":I&&s(A());break;case"cash_flow":s(Pe(h.timeframe))}}),[c,F,O,b,V,I]);const K=Ra(),we=K?.loggedInUserRole!=null&&ve(K?.loggedInUserRole)!==!0,[Ce,Ie]=u.useState(!1),Z=n=>{Ie(n)},Se=Va(),ge=Ta();return(function(n){const{isDataReady:Re}=n,{pathname:Ve}=Q(),J=ya(Ve??"")==="reports",Te=wa(Re),je=u.useMemo((()=>J?Ua:void 0),[J]);Ca({canFetchSuggestedQuestions:Te,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ka,{analytics:Y,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Ba,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Z}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:Y,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:I,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Z,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Se&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ps(){const e=d((s=>q(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Pa,{})})]})}export{ps as default};
1
+ import{j as p}from"./liveblocks-DcDE-V-o.js";import{g as Q,h as ke,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-D4EC26kf.js";import{fI as q,Ev as R,Vf as Pe,m3 as ne,uh as re,v6 as D,lK as Ee,lT as A,lL as P,kO as E,kF as L,kE as Le,DD as le,vb as Me,bq as ve,Vg as Be,bn as Ue,ES as xe,Vh as ze,Vi as Ge,cj as S,Dw as He,Vj as X,Vk as Ne,Vl as Ye,Vm as qe,Vn as $e,Vo as Ke,Vp as Ze,Vq as Je,Vr as Qe,Vs as We,Vt as Xe,Vu as ea,Vv as aa,Vw as T,Vx as M,Vy as v,Vz as B,VA as U,VB as x,VC as z,VD as G,VE as H,VF as N,ek as sa,Ew as ta,Ej as ee,Ek as ae,EC as oa,Eo as se,EI as na,VG as ra,VH as la,VI as ca,VJ as ia,VK as da,VL as pa,VM as _a,VN as fa,VO as ma,VP as ba,e0 as ua,d$ as ha}from"./zeni-epic-state-Bl3gAQPi.js";import{al as ya,am as wa,an as Ca,a as Ia,$ as Sa,W as ce,A as ie,z as de,ao as ga,V as Ra,d as Va,ap as Ta,aq as ja,a6 as ka,j as Y,N as Fa,v as Oa,p as pe,ar as Da,as as Aa,at as Pa}from"./index-Ch-ATQTq.js";import"./mui-BCH_ILdb.js";import Ea from"./NotFoundScreen-0hF8kIyY.js";import{F as La}from"./FeaturePreviewScreen-B0SxkBd3.js";import{a as b}from"./sentry-DB4rU-NW.js";import{u as Ma}from"./useInitialThreadRequest-Da3K5Ksw.js";import{t as te,a as oe,b as va}from"./routePaths-D0-Tropc.js";import{M as Ba}from"./MobileAppDrawer-C6gfQS8M.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.js";import"./InboxNotificationsProvider-DPgK9Ai7.js";import"./useTaskManagerAccess-CX5toJpg.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]="b3c2c025-854b-454d-8a0b-677914c34bac",e._sentryDebugIdIdentifier="sentry-dbid-b3c2c025-854b-454d-8a0b-677914c34bac")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(v({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Be(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:Y,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(T(a)),(g(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ta({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=sa(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(N({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(v({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=g(t),l=S(t);l?(e(Je({viewMode:a})),e(Qe({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(T(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(T(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(T(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Ze({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ia(),_=Sa(),m=Aa(_),a=ke(),s=Fe(),t=Q(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=b.useState(!1),[$,_e]=b.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>q(n))),fe=k.masterTOSInfo?.isMasterTOSAccepted??!1,me=k.company?.companyInfo.firstMonthOfFY??1,be=Ma(k?.companyId),C=d((n=>R(n).fetchState)),ue=d((n=>Pe(n))),{areTenantIdsInSync:u}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>ne(n))),I=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!$&&C==="Completed"&&u&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,u]),b.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":I&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":V&&s(L());break;case"balance_sheet_by_projects":I&&s(E());break;case"cash_flow_by_classes":V&&s(P());break;case"cash_flow_by_projects":I&&s(A());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,F,O,u,V,I]);const K=Ra(),we=K?.loggedInUserRole!=null&&ve(K?.loggedInUserRole)!==!0,[Ce,Ie]=b.useState(!1),Z=n=>{Ie(n)},Se=Va(),ge=Ta();return(function(n){const{isDataReady:Re}=n,{pathname:Ve}=Q(),J=ya(Ve??"")==="reports",Te=wa(Re),je=b.useMemo((()=>J?Ua:void 0),[J]);Ca({canFetchSuggestedQuestions:Te,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ka,{analytics:Y,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Ba,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Z}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:Y,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:I,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Z,reportsResyncFetchState:ue.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Se&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:be})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ps(){const e=d((s=>q(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ua(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-B8NMVuJ_.js";import{z as b,a6 as N,h as u,N as S,e0 as I,W as k,A as C}from"./index-DGwZLIGK.js";import"./mui-DB2eP-4H.js";import g from"./NotFoundScreen-BXBXaauZ.js";import{a as c}from"./sentry-Di8VmQH9.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-CLbwxogo.js";import{fI as _,a2u as w,a2v as p,Ea as P,q3 as V,a2w as q,E8 as z}from"./zeni-epic-state-DuYWeJse.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.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]="f9d111b9-7e5d-4649-815b-021e7414af82",e._sentryDebugIdIdentifier="sentry-dbid-f9d111b9-7e5d-4649-815b-021e7414af82")}catch{}})();const A=T((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),G=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),j=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(E=>E.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(A,{navigate:l,location:j,currentTenant:r,companyName:v,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-DcDE-V-o.js";import{z as j,a6 as N,j as u,N as S,e0 as I,W as k,A as C}from"./index-Ch-ATQTq.js";import"./mui-BCH_ILdb.js";import g from"./NotFoundScreen-0hF8kIyY.js";import{a as c}from"./sentry-DB4rU-NW.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as d,N as y}from"./core-D4EC26kf.js";import{fI as _,a2v as w,a2w as p,Ea as P,q3 as V,a2x as q,E8 as z}from"./zeni-epic-state-Bl3gAQPi.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.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]="a09d868d-4df0-4cea-847c-26f75b928ea2",e._sentryDebugIdIdentifier="sentry-dbid-a09d868d-4df0-4cea-847c-26f75b928ea2")}catch{}})();const A=T((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),G=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),x=L(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),b=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(E=>E.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(A,{navigate:l,location:x,currentTenant:r,companyName:v,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};