@zeniai/web-app-ui 5.2.7-dev → 5.2.7-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.
Files changed (63) hide show
  1. package/dist/assets/{AddressRoutes-BIJ6TmLJ.js → AddressRoutes-K7NAyrAQ.js} +1 -1
  2. package/dist/assets/{AddressScreen-B4B18718.js → AddressScreen-kANSkpLN.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-DoAQbbOx.js → AiCfoScreen-BvwhtBVv.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-BgdJ81nK.js → BillPayApprovalRoutes-DPwr6aot.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BSkmlNP-.js → BillPayRoutes-DY-yFyUM.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BrJsE9Wf.js → BusinessVerificationPageScreen-D1o3vV10.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-HhvNfCCY.js → CardsAiCfoScreen-CLPV9jYw.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BRUAWm_A.js → ChargeCardRoutes-BPpfWG0k.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-h-SBTzhu.js → CompanyPassportScreen-DVEWEDid.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-CrTdRYze.js → ConnectionAuthScreen-DHRUvouj.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-B2qgtMDG.js → CustomerOnboardingAuthScreen-X7rtsPNv.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-9iTG5rgG.js → CustomerOnboardingRoutes-Ctp3b97E.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-Dlp8-AvH.js → DashboardRoutes-CrEPyjq3.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-CqHnt2tK.js → DefaultTenantHome-n3uc8DAu.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-qMWvZF55.js → DomesticWireDetailScreen-CAXSGn5x.js} +1 -1
  16. package/dist/assets/{DrawerScreen-CaKLPeP5.js → DrawerScreen-BVS8mUkg.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-ercGoKOg.js → EntityDetailRoutes-CuTCQbRH.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-NbuloP-n.js → ExpenseAutomationRoutes-BgYCTGtf.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-CxbSxzBU.js → FeaturePreviewScreen-Cw4bAxEp.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BpkTy9Hy.js → HubSpotOAuthCallbackScreen-ok0eAsBR.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-DhZjHoQv.js → MagicLinkRoutes-tdJK69VW.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-phajga6u.js → MagicLinkSignInScreen-DV__Y9ah.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-DXlB_K3l.js → MobileAppDrawer-BS8RaOMH.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-Cz3neVdz.js → NotFoundScreen-Cs4XTtbb.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-23TepTm4.js → NotificationRoutes-DFea4_oM.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-Coz_pdpy.js → OAuthConsentScreen-DRJKKBw9.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-CqA8tmFY.js → PandLWithForecastRoutes-C8S-sqdC.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-B5GFAMh4.js → PeopleRoutes-DaXc8iH9.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-9VWn9OFg.js → PerformanceRoutes-BATp9MxK.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-XIaYFO4N.js → QBOConnectionScreen-DRa0888S.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-Bhgby_bm.js → ReimbursementApprovalRoutes-C1d9QvTl.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BQN9V9kd.js → ReimbursementApprovalRuleDetailScreen-DQbofKBt.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-CT-xUNjQ.js → ReimbursementRoutes-CnJGGO8s.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-CQ-YMNr3.js → ReportsRoutes-CIFXVkTx.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-DzGknDMk.js → RewardsRoutes-DfCkBxLg.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-B4B5a17S.js → ScreenRoutes-D_u59jTK.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-DzaddH2T.js → SettingsRoutes--FejGNT-.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-DC__s7_X.js → SetupPagesScreen-dOsZbhRG.js} +1 -1
  39. package/dist/assets/{SignInScreen-CgSXlupS.js → SignInScreen-C17dxjtf.js} +1 -1
  40. package/dist/assets/{SignOutScreen-CF8WAkOT.js → SignOutScreen-DeEKoT2w.js} +1 -1
  41. package/dist/assets/{TaskListScreen-nHc85aaE.js → TaskListScreen-DeyX47zW.js} +1 -1
  42. package/dist/assets/{TaskRoutes-B4XN9lwZ.js → TaskRoutes-B1I_DIBQ.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-DR75-AlI.js → TransactionDetailRoutes-Rml-h3Zh.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-Cdu4UqbO.js → TransactionDetailScreen-CseiXXfn.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-CMQFHyGN.js → TransactionListRoutes-CSkEXmTh.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-BadnSvSD.js → TreasuryRoutes-DVvjevwv.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-Q-LWVNza.js → VendorsRoutes-xn-Quoh9.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-lllyRMhu.js → WiseConfirmationScreen-D5NViDOv.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-DNK2PF4a.js → ZeniAccountRoutes-Br-R9e6m.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-qoPclGWB.js → ZeniAccountStatementScreen-C1OGbg3O.js} +1 -1
  51. package/dist/assets/{analyticsHelper-CuVH_0d-.js → analyticsHelper-DTpcNobE.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-D6kQDxGJ.js → getLocaleForTenant-6cRVHcMB.js} +1 -1
  53. package/dist/assets/{index-inh_AhlJ.js → index-BI0zLowA.js} +5 -5
  54. package/dist/assets/{routePaths-DVdAEsPQ.js → routePaths-CIgI6dmE.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-kvItrptc.js → useAiCfoDashboardSuggestedQuestionsChips-Cu5rs5_N.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js → useAskAiCfoHostNavButtonProps-Dt9FjqgO.js} +1 -1
  57. package/dist/assets/{useCashManagementBanner-B67UZZ7S.js → useCashManagementBanner-DiCLDHdY.js} +1 -1
  58. package/dist/assets/{useChargeCardPusherEvents-CZXEyuQA.js → useChargeCardPusherEvents-BdMUnFQ6.js} +1 -1
  59. package/dist/assets/{useEmailConnectResultRefresh-BABpEztr.js → useEmailConnectResultRefresh-OaU--UoN.js} +1 -1
  60. package/dist/assets/{useInitialThreadRequest-C-5QTneS.js → useInitialThreadRequest-CINmDijc.js} +1 -1
  61. package/dist/assets/{withTransactionSidePanel-m5dzUQbh.js → withTransactionSidePanel-CxcB1MIS.js} +1 -1
  62. package/dist/index.html +1 -1
  63. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-C6RAQzoe.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as H}from"./core-BbYLl-V8.js";import{eW as L,fS as w,ME as Te,kA as Q,r3 as X,rU as A,ko as Re,js as Me,vr as J,rZ as Oe,bs as Ae,MF as Fe,bn as ke,wA as De,MG as je,MH as Ee,vj as Pe,MI as N,MJ as Le,MK as Be,ML as ve,MM as Ve,MN as I,MO as F,MP as k,MQ as Y,MR as D,MS as j,dI as Ue,wg as xe,w4 as $,w5 as q,wm as ze,w9 as W,ws as Ge,MT as He,MU as Ne,MV as Ye,MW as $e,MX as qe,fD as We,fB as Ze}from"./zeni-epic-state-CPXlKDVV.js";import{K as Ke,M as Qe,O as Xe,T as Je,n as ea,$ as ee,X as E,z as ae,V as aa,I as sa,c as ta,W as oa,a0 as na,N as ra,e as P,g as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-inh_AhlJ.js";import"./mui-CdzFMywn.js";import fa from"./NotFoundScreen-Cz3neVdz.js";import{F as ma}from"./FeaturePreviewScreen-CxbSxzBU.js";import{a as _}from"./sentry-0zOCC74t.js";import{u as ua}from"./useInitialThreadRequest-C-5QTneS.js";import{t as Z,a as K,b as _a}from"./routePaths-DVdAEsPQ.js";import{M as ha}from"./MobileAppDrawer-DXlB_K3l.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="0a00ee6a-d256-428c-9593-53e04b4c373e",e._sentryDebugIdIdentifier="sentry-dbid-0a00ee6a-d256-428c-9593-53e04b4c373e")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ne()),e(Ye()),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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:X(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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(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(W({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(W(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(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(xe({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=Ue(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 Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return K(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?K(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(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(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(k({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({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(ve({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(N({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=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(v?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=>Q(n))),M=d((n=>X(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Ke(he??"")==="reports",be=Qe(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Xe({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:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,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:v,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 za(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=We(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-C6RAQzoe.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as H}from"./core-BbYLl-V8.js";import{eW as L,fS as w,ME as Te,kA as Q,r3 as X,rU as A,ko as Re,js as Me,vr as J,rZ as Oe,bs as Ae,MF as Fe,bn as ke,wA as De,MG as je,MH as Ee,vj as Pe,MI as N,MJ as Le,MK as Be,ML as ve,MM as Ve,MN as I,MO as F,MP as k,MQ as Y,MR as D,MS as j,dI as Ue,wg as xe,w4 as $,w5 as q,wm as ze,w9 as W,ws as Ge,MT as He,MU as Ne,MV as Ye,MW as $e,MX as qe,fD as We,fB as Ze}from"./zeni-epic-state-CPXlKDVV.js";import{K as Ke,M as Qe,O as Xe,T as Je,n as ea,$ as ee,X as E,z as ae,V as aa,I as sa,c as ta,W as oa,a0 as na,N as ra,e as P,g as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-BI0zLowA.js";import"./mui-CdzFMywn.js";import fa from"./NotFoundScreen-Cs4XTtbb.js";import{F as ma}from"./FeaturePreviewScreen-Cw4bAxEp.js";import{a as _}from"./sentry-0zOCC74t.js";import{u as ua}from"./useInitialThreadRequest-CINmDijc.js";import{t as Z,a as K,b as _a}from"./routePaths-CIgI6dmE.js";import{M as ha}from"./MobileAppDrawer-BS8RaOMH.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="0a00ee6a-d256-428c-9593-53e04b4c373e",e._sentryDebugIdIdentifier="sentry-dbid-0a00ee6a-d256-428c-9593-53e04b4c373e")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ne()),e(Ye()),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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:X(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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(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(W({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(W(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(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(xe({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=Ue(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 Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return K(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?K(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(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(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(k({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({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(ve({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(N({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=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(v?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=>Q(n))),M=d((n=>X(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Ke(he??"")==="reports",be=Qe(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Xe({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:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,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:v,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 za(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=We(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-C6RAQzoe.js";import{z as w,N as b,e as u,g as E,d8 as k,$ as I,X as C}from"./index-inh_AhlJ.js";import"./mui-CdzFMywn.js";import g from"./NotFoundScreen-Cz3neVdz.js";import{a as c}from"./sentry-0zOCC74t.js";import{u as D,j as h,h as F,g as T,n as L,o as U,p as d,N as y}from"./core-BbYLl-V8.js";import{eW as V,TT as j,TU as p,vX as _,fJ as P,TV as X,vV as z}from"./zeni-epic-state-CPXlKDVV.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="5d8a8541-83f1-43f9-9e87-3c5940d81557",e._sentryDebugIdIdentifier="sentry-dbid-5d8a8541-83f1-43f9-9e87-3c5940d81557")}catch{}})();const G=L((function(e,t){const n=j(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=w.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(z())},onUpdateInviteFormLocalData:s=>{e(X({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),J=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>V(o))),m=F(),v=T(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(b,{analytics:u,onLoad:o=>(S=>S.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:v,currentTenant:r,companyName:N,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(J,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-C6RAQzoe.js";import{z as w,N as b,e as u,g as E,d8 as k,$ as I,X as C}from"./index-BI0zLowA.js";import"./mui-CdzFMywn.js";import g from"./NotFoundScreen-Cs4XTtbb.js";import{a as c}from"./sentry-0zOCC74t.js";import{u as D,j as h,h as F,g as T,n as L,o as U,p as d,N as y}from"./core-BbYLl-V8.js";import{eW as V,TT as j,TU as p,vX as _,fJ as P,TV as X,vV as z}from"./zeni-epic-state-CPXlKDVV.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="5d8a8541-83f1-43f9-9e87-3c5940d81557",e._sentryDebugIdIdentifier="sentry-dbid-5d8a8541-83f1-43f9-9e87-3c5940d81557")}catch{}})();const G=L((function(e,t){const n=j(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=w.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(z())},onUpdateInviteFormLocalData:s=>{e(X({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),J=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>V(o))),m=F(),v=T(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(b,{analytics:u,onLoad:o=>(S=>S.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:v,currentTenant:r,companyName:N,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(J,{}):a.jsx(g,{})}),a.jsx(d,{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-Dlp8-AvH.js","assets/sentry-0zOCC74t.js","assets/core-BbYLl-V8.js","assets/zeni-epic-state-CPXlKDVV.js","assets/index-inh_AhlJ.js","assets/mui-CdzFMywn.js","assets/analytics-CAwmb4Gq.js","assets/utils-OnooQQgi.js","assets/withTransactionSidePanel-m5dzUQbh.js","assets/useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js","assets/TransactionDetailScreen-Cdu4UqbO.js","assets/decodeURIComponentSafe-BAc0Xv61.js","assets/routePaths-DVdAEsPQ.js","assets/NotFoundScreen-Cz3neVdz.js","assets/useInitialThreadRequest-C-5QTneS.js","assets/analyticsHelper-CuVH_0d-.js","assets/CompanyPassportScreen-h-SBTzhu.js","assets/MobileAppDrawer-DXlB_K3l.js","assets/useAiCfoDashboardSuggestedQuestionsChips-kvItrptc.js","assets/FeaturePreviewScreen-CxbSxzBU.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-BSkmlNP-.js","assets/AddressScreen-B4B18718.js","assets/DomesticWireDetailScreen-qMWvZF55.js","assets/DrawerScreen-CaKLPeP5.js","assets/SetupPagesScreen-DC__s7_X.js","assets/BusinessVerificationPageScreen-BrJsE9Wf.js","assets/BillPayApprovalRoutes-BgdJ81nK.js","assets/ReimbursementApprovalRuleDetailScreen-BQN9V9kd.js","assets/getLocaleForTenant-D6kQDxGJ.js","assets/ReimbursementRoutes-CT-xUNjQ.js","assets/ReimbursementApprovalRoutes-Bhgby_bm.js","assets/TransactionListRoutes-CMQFHyGN.js","assets/ZeniAccountStatementScreen-qoPclGWB.js","assets/SettingsRoutes-DzaddH2T.js","assets/accountMappingHelper-DqWxTQ5l.js","assets/useEmailConnectResultRefresh-BABpEztr.js","assets/QBOConnectionScreen-XIaYFO4N.js","assets/empty-BjAZZThl.js","assets/index-YFIL1B6n.js","assets/url-DHmmZDUO.js","assets/index-BY-tCXtJ.js","assets/ReportsRoutes-CQ-YMNr3.js","assets/ChargeCardRoutes-BRUAWm_A.js","assets/useChargeCardPusherEvents-CZXEyuQA.js","assets/PeopleRoutes-B5GFAMh4.js","assets/ExpenseAutomationRoutes-NbuloP-n.js","assets/TreasuryRoutes-BadnSvSD.js","assets/useCashManagementBanner-B67UZZ7S.js","assets/VendorsRoutes-Q-LWVNza.js","assets/pathToGoBack-BDzzMRY3.js","assets/ZeniAccountRoutes-DNK2PF4a.js","assets/AddressRoutes-BIJ6TmLJ.js","assets/PandLWithForecastRoutes-CqA8tmFY.js","assets/CustomerOnboardingRoutes-9iTG5rgG.js","assets/TransactionDetailRoutes-DR75-AlI.js","assets/EntityDetailRoutes-ercGoKOg.js","assets/NotificationRoutes-23TepTm4.js","assets/PerformanceRoutes-9VWn9OFg.js","assets/RewardsRoutes-DzGknDMk.js","assets/TaskRoutes-B4XN9lwZ.js","assets/TaskListScreen-nHc85aaE.js","assets/AiCfoScreen-DoAQbbOx.js","assets/CardsAiCfoScreen-HhvNfCCY.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,bn as us,eW as ds,fD as cs,fB as ms,gl as _s,fq as hs,cW as Ee,cC as ps,fT as Es,cu as Rs,bE as xs,bo as Is,fX as gs,v as js,Ma as Ts,bs as As,Mb as fs,bK as bs,bJ as Ds,bt as ys,cq as Cs,Mc as vs,Md as Us,cS as ws,cV as Os,cU as Ps,cB as Fs,cI as Ls,oc as Re,fz as xe,gv as Hs,f$ as Ie,gs as ge,gt as je,g0 as ks}from"./zeni-epic-state-CPXlKDVV.js";import{j as e}from"./liveblocks-C6RAQzoe.js";import{a as O}from"./sentry-0zOCC74t.js";import{u as Bs,h as Vs,i as Ss,g as Ns,j as z,l as Te,N as u,o as Ms,p as a}from"./core-BbYLl-V8.js";import{y as Zs,u as zs,z as b,$ as $s,c as Gs,h as Ws,X as $,i as qs,d as Ys,I as Xs,L as F,a as Ae,t as _,P as Js,e as Q,l}from"./index-inh_AhlJ.js";import"./mui-CdzFMywn.js";import{f as fe}from"./analyticsHelper-CuVH_0d-.js";import{t as Ks}from"./getLocaleForTenant-D6kQDxGJ.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="94057fab-e1eb-4243-94f3-2b6dc9bee769",o._sentryDebugIdIdentifier="sentry-dbid-94057fab-e1eb-4243-94f3-2b6dc9bee769")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-Dlp8-AvH.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-BSkmlNP-.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-CT-xUNjQ.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-CMQFHyGN.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-DzaddH2T.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-CQ-YMNr3.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-BRUAWm_A.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-B5GFAMh4.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-NbuloP-n.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-BadnSvSD.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-Q-LWVNza.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-DNK2PF4a.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-CQ-YMNr3.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-BIJ6TmLJ.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-B5GFAMh4.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-CqA8tmFY.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-9iTG5rgG.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-Q-LWVNza.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-DR75-AlI.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),be=l((()=>t((()=>import("./EntityDetailRoutes-ercGoKOg.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-Dlp8-AvH.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-BSkmlNP-.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])))),ut=l((()=>t((()=>import("./SettingsRoutes-DzaddH2T.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])))),ye=l((()=>t((()=>import("./ReimbursementRoutes-CT-xUNjQ.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])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-DNK2PF4a.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-BadnSvSD.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-CMQFHyGN.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-BRUAWm_A.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-23TepTm4.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),pt=l((()=>t((()=>import("./PerformanceRoutes-9VWn9OFg.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-NbuloP-n.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-DzGknDMk.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-B4XN9lwZ.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),It=l((()=>t((()=>import("./AiCfoScreen-DoAQbbOx.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-HhvNfCCY.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),y=l((()=>t((()=>import("./NotFoundScreen-Cz3neVdz.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-nHc85aaE.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const T=Bs(),B=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:H}=zs(),v=b.getSignedInUserTenant(i)?.tenantId,g=b.getSignedInUser(),se=us(g),G=Ns(),[V,Pe]=O.useState(!1),r=z((n=>ds(n))),{useFeatureGate:N}=$s(),M=Gs(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=N($.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N($.isDebitCardFeatureEnabled),A=z((n=>n.tenantState.fetchState)),j=z((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||A==="Completed"?cs(ne,r):void 0,X=j==="Completed"||A==="Completed"?ms(r):void 0,ke=qs(r,He,ne),{isCardsHidden:Be}=Ys(r?.tenantId),Ve=!ke||!!Be,{isFeatureEnabled:Se}=N($.isSettingsFeatureEnabled),{isFeatureEnabled:J}=N($.isAiCfoFileUploadEnabled),W=z((n=>_s(n)));if(i!=null){const n=b.getSignedInUserTenant(i);g!=null&&n!=null&&fe(g,r,L)}const Z={tenantId:v,userId:g?.userId,sessionId:g?.zeniSessionId},ae=hs(),p=Xs(),Ne=r.company==null||p?.loggedInUserRoleMap!=null&&Ee(p.loggedInUserRole),Me=ps(p?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,K=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=z((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(K!=null&&v!=null){const n=K.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Is();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[K,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!js(ae,Z)&&b.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Hs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=b.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,g,T,Ze))}),[Z,ae,g,T,b]),O.useEffect((()=>{b.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(q&&rs){k(Ie(s));const Y=b.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(c.userId,s))),q&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)));if(q){Q.identify(c.userId,{tenant_id:s});const Y=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),k(ks(c.userId,s,c.zeniSessionId))),Y&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Re(c.userId,c.zeniSessionId)))}})(A,j,r,v,g,U,T))}),[v,j]),O.useEffect((()=>{b.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),b.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),g!=null&&fe(g,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,g]),O.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[j,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[j,V]);const w=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:ze}=N($.isReferralFeatureEnabled),$e=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,We=fs(p?.loggedInUserRoleMap),qe=r.externalConnections?.accounting[0]?.isValid,Ye=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&bs(p?.loggedInUserRoleMap),_e=Fe&&!w,Xe=Le&&!w,Je=le&&Ds(p?.loggedInUserRoleMap),Ke=ue&&ys(p?.loggedInUserRoleMap),Qe=_e&&Cs(p?.loggedInUserRoleMap),es=vs(p?.loggedInUserRoleMap),ss=Us(p?.loggedInUserRoleMap),ts=ws(p?.loggedInUserRoleMap),ns=Os(p?.loggedInUserRoleMap),as=Ps(p?.loggedInUserRoleMap),E=Fs(p?.loggedInUserRoleMap),R=Ls(p?.loggedInUserRoleMap),he=le&&E,pe=ce&&R,x=_e&&ts,I=Xe&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return b.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(g!=null&&A!=="In-Progress"&&T(Re(g.userId,g.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&Ye&&qe!==!0&&h===!1&&X===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(jt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||$e||Ge?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(mt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(be,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,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||me||Qe||Ke?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:I?e.jsx(ct,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(pt,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(Rt,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(It,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):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:{...G.state,message:"...",origin:G.pathname}}))}const jt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(At,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(y,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,Nt as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CrEPyjq3.js","assets/sentry-0zOCC74t.js","assets/core-BbYLl-V8.js","assets/zeni-epic-state-CPXlKDVV.js","assets/index-BI0zLowA.js","assets/mui-CdzFMywn.js","assets/analytics-CAwmb4Gq.js","assets/utils-OnooQQgi.js","assets/withTransactionSidePanel-CxcB1MIS.js","assets/useAskAiCfoHostNavButtonProps-Dt9FjqgO.js","assets/TransactionDetailScreen-CseiXXfn.js","assets/decodeURIComponentSafe-BAc0Xv61.js","assets/routePaths-CIgI6dmE.js","assets/NotFoundScreen-Cs4XTtbb.js","assets/useInitialThreadRequest-CINmDijc.js","assets/analyticsHelper-DTpcNobE.js","assets/CompanyPassportScreen-DVEWEDid.js","assets/MobileAppDrawer-BS8RaOMH.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Cu5rs5_N.js","assets/FeaturePreviewScreen-Cw4bAxEp.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-DY-yFyUM.js","assets/AddressScreen-kANSkpLN.js","assets/DomesticWireDetailScreen-CAXSGn5x.js","assets/DrawerScreen-BVS8mUkg.js","assets/SetupPagesScreen-dOsZbhRG.js","assets/BusinessVerificationPageScreen-D1o3vV10.js","assets/BillPayApprovalRoutes-DPwr6aot.js","assets/ReimbursementApprovalRuleDetailScreen-DQbofKBt.js","assets/getLocaleForTenant-6cRVHcMB.js","assets/ReimbursementRoutes-CnJGGO8s.js","assets/ReimbursementApprovalRoutes-C1d9QvTl.js","assets/TransactionListRoutes-CSkEXmTh.js","assets/ZeniAccountStatementScreen-C1OGbg3O.js","assets/SettingsRoutes--FejGNT-.js","assets/accountMappingHelper-DqWxTQ5l.js","assets/useEmailConnectResultRefresh-OaU--UoN.js","assets/QBOConnectionScreen-DRa0888S.js","assets/empty-BjAZZThl.js","assets/index-YFIL1B6n.js","assets/url-DHmmZDUO.js","assets/index-BY-tCXtJ.js","assets/ReportsRoutes-CIFXVkTx.js","assets/ChargeCardRoutes-BPpfWG0k.js","assets/useChargeCardPusherEvents-BdMUnFQ6.js","assets/PeopleRoutes-DaXc8iH9.js","assets/ExpenseAutomationRoutes-BgYCTGtf.js","assets/TreasuryRoutes-DVvjevwv.js","assets/useCashManagementBanner-DiCLDHdY.js","assets/VendorsRoutes-xn-Quoh9.js","assets/pathToGoBack-BDzzMRY3.js","assets/ZeniAccountRoutes-Br-R9e6m.js","assets/AddressRoutes-K7NAyrAQ.js","assets/PandLWithForecastRoutes-C8S-sqdC.js","assets/CustomerOnboardingRoutes-Ctp3b97E.js","assets/TransactionDetailRoutes-Rml-h3Zh.js","assets/EntityDetailRoutes-CuTCQbRH.js","assets/NotificationRoutes-DFea4_oM.js","assets/PerformanceRoutes-BATp9MxK.js","assets/RewardsRoutes-DfCkBxLg.js","assets/TaskRoutes-B1I_DIBQ.js","assets/TaskListScreen-DeyX47zW.js","assets/AiCfoScreen-BvwhtBVv.js","assets/CardsAiCfoScreen-CLPV9jYw.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as us,eW as ds,fD as cs,fB as ms,gl as _s,fq as hs,cW as Ee,cC as ps,fT as Es,cu as Rs,bE as xs,bo as Is,fX as gs,v as js,Ma as Ts,bs as As,Mb as fs,bK as bs,bJ as Ds,bt as ys,cq as Cs,Mc as vs,Md as Us,cS as ws,cV as Os,cU as Ps,cB as Fs,cI as Ls,oc as Re,fz as xe,gv as Hs,f$ as Ie,gs as ge,gt as je,g0 as ks}from"./zeni-epic-state-CPXlKDVV.js";import{j as e}from"./liveblocks-C6RAQzoe.js";import{a as O}from"./sentry-0zOCC74t.js";import{u as Bs,h as Vs,i as Ss,g as Ns,j as z,l as Te,N as u,o as Ms,p as a}from"./core-BbYLl-V8.js";import{y as Zs,u as zs,z as b,$ as $s,c as Gs,h as Ws,X as $,i as qs,d as Ys,I as Xs,L as F,a as Ae,t as _,P as Js,e as Q,l}from"./index-BI0zLowA.js";import"./mui-CdzFMywn.js";import{f as fe}from"./analyticsHelper-DTpcNobE.js";import{t as Ks}from"./getLocaleForTenant-6cRVHcMB.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="94057fab-e1eb-4243-94f3-2b6dc9bee769",o._sentryDebugIdIdentifier="sentry-dbid-94057fab-e1eb-4243-94f3-2b6dc9bee769")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-CrEPyjq3.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-DY-yFyUM.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-CnJGGO8s.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-CSkEXmTh.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes--FejGNT-.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-CIFXVkTx.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-BPpfWG0k.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-DaXc8iH9.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-BgYCTGtf.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-DVvjevwv.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-xn-Quoh9.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-Br-R9e6m.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-CIFXVkTx.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-K7NAyrAQ.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-DaXc8iH9.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-C8S-sqdC.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-Ctp3b97E.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-xn-Quoh9.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-Rml-h3Zh.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),be=l((()=>t((()=>import("./EntityDetailRoutes-CuTCQbRH.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-CrEPyjq3.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-DY-yFyUM.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])))),ut=l((()=>t((()=>import("./SettingsRoutes--FejGNT-.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])))),ye=l((()=>t((()=>import("./ReimbursementRoutes-CnJGGO8s.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])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-Br-R9e6m.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-DVvjevwv.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-CSkEXmTh.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-BPpfWG0k.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-DFea4_oM.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),pt=l((()=>t((()=>import("./PerformanceRoutes-BATp9MxK.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-BgYCTGtf.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-DfCkBxLg.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-B1I_DIBQ.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),It=l((()=>t((()=>import("./AiCfoScreen-BvwhtBVv.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-CLPV9jYw.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),y=l((()=>t((()=>import("./NotFoundScreen-Cs4XTtbb.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-DeyX47zW.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const T=Bs(),B=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:H}=zs(),v=b.getSignedInUserTenant(i)?.tenantId,g=b.getSignedInUser(),se=us(g),G=Ns(),[V,Pe]=O.useState(!1),r=z((n=>ds(n))),{useFeatureGate:N}=$s(),M=Gs(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=N($.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N($.isDebitCardFeatureEnabled),A=z((n=>n.tenantState.fetchState)),j=z((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||A==="Completed"?cs(ne,r):void 0,X=j==="Completed"||A==="Completed"?ms(r):void 0,ke=qs(r,He,ne),{isCardsHidden:Be}=Ys(r?.tenantId),Ve=!ke||!!Be,{isFeatureEnabled:Se}=N($.isSettingsFeatureEnabled),{isFeatureEnabled:J}=N($.isAiCfoFileUploadEnabled),W=z((n=>_s(n)));if(i!=null){const n=b.getSignedInUserTenant(i);g!=null&&n!=null&&fe(g,r,L)}const Z={tenantId:v,userId:g?.userId,sessionId:g?.zeniSessionId},ae=hs(),p=Xs(),Ne=r.company==null||p?.loggedInUserRoleMap!=null&&Ee(p.loggedInUserRole),Me=ps(p?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,K=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=z((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(K!=null&&v!=null){const n=K.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Is();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[K,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!js(ae,Z)&&b.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Hs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=b.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,g,T,Ze))}),[Z,ae,g,T,b]),O.useEffect((()=>{b.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(q&&rs){k(Ie(s));const Y=b.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(c.userId,s))),q&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)));if(q){Q.identify(c.userId,{tenant_id:s});const Y=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),k(ks(c.userId,s,c.zeniSessionId))),Y&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Re(c.userId,c.zeniSessionId)))}})(A,j,r,v,g,U,T))}),[v,j]),O.useEffect((()=>{b.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),b.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),g!=null&&fe(g,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,g]),O.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[j,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[j,V]);const w=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:ze}=N($.isReferralFeatureEnabled),$e=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,We=fs(p?.loggedInUserRoleMap),qe=r.externalConnections?.accounting[0]?.isValid,Ye=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&bs(p?.loggedInUserRoleMap),_e=Fe&&!w,Xe=Le&&!w,Je=le&&Ds(p?.loggedInUserRoleMap),Ke=ue&&ys(p?.loggedInUserRoleMap),Qe=_e&&Cs(p?.loggedInUserRoleMap),es=vs(p?.loggedInUserRoleMap),ss=Us(p?.loggedInUserRoleMap),ts=ws(p?.loggedInUserRoleMap),ns=Os(p?.loggedInUserRoleMap),as=Ps(p?.loggedInUserRoleMap),E=Fs(p?.loggedInUserRoleMap),R=Ls(p?.loggedInUserRoleMap),he=le&&E,pe=ce&&R,x=_e&&ts,I=Xe&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return b.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(g!=null&&A!=="In-Progress"&&T(Re(g.userId,g.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&Ye&&qe!==!0&&h===!1&&X===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(jt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||$e||Ge?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(mt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(be,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,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||me||Qe||Ke?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:I?e.jsx(ct,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(pt,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(Rt,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(It,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):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:{...G.state,message:"...",origin:G.pathname}}))}const jt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(At,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(y,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,Nt as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-C6RAQzoe.js";import{a as u}from"./sentry-0zOCC74t.js";import{h as L,g as Q,u as U,j as y,s as le,n as G,i as H,o as ne,p as v}from"./core-BbYLl-V8.js";import{bn as De,eW as j,gq as Te,n2 as re,Ov as Me,hG as he,Om as Ue,r3 as _e,kA as be,m_ as Be,hI as Re,Oo as Fe,On as Oe,QL as Ve,zy as ze,E$ as Le,Qk as Ne,Qt as $e,c7 as ae,cN as Qe,cO as Ge,bs as He,Mn as Ze,x_ as Ke,QM as qe,Hq as We,EH as Je,Ey as ye,Ev as Xe,y2 as Se,EB as Ce,EE as Ie,EK as oe,uo as se,y1 as Ye,kc as J,kf as Ae,QN as en,lg as nn,yh as tn,Ne as an,Nf as on,ka as sn,QO as cn,kd as ln,rx as rn,N9 as dn,Na as un,rB as pn,hr as gn,Mv as ee,hj as de,hg as mn,ho as fn,Mw as hn,ye as bn,QP as yn,QQ as Sn,EY as Cn,fB as Ee,fD as xe,QR as In,ge as An,MF as En,yd as ue,gj as pe,gi as xn,yc as vn,gh as kn,gg as wn,QS as Pn,fG as ve,QT as jn,QU as Dn,yk as Tn,yb as ge,QV as Mn,fW as Un,y8 as _n,b_ as Bn,c6 as Rn,c5 as Fn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-CPXlKDVV.js";import{$ as X,X as O,z as w,ag as ke,bR as Qn,e as Z,g as Gn,bC as Hn,I as K,B as ie,bS as Zn,i as we,d as Pe,bT as Kn,ar as qn,m as je,bU as Wn,bV as Jn,bW as Xn,V as Yn,bX as et,v as nt,bY as tt}from"./index-inh_AhlJ.js";import{n as V}from"./mui-CdzFMywn.js";import{M as R}from"./MobileAppDrawer-DXlB_K3l.js";import{a as q,g as W,m as at}from"./accountMappingHelper-DqWxTQ5l.js";import{t as ot,A as st}from"./AddressScreen-B4B18718.js";import $ from"./NotFoundScreen-Cz3neVdz.js";import{g as it}from"./analyticsHelper-CuVH_0d-.js";import{B as ct}from"./BusinessVerificationPageScreen-BrJsE9Wf.js";import{C as lt}from"./CompanyPassportScreen-h-SBTzhu.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-BABpEztr.js";import{q as me}from"./QBOConnectionScreen-XIaYFO4N.js";import{B as ut}from"./BillPayApprovalRoutes-BgdJ81nK.js";import{R as pt}from"./ReimbursementApprovalRoutes-Bhgby_bm.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./routePaths-DVdAEsPQ.js";import"./empty-BjAZZThl.js";import"./pdf-lib-D5xPiPDu.js";import"./index-YFIL1B6n.js";import"./url-DHmmZDUO.js";import"./index-BY-tCXtJ.js";import"./decodeURIComponentSafe-BAc0Xv61.js";import"./ReimbursementApprovalRuleDetailScreen-BQN9V9kd.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]="e7b8be87-f1d6-49bd-9848-95e9b7b96626",e._sentryDebugIdIdentifier="sentry-dbid-e7b8be87-f1d6-49bd-9848-95e9b7b96626")}catch{}})();const gt=V.div`
1
+ import{j as o}from"./liveblocks-C6RAQzoe.js";import{a as u}from"./sentry-0zOCC74t.js";import{h as L,g as Q,u as U,j as y,s as le,n as G,i as H,o as ne,p as v}from"./core-BbYLl-V8.js";import{bn as De,eW as j,gq as Te,n2 as re,Ov as Me,hG as he,Om as Ue,r3 as _e,kA as be,m_ as Be,hI as Re,Oo as Fe,On as Oe,QL as Ve,zy as ze,E$ as Le,Qk as Ne,Qt as $e,c7 as ae,cN as Qe,cO as Ge,bs as He,Mn as Ze,x_ as Ke,QM as qe,Hq as We,EH as Je,Ey as ye,Ev as Xe,y2 as Se,EB as Ce,EE as Ie,EK as oe,uo as se,y1 as Ye,kc as J,kf as Ae,QN as en,lg as nn,yh as tn,Ne as an,Nf as on,ka as sn,QO as cn,kd as ln,rx as rn,N9 as dn,Na as un,rB as pn,hr as gn,Mv as ee,hj as de,hg as mn,ho as fn,Mw as hn,ye as bn,QP as yn,QQ as Sn,EY as Cn,fB as Ee,fD as xe,QR as In,ge as An,MF as En,yd as ue,gj as pe,gi as xn,yc as vn,gh as kn,gg as wn,QS as Pn,fG as ve,QT as jn,QU as Dn,yk as Tn,yb as ge,QV as Mn,fW as Un,y8 as _n,b_ as Bn,c6 as Rn,c5 as Fn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-CPXlKDVV.js";import{$ as X,X as O,z as w,ag as ke,bR as Qn,e as Z,g as Gn,bC as Hn,I as K,B as ie,bS as Zn,i as we,d as Pe,bT as Kn,ar as qn,m as je,bU as Wn,bV as Jn,bW as Xn,V as Yn,bX as et,v as nt,bY as tt}from"./index-BI0zLowA.js";import{n as V}from"./mui-CdzFMywn.js";import{M as R}from"./MobileAppDrawer-BS8RaOMH.js";import{a as q,g as W,m as at}from"./accountMappingHelper-DqWxTQ5l.js";import{t as ot,A as st}from"./AddressScreen-kANSkpLN.js";import $ from"./NotFoundScreen-Cs4XTtbb.js";import{g as it}from"./analyticsHelper-DTpcNobE.js";import{B as ct}from"./BusinessVerificationPageScreen-D1o3vV10.js";import{C as lt}from"./CompanyPassportScreen-DVEWEDid.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-OaU--UoN.js";import{q as me}from"./QBOConnectionScreen-DRa0888S.js";import{B as ut}from"./BillPayApprovalRoutes-DPwr6aot.js";import{R as pt}from"./ReimbursementApprovalRoutes-C1d9QvTl.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./routePaths-CIgI6dmE.js";import"./empty-BjAZZThl.js";import"./pdf-lib-D5xPiPDu.js";import"./index-YFIL1B6n.js";import"./url-DHmmZDUO.js";import"./index-BY-tCXtJ.js";import"./decodeURIComponentSafe-BAc0Xv61.js";import"./ReimbursementApprovalRuleDetailScreen-DQbofKBt.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]="e7b8be87-f1d6-49bd-9848-95e9b7b96626",e._sentryDebugIdIdentifier="sentry-dbid-e7b8be87-f1d6-49bd-9848-95e9b7b96626")}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-C6RAQzoe.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as x,n as H,t as en}from"./core-BbYLl-V8.js";import{bJ as nn,cq as Ce,Q8 as ye,eW as B,cC as tn,zO as Q,zy as an,Qk as sn,Qn as on,rQ as te,rE as ae,l8 as ie,tW as z,Qp as Ie,gi as $e,gh as Ge,gg as He,Qq as cn,zX as rn,EH as Ae,Ey as ke,Ev as _e,Ed as J,EB as Ee,EE as ve,EK as Pe,uo as Te,gx as un,cx as dn,fD as ln,fB as pn,fC as mn,bt as yn,Qr as fn,Dd as le,DR as gn,Qs as Sn,bK as bn,F_ as pe,E$ as hn,Qt as Cn,Qu as In,G2 as An,G6 as kn,tP as _n,Kw as En,GD as he,HD as me,Qv as vn,Qw as Pn,Qx as Tn,Qy as We,Qz as wn,MZ as Dn,PA as Un,Nc as On,QA as qe,Eh as Fn,Nd as Bn,El as Vn,QB as Oe,GZ as Ke,lg as xn,rH as Je,tY as jn,bE as Re,u8 as Ne,cA as Rn,QC as Xe,fV as Nn,Gl as zn,Gp as Ln,QD as Mn,GG as ze,QE as Zn,QF as Qn,QG as $n,QH as Gn,gq as Hn,B6 as Wn,QI as qn,Bb as Kn,Ba as Jn}from"./zeni-epic-state-CPXlKDVV.js";import{I as se,$ as oe,X as K,y as we,aS as X,bC as Ye,z as U,N as ce,e as O,B as De,g as $,bD as Xn,au as re,bE as V,bF as Yn,bG as et,ag as xe,bH as nt,v as Le,av as Me,n as tt,E as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-inh_AhlJ.js";import{a as h}from"./sentry-0zOCC74t.js";import{n as Fe,D as rt,S as ut}from"./mui-CdzFMywn.js";import{M as fe}from"./MobileAppDrawer-DXlB_K3l.js";import N from"./NotFoundScreen-Cz3neVdz.js";import{a as Ze}from"./analyticsHelper-CuVH_0d-.js";import{d as Qe}from"./routePaths-DVdAEsPQ.js";import{B as Ue}from"./BusinessVerificationPageScreen-BrJsE9Wf.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]="ed106c4b-264a-4029-93fd-035c0aa36cb1",e._sentryDebugIdIdentifier="sentry-dbid-ed106c4b-264a-4029-93fd-035c0aa36cb1")}catch{}})();const dt=Fe.div`
1
+ import{j as u}from"./liveblocks-C6RAQzoe.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as x,n as H,t as en}from"./core-BbYLl-V8.js";import{bJ as nn,cq as Ce,Q8 as ye,eW as B,cC as tn,zO as Q,zy as an,Qk as sn,Qn as on,rQ as te,rE as ae,l8 as ie,tW as z,Qp as Ie,gi as $e,gh as Ge,gg as He,Qq as cn,zX as rn,EH as Ae,Ey as ke,Ev as _e,Ed as J,EB as Ee,EE as ve,EK as Pe,uo as Te,gx as un,cx as dn,fD as ln,fB as pn,fC as mn,bt as yn,Qr as fn,Dd as le,DR as gn,Qs as Sn,bK as bn,F_ as pe,E$ as hn,Qt as Cn,Qu as In,G2 as An,G6 as kn,tP as _n,Kw as En,GD as he,HD as me,Qv as vn,Qw as Pn,Qx as Tn,Qy as We,Qz as wn,MZ as Dn,PA as Un,Nc as On,QA as qe,Eh as Fn,Nd as Bn,El as Vn,QB as Oe,GZ as Ke,lg as xn,rH as Je,tY as jn,bE as Re,u8 as Ne,cA as Rn,QC as Xe,fV as Nn,Gl as zn,Gp as Ln,QD as Mn,GG as ze,QE as Zn,QF as Qn,QG as $n,QH as Gn,gq as Hn,B6 as Wn,QI as qn,Bb as Kn,Ba as Jn}from"./zeni-epic-state-CPXlKDVV.js";import{I as se,$ as oe,X as K,y as we,aS as X,bC as Ye,z as U,N as ce,e as O,B as De,g as $,bD as Xn,au as re,bE as V,bF as Yn,bG as et,ag as xe,bH as nt,v as Le,av as Me,n as tt,E as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-BI0zLowA.js";import{a as h}from"./sentry-0zOCC74t.js";import{n as Fe,D as rt,S as ut}from"./mui-CdzFMywn.js";import{M as fe}from"./MobileAppDrawer-BS8RaOMH.js";import N from"./NotFoundScreen-Cs4XTtbb.js";import{a as Ze}from"./analyticsHelper-DTpcNobE.js";import{d as Qe}from"./routePaths-CIgI6dmE.js";import{B as Ue}from"./BusinessVerificationPageScreen-D1o3vV10.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]="ed106c4b-264a-4029-93fd-035c0aa36cb1",e._sentryDebugIdIdentifier="sentry-dbid-ed106c4b-264a-4029-93fd-035c0aa36cb1")}catch{}})();const dt=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-C6RAQzoe.js";import{a as u,b as M,q as T}from"./sentry-0zOCC74t.js";import{u as A,h as z,j as l,g as D,N as j,n as O}from"./core-BbYLl-V8.js";import{u as P,z as s,y as F,e as E,a as _,f as B,g as N,U as $,j as V,k as W,m as v}from"./index-inh_AhlJ.js";import{eW as Z,M9 as q,Ma as J,fz as G,f$ as H,Mf as K,gp as Q,cZ as R,Mg as b,Mh as X,Mi as Y,bZ as y}from"./zeni-epic-state-CPXlKDVV.js";import"./mui-CdzFMywn.js";import{u as ee}from"./useDeviceId-BcZcktIJ.js";import{f as te}from"./analyticsHelper-CuVH_0d-.js";import{t as ne}from"./getLocaleForTenant-D6kQDxGJ.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="54de692e-8331-4516-a097-158004f0c81b",t._sentryDebugIdIdentifier="sentry-dbid-54de692e-8331-4516-a097-158004f0c81b")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.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())}}}))(W),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>Z(e))),I=l((e=>q(e))),m=D(),w=F().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.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(J(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then((()=>{const e=V();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-C6RAQzoe.js";import{a as u,b as M,q as T}from"./sentry-0zOCC74t.js";import{u as A,h as z,j as l,g as D,N as j,n as O}from"./core-BbYLl-V8.js";import{u as P,z as s,y as F,e as E,a as _,f as B,g as N,U as $,j as V,k as W,m as v}from"./index-BI0zLowA.js";import{eW as Z,M9 as q,Ma as J,fz as G,f$ as H,Mf as K,gp as Q,cZ as R,Mg as b,Mh as X,Mi as Y,bZ as y}from"./zeni-epic-state-CPXlKDVV.js";import"./mui-CdzFMywn.js";import{u as ee}from"./useDeviceId-BcZcktIJ.js";import{f as te}from"./analyticsHelper-DTpcNobE.js";import{t as ne}from"./getLocaleForTenant-6cRVHcMB.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="54de692e-8331-4516-a097-158004f0c81b",t._sentryDebugIdIdentifier="sentry-dbid-54de692e-8331-4516-a097-158004f0c81b")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.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())}}}))(W),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>Z(e))),I=l((e=>q(e))),m=D(),w=F().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.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(J(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then((()=>{const e=V();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C6RAQzoe.js";import{a as i}from"./sentry-0zOCC74t.js";import{u as f,g as u,N as c}from"./core-BbYLl-V8.js";import{z as n,e as a,g as m,B as g}from"./index-inh_AhlJ.js";import{gu as p,Mx as b}from"./zeni-epic-state-CPXlKDVV.js";import{n as y}from"./mui-CdzFMywn.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="2dae93e4-0e53-4462-9b18-0a4d1b3053b5",e._sentryDebugIdIdentifier="sentry-dbid-2dae93e4-0e53-4462-9b18-0a4d1b3053b5")}catch{}})();function M(){const e=f(),t=u(),r=i.useRef(!1),d=n.isSignedIn(),o=t.state?.message==="logout"||d;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(p()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(g,{fetchState:"In-Progress"})}):s.jsx(c,{to:"../",replace:!0})}const h=y.div`
1
+ import{j as s}from"./liveblocks-C6RAQzoe.js";import{a as i}from"./sentry-0zOCC74t.js";import{u as f,g as u,N as c}from"./core-BbYLl-V8.js";import{z as n,e as a,g as m,B as g}from"./index-BI0zLowA.js";import{gu as p,Mx as b}from"./zeni-epic-state-CPXlKDVV.js";import{n as y}from"./mui-CdzFMywn.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="2dae93e4-0e53-4462-9b18-0a4d1b3053b5",e._sentryDebugIdIdentifier="sentry-dbid-2dae93e4-0e53-4462-9b18-0a4d1b3053b5")}catch{}})();function M(){const e=f(),t=u(),r=i.useRef(!1),d=n.isSignedIn(),o=t.state?.message==="logout"||d;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(p()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(g,{fetchState:"In-Progress"})}):s.jsx(c,{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 u}from"./liveblocks-C6RAQzoe.js";import{a as D}from"./sentry-0zOCC74t.js";import{h as v,u as J,g as _,j as G,i as K,n as z}from"./core-BbYLl-V8.js";import{z as U,$ as W,X as p,a0 as O,N as M,e as V,g as Z,db as q,v as g,r as Q}from"./index-inh_AhlJ.js";import{eW as X,T_ as F,Ji as I,T$ as R,TW as H,IG as y,U0 as Y,IO as E,I8 as aa,Jj as S,U1 as B,fy as ea,J9 as ta,Je as sa,J1 as oa,I$ as w,Jf as na,IY as ia,U2 as la,U3 as ra,U4 as ka,U5 as ca,U6 as T,eh as da,U7 as ua,U8 as pa}from"./zeni-epic-state-CPXlKDVV.js";import{n as Ta}from"./mui-CdzFMywn.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js";import{M as ga}from"./MobileAppDrawer-DXlB_K3l.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="d12dbec6-dd0f-433e-bb36-79554290b322",e._sentryDebugIdIdentifier="sentry-dbid-d12dbec6-dd0f-433e-bb36-79554290b322")}catch{}})();const fa=Ta.div`
1
+ import{j as u}from"./liveblocks-C6RAQzoe.js";import{a as D}from"./sentry-0zOCC74t.js";import{h as v,u as J,g as _,j as G,i as K,n as z}from"./core-BbYLl-V8.js";import{z as U,$ as W,X as p,a0 as O,N as M,e as V,g as Z,db as q,v as g,r as Q}from"./index-BI0zLowA.js";import{eW as X,T_ as F,Ji as I,T$ as R,TW as H,IG as y,U0 as Y,IO as E,I8 as aa,Jj as S,U1 as B,fy as ea,J9 as ta,Je as sa,J1 as oa,I$ as w,Jf as na,IY as ia,U2 as la,U3 as ra,U4 as ka,U5 as ca,U6 as T,eh as da,U7 as ua,U8 as pa}from"./zeni-epic-state-CPXlKDVV.js";import{n as Ta}from"./mui-CdzFMywn.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-Dt9FjqgO.js";import{M as ga}from"./MobileAppDrawer-BS8RaOMH.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="d12dbec6-dd0f-433e-bb36-79554290b322",e._sentryDebugIdIdentifier="sentry-dbid-d12dbec6-dd0f-433e-bb36-79554290b322")}catch{}})();const fa=Ta.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-C6RAQzoe.js";import se from"./NotFoundScreen-Cz3neVdz.js";import{a as c}from"./sentry-0zOCC74t.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-BbYLl-V8.js";import{Il as M,Io as le,Ii as de,eW as W,TW as X,IC as H,If as pe,J6 as ue,I$ as ke,TX as Q,TY as z,Ib as me,I8 as fe,rQ as ge,rE as he,l8 as Ie,Iw as Se,TZ as Te,IN as be,IK as Ee,Ir as Ce,IH as Ge,IG as De}from"./zeni-epic-state-CPXlKDVV.js";import{z as G,d9 as xe,x as ye,$ as je,X as b,r as Y,v,N as we,e as V,g as ve,da as Re,m as A,au as Fe}from"./index-inh_AhlJ.js";import{n as Be}from"./mui-CdzFMywn.js";import{u as Pe}from"./useInitialThreadRequest-C-5QTneS.js";import{M as Ue}from"./MobileAppDrawer-DXlB_K3l.js";import Le from"./TaskListScreen-nHc85aaE.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./useAskAiCfoHostNavButtonProps-DBmwJ5Ye.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]="87d2c9fb-efd6-41b7-b8e9-a27fc24dc8ab",e._sentryDebugIdIdentifier="sentry-dbid-87d2c9fb-efd6-41b7-b8e9-a27fc24dc8ab")}catch{}})();function Ne(){const e=O(),t=Z(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),l=c.useCallback((()=>{t(M())}),[t]),k=c.useCallback(((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[t]),a=c.useCallback((o=>{t(de({cannedResponseId:o}))}),[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const $e=re((function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=W(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=X(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>z(e.taskGroupState,p))).filter((p=>p!=null&&!p.isDeleted)).map((p=>({id:p.id,name:p.name,isDefault:p.isDefault})))}}),(function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function w(){const e=O(),t=Z(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>W(i))),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,J]=c.useState(!1),[F,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),C=g((i=>i.taskListState.updateTasksFetchState.fetchState)),U=g((i=>X(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(J(!0),t(H(!1,r)))}),[p,t]),c.useEffect((()=>{F||U.fetchState==="Completed"||(K(!0),t(pe()))}),[F,t,U.fetchState]),c.useEffect((()=>{B||L==="Completed"||(ee(!0),t(ue()))}),[B,t,L]);const ae=c.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))}),[t,r]);c.useEffect((()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return y(!1),void(T.current=!1);if(C==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0}),[P,C,l,s,e]);const N=g((i=>Q(i,r))),j=N.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Be.div`
1
+ import{j as n}from"./liveblocks-C6RAQzoe.js";import se from"./NotFoundScreen-Cs4XTtbb.js";import{a as c}from"./sentry-0zOCC74t.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-BbYLl-V8.js";import{Il as M,Io as le,Ii as de,eW as W,TW as X,IC as H,If as pe,J6 as ue,I$ as ke,TX as Q,TY as z,Ib as me,I8 as fe,rQ as ge,rE as he,l8 as Ie,Iw as Se,TZ as Te,IN as be,IK as Ee,Ir as Ce,IH as Ge,IG as De}from"./zeni-epic-state-CPXlKDVV.js";import{z as G,d9 as xe,x as ye,$ as je,X as b,r as Y,v,N as we,e as V,g as ve,da as Re,m as A,au as Fe}from"./index-BI0zLowA.js";import{n as Be}from"./mui-CdzFMywn.js";import{u as Pe}from"./useInitialThreadRequest-CINmDijc.js";import{M as Ue}from"./MobileAppDrawer-BS8RaOMH.js";import Le from"./TaskListScreen-DeyX47zW.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./useAskAiCfoHostNavButtonProps-Dt9FjqgO.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]="87d2c9fb-efd6-41b7-b8e9-a27fc24dc8ab",e._sentryDebugIdIdentifier="sentry-dbid-87d2c9fb-efd6-41b7-b8e9-a27fc24dc8ab")}catch{}})();function Ne(){const e=O(),t=Z(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),l=c.useCallback((()=>{t(M())}),[t]),k=c.useCallback(((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[t]),a=c.useCallback((o=>{t(de({cannedResponseId:o}))}),[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const $e=re((function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=W(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=X(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>z(e.taskGroupState,p))).filter((p=>p!=null&&!p.isDeleted)).map((p=>({id:p.id,name:p.name,isDefault:p.isDefault})))}}),(function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function w(){const e=O(),t=Z(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>W(i))),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,J]=c.useState(!1),[F,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),C=g((i=>i.taskListState.updateTasksFetchState.fetchState)),U=g((i=>X(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(J(!0),t(H(!1,r)))}),[p,t]),c.useEffect((()=>{F||U.fetchState==="Completed"||(K(!0),t(pe()))}),[F,t,U.fetchState]),c.useEffect((()=>{B||L==="Completed"||(ee(!0),t(ue()))}),[B,t,L]);const ae=c.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))}),[t,r]);c.useEffect((()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return y(!1),void(T.current=!1);if(C==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0}),[P,C,l,s,e]);const N=g((i=>Q(i,r))),j=N.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-C6RAQzoe.js";import i from"./NotFoundScreen-Cz3neVdz.js";import{T as r}from"./TransactionDetailScreen-Cdu4UqbO.js";import"./sentry-0zOCC74t.js";import{o as s,p as o}from"./core-BbYLl-V8.js";import"./zeni-epic-state-CPXlKDVV.js";import"./recharts-CteGH0cz.js";import"./index-inh_AhlJ.js";import"./mui-CdzFMywn.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js";import"./decodeURIComponentSafe-BAc0Xv61.js";import"./routePaths-DVdAEsPQ.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};
1
+ import{j as t}from"./liveblocks-C6RAQzoe.js";import i from"./NotFoundScreen-Cs4XTtbb.js";import{T as r}from"./TransactionDetailScreen-CseiXXfn.js";import"./sentry-0zOCC74t.js";import{o as s,p as o}from"./core-BbYLl-V8.js";import"./zeni-epic-state-CPXlKDVV.js";import"./recharts-CteGH0cz.js";import"./index-BI0zLowA.js";import"./mui-CdzFMywn.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./useAskAiCfoHostNavButtonProps-Dt9FjqgO.js";import"./decodeURIComponentSafe-BAc0Xv61.js";import"./routePaths-CIgI6dmE.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};
@@ -1,4 +1,4 @@
1
- import{j as x}from"./liveblocks-C6RAQzoe.js";import{a as i}from"./sentry-0zOCC74t.js";import{u as W,k as Ye,j as S,s as fe,g as ge,h as Te,i as Ee,N as Qe,n as Xe}from"./core-BbYLl-V8.js";import{nR as he,eW as Q,gq as Ze,Ov as et,n2 as tt,mM as at,bn as nt,cW as be,bs as Ie,ro as q,Nu as H,Ow as ve,Ox as oe,NU as De,kL as Ce,Oy as ke,NZ as se,N_ as ce,lA as Ae,Kp as ie,No as M,kF as Oe,kD as Ue,kP as ot,nE as st,Oz as ct,OA as it,vE as Y,kK as xe,JK as _e,cj as rt,c_ as lt,OB as dt,Nn as ut,OC as mt,vA as pt,OD as ft,OE as ht,OF as yt,OG as St,OH as gt,kO as Tt,OI as Et,OJ as bt,Np as It,OK as vt,OL as Dt,OM as Ct,JE as kt,Ju as At,JT as Ot,kQ as Ut,Kq as ye,nJ as xt}from"./zeni-epic-state-CPXlKDVV.js";import{$ as J,X as _,z as we,aS as Pe,y as _t,n as wt,aT as Pt,E as Ft,r as ae,I as Vt,aU as Bt,v as ne,a0 as Nt,aV as Lt,e as Fe,aW as Rt,au as zt,a4 as te}from"./index-inh_AhlJ.js";import{n as Gt,S as jt,D as $t}from"./mui-CdzFMywn.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js";import{d as Ve}from"./decodeURIComponentSafe-BAc0Xv61.js";import{h as Be,c as Ne,g as Wt,e as qt}from"./routePaths-DVdAEsPQ.js";import{u as Ht}from"./utils-OnooQQgi.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]="d97571e5-fd80-4722-a556-29881f4856d6",t._sentryDebugIdIdentifier="sentry-dbid-d97571e5-fd80-4722-a556-29881f4856d6")}catch{}})();function Jt(t=!0){const e=W(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Kt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),E=k.companyId,U=S((h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:w,capitalizableAccountOverrides:B,dismissedAccounts:z}=S((h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(w);G.current=w;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const L=S((h=>et(h.accountState)),fe),I=i.useMemo((()=>{const h={};for(const b of L)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h}),[L]),l=m!=null?I[m]??null:null,j=i.useCallback((h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),X=N.current??{},K=P.current;for(const R of u)if($.has(R.accountId)&&X[R.accountId]==null&&K?.[R.accountId]==null)return y(R.classificationType),O(R.accountId),void g(!0)}),[v]),D=i.useCallback(((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)}),[r,E]),F=i.useCallback((()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))}),[r,E,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.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=we.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Le(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 ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),f=S((u=>H(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"})),E=i.useMemo((()=>f?.fetchState==="Completed"?Le(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),w=S((u=>oe(u))),B=S((u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")})),z=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[N,P]=i.useState(!1),[L,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{P(!1),I(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{P(!1),I(!1)}),[]),[F,h]=i.useState(!1),b=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(N?L||U==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),P(!0),s(Ae(E))))}),[s,l,f?.fetchState,f?.transaction,E,c,r,p,N,L,U,b]),i.useEffect((()=>{w.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[w.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s(M("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:w,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=wt(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(jt)`
1
+ import{j as x}from"./liveblocks-C6RAQzoe.js";import{a as i}from"./sentry-0zOCC74t.js";import{u as W,k as Ye,j as S,s as fe,g as ge,h as Te,i as Ee,N as Qe,n as Xe}from"./core-BbYLl-V8.js";import{nR as he,eW as Q,gq as Ze,Ov as et,n2 as tt,mM as at,bn as nt,cW as be,bs as Ie,ro as q,Nu as H,Ow as ve,Ox as oe,NU as De,kL as Ce,Oy as ke,NZ as se,N_ as ce,lA as Ae,Kp as ie,No as M,kF as Oe,kD as Ue,kP as ot,nE as st,Oz as ct,OA as it,vE as Y,kK as xe,JK as _e,cj as rt,c_ as lt,OB as dt,Nn as ut,OC as mt,vA as pt,OD as ft,OE as ht,OF as yt,OG as St,OH as gt,kO as Tt,OI as Et,OJ as bt,Np as It,OK as vt,OL as Dt,OM as Ct,JE as kt,Ju as At,JT as Ot,kQ as Ut,Kq as ye,nJ as xt}from"./zeni-epic-state-CPXlKDVV.js";import{$ as J,X as _,z as we,aS as Pe,y as _t,n as wt,aT as Pt,E as Ft,r as ae,I as Vt,aU as Bt,v as ne,a0 as Nt,aV as Lt,e as Fe,aW as Rt,au as zt,a4 as te}from"./index-BI0zLowA.js";import{n as Gt,S as jt,D as $t}from"./mui-CdzFMywn.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-Dt9FjqgO.js";import{d as Ve}from"./decodeURIComponentSafe-BAc0Xv61.js";import{h as Be,c as Ne,g as Wt,e as qt}from"./routePaths-CIgI6dmE.js";import{u as Ht}from"./utils-OnooQQgi.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]="d97571e5-fd80-4722-a556-29881f4856d6",t._sentryDebugIdIdentifier="sentry-dbid-d97571e5-fd80-4722-a556-29881f4856d6")}catch{}})();function Jt(t=!0){const e=W(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Kt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),E=k.companyId,U=S((h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:w,capitalizableAccountOverrides:B,dismissedAccounts:z}=S((h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(w);G.current=w;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const L=S((h=>et(h.accountState)),fe),I=i.useMemo((()=>{const h={};for(const b of L)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h}),[L]),l=m!=null?I[m]??null:null,j=i.useCallback((h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),X=N.current??{},K=P.current;for(const R of u)if($.has(R.accountId)&&X[R.accountId]==null&&K?.[R.accountId]==null)return y(R.classificationType),O(R.accountId),void g(!0)}),[v]),D=i.useCallback(((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)}),[r,E]),F=i.useCallback((()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))}),[r,E,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.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=we.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Le(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 ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),f=S((u=>H(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"})),E=i.useMemo((()=>f?.fetchState==="Completed"?Le(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),w=S((u=>oe(u))),B=S((u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")})),z=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[N,P]=i.useState(!1),[L,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{P(!1),I(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{P(!1),I(!1)}),[]),[F,h]=i.useState(!1),b=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(N?L||U==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),P(!0),s(Ae(E))))}),[s,l,f?.fetchState,f?.transaction,E,c,r,p,N,L,U,b]),i.useEffect((()=>{w.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[w.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s(M("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:w,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=wt(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(jt)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-C6RAQzoe.js";import{h as W,g as Z,u as K,i as X,j as S,N as R,n as H,o as ve,p as j}from"./core-BbYLl-V8.js";import{eW as q,r3 as Q,jZ as u,RS as ee,Kg as De,bo as le,RT as Pe,kA as te,NW as ae,RU as ue,RV as be,bE as Y,Kc as ye,RW as Ee,RX as me,RY as je,Kf as Ae,RZ as xe,R_ as pe,R$ as Me,S0 as ge,S1 as Le,S2 as Ce,S3 as fe,Ls as Be}from"./zeni-epic-state-CPXlKDVV.js";import{a as de,$ as ne,X as N,e as G,co as ce,v as U,r as oe,V as Fe,h as Oe}from"./index-inh_AhlJ.js";import"./mui-CdzFMywn.js";import{a as g}from"./sentry-0zOCC74t.js";import{w as se}from"./withTransactionSidePanel-m5dzUQbh.js";import{p as ie,c as re}from"./routePaths-DVdAEsPQ.js";import{v as ze}from"./utils-OnooQQgi.js";import{d as P}from"./decodeURIComponentSafe-BAc0Xv61.js";import{Z as Ge}from"./ZeniAccountStatementScreen-qoPclGWB.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js";import"./TransactionDetailScreen-Cdu4UqbO.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]="96207a41-64a6-49ec-a10c-65a99b4e797a",a._sentryDebugIdIdentifier="sentry-dbid-96207a41-64a6-49ec-a10c-65a99b4e797a")}catch{}})();const Re=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),we=H((function(a,e){const t=Pe(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);G.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=U(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=W(),t=Z(),n=K(),c=t.pathname.split("/").find((r=>Re.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=X(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=$e(o),y="month",I=S((r=>q(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(N.isProjectsTransactionsEnabled),x=S((r=>Q(r)))&&k,{dataAvailable:C,initialTimeframeTick:b}=_e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo((()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.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(R,{to:"../"}):s.jsx(we,{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=H((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??Se();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)}`),G.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=U(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),Ne=se((function({referrerType:a,...e}){const t=W(),n=Z(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>be(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(N.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ue(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},$=Ze(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:$}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[b,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:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:Se(_.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ue=(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,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),qe=H((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)}`),G.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(Ae(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=U(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),We=se((function({referrerType:a,...e}){const t=W(),n=Z(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>je(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(N.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ke(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},$=Xe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:$}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[b,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(qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:he(_.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(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,Xe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H((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)}`),G.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(ge(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=U(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=U(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=W(),n=Z(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=X(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S((v=>Me(v.transactionListState,A,p))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((v=>q(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Qe(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,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(N.isTransactionCommentingEnabled),{isFeatureEnabled:_}=z(N.isProjectsTransactionsEnabled),d=S((v=>Q(v)))&&_,{areTenantIdsInSync:$}=Fe();g.useEffect((()=>{!b&&r!=null&&$&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[b,r,c,$]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(He,{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(R,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(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=Z().state?.referrer,e=S((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[S((n=>q(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(Ge,{})}),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(R,{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(R,{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(R,{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(Ne,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(We,{referrerType:a})})]})}export{kt as default};
1
+ import{j as s}from"./liveblocks-C6RAQzoe.js";import{h as W,g as Z,u as K,i as X,j as S,N as R,n as H,o as ve,p as j}from"./core-BbYLl-V8.js";import{eW as q,r3 as Q,jZ as u,RS as ee,Kg as De,bo as le,RT as Pe,kA as te,NW as ae,RU as ue,RV as be,bE as Y,Kc as ye,RW as Ee,RX as me,RY as je,Kf as Ae,RZ as xe,R_ as pe,R$ as Me,S0 as ge,S1 as Le,S2 as Ce,S3 as fe,Ls as Be}from"./zeni-epic-state-CPXlKDVV.js";import{a as de,$ as ne,X as N,e as G,co as ce,v as U,r as oe,V as Fe,h as Oe}from"./index-BI0zLowA.js";import"./mui-CdzFMywn.js";import{a as g}from"./sentry-0zOCC74t.js";import{w as se}from"./withTransactionSidePanel-CxcB1MIS.js";import{p as ie,c as re}from"./routePaths-CIgI6dmE.js";import{v as ze}from"./utils-OnooQQgi.js";import{d as P}from"./decodeURIComponentSafe-BAc0Xv61.js";import{Z as Ge}from"./ZeniAccountStatementScreen-C1OGbg3O.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./useAskAiCfoHostNavButtonProps-Dt9FjqgO.js";import"./TransactionDetailScreen-CseiXXfn.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]="96207a41-64a6-49ec-a10c-65a99b4e797a",a._sentryDebugIdIdentifier="sentry-dbid-96207a41-64a6-49ec-a10c-65a99b4e797a")}catch{}})();const Re=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),we=H((function(a,e){const t=Pe(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);G.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=U(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=W(),t=Z(),n=K(),c=t.pathname.split("/").find((r=>Re.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=X(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=$e(o),y="month",I=S((r=>q(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(N.isProjectsTransactionsEnabled),x=S((r=>Q(r)))&&k,{dataAvailable:C,initialTimeframeTick:b}=_e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo((()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.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(R,{to:"../"}):s.jsx(we,{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=H((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??Se();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)}`),G.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=U(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),Ne=se((function({referrerType:a,...e}){const t=W(),n=Z(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>be(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(N.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ue(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},$=Ze(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:$}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[b,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:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:Se(_.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ue=(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,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),qe=H((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)}`),G.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(Ae(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=U(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),We=se((function({referrerType:a,...e}){const t=W(),n=Z(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>je(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(N.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ke(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},$=Xe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:$}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[b,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(qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:he(_.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(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,Xe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H((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)}`),G.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(ge(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=U(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=U(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=W(),n=Z(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=X(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S((v=>Me(v.transactionListState,A,p))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((v=>q(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Qe(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,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(N.isTransactionCommentingEnabled),{isFeatureEnabled:_}=z(N.isProjectsTransactionsEnabled),d=S((v=>Q(v)))&&_,{areTenantIdsInSync:$}=Fe();g.useEffect((()=>{!b&&r!=null&&$&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[b,r,c,$]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(He,{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(R,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(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=Z().state?.referrer,e=S((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[S((n=>q(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(Ge,{})}),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(R,{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(R,{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(R,{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(Ne,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(We,{referrerType:a})})]})}export{kt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-C6RAQzoe.js";import{h as B,g as F,u as L,i as O,j as g,N as D,n as G,o as Ie,p as k}from"./core-BbYLl-V8.js";import{cr as N,eW as E,QC as U,GD as ae,fV as Z,Gl as ne,QE as Te,GG as ke,QA as je,QB as se,QQ as be,EK as Ae,uo as Ee,QG as ve,GZ as De,QD as re,cV as H,yH as oe,fB as Be,fD as Fe,RP as Le,RQ as Ue,Gm as Pe,RR as Re,Gn as Me,Gw as Ve,bs as Oe,bJ as Ge,cC as Ne,bK as _e,cq as $e,bt as ze,Mb as Qe,cp as Ze}from"./zeni-epic-state-CPXlKDVV.js";import{I as _,ar as He,z as A,N as $,e as j,ch as Ke,ci as We,cj as Q,n as K,y as qe,V as Je,a0 as Xe,$ as ie,X as v,E as Ye,B as et,ck as tt,au as W,v as at,cl as nt,r as q,cm as st,_ as X,cn as rt,i as ot}from"./index-inh_AhlJ.js";import{D as it,n as R,S as ct}from"./mui-CdzFMywn.js";import lt from"./NotFoundScreen-Cz3neVdz.js";import{S as Y}from"./SetupPagesScreen-DC__s7_X.js";import{a as p}from"./sentry-0zOCC74t.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js";import{u as dt}from"./useInitialThreadRequest-C-5QTneS.js";import{u as pt}from"./useCashManagementBanner-B67UZZ7S.js";import{M as ce}from"./MobileAppDrawer-DXlB_K3l.js";import{F as mt}from"./FeaturePreviewScreen-CxbSxzBU.js";import{a as ee}from"./analyticsHelper-CuVH_0d-.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./routePaths-DVdAEsPQ.js";import"./BusinessVerificationPageScreen-BrJsE9Wf.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]="c1afd9fc-b56e-4819-9221-888f1020f081",t._sentryDebugIdIdentifier="sentry-dbid-c1afd9fc-b56e-4819-9221-888f1020f081")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(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))}}}))(Ke);function yt(){const t=B(),a=F(),n=L(),{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=>U(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:U(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"))}}}))(We),ht=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=O(),r=L(),[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=>U(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`
1
+ import{j as e}from"./liveblocks-C6RAQzoe.js";import{h as B,g as F,u as L,i as O,j as g,N as D,n as G,o as Ie,p as k}from"./core-BbYLl-V8.js";import{cr as N,eW as E,QC as U,GD as ae,fV as Z,Gl as ne,QE as Te,GG as ke,QA as je,QB as se,QQ as be,EK as Ae,uo as Ee,QG as ve,GZ as De,QD as re,cV as H,yH as oe,fB as Be,fD as Fe,RP as Le,RQ as Ue,Gm as Pe,RR as Re,Gn as Me,Gw as Ve,bs as Oe,bJ as Ge,cC as Ne,bK as _e,cq as $e,bt as ze,Mb as Qe,cp as Ze}from"./zeni-epic-state-CPXlKDVV.js";import{I as _,ar as He,z as A,N as $,e as j,ch as Ke,ci as We,cj as Q,n as K,y as qe,V as Je,a0 as Xe,$ as ie,X as v,E as Ye,B as et,ck as tt,au as W,v as at,cl as nt,r as q,cm as st,_ as X,cn as rt,i as ot}from"./index-BI0zLowA.js";import{D as it,n as R,S as ct}from"./mui-CdzFMywn.js";import lt from"./NotFoundScreen-Cs4XTtbb.js";import{S as Y}from"./SetupPagesScreen-dOsZbhRG.js";import{a as p}from"./sentry-0zOCC74t.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-Dt9FjqgO.js";import{u as dt}from"./useInitialThreadRequest-CINmDijc.js";import{u as pt}from"./useCashManagementBanner-DiCLDHdY.js";import{M as ce}from"./MobileAppDrawer-BS8RaOMH.js";import{F as mt}from"./FeaturePreviewScreen-Cw4bAxEp.js";import{a as ee}from"./analyticsHelper-DTpcNobE.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.js";import"./routePaths-CIgI6dmE.js";import"./BusinessVerificationPageScreen-D1o3vV10.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]="c1afd9fc-b56e-4819-9221-888f1020f081",t._sentryDebugIdIdentifier="sentry-dbid-c1afd9fc-b56e-4819-9221-888f1020f081")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(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))}}}))(Ke);function yt(){const t=B(),a=F(),n=L(),{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=>U(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:U(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"))}}}))(We),ht=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=O(),r=L(),[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=>U(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-C6RAQzoe.js";import{a as f}from"./sentry-0zOCC74t.js";import{h as J,g as Y,i as B,j as S,n as G,u as z,o as at,p as O,N as $}from"./core-BbYLl-V8.js";import{eW as L,Nk as Ee,Nl as Re,gx as X,cx as be,cy as Ie,xg as St,Nm as nt,xk as zt,Lj as ee,kA as te,xe as Yt,x8 as qt,Nn as Ue,x0 as Ht,w$ as Wt,wV as Qt,x5 as Zt,xl as Xt,No as he,Np as Me,x1 as ea,Nq as pe,fI as ft,xA as gt,xt as vt,Nr as xt,pV as Tt,xo as yt,xm as Dt,Ns as Ct,xH as Et,xE as bt,xp as It,xG as Je,JK as kt,Nt as ta,Nu as aa,cA as na,Nv as sa,Nw as oa,Nx as me,Ny as ie,Nz as ke,Lk as Ge,xW as ye,Li as De,xJ as wt,xh as $e,NA as la,Ll as H,NB as Ke,xb as ia,NC as ca,ND as da,NE as ze,NF as Ye,NG as qe,NH as He,xQ as we,NI as At,xx as jt,NJ as ra,NK as ua,NL as ha,NM as pa,NN as ma,NO as Sa,NP as fa,NQ as ga,uA as va,uI as xa,uB as Ta,Kq as je,NR as ya,NS as Da,jZ as Fe,bo as Ca,NT as Ea,NU as ba,ly as Ia,lH as ka,Kp as Pe,bE as st,NV as Ft,K0 as Pt,NW as wa,NX as Aa,NY as ja,lJ as Fa,NZ as ot,N_ as lt,N$ as it,O0 as ct,O1 as Pa,lF as Va,O2 as _a,lI as La,O3 as Oa,O4 as Vt,KL as _t,kY as Na,O5 as Ba,O6 as Ve,O7 as Lt,KJ as Ot,Ac as Ra,O8 as Ua,O9 as Ma,lg as Nt,Oa as Ja,Ob as Ga,KX as $a,s9 as Ka,Oc as Bt,Od as dt,KU as _e,Oe as rt,Of as za,KZ as Ya,Og as qa,Oh as Ha,Oi as Wa,Oj as Qa,Ok as Za,sc as Xa,Ol as en,Lm as tn,Om as an,KC as Le,hI as nn,On as sn,Oo as on,hG as ln,Op as cn,Oq as dn,Ag as rn,Or as un,Os as hn,Ot as pn,Ou as mn,l0 as Sn,bn as fn,fD as gn,fB as vn}from"./zeni-epic-state-CPXlKDVV.js";import{z as R,ar as Oe,B as Rt,N as Q,e as j,a4 as Z,aB as xn,v as M,a as Ce,x as ce,aC as We,aD as Tn,aE as yn,r as Qe,aF as Dn,y as Cn,n as de,E as Ze,$ as ae,X as K,aG as En,m as Xe,a0 as Se,aH as bn,aI as Ut,V as In,aJ as kn,I as wn,aK as An,au as Mt,aL as jn,o as W,S as Fn,G as Jt,R as Pn,aM as Vn,aN as _n,g as et,aO as Ln,aP as On,q as Nn,aQ as Bn,aR as Rn}from"./index-inh_AhlJ.js";import{n as U,D as Un,S as Gt}from"./mui-CdzFMywn.js";import{t as Mn,A as Jn}from"./AddressScreen-B4B18718.js";import le from"./NotFoundScreen-Cz3neVdz.js";import{F as Gn}from"./FeaturePreviewScreen-CxbSxzBU.js";import{c as q,v as tt,d as $n}from"./routePaths-DVdAEsPQ.js";import{p as $t}from"./pathToGoBack-BDzzMRY3.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DBmwJ5Ye.js";import{M as ge}from"./MobileAppDrawer-DXlB_K3l.js";import{D as Kn}from"./DrawerScreen-CaKLPeP5.js";import{g as zn,m as Yn}from"./accountMappingHelper-DqWxTQ5l.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="e97ca61c-b5d2-4ed2-b52e-a1570f8d112e",e._sentryDebugIdIdentifier="sentry-dbid-e97ca61c-b5d2-4ed2-b52e-a1570f8d112e")}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(zt()),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),Wn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=B(),{scheduleType:o}=B();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=Oe(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(Q,{analytics:j,onLoad:()=>{Qn(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})},Kt=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}},Qn=(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:{...Kt(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`
1
+ import{j as l}from"./liveblocks-C6RAQzoe.js";import{a as f}from"./sentry-0zOCC74t.js";import{h as J,g as Y,i as B,j as S,n as G,u as z,o as at,p as O,N as $}from"./core-BbYLl-V8.js";import{eW as L,Nk as Ee,Nl as Re,gx as X,cx as be,cy as Ie,xg as St,Nm as nt,xk as zt,Lj as ee,kA as te,xe as Yt,x8 as qt,Nn as Ue,x0 as Ht,w$ as Wt,wV as Qt,x5 as Zt,xl as Xt,No as he,Np as Me,x1 as ea,Nq as pe,fI as ft,xA as gt,xt as vt,Nr as xt,pV as Tt,xo as yt,xm as Dt,Ns as Ct,xH as Et,xE as bt,xp as It,xG as Je,JK as kt,Nt as ta,Nu as aa,cA as na,Nv as sa,Nw as oa,Nx as me,Ny as ie,Nz as ke,Lk as Ge,xW as ye,Li as De,xJ as wt,xh as $e,NA as la,Ll as H,NB as Ke,xb as ia,NC as ca,ND as da,NE as ze,NF as Ye,NG as qe,NH as He,xQ as we,NI as At,xx as jt,NJ as ra,NK as ua,NL as ha,NM as pa,NN as ma,NO as Sa,NP as fa,NQ as ga,uA as va,uI as xa,uB as Ta,Kq as je,NR as ya,NS as Da,jZ as Fe,bo as Ca,NT as Ea,NU as ba,ly as Ia,lH as ka,Kp as Pe,bE as st,NV as Ft,K0 as Pt,NW as wa,NX as Aa,NY as ja,lJ as Fa,NZ as ot,N_ as lt,N$ as it,O0 as ct,O1 as Pa,lF as Va,O2 as _a,lI as La,O3 as Oa,O4 as Vt,KL as _t,kY as Na,O5 as Ba,O6 as Ve,O7 as Lt,KJ as Ot,Ac as Ra,O8 as Ua,O9 as Ma,lg as Nt,Oa as Ja,Ob as Ga,KX as $a,s9 as Ka,Oc as Bt,Od as dt,KU as _e,Oe as rt,Of as za,KZ as Ya,Og as qa,Oh as Ha,Oi as Wa,Oj as Qa,Ok as Za,sc as Xa,Ol as en,Lm as tn,Om as an,KC as Le,hI as nn,On as sn,Oo as on,hG as ln,Op as cn,Oq as dn,Ag as rn,Or as un,Os as hn,Ot as pn,Ou as mn,l0 as Sn,bn as fn,fD as gn,fB as vn}from"./zeni-epic-state-CPXlKDVV.js";import{z as R,ar as Oe,B as Rt,N as Q,e as j,a4 as Z,aB as xn,v as M,a as Ce,x as ce,aC as We,aD as Tn,aE as yn,r as Qe,aF as Dn,y as Cn,n as de,E as Ze,$ as ae,X as K,aG as En,m as Xe,a0 as Se,aH as bn,aI as Ut,V as In,aJ as kn,I as wn,aK as An,au as Mt,aL as jn,o as W,S as Fn,G as Jt,R as Pn,aM as Vn,aN as _n,g as et,aO as Ln,aP as On,q as Nn,aQ as Bn,aR as Rn}from"./index-BI0zLowA.js";import{n as U,D as Un,S as Gt}from"./mui-CdzFMywn.js";import{t as Mn,A as Jn}from"./AddressScreen-kANSkpLN.js";import le from"./NotFoundScreen-Cs4XTtbb.js";import{F as Gn}from"./FeaturePreviewScreen-Cw4bAxEp.js";import{c as q,v as tt,d as $n}from"./routePaths-CIgI6dmE.js";import{p as $t}from"./pathToGoBack-BDzzMRY3.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-Dt9FjqgO.js";import{M as ge}from"./MobileAppDrawer-BS8RaOMH.js";import{D as Kn}from"./DrawerScreen-BVS8mUkg.js";import{g as zn,m as Yn}from"./accountMappingHelper-DqWxTQ5l.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="e97ca61c-b5d2-4ed2-b52e-a1570f8d112e",e._sentryDebugIdIdentifier="sentry-dbid-e97ca61c-b5d2-4ed2-b52e-a1570f8d112e")}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(zt()),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),Wn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=B(),{scheduleType:o}=B();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=Oe(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(Q,{analytics:j,onLoad:()=>{Qn(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})},Kt=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}},Qn=(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:{...Kt(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%;
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-C6RAQzoe.js";import{a as f}from"./sentry-0zOCC74t.js";import{t as u,u as h,j as b,N as y}from"./core-BbYLl-V8.js";import{Mu as I,fz as w,Bx as x}from"./zeni-epic-state-CPXlKDVV.js";import{z as l,B as j,G as S,R as D}from"./index-inh_AhlJ.js";import{n as p}from"./mui-CdzFMywn.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="af1e78d2-d943-4a36-bfb8-cb97f65bee13",e._sentryDebugIdIdentifier="sentry-dbid-af1e78d2-d943-4a36-bfb8-cb97f65bee13")}catch{}})();const q=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",c=e.get("profileId")??"",[n,g]=f.useState(!1),a=h(),i=b((m=>I(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(y,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(g(!0),a(x(t,c,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=p.div`
1
+ import{j as o}from"./liveblocks-C6RAQzoe.js";import{a as f}from"./sentry-0zOCC74t.js";import{t as u,u as h,j as b,N as y}from"./core-BbYLl-V8.js";import{Mu as I,fz as w,Bx as x}from"./zeni-epic-state-CPXlKDVV.js";import{z as l,B as j,G as S,R as D}from"./index-BI0zLowA.js";import{n as p}from"./mui-CdzFMywn.js";import"./recharts-CteGH0cz.js";import"./analytics-CAwmb4Gq.js";import"./plaid-CF_Au40f.js";import"./dnd-DQSp8Rgc.js";import"./stripe-cKAAJElX.js";import"./lottie-MHL8Gjsq.js";import"./lexical-DSV51oa2.js";import"./pdf-DNFehLU8.js";import"./utils-OnooQQgi.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]="af1e78d2-d943-4a36-bfb8-cb97f65bee13",e._sentryDebugIdIdentifier="sentry-dbid-af1e78d2-d943-4a36-bfb8-cb97f65bee13")}catch{}})();const q=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",c=e.get("profileId")??"",[n,g]=f.useState(!1),a=h(),i=b((m=>I(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(y,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(g(!0),a(x(t,c,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=p.div`
2
2
  display: flex;
3
3
  width: 100%;
4
4
  height: 100vh;