@zeniai/web-app-ui 5.2.18-qa → 5.2.19-next
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-D14Xrcr-.js +1 -0
- package/dist/assets/AddressScreen-DM3Cytik.js +9 -0
- package/dist/assets/AiCfoScreen-C7VAZJ1A.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-8Ll-z-xT.js → BillPayApprovalRoutes-C9icCWAb.js} +1 -1
- package/dist/assets/{BillPayRoutes-pfP5wo_C.js → BillPayRoutes-DffUP74I.js} +12 -12
- package/dist/assets/{BusinessVerificationPageScreen-MOMZNf2n.js → BusinessVerificationPageScreen-qG6q7Wb6.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-BahaNrfe.js +14 -0
- package/dist/assets/{ChargeCardRoutes-CkepWz7M.js → ChargeCardRoutes-SaV3T-oM.js} +10 -10
- package/dist/assets/CompanyPassportScreen-CQUCnlmj.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DxTli2yc.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DCVZbjhG.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-Ber4B0KW.js +30 -0
- package/dist/assets/{DashboardRoutes-MCNi0Cm3.js → DashboardRoutes-CDwIkoUk.js} +4 -4
- package/dist/assets/{DefaultTenantHome-B8QXwYfi.js → DefaultTenantHome-CLCoE5KB.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Cy5XGzM3.js +18 -0
- package/dist/assets/DrawerScreen-CFq_1rdP.js +1 -0
- package/dist/assets/EntityDetailRoutes-lCFdhj0N.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BnRbsSz6.js +25 -0
- package/dist/assets/FeaturePreviewScreen-1q69VsC1.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-X0-DSjZb.js +1 -0
- package/dist/assets/MagicLinkRoutes-Dfdz57KO.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-3rm3mwQp.js +12 -0
- package/dist/assets/MobileAppDrawer-uvkpUvp_.js +1 -0
- package/dist/assets/NotFoundScreen-DR4zbgK0.js +1 -0
- package/dist/assets/{NotificationRoutes-CghqA--C.js → NotificationRoutes-Cd2QvtFH.js} +1 -1
- package/dist/assets/OAuthConsentScreen-B3JPBskg.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-W3OrOyHu.js +1 -0
- package/dist/assets/PeopleRoutes-DNg7Ihue.js +22 -0
- package/dist/assets/PerformanceRoutes-o3ofDHl6.js +1 -0
- package/dist/assets/{Preview-C3t9OASa.js → Preview-GrKYlvV7.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BxSTUR6Z.js → QBOConnectionScreen-Bky1RVSb.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DGVz-GX1.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BCDSmsvv.js → ReimbursementApprovalRuleDetailScreen-4DU8eod7.js} +1 -1
- package/dist/assets/{ReimbursementRoutes--vh1Dgkn.js → ReimbursementRoutes-C1MfITXr.js} +8 -8
- package/dist/assets/{ReportsRoutes-B0L7XL0D.js → ReportsRoutes-CoMGWCHx.js} +1 -1
- package/dist/assets/RewardsRoutes-e7w8wtnX.js +1 -0
- package/dist/assets/ScreenRoutes-KCqCdpwt.js +2 -0
- package/dist/assets/SettingsRoutes-BZ_pWEty.js +57 -0
- package/dist/assets/{SetupPagesScreen-z1fhy2nD.js → SetupPagesScreen-D_WJHeIH.js} +5 -5
- package/dist/assets/SignInScreen-BNoucZFL.js +1 -0
- package/dist/assets/SignOutScreen-CMf4hwn3.js +9 -0
- package/dist/assets/TaskListScreen-C_rNr9Jk.js +9 -0
- package/dist/assets/TaskRoutes-CpISGdNU.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-Ds78cNrz.js → TransactionDetailRoutes-CmH9g66g.js} +1 -1
- package/dist/assets/TransactionDetailScreen-BAzuDRZQ.js +5 -0
- package/dist/assets/{TransactionListRoutes-CbJW0jN6.js → TransactionListRoutes-CoFY3pbX.js} +1 -1
- package/dist/assets/TreasuryRoutes--lIehLfz.js +37 -0
- package/dist/assets/{VendorsRoutes-WaC1MSeH.js → VendorsRoutes-BlvpjJIF.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-C62-fzuC.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-ChKECbqX.js → ZeniAccountRoutes-DsEwo2kw.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-DsIySC9T.js +9 -0
- package/dist/assets/{accountMappingHelper-B-kf-Qnc.js → accountMappingHelper-DF_wZmqr.js} +1 -1
- package/dist/assets/{analytics-DtYJ-EGT.js → analytics-CsrWBSkJ.js} +1 -1
- package/dist/assets/{analyticsHelper-DcIIaR44.js → analyticsHelper-eo4F52XS.js} +1 -1
- package/dist/assets/{core-DnZcjy6X.js → core-Ct1Na3r4.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CjxujRw-.js → decodeURIComponentSafe-Dl7JnLtd.js} +1 -1
- package/dist/assets/{dnd-eoV-_JYH.js → dnd-DXTfJSUb.js} +1 -1
- package/dist/assets/{empty-Dq2hLrCm.js → empty-C9Atwx5F.js} +1 -1
- package/dist/assets/{empty-DkIaLxCd.js → empty-enRUfXAJ.js} +1 -1
- package/dist/assets/{emptyVideoElement-BFB9pddL.js → emptyVideoElement-BWmmLkB3.js} +1 -1
- package/dist/assets/epic-CPUd8eYu.js +2 -0
- package/dist/assets/getLocaleForTenant-C9iKXyPU.js +1 -0
- package/dist/assets/{index-Bar5dTpy.js → index-BBFNuY8-.js} +15820 -16753
- package/dist/assets/{index-nn6YvIGD.js → index-C5jp_Nos.js} +1 -1
- package/dist/assets/{index-DUKU6sVX.js → index-CpAcGISI.js} +1 -1
- package/dist/assets/index-Czu7h9lW.css +1 -0
- package/dist/assets/{index-D_CZgugN.js → index-DD29fIsd.js} +1 -1
- package/dist/assets/{index-Wtyhkk6J.js → index-DHN0iULb.js} +1 -1
- package/dist/assets/{index-C8_nlYo6.js → index-D_W5SS2j.js} +2 -2
- package/dist/assets/{index-Dmm4l94W.js → index-Lktm9qH-.js} +1 -1
- package/dist/assets/{index-CiCTnO2S.js → index-UCOMlrxB.js} +1 -1
- package/dist/assets/{lexical-CSqytB8g.js → lexical-5nbymAIm.js} +1 -1
- package/dist/assets/liveblocks-P0DntAgT.js +54 -0
- package/dist/assets/{lottie-Dz5luYQG.js → lottie-7Wgw-CzS.js} +1 -1
- package/dist/assets/{mui-sr6zger7.js → mui-SSWNL1tt.js} +1 -1
- package/dist/assets/{pathToGoBack-DpO-gBzq.js → pathToGoBack-wtH43kNb.js} +1 -1
- package/dist/assets/{pdf-BNSeVvBm.js → pdf-COhrBMN3.js} +3 -3
- package/dist/assets/{pdf-lib-DwpnbCVp.js → pdf-lib-DerHPYIF.js} +1 -1
- package/dist/assets/{plaid-QvRDxgoN.js → plaid-CdfVkhIW.js} +1 -1
- package/dist/assets/{pusher-senIjtt-.js → pusher-hTFVCAHJ.js} +1 -1
- package/dist/assets/{react-CBRcLxW-.js → react-C3avayV7.js} +1 -1
- package/dist/assets/{react-CiyNePZ5.js → react-CB88nZl5.js} +1 -1
- package/dist/assets/{react-OAPKV4uC.js → react-CYqO4utD.js} +1 -1
- package/dist/assets/{react-ClmbMdlp.js → react-Ci3GJXKz.js} +1 -1
- package/dist/assets/{react-CuKQRzYG.js → react-DAcDxy2I.js} +1 -1
- package/dist/assets/{react-BGDkRw8Y.js → react-G31LEvJE.js} +1 -1
- package/dist/assets/{recharts-Bim6mdwu.js → recharts-KVNUr0cO.js} +1 -1
- package/dist/assets/routePaths-Dvh0MCMy.js +1 -0
- package/dist/assets/{sentry-DFI2OQU2.js → sentry-CfbcqWq3.js} +1 -1
- package/dist/assets/{url-p6YiHaLn.js → url-CbJg2s3J.js} +1 -1
- package/dist/assets/{url-4e0ZWhZq.js → url-FHfZtBCR.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-zVG2a35W.js → useAiCfoDashboardSuggestedQuestionsChips-BLXE02N5.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BeiXTDS4.js +1 -0
- package/dist/assets/useCashManagementBanner-D5vpE0Fa.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-0JCfQ36-.js → useChargeCardPusherEvents-B55cb89o.js} +1 -1
- package/dist/assets/{useDeviceId-DasP_-mC.js → useDeviceId-BAVWaoiW.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-2wnXRew_.js → useEmailConnectResultRefresh-DZEhjfaj.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DW3cIl_2.js → useInitialThreadRequest-J5ElkQVA.js} +1 -1
- package/dist/assets/{utils-cHxIh7E8.js → utils-BmRSZi-a.js} +1 -1
- package/dist/assets/withTransactionSidePanel-u9hB8oy5.js +21 -0
- package/dist/assets/{zeni-epic-state-m4zoW3ek.js → zeni-epic-state-x9uZgubN.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +6 -9
- package/dist/assets/AddressRoutes-C8XYQ13t.js +0 -1
- package/dist/assets/AddressScreen-DCby60TJ.js +0 -9
- package/dist/assets/AiCfoScreen-BV-DOocp.js +0 -22
- package/dist/assets/CardsAiCfoScreen-C6GxFeya.js +0 -14
- package/dist/assets/CompanyPassportScreen-CF1WCnT9.js +0 -1
- package/dist/assets/ConnectionAuthScreen-CBqhtWai.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DkQZlHKP.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-B4msejL-.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-CTMJQoQi.js +0 -18
- package/dist/assets/DrawerScreen-B34R7bdb.js +0 -1
- package/dist/assets/EntityDetailRoutes-D5iLxjcN.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Bem3Gc7u.js +0 -25
- package/dist/assets/FeaturePreviewScreen-O1rkkX9g.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Bzg62ZZu.js +0 -1
- package/dist/assets/MagicLinkRoutes-CSc1SUSL.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BVxqZuYQ.js +0 -12
- package/dist/assets/MobileAppDrawer-BoTcj0FT.js +0 -1
- package/dist/assets/NotFoundScreen-D7eT4TBn.js +0 -1
- package/dist/assets/OAuthConsentScreen-BzSEu8Ts.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BfaNIbxL.js +0 -1
- package/dist/assets/PeopleRoutes-B44-Upod.js +0 -22
- package/dist/assets/PerformanceRoutes-Bv8XOGTE.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-D_w-vyXX.js +0 -1
- package/dist/assets/RewardsRoutes-4lrT5UUo.js +0 -1
- package/dist/assets/ScreenRoutes-x2ZEU7XA.js +0 -2
- package/dist/assets/SettingsRoutes-CLQ49ROa.js +0 -57
- package/dist/assets/SignInScreen-CbCM_7kJ.js +0 -1
- package/dist/assets/SignOutScreen-CPqtbwhE.js +0 -9
- package/dist/assets/TaskListScreen-ChqMZGua.js +0 -9
- package/dist/assets/TaskRoutes-DqVkv1wh.js +0 -9
- package/dist/assets/TransactionDetailScreen-DTD0gbHD.js +0 -5
- package/dist/assets/TreasuryRoutes-BzPs578Q.js +0 -37
- package/dist/assets/WiseConfirmationScreen-DP0HNbpz.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-nptp5yY4.js +0 -9
- package/dist/assets/epic-Blr6eiMV.js +0 -2
- package/dist/assets/getLocaleForTenant-DIOFG6A5.js +0 -1
- package/dist/assets/index-Cx4f0JbF.css +0 -1
- package/dist/assets/liveblocks-DKL6viSK.js +0 -54
- package/dist/assets/routePaths-BQ28bs96.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DZXDQgDN.js +0 -1
- package/dist/assets/useCashManagementBanner-DM17aUQt.js +0 -1
- package/dist/assets/withTransactionSidePanel-CBujpiDq.js +0 -21
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-P0DntAgT.js";import{h as Y,g as ee,u as ne,i as $,j as P,N as x,n as H,t as en}from"./core-Ct1Na3r4.js";import{bJ as nn,cq as Ce,Qe as ye,eZ as B,cC as tn,zU as Q,zE as an,Qq as sn,Qt as on,rW as te,rK as ae,le as ie,u0 as z,Qv as Ie,gl as Ge,gk as $e,gj as He,Qw as cn,A1 as rn,EN as Ae,EE as ke,EB as _e,Ej as J,EH as Ee,EK as ve,EQ as Pe,uu as Te,gD as un,cx as dn,fG as ln,fE as pn,fF as mn,bt as yn,Qx as fn,Dj as le,DX as gn,Qy as bn,bK as Sn,G4 as pe,F5 as hn,Qz as Cn,QA as In,G8 as An,Gc as kn,tV as _n,KC as En,GJ as he,HJ as me,QB as vn,QC as Pn,QD as Tn,QE as We,QF as wn,N3 as Dn,PG as Un,Ni as On,QG as Ke,En as Fn,Nj as Bn,Er as Vn,QH as Oe,H3 as qe,lm as xn,rN as Je,u2 as jn,bE as Ne,ue as Re,cA as Nn,QI as Xe,fY as Rn,Gr as zn,Gv as Ln,QJ as Mn,GM as ze,QK as Zn,QL as Qn,QM as Gn,QN as $n,gw as Hn,Bc as Wn,QO as Kn,Bh as qn,Bg as Jn}from"./zeni-epic-state-x9uZgubN.js";import{e as se,A as oe,d as q,y as we,aS as X,bC as Ye,z as U,C as ce,f as O,B as De,h as G,bD as Xn,au as re,bE as V,bF as Yn,bG as et,ag as xe,bH as nt,r as Le,av as Me,K as tt,F as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-BBFNuY8-.js";import{a as h}from"./sentry-CfbcqWq3.js";import{n as Fe,D as rt,S as ut}from"./mui-SSWNL1tt.js";import{M as fe}from"./MobileAppDrawer-uvkpUvp_.js";import R from"./NotFoundScreen-DR4zbgK0.js";import{a as Ze}from"./analyticsHelper-eo4F52XS.js";import{d as Qe}from"./routePaths-Dvh0MCMy.js";import{B as Ue}from"./BusinessVerificationPageScreen-qG6q7Wb6.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]="9b73bb41-6d71-429a-b510-fea9f28f4dc9",e._sentryDebugIdIdentifier="sentry-dbid-9b73bb41-6d71-429a-b510-fea9f28f4dc9")}catch{}})();const dt=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-DKL6viSK.js";import{h as Y,g as ee,u as ne,i as
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,lt=W((function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}}),(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(G(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(G(a,!0))},onEnableBillPayClick:()=>{e(q(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(G(a,!0))},onGetOtp:(n,s)=>{e(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Qe(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e($e(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(Xn),pt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=Q(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(K.isBillPayLocalCurrencyFeatureEnabled),g=Te(),{configValue:C}=i(X.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),P=v((w=>w.billPaySetupViewState.fetchState)),f=v((w=>V(w))),b=v((w=>w.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Ye(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const E=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect((()=>{S.current||P!=="Not-Started"||m==null?S.current||P!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(G(m,!1,!0))):(S.current=!0,t(G(m,!0)))}),[P,m,t]),h.useEffect((()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))}),[y,b,A,D,t]);const F=w=>{d(w)};if(E===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(E===!0&&c?.loggedInUserRoleMap!=null){const w=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>w(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Gt=(e,o)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:o,$t=e=>`/${e}/cards`,Qt=e=>`/${e}/cards/setup`,Wt=e=>`/${e}/cards/onboard`,Ht=(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},Jt=(e,o)=>e.find((t=>t.id===o)),Kt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),qt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(c.remainingAmountDue.amount)}:void 0,Yt=(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=>B(n.accountBalance.available.amount))),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=W((function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(we("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(ve(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(Ee(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(q(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(q(a,"charge_cards")):s===!0&&r===!1&&e(q(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)),P=n.allBankAccounts.find((f=>f.accountId===d));O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:P?.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(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find((f=>f.id===d)),_=n.allFundingAccounts.findIndex((f=>f.id===n.primaryFundingAccount?.id))+1,P=n.allFundingAccounts.findIndex((f=>f.id===d))+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:B(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:P,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}}))(Yn),St=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=Q(),c=se(),n=v((L=>V(L))),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(X.zeniAccountsConfig),{configValue:p}=s(X.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(K.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(K.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(K.isCardPolicyEnabled),S=v((L=>un(L,n.companyId))),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,P=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&E===!1,F=b===!1&&E,w=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=v((L=>L.chargeCardSetupViewState.fetchState)),T=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=L=>{Se(L)},Be=v((L=>fn(L,T)));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{M||Z!=="Not-Started"||T==null?M||Z!=="Completed"||T==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(T,!1,!0)):(ue(!0),t(le(T,!0)))}),[M,Z,T,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,J=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(E,b,P,_);return be||J?be||J?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded($.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:T,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:J,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Be,isCreditCardProductVisible:E,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:P,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,accountsPromoConfig:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},bt=Fe.div`
|
|
9
|
+
`,lt=H((function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=B(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}}),(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(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(He(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e($e(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e(Ge(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(Xn),pt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(q.isBillPayLocalCurrencyFeatureEnabled),g=we(),{configValue:C}=i(X.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),b=h.useRef(!1),[y,_]=h.useState(!1),E=P((T=>T.billPaySetupViewState.fetchState)),f=P((T=>B(T))),S=P((T=>T.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Ye(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect((()=>{b.current||E!=="Not-Started"||m==null?b.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(b.current=!0,t(Q(m,!1,!0))):(b.current=!0,t(Q(m,!0)))}),[E,m,t]),h.useEffect((()=>{y||S!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))}),[y,S,A,D,t]);const F=T=>{d(T)};if(v===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const T=N=>N.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:N=>T(N)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:o,Gt=e=>`/${e}/cards`,$t=e=>`/${e}/cards/setup`,Ht=e=>`/${e}/cards/onboard`,Wt=(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},Kt=(e,o)=>e.find((t=>t.id===o)),qt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,Yt=(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=>V(n.accountBalance.available.amount))),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=H((function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=B(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,b)=>{e(Te("charge_card_setup",d,b))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,b,y)=>{e(ve(d,b,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,b)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",b))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,b,y)=>{const _=n.allBankAccounts.find((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)),E=n.allBankAccounts.find((f=>f.accountId===d));O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.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(y==="paymentAccount"?ke(d,b,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,b))},onUpdatePrimaryFundingAccount:(d,b)=>{const y=n.allFundingAccounts.find((f=>f.id===d)),_=n.allFundingAccounts.findIndex((f=>f.id===n.primaryFundingAccount?.id))+1,E=n.allFundingAccounts.findIndex((f=>f.id===d))+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:V(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,b))},onEnableChargeCardSuccess:()=>{e(bn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,b)=>{e(Ie({officerType:d,fileIds:b}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,b)=>{e(te(d,b.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}}))(Yn),bt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),n=P((L=>B(L))),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(X.zeniAccountsConfig),{configValue:p}=s(X.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(q.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(q.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(q.isCardPolicyEnabled),b=P((L=>un(L,n.companyId))),y=dn(b.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),S=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:S,chargeCardsCreditAccountLimit:m}),j=S&&v===!1,F=S===!1&&v,T=ye(r),N=yn(c?.loggedInUserRoleMap),W=Ce(c?.loggedInUserRoleMap),[ge,be]=h.useState(!1),[M,ue]=h.useState(!1),Z=P((L=>L.chargeCardSetupViewState.fetchState)),w=U.getSignedInUserTenant(a)?.companyId??n.companyId,Be=U.getSignedInUser(),de=L=>{be(L)},Ve=P((L=>fn(L,w)));if(Be==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{M||Z!=="Not-Started"||w==null?M||Z!=="Completed"||w==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(w,!1,!0)):(ue(!0),t(le(w,!0)))}),[M,Z,w,t]);const Se=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,K=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(v,S,E,_);return Se||K?Se||K?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded(G.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:w,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:Se,isDebitCardTOSAccepted:K,isUserChargeCardAdmin:N,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Ve,isCreditCardProductVisible:v,isDebitCardFeatureEnabled:S,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:W,accountsPromoConfig:T})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},St=Fe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-DKL6viSK.js";import{h as Y,g as ee,u as ne,i as
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,ht=W((function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=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",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.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,s)=>{e(we("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(q(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(et),Ct=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=Q(),c=se(),{useDynamicConfig:n}=oe(),s=Te(),{configValue:l}=n(X.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=v((m=>m.remiSetupViewState.fetchState)),y=v((m=>V(m))),_=v((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:P,isLoading:f}=Ye(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))}),[S,b,t]),h.useEffect((()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,P)))}),[k,_,f,P,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=E=>E.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:E=>m(E)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=W((function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:P,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:E,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:w,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve}=i,de=g?.selectedOption,Be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:E?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((J=>J.length===2?J:Me(J)))??[],companySourceOfFunds:w?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:P};e(Ne({companyDetails:Be,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map((p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:P,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:E,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:P,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:E,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Ge(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach(((I,k)=>{C[k]=I})),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Ge(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(qe(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Qe(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(Bn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}}))(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=Q(),C=se(),{useDynamicConfig:I}=oe(),k=Te(),{configValue:d}=I(X.zeniAccountsConfig),S=ye(d),y=v((m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}})),_=v((m=>m.companyConfigState.fetchState)),P=v((m=>m.userRoleConfigState.fetchState)),f=v((m=>V(m))),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{_==="Not-Started"&&n(_n()),P==="Not-Started"&&n(Pn(!0))}),[_,P,n]),h.useEffect((()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(G(b,!0))}}),[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=v((m=>{let E;switch(e){case"zeni_accounts":E=Tn(m,b);break;case"zeni_treasury":E=He(m,b);break;case"charge_cards":E=wn(m,b);break;case"reimbursement":E=vn(m,b);break;default:E=En(m,b)}return E}));return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(E=>{switch(e){case"zeni_accounts":return E.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return E.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return E.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=W((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),g=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",C=Mn(e),I=C.transactions,k=Je(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e($n(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(we("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(ve(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(Ee(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Pe(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(q(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Gn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(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(Oe())}}}))(it),Pt=()=>{const e=Y(),o=ee(),t=ne(),a=Te(),c=tt(),{tenantEmailDomain:n}=Q(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(X.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[P,f]=h.useState(!1),[b,D]=h.useState(!1),A=v((T=>T.treasurySetupViewState.fetchState)),m=v((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),E=v((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=v((T=>T.treasuryDetailState.transactionsState?.fetchState)),F=v((T=>V(T))),w=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=v((T=>Xe(T,w))),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=T=>{k(T)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{d||A!=="Not-Started"||w==null||(S(!0),t(he(w,!0,!1)))}),[d,A,w,t]),h.useEffect((()=>{y||m!=="Not-Started"||w==null||(_(!0),t(Nn()))}),[y,m,w,t]),h.useEffect((()=>{P||E!=="Not-Started"||w==null||(f(!0),t(zn()))}),[P,E,w,t]),h.useEffect((()=>{b||j!=="Not-Started"||w==null||(D(!0),t(Ln(!0)))}),[b,j,w,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect((()=>{i||A!=="Completed"||H||Z||!o.pathname.includes("setup")||r(!0)}),[A,H,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Et,{onClick:T=>T.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:w,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},Et=Fe(ut)`
|
|
17
|
+
`,ht=H((function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=B(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=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",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.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,s)=>{e(Te("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(et),Ct=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),{useDynamicConfig:n}=oe(),s=we(),{configValue:l}=n(X.zeniAccountsConfig),i=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),b=P((m=>m.remiSetupViewState.fetchState)),y=P((m=>B(m))),_=P((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:E,isLoading:f}=Ye(y?.tenantId),S=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{I.current||b!=="Not-Started"||S==null?I.current||b!=="Completed"||S==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(S,!1,!0))):(I.current=!0,t(pe(S,!0)))}),[b,S,t]),h.useEffect((()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))}),[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(St,{children:[u.jsx(ce,{analytics:O,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:S,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=H((function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=B(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:b,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:S,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:T,companySourceOfFundsDescription:N,transactionVolume:W,transactionVolumeDescription:ge,purposeOfAccount:be,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Be}=i,de=g?.selectedOption,Ve={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Nn(k):void 0,phone:d,syncToken:f,fileIds:S,incDate:D!=null?Ne(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((K=>K.length===2?K:Me(K)))??[],companySourceOfFunds:T?.selectedOption??"",companySourceOfFundsDescription:N,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:be?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Be?.selectedOptions??[]},Se={userId:_,firstName:y.firstName,lastName:y.lastName,email:b,syncToken:E};e(Re({companyDetails:Ve,primaryContactDetails:Se}))},onCompanyOfficerUpdated:i=>{const r=i.map((p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:b,dob:y,phone:_,syncToken:E,selectDocument:f,role:S,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:b,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Ne(y?.toString()):y,syncToken:E,titleAtCompany:S.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Re({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach(((I,k)=>{C[k]=I})),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(He(i,"SpendManagementSetup"))},onResendOtp:i=>{e($e(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e(Ge(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Bn(i.documentType);r!=null&&e(Vn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}}))(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=$(),C=se(),{useDynamicConfig:I}=oe(),k=we(),{configValue:d}=I(X.zeniAccountsConfig),b=ye(d),y=P((m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}})),_=P((m=>m.companyConfigState.fetchState)),E=P((m=>m.userRoleConfigState.fetchState)),f=P((m=>B(m))),S=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))}),[_,E,n]),h.useEffect((()=>{if(!r&&y==="Not-Started"&&S!=null)switch(p(!0),e){case"zeni_accounts":n(me(S,!0));break;case"zeni_treasury":n(he(S,!0));break;case"reimbursement":n(pe(S,!0));break;case"charge_cards":n(le(S,!0));break;default:n(Q(S,!0))}}),[r,y,S,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=P((m=>{let v;switch(e){case"zeni_accounts":v=wn(m,S);break;case"zeni_treasury":v=We(m,S);break;case"charge_cards":v=Tn(m,S);break;case"reimbursement":v=Pn(m,S);break;default:v=vn(m,S)}return v}));return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded(G.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:S,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:b.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=H((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=B(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=We(e,a),g=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",C=Mn(e),I=C.transactions,k=Ke(e),d=C.accountSummary?.totalBalance?.amount,b=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:b,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e(Gn(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(Te("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(ve(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(qe())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(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(Oe())}}}))(it),Et=()=>{const e=Y(),o=ee(),t=ne(),a=we(),c=tt(),{tenantEmailDomain:n}=$(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(X.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,b]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[S,D]=h.useState(!1),A=P((w=>w.treasurySetupViewState.fetchState)),m=P((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),v=P((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=P((w=>w.treasuryDetailState.transactionsState?.fetchState)),F=P((w=>B(w))),T=U.getSignedInUserTenant(n)?.companyId??F.companyId,N=P((w=>Xe(w,T))),W=N.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,be=U.getSignedInUser(),M=w=>{k(w)};if(be==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{d||A!=="Not-Started"||T==null||(b(!0),t(he(T,!0,!1)))}),[d,A,T,t]),h.useEffect((()=>{y||m!=="Not-Started"||T==null||(_(!0),t(Rn()))}),[y,m,T,t]),h.useEffect((()=>{E||v!=="Not-Started"||T==null||(f(!0),t(zn()))}),[E,v,T,t]),h.useEffect((()=>{S||j!=="Not-Started"||T==null||(D(!0),t(Ln(!0)))}),[S,j,T,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect((()=>{i||A!=="Completed"||W||Z||!o.pathname.includes("setup")||r(!0)}),[A,W,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:w=>w.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:T,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:W,analytics:O,treasurySetupView:N,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=Fe(ut)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,
|
|
21
|
+
`,Pt=H((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=B(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=$n(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.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,s)=>{e(Te("account_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"zeni_accounts","account_setup",s))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"zeni_accounts","account_setup"):_e("account_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"account_setup",n,s))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))}}}))(st),Tt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),{useDynamicConfig:c}=oe(),n=se(),s=Ce(n?.loggedInUserRoleMap),{configValue:l}=c(X.zeniAccountsConfig),i=ye(l),[r,p]=h.useState(!1),[g,C]=h.useState(!1),I=P((_=>_.zeniAccountSetupViewState.fetchState)),k=P((_=>B(_))),d=U.getSignedInUserTenant(a)?.companyId??k.companyId,b=U.getSignedInUser(),y=_=>{p(_)};if(b==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{g||I!=="Not-Started"||d==null?g||I!=="Completed"||d==null||k.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(d,!1,!0)):(C(!0),t(me(d,!0)))}),[g,I,d,t]),k.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(x,{to:"../promo"});{const _=E=>E.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:E=>_(E)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:y}),u.jsx(Pt,{navigate:e,location:o,companyId:d,currentTenant:k,isUserZeniAccountsAdmin:s,accountsPromoConfig:i,onClickMenuIcon:()=>{y(!0)}})]})}},wt=Fe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-DKL6viSK.js";import{h as Y,g as ee,u as ne,i as
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Dt=
|
|
29
|
+
`,Dt=H((function(e,o){const t=B(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Kn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:n,analytics:O}}),(function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Jn(a))},onSubmitClick:()=>{e(qn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ie({files:a}))},onDeleteFile:a=>{e(ae(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(te(a,c.split(".")[0]))}}}))(ot),Ut=()=>{const e=Y(),o=ee(),t=ne(),[a,c]=h.useState(!1),[n,s]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=$(),p=se(),{useFeatureGate:g}=oe(),{isFeatureEnabled:C}=g(q.isBillPayLocalCurrencyFeatureEnabled),I=P((A=>A.internationalWireVerificationState.verificationFormFetchState.fetchState)),k=P((A=>A.billPaySetupViewState.fetchState)),d=P((A=>B(A))),b=we(),y=d.companyId??U.getSignedInUserTenant(r)?.companyId,_=P((A=>Hn(A.companyState,d.companyId))),E=_?.company.companyBillPayInfo.internationalWireOnboardingStatus,f=E?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{a||I!=="Not-Started"||y==null||(c(!0),t(Wn(y)))}),[a,I,y,t]),h.useEffect((()=>{n||k!=="Not-Started"||y==null||(s(!0),t(Q(y,!0)))}),[k,n,y,t]),U.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const S=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=A=>{i(A)};return S===!1?u.jsx(x,{to:"../promo"}):S===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(wt,{children:[u.jsx(ce,{analytics:O,onLoad:A=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(A)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(Dt,{navigate:e,location:o,companyId:y,analytics:O,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:f,isLocalCurrencyEnabled:C})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:b.colors.grey5}})},Ot=H((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(he(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}}))(ct((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:s,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return o?u.jsx(Ue,{productType:i}):t?u.jsx(x,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Ut,{}):t?u.jsx(x,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(pt,{}):t?u.jsx(x,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Ue,{productType:i}):u.jsx(R,{}):a?u.jsx(Ct,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(Tt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?s?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(x,{to:"../"}):u.jsx(R,{}):s?u.jsx(bt,{}):l?u.jsx(x,{to:"../"}):u.jsx(R,{})}})));function oa(e){const{tenantEmailDomain:o}=$(),t=P((c=>B(c))).companyId??U.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,s)=>{s.onEventReceived(c)}};if(U.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ot,{...e,companyId:t,...a})}export{na as A,ta as P,oa as S,Xt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Wt as g,Gt as h,Jt as i,Yt as j,ia as k,qt as l,Kt as m,$t as n,Ht as o,Qt as p,sa as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-P0DntAgT.js";import{a as u,b as M,q as T}from"./sentry-CfbcqWq3.js";import{u as A,h as z,j as c,g as D,N as O,n as j}from"./core-Ct1Na3r4.js";import{u as P,z as s,y as F,f as E,O as _,g as B,h as N,H as Z,j as V,w as $,k as v}from"./index-BBFNuY8-.js";import{eZ as q,Mf as H,Mg as J,fC as W,g2 as G,Ml as K,gv as Q,cZ as R,Mm as C,Mn as X,Mo as Y,bZ as y}from"./zeni-epic-state-x9uZgubN.js";import"./mui-SSWNL1tt.js";import{u as ee}from"./useDeviceId-BAVWaoiW.js";import{f as te}from"./analyticsHelper-eo4F52XS.js";import{t as ne}from"./getLocaleForTenant-C9iKXyPU.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="7f76d847-cd87-4fad-93d5-e12c6cf561fe",t._sentryDebugIdIdentifier="sentry-dbid-7f76d847-cd87-4fad-93d5-e12c6cf561fe")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({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 l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(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(X(n,a)))},clearSignInError:()=>{t(C())}}}))($),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),L=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>q(e))),I=c((e=>H(e))),m=D(),w=F().mode,b=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),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(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then((()=>{const e=V();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(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:!!b,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(Z,{onClose:()=>i(C()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-P0DntAgT.js";import{a as i}from"./sentry-CfbcqWq3.js";import{u as l,g as c,N as u}from"./core-Ct1Na3r4.js";import{z as d,f as a,h as m,B as p}from"./index-BBFNuY8-.js";import{gA as g,MD as y}from"./zeni-epic-state-x9uZgubN.js";import{n as b}from"./mui-SSWNL1tt.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="ddb64d63-a7d9-46d5-a06a-fd562ddb4daf",t._sentryDebugIdIdentifier="sentry-dbid-ddb64d63-a7d9-46d5-a06a-fd562ddb4daf")}catch{}})();function M(){const t=l(),e=c(),r=i.useRef(!1),n=d.isSignedIn(),o=e.state?.message==="logout"||n;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),d.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.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: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`;export{M as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-P0DntAgT.js";import{a as b}from"./sentry-CfbcqWq3.js";import{h as N,u as v,g as K,j as G,i as _,n as z}from"./core-Ct1Na3r4.js";import{z as U,A as M,d as p,a0 as Z,C as O,f as V,h as W,dd as q,r as f,p as Q}from"./index-BBFNuY8-.js";import{eZ as H,U5 as F,Jo as y,U6 as R,U1 as X,IM as E,U7 as Y,IU as I,Ie as aa,Jp as S,U8 as B,fB as ea,Jf as ta,Jk as sa,J7 as oa,J5 as w,Jl as na,J2 as ia,U9 as la,Ua as ra,Ub as ca,Uc as ka,Ud as m,ek as da,Ue as ua,Uf as pa}from"./zeni-epic-state-x9uZgubN.js";import{n as ma}from"./mui-SSWNL1tt.js";import{u as Ta}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{M as fa}from"./MobileAppDrawer-uvkpUvp_.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="b7d7910c-5ff9-4d1f-932c-8b762d9363fc",e._sentryDebugIdIdentifier="sentry-dbid-b7d7910c-5ff9-4d1f-932c-8b762d9363fc")}catch{}})();const ga=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
|
+
`,ha=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=U.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=L(i,a),k=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(y(!0,d))},onTabChange:a=>{e(ka(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(i,t.localData.defaultTaskGroupId),s=f(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ca({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(y(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(R({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(E({taskDetailLocalData:s}));const k=C(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),g=f(n.state?.pathnameStackToGoBack,n.pathname);o(k,{state:{pathnameStackToGoBack:g,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(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=f(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`)}}}))(q);function ja(){const e=N(),t=v(),o=K(),c=U.getSignedInUser(),n=G((r=>H(r))),{taskGroupId:d}=_(),{useFeatureGate:i}=M(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:g}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[x,P]=b.useState(!1),h=G((r=>F(r,l))),D=G((r=>r.taskGroupState)),T=h.fetchState,{isAiCfoAccessEnabled:J,onAskAiCfoClick:j}=Ta({mobileExploreReferrer:"Task Checklist"});if(Z({isDataReady:T==="Completed"}),b.useEffect((()=>{t(y(!1,l))}),[n?.tenantId,t,l]),b.useEffect((()=>{T==="Completed"&&t(R({taskGroupById:D.taskGroupById}))}),[T,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[T==="Completed"?u.jsx(O,{analytics:V,onLoad:r=>($=>$.trackPageLoaded(W.Event.taskListPage))(r)}):null,u.jsxs(ga,{children:[u.jsx(fa,{isAppContentDrawerOpen:x,handleDrawerToggle:r=>{P(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:g,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:J,onAskAiCfoClick:j})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,Da=(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{ja as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-P0DntAgT.js";import se from"./NotFoundScreen-DR4zbgK0.js";import{a as c}from"./sentry-CfbcqWq3.js";import{h as M,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-Ct1Na3r4.js";import{Ir as Z,Iu as le,Io as de,eZ as J,U1 as K,II as H,Il as pe,Jc as ue,J5 as ke,U2 as Q,U3 as z,Ih as me,Ie as fe,rW as ge,rK as he,le as Ie,IC as Se,U4 as Te,IT as be,IQ as Ce,Ix as Ee,IN as Ge,IM as De}from"./zeni-epic-state-x9uZgubN.js";import{z as G,db as xe,v as ye,A as je,d as b,p as W,r as w,C as ve,f as V,h as we,dc as Re,k as A,au as Ue}from"./index-BBFNuY8-.js";import{n as Fe}from"./mui-SSWNL1tt.js";import{u as Be}from"./useInitialThreadRequest-J5ElkQVA.js";import{M as Pe}from"./MobileAppDrawer-uvkpUvp_.js";import Le from"./TaskListScreen-C_rNr9Jk.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";import"./useAskAiCfoHostNavButtonProps-BeiXTDS4.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]="f696f827-eee7-4e23-9b59-cccf287359e3",e._sentryDebugIdIdentifier="sentry-dbid-f696f827-eee7-4e23-9b59-cccf287359e3")}catch{}})();function Ne(){const e=M(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),l=c.useCallback((()=>{t(Z())}),[t]),k=c.useCallback(((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[t]),a=c.useCallback((o=>{t(de({cannedResponseId:o}))}),[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const $e=re((function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=J(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=K(e),{tenantEmailDomain:D}=d,C=r.recurringSourceTaskId,x=C!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(C)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Ue.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>z(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(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ce(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function v(){const e=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>J(i))),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:C}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,X]=c.useState(!1),[U,Y]=c.useState(!1),[F,ee]=c.useState(!1),[B,y]=c.useState(!1),T=c.useRef(!1),E=g((i=>i.taskListState.updateTasksFetchState.fetchState)),P=g((i=>K(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(X(!0),t(H(!1,r)))}),[p,t]),c.useEffect((()=>{U||P.fetchState==="Completed"||(Y(!0),t(pe()))}),[U,t,P.fetchState]),c.useEffect((()=>{F||L==="Completed"||(ee(!0),t(ue()))}),[F,t,L]);const ae=c.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))}),[t,r]);c.useEffect((()=>{if(B)if(E!=="In-Progress"){if(T.current){if(E==="Error")return y(!1),void(T.current=!1);if(E==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0}),[B,E,l,s,e]);const N=g((i=>Q(i,r))),j=N.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:C})]})]})}const ze=Fe.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(v,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(v,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(Ne,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(v,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
|
package/dist/assets/{TransactionDetailRoutes-Ds78cNrz.js → TransactionDetailRoutes-CmH9g66g.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-P0DntAgT.js";import i from"./NotFoundScreen-DR4zbgK0.js";import{T as r}from"./TransactionDetailScreen-BAzuDRZQ.js";import"./sentry-CfbcqWq3.js";import{o as s,p as o}from"./core-Ct1Na3r4.js";import"./zeni-epic-state-x9uZgubN.js";import"./recharts-KVNUr0cO.js";import"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";import"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import"./decodeURIComponentSafe-Dl7JnLtd.js";import"./routePaths-Dvh0MCMy.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as w}from"./liveblocks-P0DntAgT.js";import{a as i}from"./sentry-CfbcqWq3.js";import{u as W,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Ze}from"./core-Ct1Na3r4.js";import{nX as he,eZ as Q,gw as Xe,OB as et,n8 as tt,mS as at,bn as nt,cW as Ee,bs as ve,ru as K,NA as q,OC as Ie,OD as oe,N_ as De,kR as Ce,OE as ke,O3 as se,O4 as ce,lG as Ae,Kv as ie,Nu as M,kL as Oe,kJ as Ue,kV as ot,nK as st,OF as ct,OG as it,vK as Y,kQ as we,JQ as _e,cj as rt,c_ as lt,OH as dt,Nt as ut,OI as mt,vG as pt,OJ as ft,OK as ht,OL as yt,OM as St,ON as gt,kU as Tt,OO as bt,OP as Et,Nv as vt,OQ as It,OR as Dt,OS as Ct,JK as kt,JA as At,JZ as Ot,kW as Ut,Kw as ye,nP as wt}from"./zeni-epic-state-x9uZgubN.js";import{A as H,d as _,z as xe,aS as Pe,y as _t,K as xt,aT as Pt,F as Ft,p as ae,e as Vt,aU as Bt,r as ne,a0 as Nt,aV as Rt,f as Fe,aW as Lt,au as zt,a4 as te}from"./index-BBFNuY8-.js";import{n as Gt,S as jt,D as $t}from"./mui-SSWNL1tt.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{d as Ve}from"./decodeURIComponentSafe-Dl7JnLtd.js";import{h as Be,c as Ne,g as Wt,e as Kt}from"./routePaths-Dvh0MCMy.js";import{u as qt}from"./utils-BmRSZi-a.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="a6079558-eb3a-4cb8-b34e-e187acdc6189",t._sentryDebugIdIdentifier="sentry-dbid-a6079558-eb3a-4cb8-b34e-e187acdc6189")}catch{}})();function Ht(t=!0){const e=W(),s=Ye(),{useFeatureGate:a}=H(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Jt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=H(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),b=k.companyId,U=S((h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:x,capitalizableAccountOverrides:B,dismissedAccounts:z}=S((h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(x);G.current=x;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S((h=>et(h.accountState)),fe),v=i.useMemo((()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h}),[R]),l=m!=null?v[m]??null:null,j=i.useCallback((h=>{if(!I)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Z=N.current??{},J=P.current;for(const L of u)if($.has(L.accountId)&&Z[L.accountId]==null&&J?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)}),[I]),D=i.useCallback(((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)}),[r,b]),F=i.useCallback((()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))}),[r,b,m]);return{showPopup:p&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=xe.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=H(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&ve(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:K(e)})),[t,e]),f=S((u=>q(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,I=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const $=q(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"})),b=i.useMemo((()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(b!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")})),x=S((u=>oe(u))),B=S((u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")})),z=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[N,P]=i.useState(!1),[R,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{P(!1),v(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{P(!1),v(!1)}),[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(v(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))}),[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect((()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[x.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s(M("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:x,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=xt(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return w.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:w.jsx(Zt,{onClick:y=>y.stopPropagation(),children:w.jsx(Pt,{...A})})})},Zt=Gt(jt)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`;function Xt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:K(e.transactionType),sourceTransactionType:K(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S((p=>p.createTransferEntryState.lastTransferEntryReplacement)),r=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))}),[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Be(g,A)&&(y={id:g,type:K(A)});const m=y!=null?S((T=>q(T,y))):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let I="../";for(let k=0;k<C;k++)I=`${I}../`;return I})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(we(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map((I=>I.id))??[]};o(Y({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Ze((function(t,e){const s=q(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=xe.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}}),(function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(wt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ne(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?we(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(It({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=qt(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Kt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(_e(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(vt({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(Y({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Xt(t,a):void 0}}))(Lt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=H(),o=Vt(),c=S((d=>Q(d))),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&ve(c.userRole),{isFeatureEnabled:A}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(_.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[I,k]=i.useState(!1),b=Ve(f??""),U=Be(C,b),x=S((d=>d.transactionVendorViewState)),B=re(),{isFeatureEnabled:z}=a(_.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(_.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:N}=a(_.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,v=i.useMemo((()=>{if(U)return{id:C,type:K(b)}}),[U,C,b]),l=v!=null?S((d=>q(d,v))):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?x.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S((d=>D!=null?Ie(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0)),h=S((d=>oe(d))),E=S((d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0)),u=c.company?.companyInfo.firstMonthOfFY??1,$=S((d=>Ce(d.accountState,d.accountListState,"accountList"))),[Z,J]=i.useState(!1),[L,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback((d=>Ne(d,T??"")+s.search),[T,s.search]),je=i.useCallback((()=>{de(!1)}),[]);ea({currentTransactionId:v,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{J(!1),le(!1)},me=Bt();Ht();const X=i.useRef(l?.transaction);X.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Jt($e,(()=>{const d=[];if(X.current!=null)for(const ee of X.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d}));i.useEffect((()=>{v!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(_e(v,!1)),ue())}),[e,v,l?.fetchState]),i.useEffect((()=>{if(v!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}}),[v,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect((()=>{ze||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(Z?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),J(!0),e(Ae(D))))}),[l?.fetchState,l?.transaction,F,r]),i.useEffect((()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)}),[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(M("common"))}),[]);const Me=[f,C].filter((d=>d!=null)),{transactionId:pe,onSaveVendor:We,onSaveSuccess:Ke,onCancel:qe}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:He,onAskAiCfoClick:Je}=Mt({mobileExploreReferrer:"Transaction Details"});return Nt({isDataReady:l?.fetchState==="Completed"}),U?w.jsxs(w.Fragment,{children:[pe!=null&&I&&w.jsx(Qt,{isOpen:I,transactionId:pe,onSaveVendor:We,onSaveSuccess:Ke,onCancel:qe}),w.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:v,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:He,onAskAiCfoClick:Je,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:N,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&w.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):w.jsx(Qe,{to:Le(Me.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((n=>n.fileName)))}},na=t=>{const e=[],s=[];return t.lines?.forEach((a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}})),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,Ht as a,Jt as b,ta as c,aa as d,ea as e,re as f,Xt as g,ha as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DKL6viSK.js";import{h as Z,g as N,u as H,i as Q,j as g,N as G,n as W,o as ve,p as j}from"./core-DnZcjy6X.js";import{e$ as U,re as X,k8 as u,Sc as ee,Kz as De,bo as le,Sd as be,kL as te,Od as ae,Se as ue,Sf as Pe,bE as Y,Kv as ye,Sg as Ee,Sh as me,Si as je,Ky as Se,Sj as xe,Sk as pe,Sl as Le,Sm as Ae,Sn as Me,So as Ce,Sp as fe,LL as Be}from"./zeni-epic-state-m4zoW3ek.js";import{a as de,w as ne,i as J,e as w,co as ce,r as K,q as oe,Z as Fe,_ as Oe}from"./index-Bar5dTpy.js";import"./mui-sr6zger7.js";import{a as A}from"./sentry-DFI2OQU2.js";import{w as se}from"./withTransactionSidePanel-CBujpiDq.js";import{p as ie,c as re}from"./routePaths-BQ28bs96.js";import{v as ze}from"./utils-cHxIh7E8.js";import{d as b}from"./decodeURIComponentSafe-CjxujRw-.js";import{Z as we}from"./ZeniAccountStatementScreen-nptp5yY4.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./useAskAiCfoHostNavButtonProps-DZXDQgDN.js";import"./TransactionDetailScreen-DTD0gbHD.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]="fdcbe52e-2415-4351-9bd4-3b19d6a10d50",a._sentryDebugIdIdentifier="sentry-dbid-fdcbe52e-2415-4351-9bd4-3b19d6a10d50")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],q=a=>ze(a),_e=W((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,q(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=q(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:q(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=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:q(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=Z(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=Re(o),y="month",I=g((r=>U(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:k}=S(J.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=A.useState(!1),[F,O]=A.useState(void 0),f=A.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);A.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=q(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let L=f;return f!=null&&F!=null&&(L={...f,period:F}),c==null||L==null?s.jsx(G,{to:"../"}):s.jsx(_e,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:L,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),Re=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},qe=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??ge();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=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),Je=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),S=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>Pe(d.transactionListState,S,p,k))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:L}=ne(),{isFeatureEnabled:r}=L(J.isProjectsTransactionsEnabled),_=g((d=>X(d)))&&r;let i;const z=Ke(p,S,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},R=Ne(C?.dateRange,d);i={accountId:S,accountType:ee(p),classId:k,title:x,timeframe:T,period:R}}A.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let M=i;i!=null&&E!=null&&(M={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&M!=null?s.jsx(qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:M,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(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,Ne=(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??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(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Se(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=K(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),Ze=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),S=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>je(d.transactionListState,S,p,k))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:L}=ne(),{isFeatureEnabled:r}=L(J.isProjectsTransactionsEnabled),_=g((d=>X(d)))&&r;let i;const z=He(p,S,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},R=Qe(C?.dateRange,d);i={accountId:S,accountType:ee(p),projectId:k,title:x,timeframe:T,period:R}}A.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let M=i;i!=null&&E!=null&&(M={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&M!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:M,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,Qe=(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=Me(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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(Ae(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=K(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=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=b(l??""),S=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Le(v.transactionListState,S,p))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((v=>U(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",L=O.company?.companyInfo.firstMonthOfFY??1;let r;const _=Xe(p,S,h,T,D,k);if(_){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:S,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:M}=z(J.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(J.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:R}=Fe();A.useEffect((()=>{!P&&r!=null&&R&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Ae(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,R]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return _&&i!=null?s.jsx(We,{firstMonthOfFY:L,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:M,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...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/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>U(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(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(Je,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-P0DntAgT.js";import{h as U,g as N,u as H,i as Q,j as g,N as G,n as W,o as ve,p as j}from"./core-Ct1Na3r4.js";import{eZ as K,r9 as X,k3 as u,RY as ee,Km as De,bo as le,RZ as Pe,kG as te,O0 as ae,R_ as ue,R$ as be,bE as Y,Ki as ye,S0 as Ee,S1 as me,S2 as je,Kl as Ae,S3 as xe,S4 as pe,S5 as Me,S6 as Se,S7 as Le,S8 as Ce,S9 as fe,Ly as Be}from"./zeni-epic-state-x9uZgubN.js";import{O as de,A as ne,d as q,f as w,co as ce,r as Z,p as oe,_ as Fe,c as Oe}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{a as S}from"./sentry-CfbcqWq3.js";import{w as se}from"./withTransactionSidePanel-u9hB8oy5.js";import{p as ie,c as re}from"./routePaths-Dvh0MCMy.js";import{v as ze}from"./utils-BmRSZi-a.js";import{d as P}from"./decodeURIComponentSafe-Dl7JnLtd.js";import{Z as we}from"./ZeniAccountStatementScreen-DsIySC9T.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import"./TransactionDetailScreen-BAzuDRZQ.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]="ac84e854-3783-47c2-ba2a-70a8cd7d973c",a._sentryDebugIdIdentifier="sentry-dbid-ac84e854-3783-47c2-ba2a-70a8cd7d973c")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=W((function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(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=J(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:J(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=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=U(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:b}=$e(o,p,I.bookCloseDate),[B,E]=S.useState(!1),[F,O]=S.useState(void 0),f=S.useMemo((()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);S.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=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??ge();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=Z(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=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=g((d=>be(d.transactionListState,A,p,k))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Ze(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{b||i==null||(B(!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,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(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,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=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??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(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=Z(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),Ue=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=g((d=>je(d.transactionListState,A,p,k))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((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")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{b||i==null||(B(!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,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ke,{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,Qe=(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&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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(Se(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=Z(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=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,A,p))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((v=>K(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,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=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();S.useEffect((()=>{!b&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Se(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[b,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=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:v=>F(v),...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/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>K(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(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(Ue,{referrerType:a})})]})}export{kt as default};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-P0DntAgT.js";import{h as F,g as B,u as L,i as O,j as g,N as D,n as N,o as Te,p as k}from"./core-Ct1Na3r4.js";import{cr as G,eZ as E,QI as U,GJ as ae,fY as H,Gr as ne,QK as we,GM as ke,QG as be,QH as se,QW as je,EQ as Ae,uu as Ee,QM as ve,H3 as De,QJ as re,cV as Z,yN as oe,fE as Fe,fG as Be,RV as Le,RW as Ue,Gs as Me,RX as Pe,Gt as Re,GC as Ve,bs as Oe,bJ as Ne,cC as Ge,bK as _e,cq as ze,bt as $e,Mh as Qe,cp as He}from"./zeni-epic-state-x9uZgubN.js";import{e as _,ar as Ze,z as A,C as z,f as b,ch as Ke,ci as We,cj as Q,K,y as Je,_ as qe,a0 as Xe,A as ie,d as v,F as Ye,B as et,ck as tt,au as W,r as at,cl as nt,p as J,cm as st,V as X,cn as rt,i as ot}from"./index-BBFNuY8-.js";import{D as it,n as P,S as ct}from"./mui-SSWNL1tt.js";import lt from"./NotFoundScreen-DR4zbgK0.js";import{S as Y}from"./SetupPagesScreen-D_WJHeIH.js";import{a as p}from"./sentry-CfbcqWq3.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{u as dt}from"./useInitialThreadRequest-J5ElkQVA.js";import{u as pt}from"./useCashManagementBanner-D5vpE0Fa.js";import{M as ce}from"./MobileAppDrawer-uvkpUvp_.js";import{F as mt}from"./FeaturePreviewScreen-1q69VsC1.js";import{a as ee}from"./analyticsHelper-eo4F52XS.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";import"./routePaths-Dvh0MCMy.js";import"./BusinessVerificationPageScreen-qG6q7Wb6.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]="83f6d6b6-1b6f-4c05-baa7-dbbc341b8b4d",t._sentryDebugIdIdentifier="sentry-dbid-83f6d6b6-1b6f-4c05-baa7-dbbc341b8b4d")}catch{}})();const ft=N((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:b}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(we(s))}}}))(Ke);function yt(){const t=F(),a=B(),n=L(),{tenantEmailDomain:r}=O(),m=_(),s=g((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=Ze(s),o=G(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,I]=p.useState(!1),[c,l]=p.useState(!1),S=g((w=>E(w))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((w=>U(w,y))),T=g((w=>w.treasurySetupViewState.fetchState)),C=g((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),R=g((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,T,y,n]),p.useEffect((()=>{c||R!=="Not-Started"||y==null||(l(!0),n(H()))}),[c,R,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(I(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const M=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!M&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:M,isReadOnly:!o,treasurySetupView:h,analytics:b})]})}const gt=N((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(We),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=L(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,I]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>be(C))),T=g((C=>U(C,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(H()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(I(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(gt,{analytics:b,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:T,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",h.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=P.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
|
+
`,xt={overlayWidth:new Ye(100,100,48)},Ct=N((function(t,a){const n=re(t),{companyId:r}=a;return{treasuryDetail:n,treasurySetupView:U(t,r),downloadEndPoint:`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:r,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:o}=a,{tenantEmailDomain:u}=r;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let d="page-not-found";i==="editPortfolio"?d=It(u):i==="statements"?d=Tt(u):i==="taxLetter"?d=wt(u):i==="settings"&&(d=kt(u));const I=at(m.state?.pathnameStackToGoBack,m.pathname);n(d,{state:{pathnameStackToGoBack:I}})},onColumnSortConfigChanged:(i,d)=>{t(Le({uiState:{sortKey:i,sortOrder:d}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(o?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${u}/checking/cash_management`)}}}))(tt);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),r=F(),m=L(),s=K(),f=Je(),o=g((j=>E(j))),{tenantEmailDomain:u}=O(),i=o.companyId??A.getSignedInUserTenant(u)?.companyId,[d,I]=p.useState(!1),c=g((j=>re(j))),l=c.fetchState,S=c.accountSummary?.totalBalance?.amount,y=g((j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),x=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),T=!!o.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,C=G(h?.loggedInUserRoleMap),R=Z(h?.loggedInUserRoleMap),{areTenantIdsInSync:M}=qe();p.useEffect((()=>{l==="Not-Started"&&!d&&M&&(I(!0),m(oe(!0)))}),[d,m,l,M]),p.useEffect((()=>{c.transactionsFetchState.fetchState==="Completed"&&c.transactions.length===0&&!n.pathname.includes("transfer")&&C&&r("./transfer")}),[c.transactionsFetchState.fetchState,c.transactions.length]);const w=()=>{r("..")},[le,ue]=p.useState(!1),q=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=ut({mobileExploreReferrer:"Treasury"});Xe({isDataReady:l==="Completed"});const me=pt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(v.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(v.isCashManagementFeatureEnabled),Se=dt(i,{clearParams:l==="Completed"&&y?.fetchState==="Completed"}),xe=Fe(o),Ce=Be(fe,o);if(xe===!0&&Ce!==!0)return e.jsx(mt,{});if(x){const j=y?.fetchState!=="Completed"||c.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[c.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:xt.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(bt,{onClick:Ie=>Ie.stopPropagation(),children:[t===!0?e.jsx(ht,{isFirstTransfer:c.transactions.length===0||S===0}):null,a===!0?e.jsx(yt,{}):null]})}),e.jsxs(St,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:q}),e.jsx(Ct,{treasuryDetailsView:c,isAutoTransferRuleEnabled:ye,navigate:r,currentTenant:o,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:q,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return T&&C?e.jsx(D,{to:"../setup"}):o.companyTreasuryInfo?.info&&!T&&R?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const It=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,kt=t=>`/${t}/treasury/setup`,bt=P(ct)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,jt=P.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 At(){const t=F(),a=L(),n=K(),r=B(),m=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),o=g((l=>Ue(l)));p.useEffect((()=>{s||o.fetchState!=="Not-Started"||(f(!0),a(Me(!1)))}),[s,o.fetchState,a]);const u=A.getSignedInUser(),i=g((l=>E(l))),d={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(u==null)throw Error("Can't access statements page without signing in...");const c=o.fetchState!=="Completed";return e.jsx(jt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:I,statementListView:o,isLoading:c,onBackClick:()=>{const l=J(r.state?.pathnameStackToGoBack),S=l.poppedPathname??"..";t(S,{state:{pathnameStackToGoBack:l.newStack}})},authParams:d,downloadEndPoint:m})})}const Et=P.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 vt(){const t=F(),a=K(),n=B(),r=L(),m=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),o=g((l=>Pe(l)));p.useEffect((()=>{s||o.fetchState!=="Not-Started"||(f(!0),r(Re(!1)))}),[s,o.fetchState,r]);const u=A.getSignedInUser(),i=g((l=>E(l))),d={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(u==null)throw Error("Can't access tax letter page without signing in...");const c=o.fetchState!=="Completed";return e.jsx(Et,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:I,taxLetterListView:o,isLoading:c,onBackClick:()=>{const l=J(n.state?.pathnameStackToGoBack),S=l.poppedPathname??"..";t(S,{state:{pathnameStackToGoBack:l.newStack}})},authParams:d,downloadEndPoint:m})})}const Dt=N((function(t,a){const{companyId:n}=a,r=U(t,n);return{treasurySetupView:r,isSetupComplete:r.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:r}=a;return{onSetupButtonClick:()=>{t(Ve(r))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}}))(rt),Ft=()=>{const t=F(),a=B(),n=L(),{tenantEmailDomain:r}=O(),[m,s]=p.useState(!1),f=g((h=>E(h))),[o,u]=p.useState(!1),i=g((h=>h.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{o||i?.fetchState!=="Not-Started"||d==null||(u(!0),n(H()))}),[i,n]);const d=A.getSignedInUserTenant(r)?.companyId??f.companyId,I=A.getSignedInUser(),c=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=h=>{s(h)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const S=_(),y=G(S?.loggedInUserRoleMap),x=Z(S?.loggedInUserRoleMap);if(c&&y)return e.jsx(D,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!c&&y||x)){if(a.state?.message==="activation"){const h=J(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:h.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:h=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(h)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:l}),e.jsx(Dt,{analytics:b,navigate:t,companyId:d,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=P.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 na(){const t=B(),a=g((T=>E(T))),{useFeatureGate:n}=ie(),r=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=Z(s?.loggedInUserRoleMap),o=a?.userRole!=null&&Oe(a?.userRole),u=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!o)&&Ne(s?.loggedInUserRoleMap),i=Ge(s?.loggedInUserRoleMap),d=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!o)&&_e(s?.loggedInUserRoleMap),I=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!o&&ze(s?.loggedInUserRoleMap),c=r&&!o&&G(s?.loggedInUserRoleMap),{isFeatureEnabled:l}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=n(v.isDebitCardFeatureEnabled),y=ot(a,l,S)&&!o&&$e(s?.loggedInUserRoleMap),x=Qe(s?.loggedInUserRoleMap),h=He(s?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:u,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:y,isTreasuryAdminLevelAccess:c,isUserHasOnlyCardAccess:x,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:u,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:y,isTreasuryAdminLevelAccess:c,isUserHasOnlyCardAccess:x,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Ft,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(vt,{})}),r?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),c?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):m&&c?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{na as default};
|