@zeniai/web-app-ui 5.0.8-qa → 5.0.9-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-CL334upZ.js +1 -0
- package/dist/assets/AddressScreen-Dnqvk39f.js +9 -0
- package/dist/assets/{AiCfoScreen-BfR_WAUY.js → AiCfoScreen-DZh-dzaC.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-OpE7S5Ra.js → BillPayApprovalRoutes-Dks0BYHS.js} +1 -1
- package/dist/assets/{BillPayRoutes-axo-SKgc.js → BillPayRoutes-DyYN5q_F.js} +8 -8
- package/dist/assets/{BusinessVerificationPageScreen-D5XmscRr.js → BusinessVerificationPageScreen-DbNtBlq9.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-viH2izFk.js → ChargeCardRoutes-DDzL8gpY.js} +8 -8
- package/dist/assets/CompanyPassportScreen-CtaJgM_D.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-CL2Yh8zj.js → ConnectionAuthScreen-BwirMqZq.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DSGPVAAz.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BS7CY5PQ.js → CustomerOnboardingRoutes-5AwlPOlH.js} +3 -3
- package/dist/assets/{DashboardRoutes-B8ZUfp35.js → DashboardRoutes-BPkQitQx.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CmxoCLw7.js → DefaultTenantHome-D_Gz32KF.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Cet8eqve.js +18 -0
- package/dist/assets/DrawerScreen-C5Pyoiiy.js +1 -0
- package/dist/assets/{EntityDetailRoutes-D_BEywu_.js → EntityDetailRoutes-CVOtLlxx.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-9lDNU9cs.js → ExpenseAutomationRoutes-D-ShrGPq.js} +5 -5
- package/dist/assets/FeaturePreviewScreen-Esm95F3O.js +1 -0
- package/dist/assets/MagicLinkRoutes-CWz8FVdT.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-Dy9ZVfaY.js +12 -0
- package/dist/assets/{MobileAppDrawer-BkI4pCp1.js → MobileAppDrawer-DVs4kZOY.js} +1 -1
- package/dist/assets/NotFoundScreen-C3zjg2pa.js +1 -0
- package/dist/assets/{NotificationRoutes-DUO3WvcP.js → NotificationRoutes-CW6WHRSZ.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-JcUTTxdM.js +1 -0
- package/dist/assets/PeopleRoutes-B-S9keOO.js +22 -0
- package/dist/assets/PerformanceRoutes-CNYDT1z6.js +1 -0
- package/dist/assets/{Preview-C-TyETku.js → Preview-DYcWSu_p.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BfooSrpS.js → QBOConnectionScreen-CoK1XecU.js} +1 -1
- package/dist/assets/{ReferralListScreen-BHutPF6F.js → ReferralListScreen-H3ugCkel.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-Dif6cOro.js → ReimbursementApprovalRoutes-BU7MjFhQ.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B0Q8zt66.js → ReimbursementApprovalRuleDetailScreen-BcC01mNe.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CjQsA-jF.js → ReimbursementRoutes-D3zYz8wy.js} +6 -6
- package/dist/assets/{ReportsRoutes-lxuzl_Wx.js → ReportsRoutes-CljixoPv.js} +1 -1
- package/dist/assets/RewardsRoutes-dtSU2rm8.js +1 -0
- package/dist/assets/ScreenRoutes-98svW53l.js +2 -0
- package/dist/assets/{SettingsRoutes-D0rY2sqY.js → SettingsRoutes-otH5iG80.js} +6 -6
- package/dist/assets/{SetupPagesScreen-xsDN3gQY.js → SetupPagesScreen-BXNBjv3j.js} +5 -5
- package/dist/assets/SignInScreen-YVvbAXIF.js +1 -0
- package/dist/assets/SignOutScreen-CvxeJUO0.js +9 -0
- package/dist/assets/{TaskListScreen-Gh2BcJf5.js → TaskListScreen-DBwhGgZH.js} +2 -2
- package/dist/assets/TaskRoutes-D21v8ON-.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BwPxRt-X.js +1 -0
- package/dist/assets/{TransactionDetailScreen-B3XLOPyj.js → TransactionDetailScreen-v_iRnLm6.js} +2 -2
- package/dist/assets/{TransactionListRoutes-D5xKomzr.js → TransactionListRoutes-DelEkqAU.js} +1 -1
- package/dist/assets/TreasuryRoutes-DkznvHgV.js +37 -0
- package/dist/assets/{VendorsRoutes-iE2oE5sx.js → VendorsRoutes-CmyeEzqo.js} +10 -10
- package/dist/assets/WiseConfirmationScreen-wKVEK2GQ.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C0ogwbuf.js → ZeniAccountRoutes-XGCXjBgv.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-BxqDty2m.js +9 -0
- package/dist/assets/{accountMappingHelper-CMyHY-D8.js → accountMappingHelper-BmWub9rZ.js} +1 -1
- package/dist/assets/{analytics-BnogYQPW.js → analytics-Fp0p9zzF.js} +1 -1
- package/dist/assets/{analyticsHelper-VcinlAtN.js → analyticsHelper-B5vDoHXs.js} +1 -1
- package/dist/assets/{core-kCJNxrqK.js → core-BxynaUfL.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-o2pxqUNn.js → decodeURIComponentSafe-C4CdHegQ.js} +1 -1
- package/dist/assets/{dnd-BFDNLN4d.js → dnd-DTmBUnLk.js} +1 -1
- package/dist/assets/{empty-CT-qhBXX.js → empty-BCapHP-3.js} +1 -1
- package/dist/assets/{empty-BrKKuJyB.js → empty-Cr-F5mUv.js} +1 -1
- package/dist/assets/{emptyVideoElement-Dh7SLvZr.js → emptyVideoElement-DFWZAgeK.js} +1 -1
- package/dist/assets/{epic-CAWrO46g.js → epic-BRaAmsNG.js} +2 -2
- package/dist/assets/getLocaleForTenant-BE1pHVDh.js +1 -0
- package/dist/assets/{index-BOKb4mE0.js → index-0JOtcwRL.js} +1 -1
- package/dist/assets/{index-D2AzfBKx.js → index-BJLEQ2__.js} +1 -1
- package/dist/assets/{index-D3-PmkS_.js → index-BXlN7b10.js} +2 -2
- package/dist/assets/{index-BIrdXBd5.js → index-BoAQJ4XP.js} +1 -1
- package/dist/assets/{index-CvT58EDq.js → index-CMN0VTWt.js} +12588 -12518
- package/dist/assets/{index-C6ATGAAr.js → index-DxCK0Ves.js} +1 -1
- package/dist/assets/{index-7YbGGjkm.js → index-z5S8dnQk.js} +1 -1
- package/dist/assets/{lexical-Dzssv7yV.js → lexical-BgdBwfNo.js} +1 -1
- package/dist/assets/{liveblocks-CiP_ybjI.js → liveblocks-BOEQeN-H.js} +1 -1
- package/dist/assets/{lottie-affxu90n.js → lottie-CHRWrHfY.js} +1 -1
- package/dist/assets/{mui-DyZ66Hcs.js → mui-D7DqO3YQ.js} +1 -1
- package/dist/assets/{pathToGoBack-CZxyCUC3.js → pathToGoBack-5wx41ypO.js} +1 -1
- package/dist/assets/{pdf-8e-E8rNQ.js → pdf-DEWT-QpZ.js} +3 -3
- package/dist/assets/{pdf-lib-BcflqWCN.js → pdf-lib-DOPLrm4O.js} +1 -1
- package/dist/assets/{plaid-FyiqUv2G.js → plaid-lowWm0fK.js} +1 -1
- package/dist/assets/{pusher-CxuRwAae.js → pusher-dR6xTdBt.js} +1 -1
- package/dist/assets/{react-CmVQ18xG.js → react-4OyDFrBO.js} +1 -1
- package/dist/assets/{react-DCHHkfVQ.js → react-B5NEquCq.js} +1 -1
- package/dist/assets/{react-BoOc_4N3.js → react-BGoqYhRz.js} +1 -1
- package/dist/assets/{react-C2XRiQUN.js → react-CITxf4P4.js} +1 -1
- package/dist/assets/{react-D1lsM1-4.js → react-DHCq2NZd.js} +1 -1
- package/dist/assets/{react-aFvNsmqH.js → react-wqVrph3b.js} +1 -1
- package/dist/assets/{recharts-BwJtr99T.js → recharts-DFfCUpO3.js} +1 -1
- package/dist/assets/{routePaths-BSkJ1W8n.js → routePaths-tLvi4-VJ.js} +1 -1
- package/dist/assets/{sentry-FpOk-uOh.js → sentry-BcE91o8k.js} +1 -1
- package/dist/assets/{url-DAvashYQ.js → url-CKFkQ8vX.js} +1 -1
- package/dist/assets/{url-Bl72EBuq.js → url-Cr6I6Veb.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CIv6_RmV.js +1 -0
- package/dist/assets/{useDeviceId-LkHHn9A4.js → useDeviceId-L-TdNFYo.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-CWbYAi7j.js → useFetchSuggestedQuestionsWhenReady-Bpx2l830.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Dia-MiHT.js → useInitialThreadRequest-guWm_-78.js} +1 -1
- package/dist/assets/{utils-Bq4O8z6v.js → utils-BMw-tiy-.js} +1 -1
- package/dist/assets/withTransactionSidePanel-lvb3ni_e.js +21 -0
- package/dist/assets/{zeni-epic-state-CPD487tE.js → zeni-epic-state-C9u4BvTm.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-CMLsknQg.js +0 -1
- package/dist/assets/AddressScreen-CzS53KmK.js +0 -9
- package/dist/assets/CompanyPassportScreen-BxubR0U3.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BSVEycjw.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DSQSKR9w.js +0 -18
- package/dist/assets/DrawerScreen-BTwKpT_9.js +0 -1
- package/dist/assets/FeaturePreviewScreen-Dr99eg64.js +0 -1
- package/dist/assets/MagicLinkRoutes-CeF1WSBY.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BBr6a7xt.js +0 -12
- package/dist/assets/NotFoundScreen-BsYL6zqu.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BfsVk3Vf.js +0 -1
- package/dist/assets/PeopleRoutes-DM78CUht.js +0 -22
- package/dist/assets/PerformanceRoutes-CBDi4gyz.js +0 -1
- package/dist/assets/RewardsRoutes-BiVBNcJr.js +0 -1
- package/dist/assets/ScreenRoutes-DOpjKPVr.js +0 -2
- package/dist/assets/SignInScreen-Cox6sg_r.js +0 -1
- package/dist/assets/SignOutScreen-BYcswMle.js +0 -9
- package/dist/assets/TaskRoutes-DLsxacD4.js +0 -9
- package/dist/assets/TransactionDetailRoutes-DEoXVFV0.js +0 -1
- package/dist/assets/TreasuryRoutes-DtYSpqNp.js +0 -37
- package/dist/assets/WiseConfirmationScreen-Bk9m0DPr.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-DCHmv1RE.js +0 -9
- package/dist/assets/getLocaleForTenant-1Uav7XAQ.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C9p_HWtx.js +0 -1
- package/dist/assets/withTransactionSidePanel-6L7N_-mK.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BOEQeN-H.js";import{a as o}from"./sentry-BcE91o8k.js";import{g as f,j as V,h as M,u as N,k as W}from"./core-BxynaUfL.js";import{h as _,J as $,z as R,a$ as U,G as z,Q as G,O as J,x as Q,c as l,f as X,a1 as Z,b0 as q}from"./index-CMN0VTWt.js";import{eX as K,eM as Y,Lv as I,Lw as ee,to as ae,te as g,eZ as re,bL as ne,tj as te,Lx as se}from"./zeni-epic-state-C9u4BvTm.js";import{D as oe,e as ie,n as le,S as de}from"./mui-D7DqO3YQ.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import{M as ue}from"./MobileAppDrawer-DVs4kZOY.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]="1e3ba750-9744-4cb9-9312-162cda036db3",e._sentryDebugIdIdentifier="sentry-dbid-1e3ba750-9744-4cb9-9312-162cda036db3")}catch{}})();const pe={overlayWidth:new z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>K(d));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(de)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,P="refer-and-earn-status-update",ke=
|
|
5
|
+
`,P="refer-and-earn-status-update",ke=W(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(Z(q));function Pe({isReferralDrawerOpen:e}){const a=V(),r=M(),n=N(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Y(t)),m=f(t=>I(t)),b=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=ee([m,w]),{areTenantIdsInSync:c}=G();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&c&&(u(!0),r(g(!0)))},[b,r,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),r(re(!0)))},[w,r,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),y=t=>{j(t)},{isAiCfoOpen:O,setIsAiCfoOpen:L}=J(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=ce({isAiCfoOpen:O,setIsAiCfoOpen:L,mobileExploreReferrer:"Rewards"});fe({isDataReady:v===!0});const F={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(Q,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(X.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:y}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...F})]})}export{Pe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-BOEQeN-H.js";import x from"./NotFoundScreen-C3zjg2pa.js";import{a as p}from"./sentry-BcE91o8k.js";import{j as C,u as I,h as A,g as u,N as k,k as E,n as D,o as c}from"./core-BxynaUfL.js";import{eM as T,Mp as g,MF as S,Cl as U,Bu as V,Ck as d,Cb as M,MU as _}from"./zeni-epic-state-C9u4BvTm.js";import{h as $,z as B,w as F,a1 as N,bF as O,aa as W}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-BcC01mNe.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="50a6b775-0b8c-4add-ac67-d2016a10571e",e._sentryDebugIdIdentifier="sentry-dbid-50a6b775-0b8c-4add-ac67-d2016a10571e")}catch{}})();const m="reimbursement-approval-rule-update",z=E(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(m)&&e(_(!1))},onBackClick:()=>{W(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(M(n))},onEditRuleClick:n=>{n!=null?(e(d(n)),a(`./${n}/edit`)):(e(d()),a("./new"))}}})(N(O)),P=()=>{const e=C(),r=I(),a=A(),[l,n]=p.useState(!1),[f,w]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),y=$(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(U())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(V(!0)))},[l,b,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(w(!0),a(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${m}`]:[],eventCallback:(s,q,R)=>{s.endsWith(m)&&R.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(k,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(F,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}}):t.jsx(z,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(P,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-BOEQeN-H.js";import{a as y}from"./sentry-BcE91o8k.js";import{j as w,h as A,u as C,l as T,g as S,k as U}from"./core-BxynaUfL.js";import{MF as R,Mp as E,Ce as x,Cn as _,Cl as h,Cm as b,MG as k}from"./zeni-epic-state-C9u4BvTm.js";import{z as B,h as V,w as F,bw as j,aa as O}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.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]="52502357-14a9-4041-938e-c1e9f769882f",e._sentryDebugIdIdentifier="sentry-dbid-52502357-14a9-4041-938e-c1e9f769882f")}catch{}})();function $(e){return k(e)==null}const M=U(function(e,a){const t=R(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=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),f=D.concat(I);v.push({action:c.stepType.selectedOption,actors:f,operator:f.length>1?c.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:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(b(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:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(b(p))}},onResetClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=V(),r=S(p=>R(p)),i=S(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!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(F,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-CiP_ybjI.js";import{j as W,h as le,u as V,l as Y,g as w,N as $,k as K,i as ut,n as pt,o as B}from"./core-kCJNxrqK.js";import{eM as J,MV as me,b$ as ce,Bp as xe,jx as bt,BC as ae,BB as se,MW as gt,bm as de,fG as Te,MX as ht,Jh as ft,jm as je,Ji as Se,Jj as St,ig as It,Mb as yt,iw as Rt,Bd as At,s2 as Ct,io as vt,BZ as De,MY as Fe,MZ as kt,M_ as Et,M$ as Bt,N0 as wt,N1 as xt,BJ as Ie,iC as Tt,Mk as jt,BD as Dt,Bn as Ft,N2 as Ut,Bm as Lt,N3 as Nt,Bv as ye,BN as Mt,BM as Pt,BI as $t,N4 as Ue,GA as _t,bn as Ot,By as Gt,Cf as zt,N5 as Zt,N6 as Ht,BV as Vt,BS as Re,LG as Jt,Bk as Wt,N7 as Le,CE as Ae,CM as Kt,N8 as qt,N9 as Z,Na as Xt,Nb as Ne,Nc as Qt,Nd as Me,Ne as Pe,C5 as ie,bs as Yt,bD as ue,cy as pe,eT as $e,eR as _e,Nf as en,gy as tn,LT as nn,Ng as an,Nh as Oe,LX as sn,MF as on,Ni as rn,MU as ln,CJ as Ce,CI as mn,Nj as cn,Nk as dn,Nl as un,Nm as pn,Nn as bn,Mq as gn,Cz as hn,CD as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,Ig as Cn,cJ as vn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-CPD487tE.js";import{x as Ge,J as ze,n as ee,i as C,z as M,bG as Ze,_ as te,d as v,aC as ve,o as U,ao as Q,E as wn,D as He,bH as xn,r as H,K as Ve,bI as Tn,j as ne,bJ as jn,M as Dn,A as Fn,B as be,f as Je,a1 as Un,b7 as Ln,R as Nn,h as We,bK as Mn,a4 as Pn}from"./index-CvT58EDq.js";import{n as _,S as $n}from"./mui-DyZ66Hcs.js";import oe from"./NotFoundScreen-BsYL6zqu.js";import{S as ke}from"./SetupPagesScreen-xsDN3gQY.js";import{F as Ke}from"./FeaturePreviewScreen-Dr99eg64.js";import{a as g}from"./sentry-FpOk-uOh.js";import{u as qe}from"./useInitialThreadRequest-Dia-MiHT.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-C9p_HWtx.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-CWbYAi7j.js";import{D as _n}from"./DrawerScreen-BTwKpT_9.js";import{M as Ye}from"./MobileAppDrawer-BkI4pCp1.js";import{R as On}from"./ReimbursementApprovalRoutes-Dif6cOro.js";import{FallBackRoute as Gn}from"./ScreenRoutes-DOpjKPVr.js";import"./recharts-BwJtr99T.js";import"./analytics-BnogYQPW.js";import"./plaid-FyiqUv2G.js";import"./dnd-BFDNLN4d.js";import"./stripe-DMRn4zHo.js";import"./lottie-affxu90n.js";import"./lexical-Dzssv7yV.js";import"./pdf-8e-E8rNQ.js";import"./utils-Bq4O8z6v.js";import"./analyticsHelper-VcinlAtN.js";import"./routePaths-BSkJ1W8n.js";import"./BusinessVerificationPageScreen-D5XmscRr.js";import"./ReimbursementApprovalRuleDetailScreen-B0Q8zt66.js";import"./getLocaleForTenant-1Uav7XAQ.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]="3847d624-0a90-4d12-8bec-85f8e523fd9c",e._sentryDebugIdIdentifier="sentry-dbid-3847d624-0a90-4d12-8bec-85f8e523fd9c")}catch{}})();const et=e=>`/${e}/reimbursements`,zn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Zn=K(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=M.getSignedInUser(),d=de(c),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=me(e,t.reimbursementId),p=ht(e,c?.userId??"");let I=`${c?.firstName} ${c?.lastName}`,S=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,S=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,R=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,p)=>{i!=null&&e(se(i,l,p,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Mt("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(Nt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Dt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(jt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=H(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Ct("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(At(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(xn);function Ee(){const e=W(),t=le(),n=V(),{reimbursementId:r}=Y(),c=Ge(),d=ze(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(C.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(C.isReimbursementCommentingEnabled),x=V().pathname,R=x.includes("edit"),j=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=M.getSignedInUser(),T=w(u=>J(u)),f=w(u=>me(u,r)),D=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),P=ce(T?.userRole??[]);g.useEffect(()=>{(j&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||P&&f.billStatus==="rejected"||P===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx($,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(Ze,{isNewReimbursement:r==null}):s.jsxs(Hn,{windowSize:d,children:[s.jsx(te,{analytics:v,onLoad:u=>(N=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Jn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(Kn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.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(qn,{windowSize:d,children:s.jsx(Zn,{initialOpenThreadRequest:D??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Hn=_.div`
|
|
1
|
+
import{j as s}from"./liveblocks-BOEQeN-H.js";import{j as W,h as le,u as V,l as Y,g as w,N as $,k as q,i as ut,n as pt,o as B}from"./core-BxynaUfL.js";import{eM as J,MV as me,b$ as ce,Bp as xe,jx as bt,BC as ae,BB as se,MW as gt,bm as de,fG as Te,MX as ht,Jh as ft,jm as De,Ji as Se,Jj as St,ig as It,Mb as yt,iw as Rt,Bd as At,s2 as vt,io as Ct,BZ as je,MY as Fe,MZ as kt,M_ as Et,M$ as Bt,N0 as wt,N1 as xt,BJ as Ie,iC as Tt,Mk as Dt,BD as jt,Bn as Ft,N2 as Ut,Bm as Lt,N3 as Nt,Bv as ye,BN as Mt,BM as Pt,BI as $t,N4 as Ue,GA as _t,bn as Ot,By as Gt,Cf as zt,N5 as Zt,N6 as Ht,BV as Vt,BS as Re,LG as Jt,Bk as Wt,N7 as Le,CE as Ae,CM as qt,N8 as Kt,N9 as Z,Na as Xt,Nb as Ne,Nc as Qt,Nd as Me,Ne as Pe,C5 as ie,bs as Yt,bD as ue,cy as pe,eT as $e,eR as _e,Nf as en,gy as tn,LT as nn,Ng as an,Nh as Oe,LX as sn,MF as on,Ni as rn,MU as ln,CJ as ve,CI as mn,Nj as cn,Nk as dn,Nl as un,Nm as pn,Nn as bn,Mq as gn,Cz as hn,CD as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,Ig as vn,cJ as Cn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-C9u4BvTm.js";import{v as Ge,J as ze,i as ee,s as v,z as M,bG as Ze,x as te,c as C,aC as Ce,o as U,ao as Q,I as wn,D as He,bH as xn,r as H,O as Ve,bI as Tn,S as ne,bJ as Dn,Q as jn,G as Fn,w as be,f as Je,a1 as Un,b7 as Ln,U as Nn,h as We,bK as Mn,a4 as Pn}from"./index-CMN0VTWt.js";import{n as _,S as $n}from"./mui-D7DqO3YQ.js";import oe from"./NotFoundScreen-C3zjg2pa.js";import{S as ke}from"./SetupPagesScreen-BXNBjv3j.js";import{F as qe}from"./FeaturePreviewScreen-Esm95F3O.js";import{a as g}from"./sentry-BcE91o8k.js";import{u as Ke}from"./useInitialThreadRequest-guWm_-78.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import{D as _n}from"./DrawerScreen-C5Pyoiiy.js";import{M as Ye}from"./MobileAppDrawer-DVs4kZOY.js";import{R as On}from"./ReimbursementApprovalRoutes-BU7MjFhQ.js";import{FallBackRoute as Gn}from"./ScreenRoutes-98svW53l.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./analyticsHelper-B5vDoHXs.js";import"./routePaths-tLvi4-VJ.js";import"./BusinessVerificationPageScreen-DbNtBlq9.js";import"./ReimbursementApprovalRuleDetailScreen-BcC01mNe.js";import"./getLocaleForTenant-BE1pHVDh.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]="91479fd3-a984-441d-a021-bce8f29686c2",e._sentryDebugIdIdentifier="sentry-dbid-91479fd3-a984-441d-a021-bce8f29686c2")}catch{}})();const et=e=>`/${e}/reimbursements`,zn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Zn=q(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=M.getSignedInUser(),d=de(c),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=me(e,t.reimbursementId),p=ht(e,c?.userId??"");let I=`${c?.firstName} ${c?.lastName}`,S=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,S=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,R=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,p)=>{i!=null&&e(se(i,l,p,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Mt("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(Nt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(jt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Dt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=H(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Ct(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(At(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(xn);function Ee(){const e=W(),t=le(),n=V(),{reimbursementId:r}=Y(),c=Ge(),d=ze(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isReimbursementCommentingEnabled),x=V().pathname,R=x.includes("edit"),D=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=M.getSignedInUser(),T=w(u=>J(u)),f=w(u=>me(u,r)),j=Ke(T?.companyId,{clearParams:f.fetchState==="Completed"}),P=ce(T?.userRole??[]);g.useEffect(()=>{(D&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||P&&f.billStatus==="rejected"||P===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx($,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(Ze,{isNewReimbursement:r==null}):s.jsxs(Hn,{windowSize:d,children:[s.jsx(te,{analytics:C,onLoad:u=>(N=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Jn,{children:s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(qn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.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(Kn,{windowSize:d,children:s.jsx(Zn,{initialOpenThreadRequest:j??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Hn=_.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-CiP_ybjI.js";import{j as W,h as le,u as V,l as Y
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
overflow-y: auto;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
`,
|
|
36
|
+
`,qn=_.button`
|
|
37
37
|
align-self: flex-end;
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-CiP_ybjI.js";import{j as W,h as le,u as V,l as Y
|
|
|
48
48
|
width: ${U.sp4};
|
|
49
49
|
height: ${U.sp4};
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Kn=_.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,Xn=
|
|
56
|
+
`,Xn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=M.getSignedInUser(),c=de(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Zt(n.remiActivities,Ht(t.currentTenant),r));const i=ce(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=et(o),i=H(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Wt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Jt({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(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Vt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Tn);function Qn(){const e=W(),t=le(),n=V(),r=n.hash.substring(1),c=Ge(),{reimbursementId:d}=Y(),m=M.getSignedInUser(),o=w(E=>J(E)),a=w(E=>Ue(E,d??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Ke(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:I}=Ve(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:x}=Xe({isAiCfoOpen:p,setIsAiCfoOpen:I,mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:R}=ee(),{isFeatureEnabled:D}=R(v.isLimitedCategoryForReimbursement),[b,k]=g.useState(!1),[y,T]=g.useState(!1),[f,j]=g.useState(!1),{isFeatureEnabled:P}=R(v.isReimbursementCommentingEnabled),{isFeatureEnabled:A}=R(v.isShowDeletedReimbursementsFeatureEnabled),F=w(E=>me(E,d??"")),u=_t(o),N=Ot(o.userRole),z=a.fetchState;if(g.useEffect(()=>{b||d==null?b==1&&z==="Error"&&e("page-not-found",{replace:!0}):(k(!0),t(Gt(d,!1,A)))},[b,d,t,z]),g.useEffect(()=>{A&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&u===!1?j(!1):j(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(N||a.allApprovers.find(E=>E.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,N,o.isZeni,u,m]),g.useEffect(()=>{y||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||F.fetchState=="Completed"||F.fetchState=="In-Progress"||(T(!0),t(xe(!1,D,A,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(zt(!1,!0,!0,a.lastUpdatedByUserId)))},[y,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Ze,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:C,onLoad:E=>(K=>{d!=null&&K.trackReimbursementReimbursementDetails(d)})(E)}),s.jsx(Xn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:P,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:f,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:S,onAskAiCfoClick:x})]})}const Yn=q(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(Z())},onCloseReviewItem:n=>{e(Kt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(qt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(Dn);function ea(){const e=W(),t=w(d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(d=>Le(d)),r=ne(),c=r?.loggedInUserRole?.includes("admin")===!0;return g.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Yn,{navigate:e,analytics:C,isAdmin:c})}const G=sn(),tt="bulk-operation-update",re="reimbursement-approval-rule-update",{spendManagement:ta,common:Be}=He.getLocalizedStrings(),we=ta.reimbursement.bulkActions,na=_.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-CiP_ybjI.js";import{j as W,h as le,u as V,l as Y
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,aa=
|
|
64
|
+
`,aa=q(function(e,t){const n=Pe(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=M.getSignedInUser(),d=de(c),m=e.tenantState.currentTenantId,o=J(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(S=>S!=="deleted"));const p=n.fetchState,I=on(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(S=>S.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${Nn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(Z()),e(Ne(o))},onSubtabChange:o=>{e(Z()),e(Me(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=H(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=H(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.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(bn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(pn(o))},onFiltersChange:o=>{e(un({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(dn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ie(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(cn(o))},removeAllTransactionsFromBulkActionList:()=>{e(Z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(mn(o,a??""));break;case"send_for_approval":e(ve("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ve("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(re)&&e(ln(!1))},onEventReceived:o=>{o===tt&&e(rn())}}})(Un(Ln));function sa(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Ve(),n=W(),r=le(),c=V(),d=c.state,m=ze(),[o,a]=g.useState(null),i=ut("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect(()=>{if(d?.tab!=null&&d?.subTab!=null){const h=Xt(d.tab.toString());h!=null?r(Ne(h)):console.log("Warning:Not a valid remiListTab");const O=Qt(d.subTab.toString());O!=null?r(Me(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{r(Z())}},[]);const{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isBillPayCommentingEnabled),{isFeatureEnabled:x}=l(v.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=l(v.isReimbursementBulkActionEnabled),D=M.getSignedInUser(),b=w(h=>J(h)),[k,y]=g.useState(!1),[T,f]=g.useState(!1),j=ne(),P=j?.loggedInUserRole?.includes("admin")===!0,A=w(h=>Pe(h,G,R)),{areTenantIdsInSync:F}=jn(),u=A.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:z}=Xe({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:u==="Completed"}),g.useEffect(()=>{!T&&F&&(f(!0),r(ie(G,!0,I,!1,!0)))},[T,G,r,F]),D==null)throw Error("Can't access address page without signing in...");const E=!!b?.userRole&&Yt(b),K=ue(j?.loggedInUserRoleMap),nt=pe(j?.loggedInUserRoleMap),at=!!b.userReimbursementInfo?.isReimbursementTOSAccepted,st=!!b.companyReimbursementInfo?.info?.isReimbursementEnabled,it=!!b.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ot=w(h=>Te(h.companyState,b.companyId)),rt=ot?.company.featuresActivationInfo.connectedAccountProvider,ge=h=>{y(h)},{isFeatureEnabled:lt}=l(v.isDebitCardFeatureEnabled),mt=$e(lt,b),ct=_e(b),{remisProcessed:X,remisProcessing:he}=w(h=>en(h));g.useEffect(()=>{X===he&&o!=null&&(r(tn({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:X>1?we.reports:we.report},{variableName:"_has_",variableValue:X>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:nn(o)}]})),r(an()),setTimeout(()=>{r(ie(G,!0,I,!1,!0,!0))},3e3),a(null))},[X,he]);const dt={events:b.companyId!=null?[`private-${b.companyId}.${tt}`,`private-${b.companyId}.${re}`]:[],eventCallback:(h,O,fe)=>{h.endsWith(re)?fe.onReimbursementApprovalRulesEventReceived?.(h):O.entity_type==="reimbursement"&&(a(O.operation_type),fe.onEventReceived(h))}};return c.pathname.endsWith("/reimbursements/")||c.pathname.endsWith("/reimbursements")||c.pathname.endsWith("/reimbursements/bulk-review")?mt===!0||ct===!0?s.jsx(qe,{}):st&&(!E||K)||nt&&at?s.jsxs(s.Fragment,{children:[u==="Completed"?s.jsx(te,{analytics:C,onLoad:h=>(O=>O.trackPageLoaded(Je.Event.reimbursementHome))(h)}):null,s.jsx(Ye,{isAppContentDrawerOpen:k,handleDrawerToggle:ge}),s.jsxs(na,{windowSize:m,children:[s.jsx(_n,{isOpen:i,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{n("./"),r(Z())},children:s.jsx(ra,{onClick:h=>h.stopPropagation(),children:s.jsx(ea,{})})}),s.jsx(aa,{isShowDeletedBillsEnabled:p,isShowDeletedReimbursementEnabled:I,isBillPayCommentingEnabled:S,isReimbursementCommentingEnabled:x,location:c,navigate:n,currentTenant:b,period:G,isAdmin:P,isEmployee:E,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:A.createdByUserList,createdByUserListFetchState:A.createdByUserListFetchState,isDownloadEnabled:A.isDownloadEnabled,connectedAccountProvider:rt,isBulkActionEnabled:R,bulkSubmissionLimit:A.remiBulkSubmissionLimit,bulkSubmissionFetchState:A.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:N,onAskAiCfoClick:z,...dt})]})]}):it&&K?s.jsx($,{to:"../setup"}):j!=null&&Oe(b,j.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(be,{fetchState:"In-Progress"}):s.jsx(oe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=_($n)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,la=
|
|
68
|
+
`,la=q(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:gn(e,n),analytics:C,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(fn(n))},onCreateNewRemiButtonClick:()=>{e(hn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Mn),ma=()=>{const e=W(),t=V(),{tenantEmailDomain:n}=Y(),r=We(),[c,d]=g.useState(!1),m=w(k=>J(k)),o=M.getSignedInUserTenant(n)?.companyId??m.companyId,a=M.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),p=ne(),I=ue(p?.loggedInUserRoleMap),S=pe(p?.loggedInUserRoleMap),x=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,R=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,b=k=>{d(k)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return R&&S&&x?s.jsx($,{to:"../../../reimbursements"}):D&&I?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!D||m.userReimbursementInfo&&S&&x===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:C,onLoad:k=>(y=>y.trackPageLoaded(Je.Event.reimbursementPromoPage))(k)}),s.jsx(Ye,{isAppContentDrawerOpen:c,handleDrawerToggle:b}),s.jsx(la,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{b(!0)}})]}):s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function _a(){const e=w(E=>J(E)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),p=e?.userRole!=null&&Sn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&In(t?.loggedInUserRoleMap),S=yn(t?.loggedInUserRoleMap),x=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,R=ue(t?.loggedInUserRoleMap),D=x&&R,{isFeatureEnabled:b}=m(v.isDepositAccountsFeatureEnabled),k=b&&!p&&Rn(t?.loggedInUserRoleMap),y=Pn(e,o,a)&&!p&&An(t?.loggedInUserRoleMap),T=vn(t?.loggedInUserRoleMap),f=Cn(t?.loggedInUserRoleMap),j=kn(t?.loggedInUserRoleMap),P=En(t?.loggedInUserRoleMap),A=Bn(t?.loggedInUserRoleMap),F=pe(t?.loggedInUserRoleMap),{tenantEmailDomain:u}=Y(),N=V(),z=n===!0&&(R||F&&d);return s.jsxs(pt,{children:[N.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:D,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"verification"})}),s.jsx(B,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:D,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"setup"})}),s.jsx(B,{path:"promo",element:s.jsx(ma,{})}),s.jsx(B,{path:"approval-rules/*",element:D?s.jsx(On,{}):s.jsx(Gn,{isUserHasZeniAccountsAccess:f,isUserHasChargeCardAccess:P,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:F,isUserHasTreasuryAccess:j,isTenantBankingOnly:i,tenantEmailDomain:u??""})}),z&&s.jsx(B,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(B,{path:"/*",element:s.jsx(qe,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(B,{path:"*",element:s.jsx($,{to:"../promo"})}),c&&R&&s.jsx(B,{path:"*",element:s.jsx($,{to:"../setup"})})]}):N.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"new",element:s.jsx(Ee,{})}),s.jsx(B,{path:":reimbursementId",element:s.jsx(Qn,{})}),s.jsx(B,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]}):s.jsx(B,{path:"*",element:s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${U.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]})}export{_a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-CiP_ybjI.js";import{u as x,j as fe,h as ue,l as _e,g as f,k as he,n as be,o as z}from"./core-kCJNxrqK.js";import{eM as E,f8 as g,ID as Ie,pF as F,ja as ye,ic as Ce,s$ as ge,pK as Se,bu as we,IE as Re,IF as Te,jm as Fe,bm as Oe,u1 as ke,IG as Ae,IH as De,sW as je,s_ as Pe,II as G,IJ as Ee,IK as Me,IL as Le,IM as Be,IN as S,IO as O,IP as k,IQ as H,IR as A,IS as D,dF as ve,tJ as Ue,tx as Y,ty as N,tP as Ve,tC as $,tV as xe,IT as ze,IU as Ge,IV as He,IW as Ye,IX as Ne,eT as $e,eR as qe}from"./zeni-epic-state-CPD487tE.js";import{I as Qe,K as Je,J as Ke,n as J,i as j,z as K,M as We,j as Ze,a as Xe,_ as ea,d as P,f as aa,r as W,O as sa,Q as ta,R as oa}from"./index-CvT58EDq.js";import"./mui-DyZ66Hcs.js";import na from"./NotFoundScreen-BsYL6zqu.js";import{F as ra}from"./FeaturePreviewScreen-Dr99eg64.js";import{a as h}from"./sentry-FpOk-uOh.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-CWbYAi7j.js";import{u as pa}from"./useInitialThreadRequest-Dia-MiHT.js";import{t as q,a as Q}from"./routePaths-BSkJ1W8n.js";import{M as ma}from"./MobileAppDrawer-BkI4pCp1.js";import"./recharts-BwJtr99T.js";import"./analytics-BnogYQPW.js";import"./plaid-FyiqUv2G.js";import"./dnd-BFDNLN4d.js";import"./stripe-DMRn4zHo.js";import"./lottie-affxu90n.js";import"./lexical-Dzssv7yV.js";import"./pdf-8e-E8rNQ.js";import"./utils-Bq4O8z6v.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]="f0239b7a-c67d-4a76-8c2d-b6435879420d",e._sentryDebugIdIdentifier="sentry-dbid-f0239b7a-c67d-4a76-8c2d-b6435879420d")}catch{}})();const fa=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},_a=he(function(e){const o=K.getSignedInUser(),p=e.tenantState.currentTenantId,u=E(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(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:P,isZeniUser:Oe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Fe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),m.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=W(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(O({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(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(O({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Le({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Ee({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Pe())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),p=Ke(),u=ta(p),a=fe(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=J(),{isFeatureEnabled:m}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=K.getSignedInUser(),[i,y]=h.useState(!1),[M,Z]=h.useState(!1),{isFeatureEnabled:L}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=f(n=>E(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(L?B?.companyId:void 0),C=f(n=>g(n).fetchState),ae=f(n=>Ie(n)),{areTenantIdsInSync:b}=We(),R=f(n=>n.financeStatementState.selectedReportId),se=f(n=>g(n).isCompareModeOn),_=f(n=>g(n).filter),T=f(n=>g(n).selectedReportAndTimeframeFetchState),te=f(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!M&&C==="Completed"&&b&&(s(F(l.userId,!1,!0,!1)),Z(!0))},[i,M,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Se(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const v=Ze(),oe=v?.loggedInUserRole!=null&&we(v?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),U=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),V=Qe(de??"")==="reports",pe=ia(ce),me=h.useMemo(()=>V?fa:void 0,[V]);la({canFetchSuggestedQuestions:pe,pageContexts:me})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:P,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(ma,{isAppContentDrawerOpen:ne,handleDrawerToggle:U}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:P,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:U,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=W(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:L,initialOpenThreadRequest:ee})]})}const w=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 Ua(){const e=f(s=>E(s)),{useFeatureGate:o}=J(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=$e(p,e),a=qe(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Ua as default};
|
|
1
|
+
import{j as d}from"./liveblocks-BOEQeN-H.js";import{u as x,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-BxynaUfL.js";import{eM as E,f8 as g,ID as Ie,pF as F,ja as ye,ic as Ce,s$ as ge,pK as Se,bu as we,IE as Re,IF as Te,jm as Fe,bm as Oe,u1 as ke,IG as Ae,IH as De,sW as Pe,s_ as je,II as G,IJ as Ee,IK as Me,IL as Le,IM as Be,IN as S,IO as O,IP as k,IQ as H,IR as A,IS as D,dF as Ue,tJ as ve,tx as Y,ty as N,tP as Ve,tC as $,tV as xe,IT as ze,IU as Ge,IV as He,IW as Ye,IX as Ne,eT as $e,eR as qe}from"./zeni-epic-state-C9u4BvTm.js";import{M as Qe,O as Je,J as Ke,i as J,s as P,z as K,Q as We,S as Ze,a as Xe,x as ea,c as j,f as aa,r as W,R as sa,T as ta,U as oa}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import na from"./NotFoundScreen-C3zjg2pa.js";import{F as ra}from"./FeaturePreviewScreen-Esm95F3O.js";import{a as h}from"./sentry-BcE91o8k.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import{u as pa}from"./useInitialThreadRequest-guWm_-78.js";import{t as q,a as Q}from"./routePaths-tLvi4-VJ.js";import{M as fa}from"./MobileAppDrawer-DVs4kZOY.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="5b7176c1-93bf-4417-a3ea-593244fc7e04",e._sentryDebugIdIdentifier="sentry-dbid-5b7176c1-93bf-4417-a3ea-593244fc7e04")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},_a=he(function(e){const o=K.getSignedInUser(),p=e.tenantState.currentTenantId,u=E(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(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:j,isZeniUser:Oe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Fe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ve({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=W(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(O({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(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(O({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Le({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Ee({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(Pe()),e(je())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),p=Ke(),u=ta(p),a=me(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=J(),{isFeatureEnabled:f}=c(P.isReportsHorizontalClassLayoutSwitchEnabled),l=K.getSignedInUser(),[i,y]=h.useState(!1),[M,Z]=h.useState(!1),{isFeatureEnabled:L}=c(P.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>E(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(L?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=We(),R=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),T=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!M&&C==="Completed"&&b&&(s(F(l.userId,!1,!0,!1)),Z(!0))},[i,M,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Se(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const U=Ze(),oe=U?.loggedInUserRole!=null&&we(U?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),v=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),V=Qe(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>V?ma:void 0,[V]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:j,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:v}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:j,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:v,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=W(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:L,initialOpenThreadRequest:ee})]})}const w=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 va(){const e=m(s=>E(s)),{useFeatureGate:o}=J(),{isFeatureEnabled:p}=o(P.isDebitCardFeatureEnabled),u=$e(p,e),a=qe(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{va as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-BOEQeN-H.js";import{i as j,z as w,aI as y,x as E,c as p,f as F,cy as P,s as L}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import l from"./NotFoundScreen-C3zjg2pa.js";import{a as d}from"./sentry-BcE91o8k.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as u}from"./core-BxynaUfL.js";import{eM as z,Pe as C,M4 as M,Pf as k,to as Y,eZ as G,Pg as O,tm as Z}from"./zeni-epic-state-C9u4BvTm.js";import{R as x}from"./ReferralListScreen-H3ugCkel.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import"./MobileAppDrawer-DVs4kZOY.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]="c0d2026c-e07d-4d15-b847-908ec18d14e6",e._sentryDebugIdIdentifier="sentry-dbid-c0d2026c-e07d-4d15-b847-908ec18d14e6")}catch{}})();const q=R(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(k()),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(Z())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{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)),v=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),I=M(D);d.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),d.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:_,currentTenant:r,companyName:N,userName:v,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BPkQitQx.js","assets/sentry-BcE91o8k.js","assets/core-BxynaUfL.js","assets/zeni-epic-state-C9u4BvTm.js","assets/index-CMN0VTWt.js","assets/mui-D7DqO3YQ.js","assets/analytics-Fp0p9zzF.js","assets/utils-BMw-tiy-.js","assets/withTransactionSidePanel-lvb3ni_e.js","assets/useAskAiCfoHostNavButtonProps-CIv6_RmV.js","assets/useFetchSuggestedQuestionsWhenReady-Bpx2l830.js","assets/TransactionDetailScreen-v_iRnLm6.js","assets/decodeURIComponentSafe-C4CdHegQ.js","assets/routePaths-tLvi4-VJ.js","assets/NotFoundScreen-C3zjg2pa.js","assets/analyticsHelper-B5vDoHXs.js","assets/CompanyPassportScreen-CtaJgM_D.js","assets/MobileAppDrawer-DVs4kZOY.js","assets/FeaturePreviewScreen-Esm95F3O.js","assets/ReferralListScreen-H3ugCkel.js","assets/index-D-vub4_t.css","assets/BillPayRoutes-DyYN5q_F.js","assets/AddressScreen-Dnqvk39f.js","assets/DomesticWireDetailScreen-Cet8eqve.js","assets/useInitialThreadRequest-guWm_-78.js","assets/DrawerScreen-C5Pyoiiy.js","assets/SetupPagesScreen-BXNBjv3j.js","assets/BusinessVerificationPageScreen-DbNtBlq9.js","assets/BillPayApprovalRoutes-Dks0BYHS.js","assets/ReimbursementApprovalRuleDetailScreen-BcC01mNe.js","assets/getLocaleForTenant-BE1pHVDh.js","assets/ReimbursementRoutes-D3zYz8wy.js","assets/ReimbursementApprovalRoutes-BU7MjFhQ.js","assets/TransactionListRoutes-DelEkqAU.js","assets/ZeniAccountStatementScreen-BxqDty2m.js","assets/SettingsRoutes-otH5iG80.js","assets/accountMappingHelper-BmWub9rZ.js","assets/QBOConnectionScreen-CoK1XecU.js","assets/empty-BCapHP-3.js","assets/index-0JOtcwRL.js","assets/url-Cr6I6Veb.js","assets/index-DxCK0Ves.js","assets/ReportsRoutes-CljixoPv.js","assets/ChargeCardRoutes-DDzL8gpY.js","assets/PeopleRoutes-B-S9keOO.js","assets/ExpenseAutomationRoutes-D-ShrGPq.js","assets/TreasuryRoutes-DkznvHgV.js","assets/VendorsRoutes-CmyeEzqo.js","assets/pathToGoBack-5wx41ypO.js","assets/ZeniAccountRoutes-XGCXjBgv.js","assets/AddressRoutes-CL334upZ.js","assets/PandLWithForecastRoutes-JcUTTxdM.js","assets/CustomerOnboardingRoutes-5AwlPOlH.js","assets/TransactionDetailRoutes-BwPxRt-X.js","assets/EntityDetailRoutes-CVOtLlxx.js","assets/NotificationRoutes-CW6WHRSZ.js","assets/PerformanceRoutes-CNYDT1z6.js","assets/RewardsRoutes-dtSU2rm8.js","assets/TaskRoutes-D21v8ON-.js","assets/TaskListScreen-DBwhGgZH.js","assets/AiCfoScreen-DZh-dzaC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as a,bm as os,eM as ls,eT as cs,eR as ds,eS as ms,fD as us,eO as _s,cM as Ae,ct as As,f9 as Es,cl as ps,bB as Is,bp as gs,fe as xs,v as Ts,If as hs,bu as js,Ig as Us,bD as Ds,fb as Hs,bC as Rs,br as bs,cN as ys,Ih as fs,Ii as Cs,cJ as vs,cL as Os,cK as Ps,cs as Fs,cy as Ls,mh as Ee,eN as pe,Ij as Bs,fi as Ie,fI as ge,fJ as xe,fj as ks}from"./zeni-epic-state-C9u4BvTm.js";import{j as e}from"./liveblocks-BOEQeN-H.js";import{a as v}from"./sentry-BcE91o8k.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-BxynaUfL.js";import{h as ws,u as zs,z as H,i as Gs,a as $s,l as Ys,s as L,S as Ws,L as B,D as he,t as _,P as qs,c as X,d as l}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import{f as je}from"./analyticsHelper-B5vDoHXs.js";import{t as Js}from"./getLocaleForTenant-BE1pHVDh.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="96111a1f-0691-48d2-aadd-8b6a6a99e4d7",i._sentryDebugIdIdentifier="sentry-dbid-96111a1f-0691-48d2-aadd-8b6a6a99e4d7")}catch{}})();const Ks={dashboard:()=>a(()=>import("./DashboardRoutes-BPkQitQx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>a(()=>import("./BillPayRoutes-DyYN5q_F.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-D3zYz8wy.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20])),transactions:()=>a(()=>import("./TransactionListRoutes-DelEkqAU.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>a(()=>import("./SettingsRoutes-otH5iG80.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>a(()=>import("./ReportsRoutes-CljixoPv.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-DDzL8gpY.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>a(()=>import("./PeopleRoutes-B-S9keOO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-D-ShrGPq.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>a(()=>import("./TreasuryRoutes-DkznvHgV.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>a(()=>import("./VendorsRoutes-CmyeEzqo.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-XGCXjBgv.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>a(()=>import("./ReportsRoutes-CljixoPv.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),ea=l(()=>a(()=>import("./AddressRoutes-CL334upZ.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sa=l(()=>a(()=>import("./PeopleRoutes-B-S9keOO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),aa=l(()=>a(()=>import("./PandLWithForecastRoutes-JcUTTxdM.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),na=l(()=>a(()=>import("./CustomerOnboardingRoutes-5AwlPOlH.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),ta=l(()=>a(()=>import("./VendorsRoutes-CmyeEzqo.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),ia=l(()=>a(()=>import("./TransactionDetailRoutes-BwPxRt-X.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>a(()=>import("./EntityDetailRoutes-CVOtLlxx.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),ra=l(()=>a(()=>import("./DashboardRoutes-BPkQitQx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),De=l(()=>a(()=>import("./BillPayRoutes-DyYN5q_F.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),oa=l(()=>a(()=>import("./SettingsRoutes-otH5iG80.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),He=l(()=>a(()=>import("./ReimbursementRoutes-D3zYz8wy.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20]))),la=l(()=>a(()=>import("./ZeniAccountRoutes-XGCXjBgv.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),ca=l(()=>a(()=>import("./TreasuryRoutes-DkznvHgV.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),da=l(()=>a(()=>import("./TransactionListRoutes-DelEkqAU.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),ma=l(()=>a(()=>import("./ChargeCardRoutes-DDzL8gpY.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),ua=l(()=>a(()=>import("./NotificationRoutes-CW6WHRSZ.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),_a=l(()=>a(()=>import("./PerformanceRoutes-CNYDT1z6.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),Aa=l(()=>a(()=>import("./ExpenseAutomationRoutes-D-ShrGPq.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),Ea=l(()=>a(()=>import("./RewardsRoutes-dtSU2rm8.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),pa=l(()=>a(()=>import("./TaskRoutes-D21v8ON-.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),Ia=l(()=>a(()=>import("./AiCfoScreen-DZh-dzaC.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>a(()=>import("./NotFoundScreen-C3zjg2pa.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),ga=l(()=>a(()=>import("./TaskListScreen-DBwhGgZH.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function Za({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),b=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),J=os(h),G=Ms(),[N,be]=v.useState(!1),r=z(n=>ls(n)),{useFeatureGate:P}=Gs(),K=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&J,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(n=>n.tenantState.fetchState),E=z(n=>n.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(n=>us(n));if(o!=null){const n=H.getSignedInUserTenant(o);h!=null&&n!=null&&je(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ae=_s(),A=Ws(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ne=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(n=>w.tenantId!=null?Es(n,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&b!=null){const n=Q.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,b]),v.useEffect(()=>{N||(be(!0),f(B.TENANT_FETCHING)),ne.current?ne.current=!1:!Ts(ae,w)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,D,d,s){if(pe(D?.userId,D?.zeniSessionId,n.tenantId),d(Bs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&he.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ae,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,D,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(W&&ts){k(Ie(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(q?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else W&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),W&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(W){X.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,b,h,f,U))},[b,E]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&f(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):E==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(n=Qs,D=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},D)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Ds(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Hs(r.company),We=Pe&&Ye===!0&&!C,qe=re&&Rs(A?.loggedInUserRoleMap),Je=oe&&bs(A?.loggedInUserRoleMap),Ke=me&&ys(A?.loggedInUserRoleMap),Qe=fs(A?.loggedInUserRoleMap),Xe=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=We&&I,as=oe&&g,ns=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ne===!0||Ge===!0||Qe===!0||Xe===!0;return H.isSignedIn()?b==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||J&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||J?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(xa,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(ra,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ns||F?e.jsx(sa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(aa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(na,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(ia,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(da,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(ga,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:qe||de||Ke||Je?e.jsx(ea,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(la,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(ca,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(_a,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(Aa,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(ua,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(ta,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(oa,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:as?e.jsx(ma,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(Ea,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(Ia,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):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:{...G.state,message:"...",origin:G.pathname}}))}const xa=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?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"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Ua,{tenantEmailDomain:O}):S?e.jsx(ja,{tenantEmailDomain:O}):U?e.jsx(Da,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(Ta,{tenantEmailDomain:O}):e.jsx(y,{}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Da=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,Za as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-BOEQeN-H.js";import{a as u}from"./sentry-BcE91o8k.js";import{j as T,u as R,h as P,g as m,k as B,l as _,n as W,o as C}from"./core-BxynaUfL.js";import{bm as Ie,eM as k,gr as ce,Kg as Ce,IF as xe,jm as le,lF as Ee,gt as Ae,Ki as we,Kh as ke,MH as je,w$ as Pe,Bu as ve,Mg as Me,Mp as De,b$ as re,cD as Ue,cE as Te,Is as Fe,MI as Re,It as Be,vr as _e,MJ as Ve,DK as Le,Ba as Oe,B1 as de,A_ as Ne,vv as ue,B4 as pe,B7 as ge,Bd as q,s2 as X,vu as $e,i_ as Y,j1 as me,MK as Ke,k2 as ze,vK as Ge,Jb as Ze,Jc as Je,iY as Qe,ML as He,i$ as We,MM as Ye,vH as qe,MN as Xe,MO as en,Br as nn,eR as fe,eT as he,MP as tn,fw as an,IE as sn,vG as te,fB as ae,fA as on,vF as cn,fz as ln,fy as rn,MQ as dn,eW as be,MR as un,MS as pn,vN as gn,vE as se,MT as mn,fd as fn,vB as hn,bS as bn,b_ as Sn,bZ as yn,bT as In,bX as Cn,bW as xn,bV as En,bY as An,bU as wn}from"./zeni-epic-state-C9u4BvTm.js";import{i as ee,s as D,z as x,aa as Se,bx as kn,c as K,f as jn,S as V,w as ne,by as Pn,bz as vn,al as Mn,k as ye,bA as Dn,bB as Un,bC as Tn,a4 as Fn,Q as Rn,bD as Bn,r as _n,bE as Vn}from"./index-CMN0VTWt.js";import{n as U}from"./mui-D7DqO3YQ.js";import{M as v}from"./MobileAppDrawer-DVs4kZOY.js";import{a as N,g as $,m as Ln}from"./accountMappingHelper-BmWub9rZ.js";import{t as On,A as Nn}from"./AddressScreen-Dnqvk39f.js";import F from"./NotFoundScreen-C3zjg2pa.js";import{g as $n}from"./analyticsHelper-B5vDoHXs.js";import{B as Kn}from"./BusinessVerificationPageScreen-DbNtBlq9.js";import{C as zn}from"./CompanyPassportScreen-CtaJgM_D.js";import{q as oe}from"./QBOConnectionScreen-CoK1XecU.js";import{B as Gn}from"./BillPayApprovalRoutes-Dks0BYHS.js";import{R as Zn}from"./ReimbursementApprovalRoutes-BU7MjFhQ.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./routePaths-tLvi4-VJ.js";import"./empty-BCapHP-3.js";import"./pdf-lib-DOPLrm4O.js";import"./index-0JOtcwRL.js";import"./url-Cr6I6Veb.js";import"./index-DxCK0Ves.js";import"./decodeURIComponentSafe-C4CdHegQ.js";import"./ReimbursementApprovalRuleDetailScreen-BcC01mNe.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]="02da64cf-95a1-49e3-8b88-c4f1868f0d69",e._sentryDebugIdIdentifier="sentry-dbid-02da64cf-95a1-49e3-8b88-c4f1868f0d69")}catch{}})();const Jn=U.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as t}from"./liveblocks-CiP_ybjI.js";import{a as u}from"./sentry-FpOk-uO
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,Qn=B(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:L}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),z=N(a.accountMappingView.expenseAccountList,g.selectedOption),G=N(a.accountMappingView.billPayAccountList,l.selectedOption),Z=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),J=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),Q=Ln(a.accountMappingView.expenseAccounts1099FilingAccountList,L),H={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:Z?.accountId,selectedPrepaidExpensesAccountIds:O.map(j=>j.accountId),selectedFixedAssetsAccountIds:h.map(j=>j.accountId),selectedAccruedExpensesAccountIds:M.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:J.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:Q};e(ke({data:H}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(we())):e(ce())},onSaveClick:()=>{e(Ae()),o&&K.track(jn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(kn),Hn=()=>{const e=T(),a=R(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>k(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Jn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Qn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Wn=U.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as t}from"./liveblocks-CiP_ybjI.js";import{a as u}from"./sentry-FpOk-uO
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,Yn=
|
|
17
|
+
`,Yn=B(function(e,a){const i=k(e),c=Me(e),o=De(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:K}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),qn=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>k(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>je(S)),E=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const w=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(Wn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:w}),t.jsx(Yn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Xn=U.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as t}from"./liveblocks-CiP_ybjI.js";import{a as u}from"./sentry-FpOk-uO
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,et=
|
|
25
|
+
`,et=B(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=k(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(X(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(q(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Oe(o,s,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>k(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),E=Re(d,o?.loggedInUserRoleMap),y=Be(d,o?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Xn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:w,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=U.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as t}from"./liveblocks-CiP_ybjI.js";import{a as u}from"./sentry-FpOk-uO
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,at=
|
|
33
|
+
`,at=B(function(e,a){const{companyId:i}=a,c=k(e),o=a.roleMap.bill_pay_admin,n=Ke(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&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:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:K}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(X("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(q(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(He({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(Qe(n,s,r))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(Je())},handleResetCardPaymentErrorStatuses:()=>{e(Ze())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const s=On(n);e(ze({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>k(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Mn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(Y()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(Y())},[l,E]);const S=I=>{n(I)};return w?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=B(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(qe())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>k(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>Ye(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as t}from"./liveblocks-CiP_ybjI.js";import{a as u}from"./sentry-FpOk-uO
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,ie=({appContent:e})=>{const a=P(),i=T(),c=
|
|
57
|
+
`,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>k(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),w=he(g,s),S=!w&&E,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const A=m(h=>an(h,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,G=sn(s),Z=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{O(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(Q,H){let j=`/${Q}/settings/my_profile`;return j=j.concat(`/new/${H}`),j}(r,h),J=_n(c.state?.pathnameStackToGoBack,c.pathname);i(M,{state:{pathnameStackToGoBack:J}})},onGetOtp:h=>{const M={...A.myProfileLocalData,phone:h};a(te({localData:M})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(on(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>k(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Zt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>k(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(W,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Hn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Kn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(zn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),wn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(W,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(W,{children:[t.jsx(C,{path:"/",element:t.jsx(qn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(Gn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Zn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Zt as default};
|