@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.
- package/dist/assets/AddressRoutes-1t80Lwwm.js +1 -0
- package/dist/assets/AddressScreen-fWJCm4zs.js +9 -0
- package/dist/assets/AiCfoScreen-RA-P0Ele.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-Bv9HP5Ed.js +1 -0
- package/dist/assets/BillPayRoutes-DM71-NMQ.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-9FWcKpyL.js +9 -0
- package/dist/assets/CardsAiCfoScreen-CJUAzHrT.js +14 -0
- package/dist/assets/ChargeCardRoutes-BKCoQWOu.js +71 -0
- package/dist/assets/CompanyPassportScreen-Z-knYrxv.js +1 -0
- package/dist/assets/ConnectionAuthScreen-Cev1gkS_.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-GZfWR-j7.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-BTm1Abhx.js +30 -0
- package/dist/assets/DashboardRoutes-wMhkTYla.js +20 -0
- package/dist/assets/DefaultTenantHome-ClYhyRXO.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-Cl_7XBwW.js +18 -0
- package/dist/assets/DrawerScreen-DqnvN1tq.js +1 -0
- package/dist/assets/EntityDetailRoutes-Dy54l33K.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BAwf_5XR.js +25 -0
- package/dist/assets/FeaturePreviewScreen-DCDhII3I.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-rLAbttjN.js +1 -0
- package/dist/assets/MagicLinkRoutes-B-PPv0PR.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DlEpGGzi.js +12 -0
- package/dist/assets/MobileAppDrawer-CDYOk1Tu.js +1 -0
- package/dist/assets/NotFoundScreen-DTvgxtkb.js +1 -0
- package/dist/assets/NotificationRoutes-ye5VX3PS.js +1 -0
- package/dist/assets/OAuthConsentScreen-DF7q2wgy.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DZnjcm2C.js +1 -0
- package/dist/assets/PeopleRoutes-Cshc61GL.js +22 -0
- package/dist/assets/PerformanceRoutes-UE1AlGRc.js +1 -0
- package/dist/assets/{Preview-KE8R1SN3.js → Preview-COCp1vn_.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CGgBpuke.js → QBOConnectionScreen-ClD_YrtC.js} +1 -1
- package/dist/assets/ReferralListScreen-BQiDRb4Q.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-B02Z7OIU.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CrNxSCRL.js +1 -0
- package/dist/assets/{ReimbursementRoutes-MbRZIHuu.js → ReimbursementRoutes-BDTp98VH.js} +12 -12
- package/dist/assets/ReportsRoutes-utyUVcdp.js +1 -0
- package/dist/assets/RewardsRoutes-B0tydv2M.js +1 -0
- package/dist/assets/ScreenRoutes-C_5gtCcR.js +2 -0
- package/dist/assets/SettingsRoutes-CItpcp8o.js +57 -0
- package/dist/assets/SetupPagesScreen-Cb_h1N2q.js +29 -0
- package/dist/assets/SignInScreen-DayaVPul.js +1 -0
- package/dist/assets/SignOutScreen-DfnourF6.js +9 -0
- package/dist/assets/TaskListScreen-DVU-iHmP.js +9 -0
- package/dist/assets/TaskRoutes-DECOOPQm.js +9 -0
- package/dist/assets/TransactionDetailRoutes-Ln9HzXsS.js +1 -0
- package/dist/assets/TransactionDetailScreen-qgLSqSNT.js +5 -0
- package/dist/assets/TransactionListRoutes-BqwHG3AV.js +1 -0
- package/dist/assets/TreasuryRoutes-DxBKr4aJ.js +37 -0
- package/dist/assets/{VendorsRoutes-BjMVmZbA.js → VendorsRoutes-BvKCtUVO.js} +26 -26
- package/dist/assets/WiseConfirmationScreen-DGdciAcq.js +12 -0
- package/dist/assets/ZeniAccountRoutes-4nzGey-r.js +73 -0
- package/dist/assets/ZeniAccountStatementScreen-C-juTt6c.js +9 -0
- package/dist/assets/{accountMappingHelper-B_qiWmeW.js → accountMappingHelper-BFxOrTVK.js} +1 -1
- package/dist/assets/{analytics-BUNQWYXz.js → analytics-BToIaEuE.js} +1 -1
- package/dist/assets/{analyticsHelper-DNuTbD5B.js → analyticsHelper-DE1SyLO3.js} +1 -1
- package/dist/assets/{core-C8Y7fm3n.js → core-CJUY0MOY.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-pK1yrQsS.js → decodeURIComponentSafe-BXzU7C-M.js} +1 -1
- package/dist/assets/dnd-LV5QvpgJ.js +6 -0
- package/dist/assets/{empty-CTn7RkAu.js → empty-BrON4VTN.js} +1 -1
- package/dist/assets/{index-DhPN3gNQ.js → empty-DZsqgfyL.js} +1 -1
- package/dist/assets/{emptyVideoElement-BE2d8kYR.js → emptyVideoElement-D28OtmxE.js} +1 -1
- package/dist/assets/epic-DUxvu9Sx.js +2 -0
- package/dist/assets/getLocaleForTenant-BxE1cnSw.js +1 -0
- package/dist/assets/index-3T7v0Kjw.js +1 -0
- package/dist/assets/{index-CyWBxegb.js → index-6y2Ha7q4.js} +1 -1
- package/dist/assets/{index-C_oqefR-.js → index-7lEXxVMw.js} +1 -1
- package/dist/assets/{index-C3-objML.js → index-B2ukUPdb.js} +44600 -39007
- package/dist/assets/{index-DjeTRCsF.js → index-BUVIqiRA.js} +1 -1
- package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
- package/dist/assets/{index-eBlD3uTi.js → index-CQBukgOK.js} +1 -1
- package/dist/assets/index-LSEqxgWI.js +1 -0
- package/dist/assets/{index-Cv6pmWIm.js → index-N--zv7t4.js} +2 -2
- package/dist/assets/{lexical-CPmqnx9k.js → lexical-Cmpx8sPR.js} +1 -1
- package/dist/assets/{liveblocks-fDjf6Tur.js → liveblocks-qa_6WStS.js} +1 -1
- package/dist/assets/{lottie-DmArr_jQ.js → lottie-zGjtu-Uw.js} +1 -1
- package/dist/assets/{mui-Ky-KJxLh.js → mui-CkYYTJAV.js} +1 -1
- package/dist/assets/{pathToGoBack-9QBEItSt.js → pathToGoBack-BPCNomFS.js} +1 -1
- package/dist/assets/{pdf-NvioK7wV.js → pdf-CZjXUklc.js} +3 -3
- package/dist/assets/{pdf-lib-6uw_qC-k.js → pdf-lib-1-yXS4qt.js} +1 -1
- package/dist/assets/{plaid-D50ZkdQf.js → plaid-1xV6OFdB.js} +1 -1
- package/dist/assets/{pusher-CAUUsTgW.js → pusher-D2ak7eHg.js} +1 -1
- package/dist/assets/{react-C7YWBeDO.js → react-BQ9185Ee.js} +1 -1
- package/dist/assets/{react-CzlxEg73.js → react-BSs2nIas.js} +1 -1
- package/dist/assets/{react-CHUA3ysh.js → react-BihdrB0K.js} +1 -1
- package/dist/assets/{react-BX04XLg-.js → react-CBo1BYNF.js} +1 -1
- package/dist/assets/{react-DsRQdKTx.js → react-COkOWomn.js} +1 -1
- package/dist/assets/{react-BzVo9cuE.js → react-CVnQTP0R.js} +1 -1
- package/dist/assets/{recharts-CgIjuHOA.js → recharts-D3JK2Byj.js} +3 -3
- package/dist/assets/{routePaths-B8EWQXPr.js → routePaths-DbnM8jAc.js} +1 -1
- package/dist/assets/{sentry-DjzU4p1F.js → sentry-BTf2Dtmp.js} +1 -1
- package/dist/assets/{url-mCw4Y0mb.js → url-CnoP6Bkx.js} +1 -1
- package/dist/assets/{url-DBETAWzw.js → url-DbiWYN-9.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-C9aknKEV.js +1 -0
- package/dist/assets/{useAskAiCfoHostNavButtonProps-DDzinN2F.js → useAskAiCfoHostNavButtonProps-DUCZkKew.js} +1 -1
- package/dist/assets/useCashManagementBanner-Bqm1UKHq.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-Bxg7wg9x.js +1 -0
- package/dist/assets/{useDeviceId-DBHwhChu.js → useDeviceId-D5q7Ex2B.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BGSh8M-E.js +1 -0
- package/dist/assets/useInitialThreadRequest-CcPLE3h6.js +1 -0
- package/dist/assets/{utils-Djk4rnCT.js → utils-Bd6aVUzu.js} +2 -2
- package/dist/assets/withTransactionSidePanel-RlHJMQ4A.js +21 -0
- package/dist/assets/zeni-epic-state-Da9EwYbz.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-CPX14XSj.js +0 -1
- package/dist/assets/AddressScreen-V8qhbu9d.js +0 -9
- package/dist/assets/AiCfoScreen-B2v4oX4h.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-B6jqtEYg.js +0 -1
- package/dist/assets/BillPayRoutes-CKtJupU-.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-DO1Qhw6D.js +0 -9
- package/dist/assets/ChargeCardRoutes-BHdVO9a5.js +0 -71
- package/dist/assets/CompanyPassportScreen-DkvfpbMw.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DaGPpRPO.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CD5LwsDH.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-CTpQNO2Q.js +0 -23
- package/dist/assets/DashboardRoutes-jRDsqXRC.js +0 -20
- package/dist/assets/DefaultTenantHome-_pdrgccv.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-CCXVWOri.js +0 -18
- package/dist/assets/DrawerScreen-B7V2OyqL.js +0 -1
- package/dist/assets/EntityDetailRoutes-DfRfi9XQ.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-cFT1NB2O.js +0 -25
- package/dist/assets/FeaturePreviewScreen-2R9FJdWJ.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-rd4Kj3vC.js +0 -1
- package/dist/assets/MagicLinkRoutes-BO0Lexxe.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BAuy3KLO.js +0 -12
- package/dist/assets/MobileAppDrawer-DIls_BW2.js +0 -1
- package/dist/assets/NotFoundScreen-D4Av36kV.js +0 -1
- package/dist/assets/NotificationRoutes-lCQFJz0z.js +0 -1
- package/dist/assets/OAuthConsentScreen-COgy1n70.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Bkidve9i.js +0 -1
- package/dist/assets/PeopleRoutes-B7wvEYYp.js +0 -22
- package/dist/assets/PerformanceRoutes-CjXTt9vm.js +0 -1
- package/dist/assets/ReferralListScreen-BA5RvLF7.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-BGkN9M7Q.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-6mUow2wt.js +0 -1
- package/dist/assets/ReportsRoutes-BBKUYNc0.js +0 -1
- package/dist/assets/RewardsRoutes-BbXQsLmk.js +0 -1
- package/dist/assets/ScreenRoutes-BxoMc-Es.js +0 -2
- package/dist/assets/SettingsRoutes-DLxDXOLE.js +0 -57
- package/dist/assets/SetupPagesScreen-DLtasQoq.js +0 -29
- package/dist/assets/SignInScreen-CJnKhy_P.js +0 -1
- package/dist/assets/SignOutScreen-DNLOQn_i.js +0 -9
- package/dist/assets/TaskListScreen-G6lL0uD5.js +0 -9
- package/dist/assets/TaskRoutes-DQA7zeTW.js +0 -9
- package/dist/assets/TransactionDetailRoutes-yWhhHCBD.js +0 -1
- package/dist/assets/TransactionDetailScreen-gAhskOIn.js +0 -5
- package/dist/assets/TransactionListRoutes-CzgCZLFm.js +0 -1
- package/dist/assets/TreasuryRoutes-BmIGoFg4.js +0 -37
- package/dist/assets/WiseConfirmationScreen-Co4RuLhn.js +0 -12
- package/dist/assets/ZeniAccountRoutes-C_Otg4hI.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-BbupcIsJ.js +0 -9
- package/dist/assets/dnd-RzzQg6oJ.js +0 -6
- package/dist/assets/empty-Bs_WirIs.js +0 -1
- package/dist/assets/epic-CPnluZX0.js +0 -2
- package/dist/assets/getLocaleForTenant-CYgluMQL.js +0 -1
- package/dist/assets/index-BCOcxjVj.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DN1K5TAQ.js +0 -1
- package/dist/assets/useInitialThreadRequest-X7WpfR49.js +0 -1
- package/dist/assets/withTransactionSidePanel-BvWwtSm-.js +0 -21
- package/dist/assets/zeni-epic-state-DvHgUD1-.js +0 -13
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-fDjf6Tur.js";import{a as p}from"./sentry-DjzU4p1F.js";import{h as z,g as K,u as M,j as h,t as se,n as $,i as Z,o as J,p as I}from"./core-C8Y7fm3n.js";import{bn as Ee,eQ as P,fN as Ae,m4 as we,Or as ve,gO as ue,M1 as je,pZ as ke,jH as pe,l_ as Pe,gQ as Te,M3 as Me,M2 as De,Os as Ue,yi as _e,CN as Oe,O0 as Fe,O9 as Be,c1 as ee,cG as Re,cH as ze,K8 as Ve,Ot as Le,K9 as Ne,wK as Ke,Ou as $e,F9 as Ze,Ct as Ge,Ck as ge,Ch as qe,wO as me,Cn as he,Cq as fe,Cw as ne,tb as te,wN as He,jj as X,jm as be,Ov as Qe,kn as Ye,x1 as Je,KY as Xe,KZ as We,jh as en,Ow as nn,jk as tn,qr as an,Ox as on,Oy as sn,qv as cn,gy as ln,Kh as Y,gn as rn,gu as dn,Ki as un,w_ as pn,Oz as gn,OA as mn,CK as hn,eZ as Se,e$ as Ce,OB as fn,fB as bn,Kr as Sn,wZ as ie,fG as ce,fF as Cn,wY as yn,fE as In,fD as xn,OC as En,f2 as ye,OD as An,OE as wn,x4 as vn,wX as le,OF as jn,fj as kn,wU as Pn,bU as Tn,c0 as Mn,b$ as Dn,bV as Un,bZ as _n,bY as On,bX as Fn,b_ as Bn,bW as Rn}from"./zeni-epic-state-DvHgUD1-.js";import{s as ae,U as O,z as A,af as Ie,bK as zn,c as Q,e as Vn,k as G,B as oe,bL as Ln,bM as Nn,aq as Kn,h as xe,bN as $n,bO as Zn,bP as Gn,a9 as qn,Y as Hn,bQ as Qn,q as Yn,bR as Jn}from"./index-C3-objML.js";import{n as F}from"./mui-Ky-KJxLh.js";import{M as D}from"./MobileAppDrawer-DIls_BW2.js";import{a as q,g as H,m as Xn}from"./accountMappingHelper-B_qiWmeW.js";import{t as Wn,A as et}from"./AddressScreen-V8qhbu9d.js";import N from"./NotFoundScreen-D4Av36kV.js";import{g as nt}from"./analyticsHelper-DNuTbD5B.js";import{B as tt}from"./BusinessVerificationPageScreen-DO1Qhw6D.js";import{C as at}from"./CompanyPassportScreen-DkvfpbMw.js";import{q as re}from"./QBOConnectionScreen-CGgBpuke.js";import{B as ot}from"./BillPayApprovalRoutes-B6jqtEYg.js";import{R as st}from"./ReimbursementApprovalRoutes-BGkN9M7Q.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./routePaths-B8EWQXPr.js";import"./empty-CTn7RkAu.js";import"./pdf-lib-6uw_qC-k.js";import"./index-DjeTRCsF.js";import"./url-mCw4Y0mb.js";import"./index-BCOcxjVj.js";import"./decodeURIComponentSafe-pK1yrQsS.js";import"./ReimbursementApprovalRuleDetailScreen-6mUow2wt.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]="f21ba742-8b14-4fd0-b507-d3f203796fd2",e._sentryDebugIdIdentifier="sentry-dbid-f21ba742-8b14-4fd0-b507-d3f203796fd2")}catch{}})();const it=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
|
-
`,ct=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:pe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ke(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizationThreshold:t.capitalizationThreshold,capitalizationThresholdMaxCeiling:t.capitalizationThresholdMaxCeiling,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationThresholds:t.onSaveCapitalizationThresholds}},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:w}=u,{prepaidExpensesAccount:x,fixedAssetsAccount:v,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:U}=m,E=q(t.accountMappingView.incomeAccountList,f.selectedOption),B=q(t.accountMappingView.expenseAccountList,g.selectedOption),V=q(t.accountMappingView.billPayAccountList,l.selectedOption),L=q(t.accountMappingView.reimbursementsAccountList,w.selectedOption),R=H(t.accountMappingView.prepaidExpensesAccountList,x.selectedOptions),b=H(t.accountMappingView.fixedAssetsAccountList,v.selectedOptions),T=H(t.accountMappingView.accruedExpensesAccountList,S.selectedOptions),C=H(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),j=Xn(t.accountMappingView.expenseAccounts1099FilingAccountList,U),_={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:B?.accountId,selectedBillPayAccountId:V?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:R.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:T.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:C.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:j};e(De({data:_}))},onBackClick:()=>{Ie(r)===!1?(s("../../dashboard"),e(Me())):e(ue())},onSaveClick:()=>{e(Te()),i&&Q.track(Vn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Pe(t.currentTenant.companyId,n))}}})(zn),lt=()=>{const e=z(),t=K(),s=M(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(O.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=A.getSignedInUser(),f=Ee(m),g=h(C=>P(C)),{capitalizableAccounts:l,capitalizationThreshold:w,capitalizationThresholdMaxCeiling:x,isCapitalizationThresholdSaving:v,currencySymbol:S}=h(C=>{const j=C.tenantState.currentTenantId,_=j!=null?C.tenantState.tenantsById[j]:void 0,k=Ae(C.companyState,g.companyId);return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizationThreshold:_?.capitalizationThreshold??null,capitalizationThresholdMaxCeiling:_?.capitalizationThresholdMaxCeiling??null,isCapitalizationThresholdSaving:C.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:k?.company.companyLocaleInfo?.currencySymbol??"$"}},se),y=p.useCallback((C,j)=>{s(we(g.companyId,C,j))},[s,g.companyId]),U=h(C=>ve(C.accountState),se),E=p.useMemo(()=>{const C={};for(const j of U)j.accountId!=null&&j.accountName!=null&&(C[j.accountId]=j.accountName);return C},[U]),[B,V]=p.useState(!1),[L,R]=p.useState(!1);p.useEffect(()=>{B===!1&&(s(ue()),V(!0))},[B]);const b=h(C=>je(C)),T=C=>{R(C)};return o.jsxs(it,{children:[o.jsx(D,{isAppContentDrawerOpen:L,handleDrawerToggle:T}),o.jsx(ct,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:E,capitalizationThreshold:w,capitalizationThresholdMaxCeiling:x,currencySymbol:S,isCapitalizationThresholdSaving:v,onSaveCapitalizationThresholds:y,location:t,isSettings:Ie(t),onClickMenuIcon:()=>T(!0)})]})},rt=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
|
-
`,dt=$(function(e,t){const s=P(e),r=Fe(e),i=Be(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:Q}},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")}}})(Ln),ut=()=>{const e=z(),t=K(),s=M(),{tenantEmailDomain:r}=Z(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(S=>P(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),g=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Ue(S)),w=m.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const x=G();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),s(_e(!0)))},[u,f,s]),p.useEffect(()=>{a||g!=="Not-Started"||(c(!0),s(Oe(!0)))},[a,g,s]);const v=S=>{n(S)};return x?.loggedInUserRoleMap!=null?o.jsxs(rt,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(dt,{navigate:e,location:t,companyId:w,currentTenant:m,roleMap:x.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},pt=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
|
-
`,gt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=P(e);return{bankSetupView:$e(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:Q}},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(fe(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(he(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(me(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?ge(n,a,c,u):qe(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(Ge(i,a,n,c))},onRemoveConnection:n=>{e(Ze(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Nn),mt=()=>{const e=z(),t=K(),s=M(),{tenantEmailDomain:r}=Z(),i=G(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>P(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=Re(d,i?.loggedInUserRoleMap),g=ze(d,i?.loggedInUserRoleMap),l=Ve(d,i?.loggedInUserRoleMap),w=Le(d,i?.loggedInUserRoleMap),x=Ne(d,i?.loggedInUserRoleMap),v=d.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ke(!1)))},[c,s,m]);const S=y=>{a(y)};return f||l||g||x?o.jsxs(pt,{children:[o.jsx(D,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),o.jsx(gt,{navigate:e,location:t,companyId:v,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:x,isTreasuryEnabled:w,onClickMenuIcon:()=>{S(!0)}})]}):o.jsx(N,{})},ht=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
|
-
`,ft=$(function(e,t){const{companyId:s}=t,r=P(e),i=t.roleMap.bill_pay_admin,n=Qe(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:xe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:Q}},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(me("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(fe(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(he(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(ge(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(be(n))},handleConfirmCardSetupIntent:n=>{e(tn(n))},updateCardPaymentModalState:n=>{e(nn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(en(n,a,c))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(We())},handleResetCardPaymentErrorStatuses:()=>{e(Xe())},onBillingAddressSave:n=>{e(Je(n))},onAddressEditHandler:n=>{if(n!=null){const a=Wn(n);e(Ye({addressType:"subscription_billing_address",addressToCreate:a}))}}}})($n),bt=()=>{const e=z(),t=K(),s=M(),{tenantEmailDomain:r}=Z(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>P(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Kn(f.addCardPaymentSourceStatus.fetchState),w=f.addCardPaymentSourceStatus.fetchState,x=m.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const v=G();p.useEffect(()=>{x!=null&&s(He(x,!1))},[x,s]),p.useEffect(()=>{a||(c(!0),s(X()))},[a,s]),p.useEffect(()=>{u||(be(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&w==="Completed"&&s(X())},[l,w]);const S=y=>{n(y)};return v?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),o.jsx(ft,{navigate:e,location:t,companyId:x,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:xe.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},W="external_integrations",St=$(function(e){const t=sn(e,W);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:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(pn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(dn(a,d,Y("revenue"),un("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(rn(a,c,Y(u)))},onSaveConnectorCredentials:c=>{e(ln(a,Y("payments"),c))},onNotifyMe:c=>{e(cn(W,c,i))}}})(Zn),Ct=()=>{const e=z(),t=M(),{tenantEmailDomain:s}=Z(),[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>P(l)),c=a.companyId??A.getSignedInUserTenant(s)?.companyId,u=A.getSignedInUser(),d=G(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(an(W))},[t]);const f=l=>{i(l)},g=h(l=>on(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(yt,{children:[o.jsx(D,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(St,{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,w])=>[l,w?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},yt=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
|
-
`,It=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
|
-
`,xt=()=>{const e=M(),{tenantEmailDomain:t}=Z(),[s,r]=p.useState(!1),i=h(l=>P(l)).companyId??A.getSignedInUserTenant(t)?.companyId,n=A.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>gn(l,n.userId)),c=h(l=>mn(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(hn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(It,{children:[o.jsx(D,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Gn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Et=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
|
-
`,de=({appContent:e})=>{const t=M(),s=z(),r=K(),[i,n]=p.useState(!1),a=h(b=>P(b)),{tenantEmailDomain:c}=a,u=a.companyId??A.getSignedInUserTenant(c)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(O.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(O.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(O.isTreasuryEnabled),w=h(b=>pe(b)),x=Se(a),v=Ce(g,a),S=!v&&w,y=qn(a,f,g),{areTenantIdsInSync:U}=Hn();p.useEffect(()=>{U&&t(fn(u,S))},[u,t,S,U]);const E=h(b=>bn(b,S)),B=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||u==null,V=Sn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,R=b=>{n(b)};return o.jsxs(Et,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:R}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Qn,{myProfileView:E,isAccountingClassesEnabled:w,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:V===!1,onClickMenuIcon:()=>{R(!0)},isLoading:B,isBankingOnlyTenant:v,isCardsOnlyTenant:x,onAddressClick:b=>{const T=function(j,_){let k=`/${j}/settings/my_profile`;return k=k.concat(`/new/${_}`),k}(c,b),C=Yn(r.state?.pathnameStackToGoBack,r.pathname);s(T,{state:{pathnameStackToGoBack:C}})},onGetOtp:b=>{const T={...E.myProfileLocalData,phone:b};t(ie({localData:T})),t(xn(b,"MyProfile"))},onResendOtp:b=>{t(In(b,"MyProfile"))},onCancelClick:()=>{t(yn())},onSaveClick:()=>{t(ce("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(b,T)=>{t(Cn(b,T,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&A.saveZeniOtpToken(b),t(ce("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(ie({localData:b}))}})]})};function At(){const e=M(),t=h(l=>P(l)).companyId,s=h(l=>En(l)),r=h(l=>ye(l)),i=A.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(An(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(wn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(vn())},[]);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(le(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(jn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(le(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(D,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(Jn,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function sa(e){const[t,s]=p.useState(!1),r=h(l=>ye(l)),i=h(l=>P(l)),n=G(),a=A.getSignedInUser(),c=M(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(O.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||kn(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Pn()))},[r.fetchState,t]);const f=Ce(d,i),g=Se(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(J,{children:[Mn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"accounting/*",element:o.jsx(lt,{})}),Dn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"approval_rules/*",element:o.jsx(wt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Un(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"my_bank_connections",element:o.jsx(xt,{})}),_n(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"bank_connections",element:o.jsx(mt,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"business_verification",element:o.jsx(tt,{productType:f?"zeni_accounts":g?"charge_cards":nt(i,n?.loggedInUserRoleMap)})}),Fn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"company_details",element:o.jsx(at,{})}),Bn(n?.loggedInUserRole??[],i)&&o.jsx(I,{path:"billing",element:o.jsx(bt,{})}),Rn(n?.loggedInUserRole??[],d,i)&&o.jsx(I,{path:"integrations",element:o.jsx(Ct,{})}),o.jsx(I,{path:"my_profile/new/:addressType",element:o.jsx(de,{appContent:o.jsx(et,{isSubPage:!1})})}),o.jsx(I,{path:"my_profile",element:o.jsx(de,{})}),m&&o.jsx(I,{path:"notifications",element:o.jsx(At,{})}),o.jsx(I,{path:"*",element:o.jsx(N,{})})]}):o.jsx(J,{children:o.jsx(I,{path:"*",element:o.jsx(N,{})})}):null}function wt(e){return o.jsxs(J,{children:[o.jsx(I,{path:"/",element:o.jsx(ut,{})}),o.jsx(I,{path:"bills/approval-rules/*",element:o.jsx(ot,{})}),o.jsx(I,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(st,{}):o.jsx(N,{})}),o.jsx(I,{path:"*",element:o.jsx(N,{})})]})}export{sa as default};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-fDjf6Tur.js";import{h as Q,g as X,u as Y,i as W,j as E,N,n as G,s as Xe}from"./core-C8Y7fm3n.js";import{bF as Ye,ck as Ie,NQ as ye,eQ as V,cw as en,yt as Z,yi as nn,O0 as tn,O3 as an,qK as ee,qy as ne,kf as te,sJ as z,O5 as Ae,fF as $e,fE as We,fD as Ge,O6 as sn,yC as on,Ct as ke,Ck as _e,Ch as ve,C8 as K,Cn as Pe,Cq as Ee,Cw as we,tb as Te,fU as cn,cr as rn,e$ as un,eZ as dn,e_ as ln,bt as pn,O7 as mn,Ba as le,BO as yn,O8 as fn,bG as gn,DJ as pe,CN as Sn,O9 as bn,Oa as hn,DN as Cn,DR as In,sC as An,Ih as kn,Em as Ce,Fn as me,Ob as _n,Oc as vn,Od as Pn,Oe as He,Of as En,KL as wn,Nd as Tn,KX as Dn,Og as qe,Oh as Be,EI as Ke,kn as On,qB as Je,sL as Un,bE as je,sX as Ne,cu as Fn,Oi as Qe,fi as Bn,E4 as Vn,E8 as xn,Oj as jn,Ep as Re,Ok as Nn,Ol as Rn,Om as zn,On as Ln,fN as Mn,zN as Zn,Oo as $n,zS as Wn,zR as Gn}from"./zeni-epic-state-DvHgUD1-.js";import{k as ae,s as ie,U as de,m as De,aN as J,z as w,x as se,c as T,B as Oe,e as $,bz as Hn,at as oe,bA as x,bB as qn,bC as Kn,af as xe,bD as Jn,q as ze,au as Le,J as Qn,A as Xn,bE as Yn,bF as et,bG as nt,a7 as tt}from"./index-C3-objML.js";import{a as C}from"./sentry-DjzU4p1F.js";import{n as Ve,D as at,S as it}from"./mui-Ky-KJxLh.js";import{M as fe}from"./MobileAppDrawer-DIls_BW2.js";import R from"./NotFoundScreen-D4Av36kV.js";import{a as Me}from"./analyticsHelper-DNuTbD5B.js";import{d as Ze}from"./routePaths-B8EWQXPr.js";import{B as Fe}from"./BusinessVerificationPageScreen-DO1Qhw6D.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c26bf649-4874-48dd-bf45-374b84bf5337",e._sentryDebugIdIdentifier="sentry-dbid-c26bf649-4874-48dd-bf45-374b84bf5337")}catch{}})();const st=Ve.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
|
-
`,ot=G(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=tn(e),i=w.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(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",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(Ge(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Hn),ct=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=Ye(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=De(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(F=>F.billPaySetupViewState.fetchState),A=E(F=>V(F)),_=E(F=>F.billPaySetupApproverViewState.fetchState),b=A.companyId??w.getSignedInUserTenant(a)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const D=F=>{S(F)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(N,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const F=O=>O.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:T,onLoad:O=>F(O)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:D}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{D(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Rt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;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},$t=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Gt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Ht=(e,o,t,a,c)=>e&&o&&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,qt=(e,o,t,a,c)=>e&&o&&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,Kt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Jt=80,Qt=80,Xt=e=>e.companyId??w.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Yt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,ea=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=G(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=w.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},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",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{T.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(Te("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{T.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);T.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;T.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:x(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=E(L=>V(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),D=A&&h===!1,F=A===!1&&h,O=ye(r),B=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),j=w.getSignedInUserTenant(a)?.companyId??n.companyId,U=w.getSignedInUser(),Ue=L=>{ge(L)},Se=E(L=>mn(L,j));if(U==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||M!=="Not-Started"||j==null?q||M!=="Completed"||j==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(j,!1,!0)):(re(!0),t(le(j,!0)))},[q,M,j,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:()=>{T.trackPageLoaded($.Event.cardsSetupVisited),T.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Ue}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:j,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:B,isDebitCardOnlyEnabled:D,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:O})]}):u.jsx(Oe,{fetchState:"Not-Started"}):u.jsx(N,{to:"../promo"})},mt=Ve.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
|
-
`,yt=G(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=bn(e),i=hn(e,a),l=w.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=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",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),T.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,i)=>{e(Te("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),{useDynamicConfig:n}=ie(),i=De(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>V(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=w.getSignedInUserTenant(a)?.companyId??g.companyId,A=w.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(N,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:T,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=G(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Tn(e.companyConfigState),p=Dn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:D,companySubIndustry:F,countriesOfOperations:O,companySourceOfFunds:B,companySourceOfFundsDescription:ce,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:j,usNexus:U,usNexusTypes:Ue}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Fn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?je(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:D?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:O?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:B?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:j,usNexus:U,usNexusTypes:Ue?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(Ne({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:F}=p;let O;return A.selectDocumentType==="driverLicense"?O="driving_license":A.selectDocumentType==="passport"?O="passport":A.selectDocumentType==="stateId"?O="id_document":A.selectDocumentType==="ssnCard"&&(O="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?je(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:O,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Ne({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(Un({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Be())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=X(),n=Y(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=W(),I=ae(),{useDynamicConfig:d}=ie(),m=De(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>V(h)),_=A.companyId??w.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),w.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let D;switch(e){case"zeni_accounts":D=En(h,_);break;case"zeni_treasury":D=He(h,_);break;case"charge_cards":D=Pn(h,_);break;case"reimbursement":D=vn(h,_);break;default:D=_n(h,_)}return D});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:h=>(D=>{switch(e){case"zeni_accounts":return D.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return D.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return D.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:T,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Xn(100,100,59)},ht=G(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=w.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=He(e,a),y=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",I=jn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(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:(s,r)=>{e(Te("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Re(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(Nn(s))},onConfirmFundAllocation:()=>{e(Re(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Be())}}})(Yn),Ct=()=>{const e=Q(),o=X(),t=Y(),a=De(),c=Qn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(U=>U.treasurySetupViewState.fetchState),h=E(U=>U.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),D=E(U=>U.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=E(U=>U.treasuryDetailState.transactionsState?.fetchState),O=E(U=>V(U)),B=w.getSignedInUserTenant(n)?.companyId??O.companyId,ce=E(U=>Qe(U,B)),H=ce.isAtomicAccountExists,ge=!!O.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=w.getSignedInUser(),re=U=>{m(U)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||B==null||(v(!0),t(Ce(B,!0,!1)))},[S,k,B,t]),C.useEffect(()=>{g||h!=="Not-Started"||B==null||(f(!0),t(Bn()))},[g,h,B,t]),C.useEffect(()=>{P||D!=="Not-Started"||B==null||(A(!0),t(Vn()))},[P,D,B,t]),C.useEffect(()=>{_||F!=="Not-Started"||B==null||(b(!0),t(xn(!0)))},[_,F,B,t]);const M=O.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||H||j||!o.pathname.includes("setup")||r(!0)},[k,H,j]),O.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(N,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(Be()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:U=>U.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Be()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:B,currentTenant:O,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:H,analytics:T,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Ve(it)`
|
|
18
|
-
display: flex;
|
|
19
|
-
min-height: 100%;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
`,At=G(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Te("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>V(f)),S=w.getSignedInUserTenant(a)?.companyId??m.companyId,v=w.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(N,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Ve.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
|
-
`,vt=G(function(e,o){const t=V(e),a=w.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:T}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Gn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=X(),t=Y(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>V(k)),v=De(),g=S.companyId??w.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),w.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(N,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:T,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:T,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=G(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;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(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Fe,{productType:s}):t?u.jsx(N,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(N,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ct,{}):t?u.jsx(N,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(R,{}):a?u.jsx(ft,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(kt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(N,{to:"../"}):u.jsx(R,{}):i?u.jsx(pt,{}):l?u.jsx(N,{to:"../"}):u.jsx(R,{})}}));function na(e){const{tenantEmailDomain:o}=W(),t=E(c=>V(c)).companyId??w.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(w.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Jt as A,Qt as P,na as S,Ht as a,Kt as b,ut as c,dt as d,rt as e,Xt as f,Zt as g,zt as h,Gt as i,qt as j,Yt as k,Wt as l,$t as m,Lt as n,Mt as o,Rt as p,ea as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-fDjf6Tur.js";import{a as u,b as T,q as A}from"./sentry-DjzU4p1F.js";import{u as D,h as z,j as l,g as M,N as O,n as j}from"./core-C8Y7fm3n.js";import{u as P,z as s,m as F,c as E,D as K,d as _,e as B,I as J,g as N,f as V,h as v}from"./index-C3-objML.js";import{eQ as X,JX as $,JY as q,eX as Q,fo as W,K1 as H,fM as Y,cS as G,K2 as y,K3 as R,K4 as Z,bT as b}from"./zeni-epic-state-DvHgUD1-.js";import"./mui-Ky-KJxLh.js";import{u as ee}from"./useDeviceId-DBHwhChu.js";import{f as te}from"./analyticsHelper-DNuTbD5B.js";import{t as ne}from"./getLocaleForTenant-CYgluMQL.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.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]="4f5d0467-db9f-482b-aaf2-4a57fbb64c7d",t._sentryDebugIdIdentifier="sentry-dbid-4f5d0467-db9f-482b-aaf2-4a57fbb64c7d")}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:v.googleClientId,microsoftClientId:v.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(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:b(c),sourceUri:b(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(R(n,a)))},clearSignInError:()=>{t(y())}}})(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),L=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>X(e)),I=l(e=>$(e)),m=M(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[h.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(I.tenantsInOrder),o.zeniSessionId),Q(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),K.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Y().then(()=>{const e=N();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",G(r.productSettings))},2e3))},[S,p,L,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 f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(J,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-fDjf6Tur.js";import{a as n}from"./sentry-DjzU4p1F.js";import{u,g as m,h as p,N as g}from"./core-C8Y7fm3n.js";import{z as d,B as y,t as h,c as f,e as b}from"./index-C3-objML.js";import{fR as x,fS as I,Kj as j}from"./zeni-epic-state-DvHgUD1-.js";import{n as w}from"./mui-Ky-KJxLh.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.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]="539ee8cd-1955-4433-b4a2-3956514757ad",e._sentryDebugIdIdentifier="sentry-dbid-539ee8cd-1955-4433-b4a2-3956514757ad")}catch{}})();function $(){const e=u(),t=m(),i=p(),a=n.useRef(!1),c=d.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),j(),h.reset(),f.trackLogout(b.Event.logoutSuccess),f.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.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};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-fDjf6Tur.js";import{a as D}from"./sentry-DjzU4p1F.js";import{h as _,u as v,g as K,j as b,i as q,n as z}from"./core-C8Y7fm3n.js";import{z as L,s as V,U as p,_ as H,x as M,c as O,e as Q,cT as W,q as g,p as Z}from"./index-C3-objML.js";import{eQ as J,Rm as F,H2 as y,Rn as x,Ri as X,Gq as E,Ro as Y,Gy as I,FU as aa,H3 as S,Rp as R,gU as ea,GV as ta,G_ as sa,GN as oa,GL as B,G$ as na,GI as ia,Rq as la,Rr as ra,Rs as ca,Rt as ka,Ru as m,ec as da,Rv as ua,Rw as pa}from"./zeni-epic-state-DvHgUD1-.js";import{n as ma}from"./mui-Ky-KJxLh.js";import{u as Ta}from"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import{M as ga}from"./MobileAppDrawer-DIls_BW2.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.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]="d6fd9576-589e-4f2c-a8fe-1512fddf5e8b",e._sentryDebugIdIdentifier="sentry-dbid-d6fd9576-589e-4f2c-a8fe-1512fddf5e8b")}catch{}})();const fa=ma.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
|
-
`,Ga=z(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,n=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,d=X(e),i=L.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:c,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=w(i,a),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(y(!0,d))},onTabChange:a=>{e(ka(a))},onParentTaskClick:a=>{const s=w(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(B(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(R({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ca({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(y(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Z(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(B(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ha(l,a);e(E({taskDetailLocalData:s}));const k=C(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(k,{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(R({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(E({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(i,t.localData.defaultTaskGroupId),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(W);function $a(){const e=_(),t=v(),o=K(),c=L.getSignedInUser(),n=b(r=>J(r)),{taskGroupId:d}=q(),{useFeatureGate:i}=V(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,U]=D.useState(!1),G=b(r=>F(r,l)),h=b(r=>r.taskGroupState),T=G.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:$}=Ta({mobileExploreReferrer:"Task Checklist"});if(H({isDataReady:T==="Completed"}),D.useEffect(()=>{t(y(!1,l))},[n?.tenantId,t,l]),D.useEffect(()=>{T==="Completed"&&t(x({taskGroupById:h.taskGroupById}))},[T,h.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[T==="Completed"?u.jsx(M,{analytics:O,onLoad:r=>(j=>j.trackPageLoaded(Q.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{U(r)}}),u.jsx(Ga,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:h,localData:G.localData,uiState:G.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:N,onAskAiCfoClick:$})]})]})}const w=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ha=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{$a as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-fDjf6Tur.js";import se from"./NotFoundScreen-D4Av36kV.js";import{a as c}from"./sentry-DjzU4p1F.js";import{h as Z,u as M,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-C8Y7fm3n.js";import{G5 as O,G8 as le,G2 as de,eQ as H,Ri as K,Gm as Q,F$ as pe,GS as ue,GL as ke,Rj as W,Rk as N,FX as me,FU as fe,qK as ge,qy as he,kf as Se,Gg as Ie,Rl as Ge,Gx as Te,Gu as be,Gb as Ee,Gr as Ce,Gq as De}from"./zeni-epic-state-DvHgUD1-.js";import{z as C,cR as xe,H as ye,s as Re,U as T,p as X,q as w,x as je,c as z,e as we,cS as ve,h as V,at as Fe}from"./index-C3-objML.js";import{n as Ue}from"./mui-Ky-KJxLh.js";import{u as Be}from"./useInitialThreadRequest-X7WpfR49.js";import{M as Le}from"./MobileAppDrawer-DIls_BW2.js";import Pe from"./TaskListScreen-G6lL0uD5.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./useAskAiCfoHostNavButtonProps-DDzinN2F.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]="989a4be9-0f1f-479d-9182-ca2a72065216",e._sentryDebugIdIdentifier="sentry-dbid-989a4be9-0f1f-479d-9182-ca2a72065216")}catch{}})();function $e(){const e=Z(),t=M(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[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 A,_=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=H(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??""},S=K(e),{tenantEmailDomain:D}=d,b=r.recurringSourceTaskId,x=b!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(b)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,_=Object.values(I)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,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(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(be(a,o))},onUnsnoozeTask:a=>{e(Te(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=v(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Ge({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Q(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function j(){const e=Z(),t=M(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>H(i)),k=Be(l?.companyId),{useFeatureGate:a}=Re(),{isFeatureEnabled:o}=a(T.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(T.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(T.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(T.isTaskRecurringParentEnabled),{isFeatureEnabled:b}=a(T.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,Y]=c.useState(!1),[F,J]=c.useState(!1),[U,ee]=c.useState(!1),[B,y]=c.useState(!1),G=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),L=g(i=>K(i)),P=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(Q(!1,r)))},[p,t]),c.useEffect(()=>{F||L.fetchState==="Completed"||(J(!0),t(pe()))},[F,t,L.fetchState]),c.useEffect(()=>{U||P==="Completed"||(ee(!0),t(ue()))},[U,t,P]);const ae=c.useCallback(()=>{r!=null&&(G.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(B)if(E!=="In-Progress"){if(G.current){if(E==="Error")return y(!1),void(G.current=!1);if(E==="Completed"){y(!1),G.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=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else G.current=!0},[B,E,l,s,e]);const $=g(i=>W(i,r)),R=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(R==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[R==="Completed"?n.jsx(je,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Le,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx(qe,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:q,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:R,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:b})]})]})}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
|
-
`,v=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(j,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(j,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Pe,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(j,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-fDjf6Tur.js";import i from"./NotFoundScreen-D4Av36kV.js";import{T as r}from"./TransactionDetailScreen-gAhskOIn.js";import"./sentry-DjzU4p1F.js";import{o as a,p as o}from"./core-C8Y7fm3n.js";import"./zeni-epic-state-DvHgUD1-.js";import"./recharts-CgIjuHOA.js";import"./index-C3-objML.js";import"./mui-Ky-KJxLh.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import"./decodeURIComponentSafe-pK1yrQsS.js";import"./routePaths-B8EWQXPr.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{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};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as w}from"./liveblocks-fDjf6Tur.js";import{a as r}from"./sentry-DjzU4p1F.js";import{u as N,k as Qe,j as h,t as Je,g as he,h as ge,i as Se,N as Ke,n as Xe}from"./core-C8Y7fm3n.js";import{mT as me,eQ as Q,fN as Ze,m4 as ea,m2 as aa,bn as ta,cO as ye,bs as Te,qi as G,L9 as $,Ma as be,Mb as ae,Lz as Ee,jS as Ie,Mc as ve,LE as te,LF as ne,kH as Ce,I9 as oe,L3 as M,jM as De,jK as ke,jW as na,mG as oa,Md as sa,Me as ia,uo as Y,jR as Ae,Hu as xe,cT as ra,cU as ca,Mf as la,L2 as da,Mg as ua,uk as ma,Mh as pa,Mi as fa,Mj as ha,Mk as ga,Ml as Sa,jV as ya,Mm as Ta,Mn as ba,L4 as Ea,Mo as Ia,Mp as va,Mq as Ca,Ho as Da,He as ka,HD as Aa,jX as xa,Ia as pe,mL as wa}from"./zeni-epic-state-DvHgUD1-.js";import{s as H,U as F,z as we,aN as Fe,m as Fa,J as Ua,aO as Pa,A as _a,p as Z,k as La,aP as Va,q as ee,_ as Ba,aQ as za,c as Ue,aR as Oa,at as Ra,a2 as X}from"./index-C3-objML.js";import{n as Ma,S as Na,D as ja}from"./mui-Ky-KJxLh.js";import{u as Ga}from"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import{d as Pe}from"./decodeURIComponentSafe-pK1yrQsS.js";import{h as _e,c as Le,g as $a,e as Ha}from"./routePaths-B8EWQXPr.js";import{t as qa}from"./utils-Djk4rnCT.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]="6242621a-cb6a-4b7a-9342-e90dc8da1ea7",a._sentryDebugIdIdentifier="sentry-dbid-6242621a-cb6a-4b7a-9342-e90dc8da1ea7")}catch{}})();function Wa(a=!0){const e=N(),s=Qe(),{useFeatureGate:t}=H(),{isFeatureEnabled:n}=t(F.isCreateTransferEntryFromExpenseEnabled);r.useEffect(()=>{if(!a||n!==!0)return;const o=i=>{const l=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return l!=="In-Progress"&&l!=="Completed"};o("transferEntryEligible")&&e(me({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(me({kind:"creditCardOnlyEligible"}))},[a,n,e,s])}function Ya(a,e){const s=function(){const l=N(),[m,f]=r.useState(!1),[E,p]=r.useState(null),{useDynamicConfig:g}=H(),{configValue:U,isDynamicConfigLoading:T}=g("transaction_categorization_config"),u=!T&&U?.capitalization_enabled===!0,D=h(v=>Q(v)),I=D.companyId,A=h(v=>Ze(v.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:b,globalThreshold:k,maxCeiling:P,onboardingShownForPrepaid:_,onboardingShownForFixedAsset:B}=h(v=>{const S=v.tenantState.currentTenantId,c=S!=null?v.tenantState.tenantsById[S]:void 0;return{capitalizableAccounts:c?.capitalizableAccounts??null,globalThreshold:c?.capitalizationThreshold??null,maxCeiling:c?.capitalizationThresholdMaxCeiling??null,onboardingShownForPrepaid:c?.capitalizationOnboardingShownForPrepaid===!0,onboardingShownForFixedAsset:c?.capitalizationOnboardingShownForFixedAsset===!0}},Je),j=r.useCallback(v=>{if(!u||b==null||k!=null&&k>0)return;const S=b.accounts??[],c=new Set(v);let V=!1,C=!1;for(const x of S)c.has(x.accountId)&&(x.classificationType==="prepaid"?V=!0:x.classificationType==="fixed_asset"&&(C=!0));V&&!_?(p("prepaid"),f(!0)):C&&!B&&(p("fixed_asset"),f(!0))},[u,b,k,_,B]),z=r.useCallback(v=>{E!=null&&(l(ea(I,v,P,E)),f(!1),p(null))},[l,I,E,P]),L=r.useCallback(()=>{E!=null&&(l(aa(I,E)),f(!1),p(null))},[l,I,E]);return{showPopup:m&&u,popupType:E,currencySymbol:A,checkAndShowPopup:j,handleSubmit:z,handleDismiss:L}}(),t=r.useRef(void 0),n=r.useRef([]),o=r.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=r.useRef(e);return i.current=e,r.useEffect(()=>{a==="In-Progress"&&(n.current=i.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a},[a]),s}const se=()=>{const a=we.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return r.useMemo(()=>ta(a)&&s,[a,s])};function Ve(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ft(a,e){const s=N(),{useFeatureGate:t,useDynamicConfig:n}=H(),o=h(y=>Q(y)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ye(o.userRole),m=o.userRole!=null&&Te(o.userRole),{isFeatureEnabled:f}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:E}=t(F.isExpenseAutomationEnabled),{configValue:p}=n(Fe.enableUncategorizedExpenseCategory),g=p?.uncategorized_expense_category_enabled===!0,U=se(),T=r.useMemo(()=>({id:a,type:G(e)}),[a,e]),u=h(y=>$(y,T)),D=u?.transactionDetailUpdateStatus?.fetchState,I=u?.transactionDetailLocalData?.lineItemById,A=h(y=>{const W=$(y,T)?.transactionDetailLocalData.vendorUpdates?.id;return W==null?"Not-Started":y.transactionVendorViewState.editVendorStateById[W]?.saveStatus.fetchState??"Not-Started"}),b=r.useMemo(()=>u?.fetchState==="Completed"?Ve(u?.transaction):void 0,[u?.fetchState,u?.transaction]),k=h(y=>{if(b!=null)return be(y.customerIncomeState,y.vendorExpenseState,y.trendState,b,"month")}),P=h(y=>ae(y)),_=h(y=>{if(b!=null)return Ee(y.trendWithTransactionsState,b,"TransactionDetail")}),B=o.company?.companyInfo.firstMonthOfFY??1,j=h(y=>Ie(y.accountState,y.accountListState,"accountList")),[z,L]=r.useState(!1),[v,S]=r.useState(!1),[c,V]=r.useState(!1);r.useEffect(()=>{L(!1),S(!1),V(!1)},[a,e]);const C=r.useCallback(()=>{L(!1),S(!1)},[]),[x,O]=r.useState(!1),q=_?.selectedPeriod?.timePeriod;return r.useEffect(()=>{c||u==null||u.transaction==null||(s(ve({id:u.transaction.id,type:u.transaction.type})),V(!0)),b!=null&&(!i||l&&m===!1)&&(z?v||k==null||(S(!0),s(oe(b,"TransactionDetail",{timeframe:"month",timePeriod:q??k}))):(s(te()),s(ne()),L(!0),s(Ce(b))))},[s,c,u?.fetchState,u?.transaction,b,i,l,m,z,v,k,q]),r.useEffect(()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?O(!0):O(!1)},[P.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:m,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isChainOfThoughtEnabled:U,selectedTransaction:T,transactionDetail:u,rawDetailSaveStatus:D,rawDetailLineItemById:I,vendorSaveStatus:A,tranEntity:b,defaultTrendTransactionTimePeriod:k,vendorViewDetails:P,uiState:_,firstMonthOfFY:B,uncategorizedAccounts:j,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:x,setIsCreateVendorDrawerOpen:O}}const Qa={overlayWidth:new _a(100,100,58)},Ja=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Fa(),i=Ua(),l=N(),m=h(p=>ae(p)),f=()=>{t()},E={vendorDetailView:n??m,onSaveSuccess:()=>{l(ke()),l(na("Not-Started")),s()},onSaveVendor:e,onCancelClick:f,saveVendorDetailLocalData:p=>{l(De({vendorId:void 0,localData:p}))}};return w.jsx(ja,{anchor:"right",open:a,PaperProps:{style:{width:Qa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:f,children:w.jsx(Ka,{onClick:p=>p.stopPropagation(),children:w.jsx(Pa,{...E})})})},Ka=Ma(Na)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`;function Xa(a,e){a(oa({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:G(e.transactionType),sourceTransactionType:G(e.sourceTransactionType)}))}function Za({currentTransactionId:a,enabled:e=!0,buildPath:s,beforeNavigate:t,navigate:n,navigateState:o}){const i=h(m=>m.createTransferEntryState.lastTransferEntryReplacement),l=r.useRef(null);r.useEffect(()=>{if(!e||i==null||a==null||l.current===i)return;const{previousTransactionId:m,newTransactionId:f}=i;a.id===m.id&&a.type===m.type&&(l.current=i,t?.(),n(s(f),{replace:!0,state:o}))},[e,i,a,s,t,n,o])}const et=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=he(),n=ge(),o=N(),i=se(),{transactionTypeEncoded:l,transactionId:m}=Se(),f=e??m,E=s??Pe(l??"");let p;_e(f,E)&&(p={id:f,type:G(E)});const g=p!=null?h(T=>$(T,p)):void 0,U=()=>{const T=Z(t.state?.pathnameStackToGoBack),u=T.poppedPathname??((D=2)=>{let I="../";for(let A=0;A<D;A++)I=`${I}../`;return I})(1);n(u,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:p,onSaveVendor:()=>{o(Ae(p,void 0))},onSaveSuccess:()=>{if(g!=null&&g?.transaction&&g?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&g?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=g?.transactionDetailLocalData.vendorUpdates,u={id:g?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:g?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:g?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:g?.transaction?.id,type:g?.transaction?.type},transaction:g?.transaction,lineIds:g?.transaction?.lines?.map(I=>I.id)??[]};o(Y({entity:u,amount:g?.transaction?.amount.amount,transactionDetails:D,flowType:"detail",isFetchCOT:i}))}U()},onCancel:()=>{p!=null&&o(sa({transactionId:p})),o(ke()),o(ia()),a(!0),U()}}},at=Xe(function(a,e){const s=$(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=we.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=la(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,m=da(a,"common"),f=Q(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${X}/transaction_attachment`,transactionAttachmentsEndpointToFetch:f.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${X}/transaction_attachments_accounting_provider`:`${X}/transaction_attachments`,attachmentUploadEndpoint:`${Ra.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ue,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:m},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(M("common")),e.onBackClick!=null)return void e.onBackClick();const t=Z(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Be(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(wa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(te()),a(ne());const n=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Le(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(pe(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(oe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(pe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?Ae(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(M("common"))},onUploadAttachmentAttachment:t=>{a(Aa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ka(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(Da({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(Ca(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,m)=>{a(va(t,n,o,i,l,m))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(Ia({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=Z(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=qa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${$a(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Ha(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(xe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(Ea({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(M("common"))},onCancelAutoComplete:()=>{a(M("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(Y({entity:t,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ba(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(Ta(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(ya({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(Y({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s})),a(De({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const m=e.transaction,f=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(m.type??"")}/${m.id}/vendor/create`,{state:{pathnameStackToGoBack:f}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(Sa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(Y({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(ga({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ha(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(fa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(pa({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(ma(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(ua(t,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>Xa(a,t):void 0}})(Oa);function ht(){const a=ge(),e=N(),s=he(),{useFeatureGate:t,useDynamicConfig:n}=H(),o=La(),i=h(d=>Q(d)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),m=i.userRole!=null&&ye(i.userRole),f=i.userRole!=null&&Te(i.userRole),{isFeatureEnabled:E}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:p}=t(F.isExpenseAutomationEnabled),{configValue:g}=n(Fe.enableUncategorizedExpenseCategory),U=g?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:u,transactionId:D}=Se(),[I,A]=r.useState(!1),b=Pe(u??""),k=_e(D,b),P=h(d=>d.transactionVendorViewState),_=se(),{isFeatureEnabled:B}=t(F.isTransactionCommentingEnabled),{isFeatureEnabled:j}=t(F.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:z}=t(F.isProjectsTransactionsEnabled),L=o?.currentTenant?.companyId,v=o?.currentTenant?.companyName,S=r.useMemo(()=>{if(k)return{id:D,type:G(b)}},[k,D,b]),c=S!=null?h(d=>$(d,S)):void 0,V=c?.transactionDetailLocalData.vendorUpdates?.id!=null?P.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ve(c?.transaction):void 0,x=h(d=>C!=null?be(d.customerIncomeState,d.vendorExpenseState,d.trendState,C,"month"):void 0),O=h(d=>ae(d)),q=h(d=>C!=null?Ee(d.trendWithTransactionsState,C,"TransactionDetail"):void 0),y=i.company?.companyInfo.firstMonthOfFY??1,W=h(d=>Ie(d.accountState,d.accountListState,"accountList")),[ze,ie]=r.useState(!1),[Oe,re]=r.useState(!1),[Re,ce]=r.useState(!1),Me=r.useCallback(d=>Le(d,T??"")+s.search,[T,s.search]),Ne=r.useCallback(()=>{ce(!1)},[]);Za({currentTransactionId:S,enabled:T!=null&&T!=="",buildPath:Me,beforeNavigate:Ne,navigate:a,navigateState:s.state});const le=()=>{ie(!1),re(!1)},de=Va();Wa();const J=r.useRef(c?.transaction);J.current=c?.transaction;const je=c?.transactionDetailUpdateStatus?.fetchState,R=Ya(je,()=>{const d=[];if(J.current!=null)for(const K of J.current.lines??[])"account"in K&&K.account?.accountId!=null&&d.push(K.account.accountId);return d});r.useEffect(()=>{S!=null&&c!=null&&c.fetchState==="Not-Started"&&(e(xe(S,!1)),le())},[e,S,c?.fetchState]),r.useEffect(()=>{if(S!=null&&c?.fetchState==="Error"){const d=ee(s.state?.pathnameStackToGoBack,s.pathname);a("page-not-found",{replace:!0,state:de?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[S,c?.fetchState,a,s.state,s.pathname,de]),r.useEffect(()=>{Re||c==null||c.transaction==null||(e(ve({id:c.transaction.id,type:c.transaction.type})),ce(!0)),C==null&&c?.fetchState==="Completed"&&fe(c?.transaction),C!=null&&(!l||m&&f===!1)&&(ze?Oe||x==null||(re(!0),e(oe(C,"TransactionDetail",{timeframe:"month",timePeriod:q?.selectedPeriod?.timePeriod??x}))):(e(te()),e(ne()),fe(c?.transaction),ie(!0),e(Ce(C))))},[c?.fetchState,c?.transaction,x,l]),r.useEffect(()=>{O.newVendorState?.vendorDetailLocalData?.vendorName!=null?A(!0):A(!1)},[O.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{e(M("common"))},[]);const Ge=[u,D].filter(d=>d!=null),{transactionId:ue,onSaveVendor:$e,onSaveSuccess:He,onCancel:qe}=et({closeDrawerHandler:d=>{A(!1),a(d?"../":"../..")}}),{isAiCfoAccessEnabled:We,onAskAiCfoClick:Ye}=Ga({mobileExploreReferrer:"Transaction Details"});return Ba({isDataReady:c?.fetchState==="Completed"}),k?w.jsxs(w.Fragment,{children:[ue!=null&&I&&w.jsx(Ja,{isOpen:I,transactionId:ue,onSaveVendor:$e,onSaveSuccess:He,onCancel:qe}),w.jsx(at,{hideDeleteAttachment:!0,firstMonthOfFY:y,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:a,selectedTransaction:S,entity:C,isCOTEnabled:_,defaultTrendTransactionTimePeriod:x,resetTrendIsFetchedStates:le,transaction:c?.transaction,uncategorizedAccounts:W,vendorSaveStatus:V,isVendorBulkUpdateOnTransactionEnabled:E,isCreateTransferEntryFromExpenseEnabled:j,isExpenseAutomationEnabled:p,isUncategorizedExpenseCategoryEnabled:U,isAiCfoAccessEnabled:We,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:B,isProjectsTransactionsEnabled:z,companyId:L,companyName:v}),R.showPopup&&R.popupType!=null&&w.jsx(za,{popupType:R.popupType,currencySymbol:R.currencySymbol,onSubmit:R.handleSubmit,onDismiss:R.handleDismiss})]}):w.jsx(Ke,{to:Be(Ge.length)})}const Be=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},fe=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=tt(a),t=nt(a);Ue.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},tt=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.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=t;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}},nt=a=>ra(a)===!0?a.customer?.name??"":ca(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Ja as C,ht as T,Wa as a,Ya as b,et as c,at as d,Za as e,se as f,Xa as g,ft as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-fDjf6Tur.js";import{h as K,g as J,u as Q,i as Z,j as h,N as G,n as W,o as Pe,p as j}from"./core-C8Y7fm3n.js";import{eQ as U,pZ as X,j4 as u,Px as ee,I0 as De,bo as le,Py as ve,jH as te,LB as ae,Pz as ue,PA as be,bE as Y,HY as ye,PB as Ee,PC as me,PD as je,H$ as Ae,PE as xe,PF as pe,PG as Me,PH as ge,PI as Le,PJ as Be,PK as fe,Jd as Ce}from"./zeni-epic-state-DvHgUD1-.js";import{D as de,s as ne,U as q,c as w,ce,q as H,p as oe,Y as Fe,T as Oe}from"./index-C3-objML.js";import"./mui-Ky-KJxLh.js";import{a as g}from"./sentry-DjzU4p1F.js";import{w as se}from"./withTransactionSidePanel-BvWwtSm-.js";import{p as ie,c as re}from"./routePaths-B8EWQXPr.js";import{u as ze}from"./utils-Djk4rnCT.js";import{d as v}from"./decodeURIComponentSafe-pK1yrQsS.js";import{Z as we}from"./ZeniAccountStatementScreen-BbupcIsJ.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import"./TransactionDetailScreen-gAhskOIn.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]="acfdbc7e-6b91-4122-9d6d-d101d5bd5dd0",a._sentryDebugIdIdentifier="sentry-dbid-acfdbc7e-6b91-4122-9d6d-d101d5bd5dd0")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>ze(a),Re=W(function(a,e){const t=ve(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);w.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=H(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=J(),n=Q(),c=t.pathname.split("/").find(r=>Ge.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Z(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>U(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:B,initialTimeframeTick:b}=$e(o,p,I.bookCloseDate),[C,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(b);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,B]);g.useEffect(()=>{if(!C&&f!=null){E(!0),w.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))}},[C,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:B,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=W(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)}`),w.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=H(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),qe=se(function({referrerType:a,...e}){const t=K(),n=J(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=v(l??""),A=v(m??""),k=v(S??""),x=v(I??""),B=h(d=>be(d.transactionListState,A,p,k)),[b,C]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>U(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=h(d=>X(d))&&r;let i;const z=He(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Je(B?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[b,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 z&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(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,Je=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=W(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)}`),w.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=H(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=J(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=v(l??""),A=v(m??""),k=v(S??""),x=v(I??""),B=h(d=>je(d.transactionListState,A,p,k)),[b,C]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>U(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=h(d=>X(d))&&r;let i;const z=Qe(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ze(B?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[b,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 z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:Se($.length)})}),Se=(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,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W(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&&Be(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)}`),w.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=H(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=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=K(),n=J(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Z(),p=v(l??""),A=v(m??""),k=v(y??""),x=!(I!=null&&I==="exclude_subaccounts"),B=h(P=>Me(P.transactionListState,A,p)),[b,C]=g.useState(!1),[E,F]=g.useState(void 0),O=h(P=>U(P)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,S,T,D,k);if(R){const P={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(B?.dateRange,P);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:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=h(P=>X(P))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!b&&r!=null&&_&&(C(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[b,r,c,_]);const ke=[l,m,S,T,D,y].filter(P=>P!=null);return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:P=>F(P),...e}):s.jsx(G,{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/${Ce}/statements`;function kt(){const a=J().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>U(n)).tenantId],t=Oe();return s.jsxs(Pe,{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(we,{})}),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(G,{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(G,{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(G,{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(qe,{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};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-fDjf6Tur.js";import{h as L,g as P,u as B,i as M,j as f,N as U,n as V,o as we,p as k}from"./core-C8Y7fm3n.js";import{cl as N,eQ as D,Oi as O,Em as ae,fi as q,E4 as ne,Ok as Te,Ep as Ie,Og as Ce,Oh as se,OA as ke,Cw as je,tb as be,Om as Ee,EI as Ae,Oj as re,cN as H,xr as oe,eZ as ve,e$ as De,Pu as Fe,Pv as Ue,E5 as Le,Pw as Pe,E6 as Be,Ef as Oe,bs as Re,bF as Me,cw as Ve,bG as Ne,ck as _e,fh as ze,bt as $e,JZ as Ge,cj as Ze}from"./zeni-epic-state-DvHgUD1-.js";import{k as _,aq as qe,z as E,x as z,c as j,c7 as He,c8 as Je,c9 as Z,J,m as Ke,Y as We,_ as Qe,s as ie,U as v,A as Ye,B as Xe,ca as et,at as K,q as tt,cb as at,p as W,cc as nt,j as Y,cd as st,a9 as rt}from"./index-C3-objML.js";import{D as ot,n as R,S as it}from"./mui-Ky-KJxLh.js";import ct from"./NotFoundScreen-D4Av36kV.js";import{S as X}from"./SetupPagesScreen-DLtasQoq.js";import{a as d}from"./sentry-DjzU4p1F.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import{u as ut}from"./useInitialThreadRequest-X7WpfR49.js";import{M as ce}from"./MobileAppDrawer-DIls_BW2.js";import{F as dt}from"./FeaturePreviewScreen-2R9FJdWJ.js";import{a as ee}from"./analyticsHelper-DNuTbD5B.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./routePaths-B8EWQXPr.js";import"./BusinessVerificationPageScreen-DO1Qhw6D.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]="7b9956d5-d229-48c8-8144-5e3d9f9b2c3e",t._sentryDebugIdIdentifier="sentry-dbid-7b9956d5-d229-48c8-8144-5e3d9f9b2c3e")}catch{}})();const pt=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:O(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Te(r))}}})(He);function mt(){const t=L(),a=P(),n=B(),{tenantEmailDomain:o}=M(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=qe(r),s=N(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,I]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=E.getSignedInUserTenant(o)?.companyId??h.companyId,w=E.getSignedInUser(),S=f(C=>O(C,y)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(w==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,T,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(q()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(I(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(U,{to:"../promo"});const A=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!A&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:A,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:O(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",r,m,"Transfer"),t(Ae())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),yt=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=M(),o=B(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),w=E.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),T=f(x=>O(x,w));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||w==null||(s(!0),o(ae(w,!0,!1)))},[m,u,w,o]),d.useEffect(()=>{l||c!=="Not-Started"||w==null||(i(!0),o(q()))},[l,c,w,o]),d.useEffect(()=>{g||h!=="Not-Started"||w==null||(I(!0),o(ne()))},[g,h,w,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=R.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
|
-
`,ht={overlayWidth:new Ye(100,100,48)},St=V(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:O(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:l=>{let i="page-not-found";l==="editPortfolio"?i=xt(s):l==="statements"?i=wt(s):l==="taxLetter"?i=Tt(s):l==="settings"&&(i=It(s));const g=tt(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:g}})},onColumnSortConfigChanged:(l,i)=>{t(Fe({uiState:{sortKey:l,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(et);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=P(),o=L(),p=B(),r=J(),m=Ke(),s=f(b=>D(b)),{tenantEmailDomain:l}=M(),i=s.companyId??E.getSignedInUserTenant(l)?.companyId,[g,I]=d.useState(!1),u=f(b=>re(b)),c=u.fetchState,h=u.accountSummary?.totalBalance?.amount,y=f(b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),w=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),T=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=N(S?.loggedInUserRoleMap),F=H(S?.loggedInUserRoleMap),{areTenantIdsInSync:A}=We();d.useEffect(()=>{c==="Not-Started"&&!g&&A&&(I(!0),p(oe(!0)))},[g,p,c,A]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const C=()=>{o("..")},[le,ue]=d.useState(!1),Q=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Qe({isDataReady:c==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:me}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=$(v.isTreasuryCommentingEnabled),ge=ut(i,{clearParams:c==="Completed"&&y?.fetchState==="Completed"}),he=ve(s),Se=De(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(w){const b=y?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:j,onLoad:()=>{}}):null,e.jsx(ot,{onClose:C,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:u.transactions.length===0||h===0}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(St,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return T&&x?e.jsx(U,{to:"../setup"}):s.companyTreasuryInfo?.info&&!T&&F?e.jsx(U,{to:"../promo",state:n.state}):e.jsx(Xe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,wt=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=R(it)`
|
|
10
|
-
display: flex;
|
|
11
|
-
min-height: 100%;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
`,kt=R.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 jt(){const t=L(),a=B(),n=J(),o=P(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Ue(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Le(!1)))},[r,s.fetchState,a]);const l=E.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(at,{currentTenantCompanyName:I,statementListView:s,isLoading:u,onBackClick:()=>{const c=W(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const bt=R.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 Et(){const t=L(),a=J(),n=P(),o=B(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Pe(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Be(!1)))},[r,s.fetchState,o]);const l=E.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(nt,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:u,onBackClick:()=>{const c=W(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const At=V(function(t,a){const{companyId:n}=a,o=O(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(Oe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(st),vt=()=>{const t=L(),a=P(),n=B(),{tenantEmailDomain:o}=M(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,l]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||g==null||(l(!0),n(q()))},[i,n]);const g=E.getSignedInUserTenant(o)?.companyId??m.companyId,I=E.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{r(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),y=N(h?.loggedInUserRoleMap),w=H(h?.loggedInUserRoleMap);if(u&&y)return e.jsx(U,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&y||w)){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(Y,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:S=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:c}),e.jsx(At,{analytics:j,navigate:t,companyId:g,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(Y,{size:"ExtraLarge",start:!0})})},te=R.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 ea(){const t=P(),a=f(A=>D(A)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=H(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),g=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(v.isDepositAccountsFeatureEnabled),u=I&&!s&&_e(r?.loggedInUserRoleMap),c=a.company!=null&&ze(a.company),h=o&&c===!0&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:y}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:w}=n(v.isDebitCardFeatureEnabled),S=rt(a,y,w)&&!s&&$e(r?.loggedInUserRoleMap),T=Ge(r?.loggedInUserRoleMap),x=Ze(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(we,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):p&&h?e.jsx(k,{path:"*",element:e.jsx(U,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(U,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ea as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-fDjf6Tur.js";import{a as l}from"./sentry-DjzU4p1F.js";import{s as u,u as h,j as y,N as b}from"./core-C8Y7fm3n.js";import{Kg as I,eX as w,Ac as j}from"./zeni-epic-state-DvHgUD1-.js";import{z as f,B as x,C as S,E}from"./index-C3-objML.js";import{n as c}from"./mui-Ky-KJxLh.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.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]="28061b13-8dee-4017-b94d-069533c4e482",e._sentryDebugIdIdentifier="sentry-dbid-28061b13-8dee-4017-b94d-069533c4e482")}catch{}})();const X=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",g=e.get("profileId")??"",[n,p]=l.useState(!1),a=h(),s=y(m=>I(m)),r=f.getSignedInUser(),d=f.getSignedInUserTenantWithId(i);if(r==null||d==null)return o.jsx(b,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),l.useEffect(()=>{n||(p(!0),a(j(t,g,i)))},[n,a]),s.fetchState==="Error"?o.jsx(D,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},D=c.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100vh;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
-
`,_=c(E.LargeRegular)`
|
|
10
|
-
display: flex;
|
|
11
|
-
color: ${S.important};
|
|
12
|
-
`;export{X as default};
|