@zeniai/web-app-ui 5.4.8-dev → 5.4.9-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccountMappingScreen-BVoif-LS.js +9 -0
- package/dist/assets/{ActualMatchingMatchDetailScreen-CpFxldZX.js → ActualMatchingMatchDetailScreen-37ukErZ3.js} +1 -1
- package/dist/assets/AddressRoutes-CTdswws_.js +1 -0
- package/dist/assets/AddressScreen-DIx8pAlP.js +9 -0
- package/dist/assets/{AiCfoScreen-D0ryurTs.js → AiCfoScreen-bkTvdFWM.js} +5 -5
- package/dist/assets/{AppDrawer-Bz9R1SRM.js → AppDrawer-Bqkq0J1O.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-CUhlkbFZ.js → BillPayApprovalRoutes-nVb6rKwz.js} +1 -1
- package/dist/assets/{BillPayRoutes-Cq7a-pm7.js → BillPayRoutes-D7EPBDh7.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-DMccZcIL.js +9 -0
- package/dist/assets/{CardsAiCfoScreen-i0herVW8.js → CardsAiCfoScreen-Cys2hC2x.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-DKqAyC6V.js → ChargeCardRoutes-rF3I93wy.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-B28ZIQmd.js → CompanyPassportScreen-DzTS_PxV.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-B7H-_PrY.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CqKrvs3q.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CGeTdTAp.js → CustomerOnboardingRoutes-DyQugrQS.js} +3 -3
- package/dist/assets/{DashboardRoutes-Cwe3Vuyf.js → DashboardRoutes-B7G0hGYD.js} +4 -4
- package/dist/assets/{DefaultTenantHome-Y19U_bWi.js → DefaultTenantHome-Dpr9pT2f.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BNWRfTvg.js +18 -0
- package/dist/assets/{DrawerScreen-BiLnsYxr.js → DrawerScreen-DEMkXBuJ.js} +1 -1
- package/dist/assets/EntityDetailRoutes-DlCSk6Xj.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CwVf58CT.js → ExpenseAutomationRoutes-DcYDpqvS.js} +5 -5
- package/dist/assets/FeaturePreviewScreen-CZZbV-Lj.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-XzCI6Wqi.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-Lon_JjZI.js → InboxNotificationsProvider-CzZNeGt1.js} +1 -1
- package/dist/assets/{InvoicingRoutes-CEhIyfKx.js → InvoicingRoutes-BZEd2Xd_.js} +2 -2
- package/dist/assets/MagicLinkRoutes-Ch_9Qa7Y.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-D7qEtB4W.js +12 -0
- package/dist/assets/MobileAppDrawer-DYOb_3zl.js +1 -0
- package/dist/assets/NotFoundScreen-hP5G-uHy.js +1 -0
- package/dist/assets/NotificationRoutes-DdgV7jbI.js +1 -0
- package/dist/assets/OAuthConsentScreen-CQqkncrK.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-77IqlyFS.js +1 -0
- package/dist/assets/{PaymentLinkScreen-Cu5uQlbD.js → PaymentLinkScreen-DMvOIo--.js} +1 -1
- package/dist/assets/PeopleRoutes-BWw5-zAe.js +22 -0
- package/dist/assets/{PerformanceRoutes-D57LkbmT.js → PerformanceRoutes-DMlk1Yfb.js} +1 -1
- package/dist/assets/{Preview-B_x0UYXC.js → Preview-SrROl7l3.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B_jTzA2E.js → QBOConnectionScreen-BJEzxzvn.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-D9UKdBqr.js → ReimbursementApprovalRoutes-BikedZ_D.js} +1 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-BVAueb7P.js +1 -0
- package/dist/assets/ReimbursementRoutes-B8-BBslS.js +68 -0
- package/dist/assets/{ReportsRoutes-97Pz3_w0.js → ReportsRoutes-BLQeDL9q.js} +1 -1
- package/dist/assets/RewardsRoutes-BeComSZ4.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CXq4al_v.js → ScheduleDetailsPrepaidExpensesScreen-BTeNJoD-.js} +5 -5
- package/dist/assets/ScreenRoutes-C_Y9Ih-I.js +2 -0
- package/dist/assets/{SettingsRoutes-CXOUMEST.js → SettingsRoutes-D1KLQYfe.js} +6 -6
- package/dist/assets/{SetupPagesScreen-DT18jEZS.js → SetupPagesScreen-D-sIYsOb.js} +5 -5
- package/dist/assets/SignInScreen-DYkAG0ir.js +1 -0
- package/dist/assets/SignOutScreen-CnE9aVZf.js +9 -0
- package/dist/assets/TaskListScreen-3oMHbvzs.js +9 -0
- package/dist/assets/TaskRoutes-gD6fXeIa.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CPgOmOJv.js +1 -0
- package/dist/assets/TransactionDetailScreen-DKDiKxK4.js +5 -0
- package/dist/assets/{TransactionListRoutes-DFYIfVzR.js → TransactionListRoutes-dt9sGf6m.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DweO_eX_.js → TreasuryRoutes-CuCdm5Gl.js} +6 -6
- package/dist/assets/{VendorsRoutes-CtkEV-aM.js → VendorsRoutes--pMAMDSH.js} +10 -10
- package/dist/assets/WiseConfirmationScreen-BOUXMp2T.js +12 -0
- package/dist/assets/ZeniAccountRoutes-CWyEeR9A.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-qY5rQsAd.js +9 -0
- package/dist/assets/{accountMappingHelper-CCESaK7R.js → accountMappingHelper-BV1cQq3A.js} +1 -1
- package/dist/assets/{analytics-BSYXJeF4.js → analytics-Cfs2G4_3.js} +1 -1
- package/dist/assets/{analyticsHelper-w2YkQjq1.js → analyticsHelper-USl63sKg.js} +1 -1
- package/dist/assets/{core-k1hJbZ6L.js → core-C1WlT0Gj.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CKsYKxPJ.js → decodeURIComponentSafe-7TTqX1My.js} +1 -1
- package/dist/assets/{dnd-CiTl8J_b.js → dnd-B-4X27-9.js} +1 -1
- package/dist/assets/{empty-DXUNZiQh.js → empty-CY_o0w8p.js} +1 -1
- package/dist/assets/{empty-Bzngm89v.js → empty-P6T33YMO.js} +1 -1
- package/dist/assets/{emptyVideoElement-qNZVYRIB.js → emptyVideoElement-DXwM8vzz.js} +1 -1
- package/dist/assets/epic-C_ztG9Vn.js +2 -0
- package/dist/assets/expenseAutomationHelper-DNfzvs5h.js +1 -0
- package/dist/assets/{getLocaleForTenant-Bok1bQNl.js → getLocaleForTenant-GRoZrOtf.js} +1 -1
- package/dist/assets/{index-DGy3NvOY.js → index-BXFluF17.js} +1 -1
- package/dist/assets/{index-Cjqi6Pkt.js → index-BaogokNB.js} +9420 -9420
- package/dist/assets/{index-B1EgaaVs.js → index-C7OizTrs.js} +1 -1
- package/dist/assets/{index-iZXXuKOD.js → index-CBN1-9DQ.js} +2 -2
- package/dist/assets/{index-BKGXj7ws.js → index-CLZ8aHkZ.js} +1 -1
- package/dist/assets/{index-Ce30h5vk.js → index-Cqlg1yss.js} +1 -1
- package/dist/assets/{index-CdAfnjbO.js → index-D6d3wrtH.js} +1 -1
- package/dist/assets/{index-BYIWMErm.js → index-rFi6I5F-.js} +1 -1
- package/dist/assets/{lexical-YTMAFU1j.js → lexical-Dmnf9NSK.js} +1 -1
- package/dist/assets/{liveblocks-oxGmLiGE.js → liveblocks-DQb3Em37.js} +1 -1
- package/dist/assets/{lottie-DXQhXtqa.js → lottie-B_xwqN2A.js} +1 -1
- package/dist/assets/{mui-D8QuRJEy.js → mui-D2HFTrjh.js} +1 -1
- package/dist/assets/{pathToGoBack-BvtdrmIA.js → pathToGoBack-Djr4VFL1.js} +1 -1
- package/dist/assets/{pdf-QcH92u4w.js → pdf-DDFs-jyU.js} +3 -3
- package/dist/assets/{pdf-lib-CmPW-Sf3.js → pdf-lib-uEuVq1x5.js} +1 -1
- package/dist/assets/{plaid-CbZCK8Pe.js → plaid-D36sgvQh.js} +1 -1
- package/dist/assets/{pusher-DrskEKGJ.js → pusher-Bmhf7zdt.js} +1 -1
- package/dist/assets/{react-DI5Tj1pD.js → react-ABjTKzj0.js} +1 -1
- package/dist/assets/{react-DLwkwTYN.js → react-BNxhEAR6.js} +1 -1
- package/dist/assets/{react-BFUAIjFB.js → react-DEkQrWnb.js} +1 -1
- package/dist/assets/{react-CTz3hOfW.js → react-DQ4Bdeyq.js} +1 -1
- package/dist/assets/{react-bRbgXAqh.js → react-Dypy880L.js} +1 -1
- package/dist/assets/{react-BdEbM4Cv.js → react-_dplkTkE.js} +1 -1
- package/dist/assets/{recharts-DZG9umMy.js → recharts-Cqzw8WNA.js} +1 -1
- package/dist/assets/{reportTimeframe-BoyB48qP.js → reportTimeframe-C4q_PyKL.js} +1 -1
- package/dist/assets/{routePaths-BQiUfv8Y.js → routePaths-B56KGAwY.js} +1 -1
- package/dist/assets/{sentry-CYolppN9.js → sentry-bn66aQBn.js} +1 -1
- package/dist/assets/{stripSplatSuffix-yEJV_xmD.js → stripSplatSuffix-Bc1c61un.js} +1 -1
- package/dist/assets/{url-Dvn7w47g.js → url-DQxeYqWJ.js} +1 -1
- package/dist/assets/{url-BJMHxMoG.js → url-alEaciYB.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-DC73Os7S.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BBN3Q32c.js → useAiCfoDashboardSuggestedQuestionsChips-Cj21wv_W.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-GW3aOOUV.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-DEUPC1vA.js → useChargeCardPusherEvents-BkaiNEUC.js} +1 -1
- package/dist/assets/{useDeviceId-BqvO5dq-.js → useDeviceId-nnRIPwcw.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BL7F1fI2.js +1 -0
- package/dist/assets/{useEnsureVendorListLoaded-CbkO2307.js → useEnsureVendorListLoaded-DT9MJB3G.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DKk3Gbri.js → useInitialThreadRequest-rwXc-zR2.js} +1 -1
- package/dist/assets/useTaskManagerAccess-Bq4KBSvW.js +1 -0
- package/dist/assets/{useTaskManagerPusherEvents-CULNono8.js → useTaskManagerPusherEvents-DiYOmCQ4.js} +1 -1
- package/dist/assets/{utils-CZxvf1-B.js → utils-C55XrdHj.js} +1 -1
- package/dist/assets/withTransactionSidePanel-LJitfor3.js +25 -0
- package/dist/assets/{zeni-epic-state-C2CKsxzr.js → zeni-epic-state-VpP2uC41.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AccountMappingScreen-DxODZ1Nk.js +0 -9
- package/dist/assets/AddressRoutes-K7qFYU4Q.js +0 -1
- package/dist/assets/AddressScreen-B7HfNJJM.js +0 -9
- package/dist/assets/BusinessVerificationPageScreen-YH2iMYXG.js +0 -9
- package/dist/assets/ConnectionAuthScreen-cnuYO2ir.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BugwGIlC.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-C3Fvc0vh.js +0 -18
- package/dist/assets/EntityDetailRoutes-DiWWQPIS.js +0 -1
- package/dist/assets/FeaturePreviewScreen-CVxHNITI.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-D5mS9Mm3.js +0 -1
- package/dist/assets/MagicLinkRoutes-Bbw6eA7p.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CMSV3Ecy.js +0 -12
- package/dist/assets/MobileAppDrawer-D95K9MWM.js +0 -1
- package/dist/assets/NotFoundScreen-ngkmWfLO.js +0 -1
- package/dist/assets/NotificationRoutes-OU4hmCU4.js +0 -1
- package/dist/assets/OAuthConsentScreen-BfPvpIZK.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-D5OxnQT-.js +0 -1
- package/dist/assets/PeopleRoutes-CRBdsznQ.js +0 -22
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CdBqEWoC.js +0 -1
- package/dist/assets/ReimbursementRoutes-DqKBNzYH.js +0 -68
- package/dist/assets/RewardsRoutes-CP48quzG.js +0 -1
- package/dist/assets/ScreenRoutes-EZYd0oGd.js +0 -2
- package/dist/assets/SignInScreen-D_kJ7A6-.js +0 -1
- package/dist/assets/SignOutScreen-Hgz5ILuE.js +0 -9
- package/dist/assets/TaskListScreen-PbWxRl0T.js +0 -9
- package/dist/assets/TaskRoutes-8igPnZpC.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BkrhGwVi.js +0 -1
- package/dist/assets/TransactionDetailScreen-CUF4XJ-a.js +0 -5
- package/dist/assets/WiseConfirmationScreen-Cvz0_zLL.js +0 -12
- package/dist/assets/ZeniAccountRoutes-ulGvqG-O.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-Dff7TUu2.js +0 -9
- package/dist/assets/epic-BVcu5QEC.js +0 -2
- package/dist/assets/expenseAutomationHelper-BfCR3sLm.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-BRI2b5oS.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BETiKk63.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-8S-s2Qbg.js +0 -1
- package/dist/assets/useTaskManagerAccess-CbR2C9f7.js +0 -1
- package/dist/assets/withTransactionSidePanel-zjTjrZrt.js +0 -25
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-DQb3Em37.js";import{a as g}from"./sentry-bn66aQBn.js";import{u as F,g as O,h as _,t as w,j as l,N as D}from"./core-C1WlT0Gj.js";import{z as r,G as M,N as P,j as A,O as N,Y as G,Z as R,R as Y}from"./index-BaogokNB.js";import{fI as W,UG as Z,V7 as $,U_ as q,gl as B,gn as H,V3 as J,gY as K,dl as Q,V8 as X,V9 as ee}from"./zeni-epic-state-VpP2uC41.js";import{u as te,n as ne}from"./mui-D2HFTrjh.js";import{u as se}from"./useDeviceId-nnRIPwcw.js";import{f as ae}from"./analyticsHelper-USl63sKg.js";import{t as ie}from"./getLocaleForTenant-GRoZrOtf.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="1897613b-5427-41eb-b4a6-e28b31f99e73",t._sentryDebugIdIdentifier="sentry-dbid-1897613b-5427-41eb-b4a6-e28b31f99e73")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=F(),a=O(),f=_(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),I=l((e=>e.tenantState.signInState)),b=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>W(e))),h=l((e=>Z(e))),E=r.getSignedInUser(),v=te().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t($(n,i,m)))}),[n,p,t,i,m,s?.zeniSessionId]),g.useEffect((()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(q(h.tenantsInOrder),s.zeniSessionId),B(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(J("Completed")),M.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,h.tenantsInOrder),K().then((()=>{const e=Y();e!=null&&P(e)})),setTimeout((()=>{A.trackLogin(N.Event.loginSuccess,"email",Q(o.productSettings))}),2e3))}),[I,S,y,s,o,h,v,a.state,t]);const U=g.useCallback((()=>{f("/signin/auth")}),[f]),j=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(X(i,c,d))}),[i,d,t,c]),V=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(ee(e,i,c,d))}),[i,n,t,c,d]);if(b==="Completed"&&d!=null)return u.jsx(G,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:V,onCancelVerifyDevice:U});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(D,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||m==null||b==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||b==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
z-index: 9999;
|
|
11
|
+
background-color: ${t=>t.theme.colors.background};
|
|
12
|
+
`;export{Te as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as D}from"./liveblocks-DQb3Em37.js";import{a as m}from"./sentry-bn66aQBn.js";import{u as te,j as t,i as $e,g as Ge,h as Ue,q as F}from"./core-C1WlT0Gj.js";import{fI as ne,UH as Me,UI as se,gc as xe,fH as Ne,UR as Re,UK as Pe,UL as Ve,q3 as Le,gp as Oe,UO as b,UT as je,UU as K,gq as He,UV as Ze,ED as qe,h5 as ze,cX as We,UW as Xe,gb as Ye,gr as Je}from"./zeni-epic-state-VpP2uC41.js";import{w as Ke,i as Qe,s as ea,p as aa,d as ta,f as na,u as sa,c,g as oa,r as ia,z as ra,e as da,l as ca,X as la,v as ua,n as ma,o as Q,L as fa,E as ha,F as ba,k as S,j as ee,A as pa,J as ae,C as ga,D as Sa}from"./index-BaogokNB.js";import{D as Ea}from"./mui-D2HFTrjh.js";import{u as ka}from"./InboxNotificationsProvider-CzZNeGt1.js";import{u as Ca}from"./useTaskManagerAccess-Bq4KBSvW.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="d357e083-364d-4f1b-8b8d-77e03764d4b4",l._sentryDebugIdIdentifier="sentry-dbid-d357e083-364d-4f1b-8b8d-77e03764d4b4")}catch{}})();const Ta=Ke((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=$e(),a=Ge(),E=ea(),n=Ue(),B=xe(),r=te(),{useFeatureGate:d}=aa(),p=ta(),{isTaskManagerAccessEnabled:k}=Ca(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>Ne(e))),{status:ie}=t(Re),G=$.uiState.currentChatSessionId,C=na(),{setLoading:re}=sa(),[w,U]=m.useState(void 0),A=F("/:tenantEmailDomain/dashboard")!==null,M=F("/:tenantEmailDomain/reports")!==null,f=F("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=d(c.isDebitCardFeatureEnabled),le=oa(o,ce,x),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),N=t((e=>Pe(e))),{isFeatureEnabled:T}=d(c.isReferralFeatureEnabled),v=t((e=>Ve(e)));m.useEffect((()=>{C&&T&&!f&&v.fetchState==="Not-Started"&&r(Le(!0))}),[C,T,v.fetchState,f]);const _=t((e=>e.tenantState)),me=t((e=>_.fetchState==="Completed"?Oe(e):[])),g=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:fe}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:he}=d(c.isArAgingFeatureEnabled),R=ia(),{isFeatureEnabled:be}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarNewYearAnimationEnabled),Ee=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",ke=t((e=>b(e).totalUnreadCount)),Ce=t((e=>b(e).reducedFetchCountState)),P=t((e=>b(e).notificationDetailsByTab.tasks.uiState.unreadCount)),V=t((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),L=t((e=>b(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:O,isLoading:j,isFetchingMore:H,hasFetchedAll:Z,fetchMore:Te}=ka();m.useEffect((()=>{const e=setTimeout((()=>Te?.()),0);return()=>clearTimeout(e)})),m.useEffect((()=>{if(j===!1&&H===!1&&Z===!0)if(o?.companyId!=null&&O!=null){const e=`dashboard_${o.companyId}`;U(O.filter((u=>u.roomId===e&&u.readAt==null)).length)}else U(0)}),[j,H,Z]),m.useEffect((()=>{C&&k&&!f&&L.fetchState==="Not-Started"&&B.tenantId!=null&&r(je("task_manager","dashboard"))}),[C,k,f,L.fetchState,B.tenantId,r]),m.useEffect((()=>{f||I.fetchState!=="Not-Started"||r(K({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,I.fetchState,r]),m.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(K({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ce,count:ke},q=s!=null?ra.getSignedInUserTenant(s):null,z=t((e=>q?.tenantId!=null?He(e,q.tenantId):void 0)),h=[];fe===!1&&h.push("accounts_payable_aging"),he===!1&&h.push("accounts_receivable_aging"),h.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&h.push("rewards_card"),R===!1&&h.push("expense_automation_card");const W=t((e=>Ze(e,h).fetchState)),X=t((e=>qe(e).fetchState)),ye=A&&(W==="Completed"||W==="Error")||M&&(X==="Completed"||X==="Error")||!A&&!M?void 0:"disabled",we=m.useMemo((()=>ze(o.userRole)),[o.userRole]),Ae=We(we),ve=o?.rewardsLastViewedTime==null,_e=p?.userEmail!=null&&N.fetchState==="Completed"&&Xe(N.notificationSettings,p.userEmail,x,o,k),Y=da(),Fe=Y&&ca(a);return D.jsx(Ea,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:D.jsx(la,{signedInUser:p,currentTenantId:_.currentTenantId??"",tenants:_.fetchState==="Completed"?me:z!=null?[z]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:Q(a),isInvoicing:ma(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:Ae,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:Ee,isNotificationsTabVisible:_e,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:R,selectedMenu:ua(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:ve,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:Y,onNotificationIconClick:()=>{i(!1);let e=P===0&&V>0?"notifications/comments":"notifications/tasks";Q(a)&&(e=P===0&&V>0?"../../notifications/comments":"../../notifications/tasks");const u=S(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=S(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:S(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void pa({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=S(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=S(a.state?.pathnameStackToGoBack,a.pathname),J=e.type,De=ae(J)&&J!=="command_center";if(ae(e.type)&&g[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(g[o.tenantId].month,g[o.tenantId].year,"Sidebar"),De&&g[o.tenantId]!=null){const y=g[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const Be=ga(e.type);Sa(e.type)?(G!=null&&r(Je()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${Be}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(fa.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:ba(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{E.toggle()},isAiCfo:Fe,aiCfoView:$,isOnDashboard:A,updateCurrentChatSessionId:e=>{r(Ye({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:be,isTaskManagerAccessEnabled:k,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:ge,newYearAnimationEnabled:Se})})})),Ba=l=>{const i=te(),s=t((E=>ne(E))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(E,n)=>{Qe(n)&&Me(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return D.jsx(Ta,{...l,...a})};export{Ba as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-DQb3Em37.js";import{h as r,l as i}from"./core-C1WlT0Gj.js";import{ak as n}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import"./sentry-bn66aQBn.js";import"./zeni-epic-state-VpP2uC41.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.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]="e1fe4b0b-a509-4443-892f-577d1dfd5036",o._sentryDebugIdIdentifier="sentry-dbid-e1fe4b0b-a509-4443-892f-577d1dfd5036")}catch{}})();const a=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as mt,b as lt,o as ft,j as N}from"./liveblocks-DQb3Em37.js";import ut from"./NotFoundScreen-hP5G-uHy.js";import{a as k}from"./sentry-bn66aQBn.js";import{h as ht,g as pt,i as kt,u as gt,j as S,l as St,n as bt,o as Z}from"./core-C1WlT0Gj.js";import{cC as It,UK as K,fI as Y,h5 as Tt,UO as b,a1Y as z,UU as m,UI as y,AO as F,GB as Ct,a1Z as At,UH as yt,UW as Et,AT as _t,a1_ as $,br as j,gk as x,AX as J,a1$ as Nt,cO as Bt,cH as wt}from"./zeni-epic-state-VpP2uC41.js";import{ao as xt,d as Ut,p as vt,c as Dt,aq as Rt,dL as Gt,k as B,dM as Pt,w as Mt,dN as $t,i as jt,a2 as Ft}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{u as Lt}from"./useTaskManagerAccess-Bq4KBSvW.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.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]="88c8a4c4-4137-46c5-8f2e-898283073941",t._sentryDebugIdIdentifier="sentry-dbid-88c8a4c4-4137-46c5-8f2e-898283073941")}catch{}})();const Ot=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),qt=St((function(t,l){const n=K(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=b(t),f=Y(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}d==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(a),t($([a],j())));let i=`/${h}/${r[1]}`;const T=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!wt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,s)=>{t(y(a,s))},onUpdateNotificationTabState:(a,s)=>{t(m(a,s))},onUpdateNotificationViewCurrentTabAndSubTab:(a,s)=>{t(z(a,s));const d=`../${a}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,s)=>{if(a==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(F("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(a,s,d,r)=>{a==="tasks"?t(J("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t($([i],j())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Ot(o,I).then((()=>{t($(o,j())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Mt($t)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=It(h??""),o=gt(),f=Ut(),[I,v]=k.useState(!1),a=S((e=>K(e))),s=S((e=>Y(e))),{useFeatureGate:d}=vt(),{isFeatureEnabled:r}=d(Dt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:T}=Vt({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Q=Tt(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),L=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),tt=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),R=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),et=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),at=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),st=Gt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:G,fetchMore:ot}=mt(),{threads:O,isLoading:q,fetchMore:W,isFetchingMore:H,hasFetchedAll:X}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(L!==c&&c!=null&&o(z(c)),c==null){const e=`../${L}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&C===!0&&s?.companyId!=null&&w!=null){const e=`dashboard_${s.companyId}`,p=w.filter((A=>A.roomId===e&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const P=E||G===!0||C!==!0||E||G===!0||C!==!0;k.useEffect((()=>{P&&R!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):P||R!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[P,R]),k.useEffect((()=>{o(y({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&I===!1&&(v(!0),o(Ct()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&q===!1&&w!=null&&O!=null){const e=`dashboard_${s.companyId}`,p=w.filter((u=>u.roomId===e)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=O.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(H||X===!0||W==null||W(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,G,H,C,X,q,w?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(jt(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),o(F("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Lt(f);return N.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:Q,signedInUser:f,externalNotificationsUnreadCount:et,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:at,isAiCfoAccessEnabled:i,onAskAiCfoClick:T,...nt})};function me(){return N.jsxs(bt,{children:[N.jsx(Z,{path:"/:selectedTab",element:N.jsx(Wt,{})}),N.jsx(Z,{path:"*",element:N.jsx(ut,{})})]})}export{me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-DQb3Em37.js";import{a as r}from"./sentry-bn66aQBn.js";import{u as A,g as j,j as o,N as C}from"./core-C1WlT0Gj.js";import{Vl as P,fI as V,gp as x,Vm as z,Vn as D,Vo as M,Vp as R,pW as k,U0 as L}from"./zeni-epic-state-VpP2uC41.js";import{z as h,af as I}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.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]="a2186d74-3437-4e2e-b827-ed9e4f4d0446",n._sentryDebugIdIdentifier="sentry-dbid-a2186d74-3437-4e2e-b827-ed9e4f4d0446")}catch{}})();function ee(){const n=A(),s=j(),{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(),f=o((e=>V(e))),l=o((e=>x(e))),d=o((e=>e.tenantState.fetchState)),y=o(z),v=o(D),u=o(M),[S,b]=r.useState(null),[E,U]=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 _=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((T=>T.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[f?.tenantId,l]),c=S??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:b,approveError:E??v,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{U("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-DQb3Em37.js";import{h as G,u as Y,g as z,i as X,j as d,l as H,n as J,o as S}from"./core-C1WlT0Gj.js";import{fI as v,Az as O,vc as K,We as w,v7 as T,bq as Q,c1 as Z,v8 as ee,Wf as ae,VX as C,ek as te,Es as se,Wg as oe,ER as re,e1 as ne,e0 as ce}from"./zeni-epic-state-VpP2uC41.js";import{ag as ie,z as le,ao as de,aq as me,V as fe,a6 as pe,j as M,aB as ue,k as he,p as ge,c as Fe}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import Ie from"./NotFoundScreen-hP5G-uHy.js";import{F as be}from"./FeaturePreviewScreen-CZZbV-Lj.js";import{a as g}from"./sentry-bn66aQBn.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{u as Ce}from"./useInitialThreadRequest-rwXc-zR2.js";import{t as Te}from"./routePaths-B56KGAwY.js";import{M as ye}from"./MobileAppDrawer-DYOb_3zl.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.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]="81c6b1ca-6eb4-4f26-97c2-1498fe678a4a",s._sentryDebugIdIdentifier="sentry-dbid-81c6b1ca-6eb4-4f26-97c2-1498fe678a4a")}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})}},Ae=H((function(s){const e=ae(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:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(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=te(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 u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=G(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=X(),[p,u]=g.useState(!1),[m,A]=g.useState(!1),F=le.getSignedInUser(),k=d((t=>v(t))),q=k.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),D=d((t=>t.reportUIOptionsState.selectedForecast)),j=t=>x.pandLByForecastID[t]!=null&&ee(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:W}=Se({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!p&&I)u(!0),l||a(K());else if(l&&!m){A(!0);const t=((f,P,R)=>P!=null?f.forecasts.findIndex((b=>b.id===P)):R!=null?f.forecasts.findIndex((b=>b.id===R)):f.forecasts.length>0?0:-1)(i,r,D?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=D?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!j(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,O,T,I]);const E=fe(),_=E?.loggedInUserRole!=null&&Q(E.loggedInUserRole),N=Ce(k?.companyId,{clearParams:l&&m}),[V,$]=g.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",F?.firstName??""),h.searchParams.set("lastname",F?.lastName??""),h.searchParams.set("email",F?.userEmail??"");const L=t=>{$(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:q,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:j,meetingUrl:Z(h.toString()),hasTransactionAccess:_,isAiCfoAccessEnabled:B,onAskAiCfoClick:W,initialOpenThreadRequest:N,onClickMenuIcon:()=>{L(!0)}})]})}function Xe(){const s=d((c=>v(c))),{useFeatureGate:e}=ge(),{isFeatureEnabled:a}=e(Fe.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(J,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{Xe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-DQb3Em37.js";import{a as p}from"./sentry-bn66aQBn.js";import{H as a,a7 as u,ab as f,ac as h}from"./index-BaogokNB.js";import{s as c}from"./mui-D2HFTrjh.js";import{i as y}from"./core-C1WlT0Gj.js";import"./zeni-epic-state-VpP2uC41.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.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]="4e512d53-3495-4744-9907-d08633789fa6",e._sentryDebugIdIdentifier="sentry-dbid-4e512d53-3495-4744-9907-d08633789fa6")}catch{}})();const g=c("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DQb3Em37.js";import{Wa as re,fI as Y,m3 as G,e1 as N,e0 as le,S$ as Q,Vy as ce,Di as Pe,Wb as J,D7 as je,Ds as Le,Dm as de,Db as pe,Dq as ve,Dn as Te,Wc as ue,sx as Ae,g9 as Ve,gG as Oe,Wd as H,Df as me,De as ge,Dv as Re,ca as Fe}from"./zeni-epic-state-VpP2uC41.js";import{$ as fe,p as X,c as W,z as _,g as he,K as Ce,ad as ye,ax as be,ay as Ze,a9 as Se,H as R,ae as De,G as K,az as Be,ao as Ue,aq as $e,a6 as ze,j as we,O as He,k as We,aA as Ge,V as _e}from"./index-BaogokNB.js";import{D as xe,n as M,S as Ie}from"./mui-D2HFTrjh.js";import ae from"./NotFoundScreen-hP5G-uHy.js";import{a as c}from"./sentry-bn66aQBn.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-C1WlT0Gj.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{M as Ne}from"./MobileAppDrawer-DYOb_3zl.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.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]="14a9be6f-38d0-4a71-9b80-9cecf8046086",e._sentryDebugIdIdentifier="sentry-dbid-14a9be6f-38d0-4a71-9b80-9cecf8046086")}catch{}})();const Qe={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[F,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),E=g((l=>G(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(W.isDebitCardFeatureEnabled),P=N(I,p),v=le(p),T=Q(p),B=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{F===!0?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(W.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:V}=Ce(p?.tenantId),y=!L||V,O=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ze,{...s})]})})},ea=M(Ie)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,ke=M(De.H6Regular)`
|
|
6
|
+
margin-top: ${R.sp7};
|
|
7
|
+
padding-left: ${R.sp8};
|
|
8
|
+
padding-right: ${R.sp8};
|
|
9
|
+
color: ${e=>e.theme.colors.primary};
|
|
10
|
+
word-break: break-word;
|
|
11
|
+
`,Ee=M(De.LargeRegularSp)`
|
|
12
|
+
color: ${e=>e.theme.colors.hero};
|
|
13
|
+
padding-left: ${R.sp8};
|
|
14
|
+
padding-right: ${R.sp8};
|
|
15
|
+
margin-bottom: 30px;
|
|
16
|
+
margin-top: ${R.sp4};
|
|
17
|
+
white-space: pre-line;
|
|
18
|
+
`,aa={overlayWidth:new Se(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[F,Z]=c.useState(!1),[k,S]=c.useState(!1),D=g((o=>re(o))),r=g((o=>Y(o))),p=g((o=>G(o))),{useFeatureGate:E}=X(),{isFeatureEnabled:x}=E(W.isDebitCardFeatureEnabled),I=N(x,r),P=le(r),v=Q(r),T=ce(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{b(),m(J())},C=()=>{F===!0?S(!0):w()},A={onOkClick:()=>{S(!1),w()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(W.isChargeCardFeatureEnabled),L=he(r,j,x),{isCardsHidden:V}=Ce(r?.tenantId),y=!L||V,O=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),Z(!0)},onResetClick:w,onSaveClick:()=>{m(f==="zeni_only"?ve(e):Te())},onCloseClick:C,peopleDetails:D,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return c.useEffect((()=>{D.invitePersonState.fetchState==="Completed"&&(b(),m(J()))}),[D.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Be,{...s})]})})},ta=M(Ie)`
|
|
19
|
+
display: flex;
|
|
20
|
+
min-height: 100%;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
`,na=Je((function(e,t){const d=ue(e),n=_.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:we}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(H({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(H({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Me(),n=ee(),f=qe(),{areTenantIdsInSync:i}=Ue(),b=_.getSignedInUser(),h=g((s=>Y(s))),{useFeatureGate:m}=X(),{isFeatureEnabled:F}=m(W.isDebitCardFeatureEnabled),Z=g((s=>G(s))),k=!N(F,h)&&Z,S=Q(h),D=h?.tenantId,{tenantEmailDomain:r}=h,[p,E]=c.useState(!1),[x,I]=c.useState(!1),[P,v]=c.useState(!1),[T,B]=c.useState("off"),[U,w]=c.useState(!1),C=s=>{w(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Ye({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Ve(s.userState,s.userRoleState,s.userListViewState,"manager"))),V=g((s=>Oe(s))),y=h?.companyId;c.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(H({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),E(!0),n(me()))}),[p,b,D,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),v(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(H({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const O=()=>{I(!1),v(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:we,onLoad:s=>s.trackPageLoaded(He.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:O,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:O,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Ne,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(H({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=We(f.state?.pathnameStackToGoBack,f.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function ka(){const e=_e();return Fe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DQb3Em37.js";import E from"./NotFoundScreen-hP5G-uHy.js";import{a as r}from"./sentry-bn66aQBn.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as O,n as z,o as b}from"./core-C1WlT0Gj.js";import{fI as B,a20 as h,bo as F,bn as N,iP as V,gk as q}from"./zeni-epic-state-VpP2uC41.js";import{s as $,z as I,aq as G,dO as H}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{M as K}from"./MobileAppDrawer-DYOb_3zl.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.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]="c9538f22-6d4e-47c9-92b4-19b509b7f0ed",e._sentryDebugIdIdentifier="sentry-dbid-c9538f22-6d4e-47c9-92b4-19b509b7f0ed")}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}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(H),Q=()=>{const e=_(),t=v(),c=$(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:f}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({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"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=J({mobileExploreReferrer:"Performance"});return G({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:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/dashboard`,replace:!0})};function be(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(Q,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,R as a}from"./sentry-
|
|
1
|
+
import{a as h,R as a}from"./sentry-bn66aQBn.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`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:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as _l}from"./liveblocks-
|
|
1
|
+
import{j as _l}from"./liveblocks-DQb3Em37.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-bn66aQBn.js";import{L as ge,c1 as xc,fI as kc,UG as Tc,Vw as jl,ca as xl}from"./zeni-epic-state-VpP2uC41.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-C55XrdHj.js";import{r as cn}from"./empty-CY_o0w8p.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-uEuVq1x5.js";import{a as Ye,r as Fl}from"./index-BXFluF17.js";import{r as Ul}from"./index-C7OizTrs.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-C1WlT0Gj.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,E as Kl}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import{d as It}from"./decodeURIComponentSafe-7TTqX1My.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]="c36e4af9-1f6c-4892-9598-42626486282e",e._sentryDebugIdIdentifier="sentry-dbid-c36e4af9-1f6c-4892-9598-42626486282e")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(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 i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.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 t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=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},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={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(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
|
|
2
2
|
`),I=S(E).split(`
|
|
3
3
|
`),k=0,C="";if(O==="strictEqual"&&l(j)==="object"&&l(E)==="object"&&j!==null&&E!==null&&(O="strictEqualObject"),R.length===1&&I.length===1&&R[0]!==I[0]){var H=R[0].length+I[0].length;if(H<=10){if(!(l(j)==="object"&&j!==null||l(E)==="object"&&E!==null||j===0&&E===0))return"".concat(_[O],`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as o}from"./liveblocks-DQb3Em37.js";import z from"./NotFoundScreen-hP5G-uHy.js";import{a as p}from"./sentry-bn66aQBn.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as K,o as g}from"./core-C1WlT0Gj.js";import{fI as E,_4 as h,_m as w,Oe as U,Oa as L,Od as f,O3 as N,_L as B,O7 as q,Og as F}from"./zeni-epic-state-VpP2uC41.js";import{z as _,w as T,cb as G,o as $,bU as H,cc as J}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import{u as M}from"./useEnsureVendorListLoaded-DT9MJB3G.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-BVAueb7P.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="2988ffe3-3d4d-48b7-9c61-8a67a83ff2b5",e._sentryDebugIdIdentifier="sentry-dbid-2988ffe3-3d4d-48b7-9c61-8a67a83ff2b5")}catch{}})();const j="reimbursement-approval-rule-update",P=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(G)),Q=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>h(r))),b=u((r=>w(r).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(r,y,I)=>{r.endsWith(j)&&I.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(P,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(F(t,!0))}}}))(T(J)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=H(e?.tenantId);return s?o.jsx(Z,{isLoading:n}):o.jsx(Q,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),r=u((i=>h(i)));M();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(q(!1,!0)))}),[v,b,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,r,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return o.jsxs(K,{children:[o.jsx(g,{path:"/",element:o.jsx(Y,{})}),o.jsx(g,{path:"/new",element:o.jsx(x,{})}),o.jsx(g,{path:"/:approvalRuleId/edit",element:o.jsx(x,{})}),o.jsx(g,{path:"*",element:o.jsx(z,{})})]})}export{ue as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-DQb3Em37.js";import{a as y}from"./sentry-bn66aQBn.js";import{h as T,u as x,g as C,i as V,j as R,l as k}from"./core-C1WlT0Gj.js";import{_m as _,_4 as O,O6 as j,Oj as B,Oe as A,Of as E,_n as F,fI as K,Od as L}from"./zeni-epic-state-VpP2uC41.js";import{z as N,a5 as P,c2 as W,o as $,bU as G,c3 as H}from"./index-BaogokNB.js";import{u as q}from"./mui-D2HFTrjh.js";import{u as J}from"./useEnsureVendorListLoaded-DT9MJB3G.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]="a47cc9ed-4ade-4eaa-9950-28e8a2b273d6",e._sentryDebugIdIdentifier="sentry-dbid-a47cc9ed-4ade-4eaa-9950-28e8a2b273d6")}catch{}})();const M=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return o.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===o.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=T(),o=x(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),o(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:s,vendorNamesById:i,editingRuleId:p==="approval_update"?o.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,z=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=z.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=R((t=>K(t))),{isApprovalRulesV3Enabled:o}=G(e?.tenantId);return o?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=T(),o=x(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),o(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,se as i};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DQb3Em37.js";import{u as ae,j as R,h as Q,g as Y,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-C1WlT0Gj.js";import{fI as H,Oa as ct,$R as ge,ca as he,Ng as Fe,me as dt,Nv as ce,Nu as de,$S as ut,bn as fe,gZ as Le,$T as pt,XB as bt,m3 as $e,XC as ke,XD as gt,kR as ht,ZS as ft,l4 as St,N4 as It,CA as yt,kY as vt,NR as Ne,$U as Pe,$V as Ce,$W as At,$X as Rt,$Y as kt,NB as we,la as Ct,Z$ as wt,Nt as Et,Ne as xt,$Z as Bt,Nd as Tt,$_ as Dt,Nl as Ee,NF as jt,NE as Ut,NA as Ft,$$ as _e,S$ as Lt,bo as $t,No as Nt,O7 as Pt,a00 as _t,a01 as Mt,NN as Ot,NK as xe,Zm as Zt,Nb as zt,a02 as Me,OA as Be,OI as Gt,a03 as Vt,a04 as X,a05 as Ht,a06 as Oe,a07 as Wt,a08 as Ze,a09 as ze,NZ as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a0a as Xt,gk as Kt,Zz as Yt,a0b as Jt,a0c as He,ZD as Qt,_m as en,a0d as tn,_L as nn,OF as Te,OE as an,a0e as sn,a0f as on,a0g as rn,a0h as ln,a0i as mn,_5 as cn,Ov as dn,Oz as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,U$ as Sn,dc as In,df as yn,de as vn,cH as An}from"./zeni-epic-state-VpP2uC41.js";import{bU as Rn,s as We,$ as qe,p as oe,c as F,z as L,cT as Xe,a6 as re,j as E,aQ as De,H as j,ac as se,ad as kn,G as Ke,cU as Cn,k as K,aq as Ye,cV as wn,V as le,cW as En,ao as xn,a9 as Bn,a5 as ye,O as Je,w as Tn,bC as Dn,at as jn,ag as Un,cX as Fn,g as Ln}from"./index-BaogokNB.js";import{n as P,S as $n,u as Qe}from"./mui-D2HFTrjh.js";import pe from"./NotFoundScreen-hP5G-uHy.js";import{S as je}from"./SetupPagesScreen-D-sIYsOb.js";import{F as et}from"./FeaturePreviewScreen-CZZbV-Lj.js";import{a as g}from"./sentry-bn66aQBn.js";import{u as ve}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{u as tt}from"./useInitialThreadRequest-rwXc-zR2.js";import{D as Nn}from"./DrawerScreen-DEMkXBuJ.js";import{M as nt}from"./MobileAppDrawer-DYOb_3zl.js";import{F as Pn}from"./ScreenRoutes-C_Y9Ih-I.js";import{R as _n}from"./ReimbursementApprovalRoutes-BikedZ_D.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./BusinessVerificationPageScreen-DMccZcIL.js";import"./routePaths-B56KGAwY.js";import"./analyticsHelper-USl63sKg.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.js";import"./getLocaleForTenant-GRoZrOtf.js";import"./useEnsureVendorListLoaded-DT9MJB3G.js";import"./ReimbursementApprovalRuleDetailScreen-BVAueb7P.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]="3a752fc9-887a-4092-96c3-069fd58623df",e._sentryDebugIdIdentifier="sentry-dbid-3a752fc9-887a-4092-96c3-069fd58623df")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ke.getLocalizedStrings(),On=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),m=L.getSignedInUser(),c=fe(m),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,m?.userId??"");let I=`${m?.firstName} ${m?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=m?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:E,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(Ee(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(Rt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(At({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=K(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Ue(){const e=Q(),t=ae(),n=Y(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(F.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(F.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=ve({mobileExploreReferrer:"Reimbursement Details"}),B=Y().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,v]=g.useState(!1),S=L.getSignedInUser(),w=R((b=>H(b))),h=R((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),U=he(w?.userRole??[]);(function(){const b=ae(),M=R((J=>H(J))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=Rn(O),z=R((J=>J.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(v(!0),t(Fe(!1,I,u,r)))}));const A=R((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const _={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||U&&h.billStatus==="rejected"||U===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:c,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const Zn=P.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
6
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
+
`,zn=P.div`
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
background-color: ${kn.overlayBackgroundBlack};
|
|
14
|
+
z-index: 5;
|
|
15
|
+
`,Gn=P.div`
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
width: 42%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
z-index: 6;
|
|
22
|
+
display: flex;
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
`,Vn=P.div`
|
|
26
|
+
position: fixed;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
z-index: 11;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
overflow-y: auto;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
`,Hn=P.button`
|
|
37
|
+
align-self: flex-end;
|
|
38
|
+
background: none;
|
|
39
|
+
border: none;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
padding: ${j.sp2} ${j.sp3};
|
|
42
|
+
line-height: 1;
|
|
43
|
+
color: ${e=>e.theme.colors.hero};
|
|
44
|
+
&:hover {
|
|
45
|
+
color: ${e=>e.theme.colors.primary};
|
|
46
|
+
}
|
|
47
|
+
svg {
|
|
48
|
+
width: ${j.sp4};
|
|
49
|
+
height: ${j.sp4};
|
|
50
|
+
}
|
|
51
|
+
`,Wn=P.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
width: 100%;
|
|
55
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
+
`,qn=ee((function(e,t){const n=_e(e,t.reimbursementId),r=L.getSignedInUser(),m=fe(r),c=e.tenantState.currentTenantId,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},i=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=_t(n.remiActivities,Mt(t.currentTenant),r));const o=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:d,signedInUser:r,createdBy:i,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:o,showApproveRejectBtns:a,isZeniUser:m,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r;return{onDuplicateLineClick:(a,o)=>window.open(`/${i}/reimbursement/${a}#L${o}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=at(i),o=K(m.state?.pathnameStackToGoBack,m.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onSaveRealTimeApprovals:a=>{e(zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=K(m.state?.pathnameStackToGoBack,m.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{E.trackReimbursementDeleteReimbursement(n),e(Ne(n))},cancelAndDeleteReport:a=>{a===!0?E.trackReimbursementCancelAndDeleteReimbursement(n):E.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{d.toggle()}}}))(wn);function Xn(){const e=Q(),t=ae(),n=Y(),r=n.hash.substring(1),m=We(),{reimbursementId:c}=ie(),d=L.getSignedInUser(),i=R((A=>H(A))),a=R((A=>_e(A,c??""))),o=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(i?.companyId,{clearParams:a.fetchState==="Completed"&&!o}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:I}=ve({mobileExploreReferrer:"Reimbursement Details"});Ye({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=oe(),{isFeatureEnabled:T}=u(F.isLimitedCategoryForReimbursement),[y,B]=g.useState(!1),[D,k]=g.useState(!1),[C,v]=g.useState(!1),{isFeatureEnabled:S}=u(F.isShowDeletedReimbursementsFeatureEnabled),w=R((A=>ge(A,c??""))),h=Lt(i),$=$t(i.userRole),U=a.fetchState;if(g.useEffect((()=>{y||c==null?y==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(c,!1,S)))}),[y,c,t,U]),g.useEffect((()=>{S&&a.remiDetails?.isDeleted===!0||i.isZeni===!0&&d?.userEmailDomain==="zeni.ai"&&h===!1?v(!1):v(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((A=>A.user.userId===d?.userId))!=null||a.remiDetails?.lastUpdatedBy===d?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,i.isZeni,h,d]),g.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||w.fetchState=="Completed"||w.fetchState=="In-Progress"||(k(!0),t(Fe(!1,T,S,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,c,t]),d==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:A=>(_=>{c!=null&&_.trackReimbursementReimbursementDetails(c)})(A)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:S,location:n,navigate:e,isRealTimeApprovalEnabled:C,currentTenant:i,reimbursementId:c??"",themeState:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:I})]})}const Kn=ee((function(e,t){return{remisReviewView:Me(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Be("approved",r??""));break;case"reject":e(Be("rejected",r??""))}}}}))(En);function Yn({tenantEmailDomain:e}){const t=Q(),n=R((d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=R((d=>Me(d))),m=le(),c=m?.loggedInUserRole?.includes("admin")===!0;return g.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Kn,{navigate:t,analytics:E,isAdmin:c,tenantEmailDomain:e})}const V=Qt(),st="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:Jn,common:me}=Ke.getLocalizedStrings(),Qn=Jn.reimbursement.bulkActions,ea=P.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
min-height: 100%;
|
|
59
|
+
width: 100%;
|
|
60
|
+
flex: 1 1 auto;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
align-items: center;
|
|
63
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
+
`,ta=ee((function(e,t){const n=ze(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const m=L.getSignedInUser(),c=fe(m),d=e.tenantState.currentTenantId,i=H(e),a=i?.companyName??"",o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:d??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const p=n.fetchState,I=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:E,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:o,companyName:a,timePeriod:V,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:m,period:c}=t,{tenantEmailDomain:d}=r;return{updateTabToState:i=>{e(X()),e(Oe(i))},onSubtabChange:i=>{e(X()),e(Ze(i))},onTransactionClick:(i,a)=>{const o=sa(d,i,a),l=K(m.state?.pathnameStackToGoBack,m.pathname);n(o,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const i=aa(d),a=K(m.state?.pathnameStackToGoBack,m.pathname);n(i,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:i}=t.currentTenant;E?.trackReimbursementNewReimbursement();const a=`/${i}/reimbursement/new`,o=K(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:o}})},onColumnSortConfigChanged:(i,a)=>{e(mn({uiState:{sortKey:i,sortOrder:a},period:t.period}))},onSearchTextChanged:i=>{e(ln(i))},onFiltersChange:i=>{e(rn({filters:i})),i.categories.every((a=>a.field!=null&&a.values?.length!==0))&&E.trackSpendManagmentFilterChange("reimbursement",i.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:i=>{i==="In-Progress"&&E.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:i}}))},onReloadTransactions:()=>{e(ue(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:i=>{e(sn(i))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(i,a)=>{switch(i){case"delete":case"cancel":e(an(i,a??""));break;case"send_for_approval":e(Te("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Te("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:i=>{i.endsWith(be)&&e(nn(!1))},onEventReceived:i=>{i===st&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ae(),n=Y(),r=n.state,m=qe(),[c,d]=g.useState(null),i=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Ht(r.tab.toString());f!=null?t(Oe(f)):console.log("Warning:Not a valid remiListTab");const G=Wt(r.subTab.toString());G!=null?t(Ze(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:o}=a(F.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(F.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:p}=a(F.isReimbursementBulkActionEnabled),I=L.getSignedInUser(),u=R((f=>H(f))),[T,y]=g.useState(!1),[B,D]=g.useState(!1),k=le(),C=k?.loggedInUserRole?.includes("admin")===!0,v=R((f=>ze(f,V,p))),{areTenantIdsInSync:S}=xn(),w=v.fetchState,{isAiCfoAccessEnabled:h,onAskAiCfoClick:$}=ve({mobileExploreReferrer:"Reimbursement List"});if(Ye({isDataReady:w==="Completed"}),g.useEffect((()=>{!B&&S&&(D(!0),t(ue(V,!0,l,!1,!0)))}),[B,V,t,S]),I==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),A=Se(k?.loggedInUserRoleMap),_=Ie(k?.loggedInUserRoleMap),b=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,M=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,O=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,Z=R((f=>Le(f.companyState,u.companyId))),W=Z?.company.featuresActivationInfo.connectedAccountProvider,z=f=>{y(f)},{isFeatureEnabled:J}=a(F.isDebitCardFeatureEnabled),it=Ge(J,u),ot=Ve(u),{remisProcessed:te,remisProcessing:Ae}=R((f=>Xt(f)));g.useEffect((()=>{te===Ae&&c!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:Qn.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(Jt()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),d(null))}),[te,Ae]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(f,G,Re)=>{f.endsWith(be)?Re.onReimbursementApprovalRulesEventReceived?.(f):G.entity_type==="reimbursement"&&(d(G.operation_type),Re.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(et,{}):M&&(!U||A)||_&&b?s.jsxs(s.Fragment,{children:[w==="Completed"?s.jsx(re,{analytics:E,onLoad:f=>(G=>G.trackPageLoaded(Je.Event.reimbursementHome))(f)}):null,s.jsx(nt,{isAppContentDrawerOpen:T,handleDrawerToggle:z}),s.jsxs(ea,{windowSize:m,children:[s.jsx(Nn,{isOpen:i,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:f=>f.stopPropagation(),children:s.jsx(Yn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:o,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:V,isAdmin:C,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{z(!0)},createdByUserList:v.createdByUserList,createdByUserListFetchState:v.createdByUserListFetchState,isDownloadEnabled:v.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:p,bulkSubmissionLimit:v.remiBulkSubmissionLimit,bulkSubmissionFetchState:v.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:h,onAskAiCfoClick:$,...rt})]})]}):O&&A?s.jsx(N,{to:"../setup"}):k!=null&&He(u,k.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=P($n)`
|
|
65
|
+
display: flex;
|
|
66
|
+
min-height: 100%;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
`,oa=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:E,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Fn),ra=()=>{const e=Un(),t=Q(),n=Y(),{tenantEmailDomain:r}=ie(),m=Qe(),[c,d]=g.useState(!1),i=R((C=>H(C))),a=L.getSignedInUserTenant(r)?.companyId??i.companyId,o=L.getSignedInUser(),l=i.userRoleId,p=!!i.userRole?.includes("reimbursements_user"),I=le(),u=Se(I?.loggedInUserRoleMap),T=Ie(I?.loggedInUserRoleMap),y=!!i.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!i.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!i.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,k=C=>{d(C)};if(o==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&T&&y?s.jsx(N,{to:"../../../reimbursements"}):D&&u?s.jsx(N,{to:"../../reimbursements/setup"}):i.companyReimbursementInfo&&!D||i.userReimbursementInfo&&T&&y===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:C=>(v=>v.trackPageLoaded(Je.Event.reimbursementPromoPage))(C)}),s.jsx(nt,{isAppContentDrawerOpen:c,handleDrawerToggle:k}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:i.userReimbursementInfo,userRoleId:l,isEmployee:p,onClickMenuIcon:()=>{k(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})};function Ma(){const e=R((z=>H(z))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),m=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:d}=oe(),{isFeatureEnabled:i}=d(F.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=d(F.isDebitCardFeatureEnabled),o=Ge(a,e),l=Ve(e),p=e?.userRole!=null&&pn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,y=Se(t?.loggedInUserRoleMap),B=T&&y,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,k=D&&hn(t?.loggedInUserRoleMap),C=Ln(e,i,a)&&!p,v=C&&fn(t?.loggedInUserRoleMap),S=Sn(t?.loggedInUserRoleMap),w=In(t?.loggedInUserRoleMap),h=yn(t?.loggedInUserRoleMap),$=D&&w,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&h,A=vn(t?.loggedInUserRoleMap),_=An(t?.loggedInUserRoleMap),b=Ie(t?.loggedInUserRoleMap),M=C&&A,{tenantEmailDomain:O}=ie(),Z=Y(),W=n===!0&&(y||b&&c);return s.jsxs(mt,{children:[Z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:v,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:v,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(_n,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:_,isUserHasReimbursementAccess:b,showTreasuryRoute:U,isTenantBankingOnly:o,showChargeCardRoute:M,tenantEmailDomain:O??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(o===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(et,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../promo"})}),m&&y&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):Z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(Ue,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(Ue,{})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(x,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]})}export{Ma as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-oxGmLiGE.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as We,o as oe}from"./core-k1hJbZ6L.js";import{fI as Q,EH as S,VC as ze,m3 as ue,ul as he,va as Y,lK as D,lT as F,lL as V,kO as P,kF as A,kE as E,DK as U,vf as ye,bq as Ge,VD as He,bn as Ne,F3 as $e,VE as qe,VF as Ke,ck as I,DD as ne,VG as re,VH as Ze,VI as Je,VJ as Qe,VK as Xe,VL as ea,VM as aa,VN as sa,VO as ta,VP as oa,VQ as na,VR as ra,VS as la,VT as k,VU as x,VV as W,VW as z,VX as G,VY as H,VZ as N,V_ as $,V$ as q,W0 as K,ek as ca,EJ as ia,Ev as le,Ew as ce,EP as da,EA as ie,bG as O,W1 as de,di as pe,EB as _e,EV as pa,W2 as _a,W3 as fa,W4 as ba,W5 as ma,W6 as ua,W7 as ha,W8 as ya,W9 as Ca,Wa as wa,Wb as ga,e1 as Ia,e0 as Ra}from"./zeni-epic-state-C2CKsxzr.js";import{al as Sa,am as Ta,an as ka,a as Oa,$ as ja,p as Ce,d as Z,z as we,ao as Da,V as Fa,f as Va,ap as Pa,aq as Aa,a6 as Ea,k as J,O as Ma,A as La,l as ge,ar as Ba,as as va,at as Ya}from"./index-Cjqi6Pkt.js";import"./mui-D8QuRJEy.js";import Ua from"./NotFoundScreen-ngkmWfLO.js";import{F as xa}from"./FeaturePreviewScreen-CVxHNITI.js";import{a as u}from"./sentry-CYolppN9.js";import{u as Wa}from"./useInitialThreadRequest-DKk3Gbri.js";import{t as fe,a as be,b as za}from"./routePaths-BQiUfv8Y.js";import{t as me}from"./reportTimeframe-BoyB48qP.js";import{M as Ga}from"./MobileAppDrawer-D95K9MWM.js";import"./recharts-DZG9umMy.js";import"./analytics-BSYXJeF4.js";import"./plaid-CbZCK8Pe.js";import"./dnd-CiTl8J_b.js";import"./stripe-cKAAJElX.js";import"./lottie-DXQhXtqa.js";import"./lexical-YTMAFU1j.js";import"./pdf-QcH92u4w.js";import"./utils-CZxvf1-B.js";import"./InboxNotificationsProvider-Lon_JjZI.js";import"./useTaskManagerAccess-CbR2C9f7.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]="9e676d00-d1ef-4a3e-97d1-981b0319352e",e._sentryDebugIdIdentifier="sentry-dbid-9e676d00-d1ef-4a3e-97d1-981b0319352e")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(K({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(W({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=Q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=He(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:J,isZeniUser:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=O(a),i=O(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(E(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(E(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(A());break;case"balance_sheet_by_projects":e(E(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(P());break;case"cash_flow":e(D(r,!0,a,s));break;case"cash_flow_by_classes":e(D(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(D(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(F())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(R(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?za(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(K({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(G({scrollPosition:s}));break;case"cash_flow_by_classes":e(z({scrollPosition:s}));break;case"cash_flow_by_projects":e(W({scrollPosition:s}));break;case"cash_flow":e(x({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(K({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=R(t),r=I(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e(Xe({classesToFilterOut:a})):R(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Ze({projectsToFilterOut:a})):R(o.selectedReportID)?e(Je({projectsToFilterOut:a})):e(Qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?A():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?P():U())},onUpdateDisplayOrder:a=>{e(Ke(a))},onUpdateReportFormat:a=>{Na(e),e(qe(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):P(!0):A(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=ja(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(Z.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(Z.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Ie]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>Q(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=Wa(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>ze(l))),{areTenantIdsInSync:y}=Da(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),je=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Ie(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(E(C.timeframe));break;case"balance_sheet_by_classes":T&&s(A());break;case"balance_sheet_by_projects":g&&s(P());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(D(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Fa(),De=ee?.loggedInUserRole!=null&&Ge(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Pe=Va(),Ae=Pa();return(function(l){const{isDataReady:Ee}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ee),Be=u.useMemo((()=>se?Ha:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Aa({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Ea,{analytics:J,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ga,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:je,selectedReportID:B,analytics:J,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:De,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ae&&Pe&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ys(){const e=_((s=>Q(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(Z.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(We,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
|
|
1
|
+
import{j as f}from"./liveblocks-DQb3Em37.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as ze,o as oe}from"./core-C1WlT0Gj.js";import{fI as J,ED as S,Vx as Ge,m3 as ue,uh as he,v6 as Y,lK as D,lT as F,lL as V,kO as A,kF as E,kE as P,DG as U,vb as ye,bq as He,Vy as Ne,bn as We,E$ as $e,Vz as qe,VA as Ze,ck as I,Dz as ne,VB as re,VC as Ke,VD as Qe,VE as Je,VF as Xe,VG as ea,VH as aa,VI as sa,VJ as ta,VK as oa,VL as na,VM as ra,VN as la,VO as k,VP as x,VQ as z,VR as G,VS as H,VT as N,VU as W,VV as $,VW as q,VX as Z,ek as ca,EF as ia,Er as le,Es as ce,EL as da,Ew as ie,bG as O,VY as de,di as pe,Ex as _e,ER as pa,VZ as _a,V_ as fa,V$ as ba,W0 as ma,W1 as ua,W2 as ha,W3 as ya,W4 as Ca,W5 as wa,W6 as ga,e1 as Ia,e0 as Ra}from"./zeni-epic-state-VpP2uC41.js";import{al as Sa,am as Ta,an as ka,a as Oa,$ as ja,p as Ce,c as K,z as we,ao as Da,V as Fa,e as Va,ap as Aa,aq as Ea,a6 as Pa,j as Q,O as Ma,A as La,k as ge,ar as Ba,as as va,at as Ya}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import Ua from"./NotFoundScreen-hP5G-uHy.js";import{F as xa}from"./FeaturePreviewScreen-CZZbV-Lj.js";import{a as u}from"./sentry-bn66aQBn.js";import{u as za}from"./useInitialThreadRequest-rwXc-zR2.js";import{t as fe,a as be,b as Ga}from"./routePaths-B56KGAwY.js";import{t as me}from"./reportTimeframe-C4q_PyKL.js";import{M as Ha}from"./MobileAppDrawer-DYOb_3zl.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.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]="ff1e1143-08ca-47e8-908b-76ec3582ea52",e._sentryDebugIdIdentifier="sentry-dbid-ff1e1143-08ca-47e8-908b-76ec3582ea52")}catch{}})();const Na=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(Z({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(W({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0}))},Wa=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=J(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=Ne(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:Q,isZeniUser:We(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=O(a),i=O(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(P(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(P(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(E());break;case"balance_sheet_by_projects":e(P(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(A());break;case"cash_flow":e(D(r,!0,a,s));break;case"cash_flow_by_classes":e(D(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(D(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(F())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(R(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ga(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Z({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(W({scrollPosition:s}));break;case"balance_sheet_by_classes":e(N({scrollPosition:s}));break;case"balance_sheet_by_projects":e(H({scrollPosition:s}));break;case"cash_flow_by_classes":e(G({scrollPosition:s}));break;case"cash_flow_by_projects":e(z({scrollPosition:s}));break;case"cash_flow":e(x({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(Z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=R(t),r=I(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e(Xe({classesToFilterOut:a})):R(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Ke({projectsToFilterOut:a})):R(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):e(Je({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?E():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?A():U())},onUpdateDisplayOrder:a=>{e(Ze(a))},onUpdateReportFormat:a=>{Wa(e),e(qe(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):A(!0):E(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=ja(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(K.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(K.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Ie]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>J(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=za(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>Ge(l))),{areTenantIdsInSync:y}=Da(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),je=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Ie(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(P(C.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":g&&s(A());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(D(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Fa(),De=ee?.loggedInUserRole!=null&&He(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Ae=Va(),Ee=Aa();return(function(l){const{isDataReady:Pe}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Pe),Be=u.useMemo((()=>se?Na:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Ea({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Pa,{analytics:Q,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ha,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:je,selectedReportID:B,analytics:Q,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:De,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ee&&Ae&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ys(){const e=_((s=>J(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(K.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(ze,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DQb3Em37.js";import{z as j,a6 as N,j as u,O as S,e6 as I,p as k,c as C}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import g from"./NotFoundScreen-hP5G-uHy.js";import{a as c}from"./sentry-bn66aQBn.js";import{u as D,j as h,h as F,g as L,l as _,n as T,o as d,N as y}from"./core-C1WlT0Gj.js";import{fI as U,a2Z as w,a2_ as p,Ei as P,q3 as V,a2$ as q,Eg as z}from"./zeni-epic-state-VpP2uC41.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.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]="55debf4f-7914-49ca-a7d6-da526a1dacee",e._sentryDebugIdIdentifier="sentry-dbid-55debf4f-7914-49ca-a7d6-da526a1dacee")}catch{}})();const G=_((function(e,t){const n=w(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(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),O=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),x=L(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),b=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:x,currentTenant:r,companyName:E,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|