@zeniai/web-app-ui 5.0.78-prod → 5.0.79-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-VNiW4zFt.js +1 -0
- package/dist/assets/AddressScreen-zAEAr0cm.js +9 -0
- package/dist/assets/{AiCfoScreen-A8Awkqi8.js → AiCfoScreen-CEp0H39c.js} +3 -3
- package/dist/assets/BillPayApprovalRoutes-DdepEMNI.js +1 -0
- package/dist/assets/{BillPayRoutes-Dq3yQ57P.js → BillPayRoutes-BFjD0YEd.js} +26 -26
- package/dist/assets/BusinessVerificationPageScreen-C2DktOhf.js +9 -0
- package/dist/assets/{ChargeCardRoutes-DP2t_uhH.js → ChargeCardRoutes-DzXM12p0.js} +9 -9
- package/dist/assets/CompanyPassportScreen-2RC9cNYm.js +1 -0
- package/dist/assets/ConnectionAuthScreen-Cz8BO1Qy.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-C11rmqMq.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-Dz9NWWrJ.js +23 -0
- package/dist/assets/{DashboardRoutes-CAQmzY7M.js → DashboardRoutes-AodiBc0C.js} +4 -4
- package/dist/assets/{DefaultTenantHome-BuA42TgC.js → DefaultTenantHome-VZ9caScB.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-D3cRlBJq.js +18 -0
- package/dist/assets/DrawerScreen-DrA0_hQo.js +1 -0
- package/dist/assets/EntityDetailRoutes-Htc-mXG5.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-Ctsyj1qb.js → ExpenseAutomationRoutes-hDXdzNbj.js} +5 -5
- package/dist/assets/FeaturePreviewScreen-9JeQ0IeJ.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-rCTFotPG.js +1 -0
- package/dist/assets/{MagicLinkRoutes-c-ICkHeA.js → MagicLinkRoutes-Bk573e_F.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-C8DIoYNk.js +12 -0
- package/dist/assets/{MobileAppDrawer-DSgPRxOv.js → MobileAppDrawer-DDKkJ918.js} +1 -1
- package/dist/assets/NotFoundScreen-vkDXbz0R.js +1 -0
- package/dist/assets/NotificationRoutes-BCGxlZOG.js +1 -0
- package/dist/assets/OAuthConsentScreen-CL6akwVK.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Br2Ee7zc.js +1 -0
- package/dist/assets/PeopleRoutes-g3ceR6fI.js +22 -0
- package/dist/assets/PerformanceRoutes-BX5shptQ.js +1 -0
- package/dist/assets/{Preview-CzTmVH5B.js → Preview-x7C1SnY9.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DVWXlQxR.js → QBOConnectionScreen-C0EWfqqq.js} +1 -1
- package/dist/assets/{ReferralListScreen-Dk4OhEOh.js → ReferralListScreen-DtKoNKFt.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-DfPsMGzz.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CvAjyFdG.js → ReimbursementApprovalRuleDetailScreen-CQFzG62_.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-LJv5ZEhb.js → ReimbursementRoutes-49Rieggp.js} +7 -7
- package/dist/assets/ReportsRoutes-BScMXjBF.js +1 -0
- package/dist/assets/RewardsRoutes-DN1QCtTK.js +1 -0
- package/dist/assets/ScreenRoutes-u3IHYIz2.js +2 -0
- package/dist/assets/{SettingsRoutes-CN1RB2Kk.js → SettingsRoutes-D6YwI1A0.js} +7 -7
- package/dist/assets/{SetupPagesScreen-B1u5XXT5.js → SetupPagesScreen-HxvWGUNa.js} +5 -5
- package/dist/assets/SignInScreen-CQSFtM1Y.js +1 -0
- package/dist/assets/SignOutScreen-Cje6a06U.js +9 -0
- package/dist/assets/TaskListScreen-B_GnE7cK.js +9 -0
- package/dist/assets/TaskRoutes-B384KfDT.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BKgQg9gp.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CVJIejMp.js → TransactionDetailScreen-BkrtxHZ2.js} +2 -2
- package/dist/assets/{TransactionListRoutes-nDA_htng.js → TransactionListRoutes-DhFIr0h0.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BNUkMK5W.js → TreasuryRoutes-D0IWSqF8.js} +6 -6
- package/dist/assets/{VendorsRoutes-CpWLxCM4.js → VendorsRoutes-KHi82m-_.js} +22 -22
- package/dist/assets/WiseConfirmationScreen-ZNfVKLHA.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-Db8jzNqV.js → ZeniAccountRoutes-wwixhMEJ.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-Bk1Pha4F.js +9 -0
- package/dist/assets/{accountMappingHelper-CT28maj0.js → accountMappingHelper-Ce_vl0gX.js} +1 -1
- package/dist/assets/{analytics-Br8sYi51.js → analytics-CYNkDTSy.js} +1 -1
- package/dist/assets/{analyticsHelper-CUa_2Hxt.js → analyticsHelper-Db94ox0D.js} +1 -1
- package/dist/assets/{core-BUa4y4mL.js → core-DS-Czzkv.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CRJGdpaG.js → decodeURIComponentSafe-BUgIzLPe.js} +1 -1
- package/dist/assets/{dnd-Dl4N7fBZ.js → dnd-B781yOiO.js} +1 -1
- package/dist/assets/{empty-B90Uv9-T.js → empty-BVRicoJe.js} +1 -1
- package/dist/assets/{empty-BR4JY50t.js → empty-BW6MrnJi.js} +1 -1
- package/dist/assets/{emptyVideoElement-tnCNovqO.js → emptyVideoElement-qUB1PF8Z.js} +1 -1
- package/dist/assets/epic-BNsqfRJa.js +2 -0
- package/dist/assets/getLocaleForTenant-bt_-bwkg.js +1 -0
- package/dist/assets/{index-CHewEF_r.js → index-BIUN5C-2.js} +1 -1
- package/dist/assets/{index-2Xf81mMP.js → index-BnFuYygs.js} +1 -1
- package/dist/assets/{index-BChjK39b.js → index-CW8nCWyD.js} +2 -2
- package/dist/assets/{index-BphHrMlb.js → index-D3TculOd.js} +1 -1
- package/dist/assets/{index-BlE_QRZ7.js → index-DZw5cZyY.js} +1 -1
- package/dist/assets/{index-BqVUPrfN.js → index-KYBDOcEA.js} +12744 -12716
- package/dist/assets/{index-xcm_ApEH.js → index-P6artprw.js} +1 -1
- package/dist/assets/{index-B46Qh1vA.js → index-_F7gR_zT.js} +1 -1
- package/dist/assets/{lexical-gklPXKki.js → lexical-DZ3pAnkc.js} +1 -1
- package/dist/assets/{liveblocks-JFc2ySVL.js → liveblocks-BLWCZxXF.js} +1 -1
- package/dist/assets/{lottie-tfFSHGOM.js → lottie-DuFs7GNB.js} +1 -1
- package/dist/assets/{mui-RJ5XtWIj.js → mui-DeKIqdeR.js} +1 -1
- package/dist/assets/{pathToGoBack-UH0xKv_w.js → pathToGoBack-BXYS_je9.js} +1 -1
- package/dist/assets/{pdf-DyXQZDfv.js → pdf-Co6rX9Tl.js} +3 -3
- package/dist/assets/{pdf-lib-DQ75GOuH.js → pdf-lib-CqpoMVUd.js} +1 -1
- package/dist/assets/{plaid-M6xkDuEc.js → plaid-Dyu1hAU2.js} +1 -1
- package/dist/assets/{pusher-9Pzhq4pa.js → pusher-OyTTrvJD.js} +1 -1
- package/dist/assets/{react-DtBTgNL_.js → react-BSux8eVn.js} +1 -1
- package/dist/assets/{react-tmTSBFJN.js → react-BaqI5eTn.js} +1 -1
- package/dist/assets/{react-B-lMEwuQ.js → react-BiQHsRc-.js} +1 -1
- package/dist/assets/{react-CbK-iBIw.js → react-BoFCiaud.js} +1 -1
- package/dist/assets/{react-Dm8DL33B.js → react-BqBM4ptm.js} +1 -1
- package/dist/assets/{react-Cy7gL0rm.js → react-BrEHhFCn.js} +1 -1
- package/dist/assets/{recharts-CPOd-6nk.js → recharts-BV8xDSZo.js} +1 -1
- package/dist/assets/{routePaths-FsWFCrEG.js → routePaths-BgR0bMMr.js} +1 -1
- package/dist/assets/{sentry-DbhlVCDx.js → sentry-BweJUVSU.js} +1 -1
- package/dist/assets/{url-BVyZWqxl.js → url-B26fnakI.js} +1 -1
- package/dist/assets/{url-BdgRfFdn.js → url-CluwUD6c.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-eM31eQ25.js +1 -0
- package/dist/assets/{useDeviceId-BqTcE7B1.js → useDeviceId-eKf2uZLe.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-HdAnpaOw.js → useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BwBVCvna.js → useInitialThreadRequest-GwPuAy0h.js} +1 -1
- package/dist/assets/{utils-jfneV6S1.js → utils-D7Uun_Ak.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-_HCg7dnz.js → withTransactionSidePanel-BxEYZshS.js} +2 -2
- package/dist/assets/{zeni-epic-state-CGaNHYyd.js → zeni-epic-state-CH3oUd_o.js} +5 -5
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-D1tOHYbp.js +0 -1
- package/dist/assets/AddressScreen-YA46n52j.js +0 -9
- package/dist/assets/BillPayApprovalRoutes-NVMWEPu0.js +0 -1
- package/dist/assets/BusinessVerificationPageScreen-CgOqYGYR.js +0 -9
- package/dist/assets/CompanyPassportScreen-CJkXrH5j.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DkkZ1Fif.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CaRVOe5Q.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-BOQ5oKh7.js +0 -23
- package/dist/assets/DomesticWireDetailScreen-2MNzySFr.js +0 -18
- package/dist/assets/DrawerScreen-uJ_3Dk8M.js +0 -1
- package/dist/assets/EntityDetailRoutes-DAqHSgtY.js +0 -1
- package/dist/assets/FeaturePreviewScreen-BGV0ZXxB.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-DceAiXdK.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BCvwxuHv.js +0 -12
- package/dist/assets/NotFoundScreen-B9fIdZtZ.js +0 -1
- package/dist/assets/NotificationRoutes-CtZRU3jC.js +0 -1
- package/dist/assets/OAuthConsentScreen-BfiVtm7S.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Bco3KBub.js +0 -1
- package/dist/assets/PeopleRoutes-CpJmRoUV.js +0 -22
- package/dist/assets/PerformanceRoutes-BJ4hq_vo.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-SuUGS_MC.js +0 -1
- package/dist/assets/ReportsRoutes-DWgChqq3.js +0 -1
- package/dist/assets/RewardsRoutes-IbwzyTA0.js +0 -1
- package/dist/assets/ScreenRoutes-Bzr1Pddu.js +0 -2
- package/dist/assets/SignInScreen-DLqX9QIL.js +0 -1
- package/dist/assets/SignOutScreen-pxwuoR_l.js +0 -9
- package/dist/assets/TaskListScreen-DTiPtOdu.js +0 -9
- package/dist/assets/TaskRoutes-Bnccp3rk.js +0 -9
- package/dist/assets/TransactionDetailRoutes-DEPQW9cF.js +0 -1
- package/dist/assets/WiseConfirmationScreen-2PZ32Ekb.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BudCs1Qh.js +0 -9
- package/dist/assets/epic-BsQGAan2.js +0 -2
- package/dist/assets/getLocaleForTenant-Crr4jHK_.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CzbTY4Ry.js +0 -1
package/dist/assets/{ExpenseAutomationRoutes-Ctsyj1qb.js → ExpenseAutomationRoutes-hDXdzNbj.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-BLWCZxXF.js";import xn from"./NotFoundScreen-vkDXbz0R.js";import{a,b as Tt}from"./sentry-BweJUVSU.js";import{n as Fe,S as Rn}from"./mui-DeKIqdeR.js";import{h as ce,j as wt,u as qe,g as U,k as Dn,l as rt,n as Un,o as ze}from"./core-DS-Czzkv.js";import{eQ as Re,Pq as Fn,mH as Se,fg as Bn,qi as _n,mZ as xt,ni as Rt,Pr as Dt,ns as Mn,Ps as Ut,mS as On,pQ as Vn,e$ as pe,Pt as De,so as Ft,Bz as Bt,Pu as _t,Pv as jn,pv as Je,L7 as dt,L9 as zn,jF as Ln,La as $n,jM as Gn,cW as qn,tr as Ne,n3 as Mt,nx as Ue,Pw as Jn,K0 as ut,J$ as Te,Px as mt,k1 as Nn,Py as Yn,Pz as Kn,PA as Qn,PB as Hn,na as Wn,mX as ie,nA as we,PC as Zn,PD as Xn,PE as ea,nH as ta,jQ as na,jH as aa,PF as oa,jP as ht,Lh as sa,PG as ca,PH as ia,pr as la,p6 as ra,ny as ge,p5 as Le,PI as da,PJ as ua,lk as ma,bq as ha,lf as pt,l1 as pa,PK as ga,gO as gt,fS as Ca,lc as Sa,vk as Ia,PL as fa,o6 as ka,o1 as Ea,o5 as va,nS as ya,PM as ba,f2 as Ot,nl as Pa,n6 as Aa,fh as Ct,nC as Ta,PN as wa,nz as Vt,PO as xa,PP as Ra,PQ as Da,PR as Ua,PS as St,pD as Fa,oY as Ba,J_ as _a,jO as Ma,PT as Oa,G5 as Va,jN as ja,jC as za,f1 as La,ox as jt,oQ as $a,nw as It,nB as Ga,bE as qa,l9 as Ja,l6 as Na,PU as Ya,nR as ft,oO as kt,oM as Ka,oC as Qa,oh as Ha,oP as Wa,PV as Za,PW as Xa,ol as eo,PX as to,ob as no,ok as ao,oi as oo,oT as so}from"./zeni-epic-state-CH3oUd_o.js";import{y as zt,S as Ce,e as z,r as H,U as Lt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,x as $t,cz as ro,an as $e,D as uo,cA as mo,X as ho,cB as po,T as go,cC as Co,cD as So,v as Io,d as fo,aK as ko,b1 as Eo,F as vo,cE as yo}from"./index-KYBDOcEA.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import{c as qt}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import{c as vt,C as bo}from"./TransactionDetailScreen-BkrtxHZ2.js";import{w as Po}from"./withTransactionSidePanel-BxEYZshS.js";import{h as Ao,v as To}from"./routePaths-BgR0bMMr.js";import{g as Ge}from"./accountMappingHelper-Ce_vl0gX.js";import{D as wo}from"./DrawerScreen-DrA0_hQo.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";import"./decodeURIComponentSafe-BUgIzLPe.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="d6437a37-149f-4501-bb90-f1a5e584a508",t._sentryDebugIdIdentifier="sentry-dbid-d6437a37-149f-4501-bb90-f1a5e584a508")}catch{}})();const xo=()=>{const t=ce(),i=wt(),P=qe(),f=U(d=>Re(d)),{useFeatureGate:E}=zt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=P.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=P.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(P.state?.pathnameStackToGoBack,P.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=Lt();return qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=P.state?.referrer;z.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex: 1 1 auto;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
-
`,Do=Tt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:
|
|
8
|
+
`,Do=Tt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:P,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=ce(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,A=(e,n)=>{g(Vn(e,n.split(".")[0]))},I=e=>{h!=null&&g(On({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Mn({accountId:i,selectedPeriod:y,payload:e}))},K=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),V=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(io,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:y,onDismissClick:P,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:A,onDeleteFile:I,onSelectSourceType:K,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(lo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:V})})}):null}),yt=Fe.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
12
|
-
`,
|
|
12
|
+
`,bt=Fe.div`
|
|
13
13
|
flex: 1;
|
|
14
14
|
min-height: 0;
|
|
15
15
|
display: flex;
|
|
@@ -18,8 +18,8 @@ import{j as C}from"./liveblocks-JFc2ySVL.js";import xn from"./NotFoundScreen-B9f
|
|
|
18
18
|
min-width: 0;
|
|
19
19
|
overflow-x: hidden;
|
|
20
20
|
overflow-y: auto;
|
|
21
|
-
`;function Uo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:b,resetCustomerRequest:I}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>jn(u,t,E));return a.useEffect(()=>{I()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(ro,{onCloseClick:i,addCustomerRequest:b,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Bo,comma:bt,space:_o}},dateFormat:Jt}=uo.getLocalizedStrings(),At=so,Vo=Dn(function(t,i){const{uncategorizedAccounts:b,vendorSearchAutoCompleteData:I,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=pe(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:I,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:b,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:b,isAccountingClassesEnabled:I,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:A}=i,{selectedPeriod:f,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:K}=S.jeSchedules,te=Vt(f),O=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{b.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(f.month,f.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const P=()=>t(St(e,n,{fetchState:"Error"}));po(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(T=>{T!=null?t(Fa(e,T)):P()}).catch(P)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Se({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Da(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?_o+Bo+l+bt:bt}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&O!=null&&t(Ot({start:O,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(eo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Xa())},onSetBulkUploadResultsTab:e=>{t(Wa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ha(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(At(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(At(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Qa(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&O!=null&&t(ge(s,{start:O,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Ta(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Aa(e))},onSaveReconciliationReview:e=>{t(ba(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=Z(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=Ge(K.prepaidExpensesAccountList,s.selectedOptions),P=Ge(K.fixedAssetsAccountList,l.selectedOptions),T=Ge(K.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:P.map(w=>w.accountId),selectedAccruedExpensesAccountIds:T.map(w=>w.accountId)};t(Pa({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:P}=n,{allAccountList:T,allClassList:V,allDepreciationAccountList:w}=S.jeSchedules,$=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find(G=>G.id===P?.selectedOption):void 0,fe={id:$?.zeniId??P?.selectedOption??"",name:$?.name??P?.defaultOptions.find(G=>G.value===P?.selectedOption)?.label??"",logo:$?.logo},Ie=p?.selectedOption!=null?T.find(G=>G.qboId===p.selectedOption):void 0,ke=k?.selectedOption!=null?V.find(G=>G.classId===k.selectedOption):void 0,ne=l?.selectedOption!=null?w.find(G=>G.qboId===l.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:Ie?.accountId,updatedClassId:ke?.classId,updatedAccumulatedDepreciationCategoryID:ne?.accountId,updatedVendor:{id:fe.id,name:fe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Te("common"))},onCancelAutoComplete:()=>{t(Te("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Ia())},handleJeScheduleClick:(e,n,s)=>{t(fa({selectedJEScheduleKey:n}));const l=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:A,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,P,T,V,w,$)=>{t(ua(e,n,s,l,y,k,p,P,T,V,w,$,I))},onCancelAutoComplete:()=>{t(Te("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&O!=null&&(t(ge(e,{start:O,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&O!=null&&t(ge(e,{start:O,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,P)=>{_!=null&&O!=null&&t(ge(e,{start:O,end:_},!0,s,n,l,k,p,P))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,P,T)=>{t(ra(e,n,s,l,T??null,k,p,!1,P))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:I}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(f.month,f.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(f.month,f.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(la(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,P)=>{const{transactionId:T,transaction:V,lineIds:w}=n;p!=null&&t(sa({transactionId:T,customerUpdates:p})),t(ca({selectedTab:l,transactionId:T.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:P})),k!=null&&t(Ne(k,e,n,s,!0,E,P))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,P)=>{const{transactionId:T,transaction:V,lineIds:w}=n;p!=null&&(t(na({transactionId:T,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(aa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:T.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:P})),k!=null&&t(Ne(k,e,n,s,!0,E,P))):t(oa({selectedTab:l,transactionId:T.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(f,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(ta(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:f}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=To(e.id,e.qboId,i.tenantEmailDomain),s=Z(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Wn({sectionId:e,selectedPeriod:f}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ie(f,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:f,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ie(f,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Hn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Kn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Nn(l)),t(Yn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,Je("bill"));const n=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Te("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,b)=>{const{isMissingReceiptsBulkUploadEnabled:I,...E}=b;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(mo),Mo=bo(function(t){const i=t.displayName??t.name??"Component",b=Tt.memo(t),I=E=>{const g=ce(),u=function(){const A=ce(),f=U(d=>pe(d).reconciliation.selectedDrawerAccountId);return{isOpen:f!=null,selectedAccountId:f,openPanel:a.useCallback(d=>{A(De({selectedDrawerAccountId:d}))},[A]),closePanel:a.useCallback(()=>{A(De({selectedDrawerAccountId:void 0}))},[A])}}(),o=U(A=>pe(A).reconciliation),v=U(A=>Re(A)),S=a.useCallback((A,f)=>{g(Ft("expense_automation_reconcile",A,f))},[g]),m=a.useCallback((A,f)=>{const d=v?.companyId;d!=null&&(g(Bt(A,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",f)),g(_t({accountId:f,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Do,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(b,{...E,...r})})};return I.displayName=`withReconSidePanel(${i})`,I}(({closeSidePanel:t,openTransactionPanel:i,panelContent:b,sidePanelIsFullView:I,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=go(),m=Co(),{isOpen:y}=So(),r=wt(),B=qe(),h=ce(),{isAiCfoAccessEnabled:A,onAskAiCfoClick:f}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&I!==!0&&t?.()},[t,E,I]),{areTenantIdsInSync:R}=zt(),K=(()=>{const c=U(q=>pe(q)),j=qe(),{currentSelectedViewFetchState:Y,currentSelectedView:M,selectedPeriod:F}=c,he=$e(M),X=$e(Y.fetchState),Pe=a.useCallback(q=>{const Q=j.state?.referrer;M==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,q,Q??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,q,Q??null)),M==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,q,c.missingReceipts.transactions.length,Q??null),M==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,q,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,Q??null),M==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,q,Fo(c.fluxAnalysis),Q??null),M==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,q,"draft",c.auditSummary.auditScorePercentage,null,Q??null)},[F,c]);return a.useEffect(()=>{X===Y.fetchState&&M===he||Y.fetchState!=="Completed"||Pe(!1)},[M,Y.fetchState,he]),Pe})(),te=fo(),[O,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[P,T]=a.useState([]),[V,w]=a.useState(void 0),$=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),fe=a.useCallback(()=>{m(),w(void 0),d(),f()},[d,f,m]),Ie=a.useRef(v);a.useEffect(()=>{v===!0&&Ie.current===!1&&(m(),w(void 0),d()),Ie.current=v},[d,v,m]);const ke=a.useRef(y);a.useEffect(()=>{y===!0&&ke.current===!1&&(v&&S(!1),w(void 0),E===!0&&I!==!0&&t?.()),ke.current=y},[t,y,v,S,I,E]);const ne=E===!0&&I!==!0,G=a.useRef(ne);a.useEffect(()=>{ne&&!G.current&&(v&&S(!1),m(),w(void 0)),G.current=ne},[v,ne,m,S]);const[Ye,Nt]=a.useState(!1),Ke=a.useRef(!1),{selectedTab:Qe}=rt(),{tenantEmailDomain:Yt}=rt(),[_e,Ze]=a.useState(B.state?.message==="comingFromTransactionDetail"),He=B.state?.message==="comingFromOverview",Kt=Io(),Ve=Be.getSignedInUser(),{useDynamicConfig:Qt,useFeatureGate:Ee}=Lt(),{configValue:Zt}=Qt(ko.enableUncategorizedExpenseCategory),H=Zt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=Ee(Ce.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:le}=Ee(Ce.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=Ee(Ce.isTransactionActivityEnabled),{isFeatureEnabled:Ht}=Ee(Ce.isExpenseAutomationCommentingEnabled),Wt=a.useCallback(c=>{const j=Je(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),Xt=U(c=>_a(c,"common")),z=U(c=>pe(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ae,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:W,jeSchedules:Me,reconciliation:tn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||$(void 0)},[x,$,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==ae&&(ve.current=ae,x==="transaction_categorization"&&$(void 0)):ve.current=ae},[x,ae,$]);const nn=U(c=>V==null?void 0:Va(c.transactionState,V)),oe=nn?.qboId,an=U(c=>oe==null?void 0:Ma(c,oe));a.useEffect(()=>{oe!=null&&h(Oa(oe))},[h,oe]);const{selectedAccountId:re}=tn,et=$e(Me.accountSettingsView.saveState.fetchState),on=U(c=>ja(c.accountState,c.accountListState,"accountList")),sn=U(c=>La(c)),de=Qe!=null?za(Qe):x,cn=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(qt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ue=Ue(tt.start),me=Ue(tt.end);if(ue==null||me==null)throw Error(`Invalid start - ${ue} and end - ${me} period from given ${D}`);const ln=a.useCallback(()=>{l(!1)},[]),rn=a.useCallback(()=>{p(!0)},[]),dn=a.useCallback(c=>{T(c),p(!1)},[]),un=a.useCallback(()=>{T([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{le===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[le,x,ye,nt,h]);const at=Ve?.userId,mn=D.month,hn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&le!==!1&&ye==="idle"&&at!=null&&ot!=null&&h($a())},[x,le,ye,at,ot,mn,hn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{de!=null&&x!==de&&h(Mt(de))},[de]),a.useEffect(()=>{Ye!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!R||(Nt(!0),h(ft(!1,!1,H)))},[Ye,W,R,H]),a.useEffect(()=>{!He&&R&&(h(ft(!1,!1,H)),h(ie(D,re,!1,!1)))},[D.month,D.year,R,H]);const st=a.useCallback((c=!1,j=!1)=>{const Y={start:ue,end:me};switch(x){case"transaction_categorization":h(ge(ae,Y,c,!_e,void 0,void 0,j,void 0,H)),Ze(!1);break;case"flux_analysis":h(we(D,c,j,null));break;case"month_end_insights":if(j===!1){const M=new Date(D.year,D.month,0),F=qa(M.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);h(Ja(!0,n.companyId,n.tenantId,F)),h(Na(n.companyId,n.tenantId))}break;case"je_schedules":h(Ga(Y,j));break;case"missing_receipts":h(Ot(Y,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ie(D,re,c,j))}},[x,ue,me,n.companyId,n.tenantId,ae,D,re,_e,Ze,H]);a.useEffect(()=>{x===de&&W.fetchState==="Not-Started"&&R&&st(!0)},[W,ue,me,n.companyId,n.tenantId,R]),a.useEffect(()=>{He||_e||Ke.current||en.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),a.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Ya({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&re==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ie(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,ie,re,D]);const pn=vt();a.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,N.monthEndCloseChecks]);const gn=u===!0?g:b,Cn=u===!0||E===!0,Sn=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Me.accountSettingsView.saveState.fetchState==="Completed"&&h(It())},[et,Me.accountSettingsView.saveState.fetchState,It]);const{transactionId:ct,onSaveVendor:fn,onSaveSuccess:In,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:Y})=>{const M=ce();let F,he,X;const Pe=vt(),q=c.transactionView;let Q=()=>{};const{transactions:vn,selectedTransactionId:se,selectedTransactionLineId:be,transactionLocalData:yn}=q;if(Y==="transaction_categorization"){const Oe=yn.find(ee=>ee.transactionId===se),J=vn.find(ee=>ee.id===se),it=be!=null?Oe?.transactionReviewLocalData?.lineItemById[be]:void 0,lt=it?.account;he=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const bn=Ao(se,J?.typeOfTransaction);J!=null&&bn&&(X={id:se,type:Je(J.typeOfTransaction)}),Q=()=>{if(se!=null&&be!=null&&J!=null){const ee=q.transactionLocalData.find(Ae=>Ae.transactionId===se)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const Ae=ee.lineItemById[be];let je=ee.selectedEntity;if(qn(J)||(je=Ae.selectedEntityLine),je!=null){const An=je,Tn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(wn=>wn.id)??[]};M(Ne(An,Ae.amount.amount,Tn,!1,!0,Pe))}}}}}const Pn=U(Oe=>dt(Oe,void 0,F,he));return{transactionId:X,onSaveVendor:()=>{M(Gn(X,void 0,!1,!0))},onSaveSuccess:Q,onCancel:()=>{X!=null&&M(Ln({transactionId:X})),M(zn()),M($n()),j()},vendorViewDetails:Pn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Kt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(Eo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(wo,{isOpen:k,drawerLeftMargin:new vo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Oo,{onClick:c=>c.stopPropagation(),children:C.jsx(Uo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&O&&C.jsx(Po,{isOpen:O,transactionId:ct,onSaveVendor:fn,onSaveSuccess:In,onCancel:kn,vendorViewDetails:En}),C.jsx(Vo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:le,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:P,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:H,isAccountingClassesEnabled:sn,isCOTEnabled:pn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&V!=null?C.jsx(yo,{activityLogView:an,qboId:oe,onClose:()=>$(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:on,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Yt,trackExpenseAutomationTabAnalytics:K,setActivityLogTransactionId:$,closeSidePanel:Sn,openTransactionPanel:i,sidePanelIsOpen:Cn,sidePanelIsFullView:u!==!0&&I,panelContent:gn,isAiCfoAccessEnabled:A,onAskAiCfoClick:fe,isExpenseAutomationCommentingEnabled:Ht,onExpenseAutomationCommentingThreadClick:Wt,sidePanelListPercent:u===!0?66:void 0})]})})),Oo=Fe(Rn)`
|
|
21
|
+
`;function Uo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:P,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>jn(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(ro,{onCloseClick:i,addCustomerRequest:P,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Bo,comma:Pt,space:_o}},dateFormat:Jt}=uo.getLocalizedStrings(),At=so,Mo=Dn(function(t,i){const{uncategorizedAccounts:P,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=pe(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:P,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:P,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:A}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:K}=S.jeSchedules,te=Mt(I),V=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{P.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(I.month,I.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));po(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(T=>{T!=null?t(Fa(e,T)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Se({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Da(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?_o+Bo+l+Pt:Pt}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&V!=null&&t(Vt({start:V,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(eo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Xa())},onSetBulkUploadResultsTab:e=>{t(Za(e))},onSetBulkUploadCompletedSubTab:e=>{t(Wa(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ha())},onSearchTransactionsForManualMatch:(e,n)=>{t(At(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(At(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Qa(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Le({selectedTab:s,uiState:{searchString:e}})),_!=null&&V!=null&&t(ge(s,{start:V,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Ta(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Aa(e))},onSaveReconciliationReview:e=>{t(Pa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Ot(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=Ge(K.prepaidExpensesAccountList,s.selectedOptions),b=Ge(K.fixedAssetsAccountList,l.selectedOptions),T=Ge(K.accruedExpensesAccountList,k.selectedOptions),M={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:T.map(w=>w.accountId)};t(ba({data:M}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:T,allClassList:M,allDepreciationAccountList:w}=S.jeSchedules,$=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find(G=>G.id===b?.selectedOption):void 0,Ie={id:$?.zeniId??b?.selectedOption??"",name:$?.name??b?.defaultOptions.find(G=>G.value===b?.selectedOption)?.label??"",logo:$?.logo},fe=p?.selectedOption!=null?T.find(G=>G.qboId===p.selectedOption):void 0,ke=k?.selectedOption!=null?M.find(G=>G.classId===k.selectedOption):void 0,ne=l?.selectedOption!=null?w.find(G=>G.qboId===l.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:fe?.accountId,updatedClassId:ke?.classId,updatedAccumulatedDepreciationCategoryID:ne?.accountId,updatedVendor:{id:Ie.id,name:Ie.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Te("common"))},onCancelAutoComplete:()=>{t(Te("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,s)=>{t(Ia({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:A,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,T,M,w,$)=>{t(ua(e,n,s,l,y,k,p,b,T,M,w,$,f))},onCancelAutoComplete:()=>{t(Te("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&V!=null&&(t(ge(e,{start:V,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n})),_!=null&&V!=null&&t(ge(e,{start:V,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{_!=null&&V!=null&&t(ge(e,{start:V,end:_},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,T)=>{t(ra(e,n,s,l,T??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?z.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):z.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(la(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:T,transaction:M,lineIds:w}=n;p!=null&&t(sa({transactionId:T,customerUpdates:p})),t(ca({selectedTab:l,transactionId:T.id,lineId:w[0],selectedTransaction:M,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ne(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:T,transaction:M,lineIds:w}=n;p!=null&&(t(na({transactionId:T,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(aa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:T.id,lineId:w[0],selectedTransaction:M,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ne(k,e,n,s,!0,E,b))):t(oa({selectedTab:l,transactionId:T.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{z.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(ta(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=To(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Zn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ie(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ie(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Wn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Kn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Nn(l)),t(Yn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,Je("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Te("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,P)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=P;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(mo),Oo=Po(function(t){const i=t.displayName??t.name??"Component",P=Tt.memo(t),f=E=>{const g=ce(),u=function(){const A=ce(),I=U(d=>pe(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{A(De({selectedDrawerAccountId:d}))},[A]),closePanel:a.useCallback(()=>{A(De({selectedDrawerAccountId:void 0}))},[A])}}(),o=U(A=>pe(A).reconciliation),v=U(A=>Re(A)),S=a.useCallback((A,I)=>{g(Ft("expense_automation_reconcile",A,I))},[g]),m=a.useCallback((A,I)=>{const d=v?.companyId;d!=null&&(g(Bt(A,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Do,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(P,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:P,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=go(),m=Co(),{isOpen:y}=So(),r=wt(),B=qe(),h=ce(),{isAiCfoAccessEnabled:A,onAskAiCfoClick:I}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=Lt(),K=(()=>{const c=U(q=>pe(q)),j=qe(),{currentSelectedViewFetchState:Y,currentSelectedView:O,selectedPeriod:F}=c,he=$e(O),X=$e(Y.fetchState),be=a.useCallback(q=>{const Q=j.state?.referrer;O==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,q,Q??null):z.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,q,Q??null)),O==="missing_receipts"&&z.trackMissingReceiptsPage(F.month,F.year,q,c.missingReceipts.transactions.length,Q??null),O==="je_schedules"&&z.trackMonthCloseScheduleListPage(F.month,F.year,q,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,Q??null),O==="flux_analysis"&&z.trackFluxAnalysisPage(F.month,F.year,q,Fo(c.fluxAnalysis),Q??null),O==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(F.month,F.year,q,"draft",c.auditSummary.auditScorePercentage,null,Q??null)},[F,c]);return a.useEffect(()=>{X===Y.fetchState&&O===he||Y.fetchState!=="Completed"||be(!1)},[O,Y.fetchState,he]),be})(),te=Io(),[V,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,T]=a.useState([]),[M,w]=a.useState(void 0),$=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),Ie=a.useCallback(()=>{m(),w(void 0),d(),I()},[d,I,m]),fe=a.useRef(v);a.useEffect(()=>{v===!0&&fe.current===!1&&(m(),w(void 0),d()),fe.current=v},[d,v,m]);const ke=a.useRef(y);a.useEffect(()=>{y===!0&&ke.current===!1&&(v&&S(!1),w(void 0),E===!0&&f!==!0&&t?.()),ke.current=y},[t,y,v,S,f,E]);const ne=E===!0&&f!==!0,G=a.useRef(ne);a.useEffect(()=>{ne&&!G.current&&(v&&S(!1),m(),w(void 0)),G.current=ne},[v,ne,m,S]);const[Ye,Nt]=a.useState(!1),Ke=a.useRef(!1),{selectedTab:Qe}=rt(),{tenantEmailDomain:Yt}=rt(),[_e,He]=a.useState(B.state?.message==="comingFromTransactionDetail"),We=B.state?.message==="comingFromOverview",Kt=fo(),Me=Be.getSignedInUser(),{useDynamicConfig:Qt,useFeatureGate:Ee}=zt(),{configValue:Ht}=Qt(ko.enableUncategorizedExpenseCategory),W=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ze}=Ee(Ce.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:le}=Ee(Ce.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=Ee(Ce.isTransactionActivityEnabled),{isFeatureEnabled:Wt}=Ee(Ce.isExpenseAutomationCommentingEnabled),Zt=a.useCallback(c=>{const j=Je(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),Xt=U(c=>_a(c,"common")),L=U(c=>pe(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ae,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:Z,jeSchedules:Oe,reconciliation:tn}=L;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||$(void 0)},[x,$,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==ae&&(ve.current=ae,x==="transaction_categorization"&&$(void 0)):ve.current=ae},[x,ae,$]);const nn=U(c=>M==null?void 0:Ma(c.transactionState,M)),oe=nn?.qboId,an=U(c=>oe==null?void 0:Oa(c,oe));a.useEffect(()=>{oe!=null&&h(Va(oe))},[h,oe]);const{selectedAccountId:re}=tn,et=$e(Oe.accountSettingsView.saveState.fetchState),on=U(c=>ja(c.accountState,c.accountListState,"accountList")),sn=U(c=>za(c)),de=Qe!=null?La(Qe):x,cn=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(qt({isDataReady:Z.fetchState==="Completed"}),Me==null)throw Error("Can't access expense automation screen without signing in...");const tt=Mt(D),ue=Ue(tt.start),me=Ue(tt.end);if(ue==null||me==null)throw Error(`Invalid start - ${ue} and end - ${me} period from given ${D}`);const ln=a.useCallback(()=>{l(!1)},[]),rn=a.useCallback(()=>{p(!0)},[]),dn=a.useCallback(c=>{T(c),p(!1)},[]),un=a.useCallback(()=>{T([])},[]),ye=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{le===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[le,x,ye,nt,h]);const at=Me?.userId,mn=D.month,hn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&le!==!1&&ye==="idle"&&at!=null&&ot!=null&&h($a())},[x,le,ye,at,ot,mn,hn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{de!=null&&x!==de&&h(Ot(de))},[de]),a.useEffect(()=>{Ye!==!1||Z.fetchState!=="Completed"&&Z.fetchState!=="Error"||!R||(Nt(!0),h(It(!1,!1,W)))},[Ye,Z,R,W]),a.useEffect(()=>{!We&&R&&(h(It(!1,!1,W)),h(ie(D,re,!1,!1)))},[D.month,D.year,R,W]);const st=a.useCallback((c=!1,j=!1)=>{const Y={start:ue,end:me};switch(x){case"transaction_categorization":h(ge(ae,Y,c,!_e,void 0,void 0,j,void 0,W)),He(!1);break;case"flux_analysis":h(we(D,c,j,null));break;case"month_end_insights":if(j===!1){const O=new Date(D.year,D.month,0),F=qa(O.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);h(Ja(!0,n.companyId,n.tenantId,F)),h(Na(n.companyId,n.tenantId))}break;case"je_schedules":h(Ga(Y,j));break;case"missing_receipts":h(Vt(Y,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ie(D,re,c,j))}},[x,ue,me,n.companyId,n.tenantId,ae,D,re,_e,He,W]);a.useEffect(()=>{x===de&&Z.fetchState==="Not-Started"&&R&&st(!0)},[Z,ue,me,n.companyId,n.tenantId,R]),a.useEffect(()=>{We||_e||Ke.current||en.fetchState==="In-Progress"||Z.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),a.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,n.tenantId]),a.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Ya({companyId:n.companyId})),r("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&re==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ie(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ie,re,D]);const pn=vt();a.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!Ze;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,N.monthEndCloseChecks]);const gn=u===!0?g:P,Cn=u===!0||E===!0,Sn=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Oe.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Oe.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:Y})=>{const O=ce();let F,he,X;const be=vt(),q=c.transactionView;let Q=()=>{};const{transactions:vn,selectedTransactionId:se,selectedTransactionLineId:Pe,transactionLocalData:yn}=q;if(Y==="transaction_categorization"){const Ve=yn.find(ee=>ee.transactionId===se),J=vn.find(ee=>ee.id===se),it=Pe!=null?Ve?.transactionReviewLocalData?.lineItemById[Pe]:void 0,lt=it?.account;he=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Pn=Ao(se,J?.typeOfTransaction);J!=null&&Pn&&(X={id:se,type:Je(J.typeOfTransaction)}),Q=()=>{if(se!=null&&Pe!=null&&J!=null){const ee=q.transactionLocalData.find(Ae=>Ae.transactionId===se)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const Ae=ee.lineItemById[Pe];let je=ee.selectedEntity;if(qn(J)||(je=Ae.selectedEntityLine),je!=null){const An=je,Tn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(wn=>wn.id)??[]};O(Ne(An,Ae.amount.amount,Tn,!1,!0,be))}}}}}const bn=U(Ve=>dt(Ve,void 0,F,he));return{transactionId:X,onSaveVendor:()=>{O(Gn(X,void 0,!1,!0))},onSaveSuccess:Q,onCancel:()=>{X!=null&&O(zn({transactionId:X})),O(Ln()),O($n()),j()},vendorViewDetails:bn}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Kt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(Eo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(wo,{isOpen:k,drawerLeftMargin:new vo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Vo,{onClick:c=>c.stopPropagation(),children:C.jsx(Uo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&V&&C.jsx(bo,{isOpen:V,transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}),C.jsx(Mo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:le,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:Ze,isUncategorizedExpenseCategoryEnabled:W,isAccountingClassesEnabled:sn,isCOTEnabled:pn,currentTenant:n,companyId:n.companyId,signedInUser:Me,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?M:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&M!=null?C.jsx(yo,{activityLogView:an,qboId:oe,onClose:()=>$(void 0),selectedTransactionId:M},String(M)):null,uncategorizedAccounts:on,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Yt,trackExpenseAutomationTabAnalytics:K,setActivityLogTransactionId:$,closeSidePanel:Sn,openTransactionPanel:i,sidePanelIsOpen:Cn,sidePanelIsFullView:u!==!0&&f,panelContent:gn,isAiCfoAccessEnabled:A,onAskAiCfoClick:Ie,isExpenseAutomationCommentingEnabled:Wt,onExpenseAutomationCommentingThreadClick:Zt,sidePanelListPercent:u===!0?66:void 0})]})})),Vo=Fe(Rn)`
|
|
22
22
|
display: flex;
|
|
23
23
|
min-height: 100%;
|
|
24
24
|
flex-direction: column;
|
|
25
|
-
`;function rs(){return C.jsxs(Un,{children:[C.jsx(
|
|
25
|
+
`;function rs(){return C.jsxs(Un,{children:[C.jsx(ze,{path:"*",element:C.jsx(xo,{})}),C.jsx(ze,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Oo,{})}),C.jsx(ze,{path:"*",element:C.jsx(xn,{})})]})}export{rs as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BLWCZxXF.js";import{a as r}from"./sentry-BweJUVSU.js";import{Y as i,$ as l,a0 as p,k as m}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import f from"./NotFoundScreen-vkDXbz0R.js";import{j as u,u as b}from"./core-DS-Czzkv.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]="38164943-7e55-44dc-9548-c9d1b513ec33",e._sentryDebugIdIdentifier="sentry-dbid-38164943-7e55-44dc-9548-c9d1b513ec33")}catch{}})();const D=()=>{const e=u(),t=b(),o=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),a=i(t.pathname);return a!=null?s.jsx(l,{menuItem:p(a),onDemoClick:o,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t};export{D as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./sentry-BweJUVSU.js";import{h as l,j as f,u as m}from"./core-DS-Czzkv.js";import{gv as p,Jc as g,Jd as b}from"./zeni-epic-state-CH3oUd_o.js";import{u as _,L as h,z as y}from"./index-KYBDOcEA.js";import"./liveblocks-BLWCZxXF.js";import"./recharts-BV8xDSZo.js";import"./mui-DeKIqdeR.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b08a22db-e1b7-48cc-aff0-08c345244467",e._sentryDebugIdIdentifier="sentry-dbid-b08a22db-e1b7-48cc-aff0-08c345244467")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-BLWCZxXF.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-DS-Czzkv.js";import{J5 as k,J6 as v,J7 as T,za as B,yY as G,J8 as D,J9 as oe,Ja as se,z0 as ie,eR as $,z7 as le,z4 as re}from"./zeni-epic-state-CH3oUd_o.js";import{Z as g,o as r,n as de,e as j,j as J,p as ce,k as me,q as pe,r as H,y as ue,S as he,s as xe,v as ge,m as fe,w as we,x as be,A as Se,B as ye,C as ke,E as ve,F as je,G as $e}from"./index-KYBDOcEA.js";import{n as m}from"./mui-DeKIqdeR.js";import f from"./NotFoundScreen-vkDXbz0R.js";import{a as I}from"./sentry-BweJUVSU.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="4679fdf8-9368-4c69-9eda-5973968562f9",e._sentryDebugIdIdentifier="sentry-dbid-4679fdf8-9368-4c69-9eda-5973968562f9")}catch{}})();const Ie=m.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -7,7 +7,7 @@ import{j as t}from"./liveblocks-JFc2ySVL.js";import{l as S,k as x,j as C,u as y,
|
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
9
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
-
`,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:
|
|
10
|
+
`,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(de);function F(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
height: 100vh;
|
|
13
13
|
width: 100%;
|
|
@@ -16,7 +16,7 @@ import{j as t}from"./liveblocks-JFc2ySVL.js";import{l as S,k as x,j as C,u as y,
|
|
|
16
16
|
align-items: center;
|
|
17
17
|
background-color: ${e=>e.theme.colors.grey4};
|
|
18
18
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
19
|
-
`,De=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:D(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,
|
|
19
|
+
`,De=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:D(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Ae();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=Pe(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function ze({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(De,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const Ae=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
height: 100%;
|
|
22
22
|
width: 100%;
|
|
@@ -25,7 +25,7 @@ import{j as t}from"./liveblocks-JFc2ySVL.js";import{l as S,k as x,j as C,u as y,
|
|
|
25
25
|
align-items: center;
|
|
26
26
|
background-color: ${e=>e.theme.colors.grey4};
|
|
27
27
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
-
`,
|
|
28
|
+
`,Ne=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(T({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
height: 100%;
|
|
31
31
|
width: 100%;
|
|
@@ -34,7 +34,7 @@ import{j as t}from"./liveblocks-JFc2ySVL.js";import{l as S,k as x,j as C,u as y,
|
|
|
34
34
|
align-items: center;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
36
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
-
`,Te=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:
|
|
37
|
+
`,Te=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},He=m(ke)`
|
|
38
38
|
width: ${r.sp4};
|
|
39
39
|
height: ${r.sp4};
|
|
40
40
|
margin-bottom: ${r.sp3};
|
|
@@ -43,7 +43,7 @@ import{j as t}from"./liveblocks-JFc2ySVL.js";import{l as S,k as x,j as C,u as y,
|
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
45
45
|
color: ${e=>e.theme.colors.brandColorJade};
|
|
46
|
-
`,
|
|
46
|
+
`,Me=m.div`
|
|
47
47
|
display: flex;
|
|
48
48
|
height: 100vh;
|
|
49
49
|
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
@@ -58,7 +58,7 @@ import{j as t}from"./liveblocks-JFc2ySVL.js";import{l as S,k as x,j as C,u as y,
|
|
|
58
58
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
59
59
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
60
60
|
padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
|
|
61
|
-
`,
|
|
61
|
+
`,_e=m.div`
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: column;
|
|
64
64
|
align-items: center;
|
|
@@ -69,4 +69,4 @@ import{j as t}from"./liveblocks-JFc2ySVL.js";import{l as S,k as x,j as C,u as y,
|
|
|
69
69
|
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
70
|
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
71
|
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
-
`,
|
|
72
|
+
`,Ke=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),d=i.get("token"),M=n.pathname.includes("address"),w=g(),V=ge(),z=fe(),b=we(),_=()=>{V.toggle()},K=E(u=>k(u)),W=E(u=>v(u)),{authParams:U,fetchState:c,billAttachment:q,billFetchState:A,companyName:R,currencySymbol:Y,amount:O}=K,{tenantId:P,userId:L,sessionId:N}=U,{fetchState:Z,internationalBankAccountCreateStatus:Q}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&a(le(s,o,d))},[b,c,s,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(L,N,P),l!=null&&a(re(l)))},[c,b,L,N,P,l,a]),c==="Error"?t.jsx(f,{}):Z==="Completed"||Q.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:z.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${z.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&A==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",s??"",R,l??"",We(n.pathname),Y,O))(u)}),t.jsxs(Me,{windowSize:w,children:[w!=="small"?t.jsx(He,{onClick:_}):null,t.jsx(_e,{windowSize:w,isAddressPage:M,children:A==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(Ke,{file:q,type:"bill"})}),t.jsx(Ve,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Ue,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(ze,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-BLWCZxXF.js";import{a as g}from"./sentry-BweJUVSU.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-DS-Czzkv.js";import{z as r,m as P,D as V,f as A,e as J,g as N,H as R,B as q,h as B}from"./index-KYBDOcEA.js";import{eQ as H,IS as Q,J0 as W,IT as Y,eR as $,fk as G,IY as K,fJ as X,cU as Z,J1 as ee,J2 as te}from"./zeni-epic-state-CH3oUd_o.js";import{n as ne}from"./mui-DeKIqdeR.js";import{u as se}from"./useDeviceId-eKf2uZLe.js";import{f as ae}from"./analyticsHelper-Db94ox0D.js";import{t as ie}from"./getLocaleForTenant-bt_-bwkg.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.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]="2032468d-8272-4175-8a60-6fba06085db1",t._sentryDebugIdIdentifier="sentry-dbid-2032468d-8272-4175-8a60-6fba06085db1")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=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),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>H(e)),b=l(e=>Q(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(W(n,i,f)))},[n,p,t,i,f,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(Y(b.tenantsInOrder),s.zeniSessionId),$(s.userId,s.zeniSessionId,o.tenantId),t(G(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),X().then(()=>{const e=B();e!=null&&A(e)}),setTimeout(()=>{J.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,y,s,o,b,v,a.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(q,{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{De as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as P}from"./liveblocks-BLWCZxXF.js";import{a as c}from"./sentry-BweJUVSU.js";import{h as be,g as s,l as qe,u as Ke,j as ea,i as M}from"./core-DS-Czzkv.js";import{eQ as he,eX as aa,eY as Se,eS as ta,bn as na,f5 as sa,eZ as oa,e_ as ia,f0 as ra,f3 as da,fd as la,f4 as g,f7 as ca,f8 as ue,fb as ua,f9 as fa,fa as ma,fc as pa,cJ as ba,ff as ha,cP as Sa,bv as ga,eP as Ea,fk as ka,fl as Ca,fj as ya}from"./zeni-epic-state-CH3oUd_o.js";import{a3 as Ia,a4 as Ta,v as wa,y as _a,z as k,Z as Aa,a5 as Fa,T as Da,w as va,u as $a,S as r,a6 as Ba,a7 as Ga,d as xa,a as Ma,a8 as Ra,Y as Na,a9 as Pa,aa as Ua,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,e as R,r as _,W as ja,af as N,ag as La}from"./index-KYBDOcEA.js";import{D as Ya}from"./mui-DeKIqdeR.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="e709cffe-d01d-4a4f-adde-9e0dcc01b75a",m._sentryDebugIdIdentifier="sentry-dbid-e709cffe-d01d-4a4f-adde-9e0dcc01b75a")}catch{}})();const za=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=qe(),t=Ke(),C=wa(),o=ea(),U=ta(),p=be(),{useFeatureGate:i}=_a(),V=k.getSignedInUser(),A=na(V),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),O=s(e=>sa(e)),j=O.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,Y=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:we}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),_e=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabledV2),Q=J||W&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ge}=i(r.isTreasuryEnabled),{isFeatureEnabled:xe}=i(r.isTaskManagerCustomerUserAccessEnabled),Me=A||!A&&xe,Re=n.company!=null&&la(n.company),w=Ge&&Re,Ne=s(e=>g(e).totalUnreadCount),Pe=s(e=>g(e).reducedFetchCountState),X=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=Ga();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&U.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Pe,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),z===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const je=xa(),oe=s(e=>fa(e,S,h,J,W,w).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||Y&&(ie==="Completed"||ie==="Error")||!D&&!Y?void 0:"disabled",Ye=c.useMemo(()=>pa(n.userRole),[n.userRole]),ze=ba(Ye),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Ma(),We=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[w,de,le,t.pathname,a]),[Je,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Xe=Pa(Qe);return P.jsx(Ya,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:P.jsx(Ua,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?_e:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:we,isVendorsTabVisible:ze,isZeniAccountEnabled:z,isChargeCardEnabled:Te,isTreasuryEnabled:w,treasuryYieldPercentage:Xe,isTreasuryPopupVisible:Je,isNotificationsTabVisible:He,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:Q&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=X===0&&q>0?"notifications/comments":"notifications/tasks";me(t)&&(e=X===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=_(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=_(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=_(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Me,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),qa=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return P.jsx(za,{...m,...t})};export{qa as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-BLWCZxXF.js";import{j as i,k as n}from"./core-DS-Czzkv.js";import{Q as e}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import"./sentry-BweJUVSU.js";import"./zeni-epic-state-CH3oUd_o.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.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]="38433470-5748-45c8-9d22-f3cba6aaf7d5",o._sentryDebugIdIdentifier="sentry-dbid-38433470-5748-45c8-9d22-f3cba6aaf7d5")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(e);function h(){const o=i();return r.jsx(a,{navigate:o})}export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-BLWCZxXF.js";import lt from"./NotFoundScreen-vkDXbz0R.js";import{a as k}from"./sentry-BweJUVSU.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-DS-Czzkv.js";import{cr as St,eZ as z,eQ as H,fc as bt,f4 as b,Pl as Z,f8 as d,eY as y,qC as M,vX as It,Pm as Ct,eX as Tt,ff as yt,qH as Et,Pn as $,bq as F,gO as x,qL as Y,Po as _t,cC as At,cw as Nt}from"./zeni-epic-state-CH3oUd_o.js";import{U as Bt,z as wt,y as xt,S as Pt,ct as Rt,r as N,a3 as vt,cu as Dt,a4 as Ut,k as Gt}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import{c as Ft}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.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]="a91df91f-4758-4f17-9080-14a6d2ef2992",t._sentryDebugIdIdentifier="sentry-dbid-a91df91f-4758-4f17-9080-14a6d2ef2992")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=z(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Z(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Y("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({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(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Dt)),qt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>z(e)),o=S(e=>H(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Ft({isDataReady:!0});const J=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),q=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),K=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:V,isLoading:L,fetchMore:W,isFetchingMore:O,hasFetchedAll:Q}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(q!==i&&i!=null&&s(Z(i)),i==null){const e=`../${q}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{K.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(E===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[E,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=E||D===!0||C!==!0||E||D===!0||C!==!0;k.useEffect(()=>{U&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&L===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),_=p.map(f=>f.id),it=p.map(f=>{const G=V.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(O||Q===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,D,O,C,Q,L,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];R==="all"?_.push("read","unread"):R!=="mentions"&&_.push(R),s(M("task_manager",T,_,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:J,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return A.jsxs(gt,{children:[A.jsx(X,{path:"/:selectedTab",element:A.jsx(qt,{})}),A.jsx(X,{path:"*",element:A.jsx(lt,{})})]})}export{ie as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-BLWCZxXF.js";import{a as r}from"./sentry-BweJUVSU.js";import{h as A,u as J,g as o,N as j}from"./core-DS-Czzkv.js";import{Jf as x,eQ as C,f3 as P,Jg as z,Jh as D,Ji as M,Jj as R,mx as k,Ib as L}from"./zeni-epic-state-CH3oUd_o.js";import{z as h,J as I}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="f18f55df-3deb-454f-9aac-9f12df325a52",n._sentryDebugIdIdentifier="sentry-dbid-f18f55df-3deb-454f-9aac-9f12df325a52")}catch{}})();function ee(){const n=A(),a=J(),{params:t,error:i}=r.useMemo(()=>x(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),f=h.isSignedIn(),s=h.getSignedInUser(),p=o(e=>C(e)),l=o(e=>P(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),u=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))},[f,s,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),c=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(L(s.userId,s.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-BLWCZxXF.js";import{j as Q,h as Y,u as z,l as Z,g as d,k as H,n as K,o as I}from"./core-DS-Czzkv.js";import{eQ as R,qq as P,p_ as X,JO as v,pV as S,bv as ee,bn as ae,bT as te,pW as se,JP as oe,JA as C,dE as re,tU as ne,JQ as ce,uf as ie,eW as le,eU as de}from"./zeni-epic-state-CH3oUd_o.js";import{z as me,U as fe,d as pe,y as M,S as $,A as ue,e as w,al as he,r as ge}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import Fe from"./NotFoundScreen-vkDXbz0R.js";import{F as be}from"./FeaturePreviewScreen-9JeQ0IeJ.js";import{a as g}from"./sentry-BweJUVSU.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import{c as Ce}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import{u as Se}from"./useInitialThreadRequest-GwPuAy0h.js";import{t as Te}from"./routePaths-BgR0bMMr.js";import{M as ye}from"./MobileAppDrawer-DDKkJ918.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.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]="ffac67e5-46ee-4714-8d56-4a3b6f717ec7",s._sentryDebugIdIdentifier="sentry-dbid-ffac67e5-46ee-4714-8d56-4a3b6f717ec7")}catch{}})();const T=(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=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function O(){const s=Q(),e=Y(),a=z(),{forecastId:o,tenantEmailDomain:r}=Z(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>R(t)),W=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),A=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Ce({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:_}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,U)=>L!=null?f.forecasts.findIndex(b=>b.id===L):U!=null?f.forecasts.findIndex(b=>b.id===U):f.forecasts.length>0?0:-1)(i,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(v(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,m,u,P,S,F]);const D=pe(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:N}=M(),{isFeatureEnabled:E}=N($.isReportsCommentingEnabled),V=Se(E?y?.companyId:void 0,{clearParams:l&&m}),[G,J]=g.useState(!1),j=t=>{J(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),n.jsx(Ae,{firstMonthOfFY:W,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:q,onAskAiCfoClick:_,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:V,onClickMenuIcon:()=>{j(!0)}})]})}function Qe(){const s=d(c=>R(c)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Qe as PandLWithForecastRoutes,Qe as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-BLWCZxXF.js";import{JJ as te,eQ as X,jC as H,eW as Q,eU as ne,H8 as Y,Jn as oe,t0 as Ee,JK as N,sQ as ke,t9 as Ie,t3 as ie,sU as re,t7 as Pe,t4 as je,JL as le,uG as Le,JM as Te,fz as ve,JN as J,sZ as de,sX as ce,tc as Fe,c2 as Ae}from"./zeni-epic-state-CH3oUd_o.js";import{Z as pe,y as q,S as E,z as K,a6 as ue,I as me,ah as ge,ai as Re,F as he,o as R,O as fe,D as Ce,aj as Oe,U as Ve,A as Ue,e as be,g as Ze,r as Be,ak as $e,d as Je}from"./index-KYBDOcEA.js";import{D as ye,n as M,S as we}from"./mui-DeKIqdeR.js";import se from"./NotFoundScreen-vkDXbz0R.js";import{a as r}from"./sentry-BweJUVSU.js";import{h as ee,l as ze,g as m,j as Ge,u as He,k as Ke,n as ae,o as $}from"./core-DS-Czzkv.js";import{u as Me}from"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import{c as We}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import{M as _e}from"./MobileAppDrawer-DDKkJ918.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="f206d67c-2207-4f50-8107-ff2542c96009",s._sentryDebugIdIdentifier="sentry-dbid-f206d67c-2207-4f50-8107-ff2542c96009")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>X(e)),D=m(e=>H(e)),{useFeatureGate:f}=q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Q(k,u),T=ne(u),v=Y(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(s):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),a.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:a.jsxs(Qe,{onClick:e=>e.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(Se,{children:z.discardTitle}),descriptionComponent:a.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:i,isEditPopup:!0}):null,a.jsx(Re,{...b})]})})},Qe=M(we)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Se=M(fe.H6Regular)`
|
|
6
|
+
margin-top: ${R.sp7};
|
|
7
|
+
padding-left: ${R.sp8};
|
|
8
|
+
padding-right: ${R.sp8};
|
|
9
|
+
color: ${s=>s.theme.colors.primary};
|
|
10
|
+
word-break: break-word;
|
|
11
|
+
`,De=M(fe.LargeRegularSp)`
|
|
12
|
+
color: ${s=>s.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
|
+
`,Ye={overlayWidth:new he(100,100,48)},G=Ce.getLocalizedStrings().peoplePage.invitePage,qe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>X(i)),u=m(i=>H(i)),{useFeatureGate:D}=q(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=Q(f,d),P=ne(d),T=Y(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,Z=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},B=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),L=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:T,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(s):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:Z};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),a.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ye.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(es,{onClick:i=>i.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(Se,{children:G.discardTitle}),descriptionComponent:a.jsx(De,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:F}):null,a.jsx(Oe,{...b})]})})},es=M(we)`
|
|
19
|
+
display: flex;
|
|
20
|
+
min-height: 100%;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
`,ss=Ke(function(s,t){const l=le(s),n=K.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:H(s),analytics:be}},function(s,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{s(re(o,y))},onResendInvite:o=>{s(Fe(o))},onReloadPeople:()=>{s(de()),s(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{s(J({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{s(J({searchText:o}))}}}})($e);function _({isInvitePeopleDrawerOpen:s,isEditPeopleDrawerOpen:t}){const l=Ge(),n=ee(),g=He(),{areTenantIdsInSync:o}=Ve(),y=K.getSignedInUser(),h=m(e=>X(e)),{useFeatureGate:p}=q(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>H(e)),I=!Q(O,h)&&V,w=Y(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,T]=r.useState(!1),[v,U]=r.useState("off"),[Z,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:B}=Me({mobileExploreReferrer:"People"}),c=m(e=>le(e));We({isDataReady:c.fetchState==="Completed"});const j=m(e=>Le(e.classState,e.classListState)),L=m(e=>Te(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(J({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(s!=null&&s===!0),T(t!=null&&t===!0&&t)},[s,t]),r.useEffect(()=>{n(J({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),T(!1),l("../")};return a.jsxs(a.Fragment,{children:[c.fetchState==="Completed"?a.jsx(Ue,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?a.jsx(qe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,a.jsx(_e,{isAppContentDrawerOpen:Z,handleDrawerToggle:C}),a.jsx(ss,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:L,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(J({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=Be(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:B})]})}function Ss(){const s=Je();return Ae(s?.loggedInUserRole??[])?a.jsxs(ae,{children:[a.jsx($,{path:"/",element:a.jsx(_,{})}),a.jsx($,{path:"new",element:a.jsx(_,{isInvitePeopleDrawerOpen:!0})}),a.jsx($,{path:":userId/edit",element:a.jsx(_,{isEditPeopleDrawerOpen:!0})}),a.jsx($,{path:"*",element:a.jsx(se,{})})]}):a.jsx(ae,{children:a.jsx($,{path:"*",element:a.jsx(se,{})})})}export{Ss as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BLWCZxXF.js";import E from"./NotFoundScreen-vkDXbz0R.js";import{a as r}from"./sentry-BweJUVSU.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-DS-Czzkv.js";import{eQ as B,Pp as b,bo as F,bn as N,hi as V,gO as Q}from"./zeni-epic-state-CH3oUd_o.js";import{v as $,z as I,cv as q}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import{c as H}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import{M as J}from"./MobileAppDrawer-DDKkJ918.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.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]="8dfe1d32-bea6-4a02-833c-d7cdf6899d57",e._sentryDebugIdIdentifier="sentry-dbid-8dfe1d32-bea6-4a02-833c-d7cdf6899d57")}catch{}})();const K=O(function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(q),L=()=>{const e=_(),t=v(),d=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(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,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=S||k||x,c=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"||c(a,i,!0),m.current=!0},[n?.fetchState,c]),j=r.useCallback((a,i)=>{c(a,i,!1)},[c]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return H({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:d,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 pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as t}from"./sentry-
|
|
1
|
+
import{a as h,b as t}from"./sentry-BweJUVSU.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Ol}from"./liveblocks-
|
|
1
|
+
import{j as Ol}from"./liveblocks-BLWCZxXF.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BweJUVSU.js";import{L as dt,bT as Tc,eQ as Ac,IS as Rc,Jk as kl,c2 as Tl,fk as Al,fl as Rl}from"./zeni-epic-state-CH3oUd_o.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-D7Uun_Ak.js";import{r as un}from"./empty-BW6MrnJi.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-CqpoMVUd.js";import{r as Gl}from"./index-DZw5cZyY.js";import{r as zl}from"./index-BIUN5C-2.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DS-Czzkv.js";import{u as Kl,z as Pc,L as Wl,K as Jl,M as Xl,j as Ql,e as tf}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import{d as Pe}from"./decodeURIComponentSafe-BUgIzLPe.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="8d40d024-db4d-4e51-ae03-f9d46a7b3f27",t._sentryDebugIdIdentifier="sentry-dbid-8d40d024-db4d-4e51-ae03-f9d46a7b3f27")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
|
|
2
2
|
`),I=_(E).split(`
|
|
3
3
|
`),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
|
|
4
4
|
|