@zeniai/web-app-ui 5.1.62-dev → 5.1.63-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 (133) hide show
  1. package/dist/assets/AddressRoutes-DiGYiZdH.js +1 -0
  2. package/dist/assets/{AddressScreen-D7DCNUGo.js → AddressScreen-GAHyIX-c.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-Bv6DgXwH.js → AiCfoScreen-D2sAwMZS.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DxIJLeU6.js → BillPayApprovalRoutes-BglCJxi-.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CxAjptk9.js → BillPayRoutes-7zp9D6x8.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-HLhTZBjl.js → BusinessVerificationPageScreen-DMq3tKTs.js} +2 -2
  7. package/dist/assets/CardsAiCfoScreen--ED2OEzt.js +14 -0
  8. package/dist/assets/ChargeCardRoutes-CMdGvjPJ.js +71 -0
  9. package/dist/assets/CompanyPassportScreen-DMJdNz2u.js +1 -0
  10. package/dist/assets/ConnectionAuthScreen-CC4jwpJn.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-Bqsz81r8.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-B4tFhrDj.js → CustomerOnboardingRoutes-DfaM8hGj.js} +6 -6
  13. package/dist/assets/{DashboardRoutes-uPgpLI1W.js → DashboardRoutes-BCVeePc3.js} +3 -3
  14. package/dist/assets/{DefaultTenantHome-Bhp_uriR.js → DefaultTenantHome-BKFAUyCt.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-YZRErnfJ.js → DomesticWireDetailScreen-WRSPX-4X.js} +4 -4
  16. package/dist/assets/DrawerScreen-DaMuYUCn.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-Bcvb-t4n.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-ChVJkArc.js → ExpenseAutomationRoutes-BMNILnav.js} +4 -4
  19. package/dist/assets/{FeaturePreviewScreen-kp5WtNsg.js → FeaturePreviewScreen-D4Ah53J7.js} +1 -1
  20. package/dist/assets/HubSpotOAuthCallbackScreen-DRjMsB35.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-Dtjlc8Bf.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-D1bS19KK.js +12 -0
  23. package/dist/assets/MobileAppDrawer-PDN1hPUR.js +1 -0
  24. package/dist/assets/NotFoundScreen-CKyavEYX.js +1 -0
  25. package/dist/assets/{NotificationRoutes-B06j6V42.js → NotificationRoutes-BP3RNHOU.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-CWy6K8Uy.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-BCTBlqwg.js +1 -0
  28. package/dist/assets/PeopleRoutes-84yTwmWw.js +22 -0
  29. package/dist/assets/PerformanceRoutes-BQUXWKZE.js +1 -0
  30. package/dist/assets/{Preview-lrK4F27Y.js → Preview-C7zW6Q7F.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-Cx74YOuE.js → QBOConnectionScreen-BDzJBSaJ.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-G8WgDfU8.js → ReferralListScreen-CXBkdn17.js} +2 -2
  33. package/dist/assets/ReimbursementApprovalRoutes-DFKDTo2d.js +1 -0
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-s9Cc-PAW.js → ReimbursementApprovalRuleDetailScreen-77M2HLZ2.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-vHQ3hpWm.js → ReimbursementRoutes-YhP6hHRt.js} +7 -7
  36. package/dist/assets/{ReportsRoutes-DIUc8s5q.js → ReportsRoutes-wzqHii7q.js} +1 -1
  37. package/dist/assets/RewardsRoutes-DfmbXNc8.js +1 -0
  38. package/dist/assets/ScreenRoutes-DvRF1Ugr.js +2 -0
  39. package/dist/assets/{SettingsRoutes-B4g8CJnG.js → SettingsRoutes-xpOSQOkw.js} +7 -7
  40. package/dist/assets/{SetupPagesScreen-BkPb95y9.js → SetupPagesScreen-CrjLDbOm.js} +5 -5
  41. package/dist/assets/SignInScreen-Ck9zXfCr.js +1 -0
  42. package/dist/assets/SignOutScreen-DSoi64zr.js +9 -0
  43. package/dist/assets/{TaskListScreen-DGOHeeuZ.js → TaskListScreen-Cs7VLiUm.js} +2 -2
  44. package/dist/assets/TaskRoutes-dkq9ikjL.js +9 -0
  45. package/dist/assets/{TransactionDetailRoutes-BXwhj2nX.js → TransactionDetailRoutes-2AtDo3dT.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-DUZV5JDK.js → TransactionDetailScreen-CWpk0UU1.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-CDDcflri.js → TransactionListRoutes-lHRZBvxi.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-CZyF8G2k.js → TreasuryRoutes-C4iGPRK3.js} +6 -6
  49. package/dist/assets/{VendorsRoutes-B0mGOZoL.js → VendorsRoutes-7KkgbfcW.js} +27 -27
  50. package/dist/assets/WiseConfirmationScreen-DshLBzeW.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-BeZsG6M5.js → ZeniAccountRoutes-pWTshbAJ.js} +10 -10
  52. package/dist/assets/{ZeniAccountStatementScreen-CU5lpB3Y.js → ZeniAccountStatementScreen-DEwEWZ2Q.js} +2 -2
  53. package/dist/assets/{accountMappingHelper-CSvCSQoY.js → accountMappingHelper-BPzhOzDQ.js} +1 -1
  54. package/dist/assets/{analytics-DCrhd8oB.js → analytics-Bqx0zRxd.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CQXeRvKo.js → analyticsHelper-d524teZu.js} +1 -1
  56. package/dist/assets/{core-DmAftQ4g.js → core-Bv1T7LZC.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-C70tsXnj.js → decodeURIComponentSafe-CgJ-EbJc.js} +1 -1
  58. package/dist/assets/{dnd-3F1D24DQ.js → dnd-CrtLd1r-.js} +1 -1
  59. package/dist/assets/{empty-CDCfsLV4.js → empty-BGU_c4p_.js} +1 -1
  60. package/dist/assets/{empty-B3YzB_Zh.js → empty-DZLujeFc.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-CFNhZ55F.js → emptyVideoElement-D0DWhAqS.js} +1 -1
  62. package/dist/assets/epic-C0x_kZHk.js +2 -0
  63. package/dist/assets/getLocaleForTenant-DTwWZ3TG.js +1 -0
  64. package/dist/assets/{index-EyTFjAAZ.js → index-B-VkC3pW.js} +1 -1
  65. package/dist/assets/{index-DPrh5XVZ.js → index-BcMhlMw0.js} +1 -1
  66. package/dist/assets/{index-BJ17Ijlb.js → index-Bf0yAk1h.js} +2 -2
  67. package/dist/assets/{index-B2dyNLwa.js → index-BfDh5m3J.js} +1 -1
  68. package/dist/assets/{index-DniSRtks.js → index-Bgxmla6x.js} +1 -1
  69. package/dist/assets/{index-BpGaPboJ.js → index-C7MHnpYf.js} +1 -1
  70. package/dist/assets/{index-DsVH62ZK.js → index-CwcEF-q7.js} +10178 -10150
  71. package/dist/assets/{index-BTn1WqO7.js → index-Dvxx9UaB.js} +1 -1
  72. package/dist/assets/{lexical-PVlNGkpS.js → lexical-DtmspfR6.js} +1 -1
  73. package/dist/assets/{liveblocks-evjZPqs_.js → liveblocks-DC3GaKoW.js} +1 -1
  74. package/dist/assets/{lottie-CmTLY-9t.js → lottie-BAdftm7g.js} +1 -1
  75. package/dist/assets/{mui-PcDpEhsm.js → mui-VYhJrGDQ.js} +1 -1
  76. package/dist/assets/{pathToGoBack-Dt8AwbCr.js → pathToGoBack-BPhnwklb.js} +1 -1
  77. package/dist/assets/{pdf-CbXlPYUs.js → pdf-DyfSqkK5.js} +4 -4
  78. package/dist/assets/{pdf-lib-CU5FhbnZ.js → pdf-lib-CPh8no6v.js} +1 -1
  79. package/dist/assets/{plaid-DSnXUEUK.js → plaid-BlhDSPsk.js} +1 -1
  80. package/dist/assets/{pusher-Cwyg5VVV.js → pusher-DGAKVhUw.js} +1 -1
  81. package/dist/assets/{react-CJ1HWQ69.js → react-B1_zGwIA.js} +1 -1
  82. package/dist/assets/{react-EoTfQhVb.js → react-BJZHoUnV.js} +1 -1
  83. package/dist/assets/{react-ymB_cbpE.js → react-D4kHPPtw.js} +1 -1
  84. package/dist/assets/{react-CY1ZQ6op.js → react-D_wg-5Ag.js} +1 -1
  85. package/dist/assets/{react-Cf5hLxOq.js → react-EkeFt_9c.js} +1 -1
  86. package/dist/assets/{react-CDqmK3AW.js → react-mFsTSWE1.js} +1 -1
  87. package/dist/assets/{recharts-CgEqsrFw.js → recharts-D979ncoh.js} +1 -1
  88. package/dist/assets/routePaths-CjJlLbxf.js +1 -0
  89. package/dist/assets/{sentry-CCZGmBkl.js → sentry-CuaXjR5n.js} +1 -1
  90. package/dist/assets/{url-BKaTO14S.js → url-73U0aVt0.js} +1 -1
  91. package/dist/assets/{url-9kg5cual.js → url-DXrWvdUh.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BzB3gTK8.js → useAiCfoDashboardSuggestedQuestionsChips-BQUVbUQb.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-XSnEPSCB.js +1 -0
  94. package/dist/assets/useCashManagementBanner-Cqvytrqk.js +1 -0
  95. package/dist/assets/{useChargeCardPusherEvents-BOkZNaGv.js → useChargeCardPusherEvents-DWEn28bl.js} +1 -1
  96. package/dist/assets/{useDeviceId-DGJPBja9.js → useDeviceId-BVyTAih4.js} +1 -1
  97. package/dist/assets/useEmailConnectResultRefresh-iMxOBvVh.js +1 -0
  98. package/dist/assets/{useInitialThreadRequest-D9ebiXdA.js → useInitialThreadRequest-BsceBU6n.js} +1 -1
  99. package/dist/assets/{utils--mWNe9J7.js → utils-DPYDOv00.js} +1 -1
  100. package/dist/assets/{withTransactionSidePanel-iGXE6khP.js → withTransactionSidePanel-BzY2xiGY.js} +2 -2
  101. package/dist/assets/{zeni-epic-state-vtQ66nN6.js → zeni-epic-state-DuQa9FMz.js} +3 -3
  102. package/dist/index.html +1 -1
  103. package/package.json +2 -2
  104. package/dist/assets/AddressRoutes-DvuqFlm5.js +0 -1
  105. package/dist/assets/CardsAiCfoScreen-BQXIEsXX.js +0 -14
  106. package/dist/assets/ChargeCardRoutes-CF9hoDo5.js +0 -71
  107. package/dist/assets/CompanyPassportScreen-Dd-P8T6z.js +0 -1
  108. package/dist/assets/ConnectionAuthScreen-BWQPD0qS.js +0 -11
  109. package/dist/assets/CustomerOnboardingAuthScreen-BycVZ7K6.js +0 -1
  110. package/dist/assets/DrawerScreen-BqYmVuny.js +0 -1
  111. package/dist/assets/EntityDetailRoutes-DbpAgwXS.js +0 -1
  112. package/dist/assets/HubSpotOAuthCallbackScreen-BAfTUuIq.js +0 -1
  113. package/dist/assets/MagicLinkRoutes-CGh8IMWW.js +0 -72
  114. package/dist/assets/MagicLinkSignInScreen-BFMyglUM.js +0 -12
  115. package/dist/assets/MobileAppDrawer-BuakBUGx.js +0 -1
  116. package/dist/assets/NotFoundScreen-AsC21qGx.js +0 -1
  117. package/dist/assets/OAuthConsentScreen-B6euKfvQ.js +0 -1
  118. package/dist/assets/PandLWithForecastRoutes-DfEV7guz.js +0 -1
  119. package/dist/assets/PeopleRoutes-qz_hXV4C.js +0 -22
  120. package/dist/assets/PerformanceRoutes-v5FcQW2N.js +0 -1
  121. package/dist/assets/ReimbursementApprovalRoutes-yvcY1FyR.js +0 -1
  122. package/dist/assets/RewardsRoutes-lnm6cAkX.js +0 -1
  123. package/dist/assets/ScreenRoutes-CAtz09zv.js +0 -2
  124. package/dist/assets/SignInScreen-Dhh5qz65.js +0 -1
  125. package/dist/assets/SignOutScreen-3sXSL_QM.js +0 -9
  126. package/dist/assets/TaskRoutes-CDomkVrp.js +0 -9
  127. package/dist/assets/WiseConfirmationScreen-B3-wTx7l.js +0 -12
  128. package/dist/assets/epic-Bmb0p0Me.js +0 -2
  129. package/dist/assets/getLocaleForTenant-C55KVru2.js +0 -1
  130. package/dist/assets/routePaths-Dq5U7lhs.js +0 -1
  131. package/dist/assets/useAskAiCfoHostNavButtonProps-uVGdd0zj.js +0 -1
  132. package/dist/assets/useCashManagementBanner-BB3WgTJ-.js +0 -1
  133. package/dist/assets/useEmailConnectResultRefresh-FRZ2xd4V.js +0 -1
@@ -1,5 +1,5 @@
1
- import{j as s}from"./liveblocks-evjZPqs_.js";import{a as o}from"./sentry-CCZGmBkl.js";import{j as f,h as L,u as _,g as F,n as V}from"./core-DmAftQ4g.js";import{m as W,Z as z,z as P,be as M,y as N,X as U,_ as $,x as X,c as l,e as q,a7 as Z,bf as G}from"./index-DsVH62ZK.js";import{fF as J,eW as K,Pj as R,Pk as Q,vE as Y,vu as g,fH as ee,bS as ae,vz as re,Pl as ne}from"./zeni-epic-state-vtQ66nN6.js";import{D as te,e as se,n as oe,S as ie}from"./mui-PcDpEhsm.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-uVGdd0zj.js";import{M as ce}from"./MobileAppDrawer-BuakBUGx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="9c11f605-c27a-4a80-b676-bd08165c1fdf",e._sentryDebugIdIdentifier="sentry-dbid-9c11f605-c27a-4a80-b676-bd08165c1fdf")}catch{}})();const de={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=W(),n=z();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>J(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(M,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-DC3GaKoW.js";import{a as o}from"./sentry-CuaXjR5n.js";import{j as f,h as L,u as V,g as W,n as F}from"./core-Bv1T7LZC.js";import{m as M,Z as _,z as P,be as N,x as U,T as $,X as z,w as G,d as l,f as J,a7 as X,bf as Z}from"./index-CwcEF-q7.js";import{fH as q,eW as K,Pk as R,Pl as Q,vG as Y,vw as g,fJ as ee,bS as ae,vB as re,Pm as ne}from"./zeni-epic-state-DuQa9FMz.js";import{D as te,e as se,n as oe,S as ie}from"./mui-VYhJrGDQ.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import{M as de}from"./MobileAppDrawer-PDN1hPUR.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="53bfac4e-2149-48ad-a708-7cf86edfb481",e._sentryDebugIdIdentifier="sentry-dbid-53bfac4e-2149-48ad-a708-7cf86edfb481")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=M(),n=_();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>q(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,I="refer-and-earn-status-update",we=V(function(e){const a=R(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(Z(G));function ye({isReferralDrawerOpen:e}){const a=L(),r=_(),n=F(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,E]=o.useState(!1),[k,C]=o.useState(!1),w=P.getSignedInUser(),h=f(t=>K(t)),m=f(t=>R(t)),v=m.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),b=Q([m,p]),{areTenantIdsInSync:d}=U();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(Y()),E(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&d&&(u(!0),r(g(!0)))},[v,r,d]),o.useEffect(()=>{!c&&p.fetchState==="Not-Started"&&d&&(x(!0),r(ee(!0)))},[p,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),y=t=>{A(t)},{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=le({mobileExploreReferrer:"Rewards"});$({isDataReady:b===!0});const O={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[b===!0?s.jsx(X,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(q.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:y}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...O})]})}export{ye as R};
5
+ `,I="refer-and-earn-status-update",we=F(function(e){const a=R(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(X(Z));function ye({isReferralDrawerOpen:e}){const a=L(),r=V(),n=W(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,C]=o.useState(!1),w=P.getSignedInUser(),h=f(t=>K(t)),m=f(t=>R(t)),v=m.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),b=Q([m,p]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(Y()),E(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&c&&(u(!0),r(g(!0)))},[v,r,c]),o.useEffect(()=>{!d&&p.fetchState==="Not-Started"&&c&&(x(!0),r(ee(!0)))},[p,r,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),y=t=>{A(t)},{isAiCfoAccessEnabled:B,onAskAiCfoClick:T}=le({mobileExploreReferrer:"Rewards"});z({isDataReady:b===!0});const O={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[b===!0?s.jsx(G,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(J.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:y}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:B,onAskAiCfoClick:T,...O})]})}export{ye as R};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-DC3GaKoW.js";import _ from"./NotFoundScreen-CKyavEYX.js";import{a as p}from"./sentry-CuaXjR5n.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as F,p as b}from"./core-Bv1T7LZC.js";import{eW as j,Qe as S,Qu as g,FB as V,EK as U,FA as c,Fr as B,QI as L,FD as O}from"./zeni-epic-state-DuQa9FMz.js";import{z as N,a7 as T,bZ as Q,af as $,bC as K,b_ as z}from"./index-CwcEF-q7.js";import"./mui-VYhJrGDQ.js";import{u as Z,R as A}from"./ReimbursementApprovalRuleDetailScreen-77M2HLZ2.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]="d607cb5d-9801-4458-8729-67da54eb8faa",e._sentryDebugIdIdentifier="sentry-dbid-d607cb5d-9801-4458-8729-67da54eb8faa")}catch{}})();const y="reimbursement-approval-rule-update",q=k(function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:g(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(L(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))}}})(T(Q)),G=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>j(a)),d=u(a=>S(a)),v=u(a=>g(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(h(!0),n(c())),o("./new"))},[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,R)=>{a.endsWith(y)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:l,location:s,navigate:o,...w})},I="reimbursement-approval-rule-update",H=k(function(e){const o=S(e),s=g(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e(L(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))},onReorderRules:t=>{e(O(t,!0))}}})(T(z)),J=()=>{const e=u(n=>j(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(G,{isLoading:s})},M=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>j(a)),d=u(a=>S(a));Z();const v=u(a=>g(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(h(!0),n(c())),o("./new"))},[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${I}`]:[],eventCallback:(a,W,R)=>{a.endsWith(I)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(F,{children:[r.jsx(b,{path:"/",element:r.jsx(J,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as b}from"./liveblocks-evjZPqs_.js";import{a as f}from"./sentry-CCZGmBkl.js";import{u as T,j as g,h as _,g as O,i as F,n as k}from"./core-DmAftQ4g.js";import{kX as L,Qt as w,Qd as C,Ft as V,FF as B,FA as A,FB as E,Qu as j,eW as z,Fz as W}from"./zeni-epic-state-vtQ66nN6.js";import{z as P,m as N,B as Q,bP as K,af as $,bC as X,bQ as G}from"./index-DsVH62ZK.js";import"./mui-PcDpEhsm.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]="f508ecbd-bc24-41e4-8e12-23eb16b10570",e._sentryDebugIdIdentifier="sentry-dbid-f508ecbd-bc24-41e4-8e12-23eb16b10570")}catch{}})();function H(){const e=T(),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 J=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(K);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.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,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(W(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=X(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(M,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as b}from"./liveblocks-DC3GaKoW.js";import{a as f}from"./sentry-CuaXjR5n.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-Bv1T7LZC.js";import{kZ as L,Qu as w,Qe as C,Fu as V,FG as B,FB as A,FC as E,Qv as j,eW as W,FA as z}from"./zeni-epic-state-DuQa9FMz.js";import{z as P,m as N,B as Q,bP as G,af as $,bC as K,bQ as Z}from"./index-CwcEF-q7.js";import"./mui-VYhJrGDQ.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]="4229f5e7-10b5-4b17-9b34-10d864fffc7e",e._sentryDebugIdIdentifier="sentry-dbid-4229f5e7-10b5-4b17-9b34-10d864fffc7e")}catch{}})();function H(){const e=T(),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 J=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(G);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const X=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.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,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(Z);function ne(){const e=g(t=>W(t)),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?b.jsx(Y,{}):b.jsx(M,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-evjZPqs_.js";import{h as W,u as re,g as H,i as X,j as E,N as _,n as K,l as mt,o as ct,p as C}from"./core-DmAftQ4g.js";import{eW as Z,QI as le,c6 as me,EE as Be,kG as dt,ER as ne,EQ as ae,QJ as ut,bn as ce,gn as Te,QK as pt,N5 as bt,kv as Fe,N6 as Se,N7 as gt,jq as ht,P$ as ft,jF as St,Es as It,u9 as Rt,jx as yt,Fc as je,QL as De,QM as At,QN as kt,QO as vt,QP as Ct,QQ as Et,EY as Ie,jL as wt,Q8 as xt,ES as Bt,EC as Tt,QR as Ft,EB as jt,QS as Dt,EK as Re,F0 as Ut,E$ as Lt,EX as Pt,QT as Ue,Kb as $t,bq as Mt,EN as _t,Fu as Nt,QU as Qt,QV as Ot,F8 as zt,F5 as ye,Pu as Gt,Ez as Ht,QW as Le,FW as Ae,G2 as Zt,QX as Vt,QY as z,QZ as Wt,Q_ as Pe,Q$ as Kt,R0 as $e,R1 as Me,Fk as se,bu as qt,bK as de,cG as ue,fB as _e,fz as Ne,R2 as Jt,fw as Xt,PH as Yt,R3 as en,R4 as Qe,PL as tn,Qt as nn,R5 as an,QH as sn,F$ as ke,F_ as on,R6 as rn,R7 as ln,R8 as mn,R9 as cn,Ra as dn,Qe as un,FR as pn,FV as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LV as Rn,cQ as yn,cS as An,cR as kn,cz as vn}from"./zeni-epic-state-vtQ66nN6.js";import{v as Oe,Z as ze,W as Y,U as k,z as $,b$ as Ge,x as ee,c as v,aK as ve,o as j,au as J,C as Cn,O as He,c0 as En,q as G,_ as Ze,c1 as wn,I as te,c2 as xn,X as Bn,y as Tn,B as pe,e as Ve,a7 as Fn,bn as jn,a2 as Dn,m as We,c3 as Un,a9 as Ln}from"./index-DsVH62ZK.js";import{n as N,S as Pn}from"./mui-PcDpEhsm.js";import ie from"./NotFoundScreen-AsC21qGx.js";import{S as Ce}from"./SetupPagesScreen-BkPb95y9.js";import{F as Ke}from"./FeaturePreviewScreen-kp5WtNsg.js";import{a as f}from"./sentry-CCZGmBkl.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-uVGdd0zj.js";import{u as qe}from"./useInitialThreadRequest-D9ebiXdA.js";import{D as $n}from"./DrawerScreen-BqYmVuny.js";import{M as Je}from"./MobileAppDrawer-BuakBUGx.js";import{R as Mn}from"./ReimbursementApprovalRoutes-yvcY1FyR.js";import{FallBackRoute as _n}from"./ScreenRoutes-CAtz09zv.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./analyticsHelper-CQXeRvKo.js";import"./routePaths-Dq5U7lhs.js";import"./BusinessVerificationPageScreen-HLhTZBjl.js";import"./ReimbursementApprovalRuleDetailScreen-s9Cc-PAW.js";import"./getLocaleForTenant-C55KVru2.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]="5316dca9-0939-4498-ae2d-24fe5defa88c",e._sentryDebugIdIdentifier="sentry-dbid-5316dca9-0939-4498-ae2d-24fe5defa88c")}catch{}})();const Xe=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Qn=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Re(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Re(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(De()),e(At());const i=Xe(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=W(),t=re(),n=H(),{reimbursementId:r}=X(),d=Oe(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,F=w.includes("edit"),A=w.includes("reimbursement/new"),[D,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>Z(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,y,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ge,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Qn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=N.div`
1
+ import{j as s}from"./liveblocks-DC3GaKoW.js";import{h as V,u as re,g as Z,i as X,j as E,N as _,n as K,l as mt,o as ct,p as C}from"./core-Bv1T7LZC.js";import{eW as H,QJ as le,c6 as me,EF as Be,kI as dt,ES as ne,ER as ae,QK as ut,bn as ce,gp as Te,QL as pt,N6 as bt,kx as Fe,N7 as Se,N8 as gt,js as ht,Q0 as ft,jH as St,Et as It,ub as Rt,jz as yt,Fd as je,QM as De,QN as At,QO as vt,QP as kt,QQ as Ct,QR as Et,EZ as Ie,jN as wt,Q9 as xt,ET as Bt,ED as Tt,QS as Ft,EC as jt,QT as Dt,EL as Re,F1 as Ut,F0 as Lt,EY as Pt,QU as Ue,Kc as $t,bq as Mt,EO as _t,Fv as Nt,QV as Ot,QW as Qt,F9 as zt,F6 as ye,Pv as Gt,EA as Zt,QX as Le,FX as Ae,G3 as Ht,QY as Wt,QZ as z,Q_ as Vt,Q$ as Pe,R0 as Kt,R1 as $e,R2 as Me,Fl as se,bu as qt,bK as de,cG as ue,fD as _e,fB as Ne,R3 as Jt,fy as Xt,PI as Yt,R4 as en,R5 as Oe,PM as tn,Qu as nn,R6 as an,QI as sn,G0 as ve,F$ as on,R7 as rn,R8 as ln,R9 as mn,Ra as cn,Rb as dn,Qf as un,FS as pn,FW as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LW as Rn,cQ as yn,cS as An,cR as vn,cz as kn}from"./zeni-epic-state-DuQa9FMz.js";import{r as Qe,Z as ze,W as Y,U as v,z as $,b$ as Ge,w as ee,d as k,aK as ke,o as j,au as J,A as Cn,a as Ze,c0 as En,n as G,X as He,c1 as wn,I as te,c2 as xn,T as Bn,x as Tn,B as pe,f as We,a7 as Fn,bn as jn,a2 as Dn,m as Ve,c3 as Un,a9 as Ln}from"./index-CwcEF-q7.js";import{n as N,S as Pn}from"./mui-VYhJrGDQ.js";import ie from"./NotFoundScreen-CKyavEYX.js";import{S as Ce}from"./SetupPagesScreen-CrjLDbOm.js";import{F as Ke}from"./FeaturePreviewScreen-D4Ah53J7.js";import{a as f}from"./sentry-CuaXjR5n.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import{u as qe}from"./useInitialThreadRequest-BsceBU6n.js";import{D as $n}from"./DrawerScreen-DaMuYUCn.js";import{M as Je}from"./MobileAppDrawer-PDN1hPUR.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DFKDTo2d.js";import{FallBackRoute as _n}from"./ScreenRoutes-DvRF1Ugr.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";import"./analyticsHelper-d524teZu.js";import"./routePaths-CjJlLbxf.js";import"./BusinessVerificationPageScreen-DMq3tKTs.js";import"./ReimbursementApprovalRuleDetailScreen-77M2HLZ2.js";import"./getLocaleForTenant-DTwWZ3TG.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]="30298bcb-31eb-4ad9-9307-5bc1098ca6d1",e._sentryDebugIdIdentifier="sentry-dbid-30298bcb-31eb-4ad9-9307-5bc1098ca6d1")}catch{}})();const Xe=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Re(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Re(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(De()),e(At());const i=Xe(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=V(),t=re(),n=Z(),{reimbursementId:r}=X(),d=Qe(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(v.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,F=w.includes("edit"),A=w.includes("reimbursement/new"),[D,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>H(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,y,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ge,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(ee,{analytics:k,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-evjZPqs_.js";import{h as W,u as re,g as H,i as X
22
22
  display: flex;
23
23
  background-color: transparent;
24
24
  overflow: hidden;
25
- `,Hn=N.div`
25
+ `,Zn=N.div`
26
26
  position: fixed;
27
27
  top: 0;
28
28
  left: 0;
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-evjZPqs_.js";import{h as W,u as re,g as H,i as X
33
33
  flex-direction: column;
34
34
  overflow-y: auto;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- `,Zn=N.button`
36
+ `,Hn=N.button`
37
37
  align-self: flex-end;
38
38
  background: none;
39
39
  border: none;
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-evjZPqs_.js";import{h as W,u as re,g as H,i as X
48
48
  width: ${j.sp4};
49
49
  height: ${j.sp4};
50
50
  }
51
- `,Vn=N.div`
51
+ `,Wn=N.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Wn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=$.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Qt(n.remiActivities,Ot(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(De());const a=Xe(o),i=G(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Ht(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(ye(n,a.type,"")):e(ye(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=G(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=W(),t=re(),n=H(),r=n.hash.substring(1),d=Oe(),{reimbursementId:c}=X(),m=$.getSignedInUser(),o=E(R=>Z(R)),a=E(R=>Ue(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=be({mobileExploreReferrer:"Reimbursement Details"});Ze({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[F,A]=f.useState(!1),[D,x]=f.useState(!1),{isFeatureEnabled:B}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(R=>le(R,c??"")),P=$t(o),U=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&P===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,P,m]),f.useEffect(()=>{F||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[F,a,c,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(_,{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(Ge,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Zt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(xn);function Jn(){const e=W(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const O=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:we}=He.getLocalizedStrings(),xe=Xn.reimbursement.bulkActions,Yn=N.div`
56
+ `,Vn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=$.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Qt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(De());const a=Xe(o),i=G(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(ye(n,a.type,"")):e(ye(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=G(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=V(),t=re(),n=Z(),r=n.hash.substring(1),d=Qe(),{reimbursementId:c}=X(),m=$.getSignedInUser(),o=E(R=>H(R)),a=E(R=>Ue(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=be({mobileExploreReferrer:"Reimbursement Details"});He({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(v.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[F,A]=f.useState(!1),[D,x]=f.useState(!1),{isFeatureEnabled:B}=h(v.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(v.isShowDeletedReimbursementsFeatureEnabled),g=E(R=>le(R,c??"")),P=$t(o),U=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&P===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,P,m]),f.useEffect(()=>{F||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[F,a,c,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(_,{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(Ge,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Vn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(xn);function Jn(){const e=V(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:k,isAdmin:d})}const Q=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:we}=Ze.getLocalizedStrings(),xe=Xn.reimbursement.bulkActions,Yn=N.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-evjZPqs_.js";import{h as W,u as re,g as H,i as X
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ea=K(function(e,t){const n=Me(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=Z(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:O,spendManagementEndPoint:`${Dn}/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:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Pe(o))},onSubtabChange:o=>{e(z()),e($e(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=G(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=G(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=G(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(Fn(jn));function ta(){const e=W(),t=re(),n=H(),r=n.state,d=ze(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Pe(S)):console.log("Warning:Not a valid remiListTab");const Q=Kt(r.subTab.toString());Q!=null?t($e(Q)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=E(S=>Z(S)),[w,F]=f.useState(!1),[A,D]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Me(S,O,h)),{areTenantIdsInSync:g}=Bn(),P=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(Ze({isDataReady:P==="Completed"}),f.useEffect(()=>{!A&&g&&(D(!0),t(se(O,!0,l,!1,!0)))},[A,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=de(x?.loggedInUserRoleMap),V=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{F(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=_e(it,u),rt=Ne(u),{remisProcessed:q,remisProcessing:he}=E(S=>Jt(S));f.useEffect(()=>{q===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?xe.reports:xe.report},{variableName:"_has_",variableValue:q>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(O,!0,l,!1,!0,!0))},3e3),m(null))},[q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,Q,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):Q.entity_type==="reimbursement"&&(m(Q.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ke,{}):tt&&(!R||p)||V&&et?s.jsxs(s.Fragment,{children:[P==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(Q=>Q.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Je,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:O,isAdmin:B,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:M,...lt})]})]}):nt&&p?s.jsx(_,{to:"../setup"}):x!=null&&Qe(u,x.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
64
+ `,ea=K(function(e,t){const n=Me(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:Q,spendManagementEndPoint:`${Dn}/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:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Pe(o))},onSubtabChange:o=>{e(z()),e($e(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=G(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=G(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=G(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ve("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ve("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(Fn(jn));function ta(){const e=V(),t=re(),n=Z(),r=n.state,d=ze(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Vt(r.tab.toString());S!=null?t(Pe(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t($e(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(v.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(v.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(v.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=E(S=>H(S)),[w,F]=f.useState(!1),[A,D]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Me(S,Q,h)),{areTenantIdsInSync:g}=Bn(),P=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(He({isDataReady:P==="Completed"}),f.useEffect(()=>{!A&&g&&(D(!0),t(se(Q,!0,l,!1,!0)))},[A,Q,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=de(x?.loggedInUserRoleMap),W=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{F(S)},{isFeatureEnabled:it}=a(v.isDebitCardFeatureEnabled),ot=_e(it,u),rt=Ne(u),{remisProcessed:q,remisProcessing:he}=E(S=>Jt(S));f.useEffect(()=>{q===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?xe.reports:xe.report},{variableName:"_has_",variableValue:q>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(Q,!0,l,!1,!0,!0))},3e3),m(null))},[q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,O,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ke,{}):tt&&(!R||p)||W&&et?s.jsxs(s.Fragment,{children:[P==="Completed"?s.jsx(ee,{analytics:k,onLoad:S=>(O=>O.trackPageLoaded(We.Event.reimbursementHome))(S)}):null,s.jsx(Je,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Q,isAdmin:B,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:M,...lt})]})]}):nt&&p?s.jsx(_,{to:"../setup"}):x!=null&&Oe(u,x.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=H(),{tenantEmailDomain:n}=X(),r=We(),[d,c]=f.useState(!1),m=E(A=>Z(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),y=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,F=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):w&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(D=>D.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Je,{isAppContentDrawerOpen:d,handleDrawerToggle:F}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{F(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(V=>Z(V)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=_e(a,e),l=Ne(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:F}=m(k.isDepositAccountsFeatureEnabled),A=F&&!b&&Sn(t?.loggedInUserRoleMap),D=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),B=yn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),P=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=X(),R=H(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[R.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:D,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:D,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:w?s.jsx(Mn,{}):s.jsx(_n,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:P,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:M??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&Qe(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):R.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
68
+ `,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:k,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=V(),t=Z(),{tenantEmailDomain:n}=X(),r=Ve(),[d,c]=f.useState(!1),m=E(A=>H(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),y=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,F=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):w&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:A=>(D=>D.trackPageLoaded(We.Event.reimbursementPromoPage))(A)}),s.jsx(Je,{isAppContentDrawerOpen:d,handleDrawerToggle:F}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{F(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>H(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ve(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=_e(a,e),l=Ne(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:F}=m(v.isDepositAccountsFeatureEnabled),A=F&&!b&&Sn(t?.loggedInUserRoleMap),D=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),B=yn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),P=kn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=X(),R=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[R.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:D,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:D,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:w?s.jsx(Mn,{}):s.jsx(_n,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:P,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:M??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):R.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-evjZPqs_.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-DmAftQ4g.js";import{eW as v,fQ as w,Mm as Te,kv as W,qP as X,rE as A,kj as Re,jn as Me,v8 as K,rJ as Oe,bs as Ae,Mn as Fe,bn as ke,wh as De,Mo as je,Mp as Ee,v0 as Pe,Mq as H,Mr as ve,Ms as Le,Mt as Be,Mu as Ve,Mv as I,Mw as F,Mx as k,My as N,Mz as D,MA as j,dJ as Ue,vZ as xe,vN as q,vO as $,w3 as ze,vS as Z,w9 as Ge,MB as Ye,MC as He,MD as Ne,ME as qe,MF as $e,fB as Ze,fz as Qe}from"./zeni-epic-state-vtQ66nN6.js";import{N as Je,Q as We,R as Xe,V as Ke,Z as ea,W as ee,U as E,z as ae,X as aa,I as sa,a as ta,Y as oa,_ as na,x as ra,c as P,e as ia,$ as la,q as se,a0 as ca,a1 as da,a2 as pa}from"./index-DsVH62ZK.js";import"./mui-PcDpEhsm.js";import fa from"./NotFoundScreen-AsC21qGx.js";import{F as ma}from"./FeaturePreviewScreen-kp5WtNsg.js";import{a as _}from"./sentry-CCZGmBkl.js";import{u as ua}from"./useInitialThreadRequest-D9ebiXdA.js";import{t as Q,a as J,b as _a}from"./routePaths-Dq5U7lhs.js";import{M as ba}from"./MobileAppDrawer-BuakBUGx.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.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]="a941a05f-92ab-44db-aebe-8bbf0f3e8fb2",e._sentryDebugIdIdentifier="sentry-dbid-a941a05f-92ab-44db-aebe-8bbf0f3e8fb2")}catch{}})();const ha=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},ga=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:W(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:b}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>W(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),h=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&b&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,b]),_.useEffect(()=>{i&&!L&&C==="Completed"&&b&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,b]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(h.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(h.timeframe));break;case"cash_flow":s(Re(h.timeframe))}},[i,R,O,b,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:be}=G(),z=Je(be??"")==="reports",he=We(_e),ye=_.useMemo(()=>z?ha:void 0,[z]);Xe({canFetchSuggestedQuestions:he,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ba,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-DC3GaKoW.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-Bv1T7LZC.js";import{eW as v,fS as w,Mn as Te,kx as Z,qR as X,rG as A,kl as Re,jp as Me,va as K,rL as Oe,bs as Ae,Mo as Fe,bn as ke,wj as De,Mp as je,Mq as Ee,v2 as Pe,Mr as H,Ms as ve,Mt as Le,Mu as Be,Mv as Ue,Mw as I,Mx as F,My as k,Mz as N,MA as D,MB as j,dJ as Ve,v$ as xe,vP as q,vQ as $,w5 as ze,vU as J,wb as Ge,MC as Ye,MD as He,ME as Ne,MF as qe,MG as $e,fD as Je,fB as Qe}from"./zeni-epic-state-DuQa9FMz.js";import{J as We,K as Ze,M as Xe,O as Ke,Z as ea,W as ee,U as E,z as ae,T as aa,I as sa,c as ta,V as oa,X as na,w as ra,d as P,f as ia,Y as la,n as se,a0 as ca,a1 as da,a2 as pa}from"./index-CwcEF-q7.js";import"./mui-VYhJrGDQ.js";import fa from"./NotFoundScreen-CKyavEYX.js";import{F as ma}from"./FeaturePreviewScreen-D4Ah53J7.js";import{a as _}from"./sentry-CuaXjR5n.js";import{u as ua}from"./useInitialThreadRequest-BsceBU6n.js";import{t as Q,a as W,b as _a}from"./routePaths-CjJlLbxf.js";import{M as ha}from"./MobileAppDrawer-PDN1hPUR.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.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]="67ceabe5-afc2-48a3-a4b8-c35c32b976f2",e._sentryDebugIdIdentifier="sentry-dbid-67ceabe5-afc2-48a3-a4b8-c35c32b976f2")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},ga=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Z(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(J({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(J(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),U=d(n=>Z(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Ae(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Ze(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Je(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-DC3GaKoW.js";import{W as w,z as x,aQ as b,w as I,d as p,f as F,d6 as P,U as T}from"./index-CwcEF-q7.js";import"./mui-VYhJrGDQ.js";import m from"./NotFoundScreen-CKyavEYX.js";import{a as f}from"./sentry-CuaXjR5n.js";import{u as L,j as y,h as V,g as U,n as A,o as R,p as u}from"./core-Bv1T7LZC.js";import{eW as z,TB as C,PV as G,TC as v,vG as W,fJ as Y,TD as B,vE as J}from"./zeni-epic-state-DuQa9FMz.js";import{R as j}from"./ReferralListScreen-CXBkdn17.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";import"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import"./MobileAppDrawer-PDN1hPUR.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="db07615f-2a6c-457a-9049-cbc41fb87ff9",a._sentryDebugIdIdentifier="sentry-dbid-db07615f-2a6c-457a-9049-cbc41fb87ff9")}catch{}})();const O=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=x.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(J())},onUpdateInviteFormLocalData:s=>{a(B({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),Q=()=>{const a=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=y(o=>z(o)),c=V(),D=U(),{useDynamicConfig:g}=w(),d=x.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=y(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:k}=g(b.zeniAccountsConfig),N=G(k);f.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(W()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(Y(!0)))},[l.fetchState,a]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(O,{navigate:c,location:D,currentTenant:r,companyName:S,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=w(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(R,{children:[e.jsx(u,{path:"/",element:t?e.jsx(j,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(j,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(Q,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BCVeePc3.js","assets/sentry-CuaXjR5n.js","assets/core-Bv1T7LZC.js","assets/zeni-epic-state-DuQa9FMz.js","assets/index-CwcEF-q7.js","assets/mui-VYhJrGDQ.js","assets/analytics-Bqx0zRxd.js","assets/utils-DPYDOv00.js","assets/withTransactionSidePanel-BzY2xiGY.js","assets/useAskAiCfoHostNavButtonProps-XSnEPSCB.js","assets/TransactionDetailScreen-CWpk0UU1.js","assets/decodeURIComponentSafe-CgJ-EbJc.js","assets/routePaths-CjJlLbxf.js","assets/NotFoundScreen-CKyavEYX.js","assets/useInitialThreadRequest-BsceBU6n.js","assets/analyticsHelper-d524teZu.js","assets/CompanyPassportScreen-DMJdNz2u.js","assets/MobileAppDrawer-PDN1hPUR.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BQUVbUQb.js","assets/FeaturePreviewScreen-D4Ah53J7.js","assets/ReferralListScreen-CXBkdn17.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-7zp9D6x8.js","assets/AddressScreen-GAHyIX-c.js","assets/DomesticWireDetailScreen-WRSPX-4X.js","assets/DrawerScreen-DaMuYUCn.js","assets/SetupPagesScreen-CrjLDbOm.js","assets/BusinessVerificationPageScreen-DMq3tKTs.js","assets/BillPayApprovalRoutes-BglCJxi-.js","assets/ReimbursementApprovalRuleDetailScreen-77M2HLZ2.js","assets/getLocaleForTenant-DTwWZ3TG.js","assets/ReimbursementRoutes-YhP6hHRt.js","assets/ReimbursementApprovalRoutes-DFKDTo2d.js","assets/TransactionListRoutes-lHRZBvxi.js","assets/ZeniAccountStatementScreen-DEwEWZ2Q.js","assets/SettingsRoutes-xpOSQOkw.js","assets/accountMappingHelper-BPzhOzDQ.js","assets/QBOConnectionScreen-BDzJBSaJ.js","assets/empty-BGU_c4p_.js","assets/index-B-VkC3pW.js","assets/url-DXrWvdUh.js","assets/index-Bgxmla6x.js","assets/useEmailConnectResultRefresh-iMxOBvVh.js","assets/ReportsRoutes-wzqHii7q.js","assets/ChargeCardRoutes-CMdGvjPJ.js","assets/useChargeCardPusherEvents-DWEn28bl.js","assets/PeopleRoutes-84yTwmWw.js","assets/ExpenseAutomationRoutes-BMNILnav.js","assets/TreasuryRoutes-C4iGPRK3.js","assets/useCashManagementBanner-Cqvytrqk.js","assets/VendorsRoutes-7KkgbfcW.js","assets/pathToGoBack-BPhnwklb.js","assets/ZeniAccountRoutes-pWTshbAJ.js","assets/AddressRoutes-DiGYiZdH.js","assets/PandLWithForecastRoutes-BCTBlqwg.js","assets/CustomerOnboardingRoutes-DfaM8hGj.js","assets/TransactionDetailRoutes-2AtDo3dT.js","assets/EntityDetailRoutes-Bcvb-t4n.js","assets/NotificationRoutes-BP3RNHOU.js","assets/PerformanceRoutes-BQUXWKZE.js","assets/RewardsRoutes-DfmbXNc8.js","assets/TaskRoutes-dkq9ikjL.js","assets/TaskListScreen-Cs7VLiUm.js","assets/AiCfoScreen-D2sAwMZS.js","assets/CardsAiCfoScreen--ED2OEzt.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bn as is,eW as rs,fD as os,fB as ls,fC as cs,gk as ds,fq as ms,cT as ge,cA as us,fT as _s,cs as ps,bE as As,bo as Es,fY as gs,v as xs,LV as Is,bs as Ts,LW as js,bK as hs,fV as Us,bJ as Rs,bt as Hs,co as Ds,LX as ys,LY as bs,cQ as fs,cS as Cs,cR as vs,cz as Os,cG as Ps,o9 as xe,fz as Ie,gu as Fs,g0 as Te,gr as je,gs as he,g1 as Ls}from"./zeni-epic-state-DuQa9FMz.js";import{j as e}from"./liveblocks-DC3GaKoW.js";import{a as v}from"./sentry-CuaXjR5n.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Ue,N as c,o as Ns,p as t}from"./core-Bv1T7LZC.js";import{m as Ms,u as Zs,z as H,W as ws,c as zs,s as Gs,U as B,I as $s,L as F,a as Re,t as _,P as Ws,d as ee,l}from"./index-CwcEF-q7.js";import"./mui-VYhJrGDQ.js";import{f as He}from"./analyticsHelper-d524teZu.js";import{t as Ys}from"./getLocaleForTenant-DTwWZ3TG.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="485258e9-d864-47c1-ad6f-376a2d49a0c9",i._sentryDebugIdIdentifier="sentry-dbid-485258e9-d864-47c1-ad6f-376a2d49a0c9")}catch{}})();const qs={dashboard:()=>a(()=>import("./DashboardRoutes-BCVeePc3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-7zp9D6x8.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-YhP6hHRt.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-lHRZBvxi.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-xpOSQOkw.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-wzqHii7q.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-CMdGvjPJ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>a(()=>import("./PeopleRoutes-84yTwmWw.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-BMNILnav.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-C4iGPRK3.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-7KkgbfcW.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-pWTshbAJ.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],se=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>a(()=>import("./ReportsRoutes-wzqHii7q.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Qs=l(()=>a(()=>import("./AddressRoutes-DiGYiZdH.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>a(()=>import("./PeopleRoutes-84yTwmWw.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),ea=l(()=>a(()=>import("./PandLWithForecastRoutes-BCTBlqwg.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),sa=l(()=>a(()=>import("./CustomerOnboardingRoutes-DfaM8hGj.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,42,45,21]))),aa=l(()=>a(()=>import("./VendorsRoutes-7KkgbfcW.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),na=l(()=>a(()=>import("./TransactionDetailRoutes-2AtDo3dT.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>a(()=>import("./EntityDetailRoutes-Bcvb-t4n.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),ta=l(()=>a(()=>import("./DashboardRoutes-BCVeePc3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),ye=l(()=>a(()=>import("./BillPayRoutes-7zp9D6x8.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ia=l(()=>a(()=>import("./SettingsRoutes-xpOSQOkw.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21]))),be=l(()=>a(()=>import("./ReimbursementRoutes-YhP6hHRt.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ra=l(()=>a(()=>import("./ZeniAccountRoutes-pWTshbAJ.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),oa=l(()=>a(()=>import("./TreasuryRoutes-C4iGPRK3.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),la=l(()=>a(()=>import("./TransactionListRoutes-lHRZBvxi.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ca=l(()=>a(()=>import("./ChargeCardRoutes-CMdGvjPJ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),da=l(()=>a(()=>import("./NotificationRoutes-BP3RNHOU.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ma=l(()=>a(()=>import("./PerformanceRoutes-BQUXWKZE.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),ua=l(()=>a(()=>import("./ExpenseAutomationRoutes-BMNILnav.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_a=l(()=>a(()=>import("./RewardsRoutes-DfmbXNc8.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),pa=l(()=>a(()=>import("./TaskRoutes-dkq9ikjL.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Aa=l(()=>a(()=>import("./AiCfoScreen-D2sAwMZS.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>a(()=>import("./CardsAiCfoScreen--ED2OEzt.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>a(()=>import("./NotFoundScreen-CKyavEYX.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ea=l(()=>a(()=>import("./TaskListScreen-Cs7VLiUm.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Na({setTenantEmailDomain:i}){const U=ks(),V=Bs(),{tenantEmailDomain:o}=Vs(),S=Ms().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Zs(),b=H.getSignedInUserTenant(o)?.tenantId,j=H.getSignedInUser(),ae=is(j),$=Ss(),[N,ve]=v.useState(!1),r=G(n=>rs(n)),{useFeatureGate:L}=ws(),w=zs(),ne=Gs(),{isFeatureEnabled:Oe}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Fe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),A=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||h==="Completed"?os(te,r):void 0,W=A==="Completed"||h==="Completed"?ls(r):void 0,Le=A==="Completed"||h==="Completed"?cs(r):void 0,ke=Fe||te||!!Le||!!W||!!u,{isFeatureEnabled:Be}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:K}=L(B.isAiCfoFileUploadEnabled),Y=G(n=>ds(n));if(o!=null){const n=H.getSignedInUserTenant(o);j!=null&&n!=null&&He(j,r,S)}const z={tenantId:b,userId:j?.userId,sessionId:j?.zeniSessionId},ie=ms(),p=$s(),Ve=r.company==null||p?.loggedInUserRoleMap!=null&&ge(p.loggedInUserRole),Se=us(p?.loggedInUserRoleMap),re=v.useRef(!0),oe=Ue("/:tenantEmailDomain/onboarding/*")!==null,Q=Ue("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=G(n=>z.tenantId!=null?_s(n,z.tenantId):void 0);v.useEffect(()=>{f(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&b!=null){const n=Q.params.selectedPeriod;if(n!=null){const R=n.split("-");if(R.length===2){const d=ps(Number(R[0])),s=Number(R[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Es();m.isAfter(M,"month")===!1?U(gs(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,b]),v.useEffect(()=>{N||(ve(!0),f(F.TENANT_FETCHING)),re.current?re.current=!1:!xs(ie,z)&&H.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,R,d,s){if(Ie(R?.userId,R?.zeniSessionId,n.tenantId),d(Fs(!0)),d(Te(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&Re.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?ee.identify(n.userId,{tenant_id:n.tenantId}):ee.resetUserIdentity()}(z,j,U,Ne))},[z,ie,j,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,R,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,as=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(q&&as){k(Te(s));const J=H.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(J?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)))}else q&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),q&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)));if(q){ee.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(R==="Completed"||R==="Error");n==="Completed"||R!=="Not-Started"&&R!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(F.TENANT_FETCHING),k(Ls(m.userId,s,m.zeniSessionId))),J&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,A,r,b,j,f,U))},[b,A]),v.useEffect(()=>{H.isSignedIn()&&h==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(F.TENANT_FETCHING),H.saveSignedInUserTenants(Is(Y.tenantsBaseInOrder)),j!=null&&He(j,r,S,void 0,Y.tenantsBaseInOrder))},[Y,h,r,j]),v.useEffect(()=>{A==="In-Progress"&&f(F.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):A==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(F.TENANT_FETCHING),Z(F.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[A,h,b,N]);const le=v.useRef(!1);v.useEffect(()=>{!le.current&&A==="Completed"&&N&&(le.current=!0,function(n=Js,R=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=qs[m];M!=null?M().then(()=>se(()=>d(s+1))).catch(()=>se(()=>d(s+1))):d(s+1)};se(()=>d(0))},R)}())},[A,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Me}=L(B.isReferralFeatureEnabled),Ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),we=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&ge(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,de=ke&&!C,ze=js(p?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,me=r.company?.companyOnboardingInfo.isOnboardingCompleted,ue=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,_e=ue&&hs(p?.loggedInUserRoleMap),pe=Oe&&!C,$e=r.company!=null&&Us(r.company),We=Pe&&$e===!0&&!C,Ye=ce&&Rs(p?.loggedInUserRoleMap),qe=de&&Hs(p?.loggedInUserRoleMap),Je=pe&&Ds(p?.loggedInUserRoleMap),Ke=ys(p?.loggedInUserRoleMap),Qe=bs(p?.loggedInUserRoleMap),E=fs(p?.loggedInUserRoleMap),g=Cs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),I=Os(p?.loggedInUserRoleMap),T=Ps(p?.loggedInUserRoleMap),Ae=ce&&I,Ee=ue&&T,Xe=pe&&E,es=We&&g,X=de&&x,ss=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||ze===!0||Ke===!0||Qe===!0;return H.isSignedIn()?b==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||h==="Completed"?(me===!0||ae&&!oe)&&Ge===!1&&u===!1&&W===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||me!==!1||oe||ae?N&&r?.userRole&&u!=null&&W!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(ga,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:W})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(ta,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Ks,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ss||P?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(ea,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(sa,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Ze||we?e.jsx(na,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(la,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(De,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ea,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:Ye||_e||Je||qe?e.jsx(Qs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Xe?e.jsx(ra,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:es?e.jsx(oa,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ne===!0?e.jsx(ma,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ne===!0&&C===!1?e.jsx(ua,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(da,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(aa,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:Ae?e.jsx(ye,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ae?e.jsx(ye,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(ia,{hasAdminLevelAccess:_e}):e.jsx(y,{})}),e.jsx(t,{path:"cards/ask",element:X&&w?e.jsx(fe,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:X&&w?e.jsx(fe,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:X?e.jsx(ca,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Me?e.jsx(_a,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(Aa,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const ga=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ja,{tenantEmailDomain:O}):S?e.jsx(Ta,{tenantEmailDomain:O}):U?e.jsx(ha,{tenantEmailDomain:O}):V?e.jsx(Ia,{tenantEmailDomain:O}):o?e.jsx(xa,{tenantEmailDomain:O}):e.jsx(y,{}),xa=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Ia=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Ce=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,Na as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBkl.js";import{h as V,g as Q,u as T,j as h,s as ce,n as $,i as G,o as J,p as A}from"./core-DmAftQ4g.js";import{bn as je,eW as M,gn as Pe,mZ as le,Od as Me,hD as he,O4 as De,qP as Ue,kv as fe,mV as Te,hF as _e,O6 as Re,O5 as Be,Qv as Fe,zf as Oe,EJ as Ve,Q4 as ze,Qd as Le,c6 as ee,cL as Ne,cM as Qe,M4 as $e,Qw as Ge,M5 as Ke,xH as He,Qx as Ze,H8 as We,Ep as qe,Eg as be,Ed as Je,xL as Se,Ej as ye,Em as Ce,Es as ne,u9 as te,xK as Xe,k7 as X,ka as Ie,Qy as Ye,lb as en,x_ as nn,M_ as tn,M$ as an,k5 as on,Qz as sn,k8 as cn,rh as ln,MV as rn,MW as dn,rl as un,ho as pn,Md as q,hg as re,hd as gn,hl as mn,Me as hn,xX as fn,QA as bn,QB as Sn,EG as yn,fz as xe,fB as Ee,QC as Cn,gb as In,Mn as xn,xW as de,gg as ue,gf as En,xV as An,ge as vn,gd as wn,QD as kn,fE as Ae,QE as jn,QF as Pn,y1 as Mn,xU as pe,QG as Dn,fV as Un,xR as Tn,bZ as _n,c5 as Rn,c4 as Bn,b_ as Fn,c2 as On,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-vtQ66nN6.js";import{W as ae,U as R,z as j,af as ve,bR as Qn,c as W,e as $n,bC as Gn,I as K,B as oe,bS as Kn,bT as Hn,ar as Zn,i as we,bU as Wn,bV as qn,bW as Jn,a9 as Xn,X as Yn,bX as et,q as nt,bY as tt}from"./index-DsVH62ZK.js";import{n as B}from"./mui-PcDpEhsm.js";import{M as _}from"./MobileAppDrawer-BuakBUGx.js";import{a as H,g as Z,m as at}from"./accountMappingHelper-CSvCSQoY.js";import{t as ot,A as st}from"./AddressScreen-D7DCNUGo.js";import N from"./NotFoundScreen-AsC21qGx.js";import{g as it}from"./analyticsHelper-CQXeRvKo.js";import{B as ct}from"./BusinessVerificationPageScreen-HLhTZBjl.js";import{C as lt}from"./CompanyPassportScreen-Dd-P8T6z.js";import{q as ge}from"./QBOConnectionScreen-Cx74YOuE.js";import{u as rt}from"./useEmailConnectResultRefresh-FRZ2xd4V.js";import{B as dt}from"./BillPayApprovalRoutes-DxIJLeU6.js";import{R as ut}from"./ReimbursementApprovalRoutes-yvcY1FyR.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./routePaths-Dq5U7lhs.js";import"./empty-CDCfsLV4.js";import"./pdf-lib-CU5FhbnZ.js";import"./index-EyTFjAAZ.js";import"./url-9kg5cual.js";import"./index-DniSRtks.js";import"./decodeURIComponentSafe-C70tsXnj.js";import"./ReimbursementApprovalRuleDetailScreen-s9Cc-PAW.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]="3ac6a534-cf81-47df-b787-68495eee9355",e._sentryDebugIdIdentifier="sentry-dbid-3ac6a534-cf81-47df-b787-68495eee9355")}catch{}})();const pt=B.div`
1
+ import{j as o}from"./liveblocks-DC3GaKoW.js";import{a as p}from"./sentry-CuaXjR5n.js";import{h as V,g as $,u as U,j as h,s as ce,n as Q,i as G,o as q,p as A}from"./core-Bv1T7LZC.js";import{bn as je,eW as M,gp as Pe,m$ as le,Oe as Me,hF as he,O5 as De,qR as Te,kx as fe,mX as Ue,hH as _e,O7 as Re,O6 as Be,Qw as Fe,zh as Oe,EK as Ve,Q5 as ze,Qe as Le,c6 as ee,cL as Ne,cM as $e,M5 as Qe,Qx as Ge,M6 as He,xJ as Ke,Qy as Ze,H9 as We,Eq as Xe,Eh as be,Ee as qe,xN as Se,Ek as ye,En as Ce,Et as ne,ub as te,xM as Je,k9 as J,kc as Ie,Qz as Ye,ld as en,y0 as nn,M$ as tn,N0 as an,k7 as on,QA as sn,ka as cn,rj as ln,MW as rn,MX as dn,rn as un,hq as pn,Me as X,hi as re,hf as gn,hn as mn,Mf as hn,xZ as fn,QB as bn,QC as Sn,EH as yn,fB as xe,fD as Ee,QD as Cn,gd as In,Mo as xn,xY as de,gi as ue,gh as En,xX as An,gg as vn,gf as wn,QE as kn,fG as Ae,QF as jn,QG as Pn,y3 as Mn,xW as pe,QH as Dn,fX as Tn,xT as Un,bZ as _n,c5 as Rn,c4 as Bn,b_ as Fn,c2 as On,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-DuQa9FMz.js";import{W as ae,U as R,z as j,af as ve,bR as $n,d as W,f as Qn,bC as Gn,I as H,B as oe,bS as Hn,bT as Kn,ar as Zn,h as we,bU as Wn,bV as Xn,bW as qn,a9 as Jn,T as Yn,bX as et,n as nt,bY as tt}from"./index-CwcEF-q7.js";import{n as B}from"./mui-VYhJrGDQ.js";import{M as _}from"./MobileAppDrawer-PDN1hPUR.js";import{a as K,g as Z,m as at}from"./accountMappingHelper-BPzhOzDQ.js";import{t as ot,A as st}from"./AddressScreen-GAHyIX-c.js";import N from"./NotFoundScreen-CKyavEYX.js";import{g as it}from"./analyticsHelper-d524teZu.js";import{B as ct}from"./BusinessVerificationPageScreen-DMq3tKTs.js";import{C as lt}from"./CompanyPassportScreen-DMJdNz2u.js";import{q as ge}from"./QBOConnectionScreen-BDzJBSaJ.js";import{u as rt}from"./useEmailConnectResultRefresh-iMxOBvVh.js";import{B as dt}from"./BillPayApprovalRoutes-BglCJxi-.js";import{R as ut}from"./ReimbursementApprovalRoutes-DFKDTo2d.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";import"./routePaths-CjJlLbxf.js";import"./empty-BGU_c4p_.js";import"./pdf-lib-CPh8no6v.js";import"./index-B-VkC3pW.js";import"./url-DXrWvdUh.js";import"./index-Bgxmla6x.js";import"./decodeURIComponentSafe-CgJ-EbJc.js";import"./ReimbursementApprovalRuleDetailScreen-77M2HLZ2.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]="c278b9a6-06de-44d8-868e-91c40ea7c0e9",e._sentryDebugIdIdentifier="sentry-dbid-c278b9a6-06de-44d8-868e-91c40ea7c0e9")}catch{}})();const pt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBk
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,gt=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:fe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:C}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:P,accruedExpensesAccount:v}=d,{bankAccount:y,expenseCategory1099:E}=m,w=H(t.accountMappingView.incomeAccountList,f.selectedOption),F=H(t.accountMappingView.expenseAccountList,g.selectedOption),z=H(t.accountMappingView.billPayAccountList,l.selectedOption),L=H(t.accountMappingView.reimbursementsAccountList,C.selectedOption),O=Z(t.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=Z(t.accountMappingView.fixedAssetsAccountList,P.selectedOptions),D=Z(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),S=Z(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),x=at(t.accountMappingView.expenseAccounts1099FilingAccountList,E),U={selectedIncomeAccountId:w?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:O.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:S.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Be({data:U}))},onBackClick:()=>{ve(r)===!1?(s("../../dashboard"),e(Re())):e(he())},onSaveClick:()=>{e(_e()),i&&W.track($n.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Te(t.currentTenant.companyId,n))}}})(Qn),mt=()=>{const e=V(),t=Q(),s=T(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=j.getSignedInUser(),f=je(m),g=h(S=>M(S)),{capitalizableAccounts:l,capitalizableAccountOverrides:C,isCapitalizationThresholdSaving:I,currencySymbol:P}=h(S=>{const x=S.tenantState.currentTenantId,U=x!=null?S.tenantState.tenantsById[x]:void 0,k=Pe(S.companyState,g.companyId);return{capitalizableAccounts:U?.capitalizableAccounts??null,capitalizableAccountOverrides:U?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:S.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:k?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=p.useCallback((S,x)=>{s(le(g.companyId,S,x))},[s,g.companyId]),y=p.useCallback(S=>{const x={...C??{}},U=Object.entries(S);for(const[se,ie]of U)ie===null?delete x[se]:x[se]=ie;const[k,ke]=U[0]??[];k!=null&&s(le(g.companyId,k,ke,void 0,Object.keys(x).length>0?x:null))},[s,g.companyId,C]),E=h(S=>Me(S.accountState),ce),w=p.useMemo(()=>{const S={};for(const x of E)x.accountId!=null&&x.accountName!=null&&(S[x.accountId]=x.accountName);return S},[E]),[F,z]=p.useState(!1),[L,O]=p.useState(!1);p.useEffect(()=>{F===!1&&(s(he()),z(!0))},[F]);const b=h(S=>De(S)),D=S=>{O(S)};return o.jsxs(pt,{children:[o.jsx(_,{isAppContentDrawerOpen:L,handleDrawerToggle:D}),o.jsx(gt,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:w,capitalizableAccountOverrides:C,currencySymbol:P,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:y,location:t,isSettings:ve(t),onClickMenuIcon:()=>D(!0)})]})},ht=B.div`
9
+ `,gt=Q(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:fe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Te(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:C}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:P,accruedExpensesAccount:v}=d,{bankAccount:y,expenseCategory1099:E}=m,w=K(t.accountMappingView.incomeAccountList,f.selectedOption),F=K(t.accountMappingView.expenseAccountList,g.selectedOption),z=K(t.accountMappingView.billPayAccountList,l.selectedOption),L=K(t.accountMappingView.reimbursementsAccountList,C.selectedOption),O=Z(t.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=Z(t.accountMappingView.fixedAssetsAccountList,P.selectedOptions),D=Z(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),S=Z(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),x=at(t.accountMappingView.expenseAccounts1099FilingAccountList,E),T={selectedIncomeAccountId:w?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:O.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:S.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Be({data:T}))},onBackClick:()=>{ve(r)===!1?(s("../../dashboard"),e(Re())):e(he())},onSaveClick:()=>{e(_e()),i&&W.track(Qn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ue(t.currentTenant.companyId,n))}}})($n),mt=()=>{const e=V(),t=$(),s=U(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=j.getSignedInUser(),f=je(m),g=h(S=>M(S)),{capitalizableAccounts:l,capitalizableAccountOverrides:C,isCapitalizationThresholdSaving:I,currencySymbol:P}=h(S=>{const x=S.tenantState.currentTenantId,T=x!=null?S.tenantState.tenantsById[x]:void 0,k=Pe(S.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:S.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:k?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=p.useCallback((S,x)=>{s(le(g.companyId,S,x))},[s,g.companyId]),y=p.useCallback(S=>{const x={...C??{}},T=Object.entries(S);for(const[se,ie]of T)ie===null?delete x[se]:x[se]=ie;const[k,ke]=T[0]??[];k!=null&&s(le(g.companyId,k,ke,void 0,Object.keys(x).length>0?x:null))},[s,g.companyId,C]),E=h(S=>Me(S.accountState),ce),w=p.useMemo(()=>{const S={};for(const x of E)x.accountId!=null&&x.accountName!=null&&(S[x.accountId]=x.accountName);return S},[E]),[F,z]=p.useState(!1),[L,O]=p.useState(!1);p.useEffect(()=>{F===!1&&(s(he()),z(!0))},[F]);const b=h(S=>De(S)),D=S=>{O(S)};return o.jsxs(pt,{children:[o.jsx(_,{isAppContentDrawerOpen:L,handleDrawerToggle:D}),o.jsx(gt,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:w,capitalizableAccountOverrides:C,currencySymbol:P,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:y,location:t,isSettings:ve(t),onClickMenuIcon:()=>D(!0)})]})},ht=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBk
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,ft=$(function(e,t){const s=M(e),r=ze(e),i=Le(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:W}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),bt=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(E=>M(E)),f=h(E=>E.billPaySetupApproverViewState.fetchState),g=h(E=>E.remiSetupApproverViewState.fetchState),l=h(E=>Fe(E)),{isApprovalRulesV3Enabled:C,isLoading:I}=Gn(m?.tenantId),P=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=K();p.useEffect(()=>{u||f!=="Not-Started"||I||(d(!0),s(Oe(!0,!0,C)))},[u,f,I,C,s]),p.useEffect(()=>{a||g!=="Not-Started"||I||(c(!0),s(Ve(!0,!1,!1,C)))},[a,g,I,C,s]);const y=E=>{n(E)};return v?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:y}),o.jsx(ft,{navigate:e,location:t,companyId:P,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{y(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},St=B.div`
17
+ `,ft=Q(function(e,t){const s=M(e),r=ze(e),i=Le(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:W}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Hn),bt=()=>{const e=V(),t=$(),s=U(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(E=>M(E)),f=h(E=>E.billPaySetupApproverViewState.fetchState),g=h(E=>E.remiSetupApproverViewState.fetchState),l=h(E=>Fe(E)),{isApprovalRulesV3Enabled:C,isLoading:I}=Gn(m?.tenantId),P=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=H();p.useEffect(()=>{u||f!=="Not-Started"||I||(d(!0),s(Oe(!0,!0,C)))},[u,f,I,C,s]),p.useEffect(()=>{a||g!=="Not-Started"||I||(c(!0),s(Ve(!0,!1,!1,C)))},[a,g,I,C,s]);const y=E=>{n(E)};return v?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:y}),o.jsx(ft,{navigate:e,location:t,companyId:P,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{y(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},St=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBk
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,yt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=M(e);return{bankSetupView:Ze(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(Ce(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(ye(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(Se(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?be(n,a,c,u):Je(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(qe(i,a,n,c))},onRemoveConnection:n=>{e(We(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Hn),Ct=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),i=K(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>M(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=Ne(d,i?.loggedInUserRoleMap),g=Qe(d,i?.loggedInUserRoleMap),l=$e(d,i?.loggedInUserRoleMap),C=Ge(d,i?.loggedInUserRoleMap),I=Ke(d,i?.loggedInUserRoleMap),P=d.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(He(!1)))},[c,s,m]);const v=y=>{a(y)};return f||l||g||I?o.jsxs(St,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:v}),o.jsx(yt,{navigate:e,location:t,companyId:P,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:C,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(N,{})},It=B.div`
25
+ `,yt=Q(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=M(e);return{bankSetupView:Ze(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(Ce(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(ye(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(Se(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?be(n,a,c,u):qe(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(Xe(i,a,n,c))},onRemoveConnection:n=>{e(We(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),Ct=()=>{const e=V(),t=$(),s=U(),{tenantEmailDomain:r}=G(),i=H(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>M(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=Ne(d,i?.loggedInUserRoleMap),g=$e(d,i?.loggedInUserRoleMap),l=Qe(d,i?.loggedInUserRoleMap),C=Ge(d,i?.loggedInUserRoleMap),I=He(d,i?.loggedInUserRoleMap),P=d.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ke(!1)))},[c,s,m]);const v=y=>{a(y)};return f||l||g||I?o.jsxs(St,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:v}),o.jsx(yt,{navigate:e,location:t,companyId:P,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:C,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(N,{})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBk
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,xt=$(function(e,t){const{companyId:s}=t,r=M(e),i=t.roleMap.bill_pay_admin,n=Ye(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:we.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:W}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(Ce(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(ye(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(be(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ie(n))},handleConfirmCardSetupIntent:n=>{e(cn(n))},updateCardPaymentModalState:n=>{e(sn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(on(n,a,c))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(an())},handleResetCardPaymentErrorStatuses:()=>{e(tn())},onBillingAddressSave:n=>{e(nn(n))},onAddressEditHandler:n=>{if(n!=null){const a=ot(n);e(en({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Wn),Et=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>M(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Zn(f.addCardPaymentSourceStatus.fetchState),C=f.addCardPaymentSourceStatus.fetchState,I=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const P=K();p.useEffect(()=>{I!=null&&s(Xe(I,!1))},[I,s]),p.useEffect(()=>{a||(c(!0),s(X()))},[a,s]),p.useEffect(()=>{u||(Ie(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&C==="Completed"&&s(X())},[l,C]);const v=y=>{n(y)};return P?.loggedInUserRoleMap!=null?o.jsxs(It,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(xt,{navigate:e,location:t,companyId:I,currentTenant:m,roleMap:P.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:we.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},Y="external_integrations",At=$(function(e){const t=dn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{ge.init("/connection/auth",n),ge.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(fn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(mn(a,d,q("revenue"),hn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(gn(a,c,q(u)))},onConnectGmail:()=>{e(re(a,"gmail",window.location.href))},onConnectOutlook:()=>{e(re(a,"outlook",window.location.href))},onSaveConnectorCredentials:c=>{e(pn(a,q("payments"),c))},onNotifyMe:c=>{e(un(Y,c,i))}}})(qn),vt=()=>{const e=V(),t=T(),{tenantEmailDomain:s}=G();rt();const[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>M(l)),c=a.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),d=K(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(ln(Y))},[t]);const f=l=>{i(l)},g=h(l=>rn(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(At,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,C])=>[l,C?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},wt=B.div`
33
+ `,xt=Q(function(e,t){const{companyId:s}=t,r=M(e),i=t.roleMap.bill_pay_admin,n=Ye(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:we.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:W}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(Ce(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(ye(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(be(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ie(n))},handleConfirmCardSetupIntent:n=>{e(cn(n))},updateCardPaymentModalState:n=>{e(sn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(on(n,a,c))},handleFetchPaymentSources:()=>{e(J())},resetCardPaymentViewState:()=>{e(an())},handleResetCardPaymentErrorStatuses:()=>{e(tn())},onBillingAddressSave:n=>{e(nn(n))},onAddressEditHandler:n=>{if(n!=null){const a=ot(n);e(en({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Wn),Et=()=>{const e=V(),t=$(),s=U(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>M(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Zn(f.addCardPaymentSourceStatus.fetchState),C=f.addCardPaymentSourceStatus.fetchState,I=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const P=H();p.useEffect(()=>{I!=null&&s(Je(I,!1))},[I,s]),p.useEffect(()=>{a||(c(!0),s(J()))},[a,s]),p.useEffect(()=>{u||(Ie(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&C==="Completed"&&s(J())},[l,C]);const v=y=>{n(y)};return P?.loggedInUserRoleMap!=null?o.jsxs(It,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(xt,{navigate:e,location:t,companyId:I,currentTenant:m,roleMap:P.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:we.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},Y="external_integrations",At=Q(function(e){const t=dn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{ge.init("/connection/auth",n),ge.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(fn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(mn(a,d,X("revenue"),hn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(gn(a,c,X(u)))},onConnectGmail:()=>{e(re(a,"gmail",window.location.href))},onConnectOutlook:()=>{e(re(a,"outlook",window.location.href))},onSaveConnectorCredentials:c=>{e(pn(a,X("payments"),c))},onNotifyMe:c=>{e(un(Y,c,i))}}})(Xn),vt=()=>{const e=V(),t=U(),{tenantEmailDomain:s}=G();rt();const[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>M(l)),c=a.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),d=H(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(ln(Y))},[t]);const f=l=>{i(l)},g=h(l=>rn(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(At,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,C])=>[l,C?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},wt=B.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBk
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,jt=()=>{const e=T(),{tenantEmailDomain:t}=G(),[s,r]=p.useState(!1),i=h(l=>M(l)).companyId??j.getSignedInUserTenant(t)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>bn(l,n.userId)),c=h(l=>Sn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(yn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(kt,{children:[o.jsx(_,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Jn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Pt=B.div`
49
+ `,jt=()=>{const e=U(),{tenantEmailDomain:t}=G(),[s,r]=p.useState(!1),i=h(l=>M(l)).companyId??j.getSignedInUserTenant(t)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>bn(l,n.userId)),c=h(l=>Sn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(yn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(kt,{children:[o.jsx(_,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(qn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Pt=B.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBk
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,me=({appContent:e})=>{const t=T(),s=V(),r=Q(),[i,n]=p.useState(!1),a=h(b=>M(b)),{tenantEmailDomain:c}=a,u=a.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(R.isTreasuryEnabled),C=h(b=>fe(b)),I=xe(a),P=Ee(g,a),v=!P&&C,y=Xn(a,f,g),{areTenantIdsInSync:E}=Yn();p.useEffect(()=>{E&&t(Cn(u,v))},[u,t,v,E]);const w=h(b=>In(b,v)),F=w.fetchState==="Not-Started"||w.fetchState==="In-Progress"||u==null,z=xn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return o.jsxs(Pt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:w,isAccountingClassesEnabled:C,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:F,isBankingOnlyTenant:P,isCardsOnlyTenant:I,onAddressClick:b=>{const D=function(x,U){let k=`/${x}/settings/my_profile`;return k=k.concat(`/new/${U}`),k}(c,b),S=nt(r.state?.pathnameStackToGoBack,r.pathname);s(D,{state:{pathnameStackToGoBack:S}})},onGetOtp:b=>{const D={...w.myProfileLocalData,phone:b};t(de({localData:D})),t(wn(b,"MyProfile"))},onResendOtp:b=>{t(vn(b,"MyProfile"))},onCancelClick:()=>{t(An())},onSaveClick:()=>{t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{t(En(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&j.saveZeniOtpToken(b),t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(de({localData:b}))}})]})};function Mt(){const e=T(),t=h(l=>M(l)).companyId,s=h(l=>kn(l)),r=h(l=>Ae(l)),i=j.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(jn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(Pn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(Mn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(Dn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function pa(e){const[t,s]=p.useState(!1),r=h(l=>Ae(l)),i=h(l=>M(l)),n=K(),a=j.getSignedInUser(),c=T(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(R.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Un(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Tn()))},[r.fetchState,t]);const f=Ee(d,i),g=xe(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?_n(i)?o.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(mt,{})}),Bn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(Dt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Fn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(jt,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(Ct,{})}),Vn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(ct,{productType:f?"zeni_accounts":g?"charge_cards":it(i,n?.loggedInUserRoleMap)})}),zn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(lt,{})}),Ln(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(Et,{})}),Nn(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(vt,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(me,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(me,{})}),m&&o.jsx(A,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(J,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function Dt(e){return o.jsxs(J,{children:[o.jsx(A,{path:"/",element:o.jsx(bt,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(dt,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(ut,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{pa as default};
57
+ `,me=({appContent:e})=>{const t=U(),s=V(),r=$(),[i,n]=p.useState(!1),a=h(b=>M(b)),{tenantEmailDomain:c}=a,u=a.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(R.isTreasuryEnabled),C=h(b=>fe(b)),I=xe(a),P=Ee(g,a),v=!P&&C,y=Jn(a,f,g),{areTenantIdsInSync:E}=Yn();p.useEffect(()=>{E&&t(Cn(u,v))},[u,t,v,E]);const w=h(b=>In(b,v)),F=w.fetchState==="Not-Started"||w.fetchState==="In-Progress"||u==null,z=xn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return o.jsxs(Pt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:w,isAccountingClassesEnabled:C,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:F,isBankingOnlyTenant:P,isCardsOnlyTenant:I,onAddressClick:b=>{const D=function(x,T){let k=`/${x}/settings/my_profile`;return k=k.concat(`/new/${T}`),k}(c,b),S=nt(r.state?.pathnameStackToGoBack,r.pathname);s(D,{state:{pathnameStackToGoBack:S}})},onGetOtp:b=>{const D={...w.myProfileLocalData,phone:b};t(de({localData:D})),t(wn(b,"MyProfile"))},onResendOtp:b=>{t(vn(b,"MyProfile"))},onCancelClick:()=>{t(An())},onSaveClick:()=>{t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{t(En(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&j.saveZeniOtpToken(b),t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(de({localData:b}))}})]})};function Mt(){const e=U(),t=h(l=>M(l)).companyId,s=h(l=>kn(l)),r=h(l=>Ae(l)),i=j.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(jn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(Pn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(Mn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(Dn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function pa(e){const[t,s]=p.useState(!1),r=h(l=>Ae(l)),i=h(l=>M(l)),n=H(),a=j.getSignedInUser(),c=U(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(R.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Tn(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Un()))},[r.fetchState,t]);const f=Ee(d,i),g=xe(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?_n(i)?o.jsxs(q,{children:[Rn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(mt,{})}),Bn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(Dt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Fn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(jt,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(Ct,{})}),Vn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(ct,{productType:f?"zeni_accounts":g?"charge_cards":it(i,n?.loggedInUserRoleMap)})}),zn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(lt,{})}),Ln(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(Et,{})}),Nn(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(vt,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(me,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(me,{})}),m&&o.jsx(A,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(q,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function Dt(e){return o.jsxs(q,{children:[o.jsx(A,{path:"/",element:o.jsx(bt,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(dt,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(ut,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{pa as default};