@zeniai/web-app-ui 5.1.99-qa → 5.2.0-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-DGCDOoKb.js +1 -0
- package/dist/assets/{AddressScreen-CBnElFxM.js → AddressScreen-Dzf83tSk.js} +2 -2
- package/dist/assets/AiCfoScreen-TZ---AU4.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-CB55AV0C.js → BillPayApprovalRoutes-iPPwT0JG.js} +1 -1
- package/dist/assets/{BillPayRoutes-UVA-u63A.js → BillPayRoutes-U0Aszwdv.js} +17 -17
- package/dist/assets/{BusinessVerificationPageScreen-DsowR4fB.js → BusinessVerificationPageScreen-B4os1LkS.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-BaEolMVN.js → CardsAiCfoScreen-Db20Cfsg.js} +3 -3
- package/dist/assets/{ChargeCardRoutes-D3n7KJn0.js → ChargeCardRoutes-rxetskAF.js} +10 -10
- package/dist/assets/{CompanyPassportScreen-wSnqdrZm.js → CompanyPassportScreen-COm4H_kf.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-C5LpJddx.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BIc9nbPF.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DT_Ih6lH.js → CustomerOnboardingRoutes-Id7ixv-a.js} +5 -5
- package/dist/assets/{DashboardRoutes-B4SpN_q5.js → DashboardRoutes-D_SbIh49.js} +4 -4
- package/dist/assets/{DefaultTenantHome-C-Q9oQmt.js → DefaultTenantHome-BsKeybH6.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BKpkRMty.js +18 -0
- package/dist/assets/DrawerScreen-BPgZ_1JF.js +1 -0
- package/dist/assets/EntityDetailRoutes-BZ9Mr897.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-nIGBHuEd.js → ExpenseAutomationRoutes-CN3ihdCO.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-Di3PuVRR.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CW56Ncxa.js +1 -0
- package/dist/assets/{MagicLinkRoutes-BTau9CfB.js → MagicLinkRoutes-DJ7vyce1.js} +5 -5
- package/dist/assets/MagicLinkSignInScreen-BZfit8o3.js +12 -0
- package/dist/assets/MobileAppDrawer-NdU6zrS3.js +1 -0
- package/dist/assets/NotFoundScreen-wlhddpbg.js +1 -0
- package/dist/assets/{NotificationRoutes-CkKMsCoc.js → NotificationRoutes-DbRksc78.js} +1 -1
- package/dist/assets/OAuthConsentScreen-sL3GodJ_.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-BoM4q2mR.js +1 -0
- package/dist/assets/PeopleRoutes-0fm-JoER.js +22 -0
- package/dist/assets/PerformanceRoutes-Cq8pT07f.js +1 -0
- package/dist/assets/{Preview-Dh_7Y2V1.js → Preview-CuOg-A8H.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BOAmyhRI.js → QBOConnectionScreen-D9vGR9Iz.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DfMng3xh.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js → ReimbursementApprovalRuleDetailScreen-w7TPHMbb.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CnfaWQKq.js → ReimbursementRoutes-uHKvr9EG.js} +8 -8
- package/dist/assets/{ReportsRoutes-ZKjtrrXu.js → ReportsRoutes-BosLV3TS.js} +1 -1
- package/dist/assets/RewardsRoutes-BPVfq5Np.js +1 -0
- package/dist/assets/ScreenRoutes-Drpg91zT.js +2 -0
- package/dist/assets/{SettingsRoutes-0RQL-spt.js → SettingsRoutes-BmbweE5j.js} +8 -8
- package/dist/assets/{SetupPagesScreen-lXVOcLJ8.js → SetupPagesScreen-HhCCJlo-.js} +5 -5
- package/dist/assets/SignInScreen-B8UhmfC2.js +1 -0
- package/dist/assets/SignOutScreen-CxWWZOhK.js +9 -0
- package/dist/assets/TaskListScreen-B7M-Cqce.js +9 -0
- package/dist/assets/TaskRoutes-CyLfJ8Tw.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-DFhCPCQa.js → TransactionDetailRoutes-Ct4erWuE.js} +1 -1
- package/dist/assets/TransactionDetailScreen-DRzSksYw.js +5 -0
- package/dist/assets/{TransactionListRoutes-kn0wMJaj.js → TransactionListRoutes-B191v9kk.js} +1 -1
- package/dist/assets/{TreasuryRoutes-h3ROpRx5.js → TreasuryRoutes-DZNZaxYZ.js} +6 -6
- package/dist/assets/{VendorsRoutes-x1VmRs4J.js → VendorsRoutes-CvrHlc-r.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-B9yx7qcI.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BOVvauFK.js → ZeniAccountRoutes-YPhOuFwx.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-DJU3198J.js +9 -0
- package/dist/assets/{accountMappingHelper-DNCKLg7K.js → accountMappingHelper-SWFIL59M.js} +1 -1
- package/dist/assets/{analytics-1WMvk5Rb.js → analytics-DhULAPA0.js} +1 -1
- package/dist/assets/{analyticsHelper-C8vUB4gm.js → analyticsHelper-CbsMOq15.js} +1 -1
- package/dist/assets/{core-0WK0Zss8.js → core-CnGMK-sC.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DYdex7Fp.js → decodeURIComponentSafe-uWfgYCNH.js} +1 -1
- package/dist/assets/{dnd-Dwsdp5ty.js → dnd-BqCGp7Ed.js} +1 -1
- package/dist/assets/{empty-o2YkWI97.js → empty-AGnm4bIq.js} +1 -1
- package/dist/assets/{empty-B_vMxB0z.js → empty-CZCaQm4J.js} +1 -1
- package/dist/assets/{emptyVideoElement-Cmrnn243.js → emptyVideoElement-Cqm9YLjS.js} +1 -1
- package/dist/assets/epic-CTjjWhpg.js +2 -0
- package/dist/assets/getLocaleForTenant-BuGWeb9s.js +1 -0
- package/dist/assets/{index-DptRs9ko.js → index-BuTuhkuP.js} +2 -2
- package/dist/assets/{index-CmH-4r8j.js → index-CUaM5Y1I.js} +1 -1
- package/dist/assets/{index-Dy73EgcO.js → index-D7tfVykC.js} +14303 -14311
- package/dist/assets/{index-C3zdsXK_.js → index-D88Jaev3.js} +1 -1
- package/dist/assets/{index-B4Kzctdg.js → index-S4IFBgph.js} +1 -1
- package/dist/assets/{index-CcesBH_n.js → index-XkyLBJ61.js} +1 -1
- package/dist/assets/{index-CqKRE3AP.js → index-b64yysEr.js} +1 -1
- package/dist/assets/{index-CFATCouK.js → index-uYv86E98.js} +1 -1
- package/dist/assets/{lexical-B9WqgH9H.js → lexical-DlqthnSG.js} +1 -1
- package/dist/assets/{liveblocks-tpE-grBU.js → liveblocks-s55OcG-D.js} +1 -1
- package/dist/assets/{lottie-dQMhiLBj.js → lottie-DMKCl4ti.js} +1 -1
- package/dist/assets/{mui-NHWzIwJg.js → mui-CggbPNN2.js} +2 -2
- package/dist/assets/{pathToGoBack-BmJj5cme.js → pathToGoBack-DpxbYxCk.js} +1 -1
- package/dist/assets/{pdf-C4fX1mA3.js → pdf-BD0zxvar.js} +3 -3
- package/dist/assets/{pdf-lib-CxgB1_73.js → pdf-lib-BzRjr6sI.js} +1 -1
- package/dist/assets/{plaid-59NT4aqa.js → plaid-d_bwfWrk.js} +1 -1
- package/dist/assets/{pusher-CY-7JGv2.js → pusher-Cfk4rd_d.js} +1 -1
- package/dist/assets/{react-D8u5JcH6.js → react-BKWnIOym.js} +1 -1
- package/dist/assets/{react-C2Lbn6h8.js → react-BdjYstH9.js} +1 -1
- package/dist/assets/{react-DhqMtE92.js → react-C8X5xuWi.js} +1 -1
- package/dist/assets/{react-SLQy3m4e.js → react-CSLZes-L.js} +1 -1
- package/dist/assets/{react-OZ0ubAW7.js → react-D5Ky_KQN.js} +1 -1
- package/dist/assets/{react-C3I7c7kB.js → react-onoaKP_J.js} +1 -1
- package/dist/assets/{recharts-CUzwcISX.js → recharts-CmLekiCG.js} +1 -1
- package/dist/assets/routePaths-CVAI7AUa.js +1 -0
- package/dist/assets/{sentry-D58SEIt0.js → sentry-qwy54zvC.js} +1 -1
- package/dist/assets/{url-BRZfE6CD.js → url-BKJ8Udjp.js} +1 -1
- package/dist/assets/{url-wdUk7Rbg.js → url-CF9Fx3Jk.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DwtRgARG.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-Bl-nKTXG.js +1 -0
- package/dist/assets/useCashManagementBanner-SbCmMLis.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-DGhBtw5K.js → useChargeCardPusherEvents-Cg9Qn_oP.js} +1 -1
- package/dist/assets/{useDeviceId-SayLljl1.js → useDeviceId-DPOieVuC.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-gsc6JcZn.js +1 -0
- package/dist/assets/{useInitialThreadRequest-B7WOjZ27.js → useInitialThreadRequest-CXnpfTcs.js} +1 -1
- package/dist/assets/{utils-CHGPa257.js → utils-5Fz6z6US.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BsJ58rSa.js → withTransactionSidePanel-ZQvLeKiY.js} +2 -2
- package/dist/assets/{zeni-epic-state-Bx_bp9Xr.js → zeni-epic-state-NrbJoBOX.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-ChIEG7ZZ.js +0 -1
- package/dist/assets/AiCfoScreen-DXLxFBnQ.js +0 -22
- package/dist/assets/ConnectionAuthScreen-RH-ZQnmS.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Bro8vP9Q.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DmspT9Qv.js +0 -18
- package/dist/assets/DrawerScreen-CTBdvd2J.js +0 -1
- package/dist/assets/EntityDetailRoutes-DPOfKd1l.js +0 -1
- package/dist/assets/FeaturePreviewScreen-CS0na0Uv.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CDdCifUI.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BQxK3HJS.js +0 -12
- package/dist/assets/MobileAppDrawer-By5kqJZy.js +0 -1
- package/dist/assets/NotFoundScreen-BUpSeNgf.js +0 -1
- package/dist/assets/OAuthConsentScreen-BzkRmkhL.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DB98rpg8.js +0 -1
- package/dist/assets/PeopleRoutes-BPQhjQKR.js +0 -22
- package/dist/assets/PerformanceRoutes-Cu8GwbPn.js +0 -1
- package/dist/assets/ReferralListScreen-Bg4MIsqb.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-CLqW8bjU.js +0 -1
- package/dist/assets/RewardsRoutes-Dmsl5Hhz.js +0 -1
- package/dist/assets/ScreenRoutes-DtVjvGeB.js +0 -2
- package/dist/assets/SignInScreen-Caakz2DY.js +0 -1
- package/dist/assets/SignOutScreen-CtzEkEl4.js +0 -9
- package/dist/assets/TaskListScreen-BtTYiD21.js +0 -9
- package/dist/assets/TaskRoutes-X8P3xHwH.js +0 -9
- package/dist/assets/TransactionDetailScreen-CRWTcneH.js +0 -5
- package/dist/assets/WiseConfirmationScreen-CIMiBhET.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-DZHjDSg5.js +0 -9
- package/dist/assets/epic-BqLIdimv.js +0 -2
- package/dist/assets/getLocaleForTenant-CqQ308VG.js +0 -1
- package/dist/assets/routePaths-YBRbNv0i.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-B3JxpD0o.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Dx1w_2sk.js +0 -1
- package/dist/assets/useCashManagementBanner-MgmXXc9G.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-CG-YyoOP.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-s55OcG-D.js";import{a as u}from"./sentry-qwy54zvC.js";import{h as L,g as Q,u as U,j as S,s as le,n as Z,i as G,o as ne,p as v}from"./core-CnGMK-sC.js";import{bn as De,eV as P,gp as Me,n1 as re,Oj as Te,hF as he,Oa as Ue,qT as _e,kz as be,mZ as Fe,hH as Re,Oc as Be,Ob as Oe,Qz as Ve,zm as ze,EP as Le,Q8 as Ne,Qh as $e,c6 as ae,cM as Qe,cN as Ze,bs as Ge,Mb as He,xO as Ke,QA as Je,He as qe,Ev as Ye,Em as Se,Ej as We,xS as ye,Ep as Ce,Es as Ie,Ey as oe,uc as se,xR as Xe,kb as Y,ke as Ae,QB as en,lf as nn,y5 as tn,N2 as an,N3 as on,k9 as sn,QC as cn,kc as ln,rl as rn,MZ as dn,M_ as un,rp as pn,hq as gn,Mj as ee,hi as de,hf as mn,hn as fn,Mk as hn,y2 as bn,QD as Sn,QE as yn,EM as Cn,fA as Ee,fC as xe,QF as In,gd as An,Mt as En,y1 as ue,gi as pe,gh as xn,y0 as vn,gg as kn,gf as wn,QG as jn,fF as ve,QH as Pn,QI as Dn,y8 as Mn,x$ as ge,QJ as Tn,fV as Un,xY as _n,bZ as Fn,c5 as Rn,c4 as Bn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-NrbJoBOX.js";import{C as W,G as O,z as w,ag as ke,bR as Qn,d as H,f as Zn,bC as Gn,T as K,B as ie,bS as Hn,i as we,J as je,bT as Kn,ar as Jn,j as Pe,bU as qn,bV as Yn,bW as Wn,_ as Xn,bX as et,v as nt,bY as tt}from"./index-D7tfVykC.js";import{n as V}from"./mui-CggbPNN2.js";import{M as R}from"./MobileAppDrawer-NdU6zrS3.js";import{a as J,g as q,m as at}from"./accountMappingHelper-SWFIL59M.js";import{t as ot,A as st}from"./AddressScreen-Dzf83tSk.js";import $ from"./NotFoundScreen-wlhddpbg.js";import{g as it}from"./analyticsHelper-CbsMOq15.js";import{B as ct}from"./BusinessVerificationPageScreen-B4os1LkS.js";import{C as lt}from"./CompanyPassportScreen-COm4H_kf.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-gsc6JcZn.js";import{q as me}from"./QBOConnectionScreen-D9vGR9Iz.js";import{B as ut}from"./BillPayApprovalRoutes-iPPwT0JG.js";import{R as pt}from"./ReimbursementApprovalRoutes-DfMng3xh.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";import"./routePaths-CVAI7AUa.js";import"./empty-AGnm4bIq.js";import"./pdf-lib-BzRjr6sI.js";import"./index-b64yysEr.js";import"./url-CF9Fx3Jk.js";import"./index-CUaM5Y1I.js";import"./decodeURIComponentSafe-uWfgYCNH.js";import"./ReimbursementApprovalRuleDetailScreen-w7TPHMbb.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="1874f541-d231-40d4-b337-f763cd4b8401",e._sentryDebugIdIdentifier="sentry-dbid-1874f541-d231-40d4-b337-f763cd4b8401")}catch{}})();const gt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,mt=
|
|
9
|
+
`,mt=Z((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:k,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,_=J(a.accountMappingView.incomeAccountList,y.selectedOption),M=J(a.accountMappingView.expenseAccountList,g.selectedOption),x=J(a.accountMappingView.billPayAccountList,r.selectedOption),F=J(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),B=q(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),T={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:F?.accountId,selectedPrepaidExpensesAccountIds:D.map((j=>j.accountId)),selectedFixedAssetsAccountIds:N.map((j=>j.accountId)),selectedAccruedExpensesAccountIds:B.map((j=>j.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((j=>j.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{ke(c)===!1?(s("../../dashboard"),e(Be())):e(he())},onSaveClick:()=>{e(Re()),l&&H.track(Zn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Fe(a.currentTenant.companyId,n))}}}))(Qn),ft=()=>{const e=L(),a=Q(),s=U(),{useFeatureGate:c,useDynamicConfig:l}=W(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=w.getSignedInUser(),y=De(f),g=S((d=>P(d))),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:k}=S((d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,j=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}}),le),E=u.useCallback(((d,C)=>{s(re(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[j,X]=T[0]??[];j!=null&&s(re(g.companyId,j,X,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=S((d=>Te(d.accountState)),le),_=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[M,x]=u.useState(!1),[F,D]=u.useState(!1);u.useEffect((()=>{M===!1&&(s(he()),x(!0))}),[M]);const N=S((d=>Ue(d))),B=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(R,{isAppContentDrawerOpen:F,handleDrawerToggle:B}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:k,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:ke(a),onClickMenuIcon:()=>B(!0)})]})},ht=V.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,bt=
|
|
17
|
+
`,bt=Z((function(e,a){const s=P(e),c=Ne(e),l=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Hn),St=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=G(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S((A=>P(A))),y=S((A=>A.billPaySetupApproverViewState.fetchState)),g=S((A=>A.remiSetupApproverViewState.fetchState)),r=S((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Gn(f?.tenantId),k=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=K();u.useEffect((()=>{p||y!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,y,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:k,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},yt=V.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=
|
|
25
|
+
`,Ct=Z((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Je(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(ye(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?Se(n,t,i,p):We(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Ye(l,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Kn),It=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=G(),l=K(),{useFeatureGate:n}=W(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,y]=u.useState(!1),g=S((D=>P(D))),r=S((D=>D.settingsViewState.bankConnection.fetchState)),b=Qe(g,l?.loggedInUserRoleMap),I=Ze(g,l?.loggedInUserRoleMap),k=g?.userRole!=null&&Ge(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!k,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!k,A=we(g,t,i),_=He(g,l?.loggedInUserRoleMap)&&A,{isCardsHidden:M}=je(g?.tenantId),x=g.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||r==="Completed"||(y(!0),s(Ke(!1)))}),[f,s,r]);const F=D=>{m(D)};return b||E||I||_?o.jsxs(yt,{children:[o.jsx(R,{isAppContentDrawerOpen:p,handleDrawerToggle:F}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:_,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{F(!0)}})]}):o.jsx($,{})},At=V.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,Et=
|
|
33
|
+
`,Et=Z((function(e,a){const{companyId:s}=a,c=P(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ye("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(Se(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(qn),xt=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=G(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S((h=>P(h))),y=S((h=>h.cardPaymentViewState)),g=S((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),r=Jn(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,I=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=K();u.useEffect((()=>{I!=null&&s(Xe(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(Y()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{r==="In-Progress"&&b==="Completed"&&s(Y())}),[r,b]);const E=h=>{n(h)};return k?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=Z((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{H.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}}))(Yn),kt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=G();rt();const[c,l]=u.useState(!1),n=S((h=>h.tenantState.fetchState)),t=S((h=>P(h))),i=t.companyId??w.getSignedInUserTenant(s)?.companyId,p=w.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(rn(te))}),[a]);const[y,g]=u.useState(!1);u.useEffect((()=>{y||(g(!0),a(Y()))}),[y,a]);const r=h=>{l(h)},b=S((h=>dn(h,i))),I=S((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:k,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:k,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},wt=V.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,
|
|
41
|
+
`,jt=V.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,
|
|
49
|
+
`,Pt=()=>{const e=U(),{tenantEmailDomain:a}=G(),[s,c]=u.useState(!1),l=S((r=>P(r))).companyId??w.getSignedInUserTenant(a)?.companyId,n=w.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=S((r=>Sn(r,n.userId))),i=S((r=>yn(r,l,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback((r=>{e(se("user_reimbursement_account",r))}),[]),y=u.useCallback((r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Wn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:y,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,fe=({appContent:e})=>{const a=U(),s=L(),c
|
|
57
|
+
`,fe=({appContent:e})=>{const a=U(),s=L(),c=Q(),[l,n]=u.useState(!1),t=S((d=>P(d))),{tenantEmailDomain:i}=t,p=t.companyId??w.getSignedInUserTenant(i)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=W(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=S((d=>be(d))),I=Ee(t),k=xe(g,t),E=!k&&b,h=we(t,y,g),{isCardsHidden:A}=je(t?.tenantId),_=!h||A,{areTenantIdsInSync:M}=Xn();u.useEffect((()=>{M&&a(In(p,E))}),[p,a,E,M]);const x=S((d=>An(d,E))),F=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{B(!0)},isLoading:F,isBankingOnlyTenant:k,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(j,X){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${X}`),z})(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(wn(d,"MyProfile"))},onResendOtp:d=>{a(kn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&w.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=U(),a=S((r=>P(r))).companyId,s=S((r=>jn(r))),c=S((r=>ve(r))),l=w.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((r=>{t(r)}),[]),p=u.useCallback((r=>{e(Pn(r))}),[]),m=u.useCallback((()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))}),[l?.userEmail]),f=u.useCallback((()=>{e(Mn())}),[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const y=u.useCallback((()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Tn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=S((r=>ve(r))),l=S((r=>P(r))),n=K(),t=w.getSignedInUser(),i=U(),{useFeatureGate:p}=W(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,l);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))}),[c.fetchState,a]);const y=xe(m,l),g=Ee(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Fn(l)?o.jsxs(ne,{children:[Rn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Bn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(kt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(St,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-s55OcG-D.js";import{h as X,g as ee,u as ne,i as G,j as P,N as x,n as W,t as en}from"./core-CnGMK-sC.js";import{bJ as nn,cp as Ce,PY as ye,eV as V,cB as tn,zC as Q,zm as an,Q8 as sn,Qb as on,rE as te,rs as ae,l7 as ie,tK as z,Qd as Ie,gh as $e,gg as Ge,gf as We,Qe as cn,zL as rn,Ev as Ae,Em as ke,Ej as _e,E1 as J,Ep as ve,Es as Ee,Ey as Pe,uc as Te,gw as un,cw as dn,fC as ln,fA as pn,fB as mn,bt as yn,Qf as fn,D1 as le,DF as gn,Qg as bn,bK as Sn,FO as pe,EP as hn,Qh as Cn,Qi as In,FS as An,FW as kn,tD as _n,Kk as vn,Gr as he,Hr as me,Qj as En,Qk as Pn,Ql as Tn,Qm as He,Qn as wn,MN as Dn,Po as Un,N0 as On,Qo as Ke,E5 as Fn,N1 as Vn,E9 as Bn,Qp as Oe,GN as qe,lf as xn,rv as Je,tM as jn,bE as Re,tY as Ne,cz as Rn,Qq as Ye,fU as Nn,G9 as zn,Gd as Ln,Qr as Mn,Gu as ze,Qs as Zn,Qt as Qn,Qu as $n,Qv as Gn,gp as Wn,AW as Hn,Qw as Kn,A$ as qn,A_ as Jn}from"./zeni-epic-state-NrbJoBOX.js";import{T as se,C as oe,G as q,y as we,aS as Y,bC as Xe,z as U,x as ce,d as O,B as De,f as $,bD as Yn,au as re,bE as B,bF as Xn,bG as et,ag as xe,bH as nt,v as Le,av as Me,m as tt,F as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-D7tfVykC.js";import{a as h}from"./sentry-qwy54zvC.js";import{n as Fe,D as rt,S as ut}from"./mui-CggbPNN2.js";import{M as fe}from"./MobileAppDrawer-NdU6zrS3.js";import N from"./NotFoundScreen-wlhddpbg.js";import{a as Ze}from"./analyticsHelper-CbsMOq15.js";import{d as Qe}from"./routePaths-CVAI7AUa.js";import{B as Ue}from"./BusinessVerificationPageScreen-B4os1LkS.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]="d0b0d7b1-0726-4af5-92b8-50860ce68180",e._sentryDebugIdIdentifier="sentry-dbid-d0b0d7b1-0726-4af5-92b8-50860ce68180")}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-tpE-grBU.js";import{h as X,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=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(we("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(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(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Ge(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")}}}))(Yn),pt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),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(Y.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),b=h.useRef(!1),[y,_]=h.useState(!1),E=v((w=>w.billPaySetupViewState.fetchState)),f=v((w=>B(w))),S=v((w=>w.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Xe(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 P=!!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=w=>{d(w)};if(P===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(P===!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}})},Qt=(e,o)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:o,$t=e=>`/${e}/cards`,Gt=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},qt=(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}),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,Yt=(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,Xt=(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=W((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(we("charge_card_setup",d,b))},onEstablishConnectionClick:d=>{e(ve(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,b,y)=>{e(Pe(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))}}}))(Xn),bt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=v((L=>B(L))),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(Y.zeniAccountsConfig),{configValue:p}=s(Y.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),b=v((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,P=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:S,chargeCardsCreditAccountLimit:m}),j=S&&P===!1,F=S===!1&&P,w=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,be]=h.useState(!1),[M,ue]=h.useState(!1),Z=v((L=>L.chargeCardSetupViewState.fetchState)),T=U.getSignedInUserTenant(a)?.companyId??n.companyId,Be=U.getSignedInUser(),de=L=>{be(L)},Ve=v((L=>fn(L,T)));if(Be==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 Se=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,q=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(P,S,E,_);return Se||q?Se||q?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:Se,isDebitCardTOSAccepted:q,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Ve,isCreditCardProductVisible:P,isDebitCardFeatureEnabled:S,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,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"})},St=Fe.div`
|
|
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(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(Ee(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(ve(!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(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Ge(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")}}}))(Yn),pt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),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(Y.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),b=h.useRef(!1),[y,_]=h.useState(!1),v=P((T=>T.billPaySetupViewState.fetchState)),f=P((T=>V(T))),S=P((T=>T.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Xe(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((()=>{b.current||v!=="Not-Started"||m==null?b.current||v!=="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)))}),[v,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(E===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(E===!0&&c?.loggedInUserRoleMap!=null){const T=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>T(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}})},Qt=(e,o)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:o,$t=e=>`/${e}/cards`,Gt=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},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: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,Yt=(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,Xt=(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,b)=>{e(Te("charge_card_setup",d,b))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,b,y)=>{e(Ee(d,b,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,b)=>{e(ve(!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)),v=n.allBankAccounts.find((f=>f.accountId===d));O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:v?.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,v=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:v,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))}}}))(Xn),bt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=P((L=>V(L))),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(Y.zeniAccountsConfig),{configValue:p}=s(Y.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,v=!!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,E=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:S,chargeCardsCreditAccountLimit:m}),j=S&&E===!1,F=S===!1&&E,T=ye(r),R=yn(c?.loggedInUserRoleMap),H=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,Ve=U.getSignedInUser(),de=L=>{be(L)},Be=P((L=>fn(L,w)));if(Ve==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(E,S,v,_);return Se||K?Se||K?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:w,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:Se,isDebitCardTOSAccepted:K,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Be,isCreditCardProductVisible:E,isDebitCardFeatureEnabled:S,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:v,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,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-tpE-grBU.js";import{h as X,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=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(we("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(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=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),{useDynamicConfig:n}=oe(),s=Te(),{configValue:l}=n(Y.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=v((m=>m.remiSetupViewState.fetchState)),y=v((m=>B(m))),_=v((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:E,isLoading:f}=Xe(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=P=>P.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(St,{children:[u.jsx(ce,{analytics:O,onLoad:P=>m(P)}),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=W((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"?qe(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:P,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:w,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:be,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:T,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?Rn(k):void 0,phone:d,syncToken:f,fileIds:S,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:P?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((q=>q.length===2?q:Me(q)))??[],companySourceOfFunds:w?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:be?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Be?.selectedOptions??[]},Se={userId:_,firstName:y.firstName,lastName:y.lastName,email:b,syncToken:E};e(Ne({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:P,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?Re(y?.toString()):y,syncToken:E,titleAtCompany:S.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:P,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=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(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(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=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=X(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=se(),{useDynamicConfig:I}=oe(),k=Te(),{configValue:d}=I(Y.zeniAccountsConfig),b=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)),E=v((m=>m.userRoleConfigState.fetchState)),f=v((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=v((m=>{let P;switch(e){case"zeni_accounts":P=Tn(m,S);break;case"zeni_treasury":P=He(m,S);break;case"charge_cards":P=wn(m,S);break;case"reimbursement":P=vn(m,S);break;default:P=Pn(m,S)}return P}));return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(P=>{switch(e){case"zeni_accounts":return P.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return P.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return P.trackPageLoaded($.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=W((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=Ye(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=qe(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($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(Pe(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(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(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=X(),o=ee(),t=ne(),a=Te(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(Y.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=v((T=>T.treasurySetupViewState.fetchState)),m=v((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),P=v((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=v((T=>T.treasuryDetailState.transactionsState?.fetchState)),F=v((T=>B(T))),w=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=v((T=>Ye(T,w))),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,be=U.getSignedInUser(),M=T=>{k(T)};if(be==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{d||A!=="Not-Started"||w==null||(b(!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((()=>{E||P!=="Not-Started"||w==null||(f(!0),t(zn()))}),[E,P,w,t]),h.useEffect((()=>{S||j!=="Not-Started"||w==null||(D(!0),t(Ln(!0)))}),[S,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(Pt,{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})]})},Pt=Fe(ut)`
|
|
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(Te("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(ve(!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=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),{useDynamicConfig:n}=oe(),s=we(),{configValue:l}=n(Y.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=>V(m))),_=P((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:v,isLoading:f}=Xe(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,v)))}),[k,_,f,v,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(St,{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: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=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"?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:v,syncToken:f,fileIds:S,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:E,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:T,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:be,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:w,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:S,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:E?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((K=>K.length===2?K:Me(K)))??[],companySourceOfFunds:T?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:be?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Ve?.selectedOptions??[]},Se={userId:_,firstName:y.firstName,lastName:y.lastName,email:b,syncToken:v};e(Ne({companyDetails:Be,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:v,selectDocument:f,role:S,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:b,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:v,titleAtCompany:S.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=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(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(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=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=X(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=se(),{useDynamicConfig:I}=oe(),k=we(),{configValue:d}=I(Y.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)),v=P((m=>m.userRoleConfigState.fetchState)),f=P((m=>V(m))),S=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{_==="Not-Started"&&n(_n()),v==="Not-Started"&&n(vn(!0))}),[_,v,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 E;switch(e){case"zeni_accounts":E=wn(m,S);break;case"zeni_treasury":E=He(m,S);break;case"charge_cards":E=Tn(m,S);break;case"reimbursement":E=Pn(m,S);break;default:E=En(m,S)}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: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=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=Ye(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=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($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(Te("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(Ee(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(ve(!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),vt=()=>{const e=X(),o=ee(),t=ne(),a=we(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(Y.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,b]=h.useState(!1),[y,_]=h.useState(!1),[v,f]=h.useState(!1),[S,D]=h.useState(!1),A=P((w=>w.treasurySetupViewState.fetchState)),m=P((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),E=P((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=P((w=>w.treasuryDetailState.transactionsState?.fetchState)),F=P((w=>V(w))),T=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=P((w=>Ye(w,T))),H=R.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(Nn()))}),[y,m,T,t]),h.useEffect((()=>{v||E!=="Not-Started"||T==null||(f(!0),t(zn()))}),[v,E,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"||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: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:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},Et=Fe(ut)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,
|
|
21
|
+
`,Pt=W((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Gn(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics: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(Ee(n,s,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(ve(!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=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=oe(),n=se(),s=Ce(n?.loggedInUserRoleMap),{configValue:l}=c(Y.zeniAccountsConfig),i=ye(l),[r,p]=h.useState(!1),[g,C]=h.useState(!1),I=P((_=>_.zeniAccountSetupViewState.fetchState)),k=P((_=>V(_))),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 _=v=>v.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:v=>_(v)}),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-tpE-grBU.js";import{h as X,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=W((function(e,o){const t=
|
|
29
|
+
`,Dt=W((function(e,o){const t=V(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=X(),o=ee(),t=ne(),[a,c]=h.useState(!1),[n,s]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=G(),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=>V(A))),b=we(),y=d.companyId??U.getSignedInUserTenant(r)?.companyId,_=P((A=>Wn(A.companyState,d.companyId))),v=_?.company.companyBillPayInfo.internationalWireOnboardingStatus,f=v?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{a||I!=="Not-Started"||y==null||(c(!0),t(Hn(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($.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=W((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(N,{});case"international-wire":return o?u.jsx(Ut,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Ue,{productType:i}):u.jsx(N,{}):a?u.jsx(Ct,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(Tt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(vt,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?s?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(x,{to:"../"}):u.jsx(N,{}):s?u.jsx(bt,{}):l?u.jsx(x,{to:"../"}):u.jsx(N,{})}})));function oa(e){const{tenantEmailDomain:o}=G(),t=P((c=>V(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,Yt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Ht as g,$t as h,Jt as i,Xt as j,ia as k,qt as l,Kt as m,Gt as n,Wt as o,Qt as p,sa as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-s55OcG-D.js";import{a as u,b as T,q as A}from"./sentry-qwy54zvC.js";import{u as M,h as z,j as l,g as D,N as j,n as O}from"./core-CnGMK-sC.js";import{u as _,z as s,y as P,d as E,a as F,e as B,f as N,h as V,g as Y,Y as $,j as v}from"./index-D7tfVykC.js";import{eV as q,LZ as J,L_ as W,fy as Z,f_ as H,M3 as G,go as K,cY as Q,M4 as b,M5 as R,M6 as X,bY as y}from"./zeni-epic-state-NrbJoBOX.js";import"./mui-CggbPNN2.js";import{u as ee}from"./useDeviceId-DPOieVuC.js";import{f as te}from"./analyticsHelper-CbsMOq15.js";import{t as ne}from"./getLocaleForTenant-BuGWeb9s.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="e0708250-8ef6-4e0f-9d0f-f9524eeaca7b",t._sentryDebugIdIdentifier="sentry-dbid-e0708250-8ef6-4e0f-9d0f-f9524eeaca7b")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),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(R(n,a)))},clearSignInError:()=>{t(b())}}}))($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=M(),d=z(),{clearAllLoading:g}=_(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),k=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=D(),w=P().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),Z(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),K().then((()=>{const e=Y();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))}),2e3))}),[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-s55OcG-D.js";import{a as i}from"./sentry-qwy54zvC.js";import{u as l,g as c,N as u}from"./core-CnGMK-sC.js";import{z as n,d as a,f as m,B as p}from"./index-D7tfVykC.js";import{gt as g,Ml as y}from"./zeni-epic-state-NrbJoBOX.js";import{n as b}from"./mui-CggbPNN2.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="5eda9b5f-9703-4d20-8778-5472f100ee65",e._sentryDebugIdIdentifier="sentry-dbid-5eda9b5f-9703-4d20-8778-5472f100ee65")}catch{}})();function M(){const e=l(),t=c(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),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: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`;export{M as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-s55OcG-D.js";import{a as G}from"./sentry-qwy54zvC.js";import{h as v,u as K,g as _,j as b,i as z,n as J}from"./core-CnGMK-sC.js";import{z as R,C as M,G as p,a0 as O,x as V,d as Z,f as Q,da as W,v as f,r as q}from"./index-D7tfVykC.js";import{eV as H,TK as x,J6 as I,TL as F,TG as Y,Iu as y,TM as X,IC as E,HY as aa,J7 as S,TN as B,fx as ea,IZ as ta,J2 as sa,IR as oa,IP as w,J3 as na,IM as ia,TO as la,TP as ra,TQ as ka,TR as ca,TS as T,eg as ua,TT as da,TU as pa}from"./zeni-epic-state-NrbJoBOX.js";import{n as Ta}from"./mui-CggbPNN2.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import{M as fa}from"./MobileAppDrawer-NdU6zrS3.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="f62ca84f-62f1-4a95-9a2b-809f742fc5b9",e._sentryDebugIdIdentifier="sentry-dbid-f62ca84f-62f1-4a95-9a2b-809f742fc5b9")}catch{}})();const ga=Ta.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,ha=J((function(e,t){const o=x(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map((l=>({...l,tasks:l.tasks.filter((a=>a.taskGroupIds.includes(k)))}))).filter((l=>l.tasks.length>0))}:o,u=Y(e),i=R.isZeniUser();return{taskListView:n,tagListView:u,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}}),(function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(I(!0,u))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=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(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(I(!0,u))},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(F({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(y({taskDetailLocalData:s}));const c=C(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),g=f(n.state?.pathnameStackToGoBack,n.pathname);o(c,{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(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...X,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(i,t.localData.defaultTaskGroupId),c=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}}))(W);function ja(){const e=v(),t=K(),o=_(),k=R.getSignedInUser(),n=b((r=>H(r))),{taskGroupId:u}=z(),{useFeatureGate:i}=M(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:g}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,N]=G.useState(!1),h=b((r=>x(r,l))),D=b((r=>r.taskGroupState)),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:j}=ma({mobileExploreReferrer:"Task Checklist"});if(O({isDataReady:m==="Completed"}),G.useEffect((()=>{t(I(!1,l))}),[n?.tenantId,t,l]),G.useEffect((()=>{m==="Completed"&&t(F({taskGroupById:D.taskGroupById}))}),[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return d.jsxs(d.Fragment,{children:[m==="Completed"?d.jsx(V,{analytics:Z,onLoad:r=>(U=>U.trackPageLoaded(Q.Event.taskListPage))(r)}):null,d.jsxs(ga,{children:[d.jsx(fa,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{N(r)}}),d.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:u,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:g,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:$,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{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=ua(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=da(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{ja as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-s55OcG-D.js";import se from"./NotFoundScreen-wlhddpbg.js";import{a as l}from"./sentry-qwy54zvC.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as le,p as f}from"./core-CnGMK-sC.js";import{I9 as H,Ic as ce,I6 as de,eV as M,TG as J,Iq as Q,I3 as pe,IW as ue,IP as ke,TH as K,TI as V,H$ as me,HY as fe,rE as ge,rs as he,l7 as Ie,Ik as Se,TJ as Te,IB as be,Iy as Ee,If as Ge,Iv as Ce,Iu as De}from"./zeni-epic-state-NrbJoBOX.js";import{z as C,d8 as xe,Q as ye,C as je,G as b,r as W,v as w,x as ve,d as z,f as we,d9 as Re,j as q,au as Be}from"./index-D7tfVykC.js";import{n as Fe}from"./mui-CggbPNN2.js";import{u as Pe}from"./useInitialThreadRequest-CXnpfTcs.js";import{M as Ue}from"./MobileAppDrawer-NdU6zrS3.js";import Le from"./TaskListScreen-B7M-Cqce.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";import"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.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]="61ebfe75-fa83-46d4-8775-39f3de7df999",e._sentryDebugIdIdentifier="sentry-dbid-61ebfe75-fa83-46d4-8775-39f3de7df999")}catch{}})();function $e(){const e=O(),t=Z(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),c=l.useCallback((()=>{t(H())}),[t]),k=l.useCallback(((o,h,I)=>{t(ce({name:o,content:h,cannedResponseId:I}))}),[t]),a=l.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:c,onSave:k})}let A,_=[];const Ne=re((function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=M(e),c=r.taskGroupId??u,k=c!=null?V(e.taskGroupState,c):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${q.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Be.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${q.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:c!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>V(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:c}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??c))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=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(Q(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(H())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function v(){const e=O(),t=Z(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),c=g((i=>M(i))),k=Pe(c?.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:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=l.useState(!1),[p,X]=l.useState(!1),[B,Y]=l.useState(!1),[F,ee]=l.useState(!1),[P,y]=l.useState(!1),T=l.useRef(!1),G=g((i=>i.taskListState.updateTasksFetchState.fetchState)),U=g((i=>J(i))),L=g((i=>i.taskGroupViewState.fetchState));l.useEffect((()=>{p||(X(!0),t(Q(!1,r)))}),[p,t]),l.useEffect((()=>{B||U.fetchState==="Completed"||(Y(!0),t(pe()))}),[B,t,U.fetchState]),l.useEffect((()=>{F||L==="Completed"||(ee(!0),t(ue()))}),[F,t,L]);const ae=l.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))}),[t,r]);l.useEffect((()=>{if(P)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=c;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}),[P,G,c,s,e]);const $=g((i=>K(i,r))),j=$.fetchState,N=C.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=c,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:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:c,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ve=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(le,{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($e,{})}),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-DFhCPCQa.js → TransactionDetailRoutes-Ct4erWuE.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-s55OcG-D.js";import i from"./NotFoundScreen-wlhddpbg.js";import{T as r}from"./TransactionDetailScreen-DRzSksYw.js";import"./sentry-qwy54zvC.js";import{o as s,p as o}from"./core-CnGMK-sC.js";import"./zeni-epic-state-NrbJoBOX.js";import"./recharts-CmLekiCG.js";import"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";import"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import"./decodeURIComponentSafe-uWfgYCNH.js";import"./routePaths-CVAI7AUa.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as x}from"./liveblocks-s55OcG-D.js";import{a as i}from"./sentry-qwy54zvC.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as Ee,N as Qe,n as Ze}from"./core-CnGMK-sC.js";import{nQ as he,eV as Q,gp as Xe,Oj as ea,n1 as aa,mL as ta,bn as na,cV as be,bs as Ie,rc as q,Ni as H,Ok as ve,Ol as oe,NI as De,kK as Ce,Om as ke,NN as se,NO as ce,lz as Ae,Kd as ie,Nc as M,kE as Oe,kC as Ue,kO as oa,nD as sa,On as ca,Oo as ia,vs as K,kJ as xe,Jy as we,ci as ra,cZ as la,Op as da,Nb as ua,Oq as ma,vo as pa,Or as fa,Os as ha,Ot as ya,Ou as Sa,Ov as ga,kN as Ta,Ow as Ea,Ox as ba,Nd as Ia,Oy as va,Oz as Da,OA as Ca,Js as ka,Ji as Aa,JH as Oa,kP as Ua,Ke as ye,nI as xa}from"./zeni-epic-state-NrbJoBOX.js";import{C as J,G as w,z as Pe,aS as _e,y as wa,m as Pa,aT as _a,F as Fa,r as te,T as Va,aU as Na,v as ne,a0 as Ba,aV as za,d as Fe,aW as La,au as Ra,a4 as ae}from"./index-D7tfVykC.js";import{n as Ga,S as ja,D as $a}from"./mui-CggbPNN2.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import{d as Ve}from"./decodeURIComponentSafe-uWfgYCNH.js";import{h as Ne,c as Be,g as Wa,e as qa}from"./routePaths-CVAI7AUa.js";import{u as Ha}from"./utils-5Fz6z6US.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]="e7a0610f-84a9-4d2a-bd36-a0fa33a2e083",a._sentryDebugIdIdentifier="sentry-dbid-e7a0610f-84a9-4d2a-bd36-a0fa33a2e083")}catch{}})();function Ja(a=!0){const e=W(),s=Ke(),{useFeatureGate:t}=J(),{isFeatureEnabled:n}=t(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!a||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"}))}),[a,n,e,s])}function Ya(a,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),E=k.companyId,U=S((h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:P,capitalizableAccountOverrides:N,dismissedAccounts:R}=S((h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(P);G.current=P;const B=i.useRef(N);B.current=N;const _=i.useRef(R);_.current=R;const z=S((h=>ea(h.accountState)),fe),I=i.useMemo((()=>{const h={};for(const b of z)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h}),[z]),l=m!=null?I[m]??null:null,j=i.useCallback((h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),Z=B.current??{},Y=_.current;for(const L of u)if($.has(L.accountId)&&Z[L.accountId]==null&&Y?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)}),[v]),D=i.useCallback(((h,b)=>{r(aa(E,h,b,!0)),g(!1),y(null),O(null)}),[r,E]),F=i.useCallback((()=>{m!=null&&(r(ta(E,m)),g(!1),y(null),O(null))}),[r,E,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),t=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((()=>{a==="In-Progress"&&(n.current=c.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a}),[a]),s}const re=()=>{const a=Pe.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>na(a)&&s),[a,s])};function ze(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ht(a,e){const s=W(),{useFeatureGate:t,useDynamicConfig:n}=J(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=t(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=t(w.isExpenseAutomationEnabled),{configValue:y}=n(_e.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:a,type:q(e)})),[a,e]),f=S((u=>H(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"})),E=i.useMemo((()=>f?.fetchState==="Completed"?ze(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),P=S((u=>oe(u))),N=S((u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")})),R=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[B,_]=i.useState(!1),[z,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{_(!1),I(!1),j(!1)}),[a,e]);const D=i.useCallback((()=>{_(!1),I(!1)}),[]),[F,h]=i.useState(!1),b=N?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(B?z||U==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),_(!0),s(Ae(E))))}),[s,l,f?.fetchState,f?.transaction,E,c,r,p,B,z,U,b]),i.useEffect((()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[P.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:v,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:P,uiState:N,firstMonthOfFY:R,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Ka={overlayWidth:new Fa(100,100,58)},Qa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=wa(),c=Pa(),r=W(),p=S((y=>oe(y))),g=()=>{t()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(oa("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($a,{anchor:"right",open:a,PaperProps:{style:{width:Ka.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Za,{onClick:y=>y.stopPropagation(),children:x.jsx(_a,{...A})})})},Za=Ga(ja)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`;function Xa(a,e){a(sa({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function et({currentTransactionId:a,enabled:e=!0,buildPath:s,beforeNavigate:t,navigate:n,navigateState:o}){const c=S((p=>p.createTransferEntryState.lastTransferEntryReplacement)),r=i.useRef(null);i.useEffect((()=>{if(!e||c==null||a==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;a.id===p.id&&a.type===p.type&&(r.current=c,t?.(),n(s(g),{replace:!0,state:o}))}),[e,c,a,s,t,n,o])}const at=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=Ee(),g=e??p,A=s??Ve(r??"");let y;Ne(g,A)&&(y={id:g,type:q(A)});const m=y!=null?S((T=>H(T,y))):void 0,O=()=>{const T=te(t.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map((v=>v.id))??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ca({transactionId:y})),o(Ue()),o(ia()),a(!0),O()}}},tt=Ze((function(a,e){const s=H(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=Pe.getSignedInUser(),o=a.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=da(a,e.entity,"TransactionDetail"));const r=a.entityAutoCompleteState.autoCompleteText.common,p=ua(a,"common"),g=Q(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${ae}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ae}/transaction_attachments_accounting_provider`:`${ae}/transaction_attachments`,attachmentUploadEndpoint:`${Ra.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,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(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(M("common")),e.onBackClick!=null)return void e.onBackClick();const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(xa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(se()),a(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Be(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ye(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,c)=>{a(c===!0&&o!=null?xe(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ua({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(M("common"))},onUploadAttachmentAttachment:t=>{a(Oa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(Aa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ka({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,c)=>{e.transaction!=null&&a(Ca(e.selectedTransaction,e.transaction,t,n,o,c))},onResetLineItemsCategoryClassInLocalData:(t,n,o,c,r,p)=>{a(Da(t,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(va({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=te(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Ha(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wa(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qa(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{a(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(Ia({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(M("common"))},onCancelAutoComplete:()=>{a(M("common"))}},onFetchRecommendationsForEntity:(t,n,o,c)=>{a(K({entity:t,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:c}=t;a(ba(n,o,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(Ea(t))},onSaveVendorInLocalData:(t,n,o,c,r)=>{if(a(Ta({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&a(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),a(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:(t,n,o,c,r)=>{a(ga({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&a(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(Sa({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ya(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(ha(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(fa({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(pa(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(ma(t,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>Xa(a,t):void 0}}))(La);function yt(){const a=Te(),e=W(),s=ge(),{useFeatureGate:t,useDynamicConfig:n}=J(),o=Va(),c=S((d=>Q(d))),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&be(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=t(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(w.isExpenseAutomationEnabled),{configValue:m}=n(_e.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=Ee(),[v,k]=i.useState(!1),E=Ve(f??""),U=Ne(C,E),P=S((d=>d.transactionVendorViewState)),N=re(),{isFeatureEnabled:R}=t(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=t(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=t(w.isProjectsTransactionsEnabled),_=o?.currentTenant?.companyId,z=o?.currentTenant?.companyName,I=i.useMemo((()=>{if(U)return{id:C,type:q(E)}}),[U,C,E]),l=I!=null?S((d=>H(d,I))):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?P.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?ze(l?.transaction):void 0,F=S((d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0)),h=S((d=>oe(d))),b=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,Y]=i.useState(!1),[L,le]=i.useState(!1),[Re,de]=i.useState(!1),Ge=i.useCallback((d=>Be(d,T??"")+s.search),[T,s.search]),je=i.useCallback((()=>{de(!1)}),[]);et({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:a,navigateState:s.state});const ue=()=>{Y(!1),le(!1)},me=Na();Ja();const X=i.useRef(l?.transaction);X.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Ya($e,(()=>{const d=[];if(X.current!=null)for(const ee of X.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d}));i.useEffect((()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())}),[e,I,l?.fetchState]),i.useEffect((()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);a("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}}),[I,l?.fetchState,a,s.state,s.pathname,me]),i.useEffect((()=>{Re||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:b?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),Y(!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:qe,onCancel:He}=at({closeDrawerHandler:d=>{k(!1),a(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=Ma({mobileExploreReferrer:"Transaction Details"});return Ba({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Qa,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}),x.jsx(tt,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:a,selectedTransaction:I,entity:D,isCOTEnabled:N,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:R,isProjectsTransactionsEnabled:B,companyId:_,companyName:z}),V.showPopup&&V.popupType!=null&&x.jsx(za,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Qe,{to:Le(Me.length)})}const Le=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},Se=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=nt(a),t=ot(a);Fe.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map((n=>n.fileName)))}},nt=a=>{const e=[],s=[];return a.lines?.forEach((t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}})),{transactionCategory:e,transactionClass:s}},ot=a=>ra(a)===!0?a.customer?.name??"":la(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Qa as C,yt as T,Ja as a,Ya as b,at as c,tt as d,et as e,re as f,Xa as g,ht as u};
|