@zeniai/web-app-ui 5.1.58-qa → 5.1.59-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 (160) hide show
  1. package/dist/assets/AddressRoutes-1t80Lwwm.js +1 -0
  2. package/dist/assets/AddressScreen-fWJCm4zs.js +9 -0
  3. package/dist/assets/AiCfoScreen-RA-P0Ele.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-Bv9HP5Ed.js +1 -0
  5. package/dist/assets/BillPayRoutes-DM71-NMQ.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-9FWcKpyL.js +9 -0
  7. package/dist/assets/CardsAiCfoScreen-CJUAzHrT.js +14 -0
  8. package/dist/assets/ChargeCardRoutes-BKCoQWOu.js +71 -0
  9. package/dist/assets/CompanyPassportScreen-Z-knYrxv.js +1 -0
  10. package/dist/assets/ConnectionAuthScreen-Cev1gkS_.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-GZfWR-j7.js +1 -0
  12. package/dist/assets/CustomerOnboardingRoutes-BTm1Abhx.js +30 -0
  13. package/dist/assets/DashboardRoutes-wMhkTYla.js +20 -0
  14. package/dist/assets/DefaultTenantHome-ClYhyRXO.js +1 -0
  15. package/dist/assets/DomesticWireDetailScreen-Cl_7XBwW.js +18 -0
  16. package/dist/assets/DrawerScreen-DqnvN1tq.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-Dy54l33K.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-BAwf_5XR.js +25 -0
  19. package/dist/assets/FeaturePreviewScreen-DCDhII3I.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-rLAbttjN.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-B-PPv0PR.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-DlEpGGzi.js +12 -0
  23. package/dist/assets/MobileAppDrawer-CDYOk1Tu.js +1 -0
  24. package/dist/assets/NotFoundScreen-DTvgxtkb.js +1 -0
  25. package/dist/assets/NotificationRoutes-ye5VX3PS.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-DF7q2wgy.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-DZnjcm2C.js +1 -0
  28. package/dist/assets/PeopleRoutes-Cshc61GL.js +22 -0
  29. package/dist/assets/PerformanceRoutes-UE1AlGRc.js +1 -0
  30. package/dist/assets/{Preview-KE8R1SN3.js → Preview-COCp1vn_.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-CGgBpuke.js → QBOConnectionScreen-ClD_YrtC.js} +1 -1
  32. package/dist/assets/ReferralListScreen-BQiDRb4Q.js +5 -0
  33. package/dist/assets/ReimbursementApprovalRoutes-B02Z7OIU.js +1 -0
  34. package/dist/assets/ReimbursementApprovalRuleDetailScreen-CrNxSCRL.js +1 -0
  35. package/dist/assets/{ReimbursementRoutes-MbRZIHuu.js → ReimbursementRoutes-BDTp98VH.js} +12 -12
  36. package/dist/assets/ReportsRoutes-utyUVcdp.js +1 -0
  37. package/dist/assets/RewardsRoutes-B0tydv2M.js +1 -0
  38. package/dist/assets/ScreenRoutes-C_5gtCcR.js +2 -0
  39. package/dist/assets/SettingsRoutes-CItpcp8o.js +57 -0
  40. package/dist/assets/SetupPagesScreen-Cb_h1N2q.js +29 -0
  41. package/dist/assets/SignInScreen-DayaVPul.js +1 -0
  42. package/dist/assets/SignOutScreen-DfnourF6.js +9 -0
  43. package/dist/assets/TaskListScreen-DVU-iHmP.js +9 -0
  44. package/dist/assets/TaskRoutes-DECOOPQm.js +9 -0
  45. package/dist/assets/TransactionDetailRoutes-Ln9HzXsS.js +1 -0
  46. package/dist/assets/TransactionDetailScreen-qgLSqSNT.js +5 -0
  47. package/dist/assets/TransactionListRoutes-BqwHG3AV.js +1 -0
  48. package/dist/assets/TreasuryRoutes-DxBKr4aJ.js +37 -0
  49. package/dist/assets/{VendorsRoutes-BjMVmZbA.js → VendorsRoutes-BvKCtUVO.js} +26 -26
  50. package/dist/assets/WiseConfirmationScreen-DGdciAcq.js +12 -0
  51. package/dist/assets/ZeniAccountRoutes-4nzGey-r.js +73 -0
  52. package/dist/assets/ZeniAccountStatementScreen-C-juTt6c.js +9 -0
  53. package/dist/assets/{accountMappingHelper-B_qiWmeW.js → accountMappingHelper-BFxOrTVK.js} +1 -1
  54. package/dist/assets/{analytics-BUNQWYXz.js → analytics-BToIaEuE.js} +1 -1
  55. package/dist/assets/{analyticsHelper-DNuTbD5B.js → analyticsHelper-DE1SyLO3.js} +1 -1
  56. package/dist/assets/{core-C8Y7fm3n.js → core-CJUY0MOY.js} +2 -2
  57. package/dist/assets/{decodeURIComponentSafe-pK1yrQsS.js → decodeURIComponentSafe-BXzU7C-M.js} +1 -1
  58. package/dist/assets/dnd-LV5QvpgJ.js +6 -0
  59. package/dist/assets/{empty-CTn7RkAu.js → empty-BrON4VTN.js} +1 -1
  60. package/dist/assets/{index-DhPN3gNQ.js → empty-DZsqgfyL.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-BE2d8kYR.js → emptyVideoElement-D28OtmxE.js} +1 -1
  62. package/dist/assets/epic-DUxvu9Sx.js +2 -0
  63. package/dist/assets/getLocaleForTenant-BxE1cnSw.js +1 -0
  64. package/dist/assets/index-3T7v0Kjw.js +1 -0
  65. package/dist/assets/{index-CyWBxegb.js → index-6y2Ha7q4.js} +1 -1
  66. package/dist/assets/{index-C_oqefR-.js → index-7lEXxVMw.js} +1 -1
  67. package/dist/assets/{index-C3-objML.js → index-B2ukUPdb.js} +44600 -39007
  68. package/dist/assets/{index-DjeTRCsF.js → index-BUVIqiRA.js} +1 -1
  69. package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
  70. package/dist/assets/{index-eBlD3uTi.js → index-CQBukgOK.js} +1 -1
  71. package/dist/assets/index-LSEqxgWI.js +1 -0
  72. package/dist/assets/{index-Cv6pmWIm.js → index-N--zv7t4.js} +2 -2
  73. package/dist/assets/{lexical-CPmqnx9k.js → lexical-Cmpx8sPR.js} +1 -1
  74. package/dist/assets/{liveblocks-fDjf6Tur.js → liveblocks-qa_6WStS.js} +1 -1
  75. package/dist/assets/{lottie-DmArr_jQ.js → lottie-zGjtu-Uw.js} +1 -1
  76. package/dist/assets/{mui-Ky-KJxLh.js → mui-CkYYTJAV.js} +1 -1
  77. package/dist/assets/{pathToGoBack-9QBEItSt.js → pathToGoBack-BPCNomFS.js} +1 -1
  78. package/dist/assets/{pdf-NvioK7wV.js → pdf-CZjXUklc.js} +3 -3
  79. package/dist/assets/{pdf-lib-6uw_qC-k.js → pdf-lib-1-yXS4qt.js} +1 -1
  80. package/dist/assets/{plaid-D50ZkdQf.js → plaid-1xV6OFdB.js} +1 -1
  81. package/dist/assets/{pusher-CAUUsTgW.js → pusher-D2ak7eHg.js} +1 -1
  82. package/dist/assets/{react-C7YWBeDO.js → react-BQ9185Ee.js} +1 -1
  83. package/dist/assets/{react-CzlxEg73.js → react-BSs2nIas.js} +1 -1
  84. package/dist/assets/{react-CHUA3ysh.js → react-BihdrB0K.js} +1 -1
  85. package/dist/assets/{react-BX04XLg-.js → react-CBo1BYNF.js} +1 -1
  86. package/dist/assets/{react-DsRQdKTx.js → react-COkOWomn.js} +1 -1
  87. package/dist/assets/{react-BzVo9cuE.js → react-CVnQTP0R.js} +1 -1
  88. package/dist/assets/{recharts-CgIjuHOA.js → recharts-D3JK2Byj.js} +3 -3
  89. package/dist/assets/{routePaths-B8EWQXPr.js → routePaths-DbnM8jAc.js} +1 -1
  90. package/dist/assets/{sentry-DjzU4p1F.js → sentry-BTf2Dtmp.js} +1 -1
  91. package/dist/assets/{url-mCw4Y0mb.js → url-CnoP6Bkx.js} +1 -1
  92. package/dist/assets/{url-DBETAWzw.js → url-DbiWYN-9.js} +1 -1
  93. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-C9aknKEV.js +1 -0
  94. package/dist/assets/{useAskAiCfoHostNavButtonProps-DDzinN2F.js → useAskAiCfoHostNavButtonProps-DUCZkKew.js} +1 -1
  95. package/dist/assets/useCashManagementBanner-Bqm1UKHq.js +1 -0
  96. package/dist/assets/useChargeCardPusherEvents-Bxg7wg9x.js +1 -0
  97. package/dist/assets/{useDeviceId-DBHwhChu.js → useDeviceId-D5q7Ex2B.js} +1 -1
  98. package/dist/assets/useEmailConnectResultRefresh-BGSh8M-E.js +1 -0
  99. package/dist/assets/useInitialThreadRequest-CcPLE3h6.js +1 -0
  100. package/dist/assets/{utils-Djk4rnCT.js → utils-Bd6aVUzu.js} +2 -2
  101. package/dist/assets/withTransactionSidePanel-RlHJMQ4A.js +21 -0
  102. package/dist/assets/zeni-epic-state-Da9EwYbz.js +13 -0
  103. package/dist/index.html +1 -1
  104. package/package.json +4 -4
  105. package/dist/assets/AddressRoutes-CPX14XSj.js +0 -1
  106. package/dist/assets/AddressScreen-V8qhbu9d.js +0 -9
  107. package/dist/assets/AiCfoScreen-B2v4oX4h.js +0 -22
  108. package/dist/assets/BillPayApprovalRoutes-B6jqtEYg.js +0 -1
  109. package/dist/assets/BillPayRoutes-CKtJupU-.js +0 -119
  110. package/dist/assets/BusinessVerificationPageScreen-DO1Qhw6D.js +0 -9
  111. package/dist/assets/ChargeCardRoutes-BHdVO9a5.js +0 -71
  112. package/dist/assets/CompanyPassportScreen-DkvfpbMw.js +0 -1
  113. package/dist/assets/ConnectionAuthScreen-DaGPpRPO.js +0 -11
  114. package/dist/assets/CustomerOnboardingAuthScreen-CD5LwsDH.js +0 -1
  115. package/dist/assets/CustomerOnboardingRoutes-CTpQNO2Q.js +0 -23
  116. package/dist/assets/DashboardRoutes-jRDsqXRC.js +0 -20
  117. package/dist/assets/DefaultTenantHome-_pdrgccv.js +0 -1
  118. package/dist/assets/DomesticWireDetailScreen-CCXVWOri.js +0 -18
  119. package/dist/assets/DrawerScreen-B7V2OyqL.js +0 -1
  120. package/dist/assets/EntityDetailRoutes-DfRfi9XQ.js +0 -1
  121. package/dist/assets/ExpenseAutomationRoutes-cFT1NB2O.js +0 -25
  122. package/dist/assets/FeaturePreviewScreen-2R9FJdWJ.js +0 -1
  123. package/dist/assets/HubSpotOAuthCallbackScreen-rd4Kj3vC.js +0 -1
  124. package/dist/assets/MagicLinkRoutes-BO0Lexxe.js +0 -72
  125. package/dist/assets/MagicLinkSignInScreen-BAuy3KLO.js +0 -12
  126. package/dist/assets/MobileAppDrawer-DIls_BW2.js +0 -1
  127. package/dist/assets/NotFoundScreen-D4Av36kV.js +0 -1
  128. package/dist/assets/NotificationRoutes-lCQFJz0z.js +0 -1
  129. package/dist/assets/OAuthConsentScreen-COgy1n70.js +0 -1
  130. package/dist/assets/PandLWithForecastRoutes-Bkidve9i.js +0 -1
  131. package/dist/assets/PeopleRoutes-B7wvEYYp.js +0 -22
  132. package/dist/assets/PerformanceRoutes-CjXTt9vm.js +0 -1
  133. package/dist/assets/ReferralListScreen-BA5RvLF7.js +0 -5
  134. package/dist/assets/ReimbursementApprovalRoutes-BGkN9M7Q.js +0 -1
  135. package/dist/assets/ReimbursementApprovalRuleDetailScreen-6mUow2wt.js +0 -1
  136. package/dist/assets/ReportsRoutes-BBKUYNc0.js +0 -1
  137. package/dist/assets/RewardsRoutes-BbXQsLmk.js +0 -1
  138. package/dist/assets/ScreenRoutes-BxoMc-Es.js +0 -2
  139. package/dist/assets/SettingsRoutes-DLxDXOLE.js +0 -57
  140. package/dist/assets/SetupPagesScreen-DLtasQoq.js +0 -29
  141. package/dist/assets/SignInScreen-CJnKhy_P.js +0 -1
  142. package/dist/assets/SignOutScreen-DNLOQn_i.js +0 -9
  143. package/dist/assets/TaskListScreen-G6lL0uD5.js +0 -9
  144. package/dist/assets/TaskRoutes-DQA7zeTW.js +0 -9
  145. package/dist/assets/TransactionDetailRoutes-yWhhHCBD.js +0 -1
  146. package/dist/assets/TransactionDetailScreen-gAhskOIn.js +0 -5
  147. package/dist/assets/TransactionListRoutes-CzgCZLFm.js +0 -1
  148. package/dist/assets/TreasuryRoutes-BmIGoFg4.js +0 -37
  149. package/dist/assets/WiseConfirmationScreen-Co4RuLhn.js +0 -12
  150. package/dist/assets/ZeniAccountRoutes-C_Otg4hI.js +0 -57
  151. package/dist/assets/ZeniAccountStatementScreen-BbupcIsJ.js +0 -9
  152. package/dist/assets/dnd-RzzQg6oJ.js +0 -6
  153. package/dist/assets/empty-Bs_WirIs.js +0 -1
  154. package/dist/assets/epic-CPnluZX0.js +0 -2
  155. package/dist/assets/getLocaleForTenant-CYgluMQL.js +0 -1
  156. package/dist/assets/index-BCOcxjVj.js +0 -1
  157. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DN1K5TAQ.js +0 -1
  158. package/dist/assets/useInitialThreadRequest-X7WpfR49.js +0 -1
  159. package/dist/assets/withTransactionSidePanel-BvWwtSm-.js +0 -21
  160. package/dist/assets/zeni-epic-state-DvHgUD1-.js +0 -13
@@ -0,0 +1,57 @@
1
+ import{j as o}from"./liveblocks-qa_6WStS.js";import{a as p}from"./sentry-BTf2Dtmp.js";import{h as V,g as Q,u as T,j as h,s as ce,n as $,i as G,o as q,p as A}from"./core-CJUY0MOY.js";import{bn as je,eV as M,gm as Pe,mY as le,Oc as Me,hC as he,O3 as De,qO as Ue,ku as fe,mU as Te,hE as _e,O5 as Re,O4 as Fe,Qu as Oe,ze as Be,EI as Ve,Q3 as ze,Qc as Le,c6 as ee,cL as Ne,cM as Qe,M3 as $e,Qv as Ge,M4 as Ke,xG as Ze,Qw as He,H7 as Je,Eo as We,Ef as be,Ec as qe,xK as Se,Ei as ye,El as Ce,Er as ne,u8 as te,xJ as Ye,k6 as Y,k9 as Ie,Qx as Xe,la as en,xZ as nn,MZ as tn,M_ as an,k4 as on,Qy as sn,k7 as cn,rg as ln,MU as rn,MV as dn,rk as un,hn as pn,Mc as W,hf as re,hc as gn,hk as mn,Md as hn,xW as fn,Qz as bn,QA as Sn,EF as yn,fy as xe,fA as Ee,QB as Cn,ga as In,Mm as xn,xV as de,gf as ue,ge as En,xU as An,gd as vn,gc as wn,QC as kn,fD as Ae,QD as jn,QE as Pn,y0 as Mn,xT as pe,QF as Dn,fU as Un,xQ as Tn,bZ as _n,c5 as Rn,c4 as Fn,b_ as On,c2 as Bn,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-Da9EwYbz.js";import{W as ae,U as R,z as j,af as ve,bR as Qn,d as J,f as $n,bC as Gn,I as K,w as oe,bS as Kn,bT as Zn,ar as Hn,i as we,bU as Jn,bV as Wn,bW as qn,a9 as Yn,V as Xn,bX as et,s as nt,bY as tt}from"./index-B2ukUPdb.js";import{n as F}from"./mui-CkYYTJAV.js";import{M as _}from"./MobileAppDrawer-CDYOk1Tu.js";import{a as Z,g as H,m as at}from"./accountMappingHelper-BFxOrTVK.js";import{t as ot,A as st}from"./AddressScreen-fWJCm4zs.js";import N from"./NotFoundScreen-DTvgxtkb.js";import{g as it}from"./analyticsHelper-DE1SyLO3.js";import{B as ct}from"./BusinessVerificationPageScreen-9FWcKpyL.js";import{C as lt}from"./CompanyPassportScreen-Z-knYrxv.js";import{q as ge}from"./QBOConnectionScreen-ClD_YrtC.js";import{u as rt}from"./useEmailConnectResultRefresh-BGSh8M-E.js";import{B as dt}from"./BillPayApprovalRoutes-Bv9HP5Ed.js";import{R as ut}from"./ReimbursementApprovalRoutes-B02Z7OIU.js";import"./recharts-D3JK2Byj.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./utils-Bd6aVUzu.js";import"./routePaths-DbnM8jAc.js";import"./empty-BrON4VTN.js";import"./pdf-lib-1-yXS4qt.js";import"./index-BUVIqiRA.js";import"./url-CnoP6Bkx.js";import"./index-LSEqxgWI.js";import"./decodeURIComponentSafe-BXzU7C-M.js";import"./ReimbursementApprovalRuleDetailScreen-CrNxSCRL.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]="246db98f-60ba-4662-9b56-db795c22859c",e._sentryDebugIdIdentifier="sentry-dbid-246db98f-60ba-4662-9b56-db795c22859c")}catch{}})();const pt=F.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
+ `,gt=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:fe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:C}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:P,accruedExpensesAccount:v}=d,{bankAccount:y,expenseCategory1099:E}=m,w=Z(t.accountMappingView.incomeAccountList,f.selectedOption),O=Z(t.accountMappingView.expenseAccountList,g.selectedOption),z=Z(t.accountMappingView.billPayAccountList,l.selectedOption),L=Z(t.accountMappingView.reimbursementsAccountList,C.selectedOption),B=H(t.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=H(t.accountMappingView.fixedAssetsAccountList,P.selectedOptions),D=H(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),S=H(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),x=at(t.accountMappingView.expenseAccounts1099FilingAccountList,E),U={selectedIncomeAccountId:w?.accountId,selectedExpenseAccountId:O?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:B.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:S.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Fe({data:U}))},onBackClick:()=>{ve(r)===!1?(s("../../dashboard"),e(Re())):e(he())},onSaveClick:()=>{e(_e()),i&&J.track($n.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Te(t.currentTenant.companyId,n))}}})(Qn),mt=()=>{const e=V(),t=Q(),s=T(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=j.getSignedInUser(),f=je(m),g=h(S=>M(S)),{capitalizableAccounts:l,capitalizableAccountOverrides:C,isCapitalizationThresholdSaving:I,currencySymbol:P}=h(S=>{const x=S.tenantState.currentTenantId,U=x!=null?S.tenantState.tenantsById[x]:void 0,k=Pe(S.companyState,g.companyId);return{capitalizableAccounts:U?.capitalizableAccounts??null,capitalizableAccountOverrides:U?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:S.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:k?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=p.useCallback((S,x)=>{s(le(g.companyId,S,x))},[s,g.companyId]),y=p.useCallback(S=>{const x={...C??{}},U=Object.entries(S);for(const[se,ie]of U)ie===null?delete x[se]:x[se]=ie;const[k,ke]=U[0]??[];k!=null&&s(le(g.companyId,k,ke,void 0,Object.keys(x).length>0?x:null))},[s,g.companyId,C]),E=h(S=>Me(S.accountState),ce),w=p.useMemo(()=>{const S={};for(const x of E)x.accountId!=null&&x.accountName!=null&&(S[x.accountId]=x.accountName);return S},[E]),[O,z]=p.useState(!1),[L,B]=p.useState(!1);p.useEffect(()=>{O===!1&&(s(he()),z(!0))},[O]);const b=h(S=>De(S)),D=S=>{B(S)};return o.jsxs(pt,{children:[o.jsx(_,{isAppContentDrawerOpen:L,handleDrawerToggle:D}),o.jsx(gt,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:w,capitalizableAccountOverrides:C,currencySymbol:P,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:y,location:t,isSettings:ve(t),onClickMenuIcon:()=>D(!0)})]})},ht=F.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
+ `,ft=$(function(e,t){const s=M(e),r=ze(e),i=Le(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:J}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),bt=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(E=>M(E)),f=h(E=>E.billPaySetupApproverViewState.fetchState),g=h(E=>E.remiSetupApproverViewState.fetchState),l=h(E=>Oe(E)),{isApprovalRulesV3Enabled:C,isLoading:I}=Gn(m?.tenantId),P=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=K();p.useEffect(()=>{u||f!=="Not-Started"||I||(d(!0),s(Be(!0,!0,C)))},[u,f,I,C,s]),p.useEffect(()=>{a||g!=="Not-Started"||I||(c(!0),s(Ve(!0,!1,!1,C)))},[a,g,I,C,s]);const y=E=>{n(E)};return v?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:y}),o.jsx(ft,{navigate:e,location:t,companyId:P,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{y(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},St=F.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
+ `,yt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=M(e);return{bankSetupView:He(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(Ce(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(ye(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(Se(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?be(n,a,c,u):qe(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(We(i,a,n,c))},onRemoveConnection:n=>{e(Je(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Zn),Ct=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),i=K(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>M(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=Ne(d,i?.loggedInUserRoleMap),g=Qe(d,i?.loggedInUserRoleMap),l=$e(d,i?.loggedInUserRoleMap),C=Ge(d,i?.loggedInUserRoleMap),I=Ke(d,i?.loggedInUserRoleMap),P=d.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ze(!1)))},[c,s,m]);const v=y=>{a(y)};return f||l||g||I?o.jsxs(St,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:v}),o.jsx(yt,{navigate:e,location:t,companyId:P,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:C,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(N,{})},It=F.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
+ `,xt=$(function(e,t){const{companyId:s}=t,r=M(e),i=t.roleMap.bill_pay_admin,n=Xe(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:we.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:J}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(Ce(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(ye(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(be(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ie(n))},handleConfirmCardSetupIntent:n=>{e(cn(n))},updateCardPaymentModalState:n=>{e(sn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(on(n,a,c))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(an())},handleResetCardPaymentErrorStatuses:()=>{e(tn())},onBillingAddressSave:n=>{e(nn(n))},onAddressEditHandler:n=>{if(n!=null){const a=ot(n);e(en({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Jn),Et=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>M(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Hn(f.addCardPaymentSourceStatus.fetchState),C=f.addCardPaymentSourceStatus.fetchState,I=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const P=K();p.useEffect(()=>{I!=null&&s(Ye(I,!1))},[I,s]),p.useEffect(()=>{a||(c(!0),s(Y()))},[a,s]),p.useEffect(()=>{u||(Ie(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&C==="Completed"&&s(Y())},[l,C]);const v=y=>{n(y)};return P?.loggedInUserRoleMap!=null?o.jsxs(It,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(xt,{navigate:e,location:t,companyId:I,currentTenant:m,roleMap:P.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:we.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},X="external_integrations",At=$(function(e){const t=dn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{ge.init("/connection/auth",n),ge.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(fn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(mn(a,d,W("revenue"),hn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(gn(a,c,W(u)))},onConnectGmail:()=>{e(re(a,"gmail",window.location.href))},onConnectOutlook:()=>{e(re(a,"outlook",window.location.href))},onSaveConnectorCredentials:c=>{e(pn(a,W("payments"),c))},onNotifyMe:c=>{e(un(X,c,i))}}})(Wn),vt=()=>{const e=V(),t=T(),{tenantEmailDomain:s}=G();rt();const[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>M(l)),c=a.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),d=K(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(ln(X))},[t]);const f=l=>{i(l)},g=h(l=>rn(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(At,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,C])=>[l,C?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},wt=F.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
+ `,kt=F.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=T(),{tenantEmailDomain:t}=G(),[s,r]=p.useState(!1),i=h(l=>M(l)).companyId??j.getSignedInUserTenant(t)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>bn(l,n.userId)),c=h(l=>Sn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(yn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(kt,{children:[o.jsx(_,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(qn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Pt=F.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
+ `,me=({appContent:e})=>{const t=T(),s=V(),r=Q(),[i,n]=p.useState(!1),a=h(b=>M(b)),{tenantEmailDomain:c}=a,u=a.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(R.isTreasuryEnabled),C=h(b=>fe(b)),I=xe(a),P=Ee(g,a),v=!P&&C,y=Yn(a,f,g),{areTenantIdsInSync:E}=Xn();p.useEffect(()=>{E&&t(Cn(u,v))},[u,t,v,E]);const w=h(b=>In(b,v)),O=w.fetchState==="Not-Started"||w.fetchState==="In-Progress"||u==null,z=xn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=b=>{n(b)};return o.jsxs(Pt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:w,isAccountingClassesEnabled:C,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{B(!0)},isLoading:O,isBankingOnlyTenant:P,isCardsOnlyTenant:I,onAddressClick:b=>{const D=function(x,U){let k=`/${x}/settings/my_profile`;return k=k.concat(`/new/${U}`),k}(c,b),S=nt(r.state?.pathnameStackToGoBack,r.pathname);s(D,{state:{pathnameStackToGoBack:S}})},onGetOtp:b=>{const D={...w.myProfileLocalData,phone:b};t(de({localData:D})),t(wn(b,"MyProfile"))},onResendOtp:b=>{t(vn(b,"MyProfile"))},onCancelClick:()=>{t(An())},onSaveClick:()=>{t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{t(En(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&j.saveZeniOtpToken(b),t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(de({localData:b}))}})]})};function Mt(){const e=T(),t=h(l=>M(l)).companyId,s=h(l=>kn(l)),r=h(l=>Ae(l)),i=j.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(jn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(Pn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(Mn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(Dn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function pa(e){const[t,s]=p.useState(!1),r=h(l=>Ae(l)),i=h(l=>M(l)),n=K(),a=j.getSignedInUser(),c=T(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(R.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Un(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Tn()))},[r.fetchState,t]);const f=Ee(d,i),g=xe(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?_n(i)?o.jsxs(q,{children:[Rn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(mt,{})}),Fn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(Dt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(jt,{})}),Bn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(Ct,{})}),Vn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(ct,{productType:f?"zeni_accounts":g?"charge_cards":it(i,n?.loggedInUserRoleMap)})}),zn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(lt,{})}),Ln(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(Et,{})}),Nn(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(vt,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(me,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(me,{})}),m&&o.jsx(A,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(q,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function Dt(e){return o.jsxs(q,{children:[o.jsx(A,{path:"/",element:o.jsx(bt,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(dt,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(ut,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{pa as default};
@@ -0,0 +1,29 @@
1
+ import{j as u}from"./liveblocks-qa_6WStS.js";import{h as X,g as Y,u as ee,i as $,j as v,N as j,n as W,t as Ye}from"./core-CJUY0MOY.js";import{bJ as en,co as Ie,PT as ye,eV as V,cA as nn,zu as Q,ze as tn,Q3 as an,Q6 as on,rz as ne,rn as te,l2 as ae,tG as L,Q8 as Ae,ge as Qe,gd as Ge,gc as $e,Q9 as sn,zD as cn,Eo as ke,Ef as _e,Ec as ve,DW as K,Ei as Pe,El as Ee,Er as Te,u8 as we,gt as rn,cv as un,fA as dn,fy as ln,fz as pn,bt as mn,Qa as yn,CW as le,Dy as fn,Qb as gn,bK as Sn,FH as pe,EI as bn,Qc as hn,Qd as Cn,FL as In,FP as An,tz as kn,Kd as _n,Gk as Ce,Hk as me,Qe as vn,Qf as Pn,Qg as En,Qh as We,Qi as Tn,MG as wn,Pg as Dn,MX as Un,Qj as He,D_ as On,MY as Fn,E2 as Vn,Qk as Ve,GG as qe,la as xn,rq as Ke,tI as Bn,bE as je,tU as Re,cy as jn,Ql as Je,fT as Rn,G2 as zn,G6 as Nn,Qm as Ln,Gn as ze,Qn as Mn,Qo as Zn,Qp as Qn,Qq as Gn,gm as $n,AO as Wn,Qr as Hn,AT as qn,AS as Kn}from"./zeni-epic-state-Da9EwYbz.js";import{I as ie,W as oe,U as de,m as De,aQ as J,bC as Xe,z as D,x as se,d as U,w as Ue,f as G,bD as Jn,au as ce,bE as x,bF as Xn,bG as Yn,af as Be,bH as et,s as Ne,av as Le,q as nt,y as tt,bI as at,bJ as it,bK as ot,a7 as st}from"./index-B2ukUPdb.js";import{a as C}from"./sentry-BTf2Dtmp.js";import{n as xe,D as ct,S as rt}from"./mui-CkYYTJAV.js";import{M as fe}from"./MobileAppDrawer-CDYOk1Tu.js";import N from"./NotFoundScreen-DTvgxtkb.js";import{a as Me}from"./analyticsHelper-DE1SyLO3.js";import{d as Ze}from"./routePaths-DbnM8jAc.js";import{B as Fe}from"./BusinessVerificationPageScreen-9FWcKpyL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="961f3188-8294-4079-9416-8fac291663b3",e._sentryDebugIdIdentifier="sentry-dbid-961f3188-8294-4079-9416-8fac291663b3")}catch{}})();const ut=xe.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
+ `,dt=W(function(e,s){const{isUserBillPayAdmin:t,companyId:a}=s,c=V(e),n=an(e),o=D.getSignedInUser(),l=c.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:s.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:i}},function(e,s){const{navigate:t,companyId:a,currentTenant:c}=s;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,o)=>{e(we("bill_pay_setup",n,o))},onEstablishConnectionClick:n=>{e(Te(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,o,l)=>{e(Ee(n,o,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,o)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",o))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,o,l)=>{e(l==="paymentAccount"?_e(n,o,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,o))},onUpdatePrimaryFundingAccount:(n,o)=>{e(ke(a,"bill_pay_setup",n,o))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,o)=>{e($e(n,"SpendManagementSetup")),o!=null&&e(sn({officerType:o,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,o)=>{e(Qe(n,o,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,o)=>{n!=null&&o!=null&&e(L(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,o)=>{e(Ae({officerType:n,fileIds:o}))},onSendForVerificationClick:n=>{e(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,o)=>{e(ne(n,o.split(".")[0]))},onSignUpClick:()=>{s.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Jn),lt=()=>{const e=X(),s=Y(),t=ee(),{tenantEmailDomain:a}=$(),c=ie(),n=en(c?.loggedInUserRoleMap),o=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=De(),{configValue:A}=i(J.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),_=C.useRef(!1),[g,S]=C.useState(!1),T=v(E=>E.billPaySetupViewState.fetchState),I=v(E=>V(E)),h=v(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:k}=Xe(I?.tenantId),m=I.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const P=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{_.current||T!=="Not-Started"||m==null?_.current||T!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(Q(m,!1,!0))):(_.current=!0,t(Q(m,!0)))},[T,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,w)))},[g,h,k,w,t]);const F=E=>{b(E)};if(P===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(P===!0&&c?.loggedInUserRoleMap!=null){const E=z=>z.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(ut,{children:[u.jsx(se,{analytics:U,onLoad:z=>E(z)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:F}),u.jsx(dt,{navigate:e,location:s,companyId:m,currentTenant:I,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:o,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})},Zt=(e,s)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:s,Qt=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,$t=e=>`/${e}/cards/onboard`,Wt=(e,s,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(s)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Ht=(e,s)=>e.find(t=>t.id===s),qt=(e,s,t)=>!e||!s||t.fetchState==="Completed",pt=(e,s,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:s,isDebitCardEnabled:t,isCreditCardEnabled:a}),Kt=(e,s)=>e?{creditCardCashbackOffer:`${s.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${s.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(s.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(s.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(s.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:s.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:s.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Jt=(e,s,t,a,c)=>e&&s&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,Xt=(e,s,t,a,c)=>e&&s&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Yt=(e,s)=>e&&s.depositAccountLimit!=null&&s.chargeCard!=null?{debitAccountId:s.depositAccountLimit.id,debitAccountName:s.depositAccountLimit?.accountName??s.connectedAccount?.accountName,debitAccountBalance:x(s.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(s.chargeCard.limit.amount-s.chargeCard.available.amount),debitAccountStatus:s.depositAccountLimit?.accountStatus??s.connectedAccount?.accountStatus}:void 0,ea=80,na=80,ta=e=>e.companyId??D.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,mt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:s})=>s||e,yt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:s,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||s||t)&&(!a||c>0),aa=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:s,isBookKeepingTenant:t})=>e||s||t,ia=({cardInfo:e,isProductVisible:s,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&s&&(!t&&c||n&&!c&&!a),ft=W(function(e,s){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=s,o=V(e),l=D.getSignedInUser(),i=o.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:o.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,s){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:o,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:f,businessVerificationStatus:A}=s;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(we("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(Te(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&o===!0&&i===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(K(a,"charge_cards")):o===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const _=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?_e(d,y,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),_=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:x(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&o===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):o===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{s.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(Xn),gt=()=>{const e=X(),s=Y(),t=ee(),{tenantEmailDomain:a}=$(),c=ie(),n=v(M=>V(M)),{useDynamicConfig:o,useFeatureGate:l}=oe(),i=s.state?.pathnameStackToGoBack?.[0],{configValue:r}=o(J.zeniAccountsConfig),{configValue:p}=o(J.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=v(M=>rn(M,n.companyId)),_=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,T=dn(A,n),I=mt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:T}),h=ln(n),w=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=yt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:w,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),P=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),z=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=v(M=>M.chargeCardSetupViewState.fetchState),B=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=M=>{ge(M)},Se=v(M=>yn(M,B));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||B==null?q||Z!=="Completed"||B==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(B,!1,!0)):(re(!0),t(le(B,!0)))},[q,Z,B,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=pt(m,I,S,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:U,onLoad:()=>{U.trackPageLoaded(G.Event.cardsSetupVisited),U.trackCardsCardSetupView(_,ue,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Oe}),u.jsx(ft,{autoPayThreshold:f,navigate:e,location:s,companyId:B,currentTenant:n,isEarlyPayEnabled:y,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:E,isDebitCardOnlyEnabled:P,isCreditCardOnlyEnabled:R,chargeCardSetUpView:Se,isCreditCardProductVisible:m,isDebitCardFeatureEnabled:I,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:_,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:z,accountsPromoConfig:F})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},St=xe.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=W(function(e,s){const{isUserRemiAdmin:t,companyId:a}=s,c=V(e),n=hn(e),o=Cn(e,a),l=D.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&o.updateStatus.fetchState!=="In-Progress"&&o.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&o.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&o.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:o,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,s){const{navigate:t,companyId:a,currentTenant:c}=s;return{updateMileageDetails:n=>{const{mileageAmount:o,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:o,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,o)=>{e(we("reimbursement_setup",n,o))},onEstablishConnectionClick:n=>{e(Te(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,o,l)=>{e(Ee(n,o,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,o)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",o))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,o,l)=>{e(l==="paymentAccount"?_e(n,o,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,o))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,o)=>{e(Ae({officerType:n,fileIds:o}))},onSendForVerificationClick:n=>{e(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,o)=>{e(ne(n,o.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,o)=>{e(ke(a,"reimbursement_setup",n,o))},onSignUpClick:()=>{s.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Yn),ht=()=>{const e=X(),s=Y(),t=ee(),{tenantEmailDomain:a}=$(),c=ie(),{useDynamicConfig:n}=oe(),o=De(),{configValue:l}=n(J.zeniAccountsConfig),i=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),_=v(m=>m.remiSetupViewState.fetchState),g=v(m=>V(m)),S=v(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:T,isLoading:I}=Xe(g?.tenantId),h=D.getSignedInUserTenant(a)?.companyId??g.companyId,w=D.getSignedInUser(),k=m=>{A(m)};if(w==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||_!=="Not-Started"||h==null?d.current||_!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[_,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,T)))},[y,S,I,T,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=P=>P.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(St,{children:[u.jsx(se,{analytics:U,onLoad:P=>m(P)}),u.jsx(fe,{isAppContentDrawerOpen:f,handleDrawerToggle:k}),u.jsx(bt,{navigate:e,location:s,companyId:h,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{k(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:o.colors.grey5}})},Ct=W(function(e,s){const{businessVerificationDetails:t,productType:a}=s,c=V(e),n=D.getSignedInUser(),o=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},i=wn(s.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?He(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},function(e,s){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:o}=s,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:_,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:T,syncToken:I,fileIds:h,incDate:w,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:P,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:z,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe}=i,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?jn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:w!=null?je(w?.toString()):w,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:P?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:z,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:_,syncToken:T};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:i=>{const r=i.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:_,dob:g,phone:S,syncToken:T,selectDocument:I,role:h,ownership:w,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:_,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:T,titleAtCompany:h.selectedOption,ownershipInCompany:w,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:i=>{e(L(t,i,a))},onSendForVerificationClick:i=>{e(L(t,i,a,!0))},onAddressClick:i=>{const r=Ze(l,i),p=Ne(o.state?.pathnameStackToGoBack,o.pathname),f=new URLSearchParams(o.search),A={};f.forEach((d,y)=>{A[y]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onRegisteredAddressClick:i=>{const r=Ze(l,i),p=Ne(o.state?.pathnameStackToGoBack,o.pathname),f=new URLSearchParams(o.search),A=Object.fromEntries(f.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onBackClick:()=>{e(Bn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ae({files:i}))},onDeleteFile:i=>{e(te(i))},onDeleteFileList:i=>{e(Ke(i))},onEditFileName:(i,r)=>{e(ne(i,r.split(".")[0]))},onGetOtp:i=>{e($e(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e(Qe(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Ve())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Fn(i.documentType);r!=null&&e(Vn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(On({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}})(et),It=({productType:e,isBusinessVerificationDrawerOpen:s,closeDrawerHandler:t})=>{const a=X(),c=Y(),n=ee(),[o]=Ye(),l=o.get("showStepProgress"),i=o.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=$(),A=ie(),{useDynamicConfig:d}=oe(),y=De(),{configValue:b}=d(J.zeniAccountsConfig),_=ye(b),g=v(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=v(m=>m.companyConfigState.fetchState),T=v(m=>m.userRoleConfigState.fetchState),I=v(m=>V(m)),h=I.companyId??D.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),T==="Not-Started"&&n(_n(!0))},[S,T,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n(Q(h,!0))}},[r,g,h,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let w;switch(e){case"zeni_accounts":w=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":w=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":w=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":w=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:w=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=v(m=>{let P;switch(e){case"zeni_accounts":P=Tn(m,h);break;case"zeni_treasury":P=We(m,h);break;case"charge_cards":P=En(m,h);break;case"reimbursement":P=Pn(m,h);break;default:P=vn(m,h)}return P});return w===!1?null:k.fetchState==="Completed"&&w===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:U,onLoad:m=>(P=>{switch(e){case"zeni_accounts":return P.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return P.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return P.trackPageLoaded(G.Event.billPayBusinessVerification,Be(c)?"Settings":void 0)}})(m)}),u.jsx(Ct,{businessVerificationDetails:k,navigate:a,location:c,companyId:h,analytics:U,currentTenant:I,productType:e,roleMap:A.loggedInUserRoleMap,isSettings:Be(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:_.maxInsuredAmount,isBusinessVerificationDrawerOpen:s,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},At={overlayWidth:new tt(100,100,59)},kt=W(function(e,s){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=s,n=V(e),o=D.getSignedInUser(),l=n.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:l??""},r=Je(e,a),p=We(e,a),f=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",A=Ln(e),d=A.transactions,y=He(e),b=A.accountSummary?.totalBalance?.amount,_=d.length===0||b===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:y,isFirstTransfer:_,isDisabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,s){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:o,treasurySetupView:l}=s;return{onTransferSaveChangesToLocalStore:i=>{e(Qn(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(we("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Te(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(Ee(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Pe(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?_e(i,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(ke(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ae({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(L(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(ze(!1))}r===!0&&e(qe())},updateFilesEntity:i=>{e(ae({files:i}))},onDeleteFile:i=>{e(te(i))},onEditFileName:(i,r)=>{e(ne(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{o.trackTreasuryAllocationAction("update",Me(i)),e(Mn(i))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{s.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Ve())}}})(at),_t=()=>{const e=X(),s=Y(),t=ee(),a=De(),c=nt(),{tenantEmailDomain:n}=$(),{useDynamicConfig:o}=oe(),l=ie(),[i,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=o(J.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,_]=C.useState(!1),[g,S]=C.useState(!1),[T,I]=C.useState(!1),[h,w]=C.useState(!1),k=v(O=>O.treasurySetupViewState.fetchState),m=v(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),P=v(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=v(O=>O.treasuryDetailState.transactionsState?.fetchState),F=v(O=>V(O)),E=D.getSignedInUserTenant(n)?.companyId??F.companyId,z=v(O=>Je(O,E)),H=z.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(_(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(Rn()))},[g,m,E,t]),C.useEffect(()=>{T||P!=="Not-Started"||E==null||(I(!0),t(zn()))},[T,P,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(w(!0),t(Nn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{i||k!=="Completed"||H||B||!s.pathname.includes("setup")||r(!0)},[k,H,B]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:U,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(ct,{onClose:()=>{t(Ve()),e("../setup")},anchor:"right",open:s.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:At.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:O=>O.stopPropagation(),children:u.jsx(It,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ve()),e("../setup")}})})}),u.jsx(kt,{navigate:e,location:s,companyId:E,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:A,isAccountsEnabled:ge,isAllocationDone:H,analytics:U,treasurySetupView:z,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=xe(rt)`
18
+ display: flex;
19
+ min-height: 100%;
20
+ flex-direction: column;
21
+ `,Pt=W(function(e,s){const{isUserZeniAccountsAdmin:t,companyId:a}=s,c=V(e),n=D.getSignedInUser(),o=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},i=Gn(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l}},function(e,s){const{navigate:t,companyId:a,currentTenant:c}=s;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,o)=>{e(we("account_setup",n,o))},onEstablishConnectionClick:n=>{e(Te(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,o,l)=>{e(Ee(n,o,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,o)=>{e(Pe(!1,n,"zeni_accounts","account_setup",o))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,o,l)=>{e(l==="paymentAccount"?_e(n,o,"zeni_accounts","account_setup"):ve("account_setup",n,o))},onUpdatePrimaryFundingAccount:(n,o)=>{e(ke(a,"account_setup",n,o))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,o)=>{e(Ae({officerType:n,fileIds:o}))},onSendForVerificationClick:n=>{e(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,o)=>{e(ne(n,o.split(".")[0]))}}})(it),Et=()=>{const e=X(),s=Y(),t=ee(),{tenantEmailDomain:a}=$(),{useDynamicConfig:c}=oe(),n=ie(),o=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),i=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=v(S=>S.zeniAccountSetupViewState.fetchState),y=v(S=>V(S)),b=D.getSignedInUserTenant(a)?.companyId??y.companyId,_=D.getSignedInUser(),g=S=>{p(S)};if(_==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=T=>T.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:U,onLoad:T=>S(T)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(Pt,{navigate:e,location:s,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:o,accountsPromoConfig:i,onClickMenuIcon:()=>{g(!0)}})]})}},Tt=xe.div`
22
+ display: flex;
23
+ height: 100vh;
24
+ width: 100%;
25
+ flex: 1 1 auto;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ background-color: ${e=>e.theme.colors.grey4};
29
+ `,wt=W(function(e,s){const t=V(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Hn(e),isReadonly:s.isFormReadonly,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:n,analytics:U}},function(e,s){const{navigate:t}=s;return{onFormDataChange:a=>{e(Kn(a))},onSubmitClick:()=>{e(qn(s.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ae({files:a}))},onDeleteFile:a=>{e(te(a))},onDeleteFileList:a=>{e(Ke(a))},onEditFileName:(a,c)=>{e(ne(a,c.split(".")[0]))}}})(ot),Dt=()=>{const e=X(),s=Y(),t=ee(),[a,c]=C.useState(!1),[n,o]=C.useState(!1),[l,i]=C.useState(!1),{tenantEmailDomain:r}=$(),p=ie(),{useFeatureGate:f}=oe(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=v(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=v(k=>k.billPaySetupViewState.fetchState),b=v(k=>V(k)),_=De(),g=b.companyId??D.getSignedInUserTenant(r)?.companyId,S=v(k=>$n(k.companyState,b.companyId)),T=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=T?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Wn(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(o(!0),t(Q(g,!0)))},[y,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,w=k=>{i(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Tt,{children:[u.jsx(se,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(k)}),Be(s)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:w}):null,u.jsx(wt,{navigate:e,location:s,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:_.colors.grey5}})},Ut=W(function(){return{}},function(e,s){const{companyId:t,productType:a}=s;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}})(st(e=>{const{isBillPayAdminLevelAccess:s,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:o,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return s?u.jsx(Fe,{productType:i}):t?u.jsx(j,{to:"../"}):u.jsx(N,{});case"international-wire":return s?u.jsx(Dt,{}):t?u.jsx(j,{to:"../"}):u.jsx(N,{});default:return s?u.jsx(lt,{}):t?u.jsx(j,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:i}):u.jsx(N,{}):a?u.jsx(ht,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(Et,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(_t,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?o?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(N,{}):o?u.jsx(gt,{}):l?u.jsx(j,{to:"../"}):u.jsx(N,{})}}));function oa(e){const{tenantEmailDomain:s}=$(),t=v(c=>V(c)).companyId??D.getSignedInUserTenant(s)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,o)=>{o.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ut,{...e,companyId:t,...a})}export{ea as A,na as P,oa as S,Jt as a,Yt as b,mt as c,yt as d,pt as e,ta as f,Wt as g,Qt as h,Kt as i,Xt as j,aa as k,qt as l,Ht as m,Gt as n,$t as o,Zt as p,ia as s};
@@ -0,0 +1 @@
1
+ import{j as u}from"./liveblocks-qa_6WStS.js";import{a as f,b as T,q as A}from"./sentry-BTf2Dtmp.js";import{u as z,h as D,j as l,g as M,N as O,n as j}from"./core-CJUY0MOY.js";import{u as P,z as s,m as _,d as E,a as F,e as B,f as N,h as V,g as Y,Y as $,i as b}from"./index-B2ukUPdb.js";import{eV as Z,LS as q,LT as J,fw as W,fZ as H,LY as X,gl as G,cX as K,LZ as y,L_ as Q,L$ as R,bY as v}from"./zeni-epic-state-Da9EwYbz.js";import"./mui-CkYYTJAV.js";import{u as ee}from"./useDeviceId-D5q7Ex2B.js";import{f as te}from"./analyticsHelper-DE1SyLO3.js";import{t as ne}from"./getLocaleForTenant-BxE1cnSw.js";import"./recharts-D3JK2Byj.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./utils-Bd6aVUzu.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="470955b0-7319-430e-b2c6-80ecb5b6b307",t._sentryDebugIdIdentifier="sentry-dbid-470955b0-7319-430e-b2c6-80ecb5b6b307")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:b.googleClientId,microsoftClientId:b.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:v(c),sourceUri:v(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(y())}}})($),ae=T.memo(ie);function be({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:C,accountUnlockTime:h}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>Z(e)),I=l(e=>q(e)),m=M(),w=_().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect(()=>{L.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[L.fetchState,c]),f.useEffect(()=>{t(void 0)},[]),f.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(X("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=Y();e!=null&&B(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?u.jsx(V,{onClose:()=>i(y()),unlockDate:h}):null]})}export{be as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-qa_6WStS.js";import{a as n}from"./sentry-BTf2Dtmp.js";import{u,g as m,h as g,N as p}from"./core-CJUY0MOY.js";import{z as f,w as b,t as y,d as l,f as h}from"./index-B2ukUPdb.js";import{gq as x,gr as I,Me as w}from"./zeni-epic-state-Da9EwYbz.js";import{n as j}from"./mui-CkYYTJAV.js";import"./recharts-D3JK2Byj.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./utils-Bd6aVUzu.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]="082b224a-6888-43ba-90fb-948c1b853671",e._sentryDebugIdIdentifier="sentry-dbid-082b224a-6888-43ba-90fb-948c1b853671")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),y.reset(),l.trackLogout(h.Event.logoutSuccess),l.resetUserIdentity()}catch(d){console.error("Error during sign out:",d)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
2
+ display: flex;
3
+ height: 100vh;
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
+ `;export{$ as default};
@@ -0,0 +1,9 @@
1
+ import{j as u}from"./liveblocks-qa_6WStS.js";import{a as D}from"./sentry-BTf2Dtmp.js";import{h as K,u as U,g as z,j as G,i as _,n as M}from"./core-CJUY0MOY.js";import{z as R,W as O,U as p,Z as V,x as W,d as Z,f as H,d9 as J,s as g,k as Q}from"./index-B2ukUPdb.js";import{eV as q,TH as F,I$ as C,TI as x,TD as X,In as y,TJ as Y,Iv as E,HR as aa,J0 as S,TK as B,fv as ea,IS as ta,IX as sa,IK as oa,II as w,IY as na,IF as ia,TL as la,TM as ra,TN as ka,TO as ca,TP as T,eh as da,TQ as ua,TR as pa}from"./zeni-epic-state-Da9EwYbz.js";import{n as Ta}from"./mui-CkYYTJAV.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DUCZkKew.js";import{M as ga}from"./MobileAppDrawer-CDYOk1Tu.js";import"./recharts-D3JK2Byj.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./utils-Bd6aVUzu.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]="ba12953b-6d31-4164-b24b-55d8aec13743",e._sentryDebugIdIdentifier="sentry-dbid-ba12953b-6d31-4164-b24b-55d8aec13743")}catch{}})();const fa=Ta.div`
2
+ display: flex;
3
+ min-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
+ `,ha=M(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=X(e),i=R.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(y({taskDetailLocalData:s}));const c=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(J);function ja(){const e=K(),t=U(),o=z(),k=R.getSignedInUser(),n=G(r=>q(r)),{taskGroupId:d}=_(),{useFeatureGate:i}=O(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,$]=D.useState(!1),h=G(r=>F(r,l)),b=G(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:j}=ma({mobileExploreReferrer:"Task Checklist"});if(V({isDataReady:m==="Completed"}),D.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),D.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:b.taskGroupById}))},[m,b.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(W,{analytics:Z,onLoad:r=>(v=>v.trackPageLoaded(H.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{$(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:b,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:N,onAskAiCfoClick:j})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{ja as default};
@@ -0,0 +1,9 @@
1
+ import{j as n}from"./liveblocks-qa_6WStS.js";import se from"./NotFoundScreen-DTvgxtkb.js";import{a as c}from"./sentry-BTf2Dtmp.js";import{h as H,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as ce,p as g}from"./core-CJUY0MOY.js";import{I2 as Z,I5 as le,H$ as de,eV as M,TD as W,Ij as Y,HY as pe,IP as ue,II as ke,TE as Q,TF as N,HU as me,HR as ge,rz as fe,rn as he,l2 as Ie,Id as Se,TG as Te,Iu as be,Ir as Ee,I8 as Ge,Io as Ce,In as De}from"./zeni-epic-state-Da9EwYbz.js";import{z as C,d7 as xe,$ as je,W as ye,U as b,k as X,s as v,x as we,d as V,f as ve,d8 as Re,i as A,au as Fe}from"./index-B2ukUPdb.js";import{n as Ue}from"./mui-CkYYTJAV.js";import{u as Be}from"./useInitialThreadRequest-CcPLE3h6.js";import{M as Pe}from"./MobileAppDrawer-CDYOk1Tu.js";import Le from"./TaskListScreen-DVU-iHmP.js";import"./recharts-D3JK2Byj.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./utils-Bd6aVUzu.js";import"./useAskAiCfoHostNavButtonProps-DUCZkKew.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]="4b972bd8-bed9-47e6-985d-0d951c9144ca",e._sentryDebugIdIdentifier="sentry-dbid-4b972bd8-bed9-47e6-985d-0d951c9144ca")}catch{}})();function $e(){const e=H(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const ze=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=W(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Y(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=H(),t=O(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=f(i=>M(i)),k=Be(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,J]=c.useState(!1),[F,K]=c.useState(!1),[U,ee]=c.useState(!1),[B,j]=c.useState(!1),T=c.useRef(!1),G=f(i=>i.taskListState.updateTasksFetchState.fetchState),P=f(i=>W(i)),L=f(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(Y(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(K(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{U||L==="Completed"||(ee(!0),t(ue()))},[U,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return j(!1),void(T.current=!1);if(G==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const $=f(i=>Q(i,r)),y=$.fetchState,z=C.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(ze,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:z,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Ue.div`
2
+ display: flex;
3
+ min-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
+ `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(g,{path:"/new",element:n.jsx(w,{})}),n.jsx(g,{path:"/new/:taskGroupId",element:n.jsx(w,{})}),n.jsx(g,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(g,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(g,{path:"/:taskId",element:n.jsx(w,{})}),n.jsx(g,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-qa_6WStS.js";import i from"./NotFoundScreen-DTvgxtkb.js";import{T as r}from"./TransactionDetailScreen-qgLSqSNT.js";import"./sentry-BTf2Dtmp.js";import{o as s,p as o}from"./core-CJUY0MOY.js";import"./zeni-epic-state-Da9EwYbz.js";import"./recharts-D3JK2Byj.js";import"./index-B2ukUPdb.js";import"./mui-CkYYTJAV.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./utils-Bd6aVUzu.js";import"./useAskAiCfoHostNavButtonProps-DUCZkKew.js";import"./decodeURIComponentSafe-BXzU7C-M.js";import"./routePaths-DbnM8jAc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -0,0 +1,5 @@
1
+ import{j as x}from"./liveblocks-qa_6WStS.js";import{a as i}from"./sentry-BTf2Dtmp.js";import{u as q,k as Ke,j as g,s as fe,g as Se,h as Te,i as be,N as Ze,n as Qe}from"./core-CJUY0MOY.js";import{nL as he,eV as Z,gm as Xe,Oc as et,mY as tt,mG as at,bn as nt,cT as Ee,bs as Ie,r7 as W,Nb as H,Od as ve,Oe as oe,NB as De,kF as Ce,Of as ke,NG as se,NH as ce,lu as Ae,K6 as ie,N5 as M,kz as Oe,kx as Ue,kJ as ot,ny as st,Og as ct,Oh as it,vk as K,kE as xe,Jr as we,cY as rt,cZ as lt,Oi as dt,N4 as ut,Oj as mt,vg as pt,Ok as ft,Ol as ht,Om as yt,On as gt,Oo as St,kI as Tt,Op as bt,Oq as Et,N6 as It,Or as vt,Os as Dt,Ot as Ct,Jl as kt,Jb as At,JA as Ot,kK as Ut,K7 as ye,nD as xt}from"./zeni-epic-state-Da9EwYbz.js";import{W as Y,U as w,z as _e,aQ as Pe,m as wt,q as _t,aR as Pt,y as Ft,k as ae,I as Vt,aS as Bt,s as ne,Z as Nt,aT as Rt,d as Fe,aU as zt,au as Lt,a2 as te}from"./index-B2ukUPdb.js";import{n as Gt,S as jt,D as $t}from"./mui-CkYYTJAV.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-DUCZkKew.js";import{d as Ve}from"./decodeURIComponentSafe-BXzU7C-M.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-DbnM8jAc.js";import{u as Ht}from"./utils-Bd6aVUzu.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="44bdd3d1-e4b3-477b-a552-212bae2ba9e1",t._sentryDebugIdIdentifier="sentry-dbid-44bdd3d1-e4b3-477b-a552-212bae2ba9e1")}catch{}})();function Yt(t=!0){const e=q(),s=Ke(),{useFeatureGate:a}=Y(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Jt(t,e){const s=function(){const r=q(),[p,S]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=Y(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=g(h=>Z(h)),b=k.companyId,U=g(h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:L}=g(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(L);P.current=L;const R=g(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Q=N.current??{},J=P.current;for(const z of u)if($.has(z.accountId)&&Q[z.accountId]==null&&J?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void S(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),S(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),S(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=g(u=>Z(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:S}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=g(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=g(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=g(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=g(u=>oe(u)),B=g(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),L=o.company?.companyInfo.firstMonthOfFY??1,G=g(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:S,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,uiState:B,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Zt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=q(),p=g(y=>oe(y)),S=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:x.jsx(Qt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Qt=Gt(jt)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `;function Xt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=g(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:S}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(S),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=Se(),n=Te(),o=q(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),S=e??p,A=s??Ve(r??"");let y;Be(S,A)&&(y={id:S,type:W(A)});const m=y!=null?g(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Qe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),S=Z(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:S.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${Lt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??ze(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ne(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(K({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,S=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:S}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(St({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(gt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Xt(t,a):void 0}})(zt);function ya(){const t=Te(),e=q(),s=Se(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=Vt(),c=g(d=>Z(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),S=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),U=Be(C,b),_=g(d=>d.transactionVendorViewState),B=re(),{isFeatureEnabled:L}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:N}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:W(b)}},[U,C,b]),l=I!=null?g(d=>H(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=g(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=g(d=>oe(d)),E=g(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=g(d=>Ce(d.accountState,d.accountListState,"accountList")),[Q,J]=i.useState(!1),[z,le]=i.useState(!1),[Le,de]=i.useState(!1),Ge=i.useCallback(d=>Ne(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{J(!1),le(!1)},me=Bt();Yt();const X=i.useRef(l?.transaction);X.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Jt($e,()=>{const d=[];if(X.current!=null)for(const ee of X.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{Le||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&ge(l?.transaction),D!=null&&(!r||p&&S===!1)&&(Q?z||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),ge(l?.transaction),J(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Ye,onAskAiCfoClick:Je}=Mt({mobileExploreReferrer:"Transaction Details"});return Nt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Zt,{isOpen:v,transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Ye,onAskAiCfoClick:Je,isTransactionCommentingEnabled:L,isProjectsTransactionsEnabled:N,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&x.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Ze,{to:ze(Me.length)})}const ze=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},ge=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Zt as C,ya as T,Yt as a,Jt as b,ta as c,aa as d,ea as e,re as f,Xt as g,ha as u};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-qa_6WStS.js";import{h as K,g as U,u as W,i as H,j as h,N as z,n as Q,o as ve,p as j}from"./core-CJUY0MOY.js";import{eV as Z,qO as X,jT as u,RC as ee,JZ as De,bo as le,RD as be,ku as te,ND as ae,RE as ue,RF as Pe,bE as Y,JV as ye,RG as Ee,RH as me,RI as je,JY as Ae,RJ as xe,RK as pe,RL as Me,RM as ge,RN as Le,RO as Ce,RP as fe,L9 as Be}from"./zeni-epic-state-Da9EwYbz.js";import{a as de,W as ne,U as J,d as G,co as ce,s as q,k as oe,V as Fe,B as Oe}from"./index-B2ukUPdb.js";import"./mui-CkYYTJAV.js";import{a as g}from"./sentry-BTf2Dtmp.js";import{w as se}from"./withTransactionSidePanel-RlHJMQ4A.js";import{p as ie,c as re}from"./routePaths-DbnM8jAc.js";import{v as Re}from"./utils-Bd6aVUzu.js";import{d as b}from"./decodeURIComponentSafe-BXzU7C-M.js";import{Z as Ge}from"./ZeniAccountStatementScreen-C-juTt6c.js";import"./recharts-D3JK2Byj.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./useAskAiCfoHostNavButtonProps-DUCZkKew.js";import"./TransactionDetailScreen-qgLSqSNT.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="cbac566a-ea46-47fc-920c-b42c78ce6a22",a._sentryDebugIdIdentifier="sentry-dbid-cbac566a-ea46-47fc-920c-b42c78ce6a22")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Re(a),we=Q(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:N(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),V=se(function({...a}){const e=K(),t=U(),n=W(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=H(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>Z(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(J.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=Q(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),Je=se(function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Z(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(J.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=qe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Q(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ke=se(function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Z(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(J.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=We(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ze,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Qe=Q(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=H(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(v=>Z(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Xe(p,A,S,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(J.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(J.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,S,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Qe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>Z(n)).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Je,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ke,{referrerType:a})})]})}export{kt as default};
@@ -0,0 +1,37 @@
1
+ import{j as e}from"./liveblocks-qa_6WStS.js";import{h as L,g as B,u as P,i as O,j as y,N as U,n as G,o as we,p as I}from"./core-CJUY0MOY.js";import{cp as N,eV as D,Ql as R,Gk as ae,fT as H,G2 as ne,Qn as ke,Gn as Ie,Qj as be,Qk as se,QA as je,Er as Ae,u8 as Ee,Qp as ve,GG as De,Qm as re,cS as Z,yn as oe,fy as Fe,fA as Ue,Rz as Le,RA as Be,G3 as Pe,RB as Re,G4 as Me,Gd as Ve,bs as Oe,bJ as Ge,cA as Ne,bK as _e,co as ze,fS as $e,bt as Qe,LU as He,cn as Ze}from"./zeni-epic-state-Da9EwYbz.js";import{I as _,ar as qe,z as A,x as z,d as b,ch as Ke,ci as We,cj as Q,q,m as Je,V as Xe,Z as Ye,W as ie,U as E,y as et,w as tt,ck as at,au as K,s as nt,cl as st,k as W,cm as rt,O as X,cn as ot,a9 as it}from"./index-B2ukUPdb.js";import{D as ct,n as M,S as lt}from"./mui-CkYYTJAV.js";import ut from"./NotFoundScreen-DTvgxtkb.js";import{S as Y}from"./SetupPagesScreen-Cb_h1N2q.js";import{a as p}from"./sentry-BTf2Dtmp.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-DUCZkKew.js";import{u as pt}from"./useInitialThreadRequest-CcPLE3h6.js";import{u as mt}from"./useCashManagementBanner-Bqm1UKHq.js";import{M as ce}from"./MobileAppDrawer-CDYOk1Tu.js";import{F as ft}from"./FeaturePreviewScreen-DCDhII3I.js";import{a as ee}from"./analyticsHelper-DE1SyLO3.js";import"./recharts-D3JK2Byj.js";import"./analytics-BToIaEuE.js";import"./plaid-1xV6OFdB.js";import"./dnd-LV5QvpgJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-zGjtu-Uw.js";import"./lexical-Cmpx8sPR.js";import"./pdf-CZjXUklc.js";import"./utils-Bd6aVUzu.js";import"./routePaths-DbnM8jAc.js";import"./BusinessVerificationPageScreen-9FWcKpyL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c389c67e-933b-49fa-ab46-e854a1976191",t._sentryDebugIdIdentifier="sentry-dbid-c389c67e-933b-49fa-ab46-e854a1976191")}catch{}})();const yt=G(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(Ie(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(ke(s))}}})(Ke);function gt(){const t=L(),a=B(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(k=>k.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=qe(s),r=N(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,C]=p.useState(!1),[d,c]=p.useState(!1),h=y(k=>D(k)),g=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=y(k=>R(k,g)),w=y(k=>k.treasurySetupViewState.fetchState),x=y(k=>k.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(k=>k.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(H()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(C(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(U,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=G(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ee("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ae(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(We),St=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,C]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),T=A.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||T==null||(r(!0),o(ae(T,!0,!1)))},[f,d,T,o]),p.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(H()))},[l,c,T,o]),p.useEffect(()=>{u||h!=="Not-Started"||T==null||(C(!0),o(ne()))},[u,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${t=>t.theme.colors.grey4};
9
+ `,Tt={overlayWidth:new et(100,100,48)},Ct=G(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:r}=a,{tenantEmailDomain:l}=o;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let u="page-not-found";i==="editPortfolio"?u=wt(l):i==="statements"?u=kt(l):i==="taxLetter"?u=It(l):i==="settings"&&(u=bt(l));const C=nt(m.state?.pathnameStackToGoBack,m.pathname);n(u,{state:{pathnameStackToGoBack:C}})},onColumnSortConfigChanged:(i,u)=>{t(Le({uiState:{sortKey:i,sortOrder:u}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(r?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${l}/checking/cash_management`)}}})(at);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),o=L(),m=P(),s=q(),f=Je(),r=y(j=>D(j)),{tenantEmailDomain:l}=O(),i=r.companyId??A.getSignedInUserTenant(l)?.companyId,[u,C]=p.useState(!1),d=y(j=>re(j)),c=d.fetchState,h=d.accountSummary?.totalBalance?.amount,g=y(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),T=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),w=!!r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=N(S?.loggedInUserRoleMap),F=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:v}=Xe();p.useEffect(()=>{c==="Not-Started"&&!u&&v&&(C(!0),m(oe(!0)))},[u,m,c,v]),p.useEffect(()=>{d.transactionsFetchState.fetchState==="Completed"&&d.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[d.transactionsFetchState.fetchState,d.transactions.length]);const k=()=>{o("..")},[le,ue]=p.useState(!1),J=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=dt({mobileExploreReferrer:"Treasury"});Ye({isDataReady:c==="Completed"});const me=mt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(E.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(E.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(E.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(E.isCashManagementFeatureEnabled),Se=pt(i,{clearParams:c==="Completed"&&g?.fetchState==="Completed"}),xe=Fe(r),Te=Ue(fe,r);if(xe===!0&&Te!==!0)return e.jsx(ft,{});if(T){const j=g?.fetchState!=="Completed"||d.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[d.accountSummaryFetchState.fetchState==="Completed"&&g?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(ct,{onClose:k,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:Tt.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(jt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(St,{isFirstTransfer:d.transactions.length===0||h===0}):null,a===!0?e.jsx(gt,{}):null]})}),e.jsxs(xt,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(Ct,{treasuryDetailsView:d,isAutoTransferRuleEnabled:ye,navigate:o,currentTenant:r,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:J,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(U,{to:"../setup"}):r.companyTreasuryInfo?.info&&!w&&F?e.jsx(U,{to:"../promo",state:n.state}):e.jsx(tt,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const wt=t=>`/${t}/treasury/edit-portfolio`,kt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,bt=t=>`/${t}/treasury/setup`,jt=M(lt)`
10
+ display: flex;
11
+ min-height: 100%;
12
+ flex-direction: column;
13
+ `,At=M.div`
14
+ display: flex;
15
+ height: 100vh;
16
+ width: 100%;
17
+ flex: 1 1 auto;
18
+ flex-direction: column;
19
+ align-items: center;
20
+ background-color: ${t=>t.theme.colors.grey4};
21
+ `;function Et(){const t=L(),a=P(),n=q(),o=B(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Be(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),a(Pe(!1)))},[s,r.fetchState,a]);const l=A.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},C=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(At,{windowSize:n,children:e.jsx(st,{currentTenantCompanyName:C,statementListView:r,isLoading:d,onBackClick:()=>{const c=W(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const vt=M.div`
22
+ display: flex;
23
+ height: 100vh;
24
+ width: 100%;
25
+ flex: 1 1 auto;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ background-color: ${t=>t.theme.colors.grey4};
29
+ `;function Dt(){const t=L(),a=q(),n=B(),o=P(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Re(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),o(Me(!1)))},[s,r.fetchState,o]);const l=A.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},C=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(vt,{windowSize:a,children:e.jsx(rt,{currentTenantCompanyName:C,taxLetterListView:r,isLoading:d,onBackClick:()=>{const c=W(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const Ft=G(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Ve(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}})(ot),Ut=()=>{const t=L(),a=B(),n=P(),{tenantEmailDomain:o}=O(),[m,s]=p.useState(!1),f=y(S=>D(S)),[r,l]=p.useState(!1),i=y(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);p.useEffect(()=>{r||i?.fetchState!=="Not-Started"||u==null||(l(!0),n(H()))},[i,n]);const u=A.getSignedInUserTenant(o)?.companyId??f.companyId,C=A.getSignedInUser(),d=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{s(S)};if(C==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),g=N(h?.loggedInUserRoleMap),T=Z(h?.loggedInUserRoleMap);if(d&&g)return e.jsx(U,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!d&&g||T)){if(a.state?.message==="activation"){const S=W(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:c}),e.jsx(Ft,{analytics:b,navigate:t,companyId:u,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=M.div`
30
+ display: flex;
31
+ width: 100%;
32
+ height: 100%;
33
+ flex-direction: row;
34
+ justify-content: center;
35
+ align-items: center;
36
+ background-color: ${t=>t.theme.colors.grey5};
37
+ `;function sa(){const t=B(),a=y(v=>D(v)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(E.isTreasuryEnabled),m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=Z(s?.loggedInUserRoleMap),r=a?.userRole!=null&&Oe(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!r)&&Ge(s?.loggedInUserRoleMap),i=Ne(s?.loggedInUserRoleMap),u=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!r)&&_e(s?.loggedInUserRoleMap),{isFeatureEnabled:C}=n(E.isDepositAccountsFeatureEnabled),d=C&&!r&&ze(s?.loggedInUserRoleMap),c=a.company!=null&&$e(a.company),h=o&&c===!0&&!r&&N(s?.loggedInUserRoleMap),{isFeatureEnabled:g}=n(E.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=n(E.isDebitCardFeatureEnabled),S=it(a,g,T)&&!r&&Qe(s?.loggedInUserRoleMap),w=He(s?.loggedInUserRoleMap),x=Ze(s?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(we,{children:[x?null:e.jsx(I,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(I,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(I,{path:"promo",element:e.jsx(Ut,{})}),e.jsx(I,{path:"statements",element:e.jsx(Et,{})}),e.jsx(I,{path:"tax-letter",element:e.jsx(Dt,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(I,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(I,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(I,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(I,{path:"*",element:e.jsx(ut,{})})]}):m&&h?e.jsx(I,{path:"*",element:e.jsx(U,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(I,{path:"*",element:e.jsx(U,{to:"../promo",state:t.state})}):e.jsx(I,{path:"*",element:null})]})}export{sa as default};