@zeniai/web-app-ui 5.2.18-qa → 5.2.19-next
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-D14Xrcr-.js +1 -0
- package/dist/assets/AddressScreen-DM3Cytik.js +9 -0
- package/dist/assets/AiCfoScreen-C7VAZJ1A.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-8Ll-z-xT.js → BillPayApprovalRoutes-C9icCWAb.js} +1 -1
- package/dist/assets/{BillPayRoutes-pfP5wo_C.js → BillPayRoutes-DffUP74I.js} +12 -12
- package/dist/assets/{BusinessVerificationPageScreen-MOMZNf2n.js → BusinessVerificationPageScreen-qG6q7Wb6.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-BahaNrfe.js +14 -0
- package/dist/assets/{ChargeCardRoutes-CkepWz7M.js → ChargeCardRoutes-SaV3T-oM.js} +10 -10
- package/dist/assets/CompanyPassportScreen-CQUCnlmj.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DxTli2yc.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DCVZbjhG.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-Ber4B0KW.js +30 -0
- package/dist/assets/{DashboardRoutes-MCNi0Cm3.js → DashboardRoutes-CDwIkoUk.js} +4 -4
- package/dist/assets/{DefaultTenantHome-B8QXwYfi.js → DefaultTenantHome-CLCoE5KB.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Cy5XGzM3.js +18 -0
- package/dist/assets/DrawerScreen-CFq_1rdP.js +1 -0
- package/dist/assets/EntityDetailRoutes-lCFdhj0N.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BnRbsSz6.js +25 -0
- package/dist/assets/FeaturePreviewScreen-1q69VsC1.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-X0-DSjZb.js +1 -0
- package/dist/assets/MagicLinkRoutes-Dfdz57KO.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-3rm3mwQp.js +12 -0
- package/dist/assets/MobileAppDrawer-uvkpUvp_.js +1 -0
- package/dist/assets/NotFoundScreen-DR4zbgK0.js +1 -0
- package/dist/assets/{NotificationRoutes-CghqA--C.js → NotificationRoutes-Cd2QvtFH.js} +1 -1
- package/dist/assets/OAuthConsentScreen-B3JPBskg.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-W3OrOyHu.js +1 -0
- package/dist/assets/PeopleRoutes-DNg7Ihue.js +22 -0
- package/dist/assets/PerformanceRoutes-o3ofDHl6.js +1 -0
- package/dist/assets/{Preview-C3t9OASa.js → Preview-GrKYlvV7.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BxSTUR6Z.js → QBOConnectionScreen-Bky1RVSb.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DGVz-GX1.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BCDSmsvv.js → ReimbursementApprovalRuleDetailScreen-4DU8eod7.js} +1 -1
- package/dist/assets/{ReimbursementRoutes--vh1Dgkn.js → ReimbursementRoutes-C1MfITXr.js} +8 -8
- package/dist/assets/{ReportsRoutes-B0L7XL0D.js → ReportsRoutes-CoMGWCHx.js} +1 -1
- package/dist/assets/RewardsRoutes-e7w8wtnX.js +1 -0
- package/dist/assets/ScreenRoutes-KCqCdpwt.js +2 -0
- package/dist/assets/SettingsRoutes-BZ_pWEty.js +57 -0
- package/dist/assets/{SetupPagesScreen-z1fhy2nD.js → SetupPagesScreen-D_WJHeIH.js} +5 -5
- package/dist/assets/SignInScreen-BNoucZFL.js +1 -0
- package/dist/assets/SignOutScreen-CMf4hwn3.js +9 -0
- package/dist/assets/TaskListScreen-C_rNr9Jk.js +9 -0
- package/dist/assets/TaskRoutes-CpISGdNU.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-Ds78cNrz.js → TransactionDetailRoutes-CmH9g66g.js} +1 -1
- package/dist/assets/TransactionDetailScreen-BAzuDRZQ.js +5 -0
- package/dist/assets/{TransactionListRoutes-CbJW0jN6.js → TransactionListRoutes-CoFY3pbX.js} +1 -1
- package/dist/assets/TreasuryRoutes--lIehLfz.js +37 -0
- package/dist/assets/{VendorsRoutes-WaC1MSeH.js → VendorsRoutes-BlvpjJIF.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-C62-fzuC.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-ChKECbqX.js → ZeniAccountRoutes-DsEwo2kw.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-DsIySC9T.js +9 -0
- package/dist/assets/{accountMappingHelper-B-kf-Qnc.js → accountMappingHelper-DF_wZmqr.js} +1 -1
- package/dist/assets/{analytics-DtYJ-EGT.js → analytics-CsrWBSkJ.js} +1 -1
- package/dist/assets/{analyticsHelper-DcIIaR44.js → analyticsHelper-eo4F52XS.js} +1 -1
- package/dist/assets/{core-DnZcjy6X.js → core-Ct1Na3r4.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CjxujRw-.js → decodeURIComponentSafe-Dl7JnLtd.js} +1 -1
- package/dist/assets/{dnd-eoV-_JYH.js → dnd-DXTfJSUb.js} +1 -1
- package/dist/assets/{empty-Dq2hLrCm.js → empty-C9Atwx5F.js} +1 -1
- package/dist/assets/{empty-DkIaLxCd.js → empty-enRUfXAJ.js} +1 -1
- package/dist/assets/{emptyVideoElement-BFB9pddL.js → emptyVideoElement-BWmmLkB3.js} +1 -1
- package/dist/assets/epic-CPUd8eYu.js +2 -0
- package/dist/assets/getLocaleForTenant-C9iKXyPU.js +1 -0
- package/dist/assets/{index-Bar5dTpy.js → index-BBFNuY8-.js} +15820 -16753
- package/dist/assets/{index-nn6YvIGD.js → index-C5jp_Nos.js} +1 -1
- package/dist/assets/{index-DUKU6sVX.js → index-CpAcGISI.js} +1 -1
- package/dist/assets/index-Czu7h9lW.css +1 -0
- package/dist/assets/{index-D_CZgugN.js → index-DD29fIsd.js} +1 -1
- package/dist/assets/{index-Wtyhkk6J.js → index-DHN0iULb.js} +1 -1
- package/dist/assets/{index-C8_nlYo6.js → index-D_W5SS2j.js} +2 -2
- package/dist/assets/{index-Dmm4l94W.js → index-Lktm9qH-.js} +1 -1
- package/dist/assets/{index-CiCTnO2S.js → index-UCOMlrxB.js} +1 -1
- package/dist/assets/{lexical-CSqytB8g.js → lexical-5nbymAIm.js} +1 -1
- package/dist/assets/liveblocks-P0DntAgT.js +54 -0
- package/dist/assets/{lottie-Dz5luYQG.js → lottie-7Wgw-CzS.js} +1 -1
- package/dist/assets/{mui-sr6zger7.js → mui-SSWNL1tt.js} +1 -1
- package/dist/assets/{pathToGoBack-DpO-gBzq.js → pathToGoBack-wtH43kNb.js} +1 -1
- package/dist/assets/{pdf-BNSeVvBm.js → pdf-COhrBMN3.js} +3 -3
- package/dist/assets/{pdf-lib-DwpnbCVp.js → pdf-lib-DerHPYIF.js} +1 -1
- package/dist/assets/{plaid-QvRDxgoN.js → plaid-CdfVkhIW.js} +1 -1
- package/dist/assets/{pusher-senIjtt-.js → pusher-hTFVCAHJ.js} +1 -1
- package/dist/assets/{react-CBRcLxW-.js → react-C3avayV7.js} +1 -1
- package/dist/assets/{react-CiyNePZ5.js → react-CB88nZl5.js} +1 -1
- package/dist/assets/{react-OAPKV4uC.js → react-CYqO4utD.js} +1 -1
- package/dist/assets/{react-ClmbMdlp.js → react-Ci3GJXKz.js} +1 -1
- package/dist/assets/{react-CuKQRzYG.js → react-DAcDxy2I.js} +1 -1
- package/dist/assets/{react-BGDkRw8Y.js → react-G31LEvJE.js} +1 -1
- package/dist/assets/{recharts-Bim6mdwu.js → recharts-KVNUr0cO.js} +1 -1
- package/dist/assets/routePaths-Dvh0MCMy.js +1 -0
- package/dist/assets/{sentry-DFI2OQU2.js → sentry-CfbcqWq3.js} +1 -1
- package/dist/assets/{url-p6YiHaLn.js → url-CbJg2s3J.js} +1 -1
- package/dist/assets/{url-4e0ZWhZq.js → url-FHfZtBCR.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-zVG2a35W.js → useAiCfoDashboardSuggestedQuestionsChips-BLXE02N5.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BeiXTDS4.js +1 -0
- package/dist/assets/useCashManagementBanner-D5vpE0Fa.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-0JCfQ36-.js → useChargeCardPusherEvents-B55cb89o.js} +1 -1
- package/dist/assets/{useDeviceId-DasP_-mC.js → useDeviceId-BAVWaoiW.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-2wnXRew_.js → useEmailConnectResultRefresh-DZEhjfaj.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DW3cIl_2.js → useInitialThreadRequest-J5ElkQVA.js} +1 -1
- package/dist/assets/{utils-cHxIh7E8.js → utils-BmRSZi-a.js} +1 -1
- package/dist/assets/withTransactionSidePanel-u9hB8oy5.js +21 -0
- package/dist/assets/{zeni-epic-state-m4zoW3ek.js → zeni-epic-state-x9uZgubN.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +6 -9
- package/dist/assets/AddressRoutes-C8XYQ13t.js +0 -1
- package/dist/assets/AddressScreen-DCby60TJ.js +0 -9
- package/dist/assets/AiCfoScreen-BV-DOocp.js +0 -22
- package/dist/assets/CardsAiCfoScreen-C6GxFeya.js +0 -14
- package/dist/assets/CompanyPassportScreen-CF1WCnT9.js +0 -1
- package/dist/assets/ConnectionAuthScreen-CBqhtWai.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DkQZlHKP.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-B4msejL-.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-CTMJQoQi.js +0 -18
- package/dist/assets/DrawerScreen-B34R7bdb.js +0 -1
- package/dist/assets/EntityDetailRoutes-D5iLxjcN.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Bem3Gc7u.js +0 -25
- package/dist/assets/FeaturePreviewScreen-O1rkkX9g.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Bzg62ZZu.js +0 -1
- package/dist/assets/MagicLinkRoutes-CSc1SUSL.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BVxqZuYQ.js +0 -12
- package/dist/assets/MobileAppDrawer-BoTcj0FT.js +0 -1
- package/dist/assets/NotFoundScreen-D7eT4TBn.js +0 -1
- package/dist/assets/OAuthConsentScreen-BzSEu8Ts.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BfaNIbxL.js +0 -1
- package/dist/assets/PeopleRoutes-B44-Upod.js +0 -22
- package/dist/assets/PerformanceRoutes-Bv8XOGTE.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-D_w-vyXX.js +0 -1
- package/dist/assets/RewardsRoutes-4lrT5UUo.js +0 -1
- package/dist/assets/ScreenRoutes-x2ZEU7XA.js +0 -2
- package/dist/assets/SettingsRoutes-CLQ49ROa.js +0 -57
- package/dist/assets/SignInScreen-CbCM_7kJ.js +0 -1
- package/dist/assets/SignOutScreen-CPqtbwhE.js +0 -9
- package/dist/assets/TaskListScreen-ChqMZGua.js +0 -9
- package/dist/assets/TaskRoutes-DqVkv1wh.js +0 -9
- package/dist/assets/TransactionDetailScreen-DTD0gbHD.js +0 -5
- package/dist/assets/TreasuryRoutes-BzPs578Q.js +0 -37
- package/dist/assets/WiseConfirmationScreen-DP0HNbpz.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-nptp5yY4.js +0 -9
- package/dist/assets/epic-Blr6eiMV.js +0 -2
- package/dist/assets/getLocaleForTenant-DIOFG6A5.js +0 -1
- package/dist/assets/index-Cx4f0JbF.css +0 -1
- package/dist/assets/liveblocks-DKL6viSK.js +0 -54
- package/dist/assets/routePaths-BQ28bs96.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DZXDQgDN.js +0 -1
- package/dist/assets/useCashManagementBanner-DM17aUQt.js +0 -1
- package/dist/assets/withTransactionSidePanel-CBujpiDq.js +0 -21
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-P0DntAgT.js";import ca from"./NotFoundScreen-DR4zbgK0.js";import{a,b as en}from"./sentry-CfbcqWq3.js";import{n as Le,S as ia}from"./mui-SSWNL1tt.js";import{u as Se,h as tn,g as tt,j as w,n as la,i as Bt,o as ra,p as Qe}from"./core-Ct1Na3r4.js";import{eZ as Oe,Ti as da,os as ve,f_ as ua,so as ma,Tj as We,fB as nt,Tk as Vt,ei as pa,fk as ha,Tl as Ot,Tm as Be,p8 as ga,Tn as Ca,pp as Sa,oJ as nn,gr as ue,gt as fa,To as Ia,p2 as an,pj as ka,Tp as on,oD as Ea,rW as Ta,fL as ye,Tq as _e,uu as sn,EQ as cn,Tr as ln,Ts as ba,ru as at,OD as _t,OF as ya,kJ as va,OG as Aa,kQ as Pa,c_ as wa,vK as ot,oP as rn,pt as ze,Tt as Ra,Nv as zt,Nu as Ue,Tu as Mt,l5 as xa,Tv as Da,Tw as Fa,Tx as Ua,Ty as Ba,oW as Va,pw as Ve,Tz as Oa,TA as _a,TB as za,pD as Ma,kU as La,kL as ja,TC as qa,kT as Lt,ON as $a,TD as Ga,TE as Na,rq as Ja,r2 as Ya,pu as Ce,r1 as He,TF as Ka,TG as Za,TH as Qa,mo as Wa,bo as Ha,mj as jt,m5 as Xa,TI as eo,gE as to,mg as no,xD as ao,TJ as oo,q2 as so,pZ as co,q1 as io,pO as lo,TK as ro,fO as dn,pc as uo,oS as mo,f$ as qt,py as po,TL as ho,TM as go,pv as un,TN as Co,TO as So,TP as fo,TQ as Io,TR as $t,rC as ko,qV as Eo,Nt as To,TS as bo,TT as yo,kS as vo,TU as Ao,Jw as Po,kR as wo,kG as Ro,fN as xo,qr as mn,qN as Do,ps as Gt,px as Fo,bE as Uo,md as Bo,ma as Vo,TV as Oo,pN as Nt,qJ as Jt,qH as _o,TW as zo,qw as Mo,qc as Lo,qK as jo,TX as qo,TY as $o,qg as Go,TZ as No,q7 as Jo,qf as Yo,qd as Ko,qQ as Zo}from"./zeni-epic-state-x9uZgubN.js";import{A as Me,d as K,f as J,r as ie,_ as pn,a0 as hn,cZ as Qo,z as je,c_ as Wo,c$ as Ho,d0 as Xo,au as Ae,d1 as es,d2 as Yt,aZ as Kt,B as gn,d3 as ts,ar as Xe,O as ns,a9 as as,d4 as os,a4 as ss,d5 as cs,Z as is,d6 as ls,d7 as rs,v as ds,e as us,aS as ms,d8 as ps,d9 as hs,be as gs,F as Cs,aV as Ss}from"./index-BBFNuY8-.js";import{u as Cn}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{f as Zt,a as fs,b as Is,g as ks,C as Es}from"./TransactionDetailScreen-BAzuDRZQ.js";import{w as Ts}from"./withTransactionSidePanel-u9hB8oy5.js";import{h as bs,v as ys}from"./routePaths-Dvh0MCMy.js";import{g as et}from"./accountMappingHelper-DF_wZmqr.js";import{D as vs}from"./DrawerScreen-CFq_1rdP.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";import"./decodeURIComponentSafe-Dl7JnLtd.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="f5f727af-ec2e-4196-8807-e7a058572001",t._sentryDebugIdIdentifier="sentry-dbid-f5f727af-ec2e-4196-8807-e7a058572001")}catch{}})();const As=()=>{const t=Se(),s=tn(),A=tt(),E=w((u=>Oe(u))),{useFeatureGate:b}=Me(),{isFeatureEnabled:i}=b(K.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:m}=b(K.aiAuditScorePercentage),f=w((u=>u.expenseAutomationViewState.selectedPeriodByTenantId)),c=w((u=>da(u,E.tenantId))),{isAiCfoAccessEnabled:C,onAskAiCfoClick:h}=Cn({mobileExploreReferrer:"Month-End Close Overview"}),P=a.useCallback(((u,z,ae=!1)=>{t(ve({tenantId:z,period:{month:u.month,year:u.year},refreshViewInBackground:ae}))}),[]),v=a.useCallback((u=>{const z=A.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(u.month,u.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,z??null),t(ua(E.tenantId,u))}),[E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),r=f[E.tenantId],p=a.useCallback((()=>{const u=A.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(r.month,r.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,u??null),P(r,E.tenantId,!0)}),[P,r,E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),B=ie(A.state?.pathnameStackToGoBack,A.pathname),R=a.useCallback((()=>{if(c.monthEndCloseChecks!=null&&r!=null){const u=c.monthEndCloseChecks.monthEndCloseCheckList.find((z=>z.progress<100));if(u!=null)return void s(`./${u.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}});s(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}})}}),[c.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=pn();return hn({isDataReady:c.fetchState==="Completed"}),a.useEffect((()=>{r!=null&&c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&I&&P(r,E.tenantId)}),[P,r,c.fetchState,E.tenantId,I]),a.useEffect((()=>{r!=null&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(ma(r))}),[r,c.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect((()=>{const u=setInterval((()=>{c.fetchState!=="In-Progress"&&c.fetchState==="Completed"&&p()}),3e5);return()=>clearInterval(u)}),[c.fetchState]),a.useEffect((()=>{if(c.fetchState==="Completed"&&c.monthEndCloseChecks?.auditSummary!=null){const u=A.state?.referrer;J.trackMonthCloseAuditPage(c.selectedPeriod.month,c.selectedPeriod.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,u??null)}}),[c.fetchState,c.selectedPeriod,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Ps,{children:S.jsx(Qo,{monthEndCloseChecksView:c,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:u=>{s(`./${u}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:R,onBackClick:()=>{s("../../dashboard")},onReload:p,isAiCfoAccessEnabled:C,onAskAiCfoClick:h,aiAuditScorePercentageEnabled:m})})},Ps=Le.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
+
`,ws=en.memo((({reconciliation:t,selectedDrawerAccountId:s,onClose:A,onFetchLinkTokenClick:E,onEstablishConnectionClick:b})=>{const i=Se(),{useFeatureGate:m}=Me(),{isFeatureEnabled:f}=m(K.isReconV3Enabled),c=je.getSignedInUser(),C=w((k=>Oe(k))),h=t.excludedAccountIDs,P=a.useMemo((()=>({userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:C?.tenantId??""})),[c?.userId,c?.zeniSessionId,C?.tenantId]),{accountReconciliationsByAccountID:v,monthYearPeriod:r,statementUploadChosen:p}=t,B=v[s],R=a.useRef(!1),I=a.useCallback((k=>{R.current=k,Yt(s,k)}),[s]),u=a.useCallback((k=>{i(We({accountId:s,selectedPeriod:r,dismissedToBackground:!0,backgroundCompletedSteps:k.completedSteps,startedAtMs:k.startedAtMs,totalDurationSeconds:k.totalDurationSeconds})),B!=null&&requestAnimationFrame((()=>{R.current||i(nt({messageSection:"statement_parsing_in_progress",messageText:"success",type:"info",showStatusIcon:!0,variables:[{variableName:"_account_name_",variableValue:Wo(B)}]}))}))}),[i,r,B,s]),z=a.useCallback((()=>{i(We({accountId:s,selectedPeriod:r,dismissedToBackground:!1}))}),[i,s,r]),ae=a.useCallback((k=>{i(Vt({accountId:s,selectedPeriod:r,backgroundCompletedSteps:k}))}),[i,r,s]),j=a.useCallback((()=>{i(Vt({accountId:s,selectedPeriod:r,backgroundCompletedSteps:0})),i(We({accountId:s,selectedPeriod:r,dismissedToBackground:!1}))}),[i,r,s]);a.useEffect((()=>()=>{Yt(null,!1)}),[]);const V=B?.parsedStatementData?.statementUpload?.statementMeta?.statementUploadId??B?.accountReconEntity.statementMetaData?.statementUploadId,e=B?.statementDateConflict?.previousReconciliationInfo?.reconciledByUserId,n=w((k=>e!=null&&e!==""?pa(ha(k.userState,e)):"")),l=a.useCallback((()=>{i(Ot({accountId:s,selectedPeriod:r}))}),[i,s,r]),d=a.useCallback((()=>{i(Ot({accountId:s,selectedPeriod:r})),i(Be({statementUploadChosen:!0}))}),[i,s,r]),T=(k,pe)=>{i(Ta(k,pe.split(".")[0]))},g=k=>{V!=null&&i(Ea({accountId:s,selectedPeriod:r,fileId:k,statementUploadId:V}))},y=()=>{i(Be({statementUploadChosen:!1}))},x=k=>{i(ka({accountId:s,selectedPeriod:r,payload:k}))},D=a.useCallback(((k,pe,qe)=>{i(ga({accountId:k,selectedPeriod:pe,statementUploadId:qe}))}),[i]),F=a.useCallback((k=>{i(Ca({accountId:s,selectedPeriod:r,statementUpdateLocalData:k}))}),[i,s,r]),L=a.useCallback((()=>{V!=null&&i(Sa({accountId:s,selectedPeriod:r,statementUploadId:V}))}),[i,s,r,V]),ee=a.useCallback((()=>{i(Be({statementUploadChosen:!0}))}),[i]),H=k=>{i(on({accountId:s,selectedPeriod:r,localData:{accountSource:k}}))},me=a.useCallback((()=>{i(nn({accountId:s}))}),[i,s]),fe=a.useCallback((k=>{i(ue(r,k)),A()}),[i,r,A]),G=a.useCallback((()=>{i(fa({accountId:s,selectedPeriod:r,statementProcessingFailed:!1})),i(Ia({accountId:s,selectedPeriod:r}))}),[i,s,r]),Pe=a.useCallback((()=>{i(an({accountId:s}))}),[i,s]),le=h.includes(s)?t.excludedAccountReconciliationByAccountID[s]:void 0;if(le!=null)return S.jsx(Qt,{children:S.jsx(Wt,{$isV3:f===!0,children:S.jsx(Ho,{excludedAccountReconciliation:le,includeAccountFetch:t.includeAccountFetchState,isReconV3Enabled:f,onDismissClick:A,onIncludeIntoReconciliation:Pe})})});if(B!=null){const k=f===!0?S.jsx(Xo,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:r,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:E,onEstablishConnectionClick:b,onEditFileName:T,onDeleteFile:g,onSelectSourceType:H,filesEndPoint:Ae.fileMicroServiceBaseUrl,authParams:P,openFilePicker:p,onStatementUploadSuccess:x,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:me,onRetryParsing:D,onReviewClicked:fe,statementProcessingFailed:B.statementProcessingFailed,statementProcessingDismissedToBackground:B.statementProcessingDismissedToBackground,onDismissStatementProcessingFailed:G,onContinueInBackground:u,onClearStatementProcessingDismissedToBackground:z,onResetStatementProcessingProgress:j,onStatementProcessingProgressChange:ae,onStatementFlowVisibilityChange:I,onReuploadStatement:ee,onStatementFormDataChange:F,onStatementConfirmSave:L,reconciledByName:n,onDismissDateConflict:l,onReuploadAfterDateConflict:d,isReconV3Enabled:f}):S.jsx(es,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:r,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:E,onEstablishConnectionClick:b,onEditFileName:T,onDeleteFile:g,onSelectSourceType:H,filesEndPoint:Ae.fileMicroServiceBaseUrl,authParams:P,openFilePicker:p,onStatementUploadSuccess:x,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:me});return S.jsx(Qt,{children:S.jsx(Wt,{$isV3:f===!0,children:k})})}return null})),Qt=Le.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
height: 100%;
|
|
12
|
+
`,Wt=Le.div`
|
|
13
|
+
flex: 1;
|
|
14
|
+
min-height: 0;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
overflow-x: hidden;
|
|
20
|
+
overflow-y: ${t=>t.$isV3===!0?"hidden":"auto"};
|
|
21
|
+
`;function Rs({companyId:t,closeCustomerRequestDrawer:s,addCustomerRequest:A,resetCustomerRequest:E}){const b=je.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const i=w((m=>ba(m,t,b)));return a.useEffect((()=>{E()}),[]),S.jsx(S.Fragment,{children:i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?S.jsx(gn,{fetchState:"In-Progress"}):S.jsx(ts,{onCloseClick:s,addCustomerRequest:A,snippets:i.companyMonthEndReportTemplatesData,bulletPoints:i.zeniRequestsData??[]})})}const xs=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Ds,comma:Ht,space:Fs}},dateFormat:Sn}=ns.getLocalizedStrings(),Xt=Zo,Us=la((function(t,s){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:E,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:i,companyId:m,isMissingReceiptsBulkUploadEnabled:f,isTransactionActivityEnabled:c}=s,C=je.getSignedInUser(),h=t.tenantState.currentTenantId,P={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:h??""},v=ye(t),{selectedTransactionCategorizationTab:r}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:f===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:E,authParams:P,receiptUploadEndpoint:`${Ae.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ss}/transaction_attachments`,bulkUploadEndpoint:f===!0?`${Ae.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:r,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:i,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:C,uncategorizedAccounts:A,companyId:m,isTransactionActivityEnabled:c}}),(function(t,s){const{themeState:A,isAccountingClassesEnabled:E,isCOTEnabled:b,isUncategorizedExpenseCategoryEnabled:i,isMissingReceiptsBulkUploadEnabled:m,location:f,vendorSearchAutoCompleteData:c,expenseAutomationViewSelector:C,currentTenant:h,uncategorizedAccounts:P,navigate:v,onClickCustomerRequest:r,handleEditClick:p,setActivityLogTransactionId:B}=s,{selectedPeriod:R,currentSelectedView:I,reconciliation:{selectedAccountId:u}}=C,{accountSettingsView:z}=C.jeSchedules,ae=rn(R),j=ze(ae.start),V=ze(ae.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{J.trackMissingReceiptAttached(R.month,R.year),t(Eo(e))},onUploadTransactionReceipt:(e,n,l,d,T,g)=>{t($t(e,n,{fetchState:"In-Progress"}));const y=()=>t($t(e,n,{fetchState:"Error"}));cs(`${Ae.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,l,d,T).then((x=>{x!=null?t(ko(e,x)):y()})).catch(y)},onMissingReceiptsRowClick:(e,n)=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,n);const l=ie(f.state?.pathnameStackToGoBack,f.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Io(e,n)),h!=null&&t(ve({tenantId:h.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,l,d)=>{t(fo(e,{fetchState:n,error:l})),l!=null&&t(nt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:d!=null?Fs+Ds+d+Ht:Ht}]}))},onUpdateJESchedulesUIState:e=>{t(So(e))},onUpdateMissingReceiptsUIState:e=>{t(Co(e))},onFetchMissingReceiptsList:()=>{V!=null&&j!=null&&t(un({start:j,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...m===!0?{onBulkUploadFiles:e=>{t(Ko(e))},onBulkUploadProgress:e=>{t(Yo(e))},onBulkUploadSuccess:e=>{t(Jo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(No(e))},onConfirmBulkUploadMatch:(e,n,l,d,T)=>{t(Go(e,n,l,d,T))},onBulkUploadConfirmMatchAcknowledged:()=>{t($o())},onSetBulkUploadResultsTab:e=>{t(qo(e))},onSetBulkUploadCompletedSubTab:e=>{t(jo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Jt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Lo())},onSearchTransactionsForManualMatch:(e,n)=>{t(Xt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=C.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Xt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Mo(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(zo())},onFetchBulkUploadBatches:e=>{t(mn(e))},onFetchMoreBatchDetails:()=>{t(_o())},onResetBulkUploadSort:()=>{t(Jt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(go())},onSearchTextChanged:e=>{const n=C.currentSelectedView,l=C.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(He({selectedTab:l,uiState:{searchString:e}})),V!=null&&j!=null&&t(Ce(l,{start:j,end:V},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=C.selectedTransactionCategorizationTab;t(ho({filters:e,selectedTab:n}))},onRefresh:()=>{s.trackExpenseAutomationTabAnalytics(!0),t(po(i))},onClose:()=>{I==="reconciliation"&&u!=null&&t(qt({selectedAccountId:void 0})),v("../")},onBack:()=>{I==="reconciliation"&&u!=null&&t(qt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(mo(e))},onSaveReconciliationReview:e=>{t(uo(e))},onUpdateStep:e=>{const{selectedPeriod:n}=C,l=ie(f.state?.pathnameStackToGoBack,f.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:l,referrer:C.currentSelectedView}}),t(dn(e))},handleLogOutClick:()=>{const e=ie(f.state?.pathnameStackToGoBack,f.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:l,fixedAssetsAccount:d,accruedExpensesAccount:T}=n,g=et(z.prepaidExpensesAccountList,l.selectedOptions),y=et(z.fixedAssetsAccountList,d.selectedOptions),x=et(z.accruedExpensesAccountList,T.selectedOptions),D={selectedPrepaidExpensesAccountIds:g.map((F=>F.accountId)),selectedFixedAssetsAccountIds:y.map((F=>F.accountId)),selectedAccruedExpensesAccountIds:x.map((F=>F.accountId))};t(ro({data:D}))},onSaveJeAccountSettingsClick:()=>{t(lo())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:l,accumulatedDepreciationCategory:d,scheduleClass:T,scheduleExpenseCategory:g,vendor:y}=n,{allAccountList:x,allClassList:D,allDepreciationAccountList:F}=C.jeSchedules,L=c.entityAutoCompleteView.vendor.length>0?c.entityAutoCompleteView.vendor.find((G=>G.id===y?.selectedOption)):void 0,ee={id:L?.zeniId??y?.selectedOption??"",name:L?.name??y?.defaultOptions.find((G=>G.value===y?.selectedOption))?.label??"",logo:L?.logo},H=g?.selectedOption!=null?x.find((G=>G.qboId===g.selectedOption)):void 0,me=T?.selectedOption!=null?D.find((G=>G.classId===T.selectedOption)):void 0,fe=d?.selectedOption!=null?F.find((G=>G.qboId===d.selectedOption)):void 0;t(io({scheduledJournalEntryID:e,localData:{jeScheduleID:l,scheduledJournalEntryID:e,updatedCategoryId:H?.accountId,updatedClassId:me?.classId,updatedAccumulatedDepreciationCategoryID:fe?.accountId,updatedVendor:{id:ee.id,name:ee.name}}}))},ignoreRecommendedJeSchedule(e,n){t(co(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(zt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Ue("common"))},onCancelAutoComplete:()=>{t(Ue("common"))}},onPostJESchedule(e,n){t(so({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(oo())},handleJeScheduleClick:(e,n,l)=>{t(ao({selectedJEScheduleKey:n}));const d=ie(f.state?.pathnameStackToGoBack,f.pathname);v(`../../vendors/schedules/${l}/details/${e}`,{state:{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{h!=null&&t(no(e,h.companyId,h.tenantId))},onClickCustomerRequest:r,setActivityLogTransactionId:B,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(to())},onOpenFileAttachmentSnackBar:()=>{t(nt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(eo(e))},onUpdateFileAttachment:e=>{t(Xa({files:e}))},previewMonthEndReport:(e,n,l,d)=>{h!=null&&t(jt(e,h.companyId,n,!0,l,d,h.tenantId))},saveMonthEndReport:(e,n,l,d)=>{h!=null&&t(jt(e,h.companyId,n,!1,l,d,h.tenantId))},onEditMonthEndInsightsClick:p,sendMonthEndReport:e=>{const n=f.state?.referrer,{selectedPeriod:l,auditSummary:d}=C;h!=null&&d?.auditScorePercentage!=null&&(t(Wa(h.companyId,e,h.tenantId)),J.trackInsightsEmailPage(l.month,l.year,!1,"draft",d.auditScorePercentage,Ha().format(Sn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,n);const l=ie(f.state?.pathnameStackToGoBack,f.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,l,d,T,g,y,x,D,F,L,ee,H)=>{t(Qa(e,n,l,d,P,T,g,y,x,D,F,L,ee,H))},onCancelAutoComplete:()=>{t(Ue("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Mt({scrollPosition:e}))},onUpdateTab:e=>{s.closeSidePanel?.(),V!=null&&j!=null&&(t(Ce(e,{start:j,end:V},!1,!1)),t(Za(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{s.closeSidePanel?.(),V!=null&&j!=null&&(t(Ka(e)),t(Ce("autoCategorized",{start:j,end:V},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(He({selectedTab:e,uiState:n})),V!=null&&j!=null&&t(Ce(e,{start:j,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(He({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,l,d,T,g,y)=>{V!=null&&j!=null&&t(Ce(e,{start:j,end:V},!0,l,n,d,T,g,y))},resetTransactionCategorizationLocalData:(e,n,l,d,T,g,y,x)=>{t(Ya(e,n,l,d,x??null,T,g,!1,y))},updateSelectedVendorForTransaction:(e,n,l,d,T)=>{t(Lt({selectedTab:e,transactionId:n,lineId:l,selectedTransaction:d,uncategorizedAccounts:P,updatedVendor:T,isAccountingClassesEnabled:E}))},onSaveUpdateTransactionCategorization:(e,n,l)=>{const d=f.state?.referrer;e==="autoCategorized"?J.trackTransactionsAutoCategorisedPage(R.month,R.year,C.transactionView.totalCountByTab.autoCategorized,n.length,!1,d??null):J.trackTransactionsReviewPage(R.month,R.year,C.transactionView.totalCountByTab.review,n.length,!1,d??null),t(Ja(e,n,l,i))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Na({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,l,d,T,g,y)=>{const{transactionId:x,transaction:D,lineIds:F}=n;g!=null&&t($a({transactionId:x,customerUpdates:g})),t(Ga({selectedTab:d,transactionId:x.id,lineId:F[0],selectedTransaction:D,uncategorizedAccounts:P,updatedCustomer:g,selectedEntity:T,isAccountingClassesEnabled:E,isUncategorizedExpenseCategoryEnabled:y})),T!=null&&t(ot({entity:T,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:d,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:y}))},onFetchRecommendationsForEntityCategorization:(e,n,l,d,T,g,y)=>{const{transactionId:x,transaction:D,lineIds:F}=n;g!=null&&(t(La({transactionId:x,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(ja({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Lt({selectedTab:d,transactionId:x.id,lineId:F[0],selectedTransaction:D,uncategorizedAccounts:P,updatedVendor:g,selectedEntity:T,isAccountingClassesEnabled:E,isUncategorizedExpenseCategoryEnabled:y})),T!=null&&t(ot({entity:T,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:d,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:y}))):t(qa({selectedTab:d,transactionId:x.id,lineId:F[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ve(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ve(R,!0,!1,null,!1,!1))},markAsReview:(e,n,l,d)=>{J.trackFluxAnalysisReviewed(l.month,l.year,d??!1,e),t(Ma(n,e,l,d??!1))},onUpdateFluxAnalysisUIState:e=>{t(za(e))},updateOperatingExpensesIdsForReview:e=>{t(_a({operatingExpenseIds:e,selectedPeriod:R}))},redirectToVendorDetailPage:e=>{if(s.tenantEmailDomain!=null){const n=ys(e.id,e.qboId,s.tenantEmailDomain),l=ie(s.location.state?.pathnameStackToGoBack,s.location.pathname);s.navigate(n,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Oa({sectionId:e,selectedPeriod:R}))},onFetchReimbursementView:(e,n,l)=>{t(Ve(e,!0,!1,n,!0,l))},onReviewClicked:e=>{t(ue(R,e))},setOpenDrawerClicked:e=>{t(_e({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(sn("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const l=h?.companyId;l!=null&&(t(cn(e,l,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(ln({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(_e({selectedDrawerAccountId:e})),t(on({accountId:e,selectedPeriod:R,localData:{accountSource:"bank_statement"}})),t(Be({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ue(R,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Va({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Ba({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ua({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{s.closeSidePanel?.(),t(Fa({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,l)=>{const d=e.vendor?.id;l&&d!=null&&t(xa(d)),t(Da({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,at("bill"));const n=ie(f.state?.pathnameStackToGoBack,f.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(zt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ue("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ra({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(nn({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(an({accountId:e}))}}}),((t,s,A)=>{const{isMissingReceiptsBulkUploadEnabled:E,...b}=A;return(function(i,m,f){return{...i,...m,...f,onUploadTransactionReceipt:(c,C,h,P,v)=>{m.onUploadTransactionReceipt(c,C,h,P,v,i.authParams)}}})(t,s,b)}))(as(os)),Bs=Ts((function(t){const s=t.displayName??t.name??"Component",A=en.memo(t),E=b=>{const i=Se(),m=(function(){const I=Se(),u=w((z=>ye(z).reconciliation.selectedDrawerAccountId));return{isOpen:u!=null,selectedAccountId:u,openPanel:a.useCallback((z=>{I(_e({selectedDrawerAccountId:z}))}),[I]),closePanel:a.useCallback((()=>{I(_e({selectedDrawerAccountId:void 0}))}),[I])}})(),f=w((I=>ye(I).reconciliation)),c=w((I=>Oe(I))),C=a.useCallback(((I,u)=>{i(sn("expense_automation_reconcile",I,u))}),[i]),h=a.useCallback(((I,u)=>{const z=c?.companyId;z!=null&&(i(cn(I,z,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",u)),i(ln({accountId:u,connectionInProgress:!0})))}),[i,c?.companyId]),P=a.useMemo((()=>{if(m.isOpen&&m.selectedAccountId!=null)return S.jsx(ws,{reconciliation:f,selectedDrawerAccountId:m.selectedAccountId,onClose:m.closePanel,onFetchLinkTokenClick:C,onEstablishConnectionClick:h})}),[m.isOpen,m.selectedAccountId,m.closePanel,f,C,h]),v=a.useMemo((()=>({reconPanelContent:P,reconSidePanelIsOpen:m.isOpen,closeReconSidePanel:m.closePanel})),[P,m.isOpen,m.closePanel]),{useFeatureGate:r}=Me(),{isFeatureEnabled:p}=r(K.isReconV3Enabled),B=a.useContext(Kt),R=a.useMemo((()=>m.isOpen?p===!0?{selectedItemId:m.selectedAccountId}:{closePanel:m.closePanel,selectedItemId:m.selectedAccountId}:B),[m.isOpen,m.closePanel,m.selectedAccountId,B,p]);return S.jsx(Kt.Provider,{value:R,children:S.jsx(A,{...b,...v})})};return E.displayName=`withReconSidePanel(${s})`,E})((({closeSidePanel:t,openTransactionPanel:s,panelContent:A,sidePanelIsFullView:E,sidePanelIsOpen:b,reconPanelContent:i,reconSidePanelIsOpen:m,closeReconSidePanel:f})=>{const{isAiCfoOpen:c,setIsAiCfoOpen:C}=is(),h=ls(),{isOpen:P}=rs(),v=tn(),r=tt(),p=Se(),{isAiCfoAccessEnabled:B,onAskAiCfoClick:R}=Cn({mobileExploreReferrer:"Transaction categorization"}),I=a.useCallback((()=>{b===!0&&E!==!0&&t?.()}),[t,b,E]),{areTenantIdsInSync:u}=pn(),z=(()=>{const o=w((Y=>ye(Y))),_=tt(),{currentSelectedViewFetchState:N,currentSelectedView:$,selectedPeriod:U}=o,te=Xe($),Q=Xe(N.fetchState),X=a.useCallback((Y=>{const ne=_.state?.referrer;$==="transaction_categorization"&&(o.selectedTransactionCategorizationTab==="review"?J.trackTransactionsReviewPage(U.month,U.year,o.transactionView.totalCountByTab.review,0,Y,ne??null):J.trackTransactionsAutoCategorisedPage(U.month,U.year,o.transactionView.totalCountByTab.autoCategorized,0,Y,ne??null)),$==="missing_receipts"&&J.trackMissingReceiptsPage(U.month,U.year,Y,o.missingReceipts.transactions.length,ne??null),$==="je_schedules"&&J.trackMonthCloseScheduleListPage(U.month,U.year,Y,o.jeSchedules.draftSchedules.length,o.jeSchedules.resolveSchedules.length,ne??null),$==="flux_analysis"&&J.trackFluxAnalysisPage(U.month,U.year,Y,xs(o.fluxAnalysis),ne??null),$==="month_end_insights"&&o.auditSummary?.auditScorePercentage!=null&&J.trackInsightsEmailPage(U.month,U.year,Y,"draft",o.auditSummary.auditScorePercentage,null,ne??null)}),[U,o]);return a.useEffect((()=>{Q===N.fetchState&&$===te||N.fetchState!=="Completed"||X(!1)}),[$,N.fetchState,te]),X})(),ae=ds(),[j,V]=a.useState(!1),e=w((o=>_t(o))),n=w((o=>Oe(o))),[l,d]=a.useState(!1),[T,g]=a.useState(!1),[y,x]=a.useState([]),[D,F]=a.useState(null),L=a.useCallback((()=>{F(null)}),[]),ee=D?.contentType==="activity"?D.detail.transactionId:void 0,H=a.useCallback((o=>{o!=null?(c&&C(!1),h(),I(),F({contentType:"activity",detail:{transactionId:o}})):F((_=>_?.contentType==="activity"?null:_))}),[I,c,h,C]),me=a.useCallback((o=>{c&&C(!1),h(),I(),F({contentType:"transfer",detail:o})}),[I,c,h,C]),fe=a.useCallback((()=>{h(),L(),I(),R()}),[I,L,R,h]),G=a.useRef(c);a.useEffect((()=>{c===!0&&G.current===!1&&(h(),L(),I()),G.current=c}),[I,L,c,h]);const Pe=a.useRef(P);a.useEffect((()=>{P===!0&&Pe.current===!1&&(c&&C(!1),L(),b===!0&&E!==!0&&t?.()),Pe.current=P}),[L,t,P,c,C,E,b]);const le=b===!0&&E!==!0,k=a.useRef(le);a.useEffect((()=>{le&&!k.current&&(c&&C(!1),h(),L()),k.current=le}),[L,c,le,h,C]);const[pe,qe]=a.useState(!1),st=a.useRef(!1),{selectedTab:ct}=Bt(),{tenantEmailDomain:fn}=Bt(),[$e,it]=a.useState(r.state?.message==="comingFromTransactionDetail"),lt=r.state?.message==="comingFromOverview",In=us(),Ge=je.getSignedInUser(),{useDynamicConfig:kn,useFeatureGate:oe}=Me(),{configValue:En}=kn(ms.enableUncategorizedExpenseCategory),se=En?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:rt}=oe(K.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:Ie}=oe(K.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Ne}=oe(K.isTransactionActivityEnabled),{isFeatureEnabled:dt}=oe(K.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:Tn}=oe(K.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:bn}=oe(K.isProjectsTransactionsEnabled),{isFeatureEnabled:yn}=oe(K.isReconV3Enabled),{isFeatureEnabled:vn}=oe(K.isJEScheduleCOTEnabled),An=a.useCallback((o=>{const _=at(o.view==="reconciliation"?"bill":"expense");s?.(o.entityId,_)}),[s]),Pn=w((o=>To(o,"common"))),q=w((o=>ye(o))),{categoryOptions:wn,paymentAccountNames:Rn}=w((o=>bo(o.accountState))),xn=w((o=>yo(o.classState))),{monthEndCloseChecksView:Z,currentSelectedView:O,selectedPeriod:M,selectedTransactionCategorizationTab:Je,currentSelectedViewBackgroundRefreshFetchState:Dn,currentSelectedViewFetchState:he,jeSchedules:Ye,reconciliation:ut}=q;fs(O==="transaction_categorization");const Fn=q.transactionView.saveStatus.fetchState,mt=q.transactionView.transactions,pt=a.useRef(mt);pt.current=mt;const ht=w((o=>o.expenseAutomationTransactionsViewState?.transactionCategorizationView)),gt=w((o=>o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),Ct=a.useRef(ht);Ct.current=ht;const St=a.useRef(gt);St.current=gt;const ce=Is(Fn,(()=>{const o=[],_=St.current,N=Ct.current,$=N!=null&&_!=null?N[_]:void 0;if($?.transactionReviewLocalDataById!=null)for(const te of Object.values($.transactionReviewLocalDataById)){const Q=te?.transactionReviewLocalData?.lineItemById;if(Q!=null)for(const X of Object.values(Q)){const Y=X?.account;Y?.accountId!=null&&o.push(Y.accountId)}}const U=pt.current;for(const te of U)for(const Q of te.lines??[])"account"in Q&&Q.account?.accountId!=null&&o.push(Q.account.accountId);return o}));a.useEffect((()=>{O==="transaction_categorization"&&b!==!0||H(void 0)}),[O,H,b]),a.useEffect((()=>{m===!0&&f?.()}),[O,ut.selectedAccountId]);const Un=q.transactionView.selectedTransactionCategorizationCompletedSubTab,we=`${Je}|${Un}`,Re=a.useRef(null);a.useEffect((()=>{Re.current!==null?Re.current!==we&&(Re.current=we,O==="transaction_categorization"&&L()):Re.current=we}),[L,O,we]);const Bn=w((o=>ee==null?void 0:vo(o.transactionState,ee))),re=Bn?.qboId,ft=w((o=>re==null?void 0:Ao(o,re)));a.useEffect((()=>{re!=null&&p(Po(re))}),[p,re]);const{createTransferEntryStatus:It,creditCardTransferAccountsList:kt,transferAccounts:Et}=q.transactionView,Tt=a.useCallback((o=>ks(p,o)),[p]),bt=a.useMemo((()=>O!=="transaction_categorization"||D==null?null:D.contentType==="activity"?Ne===!0?S.jsx(ps,{activityLogView:ft,qboId:re,onClose:()=>F(null),selectedTransactionId:D.detail.transactionId,isQuickViewCardStyle:!0},String(D.detail.transactionId)):null:D.contentType==="transfer"?S.jsx(hs,{createTransferEntryStatus:It,transaction:D.detail,transferAccounts:D.detail.transactionType==="credit_card_payment"?kt:Et,onClose:()=>F(null),onCreateTransfer:Tt,isQuickViewCardStyle:!0},String(D.detail.transactionId)):null),[O,D,Ne,ft,re,It,kt,Et,Tt]),Vn=bt!=null,{selectedAccountId:ke}=ut,yt=Xe(Ye.accountSettingsView.saveState.fetchState),On=w((o=>wo(o.accountState,o.accountListState,"accountList"))),_n=w((o=>Ro(o))),Ee=ct!=null?xo(ct):O,zn=w((o=>o.entityAutoCompleteState.autoCompleteText.common));if(hn({isDataReady:he.fetchState==="Completed"}),Ge==null)throw Error("Can't access expense automation screen without signing in...");const vt=rn(M),Te=ze(vt.start),be=ze(vt.end);if(Te==null||be==null)throw Error(`Invalid start - ${Te} and end - ${be} period from given ${M}`);const Mn=a.useCallback((()=>{d(!1)}),[]),Ln=a.useCallback((()=>{g(!0)}),[]),jn=a.useCallback((o=>{x(o),g(!1)}),[]),qn=a.useCallback((()=>{x([])}),[]),xe=q.missingReceipts.bulkUpload.phase,At=q.missingReceipts.bulkUpload.currentBatchId;a.useEffect((()=>{Ie===!0&&O==="missing_receipts"&&xe==="matching"&&At!=null&&p(mn({cacheOverride:!0}))}),[Ie,O,xe,At,p]);const Pt=Ge?.userId,$n=M.month,Gn=M.year,wt=n?.tenantId;a.useEffect((()=>{O==="missing_receipts"&&Ie!==!1&&xe==="idle"&&Pt!=null&&wt!=null&&p(Do())}),[O,Ie,xe,Pt,wt,$n,Gn,p]),a.useEffect((()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?V(!0):V(!1)}),[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect((()=>{Ee!=null&&O!==Ee&&p(dn(Ee))}),[Ee]),a.useEffect((()=>{pe===!1&&he.fetchState==="Completed"&&u&&(qe(!0),p(Gt(!1,!1,se)))}),[pe,he,u,se]),a.useEffect((()=>{!lt&&u&&(p(Gt(!1,!1,se)),p(ue(M,ke,!1,!1)))}),[M.month,M.year,u,se]);const Rt=a.useCallback(((o=!1,_=!1)=>{const N={start:Te,end:be};switch(O){case"transaction_categorization":p(Ce(Je,N,o,!$e,void 0,void 0,_,void 0,se)),it(!1);break;case"flux_analysis":p(Ve(M,o,_,null));break;case"month_end_insights":if(_===!1){const $=new Date(M.year,M.month,0),U=Uo($.toDateString()).format(Sn.analytics.YYYYDashMMDashDDFormat);p(Bo(!0,n.companyId,n.tenantId,U)),p(Vo(n.companyId,n.tenantId))}break;case"je_schedules":p(Fo(N,_));break;case"missing_receipts":p(un(N,{amount:75,currencyCode:"USD",currencySymbol:"$"},o,_));break;default:p(ue(M,ke,o,_))}}),[O,Te,be,n.companyId,n.tenantId,Je,M,ke,$e,it,se]);a.useEffect((()=>{O===Ee&&he.fetchState==="Not-Started"&&u&&Rt(!0)}),[he,Te,be,n.companyId,n.tenantId,u]),a.useEffect((()=>{lt||$e||st.current||Dn.fetchState==="In-Progress"||he.fetchState!=="Completed"||(st.current=!0,Rt(!0,!0))}),[]),a.useEffect((()=>{Z.fetchState!=="In-Progress"&&Z.fetchState!=="Completed"&&Z.fetchState!=="Error"&&n?.tenantId!=null&&p(ve({tenantId:n.tenantId,period:M,refreshViewInBackground:!1}))}),[Z.fetchState,n?.tenantId]),a.useEffect((()=>{q.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?d(!0):d(!1)}),[q.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect((()=>{q.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&u&&(p(ve({tenantId:n.tenantId,period:M,refreshViewInBackground:!0})),p(Oo({companyId:n.companyId})),v("../"))}),[q.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,M,n.companyId,u]),a.useEffect((()=>{const o=setInterval((()=>{Z.fetchState!=="In-Progress"&&Z.fetchState==="Completed"&&p(ve({tenantId:n.tenantId,period:M,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(o)}),[Z.fetchState,n.tenantId,M,p]),a.useEffect((()=>{const o=setInterval((()=>{O==="reconciliation"&&ke==null&&q.reconciliation.fetchStatus.fetchState==="Completed"&&q.reconciliation.refreshStatus.fetchState!=="In-Progress"&&p(ue(M,void 0,!0,!0))}),3e5);return()=>clearInterval(o)}),[O,p,q.reconciliation.fetchStatus.fetchState,q.reconciliation.refreshStatus.fetchState,ue,ke,M]);const Nn=Zt();a.useEffect((()=>{const o=(Z.monthEndCloseChecks?.monthEndCloseCheckList.find((_=>_.id==="month_end_insights"))?.isDisabled??!1)&&!rt;O!=="month_end_insights"||!o&&Z.monthEndCloseChecks?.reportEmailSentDate==null||v("../")}),[O,Z.monthEndCloseChecks]);const Jn=m===!0?i:A,Yn=m===!0||b===!0,Kn=m===!0?f:t;a.useEffect((()=>{yt==="In-Progress"&&Ye.accountSettingsView.saveState.fetchState==="Completed"&&p(Nt())}),[yt,Ye.accountSettingsView.saveState.fetchState,Nt]);const{transactionId:xt,onSaveVendor:Zn,onSaveSuccess:Qn,onCancel:Wn,vendorViewDetails:Hn}=(({expenseAutomationViewSelector:o,closeDrawerHandler:_,currentSelectedView:N,isUncategorizedExpenseCategoryEnabled:$})=>{const U=Se();let te,Q,X;const Y=Zt(),ne=o.transactionView;let Dt=()=>{};const{transactions:Xn,selectedTransactionId:ge,selectedTransactionLineId:De,transactionLocalData:ea}=ne;if(N==="transaction_categorization"){const Ke=ea.find((de=>de.transactionId===ge)),W=Xn.find((de=>de.id===ge)),Ft=De!=null?Ke?.transactionReviewLocalData?.lineItemById[De]:void 0,Ut=Ft?.account;Q=Ft?.class?.classId,te=["Uncategorized Income","Uncategorized Expense"].includes(Ut?.accountName??"")?void 0:Ut?.accountId;const na=bs(ge,W?.typeOfTransaction);W!=null&&na&&(X={id:ge,type:at(W.typeOfTransaction)}),Dt=()=>{if(ge!=null&&De!=null&&W!=null){const de=ne.transactionLocalData.find((Fe=>Fe.transactionId===ge))?.transactionReviewLocalData;if(de!=null&&W.lines!=null&&W.lines.length>0){const Fe=de.lineItemById[De];let Ze=de.selectedEntity;if(wa(W)||(Ze=Fe.selectedEntityLine),Ze!=null){const aa=Ze,oa={transactionId:{id:W.id,type:W.type},transaction:W,lineIds:W.lines.map((sa=>sa.id))??[]};U(ot({entity:aa,amount:Fe.amount.amount,transactionDetails:oa,flowType:"categorization",selectedTab:o.selectedTransactionCategorizationTab,isFetchCOT:Y,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const ta=w((Ke=>_t(Ke,void 0,te,Q)));return{transactionId:X,onSaveVendor:()=>{U(Pa(X,void 0,!1,!0))},onSaveSuccess:Dt,onCancel:()=>{X!=null&&U(ya({transactionId:X})),U(va()),U(Aa()),_()},vendorViewDetails:ta}})({expenseAutomationViewSelector:q,closeDrawerHandler:()=>{V(!1)},currentSelectedView:O,isUncategorizedExpenseCategoryEnabled:se});return In?.loggedInUserRoleMap==null?Z.fetchState==="Error"?S.jsx(gs,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):S.jsx(gn,{fetchState:"In-Progress"}):S.jsxs(S.Fragment,{children:[S.jsx(vs,{isOpen:T,drawerLeftMargin:new Cs(0,0,300,650),onClose:()=>{g(!1)},children:S.jsx(Vs,{onClick:o=>o.stopPropagation(),children:S.jsx(Rs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:jn,resetCustomerRequest:qn})})}),xt!=null&&j&&S.jsx(Es,{isOpen:j,transactionId:xt,onSaveVendor:Zn,onSaveSuccess:Qn,onCancel:Wn,vendorViewDetails:Hn}),S.jsx(Us,{events:[],eventCallback:(o,_,N)=>{},navigate:v,location:r,themeState:ae,categoryOptions:wn,classesForFilters:xn,accountsForFilters:Rn,vendorSearchAutoCompleteData:{autoCompleteText:zn,entityAutoCompleteView:Pn},expenseAutomationViewSelector:q,isMissingReceiptsBulkUploadEnabled:Ie,monthEndInsightsPreviewMode:l,monthEndInsightsCustomerRequestData:y,isRealtimeInsightsFeatureEnabled:rt,isCreateTransferEntryFromExpenseEnabled:dt,isUncategorizedExpenseCategoryEnabled:se,isAccountingClassesEnabled:_n,isProjectsTransactionsEnabled:bn,isCOTEnabled:Nn,isJEScheduleCOTEnabled:vn,currentTenant:n,companyId:n.companyId,signedInUser:Ge,isTransactionActivityEnabled:Ne,isRightPanelOpen:Vn,rightSidePanel:bt,onOpenTransferRightPanel:dt===!0?me:void 0,uncategorizedAccounts:On,onClickCustomerRequest:Ln,handleEditClick:Mn,tenantEmailDomain:fn,trackExpenseAutomationTabAnalytics:z,setActivityLogTransactionId:H,closeSidePanel:Kn,openTransactionPanel:s,sidePanelIsOpen:Yn,sidePanelIsFullView:m!==!0&&E,panelContent:Jn,isAiCfoAccessEnabled:B,onAskAiCfoClick:fe,isExpenseAutomationCommentingEnabled:Tn,isReconV3Enabled:yn,onExpenseAutomationCommentingThreadClick:An,sidePanelListPercent:m===!0?66:void 0}),ce.showPopup&&ce.popupType!=null&&S.jsx(Ss,{popupType:ce.popupType,currencySymbol:ce.currencySymbol,accountId:ce.popupAccountId??"",accountName:ce.popupAccountName??"",onSubmit:ce.handleSubmit,onDismiss:ce.handleDismiss})]})}))),Vs=Le(ia)`
|
|
22
|
+
display: flex;
|
|
23
|
+
min-height: 100%;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
`;function sc(){return S.jsxs(ra,{children:[S.jsx(Qe,{path:"*",element:S.jsx(As,{})}),S.jsx(Qe,{path:"/:selectedTab/:selectedPeriod/*",element:S.jsx(Bs,{})}),S.jsx(Qe,{path:"*",element:S.jsx(ca,{})})]})}export{sc as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-P0DntAgT.js";import{a as r}from"./sentry-CfbcqWq3.js";import{a5 as f,a6 as l,a7 as p,p as m}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import c from"./NotFoundScreen-DR4zbgK0.js";import{h as u,g as b}from"./core-Ct1Na3r4.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]="b50ef9de-1e19-4e43-a9d6-fe41049e3584",e._sentryDebugIdIdentifier="sentry-dbid-b50ef9de-1e19-4e43-a9d6-fe41049e3584")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./sentry-CfbcqWq3.js";import{u as l,h as f,g as m}from"./core-Ct1Na3r4.js";import{hA as p,MB as g,MC as b}from"./zeni-epic-state-x9uZgubN.js";import{u as _,L as h,z as y}from"./index-BBFNuY8-.js";import"./liveblocks-P0DntAgT.js";import"./recharts-KVNUr0cO.js";import"./mui-SSWNL1tt.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="ca75bbe3-d871-4bc5-9043-4e7cf70793fe",e._sentryDebugIdIdentifier="sentry-dbid-ca75bbe3-d871-4bc5-9043-4e7cf70793fe")}catch{}})();function R(){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{R as default};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-P0DntAgT.js";import{i as y,n as x,h as C,g as S,u as ee,t as ae,j as E,N as te,o as ne,p}from"./core-Ct1Na3r4.js";import{Mu as k,Mv as v,Mw as M,By as B,Bk as T,Mx as D,My as oe,Mz as se,Bo as ie,fC as $,Bv as le,Bs as re}from"./zeni-epic-state-x9uZgubN.js";import{K as f,o as r,m as de,f as j,k as G,n as ce,p as me,q as pe,r as H,A as ue,d as he,s as xe,v as fe,y as ge,x as we,B as be,C as ye,V as Se,D as ke,E as ve,F as je,G as $e}from"./index-BBFNuY8-.js";import{n as m}from"./mui-SSWNL1tt.js";import g from"./NotFoundScreen-DR4zbgK0.js";import{a as I}from"./sentry-CfbcqWq3.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="1df2b55b-ee5e-4779-a10f-aaaaaaf3f4f6",e._sentryDebugIdIdentifier="sentry-dbid-1df2b55b-ee5e-4779-a10f-aaaaaaf3f4f6")}catch{}})();const Ie=m.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
+
`,Ce=x((function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}}),(function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(M({data:l}))}}}))(de);function F(){const e=f(),{vendorId:t,billId:n}=y();return t==null||n==null?a.jsx(g,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const Be=m.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
height: 100vh;
|
|
13
|
+
width: 100%;
|
|
14
|
+
flex: 1 1 auto;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
18
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
19
|
+
`,De=x((function(e,t){const{isSubPage:n}=t;return{addressToEdit:D(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}}),(function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}}))(ce);function Ae({isSubPage:e}){const t=C(),n=S(),o=f();return a.jsx(a.Fragment,{children:a.jsx(Be,{windowSize:o,children:a.jsx(De,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},ze=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
|
+
display: flex;
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
flex: 1 1 auto;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
27
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
+
`,Ne=x((function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(M({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(),t=S(),n=f(),{vendorId:o,billId:s}=y();return o==null||s==null?a.jsx(g,{}):a.jsx(a.Fragment,{children:a.jsx(Le,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
flex: 1 1 auto;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
align-items: center;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
+
`,Me=x((function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,t.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 Te(){const e=C(),t=S(),n=f(),{vendorId:o,billId:s}=y(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(g,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Me,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Ge={containerWidth:new je(100,58)},He=m(ke)`
|
|
38
|
+
width: ${r.sp4};
|
|
39
|
+
height: ${r.sp4};
|
|
40
|
+
margin-bottom: ${r.sp3};
|
|
41
|
+
margin-top: ${r.sp3};
|
|
42
|
+
margin-left: ${r.sp8};
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
position: absolute;
|
|
45
|
+
color: ${e=>e.theme.colors.brandColorJade};
|
|
46
|
+
`,Ke=m.div`
|
|
47
|
+
display: flex;
|
|
48
|
+
height: 100vh;
|
|
49
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
50
|
+
width: 100vw;
|
|
51
|
+
overflow-y: scroll;
|
|
52
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
53
|
+
`,_e=m.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
|
|
58
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
59
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
60
|
+
padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
|
|
61
|
+
`,Ve=m.div`
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
|
|
67
|
+
height: ${e=>e.windowSize==="small"?"490px":"auto"};
|
|
68
|
+
overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
|
|
69
|
+
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
|
+
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
|
+
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
+
`,We=x((function(e,t){return{file:t.file,type:t.type}}))(ve);function h({appContent:e}){const t=ee(),n=S(),{tenantEmailDomain:o,vendorId:s,billId:l}=y(),[i]=ae(),d=i.get("token"),K=n.pathname.includes("address"),w=f(),_=fe(),A=ge(),b=we(),V=()=>{_.toggle()},W=E((u=>k(u))),U=E((u=>v(u))),{authParams:q,fetchState:c,billAttachment:J,billFetchState:P,companyName:O,currencySymbol:Q,amount:R}=W,{tenantId:z,userId:L,sessionId:N}=q,{fetchState:X,internationalBankAccountCreateStatus:Y}=U;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&t(le(s,o,d))}),[b,c,s,o,d,t]),I.useEffect((()=>{b&&c==="Completed"&&($(L,N,z),l!=null&&t(re(l)))}),[c,b,L,N,z,l,t]),c==="Error"?a.jsx(g,{}):X==="Completed"||Y.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&P==="Completed"&&a.jsx(ye,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",O,l??"",Ue(n.pathname),Q,R))(u)}),a.jsxs(Ke,{windowSize:w,children:[w!=="small"?a.jsx(He,{onClick:V}):null,a.jsx(Ve,{windowSize:w,isAddressPage:K,children:P==="In-Progress"?a.jsx(Se,{size:"ExtraLarge",start:!0}):a.jsx(We,{file:J,type:"bill"})}),a.jsx(_e,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function qe(){return a.jsx($e,{})}function da(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(qe,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Ae,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Te,{})})}),a.jsx(p,{path:"*",element:a.jsx(g,{})})]})}export{da as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-P0DntAgT.js";import{a as u}from"./sentry-CfbcqWq3.js";import{u as F,g as O,h as _,t as w,j as l,N as T}from"./core-Ct1Na3r4.js";import{z as r,y as V,O as P,g as A,f as N,h as W,W as Z,V as q,j as R}from"./index-BBFNuY8-.js";import{eZ as $,Mf as B,Mp as G,Mg as H,fC as J,g2 as K,Ml as Q,gv as X,cZ as Y,Mq as ee,Mr as te}from"./zeni-epic-state-x9uZgubN.js";import{n as ne}from"./mui-SSWNL1tt.js";import{u as se}from"./useDeviceId-BAVWaoiW.js";import{f as ae}from"./analyticsHelper-eo4F52XS.js";import{t as ie}from"./getLocaleForTenant-C9iKXyPU.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="fbd07177-0cf0-4093-9e2a-ecc046be5c84",t._sentryDebugIdIdentifier="sentry-dbid-fbd07177-0cf0-4093-9e2a-ecc046be5c84")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=F(),a=O(),m=_(),[b]=w(),n=b.get("token"),p=b.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:c,twoFAPhoneNumber:x,magicLinkEmail:d,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:D}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),k=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>$(e))),y=l((e=>B(e))),M=r.getSignedInUser(),v=V().mode;u.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),u.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&k!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(y.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,y.tenantsInOrder),X().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(W.Event.loginSuccess,"email",Y(o.productSettings))}),2e3))}),[h,S,k,s,o,y,v,a.state,t]);const E=u.useCallback((()=>{m("/signin/auth")}),[m]),j=u.useCallback((()=>{i!=null&&c!=null&&d!=null&&t(ee(i,d,c))}),[i,c,t,d]),U=u.useCallback((e=>{i!=null&&n!=null&&d!=null&&c!=null&&t(te(e,i,d,c))}),[i,n,t,d,c]);if(I==="Completed"&&c!=null)return g.jsx(Z,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:j,onVerifyOtp:U,onCancelVerifyDevice:E});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||M!=null){const e=a.state?.origin??"/";return g.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return g.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return g.jsx(oe,{"data-testid":"smooth-loader",children:g.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{Ce as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as V}from"./liveblocks-P0DntAgT.js";import{a as c}from"./sentry-CfbcqWq3.js";import{u as fe,j as n,i as He,g as We,h as Je,l as x}from"./core-Ct1Na3r4.js";import{eZ as me,fH as Ke,fI as be,ft as Qe,bn as Xe,eY as qe,fJ as ea,fK as aa,fM as ta,fP as na,fQ as g,fS as sa,fT as de,fW as oa,fU as ia,fV as ra,fX as da,cP as la,fZ as ca,cV as ua,fs as fa,g2 as ma,g3 as ba,g1 as pa}from"./zeni-epic-state-x9uZgubN.js";import{a9 as ha,aa as Sa,v as ga,A as Ea,z as k,x as ka,u as Ca,d as r,i as ya,c as Ia,ab as Ta,e as Aa,a as _a,ac as wa,a5 as Da,ad as Fa,ae as va,af as le,ag as ce,L as $a,ah as Pa,ai as ue,f as G,a1 as Ma,r as A,aj as R,ak as xa}from"./index-BBFNuY8-.js";import{D as Ga}from"./mui-SSWNL1tt.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="4fb91689-7102-4a33-9e50-ba12b6f5e67c",f._sentryDebugIdIdentifier="sentry-dbid-4fb91689-7102-4a33-9e50-ba12b6f5e67c")}catch{}})();const Ra=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=He(),a=We(),C=ga(),o=Je(),B=Qe(),m=fe(),{useFeatureGate:i}=Ea(),N=k.getSignedInUser(),U=Xe(N),s=n((e=>me(e))),pe=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>qe(e))),j=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[_,L]=c.useState(void 0),w=x("/:tenantEmailDomain/dashboard")!==null,Z=x("/:tenantEmailDomain/reports")!==null,I=x("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n((e=>aa(e)));c.useEffect((()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,D.fetchState,I]);const h=k.getSignedInUser(),F=n((e=>e.tenantState)),Ce=n((e=>F.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Ae}=i(r.isExpenseAutomationEnabledV2),H=Ia(),{isFeatureEnabled:_e}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:we}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,Pe=n((e=>g(e).totalUnreadCount)),Me=n((e=>g(e).reducedFetchCountState)),W=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),J=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),xe=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:K,isLoading:Q,isFetchingMore:X,hasFetchedAll:q,fetchMore:Ge}=Ta();c.useEffect((()=>{const e=setTimeout((()=>Ge?.()),0);return()=>clearTimeout(e)})),c.useEffect((()=>{if(Q===!1&&X===!1&&q===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;L(K.filter((u=>u.roomId===e&&u.readAt==null)).length)}else L(0)}),[Q,X,q]),c.useEffect((()=>{y&&!I&&xe.fetchState==="Not-Started"&&B.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,B.tenantId]),c.useEffect((()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),c.useEffect((()=>{_!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(be({unreadCount:_},"comments")))}),[_,$.fetchState]);const Re={fetchStatus:Me,count:Pe},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),H===!1&&S.push("expense_automation_card");const Ve=Aa(),te=n((e=>ia(e,S,h,Ae,Te).fetchState)),ne=n((e=>ra(e).fetchState)),Be=w&&(te==="Completed"||te==="Error")||Z&&(ne==="Completed"||ne==="Error")||!w&&!Z?void 0:"disabled",Ne=c.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=la(Ne),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&Y.fetchState==="Completed"&&ca(Y.notificationSettings,h.userEmail,z,s),se=_a(),Le=se&&wa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,P=c.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Da(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[Ze,re]=c.useState(P);c.useEffect((()=>{re(P())}),[P]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);return V.jsx(Ga,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:N,currentTenantId:F.currentTenantId??"",tenants:F.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Be,isSettings:ce(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:je,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:H,selectedMenu:le(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=W===0&&J>0?"notifications/comments":"notifications/tasks";ce(a)&&(e=W===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(G.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!pe)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&G.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=xa(e.type);ue(e.type)?(j!=null&&m(pa()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=le(a);let b=`/${encodeURIComponent(u)}/`;const M=R(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":ue(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(ba(h.userId,e.tenantId,h.zeniSessionId)));const p=e;G.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Le,aiCfoView:O,isOnDashboard:w,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:_e,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:we,christmasAnimationEnabled:De,newYearAnimationEnabled:Fe})})})),La=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&Ke(o.mode)==="dashboard"&&d(be({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ra,{...f,...a})};export{La as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-P0DntAgT.js";import{h as n,n as e}from"./core-Ct1Na3r4.js";import{R as i}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import"./sentry-CfbcqWq3.js";import"./zeni-epic-state-x9uZgubN.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="9ceba748-25d5-4d32-9a3c-da4194015415",o._sentryDebugIdIdentifier="sentry-dbid-9ceba748-25d5-4d32-9a3c-da4194015415")}catch{}})();const a=e(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-P0DntAgT.js";import lt from"./NotFoundScreen-DR4zbgK0.js";import{a as k}from"./sentry-CfbcqWq3.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as Q}from"./core-Ct1Na3r4.js";import{cw as St,fJ as q,eZ as H,fX as bt,fQ as b,Td as K,fT as d,fI as y,sI as M,ye as It,Te as Tt,fH as Ct,fZ as yt,sN as _t,Tf as $,bo as F,fB as x,sR as X,Tg as At,cI as Et,cB as Nt}from"./zeni-epic-state-x9uZgubN.js";import{_ as Bt,z as wt,A as xt,d as Rt,a0 as Dt,cW as vt,r as N,a9 as Pt,cX as Ut,aa as Gt,p as $t}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="80f898f0-483d-459f-85c4-9603c3bf602a",t._sentryDebugIdIdentifier="sentry-dbid-80f898f0-483d-459f-85c4-9603c3bf602a")}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=q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=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(X("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")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(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 R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(X("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(_t("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=$t(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}})}}}))(Pt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,R]=k.useState(!1),a=S((e=>q(e))),o=S((e=>H(e))),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const O=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),Y=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=vt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:T,isFetchingMore:P,fetchMore:ot}=ct(),{threads:W,isLoading:L,fetchMore:Z,isFetchingMore:z,hasFetchedAll:J}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(_===!1&&T===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter((C=>C.roomId===e&&C.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,T]),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=_||P===!0||T!==!0||_||P===!0||T!==!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:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&L===!1&&w!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=w.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const G=W.find((rt=>rt.id===f.threadId));return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(z||J===!0||Z==null||Z(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[_,P,z,T,J,L,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(M("task_manager",C,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:O,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(Q,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(Q,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-P0DntAgT.js";import{a as r}from"./sentry-CfbcqWq3.js";import{u as T,g as A,j as o,N as P}from"./core-Ct1Na3r4.js";import{ME as j,eZ as C,fP as x,MF as z,MG as D,MH as L,MI as R,oi as k,LB as N}from"./zeni-epic-state-x9uZgubN.js";import{z as h,M as I}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="1497b19d-ff7a-4110-b12a-1cb36287a629",n._sentryDebugIdIdentifier="sentry-dbid-1497b19d-ff7a-4110-b12a-1cb36287a629")}catch{}})();function ee(){const n=T(),a=A(),{params:t,error:i}=r.useMemo((()=>j(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=>x(e))),d=o((e=>e.tenantState.fetchState)),b=o(z),y=o(D),u=o(L),[v,S]=r.useState(null),[E,M]=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 _=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((U=>U.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),c=v??_;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??y,isApproving:b==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(N(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{M("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(P,{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-P0DntAgT.js";import{h as V,u as z,g as H,i as J,j as d,n as K,o as Q,p as I}from"./core-Ct1Na3r4.js";import{eZ as U,sw as R,s4 as X,N9 as v,r$ as y,bs as ee,bn as ae,bZ as te,s0 as se,Na as oe,MY as C,dI as re,wb as ne,Nb as ie,wy as ce,fG as le,fE as de}from"./zeni-epic-state-x9uZgubN.js";import{z as me,_ as fe,a0 as pe,e as ue,A as w,d as M,C as he,f as N,ap as ge,r as Fe}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import be from"./NotFoundScreen-DR4zbgK0.js";import{F as Ie}from"./FeaturePreviewScreen-1q69VsC1.js";import{a as g}from"./sentry-CfbcqWq3.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{u as ye}from"./useInitialThreadRequest-J5ElkQVA.js";import{t as Se}from"./routePaths-Dvh0MCMy.js";import{M as Te}from"./MobileAppDrawer-uvkpUvp_.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="5867bc77-3bd4-4d06-a77a-ec336f681805",s._sentryDebugIdIdentifier="sentry-dbid-5867bc77-3bd4-4d06-a77a-ec336f681805")}catch{}})();const S=(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=K((function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:N}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(y(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(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,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=Fe(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("../../")}}}))(ge);function O(){const s=V(),e=z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),T=d((t=>U(t))),$=T.company?.companyInfo.firstMonthOfFY??1,c=d((t=>R(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();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:q}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex((b=>b.id===L)):P!=null?f.forecasts.findIndex((b=>b.id===P)):f.forecasts.length>0?0:-1)(c,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(v(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&F&&e(y(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,R,y,F]);const D=ue(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:G}=w(),{isFeatureEnabled:E}=G(M.isReportsCommentingEnabled),W=ye(E?T?.companyId:void 0,{clearParams:l&&m}),[Y,Z]=g.useState(!1),j=t=>{Z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:N,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(Ae,{firstMonthOfFY:$,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:_,onAskAiCfoClick:q,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ze(){const s=d((i=>U(i))),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{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(be,{})})]})}export{Ze as PandLWithForecastRoutes,Ze as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-P0DntAgT.js";import{N5 as oe,eZ as Q,kG as H,fG as X,fE as ie,Kz as ee,ML as re,v8 as ke,N6 as Y,uZ as Ee,vi as ve,vc as le,v1 as ce,vg as Pe,vd as je,N7 as de,wZ as Le,fq as Te,gi as Ae,N8 as _,v5 as pe,v4 as ue,vl as Fe,c7 as Oe}from"./zeni-epic-state-x9uZgubN.js";import{K as me,A as ae,d as G,z as K,i as ge,S as fe,I as he,al as Ce,am as Re,F as ye,o as R,J as be,O as M,an as Ve,_ as Ze,a0 as Be,C as Ue,f as Se,h as $e,r as ze,ao as _e,e as Ge}from"./index-BBFNuY8-.js";import{D as we,n as N,S as xe}from"./mui-SSWNL1tt.js";import te from"./NotFoundScreen-DR4zbgK0.js";import{a as c}from"./sentry-CfbcqWq3.js";import{u as se,i as He,j as g,h as Ke,g as Me,n as Ne,o as ne,p as z}from"./core-Ct1Na3r4.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{M as qe}from"./MobileAppDrawer-uvkpUvp_.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="e323582e-43ca-41f7-b541-a027a1286c96",e._sentryDebugIdIdentifier="sentry-dbid-e323582e-43ca-41f7-b541-a027a1286c96")}catch{}})();const Je={overlayWidth:new ye(100,100,48)},W=M.getLocalizedStrings().peoplePage.invitePage,Ye=M.getLocalizedStrings().common,Qe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:w}=He(),r=g((l=>oe(l))),p=g((l=>Q(l))),E=g((l=>H(l))),{useFeatureGate:D}=ae(),{isFeatureEnabled:I}=D(G.isDebitCardFeatureEnabled),v=X(I,p),L=ie(p),T=ee(p),B=re(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!v&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(Y()),b()},A=()=>{V===!0?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=D(G.isChargeCardFeatureEnabled),j=ge(p,P,I),{isCardsHidden:F}=fe(p?.tenantId),y=!j||F,O=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:v,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(ce(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(le({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?Ee(e):ve(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Xe,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:Ye.no,action:o,isEditPopup:!0}):null,a.jsx(Re,{...s})]})})},Xe=N(xe)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,De=N(be.H6Regular)`
|
|
6
|
+
margin-top: ${R.sp7};
|
|
7
|
+
padding-left: ${R.sp8};
|
|
8
|
+
padding-right: ${R.sp8};
|
|
9
|
+
color: ${e=>e.theme.colors.primary};
|
|
10
|
+
word-break: break-word;
|
|
11
|
+
`,Ie=N(be.LargeRegularSp)`
|
|
12
|
+
color: ${e=>e.theme.colors.hero};
|
|
13
|
+
padding-left: ${R.sp8};
|
|
14
|
+
padding-right: ${R.sp8};
|
|
15
|
+
margin-bottom: 30px;
|
|
16
|
+
margin-top: ${R.sp4};
|
|
17
|
+
white-space: pre-line;
|
|
18
|
+
`,ea={overlayWidth:new ye(100,100,48)},q=M.getLocalizedStrings().peoplePage.invitePage,aa=M.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=c.useState(!1),[k,S]=c.useState(!1),w=g((o=>oe(o))),r=g((o=>Q(o))),p=g((o=>H(o))),{useFeatureGate:E}=ae(),{isFeatureEnabled:D}=E(G.isDebitCardFeatureEnabled),I=X(D,r),v=ie(r),L=ee(r),T=re(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{b(),m(Y())},C=()=>{V===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=E(G.isChargeCardFeatureEnabled),j=ge(r,P,D),{isCardsHidden:F}=fe(r?.tenantId),y=!j||F,O=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:o=>{m(le({peopleLocalData:o})),Z(!0)},onResetClick:x,onSaveClick:()=>{m(f==="zeni_only"?Pe(e):je())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:v,isLoading:U};return c.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(b(),m(Y()))}),[w.invitePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:ea.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:q.discardTitle}),descriptionComponent:a.jsx(Ie,{children:q.discardDescription}),primaryButtonText:q.discard,secondaryButtonText:aa.no,action:A}):null,a.jsx(Ve,{...s})]})})},ta=N(xe)`
|
|
19
|
+
display: flex;
|
|
20
|
+
min-height: 100%;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
`,na=Ne((function(e,t){const d=de(e),n=K.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:H(e),analytics:Se}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(ce(i,b))},onResendInvite:i=>{e(Fe(i))},onReloadPeople:()=>{e(pe()),e(ue(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(_({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(_({searchText:i}))}}}}))(_e);function J({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Ke(),n=se(),f=Me(),{areTenantIdsInSync:i}=Ze(),b=K.getSignedInUser(),h=g((s=>Q(s))),{useFeatureGate:m}=ae(),{isFeatureEnabled:V}=m(G.isDebitCardFeatureEnabled),Z=g((s=>H(s))),k=!X(V,h)&&Z,S=ee(h),w=h?.tenantId,{tenantEmailDomain:r}=h,[p,E]=c.useState(!1),[D,I]=c.useState(!1),[v,L]=c.useState(!1),[T,B]=c.useState("off"),[U,x]=c.useState(!1),C=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=We({mobileExploreReferrer:"People"}),u=g((s=>de(s)));Be({isDataReady:u.fetchState==="Completed"});const P=g((s=>Le(s.classState,s.classListState))),j=g((s=>Te(s.userState,s.userRoleState,s.userListViewState,"manager"))),F=g((s=>Ae(s))),y=h?.companyId;c.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(_({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),E(!0),n(pe()))}),[p,b,w,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ue(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),L(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(_({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const O=()=>{I(!1),L(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(Ue,{analytics:Se,onLoad:s=>s.trackPageLoaded($e.Event.members)}):null,D===!0?a.jsx(sa,{closeDrawerHandler:O,isInvitePeopleDrawerOpen:D,managersListView:j,companyPassportView:F,classListView:P,companyId:y,mode:u.uiState.mode}):null,v===!0?a.jsx(Qe,{closeDrawerHandler:O,isEditPeopleDrawerOpen:v,managersListView:j,companyPassportView:F,classListView:P,companyId:y,mode:u.uiState.mode}):null,a.jsx(qe,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:P,managersView:j,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(_({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=ze(f.state?.pathnameStackToGoBack,f.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function Da(){const e=Ge();return Oe(e?.loggedInUserRole??[])?a.jsxs(ne,{children:[a.jsx(z,{path:"/",element:a.jsx(J,{})}),a.jsx(z,{path:"new",element:a.jsx(J,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(J,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(te,{})})]}):a.jsx(ne,{children:a.jsx(z,{path:"*",element:a.jsx(te,{})})})}export{Da as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-P0DntAgT.js";import E from"./NotFoundScreen-DR4zbgK0.js";import{a as r}from"./sentry-CfbcqWq3.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as B,p as h}from"./core-Ct1Na3r4.js";import{eZ as O,Th as b,bq as F,bn as N,im as V,fB as q}from"./zeni-epic-state-x9uZgubN.js";import{v as Y,z as I,a0 as Z,cY as $}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{M as H}from"./MobileAppDrawer-uvkpUvp_.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="d41624c0-4033-4bc2-a2e0-9f6a994af547",e._sentryDebugIdIdentifier="sentry-dbid-d41624c0-4033-4bc2-a2e0-9f6a994af547")}catch{}})();const J=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))($),K=()=>{const e=_(),t=v(),c=Y(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:m}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=C||k||x,l=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0}),[n?.fetchState,l]),j=r.useCallback(((a,i)=>{l(a,i,!1)}),[l]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=G({mobileExploreReferrer:"Performance"});return Z({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(B,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as t}from"./sentry-
|
|
1
|
+
import{a as h,b as t}from"./sentry-CfbcqWq3.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-P0DntAgT.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CfbcqWq3.js";import{L as dt,bZ as Tc,eZ as Ac,Mf as Rc,MJ as kl,c7 as Tl,g2 as Al,g3 as Rl}from"./zeni-epic-state-x9uZgubN.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,o as Yt,p as ue,q as Dl}from"./utils-BmRSZi-a.js";import{r as un}from"./empty-enRUfXAJ.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DerHPYIF.js";import{r as Gl}from"./index-Lktm9qH-.js";import{r as zl}from"./index-CpAcGISI.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-Ct1Na3r4.js";import{u as Kl,z as Pc,L as Wl,N as Jl,Q as Xl,k as Ql,f as tf}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{d as Pe}from"./decodeURIComponentSafe-Dl7JnLtd.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]="235f1eef-55f4-4e21-9a94-c1b331a3b572",t._sentryDebugIdIdentifier="sentry-dbid-235f1eef-55f4-4e21-9a94-c1b331a3b572")}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
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-P0DntAgT.js";import $ from"./NotFoundScreen-DR4zbgK0.js";import{a as p}from"./sentry-CfbcqWq3.js";import{h as x,g as C,u as E,j as u,N as D,n as k,o as O,p as g}from"./core-Ct1Na3r4.js";import{eZ as I,Qz as S,QP as b,FY as V,F5 as U,FX as d,FO as B,R0 as N,F_ as W}from"./zeni-epic-state-x9uZgubN.js";import{z as F,a9 as L,bZ as z,ag as T,bC as Q,b_ as Z}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{u as K,R as A}from"./ReimbursementApprovalRuleDetailScreen-4DU8eod7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="12e2438f-512c-4f0f-8f8c-366274e260ec",e._sentryDebugIdIdentifier="sentry-dbid-12e2438f-512c-4f0f-8f8c-366274e260ec")}catch{}})();const y="reimbursement-approval-rule-update",P=k((function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:b(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:a}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(N(!1))},onBackClick:()=>{T(a)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(L(z)),X=({isLoading:e})=>{const o=x(),s=C(),a=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((n=>n.remiSetupApproverViewState.fetchState)),l=u((n=>I(n))),c=u((n=>S(n))),v=u((n=>b(n).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&a(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),a(U(!0,!1,!1,!1)))}),[t,f,e,a]),F.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),a(d())),o("./new"))}),[m,c,a]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(n,_,h)=>{n.endsWith(y)&&h.onApprovalRulesEventReceived(n)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(P,{currentTenant:l,location:s,navigate:o,...w})},j="reimbursement-approval-rule-update",Y=k((function(e){const o=S(e),s=b(e).remiSetupApproverViewUpdateData,a={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(a[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:a,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:a}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(N(!1))},onBackClick:()=>{T(a)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}}))(L(Z)),q=()=>{const e=u((a=>I(a))),{isApprovalRulesV3Enabled:o,isLoading:s}=Q(e?.tenantId);return o?r.jsx(G,{isLoading:s}):r.jsx(X,{isLoading:s})},G=({isLoading:e})=>{const o=x(),s=C(),a=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((n=>n.remiSetupApproverViewState.fetchState)),l=u((n=>I(n))),c=u((n=>S(n)));K();const v=u((n=>b(n).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&a(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),a(U(!0,!1,!1,!0)))}),[t,f,e,a]),F.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),a(d())),o("./new"))}),[m,c,a]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(n,_,h)=>{n.endsWith(j)&&h.onApprovalRulesEventReceived(n)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(Y,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(O,{children:[r.jsx(g,{path:"/",element:r.jsx(q,{})}),r.jsx(g,{path:"/new",element:r.jsx(A,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(g,{path:"*",element:r.jsx($,{})})]})}export{oe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-P0DntAgT.js";import{a as f}from"./sentry-CfbcqWq3.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-Ct1Na3r4.js";import{l6 as L,QP as w,Qz as C,FR as V,G1 as B,FY as A,FZ as E,QQ as j,eZ as z,FX as Z}from"./zeni-epic-state-x9uZgubN.js";import{z as P,y as N,B as Q,bP as G,ag as $,bC as K,bQ as W}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b299935a-0703-4363-9cbb-f2e8cbadb5ff",e._sentryDebugIdIdentifier="sentry-dbid-b299935a-0703-4363-9cbb-f2e8cbadb5ff")}catch{}})();function X(){const e=T(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const Y=F((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(I);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function H(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const J=F((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(Z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?b.jsx(M,{}):b.jsx(H,{})}function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(X(),f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,X as u};
|