@zeniai/web-app-ui 5.2.17-dev → 5.2.17-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddressRoutes-B2KIG7En.js → AddressRoutes-C9ePPZTc.js} +1 -1
- package/dist/assets/{AddressScreen-BRHUGjlq.js → AddressScreen-Ba-VvOjK.js} +1 -1
- package/dist/assets/{AiCfoScreen-HMy5Y7Mq.js → AiCfoScreen-BVHcwn1-.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-ClKax7IT.js → BillPayApprovalRoutes-GlLqvwOB.js} +1 -1
- package/dist/assets/{BillPayRoutes-BChpGQL2.js → BillPayRoutes-CC8ojAoZ.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BwMN9nGs.js → BusinessVerificationPageScreen-BZk1AoM_.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-DO_y52lp.js → CardsAiCfoScreen-DdtKtE2m.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-Dv5pDzqZ.js → ChargeCardRoutes-CEOawkX4.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-DpirfeBa.js → CompanyPassportScreen-DpwDdQJT.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-rOB6ynUK.js → ConnectionAuthScreen-4wK0rBPz.js} +1 -1
- package/dist/assets/{CustomerOnboardingAuthScreen-C98l4ZVS.js → CustomerOnboardingAuthScreen-C6JuurfT.js} +1 -1
- package/dist/assets/{CustomerOnboardingRoutes-D_6fNZiA.js → CustomerOnboardingRoutes-Dxrd_oMn.js} +1 -1
- package/dist/assets/{DashboardRoutes-Cp_J4k4_.js → DashboardRoutes-CgelQ0B8.js} +1 -1
- package/dist/assets/{DefaultTenantHome-D0bfOiik.js → DefaultTenantHome-D6efsYE9.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CEzBRH9X.js → DomesticWireDetailScreen-CQmjKCQc.js} +1 -1
- package/dist/assets/{DrawerScreen-CTCbWuBb.js → DrawerScreen-D1JpfIY3.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-8jxY5Riu.js → EntityDetailRoutes-Dzsfy19y.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BLGJhe2d.js → ExpenseAutomationRoutes-Qm3X_H6K.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-BYw0siNX.js → FeaturePreviewScreen-BKTS5XLx.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-D5JpfjXx.js → HubSpotOAuthCallbackScreen-BDz3Agei.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-DJ8XQppN.js → MagicLinkRoutes-Cn1P1SX6.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-Pc9aSzuu.js → MagicLinkSignInScreen-CB996C-0.js} +1 -1
- package/dist/assets/{MobileAppDrawer-C850zeFL.js → MobileAppDrawer-hdYoVCXp.js} +1 -1
- package/dist/assets/{NotFoundScreen-D8y3QSjF.js → NotFoundScreen-B6nbKEPc.js} +1 -1
- package/dist/assets/{NotificationRoutes-CgDlCmJS.js → NotificationRoutes-Ds6eCL2b.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BHm1bSWe.js → OAuthConsentScreen-Ba0wA_HU.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-CxkAljmn.js → PandLWithForecastRoutes-BBHF28-E.js} +1 -1
- package/dist/assets/{PeopleRoutes-Cwuko2wK.js → PeopleRoutes-DXDqmyhJ.js} +1 -1
- package/dist/assets/{PerformanceRoutes-Cpl-d1r4.js → PerformanceRoutes-BaKOjCPx.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BlMcHgbG.js → QBOConnectionScreen-CCcDJEqP.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-nJxxaKUX.js → ReimbursementApprovalRoutes-62K0ZFMF.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DXovejDg.js → ReimbursementApprovalRuleDetailScreen-Dgh8Yquq.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-41mQ1voL.js → ReimbursementRoutes-DoahH0o8.js} +1 -1
- package/dist/assets/{ReportsRoutes-CPxhUqlo.js → ReportsRoutes-BRx0lkFY.js} +1 -1
- package/dist/assets/{RewardsRoutes-BXExREiG.js → RewardsRoutes-CXoqy3I2.js} +1 -1
- package/dist/assets/{ScreenRoutes-DBgtMxcS.js → ScreenRoutes-BYtpyV-M.js} +2 -2
- package/dist/assets/{SettingsRoutes-C3VXjgEl.js → SettingsRoutes-CmZf5R1j.js} +1 -1
- package/dist/assets/{SetupPagesScreen-BX3zI3tV.js → SetupPagesScreen-D2lEnwjt.js} +1 -1
- package/dist/assets/{SignInScreen-DYVSrH1Q.js → SignInScreen-BoIjGUSc.js} +1 -1
- package/dist/assets/{SignOutScreen-D8IS2BPQ.js → SignOutScreen-CwtCC2I_.js} +1 -1
- package/dist/assets/{TaskListScreen-DbBL-EqC.js → TaskListScreen-B0fkcObi.js} +1 -1
- package/dist/assets/{TaskRoutes-CP206xuh.js → TaskRoutes-DpRNRovH.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-8oHAjr2u.js → TransactionDetailRoutes-B4V40VOl.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-Bfy3N_JT.js → TransactionDetailScreen-Dyormtjy.js} +1 -1
- package/dist/assets/{TransactionListRoutes-C46bH8Mo.js → TransactionListRoutes-BHh4uWIi.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CzmHsChK.js → TreasuryRoutes-BdMeVeBd.js} +1 -1
- package/dist/assets/{VendorsRoutes-CUyxWOUM.js → VendorsRoutes-xEmDK5qc.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-lyjRGpZ9.js → WiseConfirmationScreen-CogkOQi0.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-8seJMANR.js → ZeniAccountRoutes-X8MXJuIg.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-D_5y24R6.js → ZeniAccountStatementScreen-rGHf8AJK.js} +1 -1
- package/dist/assets/{analyticsHelper-BZTNTJma.js → analyticsHelper-CBp9b8VI.js} +1 -1
- package/dist/assets/{getLocaleForTenant-Bpp7IHaZ.js → getLocaleForTenant-BhD_5oG2.js} +1 -1
- package/dist/assets/{index-CbGX11uA.js → index-qYSCKekz.js} +5 -5
- package/dist/assets/{routePaths-BYuMJjxP.js → routePaths-TA66BJgf.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-7YoEarS7.js → useAiCfoDashboardSuggestedQuestionsChips-DqLJLw_b.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-DuEP5Klm.js → useAskAiCfoHostNavButtonProps-yAJW2Zxp.js} +1 -1
- package/dist/assets/{useCashManagementBanner-_9igQwqA.js → useCashManagementBanner-Dbz53g9T.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-DCjAMeeL.js → useChargeCardPusherEvents-CFucNvvU.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BTnBt-Sy.js → useEmailConnectResultRefresh-DnMJ5jdi.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BMuxer3t.js → useInitialThreadRequest-BeFUEHq1.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-MO-qZsKE.js → withTransactionSidePanel-DIWgh7V_.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-BqtYq8PY.js";import{g as z,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as G}from"./core-4nWRIid2.js";import{e$ as L,fX as w,MW as Te,kI as J,rd as K,s2 as k,kw as Re,jA as Oe,vB as Q,s7 as Ae,bs as ke,MX as Fe,bn as De,wK as je,MY as Me,MZ as Ee,vt as Pe,M_ as Y,M$ as Le,N0 as Be,N1 as Ne,N2 as ve,N3 as I,N4 as F,N5 as D,N6 as H,N7 as j,N8 as M,dL as Ve,wq as Ue,we as $,wf as q,ww as xe,wj as Z,wC as ze,N9 as Ge,Na as Ye,Nb as He,Nc as $e,Nd as qe,fI as Ze,fG as Xe}from"./zeni-epic-state-Brhydpej.js";import{V as We,W as Je,X as Ke,Y as Qe,J as ea,w as ee,i as E,z as ae,_ as aa,D as sa,c as ta,$ as oa,a0 as na,Z as ra,e as P,h as ia,a1 as la,x as se,a2 as ca,a3 as da,a4 as pa}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import fa from"./NotFoundScreen-D8y3QSjF.js";import{F as ma}from"./FeaturePreviewScreen-BYw0siNX.js";import{a as _}from"./sentry-BtWdTNDK.js";import{u as ua}from"./useInitialThreadRequest-BMuxer3t.js";import{t as X,a as W,b as _a}from"./routePaths-BYuMJjxP.js";import{M as ha}from"./MobileAppDrawer-C850zeFL.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="daf231d8-2978-432d-93b0-e9e15e42b849",e._sentryDebugIdIdentifier="sentry-dbid-daf231d8-2978-432d-93b0-e9e15e42b849")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(M({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(He()),e($e()),e(qe())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:K(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(M({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Ne({viewMode:a})),e(ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(Q())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(Me(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:N}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(N?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),v=d((n=>J(n))),O=d((n=>K(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(k(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(Q());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,v,O]);const V=sa(),de=V?.loggedInUserRole!=null&&ke(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),U=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=We(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>x?ba:void 0),[x]);Ke({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:N,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function xa(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Xe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{xa as default};
|
|
1
|
+
import{j as p}from"./liveblocks-BqtYq8PY.js";import{g as z,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as G}from"./core-4nWRIid2.js";import{e$ as L,fX as w,MW as Te,kI as J,rd as K,s2 as k,kw as Re,jA as Oe,vB as Q,s7 as Ae,bs as ke,MX as Fe,bn as De,wK as je,MY as Me,MZ as Ee,vt as Pe,M_ as Y,M$ as Le,N0 as Be,N1 as Ne,N2 as ve,N3 as I,N4 as F,N5 as D,N6 as H,N7 as j,N8 as M,dL as Ve,wq as Ue,we as $,wf as q,ww as xe,wj as Z,wC as ze,N9 as Ge,Na as Ye,Nb as He,Nc as $e,Nd as qe,fI as Ze,fG as Xe}from"./zeni-epic-state-Brhydpej.js";import{V as We,W as Je,X as Ke,Y as Qe,J as ea,w as ee,i as E,z as ae,_ as aa,D as sa,c as ta,$ as oa,a0 as na,Z as ra,e as P,h as ia,a1 as la,x as se,a2 as ca,a3 as da,a4 as pa}from"./index-qYSCKekz.js";import"./mui-ChRNPf14.js";import fa from"./NotFoundScreen-B6nbKEPc.js";import{F as ma}from"./FeaturePreviewScreen-BKTS5XLx.js";import{a as _}from"./sentry-BtWdTNDK.js";import{u as ua}from"./useInitialThreadRequest-BeFUEHq1.js";import{t as X,a as W,b as _a}from"./routePaths-TA66BJgf.js";import{M as ha}from"./MobileAppDrawer-hdYoVCXp.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="daf231d8-2978-432d-93b0-e9e15e42b849",e._sentryDebugIdIdentifier="sentry-dbid-daf231d8-2978-432d-93b0-e9e15e42b849")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(M({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(He()),e($e()),e(qe())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:K(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(M({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Ne({viewMode:a})),e(ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(Q())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(Me(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:N}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(N?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),v=d((n=>J(n))),O=d((n=>K(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(k(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(Q());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,v,O]);const V=sa(),de=V?.loggedInUserRole!=null&&ke(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),U=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=We(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>x?ba:void 0),[x]);Ke({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:N,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function xa(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Xe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{xa as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-BqtYq8PY.js";import{z as b,Z as S,e as u,h as E,da as k,w as I,i as C}from"./index-
|
|
1
|
+
import{j as a}from"./liveblocks-BqtYq8PY.js";import{z as b,Z as S,e as u,h as E,da as k,w as I,i as C}from"./index-qYSCKekz.js";import"./mui-ChRNPf14.js";import g from"./NotFoundScreen-B6nbKEPc.js";import{a as c}from"./sentry-BtWdTNDK.js";import{u as D,j as h,h as F,g as U,n as L,o as T,p as f,N as y}from"./core-4nWRIid2.js";import{e$ as _,Ue as w,Uf as p,w5 as P,fO as V,Ug as z,w3 as G}from"./zeni-epic-state-Brhydpej.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="4f849dbc-8be0-4522-a474-b56e6039b572",e._sentryDebugIdIdentifier="sentry-dbid-4f849dbc-8be0-4522-a474-b56e6039b572")}catch{}})();const O=L((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),R=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),m=F(),j=U(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>w(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(O,{navigate:m,location:j,currentTenant:r,companyName:v,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-
|
|
2
|
-
import{_ as t,bn as ls,e$ as us,fI as ds,fG as cs,gq as ms,fv as _s,cX as Ee,cD as hs,fY as Es,cv as ps,bE as xs,bo as Rs,g0 as gs,v as Is,Ms as js,bs as Ts,Mt as As,bK as fs,bJ as Ds,bt as bs,cr as ys,Mu as Cs,Mv as vs,cT as ws,cW as Us,cV as Os,cC as Ps,cJ as Fs,ok as pe,fE as xe,gA as Ls,g4 as Re,gx as ge,gy as Ie,g5 as ks}from"./zeni-epic-state-Brhydpej.js";import{j as e}from"./liveblocks-BqtYq8PY.js";import{a as O}from"./sentry-BtWdTNDK.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-4nWRIid2.js";import{E as Ms,u as Zs,z as b,w as Gs,c as zs,R as $s,i as z,d as Ys,g as Ws,D as qs,L as F,a as Te,t as _,P as Js,e as Q,l}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{f as Ae}from"./analyticsHelper-BZTNTJma.js";import{t as Ks}from"./getLocaleForTenant-Bpp7IHaZ.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="e40b1320-bdf9-41d8-95c3-9bf073a04bd2",o._sentryDebugIdIdentifier="sentry-dbid-e40b1320-bdf9-41d8-95c3-9bf073a04bd2")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-Cp_J4k4_.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-BChpGQL2.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-41mQ1voL.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-C46bH8Mo.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-C3VXjgEl.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-CPxhUqlo.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-Dv5pDzqZ.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-Cwuko2wK.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-BLGJhe2d.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-CzmHsChK.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-CUyxWOUM.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-8seJMANR.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-CPxhUqlo.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),st=l((()=>t((()=>import("./AddressRoutes-B2KIG7En.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),tt=l((()=>t((()=>import("./PeopleRoutes-Cwuko2wK.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CxkAljmn.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-D_6fNZiA.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),ot=l((()=>t((()=>import("./VendorsRoutes-CUyxWOUM.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-8oHAjr2u.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),fe=l((()=>t((()=>import("./EntityDetailRoutes-8jxY5Riu.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),it=l((()=>t((()=>import("./DashboardRoutes-Cp_J4k4_.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-BChpGQL2.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),lt=l((()=>t((()=>import("./SettingsRoutes-C3VXjgEl.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-41mQ1voL.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-8seJMANR.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),dt=l((()=>t((()=>import("./TreasuryRoutes-CzmHsChK.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),ct=l((()=>t((()=>import("./TransactionListRoutes-C46bH8Mo.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-Dv5pDzqZ.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),_t=l((()=>t((()=>import("./NotificationRoutes-CgDlCmJS.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),ht=l((()=>t((()=>import("./PerformanceRoutes-Cpl-d1r4.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-BLGJhe2d.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),pt=l((()=>t((()=>import("./RewardsRoutes-BXExREiG.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-CP206xuh.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),Rt=l((()=>t((()=>import("./AiCfoScreen-HMy5Y7Mq.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),ye=l((()=>t((()=>import("./CardsAiCfoScreen-DO_y52lp.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),C=l((()=>t((()=>import("./NotFoundScreen-D8y3QSjF.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-DbBL-EqC.js").then((o=>o.f))),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function St({setTenantEmailDomain:o}){const T=Hs(),V=Bs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:w,clearAllLoading:v,clearLoading:k}=Zs(),A=b.getSignedInUserTenant(i)?.tenantId,I=b.getSignedInUser(),se=ls(I),$=Ss(),[H,Oe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Pe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Le}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),f=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||f==="Completed"?ds(ne,r):void 0,J=j==="Completed"||f==="Completed"?cs(r):void 0,ke=Ys(r,Le,ne),{isCardsHidden:He}=Ws(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Ve}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=b.getSignedInUserTenant(i);I!=null&&n!=null&&Ae(I,r,L)}const Z={tenantId:A,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=hs(E?.loggedInUserRoleMap),oe=je("/:tenantEmailDomain/onboarding/*")!==null,X=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{w(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(X!=null&&A!=null){const n=X.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Rs();c.isAfter(S,"month")===!1?T(gs(A,{month:d,year:s})):V("./month_end_close_checks/review")}}}}),[X,A]),O.useEffect((()=>{H||(Oe(!0),w(F.TENANT_FETCHING))}),[H,Z,ae,I,T,b]),O.useLayoutEffect((()=>{!Is(ae,Z)&&b.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s){if(xe(D?.userId,D?.zeniSessionId,n.tenantId),d(Ls(!0)),d(Re(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=b.getSignedInUserTenantWithId(n.tenantId);s&&Te.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,I,T,Me))}),[A]),O.useEffect((()=>{b.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s,c,S,B){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){B(Re(s));const q=b.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(Ie(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(ge(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(Ie(c.userId,s)));if(W){Q.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),B(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(pe(c.userId,c.zeniSessionId)))}})(f,j,r,A,I,w,T))}),[A,j]),O.useEffect((()=>{b.isSignedIn()&&f==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),b.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&Ae(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,f,r,I]),O.useEffect((()=>{j==="In-Progress"&&w(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&A!=null?(v(),_.markActiveTenantFetchCompleted(A)):j==="Error"&&A!=null&&(_.markActiveTenantFetchFailed(A),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[j,f,A,H]);const re=O.useRef(!1);O.useEffect((()=>{!re.current&&j==="Completed"&&H&&(re.current=!0,(function(n=Qs,D=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),D)})())}),[j,H]);const U=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=N(z.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),ie=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,le=!Be&&!U,$e=As(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,We=r.externalConnections?.fetchState==="Completed",ue=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,ce=de&&fs(E?.loggedInUserRoleMap),me=Pe&&!U,qe=Fe&&!U,Je=ie&&Ds(E?.loggedInUserRoleMap),Ke=le&&bs(E?.loggedInUserRoleMap),Xe=me&&ys(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=ws(E?.loggedInUserRoleMap),ts=Us(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),_e=ie&&p,he=de&&x,R=me&&ss,g=qe&&ts,m=le&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ne===!0||$e===!0||Qe===!0||es===!0;return b.isSignedIn()?A==null?f==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&f!=="In-Progress"&&T(pe(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||f==="Completed"?(ue===!0||se&&!oe)&&We&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!H||ue!==!1||oe||se?H&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&U===!1||Ge||ze?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&U===!1?e.jsx(ct,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&U===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&U===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||ce||Xe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:R?e.jsx(ut,{}):e.jsx(C,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(C,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&U===!1?e.jsx(Et,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Se?e.jsx(ot,{}):e.jsx(C,{})}),e.jsx(a,{path:"bill/*",element:_e?e.jsx(De,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:_e?e.jsx(De,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:he?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:he?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Ve?e.jsx(lt,{hasAdminLevelAccess:ce}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(C,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(pt,{}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(Rt,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"*",element:e.jsx(C,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:w,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(w===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):V?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:V,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:w,tenantEmailDomain:v})=>{if(L===!0){if(o)return e.jsx(ve,{tenantEmailDomain:v});if(i)return e.jsx(Ce,{tenantEmailDomain:v});if(w)return e.jsx(we,{tenantEmailDomain:v})}return o?e.jsx(ve,{tenantEmailDomain:v}):i?e.jsx(Ce,{tenantEmailDomain:v}):w?e.jsx(we,{tenantEmailDomain:v}):T?e.jsx(Tt,{tenantEmailDomain:v}):V?e.jsx(jt,{tenantEmailDomain:v}):e.jsx(C,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),Ce=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CgelQ0B8.js","assets/sentry-BtWdTNDK.js","assets/core-4nWRIid2.js","assets/zeni-epic-state-Brhydpej.js","assets/index-qYSCKekz.js","assets/mui-ChRNPf14.js","assets/analytics-CP-wGaZJ.js","assets/utils-BGj88Dzy.js","assets/withTransactionSidePanel-DIWgh7V_.js","assets/useAskAiCfoHostNavButtonProps-yAJW2Zxp.js","assets/TransactionDetailScreen-Dyormtjy.js","assets/decodeURIComponentSafe-B-9vw5Be.js","assets/routePaths-TA66BJgf.js","assets/NotFoundScreen-B6nbKEPc.js","assets/useInitialThreadRequest-BeFUEHq1.js","assets/analyticsHelper-CBp9b8VI.js","assets/CompanyPassportScreen-DpwDdQJT.js","assets/MobileAppDrawer-hdYoVCXp.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DqLJLw_b.js","assets/FeaturePreviewScreen-BKTS5XLx.js","assets/index-Cx4f0JbF.css","assets/BillPayRoutes-CC8ojAoZ.js","assets/AddressScreen-Ba-VvOjK.js","assets/DomesticWireDetailScreen-CQmjKCQc.js","assets/DrawerScreen-D1JpfIY3.js","assets/SetupPagesScreen-D2lEnwjt.js","assets/BusinessVerificationPageScreen-BZk1AoM_.js","assets/BillPayApprovalRoutes-GlLqvwOB.js","assets/ReimbursementApprovalRuleDetailScreen-Dgh8Yquq.js","assets/getLocaleForTenant-BhD_5oG2.js","assets/ReimbursementRoutes-DoahH0o8.js","assets/ReimbursementApprovalRoutes-62K0ZFMF.js","assets/TransactionListRoutes-BHh4uWIi.js","assets/ZeniAccountStatementScreen-rGHf8AJK.js","assets/SettingsRoutes-CmZf5R1j.js","assets/accountMappingHelper-Cg1rcuy8.js","assets/useEmailConnectResultRefresh-DnMJ5jdi.js","assets/QBOConnectionScreen-CCcDJEqP.js","assets/empty-dwCpPdyI.js","assets/index-DmHtkhiK.js","assets/url-CUWwwyN4.js","assets/index-ot86Rern.js","assets/ReportsRoutes-BRx0lkFY.js","assets/ChargeCardRoutes-CEOawkX4.js","assets/useChargeCardPusherEvents-CFucNvvU.js","assets/PeopleRoutes-DXDqmyhJ.js","assets/ExpenseAutomationRoutes-Qm3X_H6K.js","assets/TreasuryRoutes-BdMeVeBd.js","assets/useCashManagementBanner-Dbz53g9T.js","assets/VendorsRoutes-xEmDK5qc.js","assets/pathToGoBack-DjzKcd4A.js","assets/ZeniAccountRoutes-X8MXJuIg.js","assets/AddressRoutes-C9ePPZTc.js","assets/PandLWithForecastRoutes-BBHF28-E.js","assets/CustomerOnboardingRoutes-Dxrd_oMn.js","assets/TransactionDetailRoutes-B4V40VOl.js","assets/EntityDetailRoutes-Dzsfy19y.js","assets/NotificationRoutes-Ds6eCL2b.js","assets/PerformanceRoutes-BaKOjCPx.js","assets/RewardsRoutes-CXoqy3I2.js","assets/TaskRoutes-DpRNRovH.js","assets/TaskListScreen-B0fkcObi.js","assets/AiCfoScreen-BVHcwn1-.js","assets/CardsAiCfoScreen-DdtKtE2m.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as ls,e$ as us,fI as ds,fG as cs,gq as ms,fv as _s,cX as Ee,cD as hs,fY as Es,cv as ps,bE as xs,bo as Rs,g0 as gs,v as Is,Ms as js,bs as Ts,Mt as As,bK as fs,bJ as Ds,bt as bs,cr as ys,Mu as Cs,Mv as vs,cT as ws,cW as Us,cV as Os,cC as Ps,cJ as Fs,ok as pe,fE as xe,gA as Ls,g4 as Re,gx as ge,gy as Ie,g5 as ks}from"./zeni-epic-state-Brhydpej.js";import{j as e}from"./liveblocks-BqtYq8PY.js";import{a as O}from"./sentry-BtWdTNDK.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-4nWRIid2.js";import{E as Ms,u as Zs,z as b,w as Gs,c as zs,R as $s,i as z,d as Ys,g as Ws,D as qs,L as F,a as Te,t as _,P as Js,e as Q,l}from"./index-qYSCKekz.js";import"./mui-ChRNPf14.js";import{f as Ae}from"./analyticsHelper-CBp9b8VI.js";import{t as Ks}from"./getLocaleForTenant-BhD_5oG2.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="e40b1320-bdf9-41d8-95c3-9bf073a04bd2",o._sentryDebugIdIdentifier="sentry-dbid-e40b1320-bdf9-41d8-95c3-9bf073a04bd2")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-CgelQ0B8.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-CC8ojAoZ.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-DoahH0o8.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-BHh4uWIi.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-CmZf5R1j.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-BRx0lkFY.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-CEOawkX4.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-DXDqmyhJ.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-Qm3X_H6K.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-BdMeVeBd.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-xEmDK5qc.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-X8MXJuIg.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-BRx0lkFY.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),st=l((()=>t((()=>import("./AddressRoutes-C9ePPZTc.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),tt=l((()=>t((()=>import("./PeopleRoutes-DXDqmyhJ.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-BBHF28-E.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-Dxrd_oMn.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),ot=l((()=>t((()=>import("./VendorsRoutes-xEmDK5qc.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-B4V40VOl.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),fe=l((()=>t((()=>import("./EntityDetailRoutes-Dzsfy19y.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),it=l((()=>t((()=>import("./DashboardRoutes-CgelQ0B8.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-CC8ojAoZ.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),lt=l((()=>t((()=>import("./SettingsRoutes-CmZf5R1j.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-DoahH0o8.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-X8MXJuIg.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),dt=l((()=>t((()=>import("./TreasuryRoutes-BdMeVeBd.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),ct=l((()=>t((()=>import("./TransactionListRoutes-BHh4uWIi.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-CEOawkX4.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),_t=l((()=>t((()=>import("./NotificationRoutes-Ds6eCL2b.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),ht=l((()=>t((()=>import("./PerformanceRoutes-BaKOjCPx.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-Qm3X_H6K.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),pt=l((()=>t((()=>import("./RewardsRoutes-CXoqy3I2.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-DpRNRovH.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),Rt=l((()=>t((()=>import("./AiCfoScreen-BVHcwn1-.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),ye=l((()=>t((()=>import("./CardsAiCfoScreen-DdtKtE2m.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),C=l((()=>t((()=>import("./NotFoundScreen-B6nbKEPc.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-B0fkcObi.js").then((o=>o.f))),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function St({setTenantEmailDomain:o}){const T=Hs(),V=Bs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:w,clearAllLoading:v,clearLoading:k}=Zs(),A=b.getSignedInUserTenant(i)?.tenantId,I=b.getSignedInUser(),se=ls(I),$=Ss(),[H,Oe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Pe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Le}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),f=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||f==="Completed"?ds(ne,r):void 0,J=j==="Completed"||f==="Completed"?cs(r):void 0,ke=Ys(r,Le,ne),{isCardsHidden:He}=Ws(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Ve}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=b.getSignedInUserTenant(i);I!=null&&n!=null&&Ae(I,r,L)}const Z={tenantId:A,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=hs(E?.loggedInUserRoleMap),oe=je("/:tenantEmailDomain/onboarding/*")!==null,X=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{w(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(X!=null&&A!=null){const n=X.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Rs();c.isAfter(S,"month")===!1?T(gs(A,{month:d,year:s})):V("./month_end_close_checks/review")}}}}),[X,A]),O.useEffect((()=>{H||(Oe(!0),w(F.TENANT_FETCHING))}),[H,Z,ae,I,T,b]),O.useLayoutEffect((()=>{!Is(ae,Z)&&b.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s){if(xe(D?.userId,D?.zeniSessionId,n.tenantId),d(Ls(!0)),d(Re(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=b.getSignedInUserTenantWithId(n.tenantId);s&&Te.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,I,T,Me))}),[A]),O.useEffect((()=>{b.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s,c,S,B){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){B(Re(s));const q=b.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(Ie(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(ge(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(Ie(c.userId,s)));if(W){Q.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),B(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(pe(c.userId,c.zeniSessionId)))}})(f,j,r,A,I,w,T))}),[A,j]),O.useEffect((()=>{b.isSignedIn()&&f==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),b.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&Ae(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,f,r,I]),O.useEffect((()=>{j==="In-Progress"&&w(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&A!=null?(v(),_.markActiveTenantFetchCompleted(A)):j==="Error"&&A!=null&&(_.markActiveTenantFetchFailed(A),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[j,f,A,H]);const re=O.useRef(!1);O.useEffect((()=>{!re.current&&j==="Completed"&&H&&(re.current=!0,(function(n=Qs,D=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),D)})())}),[j,H]);const U=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=N(z.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),ie=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,le=!Be&&!U,$e=As(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,We=r.externalConnections?.fetchState==="Completed",ue=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,ce=de&&fs(E?.loggedInUserRoleMap),me=Pe&&!U,qe=Fe&&!U,Je=ie&&Ds(E?.loggedInUserRoleMap),Ke=le&&bs(E?.loggedInUserRoleMap),Xe=me&&ys(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=ws(E?.loggedInUserRoleMap),ts=Us(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),_e=ie&&p,he=de&&x,R=me&&ss,g=qe&&ts,m=le&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ne===!0||$e===!0||Qe===!0||es===!0;return b.isSignedIn()?A==null?f==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&f!=="In-Progress"&&T(pe(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||f==="Completed"?(ue===!0||se&&!oe)&&We&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!H||ue!==!1||oe||se?H&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&U===!1||Ge||ze?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&U===!1?e.jsx(ct,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&U===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&U===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||ce||Xe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:R?e.jsx(ut,{}):e.jsx(C,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(C,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&U===!1?e.jsx(Et,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Se?e.jsx(ot,{}):e.jsx(C,{})}),e.jsx(a,{path:"bill/*",element:_e?e.jsx(De,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:_e?e.jsx(De,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:he?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:he?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Ve?e.jsx(lt,{hasAdminLevelAccess:ce}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(C,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(pt,{}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(Rt,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"*",element:e.jsx(C,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:w,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(w===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):V?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:V,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:w,tenantEmailDomain:v})=>{if(L===!0){if(o)return e.jsx(ve,{tenantEmailDomain:v});if(i)return e.jsx(Ce,{tenantEmailDomain:v});if(w)return e.jsx(we,{tenantEmailDomain:v})}return o?e.jsx(ve,{tenantEmailDomain:v}):i?e.jsx(Ce,{tenantEmailDomain:v}):w?e.jsx(we,{tenantEmailDomain:v}):T?e.jsx(Tt,{tenantEmailDomain:v}):V?e.jsx(jt,{tenantEmailDomain:v}):e.jsx(C,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),Ce=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-BqtYq8PY.js";import{a as u}from"./sentry-BtWdTNDK.js";import{h as z,g as G,u as M,j as y,s as le,n as H,i as Z,o as ne,p as v}from"./core-4nWRIid2.js";import{bn as De,e$ as j,gv as Re,na as re,ON as Te,hL as he,OE as Me,rd as Ue,kI as be,n6 as _e,hN as Fe,OG as Oe,OF as Be,R4 as Ve,zI as Le,F9 as ze,QF as Ne,QO as $e,c7 as ae,cO as Ge,cP as He,bs as Ze,MF as Ke,y8 as Qe,R5 as Je,HA as Xe,ER as qe,EI as ye,EF as We,yc as Se,EL as Ce,EO as Ie,EU as oe,uy as se,yb as Ye,kk as q,kn as Ae,R6 as en,lo as nn,yr as tn,Nw as an,Nx as on,ki as sn,R7 as cn,kl as ln,rH as rn,Nr as dn,Ns as un,rL as pn,hw as gn,MN as ee,ho as de,hl as mn,ht as fn,MO as hn,yo as bn,R8 as yn,R9 as Sn,F6 as Cn,fG as Ee,fI as xe,Ra as In,gj as An,MX as En,yn as ue,go as pe,gn as xn,ym as vn,gm as wn,gl as kn,Rb as Pn,fL as ve,Rc as jn,Rd as Dn,yu as Rn,yl as ge,Re as Tn,f$ as Mn,yi as Un,b_ as _n,c6 as Fn,c5 as On,b$ as Bn,c3 as Vn,c2 as Ln,c1 as zn,c4 as Nn,c0 as $n}from"./zeni-epic-state-Brhydpej.js";import{w as W,i as B,z as k,ag as we,bR as Gn,e as K,h as Hn,bC as Zn,D as Q,C as ie,bS as Kn,d as ke,g as Pe,bT as Qn,ar as Jn,m as je,bU as Xn,bV as qn,bW as Wn,_ as Yn,bX as et,x as nt,bY as tt}from"./index-
|
|
1
|
+
import{j as o}from"./liveblocks-BqtYq8PY.js";import{a as u}from"./sentry-BtWdTNDK.js";import{h as z,g as G,u as M,j as y,s as le,n as H,i as Z,o as ne,p as v}from"./core-4nWRIid2.js";import{bn as De,e$ as j,gv as Re,na as re,ON as Te,hL as he,OE as Me,rd as Ue,kI as be,n6 as _e,hN as Fe,OG as Oe,OF as Be,R4 as Ve,zI as Le,F9 as ze,QF as Ne,QO as $e,c7 as ae,cO as Ge,cP as He,bs as Ze,MF as Ke,y8 as Qe,R5 as Je,HA as Xe,ER as qe,EI as ye,EF as We,yc as Se,EL as Ce,EO as Ie,EU as oe,uy as se,yb as Ye,kk as q,kn as Ae,R6 as en,lo as nn,yr as tn,Nw as an,Nx as on,ki as sn,R7 as cn,kl as ln,rH as rn,Nr as dn,Ns as un,rL as pn,hw as gn,MN as ee,ho as de,hl as mn,ht as fn,MO as hn,yo as bn,R8 as yn,R9 as Sn,F6 as Cn,fG as Ee,fI as xe,Ra as In,gj as An,MX as En,yn as ue,go as pe,gn as xn,ym as vn,gm as wn,gl as kn,Rb as Pn,fL as ve,Rc as jn,Rd as Dn,yu as Rn,yl as ge,Re as Tn,f$ as Mn,yi as Un,b_ as _n,c6 as Fn,c5 as On,b$ as Bn,c3 as Vn,c2 as Ln,c1 as zn,c4 as Nn,c0 as $n}from"./zeni-epic-state-Brhydpej.js";import{w as W,i as B,z as k,ag as we,bR as Gn,e as K,h as Hn,bC as Zn,D as Q,C as ie,bS as Kn,d as ke,g as Pe,bT as Qn,ar as Jn,m as je,bU as Xn,bV as qn,bW as Wn,_ as Yn,bX as et,x as nt,bY as tt}from"./index-qYSCKekz.js";import{n as V}from"./mui-ChRNPf14.js";import{M as F}from"./MobileAppDrawer-hdYoVCXp.js";import{a as J,g as X,m as at}from"./accountMappingHelper-Cg1rcuy8.js";import{t as ot,A as st}from"./AddressScreen-Ba-VvOjK.js";import $ from"./NotFoundScreen-B6nbKEPc.js";import{g as it}from"./analyticsHelper-CBp9b8VI.js";import{B as ct}from"./BusinessVerificationPageScreen-BZk1AoM_.js";import{C as lt}from"./CompanyPassportScreen-DpwDdQJT.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-DnMJ5jdi.js";import{q as me}from"./QBOConnectionScreen-CCcDJEqP.js";import{B as ut}from"./BillPayApprovalRoutes-GlLqvwOB.js";import{R as pt}from"./ReimbursementApprovalRoutes-62K0ZFMF.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./routePaths-TA66BJgf.js";import"./empty-dwCpPdyI.js";import"./pdf-lib-xuF5byC3.js";import"./index-DmHtkhiK.js";import"./url-CUWwwyN4.js";import"./index-ot86Rern.js";import"./decodeURIComponentSafe-B-9vw5Be.js";import"./ReimbursementApprovalRuleDetailScreen-Dgh8Yquq.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]="a4a41e84-1c6c-4da4-bb5b-4fdf95039b29",e._sentryDebugIdIdentifier="sentry-dbid-a4a41e84-1c6c-4da4-bb5b-4fdf95039b29")}catch{}})();const gt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-BqtYq8PY.js";import{h as X,g as ee,u as ne,i as G,j as P,N as x,n as H,t as en}from"./core-4nWRIid2.js";import{bJ as nn,cr as Ce,Qt as ye,e$ as V,cD as tn,zY as Q,zI as an,QF as sn,QI as on,r_ as te,rO as ae,lg as ie,u4 as z,QK as Ie,gn as $e,gm as Ge,gl as He,QL as cn,A5 as rn,ER as Ae,EI as ke,EF as _e,En as J,EL as ve,EO as Ee,EU as Pe,uy as Te,gC as un,cy as dn,fI as ln,fG as pn,fH as mn,bt as yn,QM as fn,Dn as le,D$ as gn,QN as Sn,bK as bn,G8 as pe,F9 as hn,QO as Cn,QP as In,Gc as An,Gg as kn,tZ as _n,KO as vn,GN as he,HN as me,QQ as En,QR as Pn,QS as Tn,QT as We,QU as wn,Nf as Dn,PV as Un,Nu as On,QV as Ke,Er as Fn,Nv as Vn,Ev as Bn,QW as Oe,H7 as qe,lo as xn,rR as Je,u6 as jn,bE as Re,ui as Ne,cB as Rn,QX as Ye,f_ as Nn,Gv as zn,Gz as Ln,QY as Mn,GQ as ze,QZ as Zn,Q_ as Qn,Q$ as $n,R0 as Gn,gv as Hn,Bg as Wn,R1 as Kn,Bl as qn,Bk as Jn}from"./zeni-epic-state-Brhydpej.js";import{D as se,w as oe,i as q,E as we,aS as Y,bC as Xe,z as U,Z as ce,e as O,C as De,h as $,bD as Yn,au as re,bE as B,bF as Xn,bG as et,ag as xe,bH as nt,x as Le,av as Me,J as tt,G as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-
|
|
1
|
+
import{j as u}from"./liveblocks-BqtYq8PY.js";import{h as X,g as ee,u as ne,i as G,j as P,N as x,n as H,t as en}from"./core-4nWRIid2.js";import{bJ as nn,cr as Ce,Qt as ye,e$ as V,cD as tn,zY as Q,zI as an,QF as sn,QI as on,r_ as te,rO as ae,lg as ie,u4 as z,QK as Ie,gn as $e,gm as Ge,gl as He,QL as cn,A5 as rn,ER as Ae,EI as ke,EF as _e,En as J,EL as ve,EO as Ee,EU as Pe,uy as Te,gC as un,cy as dn,fI as ln,fG as pn,fH as mn,bt as yn,QM as fn,Dn as le,D$ as gn,QN as Sn,bK as bn,G8 as pe,F9 as hn,QO as Cn,QP as In,Gc as An,Gg as kn,tZ as _n,KO as vn,GN as he,HN as me,QQ as En,QR as Pn,QS as Tn,QT as We,QU as wn,Nf as Dn,PV as Un,Nu as On,QV as Ke,Er as Fn,Nv as Vn,Ev as Bn,QW as Oe,H7 as qe,lo as xn,rR as Je,u6 as jn,bE as Re,ui as Ne,cB as Rn,QX as Ye,f_ as Nn,Gv as zn,Gz as Ln,QY as Mn,GQ as ze,QZ as Zn,Q_ as Qn,Q$ as $n,R0 as Gn,gv as Hn,Bg as Wn,R1 as Kn,Bl as qn,Bk as Jn}from"./zeni-epic-state-Brhydpej.js";import{D as se,w as oe,i as q,E as we,aS as Y,bC as Xe,z as U,Z as ce,e as O,C as De,h as $,bD as Yn,au as re,bE as B,bF as Xn,bG as et,ag as xe,bH as nt,x as Le,av as Me,J as tt,G as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-qYSCKekz.js";import{a as h}from"./sentry-BtWdTNDK.js";import{n as Fe,D as rt,S as ut}from"./mui-ChRNPf14.js";import{M as fe}from"./MobileAppDrawer-hdYoVCXp.js";import N from"./NotFoundScreen-B6nbKEPc.js";import{a as Ze}from"./analyticsHelper-CBp9b8VI.js";import{d as Qe}from"./routePaths-TA66BJgf.js";import{B as Ue}from"./BusinessVerificationPageScreen-BZk1AoM_.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]="7d577e03-8d2e-431e-a125-6e1f0b7f71d1",e._sentryDebugIdIdentifier="sentry-dbid-7d577e03-8d2e-431e-a125-6e1f0b7f71d1")}catch{}})();const dt=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-BqtYq8PY.js";import{a as f,b as M,q as A}from"./sentry-BtWdTNDK.js";import{u as T,h as z,j as d,g as D,N as j,n as O}from"./core-4nWRIid2.js";import{u as P,z as s,E as _,e as w,a as F,f as B,h as N,j as $,k as q,q as V,m as v}from"./index-
|
|
1
|
+
import{j as u}from"./liveblocks-BqtYq8PY.js";import{a as f,b as M,q as A}from"./sentry-BtWdTNDK.js";import{u as T,h as z,j as d,g as D,N as j,n as O}from"./core-4nWRIid2.js";import{u as P,z as s,E as _,e as w,a as F,f as B,h as N,j as $,k as q,q as V,m as v}from"./index-qYSCKekz.js";import{e$ as J,Mr as W,Ms as Z,fE as G,g4 as H,Mx as K,gu as Q,c_ as R,My as b,Mz as X,MA as Y,bZ as y}from"./zeni-epic-state-Brhydpej.js";import"./mui-ChRNPf14.js";import{u as ee}from"./useDeviceId-BVGc_c85.js";import{f as te}from"./analyticsHelper-CBp9b8VI.js";import{t as ne}from"./getLocaleForTenant-BhD_5oG2.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="8afcf5e0-476e-428a-ab3c-57d4a36c271c",t._sentryDebugIdIdentifier="sentry-dbid-8afcf5e0-476e-428a-ab3c-57d4a36c271c")}catch{}})();const ie=O((function(t,i){const c=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:c,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:c,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(c.state!=null?c.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=c.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(b())}}}))(V),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=T(),c=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=d((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:E,accountLocked:x,accountUnlockTime:h}=d((e=>e.tenantState)),p=d((e=>e.tenantState.fetchState)),L=d((e=>e.tenantState.activeTenantFetchState.fetchState)),S=d((e=>e.tenantState.signInState)),o=d((e=>e.tenantState.loggedInUser)),r=d((e=>J(e))),I=d((e=>W(e))),m=D(),k=_().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{E.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[E.fetchState,l]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(Z(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,k,void 0,I.tenantsInOrder),Q().then((()=>{const e=q();e!=null&&B(e)})),setTimeout((()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,L,o,r,I,k,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(j,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:c,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&h!=null?u.jsx($,{onClose:()=>i(b()),unlockDate:h}):null]})}export{ve as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BqtYq8PY.js";import{a as i}from"./sentry-BtWdTNDK.js";import{u as l,g as d,N as u}from"./core-4nWRIid2.js";import{z as n,e as a,h as m,C as p}from"./index-
|
|
1
|
+
import{j as s}from"./liveblocks-BqtYq8PY.js";import{a as i}from"./sentry-BtWdTNDK.js";import{u as l,g as d,N as u}from"./core-4nWRIid2.js";import{z as n,e as a,h as m,C as p}from"./index-qYSCKekz.js";import{gz as g,MP as b}from"./zeni-epic-state-Brhydpej.js";import{n as y}from"./mui-ChRNPf14.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="95188a4e-56e6-4fe3-9dcb-8b6b338c2754",e._sentryDebugIdIdentifier="sentry-dbid-95188a4e-56e6-4fe3-9dcb-8b6b338c2754")}catch{}})();function L(){const e=l(),t=d(),r=i.useRef(!1),c=n.isSignedIn(),o=t.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as G}from"./liveblocks-BqtYq8PY.js";import{a as f}from"./sentry-BtWdTNDK.js";import{h as pe,u as Te,g as fe,k as ge,j as F,i as _e,n as me}from"./core-4nWRIid2.js";import{az as De,aA as be,z as x,w as Se,i as C,a0 as he,Z as Ee,e as ye,h as Ae,dd as Ge,x as w,v as Ce}from"./index-
|
|
1
|
+
import{j as G}from"./liveblocks-BqtYq8PY.js";import{a as f}from"./sentry-BtWdTNDK.js";import{h as pe,u as Te,g as fe,k as ge,j as F,i as _e,n as me}from"./core-4nWRIid2.js";import{az as De,aA as be,z as x,w as Se,i as C,a0 as he,Z as Ee,e as ye,h as Ae,dd as Ge,x as w,v as Ce}from"./index-qYSCKekz.js";import{e$ as Ie,Um as H,JA as U,Un as X,Ui as Ue,IY as M,Uo as Be,J4 as q,IG as ve,Ii as Ke,JB as V,Up as W,fD as Le,Jr as we,Jw as Re,Jj as Pe,Jh as Q,Jx as Fe,Je as je,Uq as xe,Ur as $e,Us as Ne,Ut as Oe,Uu as I,da as Je,d9 as ze,Uv as Ze,IE as Me}from"./zeni-epic-state-Brhydpej.js";import{n as qe}from"./mui-ChRNPf14.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-yAJW2Zxp.js";import{M as We}from"./MobileAppDrawer-hdYoVCXp.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="12c4fd78-8ef8-44a2-9e52-e448cd9b5ea6",a._sentryDebugIdIdentifier="sentry-dbid-12c4fd78-8ef8-44a2-9e52-e448cd9b5ea6")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},Qe=(a,e)=>a==null||a===""?[]:e.map((n=>`private-encrypted-${a}.${n}`)),Ye=(a,e)=>a==null||a===""?[]:e.map((n=>`private-encrypted-${a}.${n}`)),R=a=>Array.isArray(a)&&a.every((e=>typeof e=="string")),He=a=>{if(a==null||typeof a!="object")return null;const e=a,n=typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null;if(n==null||typeof e.tenant_id!="string"||typeof e.event_type!="string")return null;const r={task_id:n,tenant_id:e.tenant_id,event_type:e.event_type};return typeof e.is_private=="boolean"&&(r.is_private=e.is_private),R(e.assignees)&&(r.assignees=e.assignees),R(e.direct_assignees)&&(r.direct_assignees=e.direct_assignees),typeof e.created_by=="string"&&(r.created_by=e.created_by),R(e.task_group_ids)&&(r.task_group_ids=e.task_group_ids),typeof e.name=="string"&&(r.name=e.name),typeof e.parent_task_id=="string"&&(r.parent_task_id=e.parent_task_id),r},Xe=a=>{if(a==null||typeof a!="object")return null;const e=a;return R(e.task_ids)?{task_ids:e.task_ids}:null},pa=a=>{if(a==null||typeof a!="object")return null;const e=a;return typeof e.task_id!="string"?null:{task_id:e.task_id}},ea=a=>{const{events:e,onEvent:n,onSubscribed:r}=a,i=De(),g=f.useRef(n),l=f.useRef(r),_=f.useRef(0);f.useEffect((()=>{g.current=n}),[n]),f.useEffect((()=>{l.current=r}),[r]);const t=f.useMemo((()=>[...e].sort().join("|")),[e]);f.useEffect((()=>{if(i==null||e.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return e.forEach((m=>{const[D,b]=be(m);if(b==="")return;const E=i.channel(D),y=T=>{g.current(b,T)};let k;if(E?.subscribed===!0){if(k=E,k.bind(b,y),!p.has(D)){p.add(D),S();const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{E.unbind(b,y)}))}else{if(k=E??i.subscribe(D),k.bind(b,y),!p.has(D)){p.add(D);const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{k.unbind(b,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},aa=qe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-BqtYq8PY.js";import ue from"./NotFoundScreen-
|
|
1
|
+
import{j as r}from"./liveblocks-BqtYq8PY.js";import ue from"./NotFoundScreen-B6nbKEPc.js";import{a as k}from"./sentry-BtWdTNDK.js";import{h as H,u as ee,j as b,g as de,i as ke,N as pe,n as me,o as Se,p as I}from"./core-4nWRIid2.js";import{Iv as ae,Iy as fe,Is as Te,Uh as ge,e$ as te,Ui as se,IU as g,IM as T,Ip as he,Jo as Ie,Jh as be,Uj as ne,fD as oe,Uk as J,Il as Ee,Ii as De,r_ as Ce,rO as Ge,lg as Ue,IK as _e,Ul as Be,JB as Re,IG as xe,J3 as ye,J0 as ve,IB as we,IZ as Ae,IY as je}from"./zeni-epic-state-Brhydpej.js";import{z as _,db as Pe,A as Fe,w as Le,i as G,v as ie,x as U,Z as Ke,e as M,h as $e,dc as Ne,m as q,au as Oe}from"./index-qYSCKekz.js";import{n as Ze}from"./mui-ChRNPf14.js";import{u as ze}from"./useInitialThreadRequest-BeFUEHq1.js";import{M as Ve}from"./MobileAppDrawer-hdYoVCXp.js";import{b as Je,a as Me,u as qe,T as f,t as Ye,c as Y,d as Q,e as Qe}from"./TaskListScreen-B0fkcObi.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./useAskAiCfoHostNavButtonProps-yAJW2Zxp.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]="8a86ad2f-92cf-4136-9e59-452592646b41",e._sentryDebugIdIdentifier="sentry-dbid-8a86ad2f-92cf-4136-9e59-452592646b41")}catch{}})();function We(){const e=H(),a=ee(),n=_.getSignedInUser(),{cannedResponses:l,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,E,D)=>{a(fe({name:o,content:E,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Pe,{cannedResponses:l,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,P=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Xe=ge([P,(e,a)=>{const n=P(e,a),l=L(e);if(n!=null&&l!=null)return l[n]?.name},(e,a)=>{const n=P(e,a),l=L(e);return n!=null&&l!=null&&l[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let W,X=[];const He=me((function(e,a){const{location:n,taskGroupId:l}=a,s=ne(e,a.taskId),u=te(e),d=Xe(e,a.taskId),m=s.taskGroupId??l,t=m!=null?J(e.taskGroupState,m):void 0,o=_.getSignedInUser(),E=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:E??""},y=se(e),{tenantEmailDomain:v}=u,B=s.recurringSourceTaskId,w=B!=null?`${q.appUrl}/${v}/tasks/${encodeURIComponent(B)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:_.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==W&&(W=h,X=Object.values(h)),X),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Oe.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${q.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:y,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>J(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:l,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(je({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(Ae(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(we(a.taskId))},onSnoozeTask:(t,o)=>{e(ve(t,o))},onUnsnoozeTask:t=>{e(ye(t))},onCreateSubtask:(t,o)=>{e(xe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Re({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{l(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:U(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{l(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:U(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";l(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=x(m),o=U(u.state?.pathnameStackToGoBack,u.pathname);l(t,{state:{pathnameStackToGoBack:o}})}e(Be({taskId:n}))},onDeleteTaskClick:()=>{e(_e(n))},updateFilesEntity:t=>{e(Ue({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ee(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{l(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ne);function F(){const e=H(),a=ee(),n=de(),l=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((i=>te(i))),m=ze(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:E}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:y}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:v}=t(G.isTaskGroupAssigneesEnabled),[B,w]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[$,A]=k.useState(!1),C=k.useRef(!1),R=b((i=>i.taskListState.updateTasksFetchState.fetchState)),N=b((i=>se(i))),O=b((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const Z=_.getSignedInUser()?.userId,le=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],c=[...i,f.TASK_SNOOZE_RESURFACED];return[...Je(d?.tenantId,i),...Me(Z,c)]}),[d?.tenantId,Z]);qe({events:le,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,c)=>{if(s!=null)switch(i){case f.TASK_CREATED:{Q(c)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=Q(c);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=Y(c);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=Y(c);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(x(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Ye(c)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||N.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,N.fetchState]),k.useEffect((()=>{K||O==="Completed"||(re(!0),a(Ie()))}),[K,a,O]);const ce=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),A(!0))}),[a,s]);k.useEffect((()=>{if($)if(R!=="In-Progress"){if(C.current){if(R==="Error")return A(!1),void(C.current=!1);if(R==="Completed"){A(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const c=ie(n.state?.pathnameStackToGoBack);e(c.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:c.newStack}})}else{const c=x(i);e(c,{state:{pathnameStackToGoBack:U(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,R,d,n,e]);const z=b((i=>ne(i,s))),j=z.fetchState,V=_.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&z.error?.code===400){const{tenantEmailDomain:i}=d,c=x(i),p=U(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:c,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(Ke,{analytics:M,onLoad:i=>(c=>c.trackPageLoaded($e.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(Ve,{isAppContentDrawerOpen:B,handleDrawerToggle:i=>{w(i)}}),r.jsx(He,{analytics:M,currentTenant:d,handleZeniLogoClick:()=>{l.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:j,onUnarchiveTaskClick:ce,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:E,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:y,isTaskGroupAssigneesEnabled:v})]})]})}const ea=Ze.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
package/dist/assets/{TransactionDetailRoutes-8oHAjr2u.js → TransactionDetailRoutes-B4V40VOl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-BqtYq8PY.js";import i from"./NotFoundScreen-
|
|
1
|
+
import{j as t}from"./liveblocks-BqtYq8PY.js";import i from"./NotFoundScreen-B6nbKEPc.js";import{T as r}from"./TransactionDetailScreen-Dyormtjy.js";import"./sentry-BtWdTNDK.js";import{o as s,p as o}from"./core-4nWRIid2.js";import"./zeni-epic-state-Brhydpej.js";import"./recharts-UIIeT-6j.js";import"./index-qYSCKekz.js";import"./mui-ChRNPf14.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./useAskAiCfoHostNavButtonProps-yAJW2Zxp.js";import"./decodeURIComponentSafe-B-9vw5Be.js";import"./routePaths-TA66BJgf.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]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|
package/dist/assets/{TransactionDetailScreen-Bfy3N_JT.js → TransactionDetailScreen-Dyormtjy.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as P}from"./liveblocks-BqtYq8PY.js";import{a as c}from"./sentry-BtWdTNDK.js";import{u as $,k as Xe,j as g,s as fe,g as Se,h as Te,i as be,N as Ze,n as Qe}from"./core-4nWRIid2.js";import{nZ as ye,e$ as J,gv as et,ON as tt,na as at,mU as nt,bn as ot,cX as Ee,bs as Ie,ry as H,NM as q,OO as ve,OP as oe,Oa as De,kT as Ce,OQ as ke,Of as se,Og as ie,lI as Ae,KH as ce,NG as j,kN as _e,kL as Oe,kX as st,nM as it,OR as ct,OS as rt,vO as K,kS as Ue,K0 as Pe,cj as lt,c$ as dt,OT as ut,NF as mt,OU as pt,OV as ft,OW as yt,OX as ht,vK as gt,OY as St,OZ as Tt,O_ as bt,O$ as Et,P0 as It,kW as vt,P1 as Dt,P2 as Ct,NH as kt,P3 as At,P4 as _t,P5 as Ot,JW as Ut,JM as Pt,K9 as xt,kY as wt,KI as he,nR as Ft}from"./zeni-epic-state-Brhydpej.js";import{w as Y,i as U,z as xe,aS as we,E as Lt,J as Vt,aT as zt,G as Bt,v as ae,D as Nt,aU as Rt,x as ne,a0 as Mt,aV as Gt,e as Fe,aW as jt,au as $t,a4 as te}from"./index-
|
|
1
|
+
import{j as P}from"./liveblocks-BqtYq8PY.js";import{a as c}from"./sentry-BtWdTNDK.js";import{u as $,k as Xe,j as g,s as fe,g as Se,h as Te,i as be,N as Ze,n as Qe}from"./core-4nWRIid2.js";import{nZ as ye,e$ as J,gv as et,ON as tt,na as at,mU as nt,bn as ot,cX as Ee,bs as Ie,ry as H,NM as q,OO as ve,OP as oe,Oa as De,kT as Ce,OQ as ke,Of as se,Og as ie,lI as Ae,KH as ce,NG as j,kN as _e,kL as Oe,kX as st,nM as it,OR as ct,OS as rt,vO as K,kS as Ue,K0 as Pe,cj as lt,c$ as dt,OT as ut,NF as mt,OU as pt,OV as ft,OW as yt,OX as ht,vK as gt,OY as St,OZ as Tt,O_ as bt,O$ as Et,P0 as It,kW as vt,P1 as Dt,P2 as Ct,NH as kt,P3 as At,P4 as _t,P5 as Ot,JW as Ut,JM as Pt,K9 as xt,kY as wt,KI as he,nR as Ft}from"./zeni-epic-state-Brhydpej.js";import{w as Y,i as U,z as xe,aS as we,E as Lt,J as Vt,aT as zt,G as Bt,v as ae,D as Nt,aU as Rt,x as ne,a0 as Mt,aV as Gt,e as Fe,aW as jt,au as $t,a4 as te}from"./index-qYSCKekz.js";import{n as Wt,S as Ht,D as qt}from"./mui-ChRNPf14.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-yAJW2Zxp.js";import{d as Le}from"./decodeURIComponentSafe-B-9vw5Be.js";import{h as Ve,c as ze,g as Kt,e as Jt}from"./routePaths-TA66BJgf.js";import{u as Xt}from"./utils-BGj88Dzy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="a3219edd-819b-4467-b804-9ed52d55a32b",t._sentryDebugIdIdentifier="sentry-dbid-a3219edd-819b-4467-b804-9ed52d55a32b")}catch{}})();function Zt(t=!0){const e=$(),s=Xe(),{useFeatureGate:a}=Y(),{isFeatureEnabled:n}=a(U.isCreateTransferEntryFromExpenseEnabled);c.useEffect((()=>{if(!t||n!==!0)return;const o=i=>{const r=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(ye({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(ye({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Qt(t,e){const s=(function(){const r=$(),[f,S]=c.useState(!1),[A,h]=c.useState(null),[m,_]=c.useState(null),{useDynamicConfig:b}=Y(),{configValue:y,isDynamicConfigLoading:C}=b("transaction_categorization_config"),I=!C&&y?.capitalization_enabled===!0,k=g((p=>J(p))),E=k.companyId,O=g((p=>et(p.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:x,capitalizableAccountOverrides:V,dismissedAccounts:R}=g((p=>{const T=p.tenantState.currentTenantId,u=T!=null?p.tenantState.tenantsById[T]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),M=c.useRef(x);M.current=x;const z=c.useRef(V);z.current=V;const w=c.useRef(R);w.current=R;const B=g((p=>tt(p.accountState)),fe),N=c.useMemo((()=>{const p={};for(const T of B)T.accountId!=null&&T.accountName!=null&&(p[T.accountId]=T.accountName);return p}),[B]),v=m!=null?N[m]??null:null,l=c.useCallback((p=>{if(!I)return;const T=M.current;if(T==null)return;const u=T.accounts??[],G=new Set(p),X=z.current??{},Z=w.current;for(const F of u)if(G.has(F.accountId)&&X[F.accountId]==null&&Z?.[F.accountId]==null)return h(F.classificationType),_(F.accountId),void S(!0)}),[I]),W=c.useCallback(((p,T)=>{r(at(E,p,T,!0)),S(!1),h(null),_(null)}),[r,E]),D=c.useCallback((()=>{m!=null&&(r(nt(E,m)),S(!1),h(null),_(null))}),[r,E,m]);return{showPopup:f&&I,popupType:A,popupAccountId:m,popupAccountName:v,currencySymbol:O,checkAndShowPopup:l,handleSubmit:W,handleDismiss:D}})(),a=c.useRef(void 0),n=c.useRef([]),o=c.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=c.useRef(e);return i.current=e,c.useEffect((()=>{t==="In-Progress"&&(n.current=i.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=xe.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:s}=e(U.isChainOfThoughtEnabled);return c.useMemo((()=>ot(t)&&s),[t,s])};function Be(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ta(t,e){const s=$(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=g((u=>J(u))),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),f=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:S}=a(U.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(U.isExpenseAutomationEnabled),{configValue:h}=n(we.enableUncategorizedExpenseCategory),m=h?.uncategorized_expense_category_enabled===!0,_=re(),b=c.useMemo((()=>({id:t,type:H(e)})),[t,e]),y=g((u=>q(u,b))),C=y?.transactionDetailUpdateStatus?.fetchState,I=y?.transactionDetailLocalData?.lineItemById,k=g((u=>{const G=q(u,b)?.transactionDetailLocalData.vendorUpdates?.id;return G==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[G]?.saveStatus.fetchState??"Not-Started"})),E=c.useMemo((()=>y?.fetchState==="Completed"?Be(y?.transaction):void 0),[y?.fetchState,y?.transaction]),O=g((u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),x=g((u=>oe(u))),V=g((u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")})),R=o.company?.companyInfo.firstMonthOfFY??1,M=g((u=>Ce(u.accountState,u.accountListState,"accountList"))),[z,w]=c.useState(!1),[B,N]=c.useState(!1),[v,l]=c.useState(!1);c.useEffect((()=>{w(!1),N(!1),l(!1)}),[t,e]);const W=c.useCallback((()=>{w(!1),N(!1)}),[]),[D,p]=c.useState(!1),T=V?.selectedPeriod?.timePeriod;return c.useEffect((()=>{v||y==null||y.transaction==null||(s(ke({id:y.transaction.id,type:y.transaction.type})),l(!0)),E!=null&&(!i||r&&f===!1)&&(z?B||O==null||(N(!0),s(ce(E,"TransactionDetail",{timeframe:"month",timePeriod:T??O}))):(s(se()),s(ie()),w(!0),s(Ae(E))))}),[s,v,y?.fetchState,y?.transaction,E,i,r,f,z,B,O,T]),c.useEffect((()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?p(!0):p(!1)}),[x.newVendorState?.vendorDetailLocalData?.vendorName]),c.useEffect((()=>()=>{s(j("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:f,isVendorBulkUpdateOnTransactionEnabled:S,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:_,selectedTransaction:b,transactionDetail:y,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:O,vendorViewDetails:x,uiState:V,firstMonthOfFY:R,uncategorizedAccounts:M,resetTrendIsFetchedStates:W,isCreateVendorDrawerOpen:D,setIsCreateVendorDrawerOpen:p}}const ea={overlayWidth:new Bt(100,100,58)},ta=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=Lt(),i=Vt(),r=$(),f=g((h=>oe(h))),S=()=>{a()},A={vendorDetailView:n??f,onSaveSuccess:()=>{r(Oe()),r(st("Not-Started")),s()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:h=>{r(_e({vendorId:void 0,localData:h}))}};return P.jsx(qt,{anchor:"right",open:t,PaperProps:{style:{width:ea.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:P.jsx(aa,{onClick:h=>h.stopPropagation(),children:P.jsx(zt,{...A})})})},aa=Wt(Ht)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BqtYq8PY.js";import{h as H,g as N,u as Q,i as W,j as g,N as G,n as Z,o as ve,p as j}from"./core-4nWRIid2.js";import{e$ as U,rd as X,k5 as u,Sb as ee,Ky as De,bo as le,Sc as be,kI as te,Oc as ae,Sd as ue,Se as Pe,bE as Y,Ku as ye,Sf as Ee,Sg as me,Sh as je,Kx as Se,Si as xe,Sj as pe,Sk as Me,Sl as Ae,Sm as Le,Sn as Ce,So as fe,LK as Be}from"./zeni-epic-state-Brhydpej.js";import{a as de,w as ne,i as K,e as w,co as ce,x as q,v as oe,_ as Fe,R as Oe}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{a as A}from"./sentry-BtWdTNDK.js";import{w as se}from"./withTransactionSidePanel-MO-qZsKE.js";import{p as ie,c as re}from"./routePaths-BYuMJjxP.js";import{v as ze}from"./utils-BGj88Dzy.js";import{d as b}from"./decodeURIComponentSafe-B-9vw5Be.js";import{Z as we}from"./ZeniAccountStatementScreen-D_5y24R6.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import"./TransactionDetailScreen-Bfy3N_JT.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="6856f378-5576-44f0-bf35-659a7d5d30be",a._sentryDebugIdIdentifier="sentry-dbid-6856f378-5576-44f0-bf35-659a7d5d30be")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=Z((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=H(),t=N(),n=Q(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=W(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>U(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:k}=S(K.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=A.useState(!1),[F,O]=A.useState(void 0),f=A.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);A.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=Z((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),Ke=se((function({referrerType:a,...e}){const t=H(),n=N(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),S=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>Pe(d.transactionListState,S,p,k))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(K.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=qe(p,S,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:S,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}A.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=Z((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),He=se((function({referrerType:a,...e}){const t=H(),n=N(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),S=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>je(d.transactionListState,S,p,k))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(K.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Qe(p,S,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=We(C?.dateRange,d);i={accountId:S,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}A.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=H(),n=N(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=W(),p=b(l??""),S=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,S,p))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((v=>U(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,S,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:S,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(K.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(K.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();A.useEffect((()=>{!P&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Ae(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return R&&i!=null?s.jsx(Ze,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>U(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ke,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-BqtYq8PY.js";import{h as H,g as N,u as Q,i as W,j as g,N as G,n as Z,o as ve,p as j}from"./core-4nWRIid2.js";import{e$ as U,rd as X,k5 as u,Sb as ee,Ky as De,bo as le,Sc as be,kI as te,Oc as ae,Sd as ue,Se as Pe,bE as Y,Ku as ye,Sf as Ee,Sg as me,Sh as je,Kx as Se,Si as xe,Sj as pe,Sk as Me,Sl as Ae,Sm as Le,Sn as Ce,So as fe,LK as Be}from"./zeni-epic-state-Brhydpej.js";import{a as de,w as ne,i as K,e as w,co as ce,x as q,v as oe,_ as Fe,R as Oe}from"./index-qYSCKekz.js";import"./mui-ChRNPf14.js";import{a as A}from"./sentry-BtWdTNDK.js";import{w as se}from"./withTransactionSidePanel-DIWgh7V_.js";import{p as ie,c as re}from"./routePaths-TA66BJgf.js";import{v as ze}from"./utils-BGj88Dzy.js";import{d as b}from"./decodeURIComponentSafe-B-9vw5Be.js";import{Z as we}from"./ZeniAccountStatementScreen-rGHf8AJK.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./useAskAiCfoHostNavButtonProps-yAJW2Zxp.js";import"./TransactionDetailScreen-Dyormtjy.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="6856f378-5576-44f0-bf35-659a7d5d30be",a._sentryDebugIdIdentifier="sentry-dbid-6856f378-5576-44f0-bf35-659a7d5d30be")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=Z((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=H(),t=N(),n=Q(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=W(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>U(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:k}=S(K.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=A.useState(!1),[F,O]=A.useState(void 0),f=A.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);A.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=Z((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),Ke=se((function({referrerType:a,...e}){const t=H(),n=N(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),S=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>Pe(d.transactionListState,S,p,k))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(K.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=qe(p,S,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:S,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}A.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=Z((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),He=se((function({referrerType:a,...e}){const t=H(),n=N(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),S=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>je(d.transactionListState,S,p,k))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(K.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Qe(p,S,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=We(C?.dateRange,d);i={accountId:S,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}A.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=H(),n=N(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=W(),p=b(l??""),S=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,S,p))),[P,B]=A.useState(!1),[E,F]=A.useState(void 0),O=g((v=>U(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,S,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:S,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(K.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(K.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();A.useEffect((()=>{!P&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Ae(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return R&&i!=null?s.jsx(Ze,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>U(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ke,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})})]})}export{kt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-BqtYq8PY.js";import{h as F,g as U,u as B,i as O,j as g,N as D,n as G,o as Ie,p as k}from"./core-4nWRIid2.js";import{cs as N,e$ as E,QX as L,GN as ae,f_ as Z,Gv as ne,QZ as Te,GQ as ke,QV as je,QW as se,R9 as be,EU as Ae,uy as Ee,Q$ as ve,H7 as De,QY as re,cW as H,yR as oe,fG as Fe,fI as Ue,S8 as Be,S9 as Le,Gw as Pe,Sa as Re,Gx as Me,GG as Ve,bs as Oe,bJ as Ge,cD as Ne,bK as _e,cr as $e,bt as ze,Mt as Qe,cq as Ze}from"./zeni-epic-state-Brhydpej.js";import{D as _,ar as He,z as A,Z as $,e as j,ch as We,ci as qe,cj as Q,J as W,E as Je,_ as Ke,a0 as Xe,w as ie,i as v,G as Ye,C as et,ck as tt,au as q,x as at,cl as nt,v as J,cm as st,Q as X,cn as rt,d as ot}from"./index-
|
|
1
|
+
import{j as e}from"./liveblocks-BqtYq8PY.js";import{h as F,g as U,u as B,i as O,j as g,N as D,n as G,o as Ie,p as k}from"./core-4nWRIid2.js";import{cs as N,e$ as E,QX as L,GN as ae,f_ as Z,Gv as ne,QZ as Te,GQ as ke,QV as je,QW as se,R9 as be,EU as Ae,uy as Ee,Q$ as ve,H7 as De,QY as re,cW as H,yR as oe,fG as Fe,fI as Ue,S8 as Be,S9 as Le,Gw as Pe,Sa as Re,Gx as Me,GG as Ve,bs as Oe,bJ as Ge,cD as Ne,bK as _e,cr as $e,bt as ze,Mt as Qe,cq as Ze}from"./zeni-epic-state-Brhydpej.js";import{D as _,ar as He,z as A,Z as $,e as j,ch as We,ci as qe,cj as Q,J as W,E as Je,_ as Ke,a0 as Xe,w as ie,i as v,G as Ye,C as et,ck as tt,au as q,x as at,cl as nt,v as J,cm as st,Q as X,cn as rt,d as ot}from"./index-qYSCKekz.js";import{D as it,n as R,S as ct}from"./mui-ChRNPf14.js";import lt from"./NotFoundScreen-B6nbKEPc.js";import{S as Y}from"./SetupPagesScreen-D2lEnwjt.js";import{a as p}from"./sentry-BtWdTNDK.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-yAJW2Zxp.js";import{u as dt}from"./useInitialThreadRequest-BeFUEHq1.js";import{u as pt}from"./useCashManagementBanner-Dbz53g9T.js";import{M as ce}from"./MobileAppDrawer-hdYoVCXp.js";import{F as mt}from"./FeaturePreviewScreen-BKTS5XLx.js";import{a as ee}from"./analyticsHelper-CBp9b8VI.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./routePaths-TA66BJgf.js";import"./BusinessVerificationPageScreen-BZk1AoM_.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]="529381b5-ccaf-4f7f-ba97-8d20a8a3de3e",t._sentryDebugIdIdentifier="sentry-dbid-529381b5-ccaf-4f7f-ba97-8d20a8a3de3e")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:L(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Te(s))}}}))(We);function yt(){const t=F(),a=U(),n=B(),{tenantEmailDomain:r}=O(),m=_(),s=g((T=>T.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=He(s),o=N(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,w]=p.useState(!1),[c,l]=p.useState(!1),S=g((T=>E(T))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((T=>L(T,y))),I=g((T=>T.treasurySetupViewState.fetchState)),C=g((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||I!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,I,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(Z()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(w(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=G((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:L(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(qe),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=B(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,w]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),I=g((C=>L(C,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(Z()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(w(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:I,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(j,"review",h.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-BqtYq8PY.js";import{a as f}from"./sentry-BtWdTNDK.js";import{h as J,g as Y,i as N,j as S,n as G,u as K,o as at,p as V,N as $}from"./core-4nWRIid2.js";import{e$ as L,NC as Ee,ND as Re,gC as X,cy as be,cz as Ie,xq as St,NE as nt,xu as Kt,LB as ee,kI as te,xo as Yt,xi as qt,NF as Ue,xa as Ht,x9 as Qt,x3 as Wt,xf as Zt,xv as Xt,NG as he,NH as Me,xb as ea,NI as pe,fN as ft,xK as gt,xD as vt,NJ as xt,q3 as Tt,xy as yt,xw as Dt,NK as Ct,xR as Et,xO as bt,xz as It,xQ as Je,K0 as wt,NL as ta,NM as aa,cB as na,NN as sa,NO as oa,NP as me,NQ as ie,NR as we,LC as Ge,y4 as ye,LA as De,xT as kt,xr as $e,NS as la,LD as H,NT as ze,xl as ia,NU as ca,NV as da,NW as Ke,NX as Ye,NY as qe,NZ as He,x_ as ke,N_ as At,xH as jt,N$ as ra,O0 as ua,O1 as ha,O2 as pa,O3 as ma,O4 as Sa,O5 as fa,O6 as ga,uK as va,uS as xa,uL as Ta,KI as je,O7 as ya,O8 as Da,k5 as Fe,bo as Ca,O9 as Ea,Oa as ba,lG as Ia,lP as wa,KH as Pe,bE as st,Ob as Ft,Ki as Pt,Oc as ka,Od as Aa,Oe as ja,lR as Fa,Of as ot,Og as lt,Oh as it,Oi as ct,Oj as Pa,lN as _a,Ok as Oa,lQ as La,Ol as Va,Om as _t,L1 as Ot,l4 as Ba,On as Na,Oo as _e,Op as Lt,K$ as Vt,Am as Ra,Oq as Ua,Or as Ma,lo as Bt,Os as Ja,Ot as Ga,Ld as $a,sj as za,Ou as Nt,Ov as dt,La as Oe,Ow as rt,Ox as Ka,Lf as Ya,Oy as qa,Oz as Ha,OA as Qa,OB as Wa,OC as Za,sm as Xa,OD as en,LE as tn,OE as an,KU as Le,hN as nn,OF as sn,OG as on,hL as ln,OH as cn,OI as dn,Aq as rn,OJ as un,OK as hn,OL as pn,OM as mn,l8 as Sn,bn as fn,fI as gn,fG as vn}from"./zeni-epic-state-Brhydpej.js";import{z as R,ar as Ve,C as Rt,Z as W,e as j,a4 as Z,aB as xn,x as M,a as Ce,A as ce,aC as Qe,aD as Tn,aE as yn,v as We,aF as Dn,E as Cn,J as de,G as Ze,w as ae,i as z,aG as En,m as Xe,a0 as Se,aH as bn,aI as Ut,_ as In,aJ as wn,D as kn,aK as An,au as Mt,aL as jn,o as Q,S as Fn,I as Jt,K as Pn,aM as _n,aN as On,h as et,aO as Ln,aP as Vn,s as Bn,aQ as Nn,aR as Rn}from"./index-
|
|
1
|
+
import{j as l}from"./liveblocks-BqtYq8PY.js";import{a as f}from"./sentry-BtWdTNDK.js";import{h as J,g as Y,i as N,j as S,n as G,u as K,o as at,p as V,N as $}from"./core-4nWRIid2.js";import{e$ as L,NC as Ee,ND as Re,gC as X,cy as be,cz as Ie,xq as St,NE as nt,xu as Kt,LB as ee,kI as te,xo as Yt,xi as qt,NF as Ue,xa as Ht,x9 as Qt,x3 as Wt,xf as Zt,xv as Xt,NG as he,NH as Me,xb as ea,NI as pe,fN as ft,xK as gt,xD as vt,NJ as xt,q3 as Tt,xy as yt,xw as Dt,NK as Ct,xR as Et,xO as bt,xz as It,xQ as Je,K0 as wt,NL as ta,NM as aa,cB as na,NN as sa,NO as oa,NP as me,NQ as ie,NR as we,LC as Ge,y4 as ye,LA as De,xT as kt,xr as $e,NS as la,LD as H,NT as ze,xl as ia,NU as ca,NV as da,NW as Ke,NX as Ye,NY as qe,NZ as He,x_ as ke,N_ as At,xH as jt,N$ as ra,O0 as ua,O1 as ha,O2 as pa,O3 as ma,O4 as Sa,O5 as fa,O6 as ga,uK as va,uS as xa,uL as Ta,KI as je,O7 as ya,O8 as Da,k5 as Fe,bo as Ca,O9 as Ea,Oa as ba,lG as Ia,lP as wa,KH as Pe,bE as st,Ob as Ft,Ki as Pt,Oc as ka,Od as Aa,Oe as ja,lR as Fa,Of as ot,Og as lt,Oh as it,Oi as ct,Oj as Pa,lN as _a,Ok as Oa,lQ as La,Ol as Va,Om as _t,L1 as Ot,l4 as Ba,On as Na,Oo as _e,Op as Lt,K$ as Vt,Am as Ra,Oq as Ua,Or as Ma,lo as Bt,Os as Ja,Ot as Ga,Ld as $a,sj as za,Ou as Nt,Ov as dt,La as Oe,Ow as rt,Ox as Ka,Lf as Ya,Oy as qa,Oz as Ha,OA as Qa,OB as Wa,OC as Za,sm as Xa,OD as en,LE as tn,OE as an,KU as Le,hN as nn,OF as sn,OG as on,hL as ln,OH as cn,OI as dn,Aq as rn,OJ as un,OK as hn,OL as pn,OM as mn,l8 as Sn,bn as fn,fI as gn,fG as vn}from"./zeni-epic-state-Brhydpej.js";import{z as R,ar as Ve,C as Rt,Z as W,e as j,a4 as Z,aB as xn,x as M,a as Ce,A as ce,aC as Qe,aD as Tn,aE as yn,v as We,aF as Dn,E as Cn,J as de,G as Ze,w as ae,i as z,aG as En,m as Xe,a0 as Se,aH as bn,aI as Ut,_ as In,aJ as wn,D as kn,aK as An,au as Mt,aL as jn,o as Q,S as Fn,I as Jt,K as Pn,aM as _n,aN as On,h as et,aO as Ln,aP as Vn,s as Bn,aQ as Nn,aR as Rn}from"./index-qYSCKekz.js";import{n as U,D as Un,S as Gt}from"./mui-ChRNPf14.js";import{t as Mn,A as Jn}from"./AddressScreen-Ba-VvOjK.js";import le from"./NotFoundScreen-B6nbKEPc.js";import{F as Gn}from"./FeaturePreviewScreen-BKTS5XLx.js";import{c as q,v as tt,d as $n}from"./routePaths-TA66BJgf.js";import{p as $t}from"./pathToGoBack-DjzKcd4A.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-yAJW2Zxp.js";import{M as ge}from"./MobileAppDrawer-hdYoVCXp.js";import{D as zn}from"./DrawerScreen-D1JpfIY3.js";import{g as Kn,m as Yn}from"./accountMappingHelper-Cg1rcuy8.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="fdbdba0e-0ea8-4495-9ecf-1e0ce8124804",e._sentryDebugIdIdentifier="sentry-dbid-fdbdba0e-0ea8-4495-9ecf-1e0ce8124804")}catch{}})();const qn=Ce.getLocalizedStrings(),Hn=G((function(e,a){const s=Re(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}}),(function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(Kt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(xn),Qn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=N(),{scheduleType:o}=N();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S((g=>L(g))),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S((g=>Re(g,r))),p=i.selectedJELinkRowIndex,d=S((g=>X(g,c.companyId))),u=Ve(i.updateStatus.fetchState);f.useEffect((()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})}),[u,i.updateStatus.fetchState]),f.useEffect((()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]),f.useEffect((()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})}),[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const m=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&p!=null?l.jsxs(l.Fragment,{children:[m===!0?l.jsx(W,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(Hn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[p]})]}):null})},zt=e=>{const a=qn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some((p=>p.isRecommendedTransaction===!0)),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Zn=U.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|