@zeniai/web-app-ui 5.0.76-prod → 5.0.76-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-KIt8uyHg.js +1 -0
- package/dist/assets/{AddressScreen-02D4IIXX.js → AddressScreen-C8epvHKg.js} +1 -1
- package/dist/assets/{AiCfoScreen-7Qfw7m1h.js → AiCfoScreen-C8PnLvFm.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DKiUw_-9.js → BillPayApprovalRoutes-C2pW_0HD.js} +1 -1
- package/dist/assets/{BillPayRoutes-OK545GKf.js → BillPayRoutes-CIhgsxs6.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DYMZT7MK.js → BusinessVerificationPageScreen-BHqq2xxV.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-DPHmXO1M.js → ChargeCardRoutes-BCDwsoI8.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-Q0n29h95.js → CompanyPassportScreen-Cjnsn_RK.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DYuRQ2Fv.js → ConnectionAuthScreen-CXfcmrz5.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DLQ4stgM.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-C4fjdrqy.js → CustomerOnboardingRoutes-BZFueUon.js} +1 -1
- package/dist/assets/{DashboardRoutes-B9FZcGg_.js → DashboardRoutes-DxyPzfo5.js} +1 -1
- package/dist/assets/{DefaultTenantHome-DCUgRi-1.js → DefaultTenantHome-BxxoLoEm.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-IKqhZwSm.js → DomesticWireDetailScreen-BVJ2uZZ_.js} +1 -1
- package/dist/assets/{DrawerScreen-CqfyZCQa.js → DrawerScreen-BYBgvD5u.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-fOUHttju.js → EntityDetailRoutes-CVEIAJzD.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DUDB7RUh.js → ExpenseAutomationRoutes-Bhl_mKXt.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-BS0CUw64.js → FeaturePreviewScreen-BCRZsfyQ.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-DgspQrlV.js → HubSpotOAuthCallbackScreen-ByWE3hmY.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-DH85QP7H.js → MagicLinkRoutes-CjEeLFrg.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-Dml8wEzI.js → MagicLinkSignInScreen-BNv6DMmx.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DtbNyRlE.js → MobileAppDrawer-D_MxSFu1.js} +1 -1
- package/dist/assets/NotFoundScreen-BUTU_-cN.js +1 -0
- package/dist/assets/{NotificationRoutes-DuXZgoY7.js → NotificationRoutes-BU7RiYj-.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-CR1Z765t.js → OAuthConsentScreen-CjqH556D.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-B3dmA1Sq.js → PandLWithForecastRoutes-BRWqh_fp.js} +1 -1
- package/dist/assets/{PeopleRoutes-DESsHXKz.js → PeopleRoutes-BHwShJOh.js} +1 -1
- package/dist/assets/{PerformanceRoutes-keesTah9.js → PerformanceRoutes-BSJraYOg.js} +1 -1
- package/dist/assets/{Preview-B-lc4OC9.js → Preview-Csj6iaMz.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-wVcEP_8O.js → QBOConnectionScreen-D3kZw9eT.js} +1 -1
- package/dist/assets/{ReferralListScreen-BvE3nvBn.js → ReferralListScreen-DZ5cxHIr.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-C_KFvFIG.js → ReimbursementApprovalRoutes-CK7PuiBG.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Di2Ku2FG.js → ReimbursementApprovalRuleDetailScreen-DXvOZU5T.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-ZdCYLB4c.js → ReimbursementRoutes-CHbt2wdC.js} +1 -1
- package/dist/assets/{ReportsRoutes-DY3K_f7D.js → ReportsRoutes-CXA3us4c.js} +1 -1
- package/dist/assets/{RewardsRoutes-BqMNvsjf.js → RewardsRoutes-gAW1VRAE.js} +1 -1
- package/dist/assets/{ScreenRoutes-BexdZAU9.js → ScreenRoutes-U1ZbFVRi.js} +2 -2
- package/dist/assets/{SettingsRoutes-mXduxOe-.js → SettingsRoutes-ayR8jsmB.js} +1 -1
- package/dist/assets/{SetupPagesScreen-Bp4AY0Mi.js → SetupPagesScreen-DVIzlP-5.js} +1 -1
- package/dist/assets/{SignInScreen-CXyjOVym.js → SignInScreen-I3X_P9xn.js} +1 -1
- package/dist/assets/{SignOutScreen-DKHDnSe6.js → SignOutScreen-BdUuSEch.js} +1 -1
- package/dist/assets/{TaskListScreen-COtjlPYY.js → TaskListScreen-CBK1vDKd.js} +1 -1
- package/dist/assets/{TaskRoutes-DRX9ktVK.js → TaskRoutes-D817k7tQ.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-C3_-fHOI.js +1 -0
- package/dist/assets/{TransactionDetailScreen-Xdy6AbKJ.js → TransactionDetailScreen-C7MA74ac.js} +1 -1
- package/dist/assets/{TransactionListRoutes-BUHLsf1W.js → TransactionListRoutes-BX5vLxoe.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BT79rxoz.js → TreasuryRoutes-B7ppkZjl.js} +1 -1
- package/dist/assets/{VendorsRoutes-pn6DcmDJ.js → VendorsRoutes-tcDOX-e4.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-BnFvi8s0.js → WiseConfirmationScreen-Uew1AA-_.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-DA5CjpcO.js → ZeniAccountRoutes-ByArgJuB.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-Bkchp_FB.js → ZeniAccountStatementScreen-Upv5ClY5.js} +1 -1
- package/dist/assets/{accountMappingHelper-CIYwyHCp.js → accountMappingHelper-BSumbKrF.js} +1 -1
- package/dist/assets/{analytics-C6M-DE9i.js → analytics-q_QSThl7.js} +1 -1
- package/dist/assets/{analyticsHelper-CcCG6rlr.js → analyticsHelper-DhFEnfI7.js} +1 -1
- package/dist/assets/{core-DJZqFFKe.js → core-D9lzXsHE.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BiP6rBCT.js → decodeURIComponentSafe-B4xUD3SX.js} +1 -1
- package/dist/assets/{dnd-un89-W8a.js → dnd-DNtF3Icn.js} +1 -1
- package/dist/assets/{empty-C7-tC6KZ.js → empty-Bg3h__-J.js} +1 -1
- package/dist/assets/{empty-CmWX-en4.js → empty-BnWCAzBO.js} +1 -1
- package/dist/assets/{emptyVideoElement-wO4KKtvm.js → emptyVideoElement-CrLTHEbW.js} +1 -1
- package/dist/assets/{epic-CjmHq51Y.js → epic-C-cItypz.js} +1 -1
- package/dist/assets/{getLocaleForTenant-DRam5UTN.js → getLocaleForTenant-BCu2Wbt5.js} +1 -1
- package/dist/assets/{index-CyLy32xB.js → index-BYO1BJ4-.js} +1 -1
- package/dist/assets/{index-D6X2nsqL.js → index-CDrFhkvu.js} +1 -1
- package/dist/assets/{index-De7-Fto_.js → index-CuyoN034.js} +1 -1
- package/dist/assets/{index-D7lET21U.js → index-D4WqoFTE.js} +7 -7
- package/dist/assets/{index-UdAzkfmu.js → index-DQS8hiD6.js} +2 -2
- package/dist/assets/{index-t8LrPGTK.js → index-DmyhDNRf.js} +1 -1
- package/dist/assets/{index-BToxbtNk.js → index-IEcabr56.js} +1 -1
- package/dist/assets/{index-B56GmnI4.js → index-tKID2aTm.js} +1 -1
- package/dist/assets/{lexical-ChRCvCis.js → lexical-5_A_mLPM.js} +1 -1
- package/dist/assets/{liveblocks-DkPfdehf.js → liveblocks-DRCozBQX.js} +1 -1
- package/dist/assets/{lottie-B-PtdQRY.js → lottie-CFIADA6U.js} +1 -1
- package/dist/assets/{mui-Ctp_ou6C.js → mui-uwgkpTLc.js} +1 -1
- package/dist/assets/{pathToGoBack-Db6TK5Kp.js → pathToGoBack-Ll3naOiu.js} +1 -1
- package/dist/assets/{pdf-xyjfLAhh.js → pdf-C9DJlS7s.js} +3 -3
- package/dist/assets/{pdf-lib-E2_PRUbd.js → pdf-lib-DykPSmmb.js} +1 -1
- package/dist/assets/{plaid-VWs98BAj.js → plaid-CRq9dUdG.js} +1 -1
- package/dist/assets/{pusher-CqP4vhYK.js → pusher-DRQztvpS.js} +1 -1
- package/dist/assets/{react-DbbbXkLn.js → react-B67TqooD.js} +1 -1
- package/dist/assets/{react-BnNiFV_a.js → react-BG_C1Eck.js} +1 -1
- package/dist/assets/{react-Daz7lA1q.js → react-Bc7GdtKE.js} +1 -1
- package/dist/assets/{react-D_l3RGG4.js → react-Cv1q1f7X.js} +1 -1
- package/dist/assets/{react-C1pbg6AQ.js → react-DVWjQrcH.js} +1 -1
- package/dist/assets/{react-BSDM7YjB.js → react-LnMTZloB.js} +1 -1
- package/dist/assets/{recharts-D041iH6A.js → recharts-C3UFukkg.js} +1 -1
- package/dist/assets/{routePaths-B7y8nrZh.js → routePaths-C2HBowO1.js} +1 -1
- package/dist/assets/{sentry-BxQ6uAJu.js → sentry-B4qAfutp.js} +1 -1
- package/dist/assets/{url-pCQvflln.js → url-D-rSVugE.js} +1 -1
- package/dist/assets/{url-BE1qua3s.js → url-DrNm2a4i.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-CiCnpKpN.js → useAskAiCfoHostNavButtonProps-mLaTPohd.js} +1 -1
- package/dist/assets/{useDeviceId-CWGC34ee.js → useDeviceId-CF-PoIcu.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-3NQ4UG95.js → useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Dt7T5zj_.js → useInitialThreadRequest-Cw2FMHcf.js} +1 -1
- package/dist/assets/{utils-D2tZzHCG.js → utils-DfCznjX8.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BEuIUcFf.js → withTransactionSidePanel-DhelGbXD.js} +1 -1
- package/dist/assets/{zeni-epic-state-CNc-1z4P.js → zeni-epic-state-CthkBqEW.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-DQ24VS9r.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CWBg_s6S.js +0 -1
- package/dist/assets/NotFoundScreen-C0APD5Cv.js +0 -1
- package/dist/assets/TransactionDetailRoutes-BEdN3a0Y.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-DRCozBQX.js";import{a as g}from"./sentry-B4qAfutp.js";import{h as O,u as _,j as w,q as P,g as l,N as T}from"./core-D9lzXsHE.js";import{z as r,m as M,D as V,d as A,c as N,e as R,v as W,T as $,g as q}from"./index-D4WqoFTE.js";import{eO as H,IQ as J,I_ as Q,IR as B,eP as G,fi as K,IW as X,fH as Y,cT as Z,I$ as ee,J0 as te}from"./zeni-epic-state-CthkBqEW.js";import{n as ne}from"./mui-uwgkpTLc.js";import{u as ae}from"./useDeviceId-CF-PoIcu.js";import{f as se}from"./analyticsHelper-DhFEnfI7.js";import{t as ie}from"./getLocaleForTenant-BCu2Wbt5.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="f82c82fa-02d9-46a6-b1cb-d27e6a6eb4ca",t._sentryDebugIdIdentifier="sentry-dbid-f82c82fa-02d9-46a6-b1cb-d27e6a6eb4ca")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=O(),s=_(),m=w(),[k]=P(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>H(e)),b=l(e=>J(e)),E=r.getSignedInUser(),v=M().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Q(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(B(b.tenantsInOrder),a.zeniSessionId),G(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=q();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,a,o,b,v,s.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(S==="In-Progress"&&I==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx($,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as V}from"./liveblocks-
|
|
1
|
+
import{j as V}from"./liveblocks-DRCozBQX.js";import{a as c}from"./sentry-B4qAfutp.js";import{h as be,g as s,l as Je,u as Ke,j as ea,i as P}from"./core-D9lzXsHE.js";import{eO as he,eV as aa,eW as Se,eQ as ta,bn as na,f3 as sa,eX as oa,eY as ia,e_ as ra,f1 as da,fb as la,f2 as g,f5 as ca,f6 as ue,f9 as ua,f7 as fa,f8 as ma,fa as pa,cI as ba,fd as ha,cO as Sa,bv as ga,eN as Ea,fi as ka,fj as Ca,fh as ya}from"./zeni-epic-state-CthkBqEW.js";import{a3 as Ia,a4 as Ta,n as _a,y as wa,z as k,Z as Aa,a5 as Fa,Q as Da,q as va,u as $a,S as r,a6 as Ba,a7 as Ga,k as Ma,a as Pa,a8 as Ra,X as Na,a9 as Va,aa as Oa,ab as fe,ac as me,L as Ua,ad as xa,ae as pe,c as R,j as w,V as ja,af as N,ag as La}from"./index-D4WqoFTE.js";import{D as za}from"./mui-uwgkpTLc.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="897a5ef8-0c68-4590-a348-4e2565901b74",m._sentryDebugIdIdentifier="sentry-dbid-897a5ef8-0c68-4590-a348-4e2565901b74")}catch{}})();const Ya=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Je(),t=Ke(),C=_a(),o=ea(),O=ta(),p=be(),{useFeatureGate:i}=wa(),U=k.getSignedInUser(),A=na(U),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),x=s(e=>sa(e)),j=x.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:_e}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Q}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabledV2),X=W||Q&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ge}=i(r.isTreasuryEnabled),{isFeatureEnabled:Me}=i(r.isTaskManagerCustomerUserAccessEnabled),Pe=A||!A&&Me,Re=n.company!=null&&la(n.company),_=Ge&&Re,Ne=s(e=>g(e).totalUnreadCount),Ve=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Oe=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ue}=Ga();c.useEffect(()=>{const e=setTimeout(()=>Ue?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Oe.fetchState==="Not-Started"&&O.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,O.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const xe={fetchStatus:Ve,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),X===!1&&S.push("expense_automation_card");const je=Ma(),oe=s(e=>fa(e,S,h,W,Q,_).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",ze=c.useMemo(()=>pa(n.userRole),[n.userRole]),Ye=ba(ze),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Pa(),Qe=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>_&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[_,de,le,t.pathname,a]),[We,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Xe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Va(Xe);return V.jsx(za,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Oa,{signedInUser:U,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:_e,isVendorsTabVisible:Ye,isZeniAccountEnabled:Y,isChargeCardEnabled:Te,isTreasuryEnabled:_,treasuryYieldPercentage:qe,isTreasuryPopupVisible:We,isNotificationsTabVisible:He,notificationCountDetails:xe,isExpenseAutomationEnabledForUser:X&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=w(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=w(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=w(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Ua.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const M=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":xa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Qe,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Pe,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),Ja=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ya,{...m,...t})};export{Ja as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-DRCozBQX.js";import{j as r,k as i}from"./core-D9lzXsHE.js";import{K as n}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import"./sentry-B4qAfutp.js";import"./zeni-epic-state-CthkBqEW.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="8be0e406-e338-494a-8e0a-372030582bac",o._sentryDebugIdIdentifier="sentry-dbid-8be0e406-e338-494a-8e0a-372030582bac")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(a,{navigate:o})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-
|
|
1
|
+
import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-DRCozBQX.js";import lt from"./NotFoundScreen-BUTU_-cN.js";import{a as k}from"./sentry-B4qAfutp.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-D9lzXsHE.js";import{cq as St,eX as Q,eO as H,fa as bt,f2 as b,Pj as K,f6 as d,eW as y,qA as $,vV as It,Pk as Ct,eV as Tt,fd as yt,qF as At,Pl as F,bq as M,gM as w,qJ as O,Pm as Et,cB as _t,cv as Nt}from"./zeni-epic-state-CthkBqEW.js";import{R as Bt,z as xt,y as wt,S as Pt,ct as Rt,j as N,a3 as vt,cu as Dt,a4 as Ut,p as Gt}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-mLaTPohd.js";import{c as Mt}from"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="83fe8d37-993d-4219-988a-6dac5377a1a9",t._sentryDebugIdIdentifier="sentry-dbid-83fe8d37-993d-4219-988a-6dac5377a1a9")}catch{}})();const $t=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(O("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),$t(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Dt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Mt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:J,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{U&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&x!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(J||L===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,J,C,L,W,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s($("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-DRCozBQX.js";import{a as r}from"./sentry-B4qAfutp.js";import{h as A,u as C,g as o,N as J}from"./core-D9lzXsHE.js";import{Jd as P,eO as j,f1 as x,Je as z,Jf as D,Jg as M,Jh as R,mv as k,I9 as L}from"./zeni-epic-state-CthkBqEW.js";import{z as h,_ as I}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="8a1b9db3-7dc9-47e5-8731-014891e22a78",n._sentryDebugIdIdentifier="sentry-dbid-8a1b9db3-7dc9-47e5-8731-014891e22a78")}catch{}})();function ee(){const n=A(),s=C(),{params:t,error:i}=r.useMemo(()=>P(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>j(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),u=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),c=v??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&a!=null&&c!=null&&n(L(a.userId,a.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(J,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
package/dist/assets/{PandLWithForecastRoutes-B3dmA1Sq.js → PandLWithForecastRoutes-BRWqh_fp.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-DRCozBQX.js";import{j as W,h as z,u as Z,l as H,g as d,k as K,n as Q,o as I}from"./core-D9lzXsHE.js";import{eO as P,qo as R,pY as X,JM as v,pT as C,bv as ee,bn as ae,bS as te,pU as se,JN as oe,Jy as S,dC as re,tS as ne,JO as ce,ud as ie,eU as le,eS as de}from"./zeni-epic-state-CthkBqEW.js";import{z as me,R as fe,k as pe,y as M,S as w,s as ue,c as $,al as he,j as ge}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import Fe from"./NotFoundScreen-BUTU_-cN.js";import{F as be}from"./FeaturePreviewScreen-BCRZsfyQ.js";import{a as g}from"./sentry-B4qAfutp.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-mLaTPohd.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import{u as Ce}from"./useInitialThreadRequest-Cw2FMHcf.js";import{t as ye}from"./routePaths-C2HBowO1.js";import{M as Te}from"./MobileAppDrawer-D_MxSFu1.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="0afcccfd-5ece-4bb8-915f-63611d6e81df",s._sentryDebugIdIdentifier="sentry-dbid-0afcccfd-5ece-4bb8-915f-63611d6e81df")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(C(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=ye(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function U(){const s=W(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),T=d(t=>P(t)),N=T.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Se({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,O)=>L!=null?f.forecasts.findIndex(b=>b.id===L):O!=null?f.forecasts.findIndex(b=>b.id===O):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(i.forecasts[t].id,t)),y(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&y(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(C(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,C,F]);const D=pe(),Y=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:_}=M(),{isFeatureEnabled:j}=_(w.isReportsCommentingEnabled),G=Ce(j?T?.companyId:void 0,{clearParams:l&&m}),[J,V]=g.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:J,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:q,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function We(){const s=d(c=>P(c)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{We as PandLWithForecastRoutes,We as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DRCozBQX.js";import{JH as te,eO as Y,jA as H,eU as q,eS as ne,H6 as N,Jl as oe,s_ as Ee,JI as X,sO as ke,t7 as Ie,t1 as ie,sS as re,t5 as Pe,t2 as je,JJ as le,uE as Le,JK as Te,fx as ve,JL as J,sX as de,sV as ce,ta as Fe,c1 as Ae}from"./zeni-epic-state-CthkBqEW.js";import{Z as pe,y as Q,S as E,z,a6 as ue,E as me,ah as ge,ai as Oe,C as he,o as O,G as fe,D as Ce,aj as Re,R as Ve,s as Ue,c as be,e as Ze,j as Be,ak as $e,k as Je}from"./index-D4WqoFTE.js";import{D as ye,n as W,S as Se}from"./mui-uwgkpTLc.js";import ae from"./NotFoundScreen-BUTU_-cN.js";import{a as r}from"./sentry-B4qAfutp.js";import{h as ee,l as _e,g as m,j as Ge,u as He,k as ze,n as se,o as $}from"./core-D9lzXsHE.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-mLaTPohd.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import{M as Me}from"./MobileAppDrawer-D_MxSFu1.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="5e877f15-a028-40b3-9b6e-b092aa853d81",a._sentryDebugIdIdentifier="sentry-dbid-5e877f15-a028-40b3-9b6e-b092aa853d81")}catch{}})();const Xe={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>H(e)),{useFeatureGate:f}=Q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=N(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(z.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(X()),y()},F=()=>{R===!0?S(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=W(Se)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DRCozBQX.js";import E from"./NotFoundScreen-BUTU_-cN.js";import{a as r}from"./sentry-B4qAfutp.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-D9lzXsHE.js";import{eO as B,Pn as b,bo as F,bn as N,hg as V,gM as $}from"./zeni-epic-state-CthkBqEW.js";import{n as q,z as I,cv as G}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-mLaTPohd.js";import{c as J}from"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import{M as K}from"./MobileAppDrawer-D_MxSFu1.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.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]="4202f09c-e24c-4d93-9994-e5e5b0390633",e._sentryDebugIdIdentifier="sentry-dbid-4202f09c-e24c-4d93-9994-e5e5b0390633")}catch{}})();const L=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),Q=()=>{const e=_(),t=v(),c=q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:u}=M(),f=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{f(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:u,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${u}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as t}from"./sentry-
|
|
1
|
+
import{a as h,b as t}from"./sentry-B4qAfutp.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Ol}from"./liveblocks-
|
|
1
|
+
import{j as Ol}from"./liveblocks-DRCozBQX.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-B4qAfutp.js";import{L as dt,bS as Tc,eO as Ac,IQ as Rc,Ji as kl,c1 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-CthkBqEW.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-DfCznjX8.js";import{r as un}from"./empty-BnWCAzBO.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DykPSmmb.js";import{r as Gl}from"./index-CuyoN034.js";import{r as zl}from"./index-CDrFhkvu.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-D9lzXsHE.js";import{u as Kl,z as Pc,L as Wl,H as Jl,J as Xl,f as Ql,c as tf}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import{d as Pe}from"./decodeURIComponentSafe-B4xUD3SX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="da38e593-03a6-4d47-92ae-d8831668d33f",t._sentryDebugIdIdentifier="sentry-dbid-da38e593-03a6-4d47-92ae-d8831668d33f")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
|
|
2
2
|
`),I=_(E).split(`
|
|
3
3
|
`),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DRCozBQX.js";import{a as o}from"./sentry-B4qAfutp.js";import{g as f,j as L,h as M,u as V,k as _}from"./core-D9lzXsHE.js";import{m as F,Z as N,z as R,b3 as W,C as U,R as $,s as z,c as l,e as Y,a3 as Q,b4 as Z}from"./index-D4WqoFTE.js";import{eY as q,eO as G,Ma as I,Mb as J,tI as K,ty as g,e_ as X,bN as ee,tD as re,Mc as ae}from"./zeni-epic-state-CthkBqEW.js";import{D as ne,e as te,n as se,S as oe}from"./mui-uwgkpTLc.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-mLaTPohd.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import{M as de}from"./MobileAppDrawer-D_MxSFu1.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]="e1974b74-b683-47cf-8d74-832b976618de",e._sentryDebugIdIdentifier="sentry-dbid-e1974b74-b683-47cf-8d74-832b976618de")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=N();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>q(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-DRCozBQX.js";import x from"./NotFoundScreen-BUTU_-cN.js";import{a as p}from"./sentry-B4qAfutp.js";import{j as C,u as I,h as A,g as c,N as E,k,n as D,o as d}from"./core-D9lzXsHE.js";import{eO as N,N4 as b,Nk as S,CF as T,BO as V,CE as u,Cv as O,NA as U}from"./zeni-epic-state-CthkBqEW.js";import{m as _,z as B,B as $,a3 as W,bJ as z,ac as F}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import{R as g}from"./ReimbursementApprovalRuleDetailScreen-DXvOZU5T.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]="01cee2ea-de3f-47a5-ad56-dcd474496007",e._sentryDebugIdIdentifier="sentry-dbid-01cee2ea-de3f-47a5-ad56-dcd474496007")}catch{}})();const m="reimbursement-approval-rule-update",J=k(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(U(!1))},onBackClick:()=>{F(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(O(s))},onEditRuleClick:s=>{s!=null?(e(u(s)),a(`./${s}/edit`)):(e(u()),a("./new"))}}})(W(z)),P=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),v=c(n=>n.remiSetupApproverViewState.fetchState),o=c(n=>N(n)),w=_(),i=c(n=>b(n)),h=c(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||v!=="Not-Started"||(s(!0),a(V(!0)))},[l,v,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(u())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(d,{path:"/",element:t.jsx(P,{})}),t.jsx(d,{path:"/new",element:t.jsx(g,{})}),t.jsx(d,{path:"/:approvalRuleId/edit",element:t.jsx(g,{})}),t.jsx(d,{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-DRCozBQX.js";import{a as y}from"./sentry-B4qAfutp.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-D9lzXsHE.js";import{Nk as R,N4 as E,Cy as x,CH as _,CF as S,CG as h,Nl as k}from"./zeni-epic-state-CthkBqEW.js";import{z as B,m as N,B as V,bA as F,ac as j}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.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]="76e88467-3709-4dc1-be22-b5e708f7928c",e._sentryDebugIdIdentifier="sentry-dbid-76e88467-3709-4dc1-be22-b5e708f7928c")}catch{}})();function O(e){return k(e)==null}const $=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=j(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 f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.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(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function J(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(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(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DkPfdehf.js";import{j as J,h as re,u as Z,l as Y,g as E,N as $,k as K,i as mt,n as ct,o as k}from"./core-DJZqFFKe.js";import{eO as V,NB as le,c1 as me,BJ as xe,jL as dt,BW as ne,BV as ae,NC as ut,bn as ce,fI as Te,ND as pt,JY as bt,jA as De,JZ as fe,J_ as gt,iv as ht,MS as St,iK as ft,Bx as It,sm as yt,iC as Rt,Ch as je,NE as Fe,NF as At,NG as Ct,NH as vt,NI as kt,NJ as Et,C1 as Ie,iQ as wt,M$ as Bt,BX as xt,BH as Tt,NK as Dt,BG as jt,NL as Ft,BP as ye,C5 as Ut,C4 as Lt,C0 as Nt,NM as Ue,H6 as Pt,bo as Mt,BS as $t,Cz as _t,NN as Ot,NO as zt,Cd as Gt,Ca as Re,Ml as Ht,BE as Zt,NP as Le,CY as Ae,D4 as Vt,NQ as Wt,NR as G,NS as Jt,NT as Ne,NU as Kt,NV as Pe,NW as Me,Cp as se,bt as qt,bF as de,cB as ue,eU as $e,eS as _e,NX as Xt,gM as Yt,My as Qt,NY as en,NZ as Oe,MC as tn,Nk as nn,N_ as an,NA as sn,D1 as Ce,D0 as on,N$ as rn,O0 as ln,O1 as mn,O2 as cn,O3 as dn,N5 as un,CT as pn,CX as bn,bv as gn,bE as hn,cw as Sn,ck as fn,bs as In,IS as yn,cM as Rn,cO as An,cN as Cn,cv as vn}from"./zeni-epic-state-CNc-1z4P.js";import{n as ze,Z as Ge,y as Q,S as C,z as P,bK as He,s as ee,c as v,aE as ve,o as j,aq as X,E as kn,D as Ze,bL as En,j as H,bM as wn,k as te,bN as Bn,R as xn,C as Tn,B as pe,e as Ve,a3 as Dn,bb as jn,W as Fn,m as We,bO as Un,a6 as Ln}from"./index-D7lET21U.js";import{n as _,S as Nn}from"./mui-Ctp_ou6C.js";import ie from"./NotFoundScreen-C0APD5Cv.js";import{S as ke}from"./SetupPagesScreen-Bp4AY0Mi.js";import{F as Je}from"./FeaturePreviewScreen-BS0CUw64.js";import{a as S}from"./sentry-BxQ6uAJu.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-CiCnpKpN.js";import{u as Ke}from"./useInitialThreadRequest-Dt7T5zj_.js";import{c as qe}from"./useFetchSuggestedQuestionsWhenReady-3NQ4UG95.js";import{D as Pn}from"./DrawerScreen-CqfyZCQa.js";import{M as Xe}from"./MobileAppDrawer-DtbNyRlE.js";import{R as Mn}from"./ReimbursementApprovalRoutes-C_KFvFIG.js";import{FallBackRoute as $n}from"./ScreenRoutes-BexdZAU9.js";import"./recharts-D041iH6A.js";import"./analytics-C6M-DE9i.js";import"./plaid-VWs98BAj.js";import"./dnd-un89-W8a.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-PtdQRY.js";import"./lexical-ChRCvCis.js";import"./pdf-xyjfLAhh.js";import"./utils-D2tZzHCG.js";import"./analyticsHelper-CcCG6rlr.js";import"./routePaths-B7y8nrZh.js";import"./BusinessVerificationPageScreen-DYMZT7MK.js";import"./ReimbursementApprovalRuleDetailScreen-Di2Ku2FG.js";import"./getLocaleForTenant-DRam5UTN.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]="85ba7d60-3638-4b86-874e-a452e4db749e",e._sentryDebugIdIdentifier="sentry-dbid-85ba7d60-3638-4b86-874e-a452e4db749e")}catch{}})();const Ye=e=>`/${e}/reimbursements`,_n=e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Ct({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Ye(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(ft(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(fe("common"))},onCancelAutoComplete:()=>{e(fe("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=Y(),d=ze(),c=Ge(),[m,o]=S.useState(r==null),[a,i]=S.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(C.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(C.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,B]=S.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Ke(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);S.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
|
|
1
|
+
import{j as s}from"./liveblocks-DRCozBQX.js";import{j as J,h as re,u as Z,l as Y,g as E,N as $,k as K,i as mt,n as ct,o as k}from"./core-D9lzXsHE.js";import{eO as V,NB as le,c1 as me,BJ as xe,jL as dt,BW as ne,BV as ae,NC as ut,bn as ce,fI as Te,ND as pt,JY as bt,jA as De,JZ as fe,J_ as gt,iv as ht,MS as St,iK as ft,Bx as It,sm as yt,iC as Rt,Ch as je,NE as Fe,NF as At,NG as Ct,NH as vt,NI as kt,NJ as Et,C1 as Ie,iQ as wt,M$ as Bt,BX as xt,BH as Tt,NK as Dt,BG as jt,NL as Ft,BP as ye,C5 as Ut,C4 as Lt,C0 as Nt,NM as Ue,H6 as Pt,bo as Mt,BS as $t,Cz as _t,NN as Ot,NO as zt,Cd as Gt,Ca as Re,Ml as Ht,BE as Zt,NP as Le,CY as Ae,D4 as Vt,NQ as Wt,NR as G,NS as Jt,NT as Ne,NU as Kt,NV as Pe,NW as Me,Cp as se,bt as qt,bF as de,cB as ue,eU as $e,eS as _e,NX as Xt,gM as Yt,My as Qt,NY as en,NZ as Oe,MC as tn,Nk as nn,N_ as an,NA as sn,D1 as Ce,D0 as on,N$ as rn,O0 as ln,O1 as mn,O2 as cn,O3 as dn,N5 as un,CT as pn,CX as bn,bv as gn,bE as hn,cw as Sn,ck as fn,bs as In,IS as yn,cM as Rn,cO as An,cN as Cn,cv as vn}from"./zeni-epic-state-CthkBqEW.js";import{n as ze,Z as Ge,y as Q,S as C,z as P,bK as He,s as ee,c as v,aE as ve,o as j,aq as X,E as kn,D as Ze,bL as En,j as H,bM as wn,k as te,bN as Bn,R as xn,C as Tn,B as pe,e as Ve,a3 as Dn,bb as jn,W as Fn,m as We,bO as Un,a6 as Ln}from"./index-D4WqoFTE.js";import{n as _,S as Nn}from"./mui-uwgkpTLc.js";import ie from"./NotFoundScreen-BUTU_-cN.js";import{S as ke}from"./SetupPagesScreen-DVIzlP-5.js";import{F as Je}from"./FeaturePreviewScreen-BCRZsfyQ.js";import{a as S}from"./sentry-B4qAfutp.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-mLaTPohd.js";import{u as Ke}from"./useInitialThreadRequest-Cw2FMHcf.js";import{c as qe}from"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import{D as Pn}from"./DrawerScreen-BYBgvD5u.js";import{M as Xe}from"./MobileAppDrawer-D_MxSFu1.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CK7PuiBG.js";import{FallBackRoute as $n}from"./ScreenRoutes-U1ZbFVRi.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";import"./analyticsHelper-DhFEnfI7.js";import"./routePaths-C2HBowO1.js";import"./BusinessVerificationPageScreen-BHqq2xxV.js";import"./ReimbursementApprovalRuleDetailScreen-DXvOZU5T.js";import"./getLocaleForTenant-BCu2Wbt5.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]="85ba7d60-3638-4b86-874e-a452e4db749e",e._sentryDebugIdIdentifier="sentry-dbid-85ba7d60-3638-4b86-874e-a452e4db749e")}catch{}})();const Ye=e=>`/${e}/reimbursements`,_n=e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Ct({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Ye(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(ft(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(fe("common"))},onCancelAutoComplete:()=>{e(fe("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=Y(),d=ze(),c=Ge(),[m,o]=S.useState(r==null),[a,i]=S.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(C.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(C.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,B]=S.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Ke(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);S.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-DkPfdehf.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-DJZqFFKe.js";import{eO as L,f8 as S,Jj as Ie,jA as Z,Jk as X,pS as O,jo as Re,is as Te,tm as K,pX as Ae,bv as Oe,Jl as ke,bn as Fe,ul as De,Jm as je,Jn as Ee,te as Pe,Jo as H,Jp as Le,Jq as Me,Jr as Be,Js as Je,Jt as w,Ju as k,Jv as F,Jw as Y,Jx as D,Jy as j,dC as ve,u1 as Ue,tR as N,tS as q,u7 as Ve,tW as $,ud as xe,Jz as ze,JA as Ge,JB as He,JC as Ye,JD as Ne,eU as qe,eS as $e}from"./zeni-epic-state-CNc-1z4P.js";import{M as Qe,Q as We,Z as Ze,y as ee,S as E,z as ae,R as Xe,k as Ke,a as ea,s as aa,c as P,e as sa,j as se,U as ta,V as oa,W as na}from"./index-D7lET21U.js";import"./mui-Ctp_ou6C.js";import ra from"./NotFoundScreen-C0APD5Cv.js";import{F as ia}from"./FeaturePreviewScreen-BS0CUw64.js";import{a as _}from"./sentry-BxQ6uAJu.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-3NQ4UG95.js";import{u as ma}from"./useInitialThreadRequest-Dt7T5zj_.js";import{t as Q,a as W}from"./routePaths-B7y8nrZh.js";import{M as fa}from"./MobileAppDrawer-DtbNyRlE.js";import"./recharts-D041iH6A.js";import"./analytics-C6M-DE9i.js";import"./plaid-VWs98BAj.js";import"./dnd-un89-W8a.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-PtdQRY.js";import"./lexical-ChRCvCis.js";import"./pdf-xyjfLAhh.js";import"./utils-D2tZzHCG.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]="1191dca2-85c8-4c19-9a02-defe6906527b",e._sentryDebugIdIdentifier="sentry-dbid-1191dca2-85c8-4c19-9a02-defe6906527b")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},ha=Se(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},t=S(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Z(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(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(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),f.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,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 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 W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(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=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),m=Ze(),u=oa(m),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:f}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=ma(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>Z(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),A=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,v,T]);const U=Ke(),ce=U?.loggedInUserRole!=null&&Oe(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},me=ea(),fe=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=Qe(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(fa,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:fe&&me&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=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=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(E.isDebitCardFeatureEnabled),u=qe(m,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
|
|
1
|
+
import{j as p}from"./liveblocks-DRCozBQX.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-D9lzXsHE.js";import{eO as L,f8 as S,Jj as Ie,jA as Z,Jk as X,pS as O,jo as Re,is as Te,tm as K,pX as Ae,bv as Oe,Jl as ke,bn as Fe,ul as De,Jm as je,Jn as Ee,te as Pe,Jo as H,Jp as Le,Jq as Me,Jr as Be,Js as Je,Jt as w,Ju as k,Jv as F,Jw as Y,Jx as D,Jy as j,dC as ve,u1 as Ue,tR as N,tS as q,u7 as Ve,tW as $,ud as xe,Jz as ze,JA as Ge,JB as He,JC as Ye,JD as Ne,eU as qe,eS as $e}from"./zeni-epic-state-CthkBqEW.js";import{M as Qe,Q as We,Z as Ze,y as ee,S as E,z as ae,R as Xe,k as Ke,a as ea,s as aa,c as P,e as sa,j as se,U as ta,V as oa,W as na}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import ra from"./NotFoundScreen-BUTU_-cN.js";import{F as ia}from"./FeaturePreviewScreen-BCRZsfyQ.js";import{a as _}from"./sentry-B4qAfutp.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import{u as ma}from"./useInitialThreadRequest-Cw2FMHcf.js";import{t as Q,a as W}from"./routePaths-C2HBowO1.js";import{M as fa}from"./MobileAppDrawer-D_MxSFu1.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.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]="1191dca2-85c8-4c19-9a02-defe6906527b",e._sentryDebugIdIdentifier="sentry-dbid-1191dca2-85c8-4c19-9a02-defe6906527b")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},ha=Se(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},t=S(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Z(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(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(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),f.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,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 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 W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(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=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),m=Ze(),u=oa(m),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:f}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=ma(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>Z(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),A=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,v,T]);const U=Ke(),ce=U?.loggedInUserRole!=null&&Oe(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},me=ea(),fe=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=Qe(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(fa,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:fe&&me&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=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=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(E.isDebitCardFeatureEnabled),u=qe(m,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-DRCozBQX.js";import{y as w,z as j,aK as y,s as E,c as p,e as F,cF as P,S as L}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.js";import l from"./NotFoundScreen-BUTU_-cN.js";import{a as f}from"./sentry-B4qAfutp.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-D9lzXsHE.js";import{eO as z,PW as C,ML as Y,PX as _,tI as G,e_ as O,PY as K,tG as M}from"./zeni-epic-state-CthkBqEW.js";import{R as x}from"./ReferralListScreen-DZ5cxHIr.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";import"./useAskAiCfoHostNavButtonProps-mLaTPohd.js";import"./useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js";import"./MobileAppDrawer-D_MxSFu1.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]="45fa892a-e508-4954-8f58-6eb985016f27",e._sentryDebugIdIdentifier="sentry-dbid-45fa892a-e508-4954-8f58-6eb985016f27")}catch{}})();const W=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=j.getSignedInUser();return{onDismissClick:()=>{e(_()),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(M())},onUpdateInviteFormLocalData:s=>{e(K({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),X=()=>{const e=T(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=V(),k=A(),{useDynamicConfig:g}=w(),d=j.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),D=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),v=Y(S);f.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),f.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(O(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:k,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=w(),{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(X,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
|