@zeniai/web-app-ui 5.1.56-qa → 5.1.57-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-CbBiqU38.js +1 -0
- package/dist/assets/{AddressScreen-Jgfq0eWZ.js → AddressScreen-Bah6Axto.js} +2 -2
- package/dist/assets/AiCfoScreen-D6w_JSwz.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-8TDA8Ccp.js +1 -0
- package/dist/assets/BillPayRoutes-nnUKPO5Y.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-BSCz_weX.js +9 -0
- package/dist/assets/ChargeCardRoutes-Ct92GkQR.js +71 -0
- package/dist/assets/{CompanyPassportScreen-CE4f1mRO.js → CompanyPassportScreen-BuzhHe2C.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-Cx532D02.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-Df40VEpH.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-6JIj5Uwx.js +23 -0
- package/dist/assets/DashboardRoutes-8dZJcrjS.js +20 -0
- package/dist/assets/DefaultTenantHome-DtGQaM5T.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-uWwGtp2A.js +18 -0
- package/dist/assets/{DrawerScreen-DcUdH_zJ.js → DrawerScreen-C8n2HmP2.js} +1 -1
- package/dist/assets/EntityDetailRoutes-HkIOiOiT.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-D87utETH.js +25 -0
- package/dist/assets/FeaturePreviewScreen-GFqoRAmW.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-P129l75l.js +1 -0
- package/dist/assets/{MagicLinkRoutes-C901TSTh.js → MagicLinkRoutes-CwtB31Og.js} +20 -20
- package/dist/assets/MagicLinkSignInScreen-eN1m4ocj.js +12 -0
- package/dist/assets/MobileAppDrawer-B0EbhwTO.js +1 -0
- package/dist/assets/NotFoundScreen-i7in0PiQ.js +1 -0
- package/dist/assets/NotificationRoutes-DrdoIjCe.js +1 -0
- package/dist/assets/OAuthConsentScreen-B6rOIgJM.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CjBSrJEt.js +1 -0
- package/dist/assets/PeopleRoutes-Cm-tUsbs.js +22 -0
- package/dist/assets/PerformanceRoutes-B6QkgqxQ.js +1 -0
- package/dist/assets/{Preview-f2ns8xny.js → Preview-DUJTupxJ.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CSgGZuyl.js → QBOConnectionScreen-DuffYDWL.js} +1 -1
- package/dist/assets/ReferralListScreen-B2Vroa_d.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-eSS641gM.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DID8ZBs6.js +1 -0
- package/dist/assets/{ReimbursementRoutes-CzlU6LYx.js → ReimbursementRoutes-BxQKQK4v.js} +13 -13
- package/dist/assets/ReportsRoutes-Crmtgf42.js +1 -0
- package/dist/assets/RewardsRoutes-BmTO_Tbv.js +1 -0
- package/dist/assets/ScreenRoutes-CVo30lLK.js +2 -0
- package/dist/assets/SettingsRoutes-B-U88pFC.js +57 -0
- package/dist/assets/SetupPagesScreen-BR7nlLcj.js +29 -0
- package/dist/assets/SignInScreen-C54ZI6c4.js +1 -0
- package/dist/assets/SignOutScreen-BIz1BEQ9.js +9 -0
- package/dist/assets/TaskListScreen-DKr0bX0e.js +9 -0
- package/dist/assets/TaskRoutes-DH15_wAa.js +9 -0
- package/dist/assets/TransactionDetailRoutes-xbgQVU2q.js +1 -0
- package/dist/assets/TransactionDetailScreen-gxTWcgHw.js +5 -0
- package/dist/assets/TransactionListRoutes-BeJcfGnQ.js +1 -0
- package/dist/assets/TreasuryRoutes-D0pT4IIe.js +37 -0
- package/dist/assets/{VendorsRoutes-BZFmR2hI.js → VendorsRoutes-DEyltljX.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-D4eECASa.js +12 -0
- package/dist/assets/ZeniAccountRoutes-hy9KXK0i.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-CeCApd4l.js +9 -0
- package/dist/assets/{accountMappingHelper-DS9ya8eF.js → accountMappingHelper-CQ-cPZ2Q.js} +1 -1
- package/dist/assets/{analytics-BLbM2ksu.js → analytics-Dp5zEMRl.js} +1 -1
- package/dist/assets/{analyticsHelper-BU5wlVa9.js → analyticsHelper-BsoPneRx.js} +1 -1
- package/dist/assets/{core-OMb8nkC1.js → core-Bz75oBBS.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-CrZYJ6cg.js → decodeURIComponentSafe-C4sdX50I.js} +1 -1
- package/dist/assets/dnd-CZ-V7Opk.js +6 -0
- package/dist/assets/empty-7OUXq_pa.js +1 -0
- package/dist/assets/{empty-BACf_dXg.js → empty-BOJvSC1K.js} +1 -1
- package/dist/assets/{emptyVideoElement-wUn7k4Wi.js → emptyVideoElement-B7aN1P9v.js} +1 -1
- package/dist/assets/epic-BcqgfxS9.js +2 -0
- package/dist/assets/getLocaleForTenant-haKQ7Ka2.js +1 -0
- package/dist/assets/{index-BNIZfLgU.js → index-6BzK0FJL.js} +1 -1
- package/dist/assets/{index-CPre97x9.js → index-B580fqwk.js} +1 -1
- package/dist/assets/{index-5gq8gNHx.js → index-BQTqLUth.js} +2 -2
- package/dist/assets/{index-CVJX5WNC.js → index-Bs6X6A75.js} +1 -1
- package/dist/assets/{index-NcZU0lXl.js → index-CIlw72ZY.js} +26987 -31191
- package/dist/assets/{index-DmsNrKhC.js → index-DqlK4s6f.js} +1 -1
- package/dist/assets/{empty-CyDTyMxd.js → index-PPRJ7txt.js} +1 -1
- package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
- package/dist/assets/index-uPeOzU7i.js +1 -0
- package/dist/assets/{lexical-CNfNgAkp.js → lexical-BhoV9klE.js} +1 -1
- package/dist/assets/{liveblocks-BUQfB0Zp.js → liveblocks-Dtw-cIpm.js} +1 -1
- package/dist/assets/{lottie-DDI83OWz.js → lottie-DCGoGDCc.js} +1 -1
- package/dist/assets/{mui-JZY-3hhJ.js → mui-XIlJ9bNw.js} +1 -1
- package/dist/assets/{pathToGoBack-iJW8VSI1.js → pathToGoBack-DF7meFK5.js} +1 -1
- package/dist/assets/{pdf-6FZlivdz.js → pdf-DY4XXQdH.js} +3 -3
- package/dist/assets/{pdf-lib-CtBKoWQc.js → pdf-lib-BwfYoiDb.js} +1 -1
- package/dist/assets/{plaid-B_OuebQv.js → plaid-HhKeWLGl.js} +1 -1
- package/dist/assets/{pusher-BqrLLY7v.js → pusher-yKpXr-6q.js} +1 -1
- package/dist/assets/{react-PG_EpTGq.js → react-4ndjzott.js} +1 -1
- package/dist/assets/{react-uplfhPO2.js → react-5mDvcVHb.js} +1 -1
- package/dist/assets/{react-BVW_zt6p.js → react-B27fDKOl.js} +1 -1
- package/dist/assets/{react-D-VI0x0-.js → react-BU60ZCxp.js} +1 -1
- package/dist/assets/{react-axoushfz.js → react-BihThLEf.js} +1 -1
- package/dist/assets/{react-Crq75Q-S.js → react-PQlAUPJl.js} +1 -1
- package/dist/assets/{recharts-DAM4r1-u.js → recharts-P1XbTErv.js} +3 -3
- package/dist/assets/{routePaths-DZldr9mG.js → routePaths-kzqCOAuK.js} +1 -1
- package/dist/assets/{sentry-BLIwU6uZ.js → sentry-CcjRjG-d.js} +1 -1
- package/dist/assets/{url-CbGZb3kM.js → url-CywC97He.js} +1 -1
- package/dist/assets/{url-BMb7_G4N.js → url-t5z6Dd8t.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DEWGXdch.js → useAiCfoDashboardSuggestedQuestionsChips-Dr7tCqEp.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-DS5Fxq3U.js → useAskAiCfoHostNavButtonProps-CiS8Thq0.js} +1 -1
- package/dist/assets/{useDeviceId-l9JfwAte.js → useDeviceId-iq2z2ZGf.js} +1 -1
- package/dist/assets/useInitialThreadRequest-XlIrdlUc.js +1 -0
- package/dist/assets/{utils-Bia5qc4p.js → utils-CSFJzIqP.js} +2 -2
- package/dist/assets/withTransactionSidePanel-BwTwVibl.js +21 -0
- package/dist/assets/zeni-epic-state-qHZitSu9.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-DsuoPslx.js +0 -1
- package/dist/assets/AiCfoScreen-ngmwmSfT.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-DjjjDtRL.js +0 -1
- package/dist/assets/BillPayRoutes-zXfejo42.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-BiV9G1-i.js +0 -9
- package/dist/assets/CardsAiCfoScreen-Z2PndTe3.js +0 -14
- package/dist/assets/ChargeCardRoutes-CBFlKgnf.js +0 -71
- package/dist/assets/ConnectionAuthScreen-BFW2NVDD.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DZoaiMvV.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-Doltk1XW.js +0 -23
- package/dist/assets/DashboardRoutes-YclW7oS0.js +0 -20
- package/dist/assets/DefaultTenantHome-cEuyRwZp.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-3X6dnm4U.js +0 -18
- package/dist/assets/EntityDetailRoutes-D020FlPl.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-CTZlVWwO.js +0 -25
- package/dist/assets/FeaturePreviewScreen-DgqstYkZ.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-DlnwVV1p.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-DFljjGc3.js +0 -12
- package/dist/assets/MobileAppDrawer-B4f1me8_.js +0 -1
- package/dist/assets/NotFoundScreen-CxRYls3k.js +0 -1
- package/dist/assets/NotificationRoutes-Dw__n9YA.js +0 -1
- package/dist/assets/OAuthConsentScreen-Ur-mQS8z.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DSq1hcWm.js +0 -1
- package/dist/assets/PeopleRoutes-CUtLjfXT.js +0 -22
- package/dist/assets/PerformanceRoutes-D4zDazyB.js +0 -1
- package/dist/assets/ReferralListScreen-CbCeYBu8.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-CQrzmhSh.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js +0 -1
- package/dist/assets/ReportsRoutes-D_wjWb18.js +0 -1
- package/dist/assets/RewardsRoutes-Bfg59urI.js +0 -1
- package/dist/assets/ScreenRoutes-D5k4uqAt.js +0 -2
- package/dist/assets/SettingsRoutes-3hV9qN1I.js +0 -57
- package/dist/assets/SetupPagesScreen-CPey4cOW.js +0 -29
- package/dist/assets/SignInScreen-gQzAHzdj.js +0 -1
- package/dist/assets/SignOutScreen-GvUCBNk6.js +0 -9
- package/dist/assets/TaskListScreen-Cuce7GNl.js +0 -9
- package/dist/assets/TaskRoutes-DmGo1lNA.js +0 -9
- package/dist/assets/TransactionDetailRoutes-CgKCf_lf.js +0 -1
- package/dist/assets/TransactionDetailScreen-CoGsdLTa.js +0 -5
- package/dist/assets/TransactionListRoutes-C4QYqCpP.js +0 -1
- package/dist/assets/TreasuryRoutes-jiXgJCAb.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BLK_tJR5.js +0 -12
- package/dist/assets/ZeniAccountRoutes-DVnj5-p6.js +0 -73
- package/dist/assets/ZeniAccountStatementScreen-3bZVHWI7.js +0 -9
- package/dist/assets/dnd-DVcQZAG5.js +0 -6
- package/dist/assets/epic-C0I2MvV5.js +0 -2
- package/dist/assets/getLocaleForTenant-Bn16hOPH.js +0 -1
- package/dist/assets/index-BQIzm-tN.js +0 -1
- package/dist/assets/index-SfOqAjbR.js +0 -1
- package/dist/assets/useCashManagementBanner-CtcuIjhq.js +0 -1
- package/dist/assets/useInitialThreadRequest-Bh1NrHII.js +0 -1
- package/dist/assets/withTransactionSidePanel-DxHfrYsZ.js +0 -21
- package/dist/assets/zeni-epic-state-BZ6N8nVI.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-Dtw-cIpm.js";import{a as y}from"./sentry-CcjRjG-d.js";import{h as w,u as A,g as T,i as E,j as b,n as U}from"./core-Bz75oBBS.js";import{Op as D,O9 as x,Dx as C,DG as _,DE as S,DF as h,Oq as B}from"./zeni-epic-state-qHZitSu9.js";import{z as O,m as k,B as V,bJ as F,af as j}from"./index-CIlw72ZY.js";import"./mui-XIlJ9bNw.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]="a600c138-a9e6-4ab2-b239-8351dc2c2c8b",e._sentryDebugIdIdentifier="sentry-dbid-a600c138-a9e6-4ab2-b239-8351dc2c2c8b")}catch{}})();function $(e){return B(e)==null}const N=U(function(e,a){const t=D(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const v=[];return p.forEach(u=>{const R=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const f=!!$(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=R.concat(I);v.push({action:u.stepType.selectedOption,actors:m,operator:m.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function H(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=E(),n=O.getSignedInUser(),l=k(),r=b(p=>D(p)),i=b(p=>x(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(C(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(N,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BUQfB0Zp.js";import{h as W,u as re,g as H,i as Y,j as C,N as _,n as q,l as mt,o as ct,p as E}from"./core-OMb8nkC1.js";import{eV as Z,Qg as le,c6 as me,Ei as Be,kB as dt,Ev as ne,Eu as ae,Qh as ut,bn as ce,gm as Te,Qi as pt,MD as bt,kq as je,ME as Se,MF as gt,jl as ht,Px as ft,jA as St,E6 as It,tY as yt,js as Rt,ES as De,Qj as Fe,Qk as At,Ql as vt,Qm as kt,Qn as Et,Qo as Ct,EC as Ie,jG as wt,PG as xt,Ew as Bt,Eg as Tt,Qp as jt,Ef as Dt,Qq as Ft,Eo as ye,EG as Ut,EF as Lt,EB as Pt,Qr as Ue,JR as $t,bq as Mt,Er as _t,F8 as Qt,Qs as Nt,Qt as Ot,EO as zt,EL as Re,P0 as Gt,Ed as Ht,Qu as Le,FA as Ae,FI as Zt,Qv as Vt,Qw as z,Qx as Wt,Qy as Pe,Qz as qt,QA as $e,QB as Me,E_ as se,bu as Jt,bK as de,cG as ue,fA as _e,fy as Qe,QC as Kt,fv as Yt,Pd as Xt,QD as en,QE as Ne,Ph as tn,P$ as nn,QF as an,Qf as sn,FF as ve,FE as on,QG as rn,QH as ln,QI as mn,QJ as cn,QK as dn,PM as un,Fv as pn,Fz as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,Lz as yn,cQ as Rn,cS as An,cR as vn,cz as kn}from"./zeni-epic-state-BZ6N8nVI.js";import{Z as Oe,J as ze,a as X,F as v,z as $,bY as Ge,E as ee,d as k,aH as ke,o as D,at as K,H as En,D as He,bZ as Cn,s as G,_ as Ze,b_ as wn,j as te,b$ as xn,W as Bn,A as Tn,B as pe,f as Ve,a7 as jn,bk as Dn,a2 as Fn,m as We,c0 as Un,a9 as Ln}from"./index-NcZU0lXl.js";import{n as Q,S as Pn}from"./mui-JZY-3hhJ.js";import ie from"./NotFoundScreen-CxRYls3k.js";import{S as Ee}from"./SetupPagesScreen-CPey4cOW.js";import{F as qe}from"./FeaturePreviewScreen-DgqstYkZ.js";import{a as f}from"./sentry-BLIwU6uZ.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{u as Je}from"./useInitialThreadRequest-Bh1NrHII.js";import{D as $n}from"./DrawerScreen-DcUdH_zJ.js";import{M as Ke}from"./MobileAppDrawer-B4f1me8_.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CQrzmhSh.js";import{FallBackRoute as _n}from"./ScreenRoutes-D5k4uqAt.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./analyticsHelper-BU5wlVa9.js";import"./routePaths-DZldr9mG.js";import"./BusinessVerificationPageScreen-BiV9G1-i.js";import"./ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js";import"./getLocaleForTenant-Bn16hOPH.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]="db7f95b4-2509-4fab-8458-e885c5a6eb55",e._sentryDebugIdIdentifier="sentry-dbid-db7f95b4-2509-4fab-8458-e885c5a6eb55")}catch{}})();const Ye=e=>`/${e}/reimbursements`,Qn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Nn=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ct({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Ye(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(Cn);function Ce(){const e=W(),t=re(),n=H(),{reimbursementId:r}=Y(),d=Oe(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(v.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,j=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=$.getSignedInUser(),I=C(p=>Z(p)),g=C(p=>le(p,r)),P=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const M=C(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ge,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Qn,{})}),s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=Q.div`
|
|
1
|
+
import{j as s}from"./liveblocks-Dtw-cIpm.js";import{h as q,u as re,g as Z,i as Q,j as E,N as M,n as J,l as mt,o as ct,p as C}from"./core-Bz75oBBS.js";import{eQ as V,OH as le,c1 as me,CI as Be,jS as dt,CV as ne,CU as ae,OI as ut,bn as ce,fN as De,OJ as pt,L2 as bt,jH as Te,L3 as Se,L4 as gt,iC as ht,NX as ft,iR as St,Cw as It,tb as yt,iJ as Rt,Dg as je,OK as Fe,OL as At,OM as kt,ON as vt,OO as Ct,OP as Et,D0 as Ie,iX as wt,O4 as xt,CW as Bt,CG as Dt,OQ as Tt,CF as jt,OR as Ft,CO as ye,D4 as Ut,D3 as Lt,C$ as Pt,OS as Ue,Id as Ot,bq as $t,CR as Mt,Dy as _t,OT as Nt,OU as Gt,Dc as zt,D9 as Re,Nq as Ht,CD as Zt,OV as Le,DX as Ae,E3 as Vt,OW as Wt,OX as z,OY as qt,OZ as Pe,O_ as Jt,O$ as Oe,P0 as $e,Do as se,bu as Xt,bG as de,cB as ue,e$ as Me,eZ as _e,P1 as Kt,gU as Qt,ND as Yt,P2 as en,P3 as Ne,NH as tn,Op as nn,P4 as an,OG as sn,E0 as ke,D$ as on,P5 as rn,P6 as ln,P7 as mn,P8 as cn,P9 as dn,Oa as un,DS as pn,DW as bn,bs as gn,bF as hn,cw as fn,ck as Sn,bt as In,JZ as yn,cL as Rn,cN as An,cM as kn,cv as vn}from"./zeni-epic-state-qHZitSu9.js";import{H as Ge,J as ze,s as Y,U as k,z as O,bT as He,x as ee,c as v,aH as ve,o as j,at as K,C as Cn,D as Ze,bU as En,q as H,_ as Ve,bV as wn,k as te,bW as xn,Y as Bn,A as Dn,B as pe,e as We,a7 as Tn,bk as jn,a2 as Fn,m as qe,bX as Un,a9 as Ln}from"./index-CIlw72ZY.js";import{n as _,S as Pn}from"./mui-XIlJ9bNw.js";import ie from"./NotFoundScreen-i7in0PiQ.js";import{S as Ce}from"./SetupPagesScreen-BR7nlLcj.js";import{F as Je}from"./FeaturePreviewScreen-GFqoRAmW.js";import{a as f}from"./sentry-CcjRjG-d.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-CiS8Thq0.js";import{u as Xe}from"./useInitialThreadRequest-XlIrdlUc.js";import{D as On}from"./DrawerScreen-C8n2HmP2.js";import{M as Ke}from"./MobileAppDrawer-B0EbhwTO.js";import{R as $n}from"./ReimbursementApprovalRoutes-eSS641gM.js";import{FallBackRoute as Mn}from"./ScreenRoutes-CVo30lLK.js";import"./recharts-P1XbTErv.js";import"./analytics-Dp5zEMRl.js";import"./plaid-HhKeWLGl.js";import"./dnd-CZ-V7Opk.js";import"./stripe-DMRn4zHo.js";import"./lottie-DCGoGDCc.js";import"./lexical-BhoV9klE.js";import"./pdf-DY4XXQdH.js";import"./utils-CSFJzIqP.js";import"./analyticsHelper-BsoPneRx.js";import"./routePaths-kzqCOAuK.js";import"./BusinessVerificationPageScreen-BSCz_weX.js";import"./ReimbursementApprovalRuleDetailScreen-DID8ZBs6.js";import"./getLocaleForTenant-haKQ7Ka2.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]="34ec4ba9-1fda-4ee4-a00a-e9374779e1c6",e._sentryDebugIdIdentifier="sentry-dbid-34ec4ba9-1fda-4ee4-a00a-e9374779e1c6")}catch{}})();const Qe=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Nn=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=O.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=De(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const D=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:D,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Te(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=O.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Qe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=q(),t=re(),n=Z(),{reimbursementId:r}=Q(),d=Ge(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:D,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,T=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=O.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),P=Xe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||T&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:D,onAskAiCfoClick:u})})]})}const Gn=_.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
5
5
|
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
6
6
|
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
-
`,zn=
|
|
7
|
+
`,zn=_.div`
|
|
8
8
|
position: fixed;
|
|
9
9
|
top: 0;
|
|
10
10
|
left: 0;
|
|
11
11
|
right: 0;
|
|
12
12
|
bottom: 0;
|
|
13
|
-
background-color: ${
|
|
13
|
+
background-color: ${Cn.overlayBackgroundBlack};
|
|
14
14
|
z-index: 5;
|
|
15
|
-
`,
|
|
15
|
+
`,Hn=_.div`
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: 0;
|
|
18
18
|
left: 0;
|
|
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{h as W,u as re,g as H,i as Y
|
|
|
22
22
|
display: flex;
|
|
23
23
|
background-color: transparent;
|
|
24
24
|
overflow: hidden;
|
|
25
|
-
`,
|
|
25
|
+
`,Zn=_.div`
|
|
26
26
|
position: fixed;
|
|
27
27
|
top: 0;
|
|
28
28
|
left: 0;
|
|
@@ -33,27 +33,27 @@ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{h as W,u as re,g as H,i as Y
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
overflow-y: auto;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
`,
|
|
36
|
+
`,Vn=_.button`
|
|
37
37
|
align-self: flex-end;
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
40
40
|
cursor: pointer;
|
|
41
|
-
padding: ${
|
|
41
|
+
padding: ${j.sp2} ${j.sp3};
|
|
42
42
|
line-height: 1;
|
|
43
43
|
color: ${e=>e.theme.colors.hero};
|
|
44
44
|
&:hover {
|
|
45
45
|
color: ${e=>e.theme.colors.primary};
|
|
46
46
|
}
|
|
47
47
|
svg {
|
|
48
|
-
width: ${
|
|
49
|
-
height: ${
|
|
48
|
+
width: ${j.sp4};
|
|
49
|
+
height: ${j.sp4};
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Wn=_.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,
|
|
56
|
+
`,qn=J(function(e,t){const n=Ue(e,t.reimbursementId),r=O.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Nt(n.remiActivities,Gt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Te(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Qe(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Jn(){const e=q(),t=re(),n=Z(),r=n.hash.substring(1),d=Ge(),{reimbursementId:c}=Q(),m=O.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Xe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Ve({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:D}=h(k.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[T,A]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),P=Ot(o),U=$t(o.userRole),$=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(Mt(c,!1,I)))},[u,c,t,$]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&P===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,P,m]),f.useEffect(()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Be(!1,D,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[T,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Xn=J(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(xn);function Kn(){const e=q(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Xn,{navigate:e,analytics:v,isAdmin:d})}const G=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Qn,common:we}=Ze.getLocalizedStrings(),xe=Qn.reimbursement.bulkActions,Yn=_.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{h as W,u as re,g as H,i as Y
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,ea=
|
|
64
|
+
`,ea=J(function(e,t){const n=$e(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const d=O.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Pe(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(Tn(jn));function ta(){const e=q(),t=re(),n=Z(),r=n.state,d=ze(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(Pe(S)):console.log("Warning:Not a valid remiListTab");const N=Jt(r.subTab.toString());N!=null?t(Oe(N)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),D=O.getSignedInUser(),u=E(S=>V(S)),[w,T]=f.useState(!1),[A,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>$e(S,G,h)),{areTenantIdsInSync:g}=Bn(),P=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:$}=be({mobileExploreReferrer:"Reimbursement List"});if(Ve({isDataReady:P==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(G,!0,l,!1,!0)))},[A,G,t,g]),D==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Xt(u),p=de(x?.loggedInUserRoleMap),W=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>De(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{T(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=Me(it,u),rt=_e(u),{remisProcessed:X,remisProcessing:he}=E(S=>Kt(S));f.useEffect(()=>{X===he&&c!=null&&(t(Qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:X>1?xe.reports:xe.report},{variableName:"_has_",variableValue:X>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(G,!0,l,!1,!0,!0))},3e3),m(null))},[X,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,N,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):N.entity_type==="reimbursement"&&(m(N.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Je,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[P==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(N=>N.trackPageLoaded(We.Event.reimbursementHome))(S)}):null,s.jsx(Ke,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx(On,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:G,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:$,...lt})]})]}):nt&&p?s.jsx(M,{to:"../setup"}):x!=null&&Ne(u,x.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Pn)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,ia=
|
|
68
|
+
`,ia=J(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=q(),t=Z(),{tenantEmailDomain:n}=Q(),r=qe(),[d,c]=f.useState(!1),m=E(A=>V(A)),o=O.getSignedInUserTenant(n)?.companyId??m.companyId,a=O.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),D=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,T=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&D?s.jsx(M,{to:"../../../reimbursements"}):w&&R?s.jsx(M,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&D===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(We.Event.reimbursementPromoPage))(A)}),s.jsx(Ke,{isAppContentDrawerOpen:d,handleDrawerToggle:T}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{T(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=qe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=Me(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),D=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=D&&u,{isFeatureEnabled:T}=m(k.isDepositAccountsFeatureEnabled),A=T&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),P=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=Q(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:w?s.jsx($n,{}):s.jsx(Mn,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:P,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:$??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Ne(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(M,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as p}from"./liveblocks-Dtw-cIpm.js";import{g as z,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-Bz75oBBS.js";import{eQ as L,fe as I,Kq as Te,jH as J,pZ as W,qO as F,jv as Re,iz as Oe,ub as X,qT as Ae,bs as Fe,Kr as ke,bn as De,vk as je,Ks as Ee,Kt as Pe,u3 as ve,Ku as H,Kv as Le,Kw as Me,Kx as Be,Ky as Ke,Kz as w,KA as k,KB as D,KC as Y,KD as j,KE as E,dD as Ve,v0 as Ue,uQ as q,uR as N,v6 as xe,uV as $,vc as ze,KF as Ge,KG as He,KH as Ye,KI as qe,KJ as Ne,e$ as $e,eZ as Ze}from"./zeni-epic-state-qHZitSu9.js";import{O as Qe,R as Je,W as We,X as Xe,J as ea,s as ee,U as P,z as ae,Y as aa,k as sa,a as ta,Z as oa,_ as na,x as ra,c as v,e as ia,$ as la,q as se,a0 as ca,a1 as da,a2 as pa}from"./index-CIlw72ZY.js";import"./mui-XIlJ9bNw.js";import ma from"./NotFoundScreen-i7in0PiQ.js";import{F as fa}from"./FeaturePreviewScreen-GFqoRAmW.js";import{a as _}from"./sentry-CcjRjG-d.js";import{u as ua}from"./useInitialThreadRequest-XlIrdlUc.js";import{t as Z,a as Q,b as _a}from"./routePaths-kzqCOAuK.js";import{M as ha}from"./MobileAppDrawer-B0EbhwTO.js";import"./recharts-P1XbTErv.js";import"./analytics-Dp5zEMRl.js";import"./plaid-HhKeWLGl.js";import"./dnd-CZ-V7Opk.js";import"./stripe-DMRn4zHo.js";import"./lottie-DCGoGDCc.js";import"./lexical-BhoV9klE.js";import"./pdf-DY4XXQdH.js";import"./utils-CSFJzIqP.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]="bcc68d0c-8e5d-45ee-b7b9-805b7d566323",e._sentryDebugIdIdentifier="sentry-dbid-bcc68d0c-8e5d-45ee-b7b9-805b7d566323")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ye()),e(qe()),e(Ne())},ga=we(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},t=I(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:v,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:c}=l;let i=[...f];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),f.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ke({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(ve()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),m=ea(),u=da(m),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:f}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),K=d(n=>J(n)),O=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),A=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(F(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!M&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,M,C,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(X());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,K,O]);const V=sa(),de=V?.loggedInUserRole!=null&&Fe(V?.loggedInUserRole)!==!0,[pe,me]=_.useState(!1),U=n=>{me(n)},fe=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=Qe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>x?ba:void 0,[x]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:v,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:ce,selectedReportID:R,analytics:v,filter:b,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&fe&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function xa(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(P.isDebitCardFeatureEnabled),u=$e(m,e),a=Ze(e);return u===!0||a===!0?p.jsx(fa,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(ma,{})})]})}export{xa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-Dtw-cIpm.js";import{s as j,z as w,aN as y,x as I,c as p,e as F,cQ as R,U as L}from"./index-CIlw72ZY.js";import"./mui-XIlJ9bNw.js";import l from"./NotFoundScreen-i7in0PiQ.js";import{a as u}from"./sentry-CcjRjG-d.js";import{u as P,j as b,h as T,g as U,n as V,o as z,p as d}from"./core-Bz75oBBS.js";import{eQ as A,Rf as C,NQ as Q,Rg as N,uH as Y,f5 as G,Rh as H,uF as O}from"./zeni-epic-state-qHZitSu9.js";import{R as x}from"./ReferralListScreen-B2Vroa_d.js";import"./recharts-P1XbTErv.js";import"./analytics-Dp5zEMRl.js";import"./plaid-HhKeWLGl.js";import"./dnd-CZ-V7Opk.js";import"./stripe-DMRn4zHo.js";import"./lottie-DCGoGDCc.js";import"./lexical-BhoV9klE.js";import"./pdf-DY4XXQdH.js";import"./utils-CSFJzIqP.js";import"./useAskAiCfoHostNavButtonProps-CiS8Thq0.js";import"./MobileAppDrawer-B0EbhwTO.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]="199caa9d-8e12-4a2f-8031-49f7d5ebc806",e._sentryDebugIdIdentifier="sentry-dbid-199caa9d-8e12-4a2f-8031-49f7d5ebc806")}catch{}})();const q=V(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(N()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(R),B=()=>{const e=P(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>A(o)),c=T(),_=U(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),k=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),D=Q(v);u.useEffect(()=>{e(N()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:_,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(z,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-8dZJcrjS.js","assets/sentry-CcjRjG-d.js","assets/core-Bz75oBBS.js","assets/zeni-epic-state-qHZitSu9.js","assets/index-CIlw72ZY.js","assets/mui-XIlJ9bNw.js","assets/analytics-Dp5zEMRl.js","assets/utils-CSFJzIqP.js","assets/withTransactionSidePanel-BwTwVibl.js","assets/useAskAiCfoHostNavButtonProps-CiS8Thq0.js","assets/TransactionDetailScreen-gxTWcgHw.js","assets/decodeURIComponentSafe-C4sdX50I.js","assets/routePaths-kzqCOAuK.js","assets/NotFoundScreen-i7in0PiQ.js","assets/useInitialThreadRequest-XlIrdlUc.js","assets/analyticsHelper-BsoPneRx.js","assets/CompanyPassportScreen-BuzhHe2C.js","assets/MobileAppDrawer-B0EbhwTO.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Dr7tCqEp.js","assets/FeaturePreviewScreen-GFqoRAmW.js","assets/ReferralListScreen-B2Vroa_d.js","assets/index-R6GjjTB3.css","assets/BillPayRoutes-nnUKPO5Y.js","assets/AddressScreen-Bah6Axto.js","assets/DomesticWireDetailScreen-uWwGtp2A.js","assets/DrawerScreen-C8n2HmP2.js","assets/SetupPagesScreen-BR7nlLcj.js","assets/BusinessVerificationPageScreen-BSCz_weX.js","assets/BillPayApprovalRoutes-8TDA8Ccp.js","assets/ReimbursementApprovalRuleDetailScreen-DID8ZBs6.js","assets/getLocaleForTenant-haKQ7Ka2.js","assets/ReimbursementRoutes-BxQKQK4v.js","assets/ReimbursementApprovalRoutes-eSS641gM.js","assets/TransactionListRoutes-BeJcfGnQ.js","assets/ZeniAccountStatementScreen-CeCApd4l.js","assets/SettingsRoutes-B-U88pFC.js","assets/accountMappingHelper-CQ-cPZ2Q.js","assets/QBOConnectionScreen-DuffYDWL.js","assets/empty-BOJvSC1K.js","assets/index-B580fqwk.js","assets/url-t5z6Dd8t.js","assets/index-uPeOzU7i.js","assets/ReportsRoutes-Crmtgf42.js","assets/ChargeCardRoutes-Ct92GkQR.js","assets/PeopleRoutes-Cm-tUsbs.js","assets/ExpenseAutomationRoutes-D87utETH.js","assets/TreasuryRoutes-D0pT4IIe.js","assets/VendorsRoutes-DEyltljX.js","assets/pathToGoBack-DF7meFK5.js","assets/ZeniAccountRoutes-hy9KXK0i.js","assets/AddressRoutes-CbBiqU38.js","assets/PandLWithForecastRoutes-CjBSrJEt.js","assets/CustomerOnboardingRoutes-6JIj5Uwx.js","assets/TransactionDetailRoutes-xbgQVU2q.js","assets/EntityDetailRoutes-HkIOiOiT.js","assets/NotificationRoutes-DrdoIjCe.js","assets/PerformanceRoutes-B6QkgqxQ.js","assets/RewardsRoutes-BmTO_Tbv.js","assets/TaskRoutes-DH15_wAa.js","assets/TaskListScreen-DKr0bX0e.js","assets/AiCfoScreen-D6w_JSwz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as n,bn as ts,eQ as is,e$ as rs,eZ as os,e_ as ls,fI as cs,eU as ds,cO as pe,cw as ms,ff as us,co as _s,bE as As,bo as ps,fk as Es,v as Is,JY as gs,bs as Ts,JZ as xs,bG as hs,fh as js,bF as Us,bt as Hs,ck as Rs,J_ as bs,J$ as Ds,cL as fs,cN as ys,cM as Cs,cv as vs,cB as Os,nf as Ee,eX as Ie,fS as Ps,fo as ge,fP as Te,fQ as xe,fp as Fs}from"./zeni-epic-state-qHZitSu9.js";import{j as e}from"./liveblocks-Dtw-cIpm.js";import{a as v}from"./sentry-CcjRjG-d.js";import{u as Ls,h as ks,i as Bs,g as Vs,j as G,l as he,N as c,o as Ss,p as t}from"./core-Bz75oBBS.js";import{m as Ns,u as Zs,z as R,s as Ms,a as ws,T as Gs,U as B,k as $s,L as F,D as je,t as _,P as zs,c as X,l}from"./index-CIlw72ZY.js";import"./mui-XIlJ9bNw.js";import{f as Ue}from"./analyticsHelper-BsoPneRx.js";import{t as Ys}from"./getLocaleForTenant-haKQ7Ka2.js";import"./recharts-P1XbTErv.js";import"./analytics-Dp5zEMRl.js";import"./plaid-HhKeWLGl.js";import"./dnd-CZ-V7Opk.js";import"./stripe-DMRn4zHo.js";import"./lottie-DCGoGDCc.js";import"./lexical-BhoV9klE.js";import"./pdf-DY4XXQdH.js";import"./utils-CSFJzIqP.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="5243499f-b482-47a4-bbae-3c020f83569f",i._sentryDebugIdIdentifier="sentry-dbid-5243499f-b482-47a4-bbae-3c020f83569f")}catch{}})();const Js={dashboard:()=>n(()=>import("./DashboardRoutes-8dZJcrjS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-nnUKPO5Y.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-BxQKQK4v.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-BeJcfGnQ.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-B-U88pFC.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-Crmtgf42.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-Ct92GkQR.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-Cm-tUsbs.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-D87utETH.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-D0pT4IIe.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-DEyltljX.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-hy9KXK0i.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Ws=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],K=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},qs=l(()=>n(()=>import("./ReportsRoutes-Crmtgf42.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Qs=l(()=>n(()=>import("./AddressRoutes-CbBiqU38.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>n(()=>import("./PeopleRoutes-Cm-tUsbs.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),Ks=l(()=>n(()=>import("./PandLWithForecastRoutes-CjBSrJEt.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-6JIj5Uwx.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-DEyltljX.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-xbgQVU2q.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>n(()=>import("./EntityDetailRoutes-HkIOiOiT.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),an=l(()=>n(()=>import("./DashboardRoutes-8dZJcrjS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),Re=l(()=>n(()=>import("./BillPayRoutes-nnUKPO5Y.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),tn=l(()=>n(()=>import("./SettingsRoutes-B-U88pFC.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),be=l(()=>n(()=>import("./ReimbursementRoutes-BxQKQK4v.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-hy9KXK0i.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-D0pT4IIe.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-BeJcfGnQ.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-Ct92GkQR.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-DrdoIjCe.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),mn=l(()=>n(()=>import("./PerformanceRoutes-B6QkgqxQ.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),un=l(()=>n(()=>import("./ExpenseAutomationRoutes-D87utETH.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-BmTO_Tbv.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),An=l(()=>n(()=>import("./TaskRoutes-DH15_wAa.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-D6w_JSwz.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),f=l(()=>n(()=>import("./NotFoundScreen-i7in0PiQ.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),En=l(()=>n(()=>import("./TaskListScreen-DKr0bX0e.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:i}){const U=Ls(),V=ks(),{tenantEmailDomain:o}=Bs(),S=Ns().mode,{setLoading:y,clearAllLoading:O,clearLoading:M}=Zs(),D=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),ee=ts(h),$=Vs(),[N,fe]=v.useState(!1),r=G(a=>is(a)),{useFeatureGate:L}=Ms(),q=ws(),se=Gs(),{isFeatureEnabled:ye}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ce}=L(B.isTreasuryEnabled),{isFeatureEnabled:ve}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=L(B.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),p=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=p==="Completed"||j==="Completed"?rs(ne,r):void 0,z=p==="Completed"||j==="Completed"?os(r):void 0,Oe=p==="Completed"||j==="Completed"?ls(r):void 0,Pe=ve||ne||!!Oe||!!z||!!u,{isFeatureEnabled:Fe}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:Le}=L(B.isAiCfoFileUploadEnabled),Y=G(a=>cs(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&Ue(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ae=ds(),A=$s(),ke=r.company==null||A?.loggedInUserRoleMap!=null&&pe(A.loggedInUserRole),Be=ms(A?.loggedInUserRoleMap),te=v.useRef(!0),ie=he("/:tenantEmailDomain/onboarding/*")!==null,Q=he("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(a=>w.tenantId!=null?us(a,w.tenantId):void 0);v.useEffect(()=>{y(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&D!=null){const a=Q.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=_s(Number(H[0])),s=Number(H[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,je.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=ps();m.isAfter(Z,"month")===!1?U(Es(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,D]),v.useEffect(()=>{N||(fe(!0),y(F.TENANT_FETCHING)),te.current?te.current=!1:!Is(ae,w)&&R.isSignedIn()&&(y(F.TENANT_FETCHING),function(a,H,d,s){if(Ie(H?.userId,H?.zeniSessionId,a.tenantId),d(Ps(!0)),d(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&je.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Ve))},[w,ae,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(y(F.TENANT_FETCHING),function(a,H,d,s,m,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const J=s!=null&&m?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,as=d!=null&&d.externalConnections==null;if(J&&ss){k(ge(s));const W=R.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(W?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else J&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),J&&as&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(J){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Fs(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,p,r,D,h,y,U))},[D,p]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(M(F.TENANT_FETCHING),R.saveSignedInUserTenants(gs(Y.tenantsBaseInOrder)),h!=null&&Ue(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{p==="In-Progress"&&y(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),M(F.TENANT_FETCHING),M(F.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[p,j,D,N]);const re=v.useRef(!1);v.useEffect(()=>{!re.current&&p==="Completed"&&N&&(re.current=!0,function(a=Ws,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],Z=Js[m];Z!=null?Z().then(()=>K(()=>d(s+1))).catch(()=>K(()=>d(s+1))):d(s+1)};K(()=>d(0))},H)}())},[p,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ne=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),oe=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,le=Pe&&!C,Me=xs(A?.loggedInUserRoleMap),we=r.externalConnections?.accounting[0]?.isValid,ce=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,me=de&&hs(A?.loggedInUserRoleMap),ue=ye&&!C,Ge=r.company!=null&&js(r.company),$e=Ce&&Ge===!0&&!C,ze=oe&&Us(A?.loggedInUserRoleMap),Ye=le&&Hs(A?.loggedInUserRoleMap),Je=ue&&Rs(A?.loggedInUserRoleMap),We=bs(A?.loggedInUserRoleMap),qe=Ds(A?.loggedInUserRoleMap),E=fs(A?.loggedInUserRoleMap),I=ys(A?.loggedInUserRoleMap),g=Cs(A?.loggedInUserRoleMap),T=vs(A?.loggedInUserRoleMap),x=Os(A?.loggedInUserRoleMap),_e=oe&&T,Ae=de&&x,Qe=ue&&E,Xe=$e&&I,Ke=le&&g,es=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Be===!0||Me===!0||We===!0||qe===!0;return R.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||j==="Completed"?(ce===!0||ee&&!ie)&&we===!1&&u===!1&&z===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||ce!==!1||ie||ee?N&&r?.userRole&&u!=null&&z!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Ss,{children:e.jsxs(t,{element:e.jsx(zs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(In,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:z})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(an,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(qs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:es||P?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Ne||Ze?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(ln,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(En,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(An,{})}),e.jsx(t,{path:"address/*",element:ze||me||Je||Ye?e.jsx(Qs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Qe?e.jsx(rn,{}):e.jsx(f,{})}),e.jsx(t,{path:"treasury/*",element:Xe?e.jsx(on,{}):e.jsx(f,{})}),e.jsx(t,{path:"performance",element:se===!0?e.jsx(mn,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:se===!0&&C===!1?e.jsx(un,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(t,{path:"vendors/*",element:ke?e.jsx(sn,{}):e.jsx(f,{})}),e.jsx(t,{path:"bill/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ae?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ae?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Fe?e.jsx(tn,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(t,{path:"cards/*",element:Ke?e.jsx(cn,{}):e.jsx(f,{})}),e.jsx(t,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo",element:q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/",element:q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:q?e.jsx(pn,{isFileUploadEnabled:Le}):e.jsx(f,{})}),e.jsx(t,{path:"*",element:e.jsx(f,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const In=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:y,isTenantBankingOnly:O,isTenantCardsOnly:M})=>O===!0&&U?e.jsx(c,{to:"checking"}):M===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):y?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(hn,{tenantEmailDomain:O}):S?e.jsx(xn,{tenantEmailDomain:O}):U?e.jsx(jn,{tenantEmailDomain:O}):V?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(gn,{tenantEmailDomain:O}):e.jsx(f,{}),gn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Tn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),xn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),De=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{b as FallBackRoute,Nn as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-Dtw-cIpm.js";import{a as p}from"./sentry-CcjRjG-d.js";import{h as z,g as K,u as M,j as h,t as se,n as $,i as Z,o as J,p as I}from"./core-Bz75oBBS.js";import{bn as Ee,eQ as P,fN as Ae,m4 as we,Or as ve,gO as ue,M1 as je,pZ as ke,jH as pe,l_ as Pe,gQ as Te,M3 as Me,M2 as De,Os as Ue,yi as _e,CN as Oe,O0 as Fe,O9 as Be,c1 as ee,cG as Re,cH as ze,K8 as Ve,Ot as Le,K9 as Ne,wK as Ke,Ou as $e,F9 as Ze,Ct as Ge,Ck as ge,Ch as qe,wO as me,Cn as he,Cq as fe,Cw as ne,tb as te,wN as He,jj as X,jm as be,Ov as Qe,kn as Ye,x1 as Je,KY as Xe,KZ as We,jh as en,Ow as nn,jk as tn,qr as an,Ox as on,Oy as sn,qv as cn,gy as ln,Kh as Y,gn as rn,gu as dn,Ki as un,w_ as pn,Oz as gn,OA as mn,CK as hn,eZ as Se,e$ as Ce,OB as fn,fB as bn,Kr as Sn,wZ as ie,fG as ce,fF as Cn,wY as yn,fE as In,fD as xn,OC as En,f2 as ye,OD as An,OE as wn,x4 as vn,wX as le,OF as jn,fj as kn,wU as Pn,bU as Tn,c0 as Mn,b$ as Dn,bV as Un,bZ as _n,bY as On,bX as Fn,b_ as Bn,bW as Rn}from"./zeni-epic-state-qHZitSu9.js";import{s as ae,U as O,z as A,af as Ie,bK as zn,c as Q,e as Vn,k as G,B as oe,bL as Ln,bM as Nn,aq as Kn,h as xe,bN as $n,bO as Zn,bP as Gn,a9 as qn,Y as Hn,bQ as Qn,q as Yn,bR as Jn}from"./index-CIlw72ZY.js";import{n as F}from"./mui-XIlJ9bNw.js";import{M as D}from"./MobileAppDrawer-B0EbhwTO.js";import{a as q,g as H,m as Xn}from"./accountMappingHelper-CQ-cPZ2Q.js";import{t as Wn,A as et}from"./AddressScreen-Bah6Axto.js";import N from"./NotFoundScreen-i7in0PiQ.js";import{g as nt}from"./analyticsHelper-BsoPneRx.js";import{B as tt}from"./BusinessVerificationPageScreen-BSCz_weX.js";import{C as at}from"./CompanyPassportScreen-BuzhHe2C.js";import{q as re}from"./QBOConnectionScreen-DuffYDWL.js";import{B as ot}from"./BillPayApprovalRoutes-8TDA8Ccp.js";import{R as st}from"./ReimbursementApprovalRoutes-eSS641gM.js";import"./recharts-P1XbTErv.js";import"./analytics-Dp5zEMRl.js";import"./plaid-HhKeWLGl.js";import"./dnd-CZ-V7Opk.js";import"./stripe-DMRn4zHo.js";import"./lottie-DCGoGDCc.js";import"./lexical-BhoV9klE.js";import"./pdf-DY4XXQdH.js";import"./utils-CSFJzIqP.js";import"./routePaths-kzqCOAuK.js";import"./empty-BOJvSC1K.js";import"./pdf-lib-BwfYoiDb.js";import"./index-B580fqwk.js";import"./url-t5z6Dd8t.js";import"./index-uPeOzU7i.js";import"./decodeURIComponentSafe-C4sdX50I.js";import"./ReimbursementApprovalRuleDetailScreen-DID8ZBs6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f21ba742-8b14-4fd0-b507-d3f203796fd2",e._sentryDebugIdIdentifier="sentry-dbid-f21ba742-8b14-4fd0-b507-d3f203796fd2")}catch{}})();const it=F.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,ct=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:pe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ke(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizationThreshold:t.capitalizationThreshold,capitalizationThresholdMaxCeiling:t.capitalizationThresholdMaxCeiling,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationThresholds:t.onSaveCapitalizationThresholds}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:w}=u,{prepaidExpensesAccount:x,fixedAssetsAccount:v,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:U}=m,E=q(t.accountMappingView.incomeAccountList,f.selectedOption),B=q(t.accountMappingView.expenseAccountList,g.selectedOption),V=q(t.accountMappingView.billPayAccountList,l.selectedOption),L=q(t.accountMappingView.reimbursementsAccountList,w.selectedOption),R=H(t.accountMappingView.prepaidExpensesAccountList,x.selectedOptions),b=H(t.accountMappingView.fixedAssetsAccountList,v.selectedOptions),T=H(t.accountMappingView.accruedExpensesAccountList,S.selectedOptions),C=H(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),j=Xn(t.accountMappingView.expenseAccounts1099FilingAccountList,U),_={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:B?.accountId,selectedBillPayAccountId:V?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:R.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:T.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:C.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:j};e(De({data:_}))},onBackClick:()=>{Ie(r)===!1?(s("../../dashboard"),e(Me())):e(ue())},onSaveClick:()=>{e(Te()),i&&Q.track(Vn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Pe(t.currentTenant.companyId,n))}}})(zn),lt=()=>{const e=z(),t=K(),s=M(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(O.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=A.getSignedInUser(),f=Ee(m),g=h(C=>P(C)),{capitalizableAccounts:l,capitalizationThreshold:w,capitalizationThresholdMaxCeiling:x,isCapitalizationThresholdSaving:v,currencySymbol:S}=h(C=>{const j=C.tenantState.currentTenantId,_=j!=null?C.tenantState.tenantsById[j]:void 0,k=Ae(C.companyState,g.companyId);return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizationThreshold:_?.capitalizationThreshold??null,capitalizationThresholdMaxCeiling:_?.capitalizationThresholdMaxCeiling??null,isCapitalizationThresholdSaving:C.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:k?.company.companyLocaleInfo?.currencySymbol??"$"}},se),y=p.useCallback((C,j)=>{s(we(g.companyId,C,j))},[s,g.companyId]),U=h(C=>ve(C.accountState),se),E=p.useMemo(()=>{const C={};for(const j of U)j.accountId!=null&&j.accountName!=null&&(C[j.accountId]=j.accountName);return C},[U]),[B,V]=p.useState(!1),[L,R]=p.useState(!1);p.useEffect(()=>{B===!1&&(s(ue()),V(!0))},[B]);const b=h(C=>je(C)),T=C=>{R(C)};return o.jsxs(it,{children:[o.jsx(D,{isAppContentDrawerOpen:L,handleDrawerToggle:T}),o.jsx(ct,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:E,capitalizationThreshold:w,capitalizationThresholdMaxCeiling:x,currencySymbol:S,isCapitalizationThresholdSaving:v,onSaveCapitalizationThresholds:y,location:t,isSettings:Ie(t),onClickMenuIcon:()=>T(!0)})]})},rt=F.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,dt=$(function(e,t){const s=P(e),r=Fe(e),i=Be(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:Q}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Ln),ut=()=>{const e=z(),t=K(),s=M(),{tenantEmailDomain:r}=Z(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(S=>P(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),g=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Ue(S)),w=m.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const x=G();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),s(_e(!0)))},[u,f,s]),p.useEffect(()=>{a||g!=="Not-Started"||(c(!0),s(Oe(!0)))},[a,g,s]);const v=S=>{n(S)};return x?.loggedInUserRoleMap!=null?o.jsxs(rt,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(dt,{navigate:e,location:t,companyId:w,currentTenant:m,roleMap:x.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},pt=F.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 1 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,gt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=P(e);return{bankSetupView:$e(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:Q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(fe(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(he(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(me(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?ge(n,a,c,u):qe(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(Ge(i,a,n,c))},onRemoveConnection:n=>{e(Ze(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Nn),mt=()=>{const e=z(),t=K(),s=M(),{tenantEmailDomain:r}=Z(),i=G(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>P(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=Re(d,i?.loggedInUserRoleMap),g=ze(d,i?.loggedInUserRoleMap),l=Ve(d,i?.loggedInUserRoleMap),w=Le(d,i?.loggedInUserRoleMap),x=Ne(d,i?.loggedInUserRoleMap),v=d.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ke(!1)))},[c,s,m]);const S=y=>{a(y)};return f||l||g||x?o.jsxs(pt,{children:[o.jsx(D,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),o.jsx(gt,{navigate:e,location:t,companyId:v,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:x,isTreasuryEnabled:w,onClickMenuIcon:()=>{S(!0)}})]}):o.jsx(N,{})},ht=F.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
height: 100%;
|
|
28
|
+
width: 100%;
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
`,ft=$(function(e,t){const{companyId:s}=t,r=P(e),i=t.roleMap.bill_pay_admin,n=Qe(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:xe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:Q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(me("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(fe(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(he(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(ge(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(be(n))},handleConfirmCardSetupIntent:n=>{e(tn(n))},updateCardPaymentModalState:n=>{e(nn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(en(n,a,c))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(We())},handleResetCardPaymentErrorStatuses:()=>{e(Xe())},onBillingAddressSave:n=>{e(Je(n))},onAddressEditHandler:n=>{if(n!=null){const a=Wn(n);e(Ye({addressType:"subscription_billing_address",addressToCreate:a}))}}}})($n),bt=()=>{const e=z(),t=K(),s=M(),{tenantEmailDomain:r}=Z(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>P(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Kn(f.addCardPaymentSourceStatus.fetchState),w=f.addCardPaymentSourceStatus.fetchState,x=m.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const v=G();p.useEffect(()=>{x!=null&&s(He(x,!1))},[x,s]),p.useEffect(()=>{a||(c(!0),s(X()))},[a,s]),p.useEffect(()=>{u||(be(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&w==="Completed"&&s(X())},[l,w]);const S=y=>{n(y)};return v?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),o.jsx(ft,{navigate:e,location:t,companyId:x,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:xe.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},W="external_integrations",St=$(function(e){const t=sn(e,W);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(pn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(dn(a,d,Y("revenue"),un("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(rn(a,c,Y(u)))},onSaveConnectorCredentials:c=>{e(ln(a,Y("payments"),c))},onNotifyMe:c=>{e(cn(W,c,i))}}})(Zn),Ct=()=>{const e=z(),t=M(),{tenantEmailDomain:s}=Z(),[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>P(l)),c=a.companyId??A.getSignedInUserTenant(s)?.companyId,u=A.getSignedInUser(),d=G(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(an(W))},[t]);const f=l=>{i(l)},g=h(l=>on(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(yt,{children:[o.jsx(D,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(St,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,w])=>[l,w?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},yt=F.div`
|
|
34
|
+
display: flex;
|
|
35
|
+
height: 100%;
|
|
36
|
+
width: 100%;
|
|
37
|
+
flex: 1 1 auto;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
+
`,It=F.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
height: 100%;
|
|
44
|
+
width: 100%;
|
|
45
|
+
flex: 1 1 auto;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
+
`,xt=()=>{const e=M(),{tenantEmailDomain:t}=Z(),[s,r]=p.useState(!1),i=h(l=>P(l)).companyId??A.getSignedInUserTenant(t)?.companyId,n=A.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>gn(l,n.userId)),c=h(l=>mn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(hn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(It,{children:[o.jsx(D,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Gn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Et=F.div`
|
|
50
|
+
display: flex;
|
|
51
|
+
height: 100%;
|
|
52
|
+
width: 100%;
|
|
53
|
+
flex: 1 1 auto;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
align-items: center;
|
|
56
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
+
`,de=({appContent:e})=>{const t=M(),s=z(),r=K(),[i,n]=p.useState(!1),a=h(b=>P(b)),{tenantEmailDomain:c}=a,u=a.companyId??A.getSignedInUserTenant(c)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(O.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(O.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(O.isTreasuryEnabled),w=h(b=>pe(b)),x=Se(a),v=Ce(g,a),S=!v&&w,y=qn(a,f,g),{areTenantIdsInSync:U}=Hn();p.useEffect(()=>{U&&t(fn(u,S))},[u,t,S,U]);const E=h(b=>bn(b,S)),B=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||u==null,V=Sn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,R=b=>{n(b)};return o.jsxs(Et,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:R}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Qn,{myProfileView:E,isAccountingClassesEnabled:w,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:V===!1,onClickMenuIcon:()=>{R(!0)},isLoading:B,isBankingOnlyTenant:v,isCardsOnlyTenant:x,onAddressClick:b=>{const T=function(j,_){let k=`/${j}/settings/my_profile`;return k=k.concat(`/new/${_}`),k}(c,b),C=Yn(r.state?.pathnameStackToGoBack,r.pathname);s(T,{state:{pathnameStackToGoBack:C}})},onGetOtp:b=>{const T={...E.myProfileLocalData,phone:b};t(ie({localData:T})),t(xn(b,"MyProfile"))},onResendOtp:b=>{t(In(b,"MyProfile"))},onCancelClick:()=>{t(yn())},onSaveClick:()=>{t(ce("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(b,T)=>{t(Cn(b,T,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&A.saveZeniOtpToken(b),t(ce("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(ie({localData:b}))}})]})};function At(){const e=M(),t=h(l=>P(l)).companyId,s=h(l=>En(l)),r=h(l=>ye(l)),i=A.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(An(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(wn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(vn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(le(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(jn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(le(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(D,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(Jn,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function sa(e){const[t,s]=p.useState(!1),r=h(l=>ye(l)),i=h(l=>P(l)),n=G(),a=A.getSignedInUser(),c=M(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(O.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||kn(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Pn()))},[r.fetchState,t]);const f=Ce(d,i),g=Se(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(J,{children:[Mn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"accounting/*",element:o.jsx(lt,{})}),Dn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"approval_rules/*",element:o.jsx(wt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Un(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"my_bank_connections",element:o.jsx(xt,{})}),_n(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"bank_connections",element:o.jsx(mt,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"business_verification",element:o.jsx(tt,{productType:f?"zeni_accounts":g?"charge_cards":nt(i,n?.loggedInUserRoleMap)})}),Fn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"company_details",element:o.jsx(at,{})}),Bn(n?.loggedInUserRole??[],i)&&o.jsx(I,{path:"billing",element:o.jsx(bt,{})}),Rn(n?.loggedInUserRole??[],d,i)&&o.jsx(I,{path:"integrations",element:o.jsx(Ct,{})}),o.jsx(I,{path:"my_profile/new/:addressType",element:o.jsx(de,{appContent:o.jsx(et,{isSubPage:!1})})}),o.jsx(I,{path:"my_profile",element:o.jsx(de,{})}),m&&o.jsx(I,{path:"notifications",element:o.jsx(At,{})}),o.jsx(I,{path:"*",element:o.jsx(N,{})})]}):o.jsx(J,{children:o.jsx(I,{path:"*",element:o.jsx(N,{})})}):null}function wt(e){return o.jsxs(J,{children:[o.jsx(I,{path:"/",element:o.jsx(ut,{})}),o.jsx(I,{path:"bills/approval-rules/*",element:o.jsx(ot,{})}),o.jsx(I,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(st,{}):o.jsx(N,{})}),o.jsx(I,{path:"*",element:o.jsx(N,{})})]})}export{sa as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-Dtw-cIpm.js";import{h as Q,g as X,u as Y,i as W,j as E,N,n as G,s as Xe}from"./core-Bz75oBBS.js";import{bF as Ye,ck as Ie,NQ as ye,eQ as V,cw as en,yt as Z,yi as nn,O0 as tn,O3 as an,qK as ee,qy as ne,kf as te,sJ as z,O5 as Ae,fF as $e,fE as We,fD as Ge,O6 as sn,yC as on,Ct as ke,Ck as _e,Ch as ve,C8 as K,Cn as Pe,Cq as Ee,Cw as we,tb as Te,fU as cn,cr as rn,e$ as un,eZ as dn,e_ as ln,bt as pn,O7 as mn,Ba as le,BO as yn,O8 as fn,bG as gn,DJ as pe,CN as Sn,O9 as bn,Oa as hn,DN as Cn,DR as In,sC as An,Ih as kn,Em as Ce,Fn as me,Ob as _n,Oc as vn,Od as Pn,Oe as He,Of as En,KL as wn,Nd as Tn,KX as Dn,Og as qe,Oh as Be,EI as Ke,kn as On,qB as Je,sL as Un,bE as je,sX as Ne,cu as Fn,Oi as Qe,fi as Bn,E4 as Vn,E8 as xn,Oj as jn,Ep as Re,Ok as Nn,Ol as Rn,Om as zn,On as Ln,fN as Mn,zN as Zn,Oo as $n,zS as Wn,zR as Gn}from"./zeni-epic-state-qHZitSu9.js";import{k as ae,s as ie,U as de,m as De,aN as J,z as w,x as se,c as T,B as Oe,e as $,bz as Hn,at as oe,bA as x,bB as qn,bC as Kn,af as xe,bD as Jn,q as ze,au as Le,J as Qn,A as Xn,bE as Yn,bF as et,bG as nt,a7 as tt}from"./index-CIlw72ZY.js";import{a as C}from"./sentry-CcjRjG-d.js";import{n as Ve,D as at,S as it}from"./mui-XIlJ9bNw.js";import{M as fe}from"./MobileAppDrawer-B0EbhwTO.js";import R from"./NotFoundScreen-i7in0PiQ.js";import{a as Me}from"./analyticsHelper-BsoPneRx.js";import{d as Ze}from"./routePaths-kzqCOAuK.js";import{B as Fe}from"./BusinessVerificationPageScreen-BSCz_weX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c26bf649-4874-48dd-bf45-374b84bf5337",e._sentryDebugIdIdentifier="sentry-dbid-c26bf649-4874-48dd-bf45-374b84bf5337")}catch{}})();const st=Ve.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,ot=G(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=tn(e),i=w.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(Ge(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Hn),ct=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=Ye(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=De(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(F=>F.billPaySetupViewState.fetchState),A=E(F=>V(F)),_=E(F=>F.billPaySetupApproverViewState.fetchState),b=A.companyId??w.getSignedInUserTenant(a)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const D=F=>{S(F)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(N,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const F=O=>O.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:T,onLoad:O=>F(O)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:D}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{D(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Rt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Gt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Ht=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Jt=80,Qt=80,Xt=e=>e.companyId??w.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Yt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,ea=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=G(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=w.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{T.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(Te("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{T.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);T.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;T.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:x(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=E(L=>V(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),D=A&&h===!1,F=A===!1&&h,O=ye(r),B=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),j=w.getSignedInUserTenant(a)?.companyId??n.companyId,U=w.getSignedInUser(),Ue=L=>{ge(L)},Se=E(L=>mn(L,j));if(U==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||M!=="Not-Started"||j==null?q||M!=="Completed"||j==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(j,!1,!0)):(re(!0),t(le(j,!0)))},[q,M,j,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:()=>{T.trackPageLoaded($.Event.cardsSetupVisited),T.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Ue}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:j,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:B,isDebitCardOnlyEnabled:D,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:O})]}):u.jsx(Oe,{fetchState:"Not-Started"}):u.jsx(N,{to:"../promo"})},mt=Ve.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,yt=G(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=bn(e),i=hn(e,a),l=w.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),T.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),{useDynamicConfig:n}=ie(),i=De(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>V(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=w.getSignedInUserTenant(a)?.companyId??g.companyId,A=w.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(N,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:T,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=G(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Tn(e.companyConfigState),p=Dn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:D,companySubIndustry:F,countriesOfOperations:O,companySourceOfFunds:B,companySourceOfFundsDescription:ce,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:j,usNexus:U,usNexusTypes:Ue}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Fn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?je(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:D?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:O?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:B?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:j,usNexus:U,usNexusTypes:Ue?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(Ne({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:F}=p;let O;return A.selectDocumentType==="driverLicense"?O="driving_license":A.selectDocumentType==="passport"?O="passport":A.selectDocumentType==="stateId"?O="id_document":A.selectDocumentType==="ssnCard"&&(O="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?je(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:O,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Ne({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(Un({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Be())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=X(),n=Y(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=W(),I=ae(),{useDynamicConfig:d}=ie(),m=De(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>V(h)),_=A.companyId??w.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),w.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let D;switch(e){case"zeni_accounts":D=En(h,_);break;case"zeni_treasury":D=He(h,_);break;case"charge_cards":D=Pn(h,_);break;case"reimbursement":D=vn(h,_);break;default:D=_n(h,_)}return D});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:h=>(D=>{switch(e){case"zeni_accounts":return D.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return D.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return D.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:T,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Xn(100,100,59)},ht=G(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=w.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=He(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=jn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(Te("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Re(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(Nn(s))},onConfirmFundAllocation:()=>{e(Re(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Be())}}})(Yn),Ct=()=>{const e=Q(),o=X(),t=Y(),a=De(),c=Qn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(U=>U.treasurySetupViewState.fetchState),h=E(U=>U.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),D=E(U=>U.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=E(U=>U.treasuryDetailState.transactionsState?.fetchState),O=E(U=>V(U)),B=w.getSignedInUserTenant(n)?.companyId??O.companyId,ce=E(U=>Qe(U,B)),H=ce.isAtomicAccountExists,ge=!!O.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=w.getSignedInUser(),re=U=>{m(U)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||B==null||(v(!0),t(Ce(B,!0,!1)))},[S,k,B,t]),C.useEffect(()=>{g||h!=="Not-Started"||B==null||(f(!0),t(Bn()))},[g,h,B,t]),C.useEffect(()=>{P||D!=="Not-Started"||B==null||(A(!0),t(Vn()))},[P,D,B,t]),C.useEffect(()=>{_||F!=="Not-Started"||B==null||(b(!0),t(xn(!0)))},[_,F,B,t]);const M=O.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||H||j||!o.pathname.includes("setup")||r(!0)},[k,H,j]),O.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(N,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(Be()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:U=>U.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Be()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:B,currentTenant:O,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:H,analytics:T,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Ve(it)`
|
|
18
|
+
display: flex;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
`,At=G(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Te("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=Q(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>V(f)),S=w.getSignedInUserTenant(a)?.companyId??m.companyId,v=w.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(N,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Ve.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
+
`,vt=G(function(e,o){const t=V(e),a=w.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:T}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Gn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=X(),t=Y(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>V(k)),v=De(),g=S.companyId??w.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),w.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(N,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:T,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:T,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=G(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Fe,{productType:s}):t?u.jsx(N,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(N,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ct,{}):t?u.jsx(N,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(R,{}):a?u.jsx(ft,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(kt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(N,{to:"../"}):u.jsx(R,{}):i?u.jsx(pt,{}):l?u.jsx(N,{to:"../"}):u.jsx(R,{})}}));function na(e){const{tenantEmailDomain:o}=W(),t=E(c=>V(c)).companyId??w.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(w.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Jt as A,Qt as P,na as S,Ht as a,Kt as b,ut as c,dt as d,rt as e,Xt as f,Zt as g,zt as h,Gt as i,qt as j,Yt as k,Wt as l,$t as m,Lt as n,Mt as o,Rt as p,ea as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-Dtw-cIpm.js";import{a as u,b as T,q as A}from"./sentry-CcjRjG-d.js";import{u as D,h as z,j as l,g as M,N as O,n as j}from"./core-Bz75oBBS.js";import{u as P,z as s,m as F,c as E,D as K,d as _,e as B,I as J,g as N,f as V,h as v}from"./index-CIlw72ZY.js";import{eQ as X,JX as $,JY as q,eX as Q,fo as W,K1 as H,fM as Y,cS as G,K2 as y,K3 as R,K4 as Z,bT as b}from"./zeni-epic-state-qHZitSu9.js";import"./mui-XIlJ9bNw.js";import{u as ee}from"./useDeviceId-iq2z2ZGf.js";import{f as te}from"./analyticsHelper-BsoPneRx.js";import{t as ne}from"./getLocaleForTenant-haKQ7Ka2.js";import"./recharts-P1XbTErv.js";import"./analytics-Dp5zEMRl.js";import"./plaid-HhKeWLGl.js";import"./dnd-CZ-V7Opk.js";import"./stripe-DMRn4zHo.js";import"./lottie-DCGoGDCc.js";import"./lexical-BhoV9klE.js";import"./pdf-DY4XXQdH.js";import"./utils-CSFJzIqP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="4f5d0467-db9f-482b-aaf2-4a57fbb64c7d",t._sentryDebugIdIdentifier="sentry-dbid-4f5d0467-db9f-482b-aaf2-4a57fbb64c7d")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:b(c),sourceUri:b(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(R(n,a)))},clearSignInError:()=>{t(y())}}})(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),L=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>X(e)),I=l(e=>$(e)),m=M(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[h.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(I.tenantsInOrder),o.zeniSessionId),Q(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),K.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Y().then(()=>{const e=N();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",G(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(J,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
|