@zeniai/web-app-ui 5.2.19-prod → 5.2.20-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/assets/AddressRoutes-EXo_W2G8.js +1 -0
  2. package/dist/assets/AddressScreen-2BaT3oA-.js +9 -0
  3. package/dist/assets/AiCfoScreen-D51UIBd5.js +22 -0
  4. package/dist/assets/{BillPayApprovalRoutes-guz2sdH1.js → BillPayApprovalRoutes-DmH2FpGv.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D0Ag3ATI.js → BillPayRoutes-DfJ2aUyG.js} +12 -12
  6. package/dist/assets/{BusinessVerificationPageScreen-BohezKn6.js → BusinessVerificationPageScreen-Bj1xk_4H.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-GOQqQudn.js → CardsAiCfoScreen-BgnMfnsv.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-C3e575qW.js → ChargeCardRoutes-OCtj3EGu.js} +10 -10
  9. package/dist/assets/{CompanyPassportScreen-CxVFTUSz.js → CompanyPassportScreen-DZx6t9Ym.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-MT-IQAtA.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-LgV5vbRx.js +1 -0
  12. package/dist/assets/CustomerOnboardingRoutes-wfQZLitF.js +30 -0
  13. package/dist/assets/{DashboardRoutes-BCmwgis8.js → DashboardRoutes-DZ3q6bkK.js} +4 -4
  14. package/dist/assets/{DefaultTenantHome-CC2FeaFy.js → DefaultTenantHome-p5Sm1nZ3.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-CkUpa35c.js +18 -0
  16. package/dist/assets/DrawerScreen-C0UDia2K.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-CVYJbbdy.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-DlWNUUJC.js +25 -0
  19. package/dist/assets/FeaturePreviewScreen-BnJlO_wg.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-CSIQ97oS.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-BjPIElfX.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-91bKq8wl.js +12 -0
  23. package/dist/assets/MobileAppDrawer-CinzTjr5.js +1 -0
  24. package/dist/assets/NotFoundScreen-0K6cd0N1.js +1 -0
  25. package/dist/assets/{NotificationRoutes-dRraueia.js → NotificationRoutes-D6XmhJmY.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-BoXeHjzR.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-CSWL87A6.js +1 -0
  28. package/dist/assets/PeopleRoutes-DYYpRS5n.js +22 -0
  29. package/dist/assets/PerformanceRoutes-D39M8yO2.js +1 -0
  30. package/dist/assets/{Preview-CxHKvNb3.js → Preview-K7kVfJNZ.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-vAHPaqo7.js → QBOConnectionScreen-OLT5sXwr.js} +1 -1
  32. package/dist/assets/ReimbursementApprovalRoutes-DBKdGYm6.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BdQmAA7j.js → ReimbursementApprovalRuleDetailScreen-DwTxQqE3.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-OiL1KOsA.js → ReimbursementRoutes-BGm8wHdZ.js} +8 -8
  35. package/dist/assets/{ReportsRoutes-cJ_74y1a.js → ReportsRoutes-NgI0ftPw.js} +1 -1
  36. package/dist/assets/RewardsRoutes-BR5NZ2Mx.js +1 -0
  37. package/dist/assets/ScreenRoutes-CXSdkcuS.js +2 -0
  38. package/dist/assets/SettingsRoutes-BaPhIBve.js +57 -0
  39. package/dist/assets/{SetupPagesScreen-DqGd8bGY.js → SetupPagesScreen-Cvdlisb9.js} +5 -5
  40. package/dist/assets/SignInScreen-D4Abp5hF.js +1 -0
  41. package/dist/assets/SignOutScreen-iBWPMOhx.js +9 -0
  42. package/dist/assets/TaskListScreen-C2zap0Rn.js +9 -0
  43. package/dist/assets/TaskRoutes-CZVLK5dG.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-D9ZuqZEq.js → TransactionDetailRoutes-Dxvv503N.js} +1 -1
  45. package/dist/assets/TransactionDetailScreen-4CysuAHi.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-t_0rbITT.js → TransactionListRoutes-DNSGDUp4.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-CVqgaqHD.js +37 -0
  48. package/dist/assets/{VendorsRoutes-Ba7d72j7.js → VendorsRoutes-DVTbhmec.js} +15 -15
  49. package/dist/assets/WiseConfirmationScreen-TxMYz6AU.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-DdIrrwcf.js → ZeniAccountRoutes-BvMIfD-Y.js} +11 -11
  51. package/dist/assets/ZeniAccountStatementScreen-D9RVH8zp.js +9 -0
  52. package/dist/assets/{accountMappingHelper-BmtW64tm.js → accountMappingHelper-gMZWceAt.js} +1 -1
  53. package/dist/assets/{analytics-C2MbRoEp.js → analytics-BP5D4JyB.js} +1 -1
  54. package/dist/assets/{analyticsHelper-DqO64pHt.js → analyticsHelper-BgeHTAVC.js} +1 -1
  55. package/dist/assets/{core-D2KaS3N5.js → core-BfWJ7zKT.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-CD_zntJd.js → decodeURIComponentSafe-D2jiQ7Do.js} +1 -1
  57. package/dist/assets/{dnd-D-AkKI2c.js → dnd-tQgCG5z3.js} +1 -1
  58. package/dist/assets/{empty-ByGkxZf5.js → empty-0zu7mfa-.js} +1 -1
  59. package/dist/assets/{empty-D1hMU_8M.js → empty-D4KL-CgN.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-B0o6h5Gb.js → emptyVideoElement-D2WpBqYb.js} +1 -1
  61. package/dist/assets/epic-_aUX4Son.js +2 -0
  62. package/dist/assets/getLocaleForTenant-BJ1a_Zja.js +1 -0
  63. package/dist/assets/{index-D6D50L1U.js → index-BtVRjclm.js} +1 -1
  64. package/dist/assets/{index-BQPo7Zt4.js → index-C2k_pBZi.js} +1 -1
  65. package/dist/assets/{index-CHRJI22G.js → index-CiS2dMrM.js} +1 -1
  66. package/dist/assets/index-Cx4f0JbF.css +1 -0
  67. package/dist/assets/{index-CivdpZRT.js → index-DWJVmwhz.js} +35734 -34803
  68. package/dist/assets/{index-Dyy6NuL-.js → index-DpTDwQon.js} +1 -1
  69. package/dist/assets/{index-BFVwI6w6.js → index-edb9TugW.js} +1 -1
  70. package/dist/assets/{index-nz48Z_9j.js → index-oBgu7-MV.js} +2 -2
  71. package/dist/assets/{index-CjrIzFQ1.js → index-zYcXrqlT.js} +1 -1
  72. package/dist/assets/{lexical-BQ-Po3YF.js → lexical-Bg8ldM3i.js} +1 -1
  73. package/dist/assets/liveblocks-DJbBe3tc.js +54 -0
  74. package/dist/assets/{lottie-Dz6JZ58r.js → lottie-BaCgeYyk.js} +1 -1
  75. package/dist/assets/{mui-C1ThRyKO.js → mui-ts7KHm6i.js} +1 -1
  76. package/dist/assets/{pathToGoBack-Du20FI7g.js → pathToGoBack-DG10zCZ4.js} +1 -1
  77. package/dist/assets/{pdf-2k8d7AeQ.js → pdf-C9HGpLCu.js} +4 -4
  78. package/dist/assets/{pdf-lib-DqPqgk_2.js → pdf-lib-DX6kz8a9.js} +1 -1
  79. package/dist/assets/{plaid-Do7hhR27.js → plaid-Cv0mPYlm.js} +1 -1
  80. package/dist/assets/{pusher-TY6R8jm6.js → pusher-CgG6vGRj.js} +1 -1
  81. package/dist/assets/{react-CASCBfCG.js → react-Bu9a3mw7.js} +1 -1
  82. package/dist/assets/{react-D8jfsv_0.js → react-CdB2kFeI.js} +1 -1
  83. package/dist/assets/{react-Bfs0rs07.js → react-Dp-aIPjg.js} +1 -1
  84. package/dist/assets/{react-DPqkDk9u.js → react-LH5dN4Ph.js} +1 -1
  85. package/dist/assets/{react-BReY6fnO.js → react-r7Nkvi02.js} +1 -1
  86. package/dist/assets/{react-CCcFi-WD.js → react-tqWON72J.js} +1 -1
  87. package/dist/assets/{recharts-jHFM5Sob.js → recharts-DNnhB5R_.js} +1 -1
  88. package/dist/assets/routePaths-DqVKIcAE.js +1 -0
  89. package/dist/assets/{sentry-DW4kKH26.js → sentry-C6T1HHHS.js} +1 -1
  90. package/dist/assets/{url-8bOSIiqX.js → url-CJ3E3PSB.js} +1 -1
  91. package/dist/assets/{url-GR46giUc.js → url-Xy6MI2YY.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CuA1dWGl.js → useAiCfoDashboardSuggestedQuestionsChips-BH6Wd98D.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-DJm2npkG.js +1 -0
  94. package/dist/assets/useCashManagementBanner-Bjdnpen4.js +1 -0
  95. package/dist/assets/{useChargeCardPusherEvents-9ezHPs6j.js → useChargeCardPusherEvents-Bfrohee4.js} +1 -1
  96. package/dist/assets/{useDeviceId-CHTVQQ8G.js → useDeviceId-DNuYTM17.js} +1 -1
  97. package/dist/assets/{useEmailConnectResultRefresh-Ddee2XH0.js → useEmailConnectResultRefresh-DFbMcoeq.js} +1 -1
  98. package/dist/assets/{useInitialThreadRequest-UA6eH2dj.js → useInitialThreadRequest-D3K2ol9C.js} +1 -1
  99. package/dist/assets/{utils-DIwqH7uj.js → utils-xWcqC4Wl.js} +1 -1
  100. package/dist/assets/withTransactionSidePanel-BMpiKSmG.js +21 -0
  101. package/dist/assets/{zeni-epic-state-BJ_gdj7r.js → zeni-epic-state-kow6PLud.js} +6 -6
  102. package/dist/index.html +1 -1
  103. package/package.json +7 -4
  104. package/dist/assets/AddressRoutes-B7ET6G-y.js +0 -1
  105. package/dist/assets/AddressScreen-CGTYstNo.js +0 -9
  106. package/dist/assets/AiCfoScreen-CA8qqox4.js +0 -22
  107. package/dist/assets/ConnectionAuthScreen-CDBmxiL_.js +0 -11
  108. package/dist/assets/CustomerOnboardingAuthScreen-DbN5QLGb.js +0 -1
  109. package/dist/assets/CustomerOnboardingRoutes-C6q0UB9j.js +0 -30
  110. package/dist/assets/DomesticWireDetailScreen-qVcyg1bS.js +0 -18
  111. package/dist/assets/DrawerScreen-YrXahOEM.js +0 -1
  112. package/dist/assets/EntityDetailRoutes-CteWzOFU.js +0 -1
  113. package/dist/assets/ExpenseAutomationRoutes-ChtLHwSX.js +0 -25
  114. package/dist/assets/FeaturePreviewScreen-C_bWMNSt.js +0 -1
  115. package/dist/assets/HubSpotOAuthCallbackScreen-CFlu3uRE.js +0 -1
  116. package/dist/assets/MagicLinkRoutes-B6CyGV5n.js +0 -72
  117. package/dist/assets/MagicLinkSignInScreen-CU5qkDL2.js +0 -12
  118. package/dist/assets/MobileAppDrawer-O95nPlSQ.js +0 -1
  119. package/dist/assets/NotFoundScreen-BeJq256C.js +0 -1
  120. package/dist/assets/OAuthConsentScreen-CRSd0T8_.js +0 -1
  121. package/dist/assets/PandLWithForecastRoutes-DdDF5n8o.js +0 -1
  122. package/dist/assets/PeopleRoutes-DPUju30P.js +0 -22
  123. package/dist/assets/PerformanceRoutes-BSNXb7w3.js +0 -1
  124. package/dist/assets/ReimbursementApprovalRoutes-DhrGnU7Q.js +0 -1
  125. package/dist/assets/RewardsRoutes-DaWb-BQo.js +0 -1
  126. package/dist/assets/ScreenRoutes-CRY8MlH6.js +0 -2
  127. package/dist/assets/SettingsRoutes-B0QfLxKl.js +0 -57
  128. package/dist/assets/SignInScreen-wUhLdLU-.js +0 -1
  129. package/dist/assets/SignOutScreen-BChwhvvy.js +0 -9
  130. package/dist/assets/TaskListScreen-q9ElonDb.js +0 -9
  131. package/dist/assets/TaskRoutes-B9S8VECk.js +0 -9
  132. package/dist/assets/TransactionDetailScreen-B77dqrVQ.js +0 -5
  133. package/dist/assets/TreasuryRoutes-C2A809wv.js +0 -37
  134. package/dist/assets/WiseConfirmationScreen-AJ6Zf-xE.js +0 -12
  135. package/dist/assets/ZeniAccountStatementScreen-BUgkOPv6.js +0 -9
  136. package/dist/assets/epic-C_V7SCDP.js +0 -2
  137. package/dist/assets/getLocaleForTenant--JGxRDjE.js +0 -1
  138. package/dist/assets/index-Czu7h9lW.css +0 -1
  139. package/dist/assets/liveblocks-BBLi67DG.js +0 -54
  140. package/dist/assets/routePaths-TRamKMNj.js +0 -1
  141. package/dist/assets/useAskAiCfoHostNavButtonProps-CNoSipqI.js +0 -1
  142. package/dist/assets/useCashManagementBanner-COk5CYpf.js +0 -1
  143. package/dist/assets/withTransactionSidePanel-DWx4OX2G.js +0 -21
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BBLi67DG.js";import{h as W,u as de,g as V,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-D2KaS3N5.js";import{eZ as H,R1 as ue,c7 as pe,F0 as Ue,kR as ut,Fd as oe,Fc as re,R2 as pt,bn as be,gw as Le,R3 as bt,Nt as gt,kG as Pe,Nu as ve,Nv as ht,jB as ft,Ql as St,jQ as Rt,EQ as It,uu as yt,jI as vt,FA as $e,R4 as Me,R5 as At,R6 as kt,R7 as Ct,R8 as Et,R9 as wt,Fk as Ae,jW as xt,Qu as Bt,Fe as Tt,E_ as Ft,Ra as jt,EZ as Dt,Rb as Ut,F6 as ke,Fo as Lt,Fn as Pt,Fj as $t,Rc as _e,Kz as Mt,bq as _t,F9 as Nt,FS as Gt,Rd as Ot,Re as zt,Fw as Zt,Ft as Ce,PQ as Vt,EX as Ht,Rf as Ne,Gi as Ee,Gq as Qt,Rg as Wt,Rh as z,Ri as qt,Rj as Ge,Rk as Kt,Rl as Oe,Rm as ze,FI as le,bu as Jt,bK as ge,cI as he,fG as Ze,fE as Ve,Rn as Xt,fB as Yt,Q1 as en,Ro as tn,Rp as He,Q5 as nn,QP as an,Rq as sn,R0 as on,Gn as we,Gm as rn,Rr as ln,Rs as mn,Rt as cn,Ru as dn,Rv as un,QA as pn,Gd as bn,Gh as gn,bs as hn,bJ as fn,cC as Sn,cq as Rn,bt as In,Mh as yn,cS as vn,cV as An,cU as kn,cB as Cn}from"./zeni-epic-state-BJ_gdj7r.js";import{v as Qe,K as We,A as ee,d as E,z as P,b$ as qe,C as te,f as A,aM as xe,o as j,au as X,I as En,O as Ke,c0 as wn,r as Z,a0 as Je,c1 as xn,e as ne,c2 as Bn,_ as Tn,F as Fn,B as fe,h as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-CivdpZRT.js";import{n as N,S as $n}from"./mui-C1ThRyKO.js";import me from"./NotFoundScreen-BeJq256C.js";import{S as Be}from"./SetupPagesScreen-DqGd8bGY.js";import{F as et}from"./FeaturePreviewScreen-C_bWMNSt.js";import{a as f}from"./sentry-DW4kKH26.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{u as tt}from"./useInitialThreadRequest-UA6eH2dj.js";import{D as Mn}from"./DrawerScreen-YrXahOEM.js";import{M as nt}from"./MobileAppDrawer-O95nPlSQ.js";import{R as _n}from"./ReimbursementApprovalRoutes-DhrGnU7Q.js";import{FallBackRoute as Nn}from"./ScreenRoutes-CRY8MlH6.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";import"./analyticsHelper-DqO64pHt.js";import"./routePaths-TRamKMNj.js";import"./BusinessVerificationPageScreen-BohezKn6.js";import"./ReimbursementApprovalRuleDetailScreen-BdQmAA7j.js";import"./getLocaleForTenant--JGxRDjE.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]="44ba6339-b8dc-4a85-9c2f-1971d5560880",e._sentryDebugIdIdentifier="sentry-dbid-44ba6339-b8dc-4a85-9c2f-1971d5560880")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ae(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(Ae("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(At());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function Fe(){const e=W(),t=de(),n=V(),{reimbursementId:r}=Y(),d=Qe(),c=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=V().pathname,F=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),k=P.getSignedInUser(),R=w((p=>H(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(k==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:A,onLoad:p=>(Q=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&Q.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Vn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Qn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
1
+ import{j as s}from"./liveblocks-DJbBe3tc.js";import{h as Q,u as de,g as H,i as Y,j as w,N as _,n as K,l as ct,o as dt,p as C}from"./core-BfWJ7zKT.js";import{e$ as V,Rh as ue,c7 as pe,F5 as Ue,kW as ut,Fi as oe,Fh as re,Ri as pt,bn as be,gy as Le,Rj as bt,NG as gt,kL as Pe,NH as ve,NI as ht,jG as ft,QB as St,jV as Rt,EV as It,uz as yt,jN as vt,FF as $e,Rk as Me,Rl as At,Rm as kt,Rn as Ct,Ro as Et,Rp as wt,Fp as Ae,j$ as xt,QK as Bt,Fj as Tt,F3 as Ft,Rq as jt,F2 as Dt,Rr as Ut,Fb as ke,Ft as Lt,Fs as Pt,Fo as $t,Rs as _e,KM as Mt,bq as _t,Fe as Nt,FX as Gt,Rt as Ot,Ru as zt,FB as Zt,Fy as Ce,Q4 as Ht,F0 as Vt,Rv as Ne,Gn as Ee,Gv as Wt,Rw as Qt,Rx as z,Ry as Kt,Rz as Ge,RA as qt,RB as Oe,RC as ze,FN as le,bu as Jt,bK as ge,cJ as he,fI as Ze,fG as He,RD as Xt,fD as Yt,Qh as en,RE as tn,RF as Ve,Ql as nn,R3 as an,RG as sn,Rg as on,Gs as we,Gr as rn,RH as ln,RI as mn,RJ as cn,RK as dn,RL as un,QQ as pn,Gi as bn,Gm as gn,bs as hn,bJ as fn,cD as Sn,cr as Rn,bt as In,Mu as yn,cT as vn,cW as An,cV as kn,cC as Cn}from"./zeni-epic-state-kow6PLud.js";import{x as We,J as Qe,w as ee,i as E,z as P,b$ as Ke,A as te,f as A,aM as xe,o as j,au as X,H as En,a as qe,c0 as wn,v as Z,a0 as Je,c1 as xn,D as ne,c2 as Bn,X as Tn,F as Fn,B as fe,h as Xe,a9 as jn,bn as Dn,a4 as Un,E as Ye,c3 as Ln,d as Pn}from"./index-DWJVmwhz.js";import{n as N,S as $n}from"./mui-ts7KHm6i.js";import me from"./NotFoundScreen-0K6cd0N1.js";import{S as Be}from"./SetupPagesScreen-Cvdlisb9.js";import{F as et}from"./FeaturePreviewScreen-BnJlO_wg.js";import{a as f}from"./sentry-C6T1HHHS.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DJm2npkG.js";import{u as tt}from"./useInitialThreadRequest-D3K2ol9C.js";import{D as Mn}from"./DrawerScreen-C0UDia2K.js";import{M as nt}from"./MobileAppDrawer-CinzTjr5.js";import{R as _n}from"./ReimbursementApprovalRoutes-DBKdGYm6.js";import{FallBackRoute as Nn}from"./ScreenRoutes-CXSdkcuS.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";import"./analyticsHelper-BgeHTAVC.js";import"./routePaths-DqVKIcAE.js";import"./BusinessVerificationPageScreen-Bj1xk_4H.js";import"./ReimbursementApprovalRuleDetailScreen-DwTxQqE3.js";import"./getLocaleForTenant-BJ1a_Zja.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]="e211d5c7-077e-4108-9390-88cf21adf661",e._sentryDebugIdIdentifier="sentry-dbid-e211d5c7-077e-4108-9390-88cf21adf661")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=qe.getLocalizedStrings(),On=K((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ae(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(Ae("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(At());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function Fe(){const e=Q(),t=de(),n=H(),{reimbursementId:r}=Y(),d=We(),c=Qe(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,F=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),k=P.getSignedInUser(),R=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(k==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ke,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:A,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Qn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -12,7 +12,7 @@ import{j as s}from"./liveblocks-BBLi67DG.js";import{h as W,u as de,g as V,i as Y
12
12
  bottom: 0;
13
13
  background-color: ${En.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,Vn=N.div`
15
+ `,Hn=N.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-BBLi67DG.js";import{h as W,u as de,g as V,i as Y
22
22
  display: flex;
23
23
  background-color: transparent;
24
24
  overflow: hidden;
25
- `,Hn=N.div`
25
+ `,Vn=N.div`
26
26
  position: fixed;
27
27
  top: 0;
28
28
  left: 0;
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-BBLi67DG.js";import{h as W,u as de,g as V,i as Y
33
33
  flex-direction: column;
34
34
  overflow-y: auto;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- `,Qn=N.button`
36
+ `,Wn=N.button`
37
37
  align-self: flex-end;
38
38
  background: none;
39
39
  border: none;
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-BBLi67DG.js";import{h as W,u as de,g as V,i as Y
48
48
  width: ${j.sp4};
49
49
  height: ${j.sp4};
50
50
  }
51
- `,Wn=N.div`
51
+ `,Qn=N.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=q((function(e,t){const n=_e(e,t.reimbursementId),r=P.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=pe(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:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Me());const a=at(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Ht(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Vt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{A.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?A.trackReimbursementCancelAndDeleteReimbursement(n):A.trackReimbursementCancelReimbursement(n),e(Zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Kn(){const e=W(),t=de(),n=V(),r=n.hash.substring(1),d=Qe(),{reimbursementId:c}=Y(),m=P.getSignedInUser(),o=w((I=>H(I))),a=w((I=>_e(I,c??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[F,v]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:k}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w((I=>ue(I,c??""))),U=Mt(o),L=_t(o.userRole),$=a.fetchState;if(f.useEffect((()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(Nt(c,!1,R)))}),[u,c,t,$]),f.useEffect((()=>{R&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((I=>I.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),f.useEffect((()=>{F||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t(Ue(!1,T,R,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))}),[F,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:A,onLoad:I=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(I)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:k,isShowDeletedReimbursementEnabled:R,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Jn=q((function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Qt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(Bn);function Xn(){const e=W(),t=w((c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:n}=w((c=>Ne(c))),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{t!=="Completed"&&n.length!==0||e("./")}),[t,n.length]),s.jsx(Jn,{navigate:e,analytics:A,isAdmin:d})}const O=nn(),st="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Yn,common:je}=Ke.getLocalizedStrings(),De=Yn.reimbursement.bulkActions,ea=N.div`
56
+ `,Kn=K((function(e,t){const n=_e(e,t.reimbursementId),r=P.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=pe(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:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Me());const a=at(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{A.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?A.trackReimbursementCancelAndDeleteReimbursement(n):A.trackReimbursementCancelReimbursement(n),e(Zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function qn(){const e=Q(),t=de(),n=H(),r=n.hash.substring(1),d=We(),{reimbursementId:c}=Y(),m=P.getSignedInUser(),o=w((I=>V(I))),a=w((I=>_e(I,c??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[F,v]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:k}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w((I=>ue(I,c??""))),U=Mt(o),L=_t(o.userRole),$=a.fetchState;if(f.useEffect((()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(Nt(c,!1,R)))}),[u,c,t,$]),f.useEffect((()=>{R&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((I=>I.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),f.useEffect((()=>{F||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t(Ue(!1,T,R,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))}),[F,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Ke,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:A,onLoad:I=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(I)}),s.jsx(Kn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:k,isShowDeletedReimbursementEnabled:R,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Jn=K((function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(Bn);function Xn(){const e=Q(),t=w((c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:n}=w((c=>Ne(c))),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{t!=="Completed"&&n.length!==0||e("./")}),[t,n.length]),s.jsx(Jn,{navigate:e,analytics:A,isAdmin:d})}const O=nn(),st="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Yn,common:je}=qe.getLocalizedStrings(),De=Yn.reimbursement.bulkActions,ea=N.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-BBLi67DG.js";import{h as W,u as de,g as V,i as Y
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ta=q((function(e,t){const n=ze(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((h=>h!=="deleted")));const b=n.fetchState,y=an(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((h=>h.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:A,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:O,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ge(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;A?.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(un({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(dn(o))},onFiltersChange:o=>{e(cn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&A.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&A.trackSpendManagementDownloadClick("reimbursement"),e(mn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(ln(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(rn(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(on(!1))},onEventReceived:o=>{o===st&&e(sn())}}}))(jn(Dn));function na(){const e=W(),t=de(),n=V(),r=n.state,d=We(),[c,m]=f.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(Ge(S)):console.log("Warning:Not a valid remiListTab");const G=Kt(r.subTab.toString());G!=null?t(Oe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}}),[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=w((S=>H(S))),[x,F]=f.useState(!1),[v,D]=f.useState(!1),B=ne(),k=B?.loggedInUserRole?.includes("admin")===!0,R=w((S=>ze(S,O,h))),{areTenantIdsInSync:g}=Tn(),U=R.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:U==="Completed"}),f.useEffect((()=>{!v&&g&&(D(!0),t(le(O,!0,l,!1,!0)))}),[v,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const I=!!u?.userRole&&Jt(u),p=ge(B?.loggedInUserRoleMap),Q=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,K=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w((S=>Le(S.companyState,u.companyId))),it=ie?.company.featuresActivationInfo.connectedAccountProvider,Re=S=>{F(S)},{isFeatureEnabled:ot}=a(E.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=Ve(u),{remisProcessed:J,remisProcessing:Ie}=w((S=>Xt(S)));f.useEffect((()=>{J===Ie&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?De.reports:De.report},{variableName:"_has_",variableValue:J>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:en(c)}]})),t(tn()),setTimeout((()=>{t(le(O,!0,l,!1,!0,!0))}),3e3),m(null))}),[J,Ie]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,G,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(et,{}):K&&(!I||p)||Q&&ae?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(te,{analytics:A,onLoad:S=>(G=>G.trackPageLoaded(Xe.Event.reimbursementHome))(S)}):null,s.jsx(nt,{isAppContentDrawerOpen:x,handleDrawerToggle:Re}),s.jsxs(ea,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:O,isAdmin:k,isEmployee:I,entity:"reimbursement",onClickMenuIcon:()=>{Re(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:it,isBulkActionEnabled:h,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&He(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=N($n)`
64
+ `,ta=K((function(e,t){const n=ze(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((h=>h!=="deleted")));const b=n.fetchState,y=an(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((h=>h.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:A,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:O,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ge(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;A?.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(un({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(dn(o))},onFiltersChange:o=>{e(cn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&A.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&A.trackSpendManagementDownloadClick("reimbursement"),e(mn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(ln(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(rn(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(on(!1))},onEventReceived:o=>{o===st&&e(sn())}}}))(jn(Dn));function na(){const e=Q(),t=de(),n=H(),r=n.state,d=Qe(),[c,m]=f.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Kt(r.tab.toString());S!=null?t(Ge(S)):console.log("Warning:Not a valid remiListTab");const G=qt(r.subTab.toString());G!=null?t(Oe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}}),[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=w((S=>V(S))),[x,F]=f.useState(!1),[v,D]=f.useState(!1),B=ne(),k=B?.loggedInUserRole?.includes("admin")===!0,R=w((S=>ze(S,O,h))),{areTenantIdsInSync:g}=Tn(),U=R.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:U==="Completed"}),f.useEffect((()=>{!v&&g&&(D(!0),t(le(O,!0,l,!1,!0)))}),[v,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const I=!!u?.userRole&&Jt(u),p=ge(B?.loggedInUserRoleMap),W=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,q=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w((S=>Le(S.companyState,u.companyId))),it=ie?.company.featuresActivationInfo.connectedAccountProvider,Re=S=>{F(S)},{isFeatureEnabled:ot}=a(E.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=He(u),{remisProcessed:J,remisProcessing:Ie}=w((S=>Xt(S)));f.useEffect((()=>{J===Ie&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?De.reports:De.report},{variableName:"_has_",variableValue:J>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:en(c)}]})),t(tn()),setTimeout((()=>{t(le(O,!0,l,!1,!0,!0))}),3e3),m(null))}),[J,Ie]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,G,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(et,{}):q&&(!I||p)||W&&ae?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(te,{analytics:A,onLoad:S=>(G=>G.trackPageLoaded(Xe.Event.reimbursementHome))(S)}):null,s.jsx(nt,{isAppContentDrawerOpen:x,handleDrawerToggle:Re}),s.jsxs(ea,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:O,isAdmin:k,isEmployee:I,entity:"reimbursement",onClickMenuIcon:()=>{Re(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:it,isBulkActionEnabled:h,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ve(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=N($n)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,oa=q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:pn(e,n),analytics:A,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(gn(n))},onCreateNewRemiButtonClick:()=>{e(bn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Ln),ra=()=>{const e=W(),t=V(),{tenantEmailDomain:n}=Y(),r=Ye(),[d,c]=f.useState(!1),m=w((v=>H(v))),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,F=v=>{c(v)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:A,onLoad:v=>(D=>D.trackPageLoaded(Xe.Event.reimbursementPromoPage))(v)}),s.jsx(nt,{isAppContentDrawerOpen:d,handleDrawerToggle:F}),s.jsx(oa,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{F(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function $a(){const e=w((ie=>H(ie))),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ye(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ze(a,e),l=Ve(e),b=e?.userRole!=null&&hn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&fn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,F=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=F&&Rn(t?.loggedInUserRoleMap),D=Pn(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),k=yn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),U=F&&R,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=kn(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),Q=D&&$,{tenantEmailDomain:ae}=Y(),K=V(),se=n===!0&&(u||p&&c);return s.jsxs(dt,{children:[K.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(ra,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(_n,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:Q,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(et,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):K.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Fe,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{$a as default};
68
+ `,oa=K((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:pn(e,n),analytics:A,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(gn(n))},onCreateNewRemiButtonClick:()=>{e(bn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Ln),ra=()=>{const e=Q(),t=H(),{tenantEmailDomain:n}=Y(),r=Ye(),[d,c]=f.useState(!1),m=w((v=>V(v))),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,F=v=>{c(v)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:A,onLoad:v=>(D=>D.trackPageLoaded(Xe.Event.reimbursementPromoPage))(v)}),s.jsx(nt,{isAppContentDrawerOpen:d,handleDrawerToggle:F}),s.jsx(oa,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{F(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function $a(){const e=w((ie=>V(ie))),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ye(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ze(a,e),l=He(e),b=e?.userRole!=null&&hn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&fn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,F=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=F&&Rn(t?.loggedInUserRoleMap),D=Pn(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),k=yn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),U=F&&R,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=kn(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),W=D&&$,{tenantEmailDomain:ae}=Y(),q=H(),se=n===!0&&(u||p&&c);return s.jsxs(dt,{children:[q.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(ra,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(_n,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:W,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(et,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):q.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Fe,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(qn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{$a as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-BBLi67DG.js";import{g as z,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-D2KaS3N5.js";import{eZ as L,fV as w,MK as Te,kG as K,r9 as W,r_ as A,ku as Re,jy as Me,vx as J,s3 as Oe,bs as Ae,ML as ke,bn as Fe,wG as De,MM as je,MN as Ee,vp as Pe,MO as N,MP as Le,MQ as Be,MR as ve,MS as Ve,MT as I,MU as k,MV as F,MW as H,MX as D,MY as j,dI as Ue,wm as xe,wa as $,wb as Z,ws as Ge,wf as q,wy as ze,MZ as Ye,M_ as Ne,M$ as He,N0 as $e,N1 as Ze,fG as qe,fE as Qe}from"./zeni-epic-state-BJ_gdj7r.js";import{U as Xe,X as Ke,Y as We,Z as Je,K as ea,A as ee,d as E,z as ae,_ as aa,e as sa,a as ta,$ as oa,a0 as na,C as ra,f as P,h as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import fa from"./NotFoundScreen-BeJq256C.js";import{F as ma}from"./FeaturePreviewScreen-C_bWMNSt.js";import{a as _}from"./sentry-DW4kKH26.js";import{u as ua}from"./useInitialThreadRequest-UA6eH2dj.js";import{t as Q,a as X,b as _a}from"./routePaths-TRamKMNj.js";import{M as ha}from"./MobileAppDrawer-O95nPlSQ.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.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]="468638e6-e714-4054-9860-c7aef4fe581a",e._sentryDebugIdIdentifier="sentry-dbid-468638e6-e714-4054-9860-c7aef4fe581a")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ne()),e(He()),e($e()),e(Ze())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(Z(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ge(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(Z(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(ve({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(N({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>K(n))),M=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=z(),G=Xe(he??"")==="reports",be=Ke(_e),ye=_.useMemo((()=>G?ba:void 0),[G]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:v,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ga(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=qe(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{Ga as default};
1
+ import{j as p}from"./liveblocks-DJbBe3tc.js";import{g as z,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as G}from"./core-BfWJ7zKT.js";import{e$ as L,fX as w,MX as Te,kL as J,re as W,s3 as k,kz as Re,jD as Oe,vC as K,s8 as Ae,bs as ke,MY as Fe,bn as De,wL as je,MZ as Ee,M_ as Pe,vu as Me,M$ as Y,N0 as Le,N1 as Ne,N2 as ve,N3 as Be,N4 as I,N5 as F,N6 as D,N7 as H,N8 as j,N9 as E,dL as Ve,wr as Ue,wf as $,wg as q,wx as xe,wk as Z,wD as ze,Na as Ge,Nb as Ye,Nc as He,Nd as $e,Ne as qe,fI as Ze,fG as Xe}from"./zeni-epic-state-kow6PLud.js";import{R as Qe,T as Je,V as We,W as Ke,J as ea,w as ee,i as P,z as ae,X as aa,D as sa,c as ta,Z as oa,a0 as na,A as ra,f as M,h as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-DWJVmwhz.js";import"./mui-ts7KHm6i.js";import fa from"./NotFoundScreen-0K6cd0N1.js";import{F as ma}from"./FeaturePreviewScreen-BnJlO_wg.js";import{a as _}from"./sentry-C6T1HHHS.js";import{u as ua}from"./useInitialThreadRequest-D3K2ol9C.js";import{t as X,a as Q,b as _a}from"./routePaths-DqVKIcAE.js";import{M as ha}from"./MobileAppDrawer-CinzTjr5.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.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]="932cbca6-8d09-4794-9baf-4496a7a043e2",e._sentryDebugIdIdentifier="sentry-dbid-932cbca6-8d09-4794-9baf-4496a7a043e2")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(He()),e($e()),e(qe())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:M,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(ve({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Ne({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Me()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[N,te]=_.useState(!1),{isFeatureEnabled:v}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),B=d((n=>J(n))),O=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(k(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!N&&C==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))}),[i,N,C,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(K());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,B,O]);const V=sa(),de=V?.loggedInUserRole!=null&&ke(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),U=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=Qe(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>x?ba:void 0),[x]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:M,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:M,filter:b,isAccountingClassesEnabled:B,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:v,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function xa(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=Ze(f,e),a=Xe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{xa as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-DJbBe3tc.js";import{z as w,A as S,f as u,h as E,da as k,w as I,i as C}from"./index-DWJVmwhz.js";import"./mui-ts7KHm6i.js";import g from"./NotFoundScreen-0K6cd0N1.js";import{a as c}from"./sentry-C6T1HHHS.js";import{u as D,j as h,h as F,g as U,n as L,o as T,p as f,N as y}from"./core-BfWJ7zKT.js";import{e$ as _,Ue as j,Uf as p,w6 as P,fO as V,Ug as z,w4 as A}from"./zeni-epic-state-kow6PLud.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.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]="14fe87df-ea73-4340-ac36-284b96168822",e._sentryDebugIdIdentifier="sentry-dbid-14fe87df-ea73-4340-ac36-284b96168822")}catch{}})();const G=L((function(e,t){const n=j(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(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(A())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),O=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),m=F(),x=U(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),b=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:x,currentTenant:r,companyName:v,userName:b,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DZ3q6bkK.js","assets/sentry-C6T1HHHS.js","assets/core-BfWJ7zKT.js","assets/zeni-epic-state-kow6PLud.js","assets/index-DWJVmwhz.js","assets/mui-ts7KHm6i.js","assets/analytics-BP5D4JyB.js","assets/utils-xWcqC4Wl.js","assets/withTransactionSidePanel-BMpiKSmG.js","assets/useAskAiCfoHostNavButtonProps-DJm2npkG.js","assets/TransactionDetailScreen-4CysuAHi.js","assets/decodeURIComponentSafe-D2jiQ7Do.js","assets/routePaths-DqVKIcAE.js","assets/NotFoundScreen-0K6cd0N1.js","assets/useInitialThreadRequest-D3K2ol9C.js","assets/analyticsHelper-BgeHTAVC.js","assets/CompanyPassportScreen-DZx6t9Ym.js","assets/MobileAppDrawer-CinzTjr5.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BH6Wd98D.js","assets/FeaturePreviewScreen-BnJlO_wg.js","assets/index-Cx4f0JbF.css","assets/BillPayRoutes-DfJ2aUyG.js","assets/AddressScreen-2BaT3oA-.js","assets/DomesticWireDetailScreen-CkUpa35c.js","assets/DrawerScreen-C0UDia2K.js","assets/SetupPagesScreen-Cvdlisb9.js","assets/BusinessVerificationPageScreen-Bj1xk_4H.js","assets/BillPayApprovalRoutes-DmH2FpGv.js","assets/ReimbursementApprovalRuleDetailScreen-DwTxQqE3.js","assets/getLocaleForTenant-BJ1a_Zja.js","assets/ReimbursementRoutes-BGm8wHdZ.js","assets/ReimbursementApprovalRoutes-DBKdGYm6.js","assets/TransactionListRoutes-DNSGDUp4.js","assets/ZeniAccountStatementScreen-D9RVH8zp.js","assets/SettingsRoutes-BaPhIBve.js","assets/accountMappingHelper-gMZWceAt.js","assets/useEmailConnectResultRefresh-DFbMcoeq.js","assets/QBOConnectionScreen-OLT5sXwr.js","assets/empty-D4KL-CgN.js","assets/index-CiS2dMrM.js","assets/url-CJ3E3PSB.js","assets/index-DpTDwQon.js","assets/ReportsRoutes-NgI0ftPw.js","assets/ChargeCardRoutes-OCtj3EGu.js","assets/useChargeCardPusherEvents-Bfrohee4.js","assets/PeopleRoutes-DYYpRS5n.js","assets/ExpenseAutomationRoutes-DlWNUUJC.js","assets/TreasuryRoutes-CVqgaqHD.js","assets/useCashManagementBanner-Bjdnpen4.js","assets/VendorsRoutes-DVTbhmec.js","assets/pathToGoBack-DG10zCZ4.js","assets/ZeniAccountRoutes-BvMIfD-Y.js","assets/AddressRoutes-EXo_W2G8.js","assets/PandLWithForecastRoutes-CSWL87A6.js","assets/CustomerOnboardingRoutes-wfQZLitF.js","assets/TransactionDetailRoutes-Dxvv503N.js","assets/EntityDetailRoutes-CVYJbbdy.js","assets/NotificationRoutes-D6XmhJmY.js","assets/PerformanceRoutes-D39M8yO2.js","assets/RewardsRoutes-BR5NZ2Mx.js","assets/TaskRoutes-CZVLK5dG.js","assets/TaskListScreen-C2zap0Rn.js","assets/AiCfoScreen-D51UIBd5.js","assets/CardsAiCfoScreen-BgnMfnsv.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as ls,e$ as us,fI as ds,fG as cs,gq as ms,fv as _s,cX as Ee,cD as hs,fY as Es,cv as ps,bE as xs,bo as Rs,g0 as gs,v as Is,Mt as js,bs as Ts,Mu as As,bK as fs,bJ as Ds,bt as ys,cr as bs,Mv as Cs,Mw as vs,cT as ws,cW as Us,cV as Os,cC as Ps,cJ as Fs,on as pe,fE as xe,gD as Ls,g4 as Re,gA as ge,gB as Ie,g5 as ks}from"./zeni-epic-state-kow6PLud.js";import{j as e}from"./liveblocks-DJbBe3tc.js";import{a as O}from"./sentry-C6T1HHHS.js";import{u as Bs,h as Hs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-BfWJ7zKT.js";import{E as Ms,u as Zs,z as y,w as Gs,c as zs,Q as $s,i as z,d as Ys,e as Ws,D as qs,L as F,a as Te,t as _,P as Js,f as X,l}from"./index-DWJVmwhz.js";import"./mui-ts7KHm6i.js";import{f as Ae}from"./analyticsHelper-BgeHTAVC.js";import{t as Ks}from"./getLocaleForTenant-BJ1a_Zja.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="674edba9-20dd-46d8-9dc8-a141bcf02286",o._sentryDebugIdIdentifier="sentry-dbid-674edba9-20dd-46d8-9dc8-a141bcf02286")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-DZ3q6bkK.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:()=>t((()=>import("./BillPayRoutes-DfJ2aUyG.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-BGm8wHdZ.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-DNSGDUp4.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-BaPhIBve.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-NgI0ftPw.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-OCtj3EGu.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-DYYpRS5n.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-DlWNUUJC.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-CVqgaqHD.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-DVTbhmec.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-BvMIfD-Y.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-NgI0ftPw.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),st=l((()=>t((()=>import("./AddressRoutes-EXo_W2G8.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),tt=l((()=>t((()=>import("./PeopleRoutes-DYYpRS5n.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CSWL87A6.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-wfQZLitF.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),ot=l((()=>t((()=>import("./VendorsRoutes-DVTbhmec.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-Dxvv503N.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),fe=l((()=>t((()=>import("./EntityDetailRoutes-CVYJbbdy.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),it=l((()=>t((()=>import("./DashboardRoutes-DZ3q6bkK.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-DfJ2aUyG.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),lt=l((()=>t((()=>import("./SettingsRoutes-BaPhIBve.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),ye=l((()=>t((()=>import("./ReimbursementRoutes-BGm8wHdZ.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-BvMIfD-Y.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),dt=l((()=>t((()=>import("./TreasuryRoutes-CVqgaqHD.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),ct=l((()=>t((()=>import("./TransactionListRoutes-DNSGDUp4.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-OCtj3EGu.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),_t=l((()=>t((()=>import("./NotificationRoutes-D6XmhJmY.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),ht=l((()=>t((()=>import("./PerformanceRoutes-D39M8yO2.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-DlWNUUJC.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),pt=l((()=>t((()=>import("./RewardsRoutes-BR5NZ2Mx.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-CZVLK5dG.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),Rt=l((()=>t((()=>import("./AiCfoScreen-D51UIBd5.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),be=l((()=>t((()=>import("./CardsAiCfoScreen-BgnMfnsv.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),C=l((()=>t((()=>import("./NotFoundScreen-0K6cd0N1.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-C2zap0Rn.js").then((o=>o.f))),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function St({setTenantEmailDomain:o}){const T=Bs(),V=Hs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:w,clearAllLoading:v,clearLoading:k}=Zs(),A=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=ls(I),$=Ss(),[B,Oe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Pe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Le}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),f=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||f==="Completed"?ds(ne,r):void 0,J=j==="Completed"||f==="Completed"?cs(r):void 0,ke=Ys(r,Le,ne),{isCardsHidden:Be}=Ws(r?.tenantId),He=!ke||!!Be,{isFeatureEnabled:Ve}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&Ae(I,r,L)}const Z={tenantId:A,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=hs(E?.loggedInUserRoleMap),oe=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{w(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&A!=null){const n=Q.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Rs();c.isAfter(S,"month")===!1?T(gs(A,{month:d,year:s})):V("./month_end_close_checks/review")}}}}),[Q,A]),O.useEffect((()=>{B||(Oe(!0),w(F.TENANT_FETCHING))}),[B,Z,ae,I,T,y]),O.useLayoutEffect((()=>{!Is(ae,Z)&&y.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s){if(xe(D?.userId,D?.zeniSessionId,n.tenantId),d(Ls(!0)),d(Re(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Te.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Me))}),[A]),O.useEffect((()=>{y.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){H(Re(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)));if(W){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(pe(c.userId,c.zeniSessionId)))}})(f,j,r,A,I,w,T))}),[A,j]),O.useEffect((()=>{y.isSignedIn()&&f==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&Ae(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,f,r,I]),O.useEffect((()=>{j==="In-Progress"&&w(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&A!=null?(v(),_.markActiveTenantFetchCompleted(A)):j==="Error"&&A!=null&&(_.markActiveTenantFetchFailed(A),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[j,f,A,B]);const re=O.useRef(!1);O.useEffect((()=>{!re.current&&j==="Completed"&&B&&(re.current=!0,(function(n=Xs,D=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),D)})())}),[j,B]);const U=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=N(z.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),ie=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,le=!He&&!U,$e=As(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,We=r.externalConnections?.fetchState==="Completed",ue=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,ce=de&&fs(E?.loggedInUserRoleMap),me=Pe&&!U,qe=Fe&&!U,Je=ie&&Ds(E?.loggedInUserRoleMap),Ke=le&&ys(E?.loggedInUserRoleMap),Qe=me&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=ws(E?.loggedInUserRoleMap),ts=Us(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),_e=ie&&p,he=de&&x,R=me&&ss,g=qe&&ts,m=le&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ne===!0||$e===!0||Xe===!0||es===!0;return y.isSignedIn()?A==null?f==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&f!=="In-Progress"&&T(pe(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||f==="Completed"?(ue===!0||se&&!oe)&&We&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!B||ue!==!1||oe||se?B&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&U===!1||Ge||ze?e.jsx(rt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&U===!1?e.jsx(ct,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&U===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&U===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||ce||Qe||Ke?e.jsx(st,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:R?e.jsx(ut,{}):e.jsx(C,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(C,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&U===!1?e.jsx(Et,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Se?e.jsx(ot,{}):e.jsx(C,{})}),e.jsx(a,{path:"bill/*",element:_e?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:_e?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:he?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:he?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Ve?e.jsx(lt,{hasAdminLevelAccess:ce}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(C,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(pt,{}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(Rt,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"*",element:e.jsx(C,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:w,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(w===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):V?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},b=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:V,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:w,tenantEmailDomain:v})=>{if(L===!0){if(o)return e.jsx(ve,{tenantEmailDomain:v});if(i)return e.jsx(Ce,{tenantEmailDomain:v});if(w)return e.jsx(we,{tenantEmailDomain:v})}return o?e.jsx(ve,{tenantEmailDomain:v}):i?e.jsx(Ce,{tenantEmailDomain:v}):w?e.jsx(we,{tenantEmailDomain:v}):T?e.jsx(Tt,{tenantEmailDomain:v}):V?e.jsx(jt,{tenantEmailDomain:v}):e.jsx(C,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),Ce=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{b as FallBackRoute,St as default};
@@ -0,0 +1,57 @@
1
+ import{j as o}from"./liveblocks-DJbBe3tc.js";import{a as u}from"./sentry-C6T1HHHS.js";import{h as L,g as G,u as R,j as y,s as re,n as H,i as Z,o as ne,p as v}from"./core-BfWJ7zKT.js";import{bn as De,e$ as j,gy as Me,nd as le,OO as Te,hO as he,OF as Re,re as Ue,kL as be,n9 as _e,hQ as Fe,OH as Oe,OG as Be,R5 as Ve,zJ as ze,Fa as Le,QG as Ne,QP as $e,c7 as ae,cO as Ge,cP as He,bs as Ze,MG as Ke,y9 as Qe,R6 as Je,HB as qe,ES as Xe,EJ as ye,EG as Ye,yd as Se,EM as Ce,EP as Ie,EV as oe,uz as se,yc as We,kn as X,kq as Ae,R7 as en,lr as nn,ys as tn,Nx as an,Ny as on,kl as sn,R8 as cn,ko as rn,rI as ln,Ns as dn,Nt as un,rM as pn,hz as gn,MO as ee,hr as de,ho as mn,hw as fn,MP as hn,yp as bn,R9 as yn,Ra as Sn,F7 as Cn,fG as Ee,fI as xe,Rb as In,gj as An,MY as En,yo as ue,go as pe,gn as xn,yn as vn,gm as wn,gl as kn,Rc as Pn,fL as ve,Rd as jn,Re as Dn,yv as Mn,ym as ge,Rf as Tn,f$ as Rn,yj as Un,b_ as _n,c6 as Fn,c5 as On,b$ as Bn,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-kow6PLud.js";import{w as Y,i as B,z as k,ag as we,bR as Gn,f as K,h as Hn,bC as Zn,D as Q,B as ie,bS as Kn,d as ke,e as Pe,bT as Qn,ar as Jn,m as je,bU as qn,bV as Xn,bW as Yn,X as Wn,bX as et,v as nt,bY as tt}from"./index-DWJVmwhz.js";import{n as V}from"./mui-ts7KHm6i.js";import{M as F}from"./MobileAppDrawer-CinzTjr5.js";import{a as J,g as q,m as at}from"./accountMappingHelper-gMZWceAt.js";import{t as ot,A as st}from"./AddressScreen-2BaT3oA-.js";import $ from"./NotFoundScreen-0K6cd0N1.js";import{g as it}from"./analyticsHelper-BgeHTAVC.js";import{B as ct}from"./BusinessVerificationPageScreen-Bj1xk_4H.js";import{C as rt}from"./CompanyPassportScreen-DZx6t9Ym.js";import{u as lt,a as dt}from"./useEmailConnectResultRefresh-DFbMcoeq.js";import{q as me}from"./QBOConnectionScreen-OLT5sXwr.js";import{B as ut}from"./BillPayApprovalRoutes-DmH2FpGv.js";import{R as pt}from"./ReimbursementApprovalRoutes-DBKdGYm6.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";import"./routePaths-DqVKIcAE.js";import"./empty-D4KL-CgN.js";import"./pdf-lib-DX6kz8a9.js";import"./index-CiS2dMrM.js";import"./url-CJ3E3PSB.js";import"./index-DpTDwQon.js";import"./decodeURIComponentSafe-D2jiQ7Do.js";import"./ReimbursementApprovalRuleDetailScreen-DwTxQqE3.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]="2be731ec-7199-4f42-aed6-03b3bad9ce5d",e._sentryDebugIdIdentifier="sentry-dbid-2be731ec-7199-4f42-aed6-03b3bad9ce5d")}catch{}})();const gt=V.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
+ `,mt=H((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:r}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:S,expenseAccount:g}=t,{billPayAccount:l}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,U=J(a.accountMappingView.incomeAccountList,S.selectedOption),M=J(a.accountMappingView.expenseAccountList,g.selectedOption),x=J(a.accountMappingView.billPayAccountList,l.selectedOption),_=J(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),O=q(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),T={selectedIncomeAccountId:U?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:_?.accountId,selectedPrepaidExpensesAccountIds:D.map((P=>P.accountId)),selectedFixedAssetsAccountIds:N.map((P=>P.accountId)),selectedAccruedExpensesAccountIds:O.map((P=>P.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((P=>P.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Be({data:T}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Oe())):e(he())},onSaveClick:()=>{e(Fe()),r&&K.track(Hn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(_e(a.currentTenant.companyId,n))}}}))(Gn),ft=()=>{const e=L(),a=G(),s=R(),{useFeatureGate:c,useDynamicConfig:r}=Y(),{isFeatureEnabled:n}=c(B.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(B.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=r("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),S=De(f),g=y((d=>j(d))),{capitalizableAccounts:l,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=y((d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,P=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:P?.company.companyLocaleInfo?.currencySymbol??"$"}}),re),E=u.useCallback(((d,C)=>{s(le(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[P,W]=T[0]??[];P!=null&&s(le(g.companyId,P,W,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=y((d=>Te(d.accountState)),re),U=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[M,x]=u.useState(!1),[_,D]=u.useState(!1);u.useEffect((()=>{M===!1&&(s(he()),x(!0))}),[M]);const N=y((d=>Re(d))),O=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(F,{isAppContentDrawerOpen:_,handleDrawerToggle:O}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&S,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:l,accountNamesById:U,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>O(!0)})]})},ht=V.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
+ `,bt=H((function(e,a){const s=j(e),c=Ne(e),r=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:r,analytics:K}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Kn),yt=()=>{const e=L(),a=G(),s=R(),{tenantEmailDomain:c}=Z(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((A=>j(A))),S=y((A=>A.billPaySetupApproverViewState.fetchState)),g=y((A=>A.remiSetupApproverViewState.fetchState)),l=y((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=Q();u.useEffect((()=>{p||S!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,S,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(F,{isAppContentDrawerOpen:r,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:l.fetchState})},St=V.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
+ `,Ct=H((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=j(e);return{bankSetupView:Je(e,s,n,t,c,r,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,r,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?ye(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Xe(r,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Qn),It=()=>{const e=L(),a=G(),s=R(),{tenantEmailDomain:c}=Z(),r=Q(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(B.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(B.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,S]=u.useState(!1),g=y((D=>j(D))),l=y((D=>D.settingsViewState.bankConnection.fetchState)),b=Ge(g,r?.loggedInUserRoleMap),I=He(g,r?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,A=ke(g,t,i),U=Ke(g,r?.loggedInUserRoleMap)&&A,{isCardsHidden:M}=Pe(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||l==="Completed"||(S(!0),s(Qe(!1)))}),[f,s,l]);const _=D=>{m(D)};return b||E||I||U?o.jsxs(St,{children:[o.jsx(F,{isAppContentDrawerOpen:p,handleDrawerToggle:_}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:U,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{_(!0)}})]}):o.jsx($,{})},At=V.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
+ `,Et=H((function(e,a){const{companyId:s}=a,c=j(e),r=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||r)&&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:t,stripeKey:je.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:K}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(ye(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(rn(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(qn),xt=()=>{const e=L(),a=G(),s=R(),{tenantEmailDomain:c}=Z(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((h=>j(h))),S=y((h=>h.cardPaymentViewState)),g=y((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),l=Jn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=Q();u.useEffect((()=>{I!=null&&s(We(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(X()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{l==="In-Progress"&&b==="Completed"&&s(X())}),[l,b]);const E=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(F,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:je.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=H((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{K.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,r))}}}))(Xn),wt=()=>{const e=L(),a=R(),{tenantEmailDomain:s}=Z();lt();const[c,r]=u.useState(!1),n=y((h=>h.tenantState.fetchState)),t=y((h=>j(h))),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=Q(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(ln(te))}),[a]);const[S,g]=u.useState(!1);u.useEffect((()=>{S||(g(!0),a(X()))}),[S,a]);const l=h=>{r(h)},b=y((h=>dn(h,i))),I=y((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:w,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(F,{isAppContentDrawerOpen:c,handleDrawerToggle:l}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{l(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.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
+ `,Pt=V.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
+ `,jt=()=>{const e=R(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),r=y((l=>j(l))).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=y((l=>yn(l,n.userId))),i=y((l=>Sn(l,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=l=>{c(l)},f=u.useCallback((l=>{e(se("user_reimbursement_account",l))}),[]),S=u.useCallback((l=>{e(oe(l,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(Pt,{children:[o.jsx(F,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:S,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.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
+ `,fe=({appContent:e})=>{const a=R(),s=L(),c=G(),[r,n]=u.useState(!1),t=y((d=>j(d))),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=m(B.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(B.isDebitCardFeatureEnabled),l=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=y((d=>be(d))),I=Ee(t),w=xe(g,t),E=!w&&b,h=ke(t,S,g),{isCardsHidden:A}=Pe(t?.tenantId),U=!h||A,{areTenantIdsInSync:M}=Wn();u.useEffect((()=>{M&&a(In(p,E))}),[p,a,E,M]);const x=y((d=>An(d,E))),_=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(F,{isAppContentDrawerOpen:r,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:U,isTreasuryDisabled:l===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{O(!0)},isLoading:_,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(P,W){let z=`/${P}/settings/my_profile`;return z=z.concat(`/new/${W}`),z})(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=R(),a=y((l=>j(l))).companyId,s=y((l=>Pn(l))),c=y((l=>ve(l))),r=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((l=>{t(l)}),[]),p=u.useCallback((l=>{e(jn(l))}),[]),m=u.useCallback((()=>{r?.userEmail!=null&&e(Dn({loggedInUserEmail:r.userEmail}))}),[r?.userEmail]),f=u.useCallback((()=>{e(Mn())}),[]);if(r==null)throw Error("Can't access Notification Settings page without signing in...");const S=u.useCallback((()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Tn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(F,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:r,onRefresh:S,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=y((l=>ve(l))),r=y((l=>j(l))),n=Q(),t=k.getSignedInUser(),i=R(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(B.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Rn(c.notificationSettings,t.userEmail,m,r);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(Un()))}),[c.fetchState,a]);const S=xe(m,r),g=Ee(r);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?_n(r)?o.jsxs(ne,{children:[Fn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),On(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Bn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(jt,{})}),Vn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:S?"zeni_accounts":g?"charge_cards":it(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(rt,{})}),Nn(n?.loggedInUserRole??[],r)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,r)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(yt,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};