@zeniai/web-app-ui 5.0.1-qa → 5.0.2-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/assets/AddressRoutes-cGHfwdAO.js +1 -0
  2. package/dist/assets/AddressScreen-BnTNp61r.js +9 -0
  3. package/dist/assets/AiCfoScreen-C3DNvQlj.js +11 -0
  4. package/dist/assets/BillPayApprovalRoutes-BVBiJezP.js +1 -0
  5. package/dist/assets/{BillPayRoutes-B7eECbMR.js → BillPayRoutes-C68APJ0s.js} +7 -7
  6. package/dist/assets/{BusinessVerificationPageScreen-D_IL11BU.js → BusinessVerificationPageScreen-uevt4KH_.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-MbQ6GwxR.js → ChargeCardRoutes-BDWNHmvV.js} +9 -9
  8. package/dist/assets/CompanyPassportScreen-BsQAk6DO.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-CH-I2hu3.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-Dm-6AV-k.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DEmyPEG9.js → CustomerOnboardingRoutes-4bfKX61e.js} +3 -3
  12. package/dist/assets/{DashboardRoutes-LUXfYRYr.js → DashboardRoutes-KTtbdLF8.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-CsgBmyY-.js → DefaultTenantHome-DGySCaNj.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-Byk3gNE9.js → DomesticWireDetailScreen-DcjlQFtk.js} +3 -3
  15. package/dist/assets/DrawerScreen-3KqQh33-.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-B4XF7gyV.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-DzZ2kzOA.js → ExpenseAutomationRoutes-CKPTMKMk.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-CEV6r8QS.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-D8VOzSDZ.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-DGyXdYGH.js +12 -0
  21. package/dist/assets/MobileAppDrawer-YMrlHv7B.js +1 -0
  22. package/dist/assets/NotFoundScreen-CPtlb4xk.js +1 -0
  23. package/dist/assets/{NotificationRoutes-DzMqKa9n.js → NotificationRoutes-CLWgbDXX.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-XoBK7btv.js +1 -0
  25. package/dist/assets/{PeopleRoutes-BswRWZQg.js → PeopleRoutes-Cb2v_H4M.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-DWvTIqMy.js +1 -0
  27. package/dist/assets/{Preview--bb5p9Hr.js → Preview-hp5oXBDl.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-C_qIc23z.js → QBOConnectionScreen-DdYGgWWD.js} +34 -34
  29. package/dist/assets/ReferralListScreen-t3nG_-Jq.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-D0b-XGea.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cg7X5Fv7.js → ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.js} +1 -1
  32. package/dist/assets/ReimbursementRoutes-hOmxiTvW.js +68 -0
  33. package/dist/assets/ReportsRoutes-BYHcHW75.js +1 -0
  34. package/dist/assets/RewardsRoutes-BAINUSVd.js +1 -0
  35. package/dist/assets/ScreenRoutes-CzaM-ErL.js +2 -0
  36. package/dist/assets/SettingsRoutes-CyoLt7JH.js +57 -0
  37. package/dist/assets/{SetupPagesScreen-vY1ujDKJ.js → SetupPagesScreen-BaHRYy46.js} +5 -5
  38. package/dist/assets/{SignInScreen-ClbKNS4x.js → SignInScreen-D7GXAtAP.js} +1 -1
  39. package/dist/assets/SignOutScreen-Bhfa71yJ.js +9 -0
  40. package/dist/assets/TaskListScreen-DqV1jPp4.js +9 -0
  41. package/dist/assets/TaskRoutes-b0082ks-.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-72pTxmoR.js +1 -0
  43. package/dist/assets/TransactionDetailScreen-RnHkkAvY.js +5 -0
  44. package/dist/assets/TransactionListRoutes-0LJWWSY0.js +1 -0
  45. package/dist/assets/{TreasuryRoutes-CtBzkTMx.js → TreasuryRoutes-DxNNpbkP.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-aBYOoTKe.js → VendorsRoutes-CXNQHyD0.js} +20 -20
  47. package/dist/assets/{WiseConfirmationScreen-s0eoug7u.js → WiseConfirmationScreen-Dz9Nm2cC.js} +1 -1
  48. package/dist/assets/ZeniAccountRoutes-CLx-Q3l6.js +66 -0
  49. package/dist/assets/ZeniAccountStatementScreen-QylI0M1l.js +9 -0
  50. package/dist/assets/{accountMappingHelper-CEUIWp7O.js → accountMappingHelper-B_vdVXJd.js} +1 -1
  51. package/dist/assets/{analytics-BkhHPaQ4.js → analytics-B_kykzhy.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CSpNHX-t.js → analyticsHelper-Dp05MDBJ.js} +1 -1
  53. package/dist/assets/{core-C_NeXleM.js → core-C7cnuUop.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-Drd7YS9D.js → decodeURIComponentSafe-rDkCEJpn.js} +1 -1
  55. package/dist/assets/{dnd-C0SdDgY2.js → dnd-TzLeX35A.js} +1 -1
  56. package/dist/assets/{empty-5JhUjXJf.js → empty-7vbmHAL6.js} +1 -1
  57. package/dist/assets/{empty-CDZc49VR.js → empty-B375B_HA.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-SE9UwlDX.js → emptyVideoElement-BGxjtXTu.js} +1 -1
  59. package/dist/assets/epic-DefpUSD4.js +2 -0
  60. package/dist/assets/getLocaleForTenant-DHk9xDoK.js +1 -0
  61. package/dist/assets/{index-BaZ8-9eR.js → index-B2lD3Jim.js} +13079 -12937
  62. package/dist/assets/{index-3wKQcxVk.js → index-BAxpczYf.js} +2 -2
  63. package/dist/assets/{index-DEiuB93P.js → index-CcLDrNJO.js} +1 -1
  64. package/dist/assets/{index-Y_8J-EV-.js → index-DrxEgkQ-.js} +1 -1
  65. package/dist/assets/{index-COcEChnY.js → index-Qmma5Ck1.js} +1 -1
  66. package/dist/assets/{index-DYUyEm6J.js → index-_vh22_qX.js} +1 -1
  67. package/dist/assets/{index-Dmixh63m.js → index-m-Adf2ll.js} +1 -1
  68. package/dist/assets/{lexical-B1vtLf4F.js → lexical-Dp9Fvoo6.js} +1 -1
  69. package/dist/assets/{liveblocks-BCZSgQbG.js → liveblocks-jLbycGCP.js} +1 -1
  70. package/dist/assets/{lottie-BdeQlKTG.js → lottie-SbVYeXJk.js} +1 -1
  71. package/dist/assets/{mui-CgjVMn8C.js → mui-BkznVaFh.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BDpRzqvH.js → pathToGoBack-DXgc_G9d.js} +1 -1
  73. package/dist/assets/{pdf-CQPNphc4.js → pdf-DQg4OfsP.js} +4 -4
  74. package/dist/assets/{pdf-lib-DznUmqID.js → pdf-lib-CDsnDRGG.js} +1 -1
  75. package/dist/assets/{plaid-B3UNGbGB.js → plaid-DfnoQTVm.js} +1 -1
  76. package/dist/assets/{pusher-SrZYiYid.js → pusher-CQHA__kt.js} +1 -1
  77. package/dist/assets/{react-B1LuGLWv.js → react-BfsHsZ2B.js} +1 -1
  78. package/dist/assets/{react-CkJUroZo.js → react-CCO8orgk.js} +1 -1
  79. package/dist/assets/{react-CUvZ-QKI.js → react-CJwzWgLi.js} +1 -1
  80. package/dist/assets/{react-BLym8SqS.js → react-DPNnFJXW.js} +1 -1
  81. package/dist/assets/{react-BR-uiB3M.js → react-pHyk9OpQ.js} +1 -1
  82. package/dist/assets/{react-BUr4gNxK.js → react-tE35hRos.js} +1 -1
  83. package/dist/assets/{recharts-NCr2Pwd1.js → recharts-Dt8COHEP.js} +1 -1
  84. package/dist/assets/{routePaths-CXa3WNDm.js → routePaths-DBCGZwBw.js} +1 -1
  85. package/dist/assets/{sentry-CGkVgbup.js → sentry-CflaePyQ.js} +1 -1
  86. package/dist/assets/{url-D7JZ1pkZ.js → url-CMgR7Whs.js} +1 -1
  87. package/dist/assets/{url-ax2xfQkc.js → url-DZF6CZ5y.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-BopsQ8w-.js +1 -0
  89. package/dist/assets/{useDeviceId-DxDe1m2N.js → useDeviceId-aTbWtPu7.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-4mjujgB-.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-B7p2SBgg.js → useInitialThreadRequest-C_8EtcOe.js} +1 -1
  92. package/dist/assets/{utils-CTLGOmjC.js → utils-t3ltqqZ0.js} +1 -1
  93. package/dist/assets/withTransactionSidePanel-m0PuYIs6.js +8 -0
  94. package/dist/assets/zeni-epic-state-DPGmsT0c.js +14 -0
  95. package/dist/index.html +1 -1
  96. package/package.json +4 -4
  97. package/dist/assets/AddressRoutes-Ccdt31hR.js +0 -1
  98. package/dist/assets/AddressScreen-DG9DlRXT.js +0 -9
  99. package/dist/assets/AiCfoScreen-BySJdfdn.js +0 -11
  100. package/dist/assets/BillPayApprovalRoutes-7ZgXY6Qr.js +0 -1
  101. package/dist/assets/CompanyPassportScreen-0tGZqhHr.js +0 -1
  102. package/dist/assets/ConnectionAuthScreen-Ng7EqaWr.js +0 -11
  103. package/dist/assets/CustomerOnboardingAuthScreen-DHzsN76N.js +0 -1
  104. package/dist/assets/DrawerScreen-CN6TBpYY.js +0 -1
  105. package/dist/assets/EntityDetailRoutes-BVmRwPcm.js +0 -1
  106. package/dist/assets/FeaturePreviewScreen-ArEP4se9.js +0 -1
  107. package/dist/assets/MagicLinkRoutes-C8RQWz8N.js +0 -72
  108. package/dist/assets/MagicLinkSignInScreen-raeb9t11.js +0 -12
  109. package/dist/assets/MobileAppDrawer-CowqUthz.js +0 -1
  110. package/dist/assets/NotFoundScreen-0ajohMSv.js +0 -1
  111. package/dist/assets/PandLWithForecastRoutes-DdGQfKKW.js +0 -1
  112. package/dist/assets/PerformanceRoutes-ChMRcywH.js +0 -1
  113. package/dist/assets/ReferralListScreen-BAK4p9-3.js +0 -5
  114. package/dist/assets/ReimbursementApprovalRoutes-ogcfMEcC.js +0 -1
  115. package/dist/assets/ReimbursementRoutes-0m6W0X2g.js +0 -68
  116. package/dist/assets/ReportsRoutes-1TXSN037.js +0 -1
  117. package/dist/assets/RewardsRoutes-B8FReE5j.js +0 -1
  118. package/dist/assets/ScreenRoutes-DRzB_14n.js +0 -2
  119. package/dist/assets/SettingsRoutes-BGCZcWYL.js +0 -57
  120. package/dist/assets/SignOutScreen-Dvb2Qc0l.js +0 -9
  121. package/dist/assets/TaskListScreen-CaGy-z1x.js +0 -9
  122. package/dist/assets/TaskRoutes-9joFCtVs.js +0 -9
  123. package/dist/assets/TransactionDetailRoutes-CWNaQpCz.js +0 -1
  124. package/dist/assets/TransactionDetailScreen-DXlYmq7Y.js +0 -5
  125. package/dist/assets/TransactionListRoutes-FH_uc507.js +0 -1
  126. package/dist/assets/ZeniAccountRoutes-BcBOPI_A.js +0 -66
  127. package/dist/assets/ZeniAccountStatementScreen-BOfH7mnf.js +0 -9
  128. package/dist/assets/epic-CBKcA32L.js +0 -2
  129. package/dist/assets/getLocaleForTenant-Ab1B3PjW.js +0 -1
  130. package/dist/assets/useAskAiCfoHostNavButtonProps-Crpk73sU.js +0 -1
  131. package/dist/assets/useFetchSuggestedQuestionsWhenReady-sxquM27W.js +0 -1
  132. package/dist/assets/withTransactionSidePanel-CB8Jp1hw.js +0 -8
  133. package/dist/assets/zeni-epic-state-Dp14ovRw.js +0 -14
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-jLbycGCP.js";import{a as o}from"./sentry-CflaePyQ.js";import{g as f,j as V,h as F,u as N,k as W}from"./core-C7cnuUop.js";import{m as _,Z as $,z as R,a$ as U,C as Z,M as z,K,R as X,d,g as q,a1 as G,b0 as Q}from"./index-B2lD3Jim.js";import{eX as J,eM as Y,Lh as I,Li as ee,ta as ae,t0 as g,eZ as re,bL as ne,t5 as te,Lj as se}from"./zeni-epic-state-DPGmsT0c.js";import{D as oe,e as ie,n as de,S as le}from"./mui-BkznVaFh.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-BopsQ8w-.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-4mjujgB-.js";import{M as ue}from"./MobileAppDrawer-YMrlHv7B.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]="06925df0-8afd-4fd6-a7f8-9d2db14b79b0",e._sentryDebugIdIdentifier="sentry-dbid-06925df0-8afd-4fd6-a7f8-9d2db14b79b0")}catch{}})();const pe={overlayWidth:new Z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(l=>J(l));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:l=>l.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=de(le)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,P="refer-and-earn-status-update",ke=W(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([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(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{d.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{d.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{d.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{d.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{d.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(G(Q));function Pe({isReferralDrawerOpen:e}){const a=V(),r=F(),n=N(),[i,u]=o.useState(!1),[l,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Y(t)),m=f(t=>I(t)),b=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=ee([m,w]),{areTenantIdsInSync:c}=z();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&c&&(u(!0),r(g(!0)))},[b,r,c]),o.useEffect(()=>{!l&&w.fetchState==="Not-Started"&&c&&(x(!0),r(re(!0)))},[w,r,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),y=t=>{j(t)},{isAiCfoOpen:L,setIsAiCfoOpen:O}=K(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=ce({isAiCfoOpen:L,setIsAiCfoOpen:O,mobileExploreReferrer:"Rewards"});fe({isDataReady:v===!0});const M={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(X,{analytics:d,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(q.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:y}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...M})]})}export{Pe as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-jLbycGCP.js";import x from"./NotFoundScreen-CPtlb4xk.js";import{a as p}from"./sentry-CflaePyQ.js";import{j as I,u as C,h as A,g as c,N as E,k,n as D,o as u}from"./core-C7cnuUop.js";import{eM as T,Mb as v,Mr as S,C7 as V,Bg as B,C6 as m,BZ as M,MG as U}from"./zeni-epic-state-DPGmsT0c.js";import{m as _,z as $,B as N,a1 as O,bF as W,aa as z}from"./index-B2lD3Jim.js";import"./mui-BkznVaFh.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="7511c9dc-84b4-4f3b-bf7c-7fc615663406",e._sentryDebugIdIdentifier="sentry-dbid-7511c9dc-84b4-4f3b-bf7c-7fc615663406")}catch{}})();const f="reimbursement-approval-rule-update",F=k(function(e){return{approvalView:v(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(f)&&e(U(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(M(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),G=()=>{const e=I(),r=C(),a=A(),[l,n]=p.useState(!1),[d,y]=p.useState(!1),b=c(s=>s.remiSetupApproverViewState.fetchState),o=c(s=>T(s)),w=_(),i=c(s=>v(s)),g=c(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(V())},[g]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(B(!0)))},[l,b,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(m())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${f}`]:[],eventCallback:(s,P,R)=>{s.endsWith(f)&&R.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(N,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(F,{currentTenant:o,location:r,navigate:e,...j})};function Y(){return t.jsxs(D,{children:[t.jsx(u,{path:"/",element:t.jsx(G,{})}),t.jsx(u,{path:"/new",element:t.jsx(h,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Y as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-BCZSgQbG.js";import{a as y}from"./sentry-CGkVgbup.js";import{j as w,h as A,u as T,l as C,g as b,k as U}from"./core-C_NeXleM.js";import{Mg as R,M0 as E,BV as x,C2 as _,C0 as S,C1 as h,Mh as B}from"./zeni-epic-state-Dp14ovRw.js";import{z as k,m as V,B as j,bw as F,aa as O}from"./index-BaZ8-9eR.js";import"./mui-CgjVMn8C.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]="d7e38a42-cdbf-4584-9480-2aead72eba51",e._sentryDebugIdIdentifier="sentry-dbid-d7e38a42-cdbf-4584-9480-2aead72eba51")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!$(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function H(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=C(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
1
+ import{j as g}from"./liveblocks-jLbycGCP.js";import{a as y}from"./sentry-CflaePyQ.js";import{j as w,h as A,u as C,l as T,g as S,k as U}from"./core-C7cnuUop.js";import{Mr as R,Mb as E,C0 as x,C9 as _,C7 as b,C8 as h,Ms as B}from"./zeni-epic-state-DPGmsT0c.js";import{z as k,m as V,B as j,bw as F,aa as O}from"./index-B2lD3Jim.js";import"./mui-BkznVaFh.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]="2f19e4e1-5cac-474c-acd4-270500ad6384",e._sentryDebugIdIdentifier="sentry-dbid-2f19e4e1-5cac-474c-acd4-270500ad6384")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const v=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const f=!!$(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:u.stepType.selectedOption,actors:m,operator:m.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(b()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(b()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=S(p=>R(p)),i=S(p=>E(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-jLbycGCP.js";import{j as W,h as le,u as V,l as Y,g as w,N,k as K,i as ut,n as pt,o as B}from"./core-C7cnuUop.js";import{eM as J,MH as me,b$ as ce,Bb as xe,jj as bt,Bo as ae,Bn as se,MI as gt,bm as de,fG as Te,MJ as ht,J3 as ft,j8 as je,J4 as Se,J5 as St,i1 as It,LZ as yt,ih as Rt,A$ as At,rQ as vt,i8 as Ct,BL as De,MK as Fe,ML as kt,MM as Et,MN as Bt,MO as wt,MP as xt,Bv as Ie,io as Tt,M6 as jt,Bp as Dt,B9 as Ft,MQ as Ut,B8 as Lt,MR as Mt,Bh as ye,Bz as Pt,By as $t,Bu as Nt,MS as Ue,Gm as _t,bn as Ot,Bk as Gt,C1 as zt,MT as Ht,MU as Zt,BH as Vt,BE as Re,Ls as Jt,B6 as Wt,MV as Le,Cq as Ae,Cy as Kt,MW as qt,MX as H,MY as Qt,MZ as Me,M_ as Xt,M$ as Pe,N0 as $e,BT as ie,bs as Yt,bD as ue,cy as pe,eT as Ne,eR as _e,N1 as en,gy as tn,LF as nn,N2 as an,N3 as Oe,LJ as sn,Mr as on,N4 as rn,MG as ln,Cv as ve,Cu as mn,N5 as cn,N6 as dn,N7 as un,N8 as pn,N9 as bn,Mc as gn,Cl as hn,Cp as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,I2 as vn,cJ as Cn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-DPGmsT0c.js";import{y as Ge,Z as ze,a as ee,r as v,z as P,bG as He,R as te,d as C,aC as Ce,o as U,ao as X,G as wn,D as Ze,bH as xn,w as Z,K as Ve,bI as Tn,j as ne,bJ as jn,M as Dn,C as Fn,B as be,g as Je,a1 as Un,b7 as Ln,Q as Mn,m as We,bK as Pn,a4 as $n}from"./index-B2lD3Jim.js";import{n as _,S as Nn}from"./mui-BkznVaFh.js";import oe from"./NotFoundScreen-CPtlb4xk.js";import{S as ke}from"./SetupPagesScreen-BaHRYy46.js";import{F as Ke}from"./FeaturePreviewScreen-CEV6r8QS.js";import{a as g}from"./sentry-CflaePyQ.js";import{u as qe}from"./useInitialThreadRequest-C_8EtcOe.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BopsQ8w-.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-4mjujgB-.js";import{D as _n}from"./DrawerScreen-3KqQh33-.js";import{M as Ye}from"./MobileAppDrawer-YMrlHv7B.js";import{R as On}from"./ReimbursementApprovalRoutes-D0b-XGea.js";import{FallBackRoute as Gn}from"./ScreenRoutes-CzaM-ErL.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./analyticsHelper-Dp05MDBJ.js";import"./routePaths-DBCGZwBw.js";import"./BusinessVerificationPageScreen-uevt4KH_.js";import"./ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.js";import"./getLocaleForTenant-DHk9xDoK.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]="456a4f00-b154-449d-aefe-9db7d23ab1d7",e._sentryDebugIdIdentifier="sentry-dbid-456a4f00-b154-449d-aefe-9db7d23ab1d7")}catch{}})();const et=e=>`/${e}/reimbursements`,zn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Hn=K(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=P.getSignedInUser(),d=de(c),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=me(e,t.reimbursementId),p=ht(e,c?.userId??"");let I=`${c?.firstName} ${c?.lastName}`,S=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,S=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,R=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,p)=>{i!=null&&e(se(i,l,p,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(Pt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Mt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Dt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(jt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=Z(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Ct(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(At(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(xn);function Ee(){const e=W(),t=le(),n=V(),{reimbursementId:r}=Y(),c=Ge(),d=ze(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isReimbursementCommentingEnabled),x=V().pathname,R=x.includes("edit"),j=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=P.getSignedInUser(),T=w(u=>J(u)),f=w(u=>me(u,r)),D=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),$=ce(T?.userRole??[]);g.useEffect(()=>{(j&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||$&&f.billStatus==="rejected"||$===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx(N,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(He,{}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:C,onLoad:u=>(M=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Jn,{children:s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(Kn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.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(qn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:D??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Zn=_.div`
2
+ display: flex;
3
+ position: relative;
4
+ height: 100vh;
5
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,Vn=_.div`
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ background-color: ${wn.overlayBackgroundBlack};
14
+ z-index: 5;
15
+ `,Jn=_.div`
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 42%;
20
+ height: 100%;
21
+ z-index: 6;
22
+ display: flex;
23
+ background-color: transparent;
24
+ overflow: hidden;
25
+ `,Wn=_.div`
26
+ position: fixed;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ z-index: 11;
32
+ display: flex;
33
+ flex-direction: column;
34
+ overflow-y: auto;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ `,Kn=_.button`
37
+ align-self: flex-end;
38
+ background: none;
39
+ border: none;
40
+ cursor: pointer;
41
+ padding: ${U.sp2} ${U.sp3};
42
+ line-height: 1;
43
+ color: ${e=>e.theme.colors.hero};
44
+ &:hover {
45
+ color: ${e=>e.theme.colors.primary};
46
+ }
47
+ svg {
48
+ width: ${U.sp4};
49
+ height: ${U.sp4};
50
+ }
51
+ `,qn=_.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,Qn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),c=de(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ht(n.remiActivities,Zt(t.currentTenant),r));const i=ce(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=et(o),i=Z(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Wt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Jt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(De(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Vt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Tn);function Xn(){const e=W(),t=le(),n=V(),r=n.hash.substring(1),c=Ge(),{reimbursementId:d}=Y(),m=P.getSignedInUser(),o=w(E=>J(E)),a=w(E=>Ue(E,d??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:I}=Ve(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:x}=Qe({isAiCfoOpen:p,setIsAiCfoOpen:I,mobileExploreReferrer:"Reimbursement Details"});Xe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:R}=ee(),{isFeatureEnabled:j}=R(v.isLimitedCategoryForReimbursement),[b,k]=g.useState(!1),[y,T]=g.useState(!1),[f,D]=g.useState(!1),{isFeatureEnabled:$}=R(v.isReimbursementCommentingEnabled),{isFeatureEnabled:A}=R(v.isShowDeletedReimbursementsFeatureEnabled),F=w(E=>me(E,d??"")),u=_t(o),M=Ot(o.userRole),z=a.fetchState;if(g.useEffect(()=>{b||d==null?b==1&&z==="Error"&&e("page-not-found",{replace:!0}):(k(!0),t(Gt(d,!1,A)))},[b,d,t,z]),g.useEffect(()=>{A&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&u===!1?D(!1):D(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(M||a.allApprovers.find(E=>E.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,M,o.isZeni,u,m]),g.useEffect(()=>{y||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||F.fetchState=="Completed"||F.fetchState=="In-Progress"||(T(!0),t(xe(!1,j,A,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(zt(!1,!0,!0,a.lastUpdatedByUserId)))},[y,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:C,onLoad:E=>(q=>{d!=null&&q.trackReimbursementReimbursementDetails(d)})(E)}),s.jsx(Qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:$,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:f,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:S,onAskAiCfoClick:x})]})}const Yn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(H())},onCloseReviewItem:n=>{e(qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Kt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(jn);function ea(){const e=W(),t=w(d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(d=>Le(d)),r=ne(),c=r?.loggedInUserRole?.includes("admin")===!0;return g.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Yn,{navigate:e,analytics:C,isAdmin:c})}const G=sn(),tt="bulk-operation-update",re="reimbursement-approval-rule-update",{spendManagement:ta,common:Be}=Ze.getLocalizedStrings(),we=ta.reimbursement.bulkActions,na=_.div`
57
+ display: flex;
58
+ min-height: 100%;
59
+ width: 100%;
60
+ flex: 1 1 auto;
61
+ flex-direction: column;
62
+ align-items: center;
63
+ background-color: ${e=>e.theme.colors.grey4};
64
+ `,aa=K(function(e,t){const n=$e(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=P.getSignedInUser(),d=de(c),m=e.tenantState.currentTenantId,o=J(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(S=>S!=="deleted"));const p=n.fetchState,I=on(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(S=>S.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${Mn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(H()),e(Me(o))},onSubtabChange:o=>{e(H()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=Z(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=Z(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(bn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(pn(o))},onFiltersChange:o=>{e(un({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(dn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ie(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(cn(o))},removeAllTransactionsFromBulkActionList:()=>{e(H())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(mn(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(re)&&e(ln(!1))},onEventReceived:o=>{o===tt&&e(rn())}}})(Un(Ln));function sa(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Ve(),n=W(),r=le(),c=V(),d=c.state,m=ze(),[o,a]=g.useState(null),i=ut("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect(()=>{if(d?.tab!=null&&d?.subTab!=null){const h=Qt(d.tab.toString());h!=null?r(Me(h)):console.log("Warning:Not a valid remiListTab");const O=Xt(d.subTab.toString());O!=null?r(Pe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{r(H())}},[]);const{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isBillPayCommentingEnabled),{isFeatureEnabled:x}=l(v.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=l(v.isReimbursementBulkActionEnabled),j=P.getSignedInUser(),b=w(h=>J(h)),[k,y]=g.useState(!1),[T,f]=g.useState(!1),D=ne(),$=D?.loggedInUserRole?.includes("admin")===!0,A=w(h=>$e(h,G,R)),{areTenantIdsInSync:F}=Dn(),u=A.fetchState,{isAiCfoAccessEnabled:M,onAskAiCfoClick:z}=Qe({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Reimbursement List"});if(Xe({isDataReady:u==="Completed"}),g.useEffect(()=>{!T&&F&&(f(!0),r(ie(G,!0,I,!1,!0)))},[T,G,r,F]),j==null)throw Error("Can't access address page without signing in...");const E=!!b?.userRole&&Yt(b),q=ue(D?.loggedInUserRoleMap),nt=pe(D?.loggedInUserRoleMap),at=!!b.userReimbursementInfo?.isReimbursementTOSAccepted,st=!!b.companyReimbursementInfo?.info?.isReimbursementEnabled,it=!!b.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ot=w(h=>Te(h.companyState,b.companyId)),rt=ot?.company.featuresActivationInfo.connectedAccountProvider,ge=h=>{y(h)},{isFeatureEnabled:lt}=l(v.isDebitCardFeatureEnabled),mt=Ne(lt,b),ct=_e(b),{remisProcessed:Q,remisProcessing:he}=w(h=>en(h));g.useEffect(()=>{Q===he&&o!=null&&(r(tn({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:Q>1?we.reports:we.report},{variableName:"_has_",variableValue:Q>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:nn(o)}]})),r(an()),setTimeout(()=>{r(ie(G,!0,I,!1,!0,!0))},3e3),a(null))},[Q,he]);const dt={events:b.companyId!=null?[`private-${b.companyId}.${tt}`,`private-${b.companyId}.${re}`]:[],eventCallback:(h,O,fe)=>{h.endsWith(re)?fe.onReimbursementApprovalRulesEventReceived?.(h):O.entity_type==="reimbursement"&&(a(O.operation_type),fe.onEventReceived(h))}};return c.pathname.endsWith("/reimbursements/")||c.pathname.endsWith("/reimbursements")||c.pathname.endsWith("/reimbursements/bulk-review")?mt===!0||ct===!0?s.jsx(Ke,{}):st&&(!E||q)||nt&&at?s.jsxs(s.Fragment,{children:[u==="Completed"?s.jsx(te,{analytics:C,onLoad:h=>(O=>O.trackPageLoaded(Je.Event.reimbursementHome))(h)}):null,s.jsx(Ye,{isAppContentDrawerOpen:k,handleDrawerToggle:ge}),s.jsxs(na,{windowSize:m,children:[s.jsx(_n,{isOpen:i,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{n("./"),r(H())},children:s.jsx(ra,{onClick:h=>h.stopPropagation(),children:s.jsx(ea,{})})}),s.jsx(aa,{isShowDeletedBillsEnabled:p,isShowDeletedReimbursementEnabled:I,isBillPayCommentingEnabled:S,isReimbursementCommentingEnabled:x,location:c,navigate:n,currentTenant:b,period:G,isAdmin:$,isEmployee:E,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:A.createdByUserList,createdByUserListFetchState:A.createdByUserListFetchState,isDownloadEnabled:A.isDownloadEnabled,connectedAccountProvider:rt,isBulkActionEnabled:R,bulkSubmissionLimit:A.remiBulkSubmissionLimit,bulkSubmissionFetchState:A.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:M,onAskAiCfoClick:z,...dt})]})]}):it&&q?s.jsx(N,{to:"../setup"}):D!=null&&Oe(b,D.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(be,{fetchState:"In-Progress"}):s.jsx(oe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=_(Nn)`
65
+ display: flex;
66
+ min-height: 100%;
67
+ flex-direction: column;
68
+ `,la=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:gn(e,n),analytics:C,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(fn(n))},onCreateNewRemiButtonClick:()=>{e(hn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Pn),ma=()=>{const e=W(),t=V(),{tenantEmailDomain:n}=Y(),r=We(),[c,d]=g.useState(!1),m=w(k=>J(k)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),p=ne(),I=ue(p?.loggedInUserRoleMap),S=pe(p?.loggedInUserRoleMap),x=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,R=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,j=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,b=k=>{d(k)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return R&&S&&x?s.jsx(N,{to:"../../../reimbursements"}):j&&I?s.jsx(N,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!j||m.userReimbursementInfo&&S&&x===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:C,onLoad:k=>(y=>y.trackPageLoaded(Je.Event.reimbursementPromoPage))(k)}),s.jsx(Ye,{isAppContentDrawerOpen:c,handleDrawerToggle:b}),s.jsx(la,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{b(!0)}})]}):s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function _a(){const e=w(E=>J(E)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=Ne(a,e),l=_e(e),p=e?.userRole!=null&&Sn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&In(t?.loggedInUserRoleMap),S=yn(t?.loggedInUserRoleMap),x=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,R=ue(t?.loggedInUserRoleMap),j=x&&R,{isFeatureEnabled:b}=m(v.isDepositAccountsFeatureEnabled),k=b&&!p&&Rn(t?.loggedInUserRoleMap),y=$n(e,o,a)&&!p&&An(t?.loggedInUserRoleMap),T=vn(t?.loggedInUserRoleMap),f=Cn(t?.loggedInUserRoleMap),D=kn(t?.loggedInUserRoleMap),$=En(t?.loggedInUserRoleMap),A=Bn(t?.loggedInUserRoleMap),F=pe(t?.loggedInUserRoleMap),{tenantEmailDomain:u}=Y(),M=V(),z=n===!0&&(R||F&&d);return s.jsxs(pt,{children:[M.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"verification"})}),s.jsx(B,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"setup"})}),s.jsx(B,{path:"promo",element:s.jsx(ma,{})}),s.jsx(B,{path:"approval-rules/*",element:j?s.jsx(On,{}):s.jsx(Gn,{isUserHasZeniAccountsAccess:f,isUserHasChargeCardAccess:$,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:F,isUserHasTreasuryAccess:D,isTenantBankingOnly:i,tenantEmailDomain:u??""})}),z&&s.jsx(B,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(B,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(B,{path:"*",element:s.jsx(N,{to:"../promo"})}),c&&R&&s.jsx(B,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):M.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"new",element:s.jsx(Ee,{})}),s.jsx(B,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(B,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]}):s.jsx(B,{path:"*",element:s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${U.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]})}export{_a as default};
@@ -0,0 +1 @@
1
+ import{j as d}from"./liveblocks-jLbycGCP.js";import{u as V,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-C7cnuUop.js";import{eM as M,f8 as g,Ip as Ie,pr as F,iY as ye,h_ as Ce,sN as ge,pw as we,bu as Se,Iq as Re,Ir as Te,j8 as Fe,bm as Oe,tP as ke,Is as Ae,It as De,sI as je,sM as Ee,Iu as G,Iv as Me,Iw as Pe,Ix as Le,Iy as Be,Iz as w,IA as O,IB as k,IC as H,ID as A,IE as D,dF as ve,tv as Ue,tj as Y,tk as N,tB as xe,to as q,tH as Ve,IF as ze,IG as Ge,IH as He,II as Ye,IJ as Ne,eT as qe,eR as $e}from"./zeni-epic-state-DPGmsT0c.js";import{I as Qe,K as Ze,Z as Je,a as Z,r as j,z as J,M as Ke,j as We,c as Xe,R as ea,d as E,g as aa,w as K,N as sa,O as ta,Q as oa}from"./index-B2lD3Jim.js";import"./mui-BkznVaFh.js";import na from"./NotFoundScreen-CPtlb4xk.js";import{F as ra}from"./FeaturePreviewScreen-CEV6r8QS.js";import{a as h}from"./sentry-CflaePyQ.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-4mjujgB-.js";import{u as pa}from"./useInitialThreadRequest-C_8EtcOe.js";import{t as $,a as Q}from"./routePaths-DBCGZwBw.js";import{M as fa}from"./MobileAppDrawer-YMrlHv7B.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="3a6a5143-149b-47d9-9554-a3143ffd582e",e._sentryDebugIdIdentifier="sentry-dbid-3a6a5143-149b-47d9-9554-a3143ffd582e")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},_a=he(function(e){const o=J.getSignedInUser(),p=e.tenantState.currentTenantId,u=M(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(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:E,isZeniUser:Oe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Fe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ve(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return $(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?$(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(O({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(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(O({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Le({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Pe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Ee())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ze(),p=Je(),u=ta(p),a=me(),s=ue(),t=V(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=Z(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=J.getSignedInUser(),[i,y]=h.useState(!1),[P,W]=h.useState(!1),{isFeatureEnabled:L}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>M(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(L?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),R=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),T=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!P&&C==="Completed"&&b&&(s(F(l.userId,!1,!0,!1)),W(!0))},[i,P,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(we(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const v=We(),oe=v?.loggedInUserRole!=null&&Se(v?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),U=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=V(),x=Qe(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>x?ma:void 0,[x]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:E,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:U}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:E,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:U,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:L,initialOpenThreadRequest:ee})]})}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 Ua(){const e=m(s=>M(s)),{useFeatureGate:o}=Z(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=qe(p,e),a=$e(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Ua as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-jLbycGCP.js";import{a as j,z as w,aI as y,R as E,d as p,g as F,cy as P,r as L}from"./index-B2lD3Jim.js";import"./mui-BkznVaFh.js";import l from"./NotFoundScreen-CPtlb4xk.js";import{a as f}from"./sentry-CflaePyQ.js";import{h as R,g as b,j as T,u as V,k as U,n as z,o as d}from"./core-C7cnuUop.js";import{eM as A,P0 as C,LS as Y,P1 as k,ta as G,eZ as M,P2 as O,t8 as Z}from"./zeni-epic-state-DPGmsT0c.js";import{R as x}from"./ReferralListScreen-t3nG_-Jq.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./useAskAiCfoHostNavButtonProps-BopsQ8w-.js";import"./useFetchSuggestedQuestionsWhenReady-4mjujgB-.js";import"./MobileAppDrawer-YMrlHv7B.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]="27e4ef97-64d2-4261-a0bf-2d8a57e21fc9",e._sentryDebugIdIdentifier="sentry-dbid-27e4ef97-64d2-4261-a0bf-2d8a57e21fc9")}catch{}})();const q=U(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(k()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(Z())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=R(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>A(o)),c=T(),S=V(),{useDynamicConfig:g}=j(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),D=Y(v);f.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),f.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(M(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:S,currentTenant:r,companyName:I,userName:_,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(z,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{ue as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-KTtbdLF8.js","assets/sentry-CflaePyQ.js","assets/core-C7cnuUop.js","assets/zeni-epic-state-DPGmsT0c.js","assets/index-B2lD3Jim.js","assets/mui-BkznVaFh.js","assets/analytics-B_kykzhy.js","assets/utils-t3ltqqZ0.js","assets/withTransactionSidePanel-m0PuYIs6.js","assets/useAskAiCfoHostNavButtonProps-BopsQ8w-.js","assets/useFetchSuggestedQuestionsWhenReady-4mjujgB-.js","assets/TransactionDetailScreen-RnHkkAvY.js","assets/decodeURIComponentSafe-rDkCEJpn.js","assets/routePaths-DBCGZwBw.js","assets/NotFoundScreen-CPtlb4xk.js","assets/analyticsHelper-Dp05MDBJ.js","assets/CompanyPassportScreen-BsQAk6DO.js","assets/MobileAppDrawer-YMrlHv7B.js","assets/FeaturePreviewScreen-CEV6r8QS.js","assets/ReferralListScreen-t3nG_-Jq.js","assets/index-D-vub4_t.css","assets/BillPayRoutes-C68APJ0s.js","assets/AddressScreen-BnTNp61r.js","assets/DomesticWireDetailScreen-DcjlQFtk.js","assets/useInitialThreadRequest-C_8EtcOe.js","assets/DrawerScreen-3KqQh33-.js","assets/SetupPagesScreen-BaHRYy46.js","assets/BusinessVerificationPageScreen-uevt4KH_.js","assets/BillPayApprovalRoutes-BVBiJezP.js","assets/ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.js","assets/getLocaleForTenant-DHk9xDoK.js","assets/ReimbursementRoutes-hOmxiTvW.js","assets/ReimbursementApprovalRoutes-D0b-XGea.js","assets/TransactionListRoutes-0LJWWSY0.js","assets/ZeniAccountStatementScreen-QylI0M1l.js","assets/SettingsRoutes-CyoLt7JH.js","assets/accountMappingHelper-B_vdVXJd.js","assets/QBOConnectionScreen-DdYGgWWD.js","assets/empty-B375B_HA.js","assets/index-DrxEgkQ-.js","assets/url-DZF6CZ5y.js","assets/index-CcLDrNJO.js","assets/ReportsRoutes-BYHcHW75.js","assets/ChargeCardRoutes-BDWNHmvV.js","assets/PeopleRoutes-Cb2v_H4M.js","assets/ExpenseAutomationRoutes-CKPTMKMk.js","assets/TreasuryRoutes-DxNNpbkP.js","assets/VendorsRoutes-CXNQHyD0.js","assets/pathToGoBack-DXgc_G9d.js","assets/ZeniAccountRoutes-CLx-Q3l6.js","assets/AddressRoutes-cGHfwdAO.js","assets/PandLWithForecastRoutes-XoBK7btv.js","assets/CustomerOnboardingRoutes-4bfKX61e.js","assets/TransactionDetailRoutes-72pTxmoR.js","assets/EntityDetailRoutes-B4XF7gyV.js","assets/NotificationRoutes-CLWgbDXX.js","assets/PerformanceRoutes-DWvTIqMy.js","assets/RewardsRoutes-BAINUSVd.js","assets/TaskRoutes-b0082ks-.js","assets/TaskListScreen-DqV1jPp4.js","assets/AiCfoScreen-C3DNvQlj.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bm as os,eM as ls,eT as cs,eR as ds,eS as ms,fD as us,eO as _s,cM as Ae,ct as As,f9 as Es,cl as ps,bB as Is,bp as gs,fe as xs,v as Ts,I1 as hs,bu as js,I2 as Us,bD as bs,fb as Ds,bC as Hs,br as Rs,cN as ys,I3 as fs,I4 as Cs,cJ as vs,cL as Os,cK as Ps,cs as Fs,cy as Ls,m3 as Ee,eN as pe,I5 as Bs,fi as Ie,fI as ge,fJ as xe,fj as ks}from"./zeni-epic-state-DPGmsT0c.js";import{j as e}from"./liveblocks-jLbycGCP.js";import{a as v}from"./sentry-CflaePyQ.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-C7cnuUop.js";import{m as ws,u as zs,z as D,a as Gs,c as $s,e as Ys,r as L,j as Ws,L as B,D as he,t as _,P as qs,d as X,l}from"./index-B2lD3Jim.js";import"./mui-BkznVaFh.js";import{f as je}from"./analyticsHelper-Dp05MDBJ.js";import{t as Js}from"./getLocaleForTenant-DHk9xDoK.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="637bafb8-0ceb-41dd-853e-b9badefc9e16",i._sentryDebugIdIdentifier="sentry-dbid-637bafb8-0ceb-41dd-853e-b9badefc9e16")}catch{}})();const Ks={dashboard:()=>a(()=>import("./DashboardRoutes-KTtbdLF8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>a(()=>import("./BillPayRoutes-C68APJ0s.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-hOmxiTvW.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20])),transactions:()=>a(()=>import("./TransactionListRoutes-0LJWWSY0.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>a(()=>import("./SettingsRoutes-CyoLt7JH.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>a(()=>import("./ReportsRoutes-BYHcHW75.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BDWNHmvV.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>a(()=>import("./PeopleRoutes-Cb2v_H4M.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-CKPTMKMk.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>a(()=>import("./TreasuryRoutes-DxNNpbkP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>a(()=>import("./VendorsRoutes-CXNQHyD0.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-CLx-Q3l6.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>a(()=>import("./ReportsRoutes-BYHcHW75.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),ea=l(()=>a(()=>import("./AddressRoutes-cGHfwdAO.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sa=l(()=>a(()=>import("./PeopleRoutes-Cb2v_H4M.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),aa=l(()=>a(()=>import("./PandLWithForecastRoutes-XoBK7btv.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),na=l(()=>a(()=>import("./CustomerOnboardingRoutes-4bfKX61e.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),ta=l(()=>a(()=>import("./VendorsRoutes-CXNQHyD0.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),ia=l(()=>a(()=>import("./TransactionDetailRoutes-72pTxmoR.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>a(()=>import("./EntityDetailRoutes-B4XF7gyV.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),ra=l(()=>a(()=>import("./DashboardRoutes-KTtbdLF8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),be=l(()=>a(()=>import("./BillPayRoutes-C68APJ0s.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),oa=l(()=>a(()=>import("./SettingsRoutes-CyoLt7JH.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),De=l(()=>a(()=>import("./ReimbursementRoutes-hOmxiTvW.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20]))),la=l(()=>a(()=>import("./ZeniAccountRoutes-CLx-Q3l6.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),ca=l(()=>a(()=>import("./TreasuryRoutes-DxNNpbkP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),da=l(()=>a(()=>import("./TransactionListRoutes-0LJWWSY0.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),ma=l(()=>a(()=>import("./ChargeCardRoutes-BDWNHmvV.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),ua=l(()=>a(()=>import("./NotificationRoutes-CLWgbDXX.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),_a=l(()=>a(()=>import("./PerformanceRoutes-DWvTIqMy.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),Aa=l(()=>a(()=>import("./ExpenseAutomationRoutes-CKPTMKMk.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),Ea=l(()=>a(()=>import("./RewardsRoutes-BAINUSVd.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),pa=l(()=>a(()=>import("./TaskRoutes-b0082ks-.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),Ia=l(()=>a(()=>import("./AiCfoScreen-C3DNvQlj.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>a(()=>import("./NotFoundScreen-CPtlb4xk.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),ga=l(()=>a(()=>import("./TaskListScreen-DqV1jPp4.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function Za({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),R=D.getSignedInUserTenant(o)?.tenantId,h=D.getSignedInUser(),J=os(h),G=Ms(),[N,Re]=v.useState(!1),r=z(n=>ls(n)),{useFeatureGate:P}=Gs(),K=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&J,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(n=>n.tenantState.fetchState),E=z(n=>n.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(n=>us(n));if(o!=null){const n=D.getSignedInUserTenant(o);h!=null&&n!=null&&je(h,r,S)}const w={tenantId:R,userId:h?.userId,sessionId:h?.zeniSessionId},ae=_s(),A=Ws(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ne=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(n=>w.tenantId!=null?Es(n,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&R!=null){const n=Q.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(R,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,R]),v.useEffect(()=>{N||(Re(!0),f(B.TENANT_FETCHING)),ne.current?ne.current=!1:!Ts(ae,w)&&D.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s){if(pe(b?.userId,b?.zeniSessionId,n.tenantId),d(Bs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=D.getSignedInUserTenantWithId(n.tenantId);s&&he.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ae,h,U,D]),v.useEffect(()=>{D.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(W&&ts){k(Ie(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else W&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),W&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(W){X.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,R,h,f,U))},[R,E]),v.useEffect(()=>{D.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&f(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&R!=null?(O(),_.markActiveTenantFetchCompleted(R)):E==="Error"&&R!=null&&(_.markActiveTenantFetchFailed(R),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,R,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(n=Qs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Ds(r.company),We=Pe&&Ye===!0&&!C,qe=re&&Hs(A?.loggedInUserRoleMap),Je=oe&&Rs(A?.loggedInUserRoleMap),Ke=me&&ys(A?.loggedInUserRoleMap),Qe=fs(A?.loggedInUserRoleMap),Xe=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=We&&I,as=oe&&g,ns=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ne===!0||Ge===!0||Qe===!0||Xe===!0;return D.isSignedIn()?R==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||J&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||J?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(xa,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(ra,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ns||F?e.jsx(sa,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(aa,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(na,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(ia,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(da,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(ga,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:qe||de||Ke||Je?e.jsx(ea,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(la,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(ca,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(_a,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(Aa,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(ua,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(ta,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(oa,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:as?e.jsx(ma,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(Ea,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(Ia,{isFileUploadEnabled:Ve}):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:{...G.state,message:"...",origin:G.pathname}}))}const xa=({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"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Ua,{tenantEmailDomain:O}):S?e.jsx(ja,{tenantEmailDomain:O}):U?e.jsx(ba,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(Ta,{tenantEmailDomain:O}):e.jsx(y,{}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ba=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),He=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,Za as default};
@@ -0,0 +1,57 @@
1
+ import{j as t}from"./liveblocks-jLbycGCP.js";import{a as u}from"./sentry-CflaePyQ.js";import{j as T,u as R,h as k,g as m,k as _,l as B,n as Y,o as C}from"./core-C7cnuUop.js";import{bm as Ie,eM as j,gr as ce,K2 as Ce,Ir as xe,j8 as le,lr as Ae,gt as Ee,K4 as we,K3 as je,Mt as Pe,wN as ke,Bg as Me,M2 as ve,Mb as De,b$ as re,cD as Ue,cE as Te,Ie as Fe,Mu as Re,If as _e,vd as Be,Mv as Ve,Dw as Le,AY as Oe,AP as de,AM as Ne,vh as ue,AS as pe,AV as ge,A$ as J,rQ as X,vg as $e,iM as H,iP as me,Mw as ze,jQ as Ke,vw as Ge,IZ as Ze,I_ as Qe,iK as qe,Mx as We,iN as Ye,My as He,vt as Je,Mz as Xe,MA as en,Bd as nn,eR as fe,eT as he,MB as tn,fw as an,Iq as sn,vs as te,fB as ae,fA as on,vr as cn,fz as ln,fy as rn,MC as dn,eW as be,MD as un,ME as pn,vz as gn,vq as se,MF as mn,fd as fn,vn as hn,bS as bn,b_ as Sn,bZ as yn,bT as In,bX as Cn,bW as xn,bV as An,bY as En,bU as wn}from"./zeni-epic-state-DPGmsT0c.js";import{a as ee,r as D,z as x,aa as Se,bx as jn,d as z,g as Pn,j as V,B as ne,by as kn,bz as Mn,al as vn,i as ye,bA as Dn,bB as Un,bC as Tn,a4 as Fn,M as Rn,bD as _n,w as Bn,bE as Vn}from"./index-B2lD3Jim.js";import{n as U}from"./mui-BkznVaFh.js";import{M}from"./MobileAppDrawer-YMrlHv7B.js";import{a as N,g as $,m as Ln}from"./accountMappingHelper-B_vdVXJd.js";import{t as On,A as Nn}from"./AddressScreen-BnTNp61r.js";import F from"./NotFoundScreen-CPtlb4xk.js";import{g as $n}from"./analyticsHelper-Dp05MDBJ.js";import{B as zn}from"./BusinessVerificationPageScreen-uevt4KH_.js";import{C as Kn}from"./CompanyPassportScreen-BsQAk6DO.js";import{q as oe}from"./QBOConnectionScreen-DdYGgWWD.js";import{B as Gn}from"./BillPayApprovalRoutes-BVBiJezP.js";import{R as Zn}from"./ReimbursementApprovalRoutes-D0b-XGea.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./routePaths-DBCGZwBw.js";import"./empty-B375B_HA.js";import"./pdf-lib-CDsnDRGG.js";import"./index-DrxEgkQ-.js";import"./url-DZF6CZ5y.js";import"./index-CcLDrNJO.js";import"./decodeURIComponentSafe-rDkCEJpn.js";import"./ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.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]="58549dd8-b0c7-48c5-a2c4-0ef139e32e28",e._sentryDebugIdIdentifier="sentry-dbid-58549dd8-b0c7-48c5-a2c4-0ef139e32e28")}catch{}})();const Qn=U.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,qn=_(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:A}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:L}=f,E=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),G=N(a.accountMappingView.billPayAccountList,l.selectedOption),Z=N(a.accountMappingView.reimbursementsAccountList,A.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),v=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Q=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),q=Ln(a.accountMappingView.expenseAccounts1099FilingAccountList,L),W={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:Z?.accountId,selectedPrepaidExpensesAccountIds:O.map(P=>P.accountId),selectedFixedAssetsAccountIds:h.map(P=>P.accountId),selectedAccruedExpensesAccountIds:v.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:Q.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:q};e(je({data:W}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(we())):e(ce())},onSaveClick:()=>{e(Ee()),o&&z.track(Pn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ae(a.currentTenant.companyId,n))}}})(jn),Wn=()=>{const e=T(),a=R(),i=k(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>j(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),A=y=>{g(y)};return t.jsxs(Qn,{children:[t.jsx(M,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),t.jsx(qn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>A(!0)})]})},Yn=U.div`
10
+ display: flex;
11
+ height: 100%;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,Hn=_(function(e,a){const i=j(e),c=ve(e),o=De(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:z}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(kn),Jn=()=>{const e=T(),a=R(),i=k(),{tenantEmailDomain:c}=B(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>j(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>Pe(S)),A=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(ke(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(Me(!0)))},[s,g,i]);const w=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(Yn,{children:[t.jsx(M,{isAppContentDrawerOpen:o,handleDrawerToggle:w}),t.jsx(Hn,{navigate:e,location:a,companyId:A,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Xn=U.div`
18
+ display: flex;
19
+ height: 100%;
20
+ width: 100%;
21
+ flex: 1 1 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,et=_(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=j(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:z}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(X(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(J(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Oe(o,s,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Mn),nt=()=>{const e=T(),a=R(),i=k(),{tenantEmailDomain:c}=B(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>j(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),A=Re(d,o?.loggedInUserRoleMap),y=_e(d,o?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(Be(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Xn,{children:[t.jsx(M,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:w,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:A,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=U.div`
26
+ display: flex;
27
+ height: 100%;
28
+ width: 100%;
29
+ flex: 1 1 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,at=_(function(e,a){const{companyId:i}=a,c=j(e),o=a.roleMap.bill_pay_admin,n=ze(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&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:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:z}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(X("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(J(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Ye(n))},updateCardPaymentModalState:n=>{e(We({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(qe(n,s,r))},handleFetchPaymentSources:()=>{e(H())},resetCardPaymentViewState:()=>{e(Qe())},handleResetCardPaymentErrorStatuses:()=>{e(Ze())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const s=On(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=k(),{tenantEmailDomain:c}=B(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>j(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=vn(b.addCardPaymentSourceStatus.fetchState),A=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(H()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&A==="Completed"&&i(H())},[l,A]);const S=I=>{n(I)};return w?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(M,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=_(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Je())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=B(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>j(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>He(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(M,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
34
+ display: flex;
35
+ height: 100%;
36
+ width: 100%;
37
+ flex: 1 1 auto;
38
+ flex-direction: column;
39
+ align-items: center;
40
+ background-color: ${e=>e.theme.colors.grey4};
41
+ `,lt=U.div`
42
+ display: flex;
43
+ height: 100%;
44
+ width: 100%;
45
+ flex: 1 1 auto;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ background-color: ${e=>e.theme.colors.grey4};
49
+ `,rt=()=>{const e=k(),{tenantEmailDomain:a}=B(),[i,c]=u.useState(!1),o=m(l=>j(l)).companyId??x.getSignedInUserTenant(a)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>Xe(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(X("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(J(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(M,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=U.div`
50
+ display: flex;
51
+ height: 100%;
52
+ width: 100%;
53
+ flex: 1 1 auto;
54
+ flex-direction: column;
55
+ align-items: center;
56
+ background-color: ${e=>e.theme.colors.grey4};
57
+ `,ie=({appContent:e})=>{const a=k(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>j(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),A=m(h=>le(h)),y=fe(s),w=he(g,s),S=!w&&A,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const E=m(h=>an(h,S)),K=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||p==null,G=sn(s),Z=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(M,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(_n,{myProfileView:E,isAccountingClassesEnabled:A,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:w,isCardsOnlyTenant:y,onAddressClick:h=>{const v=function(q,W){let P=`/${q}/settings/my_profile`;return P=P.concat(`/new/${W}`),P}(r,h),Q=Bn(c.state?.pathnameStackToGoBack,c.pathname);i(v,{state:{pathnameStackToGoBack:Q}})},onGetOtp:h=>{const v={...E.myProfileLocalData,phone:h};a(te({localData:v})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(h,v)=>{a(on(h,v,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=k(),a=m(l=>j(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(M,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Zt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>j(l)),n=V(),s=x.getSignedInUser(),r=k(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(Y,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Wn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(zn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),An(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Kn,{})}),En(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),wn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(Y,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(Y,{children:[t.jsx(C,{path:"/",element:t.jsx(Jn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(Gn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Zn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Zt as default};