@zeniai/web-app-ui 5.1.73-qa → 5.1.75-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-BqX5wkCR.js +1 -0
- package/dist/assets/AddressScreen-ScWWmTbP.js +9 -0
- package/dist/assets/AiCfoScreen-quWQqhzX.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-CQmYX8YN.js +1 -0
- package/dist/assets/BillPayRoutes-jZS0wJcj.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-DFgVqXvI.js +9 -0
- package/dist/assets/CardsAiCfoScreen-BbBCL2AM.js +14 -0
- package/dist/assets/ChargeCardRoutes-BPGek5pB.js +71 -0
- package/dist/assets/{CompanyPassportScreen-C6ugmGBs.js → CompanyPassportScreen-DavSJynu.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-BbANlW5J.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-kiJ2IeW7.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-6ipmFo_1.js +30 -0
- package/dist/assets/DashboardRoutes-Brg8B8gk.js +20 -0
- package/dist/assets/DefaultTenantHome-B6se2qjz.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-jS6brB2p.js +18 -0
- package/dist/assets/DrawerScreen-D0g6PABS.js +1 -0
- package/dist/assets/EntityDetailRoutes-qim0q068.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-D3rXxAM_.js +25 -0
- package/dist/assets/FeaturePreviewScreen-Y7t6ABdh.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-BUpxwCNc.js +1 -0
- package/dist/assets/MagicLinkRoutes-5wgvqx65.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CelaLjKf.js +12 -0
- package/dist/assets/{MobileAppDrawer-Djrnxmnv.js → MobileAppDrawer-Sx7ydj7A.js} +1 -1
- package/dist/assets/NotFoundScreen-BDl5tn8o.js +1 -0
- package/dist/assets/NotificationRoutes-Cdcu8PTz.js +1 -0
- package/dist/assets/OAuthConsentScreen-C5pyboC-.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DjwWiUAb.js +1 -0
- package/dist/assets/PeopleRoutes-x62_g_WP.js +22 -0
- package/dist/assets/PerformanceRoutes-DQciMsYC.js +1 -0
- package/dist/assets/{Preview-9K4X8cjD.js → Preview-DIWTyMQY.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DrwgecUL.js → QBOConnectionScreen-DXq_HXCX.js} +1 -1
- package/dist/assets/ReferralListScreen-DNdLnut4.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-BazeprVG.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js +1 -0
- package/dist/assets/ReimbursementRoutes-Bb9JPi0m.js +68 -0
- package/dist/assets/ReportsRoutes-DB2v4EPm.js +1 -0
- package/dist/assets/RewardsRoutes-ChJyJSHY.js +1 -0
- package/dist/assets/ScreenRoutes-8R8Dd2d9.js +2 -0
- package/dist/assets/SettingsRoutes-oK_kou4I.js +57 -0
- package/dist/assets/SetupPagesScreen-CVKPKeC9.js +29 -0
- package/dist/assets/SignInScreen-C7vB3Bra.js +1 -0
- package/dist/assets/SignOutScreen-CQYa9Dvp.js +9 -0
- package/dist/assets/TaskListScreen-WRcn05lO.js +9 -0
- package/dist/assets/TaskRoutes-DoWinBID.js +9 -0
- package/dist/assets/TransactionDetailRoutes-B4ryZwp2.js +1 -0
- package/dist/assets/TransactionDetailScreen-DB5lxQrk.js +5 -0
- package/dist/assets/TransactionListRoutes-6SM8gNlu.js +1 -0
- package/dist/assets/TreasuryRoutes-DHuVCY9q.js +37 -0
- package/dist/assets/{VendorsRoutes-CXgYXHLy.js → VendorsRoutes-CwYVQ8VQ.js} +20 -20
- package/dist/assets/WiseConfirmationScreen-DLnf9dkP.js +12 -0
- package/dist/assets/ZeniAccountRoutes-u96OM2YN.js +73 -0
- package/dist/assets/ZeniAccountStatementScreen-D9UEHLLF.js +9 -0
- package/dist/assets/{accountMappingHelper-1n6-L3ip.js → accountMappingHelper-s2xO6MjH.js} +1 -1
- package/dist/assets/{analytics-B5_QbYyf.js → analytics-Ba6zmRos.js} +1 -1
- package/dist/assets/{analyticsHelper-llu9ZY3e.js → analyticsHelper-Cq2pq-lr.js} +1 -1
- package/dist/assets/{core-C5uCD0QC.js → core-D6ttr5iw.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-WSnueMtI.js → decodeURIComponentSafe-D0vQ4d1Q.js} +1 -1
- package/dist/assets/dnd-C751Xq24.js +6 -0
- package/dist/assets/{index-WNZaIyi6.js → empty-0_eSm854.js} +1 -1
- package/dist/assets/{empty-D1KuG6Gh.js → empty-B81gHGCB.js} +1 -1
- package/dist/assets/{emptyVideoElement-B_-dVSa6.js → emptyVideoElement-DNxKi3mL.js} +1 -1
- package/dist/assets/epic-BpVO28im.js +2 -0
- package/dist/assets/getLocaleForTenant-O3Y2pcaQ.js +1 -0
- package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
- package/dist/assets/{index-DxRIv8ho.js → index-CETE-7wR.js} +1 -1
- package/dist/assets/{index-mGu5aIQO.js → index-DK3W-xXd.js} +2 -2
- package/dist/assets/{index-DiaEA_nH.js → index-DL-oj321.js} +1 -1
- package/dist/assets/{index-5jMBO2WT.js → index-DyaqeLYa.js} +1 -1
- package/dist/assets/{index-CXNJX-KR.js → index-ilZtTEZn.js} +33335 -27881
- package/dist/assets/index-lXh6fiHl.js +1 -0
- package/dist/assets/{index-hHuZx5_w.js → index-pFVjg2n3.js} +1 -1
- package/dist/assets/index-xNwL9wH4.js +1 -0
- package/dist/assets/{lexical-hLnHAypU.js → lexical-T2nlwAPk.js} +1 -1
- package/dist/assets/{liveblocks-2V3XhuUi.js → liveblocks-CS0rfBBF.js} +1 -1
- package/dist/assets/{lottie-DTk6h7CK.js → lottie-CZmubsAo.js} +1 -1
- package/dist/assets/{mui-Dpp2C1dL.js → mui-vLo47rlo.js} +1 -1
- package/dist/assets/{pathToGoBack-spodqoPj.js → pathToGoBack-CkJN8BOO.js} +1 -1
- package/dist/assets/{pdf-BNUWc0Kr.js → pdf-CdoB_huE.js} +3 -3
- package/dist/assets/{pdf-lib-clv_iGdC.js → pdf-lib-RRzqb1kw.js} +1 -1
- package/dist/assets/{plaid-BYfDj3kT.js → plaid-IKw4XOsd.js} +1 -1
- package/dist/assets/{pusher-Kk7s6P3d.js → pusher-Cj6_igRe.js} +1 -1
- package/dist/assets/{react-Dt710hEm.js → react-BDJBiih3.js} +1 -1
- package/dist/assets/{react-D3szvoI3.js → react-BbjDrfEs.js} +1 -1
- package/dist/assets/{react-Dzi-2YSW.js → react-BkKsXl-3.js} +1 -1
- package/dist/assets/{react-M3dO3ysp.js → react-CCfELnN3.js} +1 -1
- package/dist/assets/{react-D_RXy40V.js → react-CppN-oCz.js} +1 -1
- package/dist/assets/{react-DSH7yy9o.js → react-D95yXzXQ.js} +1 -1
- package/dist/assets/{recharts-CrS5Kd38.js → recharts-BDyAk4nR.js} +3 -3
- package/dist/assets/routePaths-C1rKvS5o.js +1 -0
- package/dist/assets/{sentry-Bjq7jLMy.js → sentry-CEfOando.js} +1 -1
- package/dist/assets/{url-RMDL_YV7.js → url-BQNo9gT5.js} +1 -1
- package/dist/assets/{url-Dtn96jHv.js → url-C9_bAZjF.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-33WX5dhg.js +1 -0
- package/dist/assets/useCashManagementBanner-CBJfpbK7.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-Cvnaf2Z-.js +1 -0
- package/dist/assets/{useDeviceId-C2SjyoZO.js → useDeviceId-DISstVTH.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BzWsu8a4.js +1 -0
- package/dist/assets/useInitialThreadRequest-Bx57kb_d.js +1 -0
- package/dist/assets/{utils-Y3UWLN-V.js → utils-DKj7mVPA.js} +2 -2
- package/dist/assets/withTransactionSidePanel-DeW-W6do.js +21 -0
- package/dist/assets/zeni-epic-state-Cl3jFj7z.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-D0pPyHh_.js +0 -1
- package/dist/assets/AddressScreen-DJKsJ10Z.js +0 -9
- package/dist/assets/AiCfoScreen-D72rCutj.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-B-2S4SNn.js +0 -1
- package/dist/assets/BillPayRoutes-4uZ7joLO.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-g2faFJJh.js +0 -9
- package/dist/assets/ChargeCardRoutes-DpCZ_jyS.js +0 -71
- package/dist/assets/ConnectionAuthScreen-ByAXPikh.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-D3CEJKzV.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-DR9dynHR.js +0 -23
- package/dist/assets/DashboardRoutes-DOnDhlUi.js +0 -20
- package/dist/assets/DefaultTenantHome-B2PohhkN.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-lJID4K8i.js +0 -18
- package/dist/assets/DrawerScreen-drwDX_t8.js +0 -1
- package/dist/assets/EntityDetailRoutes-ORWd6K8g.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-CLYPTfXE.js +0 -25
- package/dist/assets/FeaturePreviewScreen-2lGXkGnT.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-DWy-9hg1.js +0 -1
- package/dist/assets/MagicLinkRoutes-BGVALfKT.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-D0cBpIHO.js +0 -12
- package/dist/assets/NotFoundScreen-C6fP8ezZ.js +0 -1
- package/dist/assets/NotificationRoutes-BKEZI2NF.js +0 -1
- package/dist/assets/OAuthConsentScreen-CKsmYMlV.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-97f0lT8j.js +0 -1
- package/dist/assets/PeopleRoutes-gwhry3Ow.js +0 -22
- package/dist/assets/PerformanceRoutes-BNgmYjW8.js +0 -1
- package/dist/assets/ReferralListScreen-7zacnt57.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-yt8YQciv.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CN_fVdI4.js +0 -1
- package/dist/assets/ReimbursementRoutes-BBYA68YB.js +0 -68
- package/dist/assets/ReportsRoutes-BYiPKbc6.js +0 -1
- package/dist/assets/RewardsRoutes-D631WDFb.js +0 -1
- package/dist/assets/ScreenRoutes-CandKxww.js +0 -2
- package/dist/assets/SettingsRoutes-Cb24ieWi.js +0 -57
- package/dist/assets/SetupPagesScreen-cvYJWiZ-.js +0 -29
- package/dist/assets/SignInScreen-UxDhgwJf.js +0 -1
- package/dist/assets/SignOutScreen-pyZ6yW6l.js +0 -9
- package/dist/assets/TaskListScreen-D3jwxPFn.js +0 -9
- package/dist/assets/TaskRoutes-BqQas_t-.js +0 -9
- package/dist/assets/TransactionDetailRoutes-zmbZfCAF.js +0 -1
- package/dist/assets/TransactionDetailScreen-C_-nFgWB.js +0 -5
- package/dist/assets/TransactionListRoutes-8BMGQlvq.js +0 -1
- package/dist/assets/TreasuryRoutes-aI9AzHq8.js +0 -37
- package/dist/assets/WiseConfirmationScreen-CO23H5IW.js +0 -12
- package/dist/assets/ZeniAccountRoutes-C1u_CJhb.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-Byji_IxT.js +0 -9
- package/dist/assets/dnd-CtoEWKvO.js +0 -6
- package/dist/assets/empty-CNiNdD6H.js +0 -1
- package/dist/assets/epic-GX18T2Rd.js +0 -2
- package/dist/assets/getLocaleForTenant-CSnj06iQ.js +0 -1
- package/dist/assets/index-BXJxTGtH.js +0 -1
- package/dist/assets/routePaths-DDv-R3QG.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-wNyzo2Lm.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-B-Hj-PQt.js +0 -1
- package/dist/assets/useInitialThreadRequest-07AtACng.js +0 -1
- package/dist/assets/withTransactionSidePanel-BMgKJwSH.js +0 -21
- package/dist/assets/zeni-epic-state-lec4Lm2t.js +0 -13
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-2V3XhuUi.js";import{g as z,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-C5uCD0QC.js";import{eR as M,ff as I,Kr as Te,jI as J,p_ as Z,qP as F,jw as Re,iA as Ae,uc as X,qU as Oe,bs as Fe,Ks as ke,bn as De,vl as je,Kt as Ee,Ku as Pe,u4 as Le,Kv as H,Kw as Me,Kx as ve,Ky as Be,Kz as Ke,KA as w,KB as k,KC as D,KD as Y,KE as j,KF as E,dE as Ue,v1 as Ve,uR as N,uS as q,v7 as xe,uW as $,vd as ze,KG as Ge,KH as He,KI as Ye,KJ as Ne,KK as qe,f0 as $e,e_ as Qe}from"./zeni-epic-state-lec4Lm2t.js";import{Q as We,R as Je,T as Ze,U as Xe,J as ea,a as ee,G as P,z as ae,V as aa,k as sa,c as ta,W as oa,Y as na,x as ra,d as L,f as ia,$ as la,r as se,a0 as ca,a1 as da,a2 as pa}from"./index-CXNJX-KR.js";import"./mui-Dpp2C1dL.js";import fa from"./NotFoundScreen-C6fP8ezZ.js";import{F as ma}from"./FeaturePreviewScreen-2lGXkGnT.js";import{a as _}from"./sentry-Bjq7jLMy.js";import{u as ua}from"./useInitialThreadRequest-07AtACng.js";import{t as Q,a as W,b as _a}from"./routePaths-DDv-R3QG.js";import{M as ha}from"./MobileAppDrawer-Djrnxmnv.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.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]="17925e54-3351-4965-9b64-1d02a6d23c80",e._sentryDebugIdIdentifier="sentry-dbid-17925e54-3351-4965-9b64-1d02a6d23c80")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ye()),e(Ne()),e(qe())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=M(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(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:L,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:Z(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(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(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(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(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(Ve({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 Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(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(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(k({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ke({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Le()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>M(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),K=d(n=>J(n)),A=d(n=>Z(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(F(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!v&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,v,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":A&&s(X());break;case"balance_sheet":s(Ae(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,K,A]);const U=sa(),de=U?.loggedInUserRole!=null&&Fe(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),V=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=We(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>x?ba:void 0,[x]);Ze({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:L,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:V}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:L,filter:b,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:A,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:V,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:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function xa(){const e=d(s=>M(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=$e(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{xa as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-2V3XhuUi.js";import{a as j,z as w,aN as b,x as E,d as p,f as F,cQ as R,G as L}from"./index-CXNJX-KR.js";import"./mui-Dpp2C1dL.js";import l from"./NotFoundScreen-C6fP8ezZ.js";import{a as u}from"./sentry-Bjq7jLMy.js";import{u as P,j as y,h as T,g as V,n as U,o as z,p as d}from"./core-C5uCD0QC.js";import{eR as A,Rg as C,NS as G,Rh as _,uI as Y,f6 as O,Ri as Q,uG as q}from"./zeni-epic-state-lec4Lm2t.js";import{R as x}from"./ReferralListScreen-7zacnt57.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.js";import"./useAskAiCfoHostNavButtonProps-B-Hj-PQt.js";import"./MobileAppDrawer-Djrnxmnv.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]="7d0b3eec-8304-4169-8ab7-83390b3b06e9",e._sentryDebugIdIdentifier="sentry-dbid-7d0b3eec-8304-4169-8ab7-83390b3b06e9")}catch{}})();const B=U(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=w.getSignedInUser();return{onDismissClick:()=>{e(_()),n("..")},onSendClick:()=>{if(o!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(q())},onUpdateInviteFormLocalData:s=>{e(Q({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(R),H=()=>{const e=P(),[t,n]=u.useState(!1),[o,s]=u.useState(!1),r=y(i=>A(i)),c=T(),N=V(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=y(i=>C(i)),S=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:k}=g(b.zeniAccountsConfig),v=G(k);u.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&o===!1&&(e(Y()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(O(!0)))},[m.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:i=>(I=>I.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,a.jsx(B,{navigate:c,location:N,currentTenant:r,companyName:D,userName:S,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(z,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(H,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DOnDhlUi.js","assets/sentry-Bjq7jLMy.js","assets/core-C5uCD0QC.js","assets/zeni-epic-state-lec4Lm2t.js","assets/index-CXNJX-KR.js","assets/mui-Dpp2C1dL.js","assets/analytics-B5_QbYyf.js","assets/utils-Y3UWLN-V.js","assets/withTransactionSidePanel-BMgKJwSH.js","assets/useAskAiCfoHostNavButtonProps-B-Hj-PQt.js","assets/TransactionDetailScreen-C_-nFgWB.js","assets/decodeURIComponentSafe-WSnueMtI.js","assets/routePaths-DDv-R3QG.js","assets/NotFoundScreen-C6fP8ezZ.js","assets/useInitialThreadRequest-07AtACng.js","assets/analyticsHelper-llu9ZY3e.js","assets/CompanyPassportScreen-C6ugmGBs.js","assets/MobileAppDrawer-Djrnxmnv.js","assets/useAiCfoDashboardSuggestedQuestionsChips-wNyzo2Lm.js","assets/FeaturePreviewScreen-2lGXkGnT.js","assets/ReferralListScreen-7zacnt57.js","assets/index-R6GjjTB3.css","assets/BillPayRoutes-4uZ7joLO.js","assets/AddressScreen-DJKsJ10Z.js","assets/DomesticWireDetailScreen-lJID4K8i.js","assets/DrawerScreen-drwDX_t8.js","assets/SetupPagesScreen-cvYJWiZ-.js","assets/BusinessVerificationPageScreen-g2faFJJh.js","assets/BillPayApprovalRoutes-B-2S4SNn.js","assets/ReimbursementApprovalRuleDetailScreen-CN_fVdI4.js","assets/getLocaleForTenant-CSnj06iQ.js","assets/ReimbursementRoutes-BBYA68YB.js","assets/ReimbursementApprovalRoutes-yt8YQciv.js","assets/TransactionListRoutes-8BMGQlvq.js","assets/ZeniAccountStatementScreen-Byji_IxT.js","assets/SettingsRoutes-Cb24ieWi.js","assets/accountMappingHelper-1n6-L3ip.js","assets/QBOConnectionScreen-DrwgecUL.js","assets/empty-D1KuG6Gh.js","assets/index-hHuZx5_w.js","assets/url-RMDL_YV7.js","assets/index-BXJxTGtH.js","assets/ReportsRoutes-BYiPKbc6.js","assets/ChargeCardRoutes-DpCZ_jyS.js","assets/PeopleRoutes-gwhry3Ow.js","assets/ExpenseAutomationRoutes-CLYPTfXE.js","assets/TreasuryRoutes-aI9AzHq8.js","assets/VendorsRoutes-CXgYXHLy.js","assets/pathToGoBack-spodqoPj.js","assets/ZeniAccountRoutes-C1u_CJhb.js","assets/AddressRoutes-D0pPyHh_.js","assets/PandLWithForecastRoutes-97f0lT8j.js","assets/CustomerOnboardingRoutes-DR9dynHR.js","assets/TransactionDetailRoutes-zmbZfCAF.js","assets/EntityDetailRoutes-ORWd6K8g.js","assets/NotificationRoutes-BKEZI2NF.js","assets/PerformanceRoutes-BNgmYjW8.js","assets/RewardsRoutes-D631WDFb.js","assets/TaskRoutes-BqQas_t-.js","assets/TaskListScreen-D3jwxPFn.js","assets/AiCfoScreen-D72rCutj.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as n,bn as ts,eR as is,f0 as rs,e_ as os,e$ as ls,fJ as cs,eV as ds,cO as pe,cw as ms,fg as us,co as _s,bE as As,bo as ps,fl as Es,v as gs,JZ as Is,bs as Ts,J_ as xs,bG as hs,fi as js,bF as Us,bt as Rs,ck as Hs,J$ as Ds,K0 as bs,cL as ys,cN as fs,cM as Cs,cv as vs,cB as Os,ng as Ee,eY as ge,fT as Ps,fp as Ie,fQ as Te,fR as xe,fq as Fs}from"./zeni-epic-state-lec4Lm2t.js";import{j as e}from"./liveblocks-2V3XhuUi.js";import{a as v}from"./sentry-Bjq7jLMy.js";import{u as Ls,h as Bs,i as ks,g as Vs,j as G,l as he,N as c,o as Ss,p as t}from"./core-C5uCD0QC.js";import{m as Ns,u as Ms,z as H,a as Zs,c as ws,S as Gs,G as k,k as $s,L as F,D as je,t as _,P as zs,d as Q,l}from"./index-CXNJX-KR.js";import"./mui-Dpp2C1dL.js";import{f as Ue}from"./analyticsHelper-llu9ZY3e.js";import{t as Ys}from"./getLocaleForTenant-CSnj06iQ.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="61b722aa-fe06-4ebd-9aa7-17430521c1ef",i._sentryDebugIdIdentifier="sentry-dbid-61b722aa-fe06-4ebd-9aa7-17430521c1ef")}catch{}})();const Js={dashboard:()=>n(()=>import("./DashboardRoutes-DOnDhlUi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-4uZ7joLO.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-BBYA68YB.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-8BMGQlvq.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-Cb24ieWi.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-BYiPKbc6.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DpCZ_jyS.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-gwhry3Ow.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CLYPTfXE.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-aI9AzHq8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-CXgYXHLy.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-C1u_CJhb.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],X=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ws=l(()=>n(()=>import("./ReportsRoutes-BYiPKbc6.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Ks=l(()=>n(()=>import("./AddressRoutes-D0pPyHh_.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),Qs=l(()=>n(()=>import("./PeopleRoutes-gwhry3Ow.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),Xs=l(()=>n(()=>import("./PandLWithForecastRoutes-97f0lT8j.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-DR9dynHR.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-CXgYXHLy.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-zmbZfCAF.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Re=l(()=>n(()=>import("./EntityDetailRoutes-ORWd6K8g.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),an=l(()=>n(()=>import("./DashboardRoutes-DOnDhlUi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),He=l(()=>n(()=>import("./BillPayRoutes-4uZ7joLO.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),tn=l(()=>n(()=>import("./SettingsRoutes-Cb24ieWi.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),De=l(()=>n(()=>import("./ReimbursementRoutes-BBYA68YB.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-C1u_CJhb.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-aI9AzHq8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-8BMGQlvq.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-DpCZ_jyS.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-BKEZI2NF.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),mn=l(()=>n(()=>import("./PerformanceRoutes-BNgmYjW8.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),un=l(()=>n(()=>import("./ExpenseAutomationRoutes-CLYPTfXE.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-D631WDFb.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),An=l(()=>n(()=>import("./TaskRoutes-BqQas_t-.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-D72rCutj.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-C6fP8ezZ.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),En=l(()=>n(()=>import("./TaskListScreen-D3jwxPFn.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:i}){const U=Ls(),V=Bs(),{tenantEmailDomain:o}=ks(),S=Ns().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Ms(),b=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),ee=ts(h),$=Vs(),[N,ye]=v.useState(!1),r=G(a=>is(a)),{useFeatureGate:L}=Zs(),W=ws(),se=Gs(),{isFeatureEnabled:fe}=L(k.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ce}=L(k.isTreasuryEnabled),{isFeatureEnabled:ve}=L(k.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=L(k.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),p=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=p==="Completed"||j==="Completed"?rs(ne,r):void 0,z=p==="Completed"||j==="Completed"?os(r):void 0,Oe=p==="Completed"||j==="Completed"?ls(r):void 0,Pe=ve||ne||!!Oe||!!z||!!u,{isFeatureEnabled:Fe}=L(k.isSettingsFeatureEnabled),{isFeatureEnabled:Le}=L(k.isAiCfoFileUploadEnabled),Y=G(a=>cs(a));if(o!=null){const a=H.getSignedInUserTenant(o);h!=null&&a!=null&&Ue(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ae=ds(),A=$s(),Be=r.company==null||A?.loggedInUserRoleMap!=null&&pe(A.loggedInUserRole),ke=ms(A?.loggedInUserRoleMap),te=v.useRef(!0),ie=he("/:tenantEmailDomain/onboarding/*")!==null,K=he("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(a=>w.tenantId!=null?us(a,w.tenantId):void 0);v.useEffect(()=>{f(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&b!=null){const a=K.params.selectedPeriod;if(a!=null){const R=a.split("-");if(R.length===2){const d=_s(Number(R[0])),s=Number(R[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,je.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=ps();m.isAfter(M,"month")===!1?U(Es(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,b]),v.useEffect(()=>{N||(ye(!0),f(F.TENANT_FETCHING)),te.current?te.current=!1:!gs(ae,w)&&H.isSignedIn()&&(f(F.TENANT_FETCHING),function(a,R,d,s){if(ge(R?.userId,R?.zeniSessionId,a.tenantId),d(Ps(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=H.getSignedInUserTenantWithId(a.tenantId);s&&je.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?Q.identify(a.userId,{tenant_id:a.tenantId}):Q.resetUserIdentity()}(w,h,U,Ve))},[w,ae,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(F.TENANT_FETCHING),function(a,R,d,s,m,M,B){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const J=s!=null&&m?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,as=d!=null&&d.externalConnections==null;if(J&&ss){B(Ie(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Te(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(xe(m.userId,s)))}else J&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Te(m.userId,s))),J&&as&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(xe(m.userId,s)));if(J){Q.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(R==="Completed"||R==="Error");a==="Completed"||R!=="Not-Started"&&R!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(F.TENANT_FETCHING),B(Fs(m.userId,s,m.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(Ee(m.userId,m.zeniSessionId)))}}(j,p,r,b,h,f,U))},[b,p]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(F.TENANT_FETCHING),H.saveSignedInUserTenants(Is(Y.tenantsBaseInOrder)),h!=null&&Ue(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{p==="In-Progress"&&f(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(F.TENANT_FETCHING),Z(F.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[p,j,b,N]);const re=v.useRef(!1);v.useEffect(()=>{!re.current&&p==="Completed"&&N&&(re.current=!0,function(a=qs,R=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Js[m];M!=null?M().then(()=>X(()=>d(s+1))).catch(()=>X(()=>d(s+1))):d(s+1)};X(()=>d(0))},R)}())},[p,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Se}=L(k.isReferralFeatureEnabled),Ne=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Me=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),oe=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,le=Pe&&!C,Ze=xs(A?.loggedInUserRoleMap),we=r.externalConnections?.accounting[0]?.isValid,ce=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,me=de&&hs(A?.loggedInUserRoleMap),ue=fe&&!C,Ge=r.company!=null&&js(r.company),$e=Ce&&Ge===!0&&!C,ze=oe&&Us(A?.loggedInUserRoleMap),Ye=le&&Rs(A?.loggedInUserRoleMap),Je=ue&&Hs(A?.loggedInUserRoleMap),qe=Ds(A?.loggedInUserRoleMap),We=bs(A?.loggedInUserRoleMap),E=ys(A?.loggedInUserRoleMap),g=fs(A?.loggedInUserRoleMap),I=Cs(A?.loggedInUserRoleMap),T=vs(A?.loggedInUserRoleMap),x=Os(A?.loggedInUserRoleMap),_e=oe&&T,Ae=de&&x,Ke=ue&&E,Qe=$e&&g,Xe=le&&I,es=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||ke===!0||Ze===!0||qe===!0||We===!0;return H.isSignedIn()?b==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||j==="Completed"?(ce===!0||ee&&!ie)&&we===!1&&u===!1&&z===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||ce!==!1||ie||ee?N&&r?.userRole&&u!=null&&z!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Ss,{children:e.jsxs(t,{element:e.jsx(zs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(gn,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:z})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(an,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Ws,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:es||P?e.jsx(Qs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Ne||Me?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(ln,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(Re,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(Re,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(En,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(An,{})}),e.jsx(t,{path:"address/*",element:ze||me||Je||Ye?e.jsx(Ks,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Ke?e.jsx(rn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:Qe?e.jsx(on,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:se===!0?e.jsx(mn,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:se===!0&&C===!1?e.jsx(un,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(t,{path:"vendors/*",element:Be?e.jsx(sn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:_e?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:_e?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ae?e.jsx(De,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ae?e.jsx(De,{}):e.jsx(D,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Fe?e.jsx(tn,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:Xe?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:W?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:W?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:W?e.jsx(pn,{isFileUploadEnabled:Le}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const gn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(hn,{tenantEmailDomain:O}):S?e.jsx(xn,{tenantEmailDomain:O}):U?e.jsx(jn,{tenantEmailDomain:O}):V?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(In,{tenantEmailDomain:O}):e.jsx(y,{}),In=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Tn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),xn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),be=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,Nn as default};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-2V3XhuUi.js";import{a as p}from"./sentry-Bjq7jLMy.js";import{h as V,g as $,u as O,j as f,t as ce,n as K,i as G,o as Y,p as A}from"./core-C5uCD0QC.js";import{bn as je,eR as P,fO as ke,m5 as le,Mb as Pe,gP as me,M2 as De,p_ as Me,jI as fe,m1 as Oe,gR as Ue,M4 as Te,M3 as _e,Ot as Re,yj as Fe,CO as Be,O2 as Ve,Ob as ze,c1 as ee,cG as Le,cH as Ne,K9 as $e,Ou as Ke,Ka as Ge,wL as Ze,Ov as He,Fa as qe,Cu as Qe,Cl as he,Ci as Je,wP as be,Co as Se,Cr as ye,Cx as ne,tc as te,wO as Ye,jk as W,jn as Ce,Ow as We,ko as Xe,x2 as en,KZ as nn,K_ as tn,ji as an,Ox as on,jl as sn,qs as cn,Oy as ln,Oz as rn,qw as dn,gz as un,Ki as J,go as pn,gv as gn,Kj as mn,w$ as fn,OA as hn,OB as bn,CL as Sn,e_ as Ie,f0 as xe,OC as yn,fC as Cn,Ks as In,w_ as re,fH as de,fG as xn,wZ as An,fF as En,fE as wn,OD as vn,f3 as Ae,OE as jn,OF as kn,x5 as Pn,wY as ue,OG as Dn,fk as Mn,wV as On,bU as Un,c0 as Tn,b$ as _n,bV as Rn,bZ as Fn,bY as Bn,bX as Vn,b_ as zn,bW as Ln}from"./zeni-epic-state-lec4Lm2t.js";import{a as ae,G as _,z as j,af as Ee,bK as Nn,d as Q,f as $n,k as Z,B as oe,bL as Kn,bM as Gn,aq as Zn,h as we,bN as Hn,bO as qn,bP as Qn,a9 as Jn,V as Yn,bQ as Wn,r as Xn,bR as et}from"./index-CXNJX-KR.js";import{n as R}from"./mui-Dpp2C1dL.js";import{M as U}from"./MobileAppDrawer-Djrnxmnv.js";import{a as H,g as q,m as nt}from"./accountMappingHelper-1n6-L3ip.js";import{t as tt,A as at}from"./AddressScreen-DJKsJ10Z.js";import N from"./NotFoundScreen-C6fP8ezZ.js";import{g as ot}from"./analyticsHelper-llu9ZY3e.js";import{B as st}from"./BusinessVerificationPageScreen-g2faFJJh.js";import{C as it}from"./CompanyPassportScreen-C6ugmGBs.js";import{q as pe}from"./QBOConnectionScreen-DrwgecUL.js";import{B as ct}from"./BillPayApprovalRoutes-B-2S4SNn.js";import{R as lt}from"./ReimbursementApprovalRoutes-yt8YQciv.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.js";import"./routePaths-DDv-R3QG.js";import"./empty-D1KuG6Gh.js";import"./pdf-lib-clv_iGdC.js";import"./index-hHuZx5_w.js";import"./url-RMDL_YV7.js";import"./index-BXJxTGtH.js";import"./decodeURIComponentSafe-WSnueMtI.js";import"./ReimbursementApprovalRuleDetailScreen-CN_fVdI4.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]="717a1ce3-97ee-476e-a539-d8cfbff31600",e._sentryDebugIdIdentifier="sentry-dbid-717a1ce3-97ee-476e-a539-d8cfbff31600")}catch{}})();const rt=R.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,dt=K(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:fe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Me(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:h,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:x}=u,{prepaidExpensesAccount:E,fixedAssetsAccount:k,accruedExpensesAccount:S}=d,{bankAccount:C,expenseCategory1099:T}=m,w=H(t.accountMappingView.incomeAccountList,h.selectedOption),F=H(t.accountMappingView.expenseAccountList,g.selectedOption),z=H(t.accountMappingView.billPayAccountList,l.selectedOption),L=H(t.accountMappingView.reimbursementsAccountList,x.selectedOption),B=q(t.accountMappingView.prepaidExpensesAccountList,E.selectedOptions),b=q(t.accountMappingView.fixedAssetsAccountList,k.selectedOptions),D=q(t.accountMappingView.accruedExpensesAccountList,S.selectedOptions),y=q(t.accountMappingView.bankAccounts1099FilingAccountList,C.selectedOptions),I=nt(t.accountMappingView.expenseAccounts1099FilingAccountList,T),M={selectedIncomeAccountId:w?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:B.map(v=>v.accountId),selectedFixedAssetsAccountIds:b.map(v=>v.accountId),selectedAccruedExpensesAccountIds:D.map(v=>v.accountId),selectedBankAccounts1099FilingAccountIds:y.map(v=>v.accountId),selectedExpenseAccounts1099FilingAccountIds:I};e(_e({data:M}))},onBackClick:()=>{Ee(r)===!1?(s("../../dashboard"),e(Te())):e(me())},onSaveClick:()=>{e(Ue()),i&&Q.track($n.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Oe(t.currentTenant.companyId,n))}}})(Nn),ut=()=>{const e=V(),t=$(),s=O(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(_.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(_.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=j.getSignedInUser(),h=je(m),g=f(y=>P(y)),{capitalizableAccounts:l,capitalizableAccountOverrides:x,isCapitalizationThresholdSaving:E,currencySymbol:k}=f(y=>{const I=y.tenantState.currentTenantId,M=I!=null?y.tenantState.tenantsById[I]:void 0,v=ke(y.companyState,g.companyId);return{capitalizableAccounts:M?.capitalizableAccounts??null,capitalizableAccountOverrides:M?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:y.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:v?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),S=p.useCallback((y,I)=>{s(le(g.companyId,y,I))},[s,g.companyId]),C=p.useCallback(y=>{const I={...x??{}},M=Object.entries(y);for(const[se,ie]of M)ie===null?delete I[se]:I[se]=ie;const[v,ve]=M[0]??[];v!=null&&s(le(g.companyId,v,ve,void 0,Object.keys(I).length>0?I:null))},[s,g.companyId,x]),T=f(y=>Pe(y.accountState),ce),w=p.useMemo(()=>{const y={};for(const I of T)I.accountId!=null&&I.accountName!=null&&(y[I.accountId]=I.accountName);return y},[T]),[F,z]=p.useState(!1),[L,B]=p.useState(!1);p.useEffect(()=>{F===!1&&(s(me()),z(!0))},[F]);const b=f(y=>De(y)),D=y=>{B(y)};return o.jsxs(rt,{children:[o.jsx(U,{isAppContentDrawerOpen:L,handleDrawerToggle:D}),o.jsx(dt,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&h,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:w,capitalizableAccountOverrides:x,currencySymbol:k,isCapitalizationThresholdSaving:E,onSaveCapitalizationAccountThreshold:S,onSaveCapitalizationAccountThresholds:C,location:t,isSettings:Ee(t),onClickMenuIcon:()=>D(!0)})]})},pt=R.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
height: 100%;
|
|
12
|
-
width: 100%;
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,gt=K(function(e,t){const s=P(e),r=Ve(e),i=ze(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:Q}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),mt=()=>{const e=V(),t=$(),s=O(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=f(S=>P(S)),h=f(S=>S.billPaySetupApproverViewState.fetchState),g=f(S=>S.remiSetupApproverViewState.fetchState),l=f(S=>Re(S)),x=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=Z();p.useEffect(()=>{u||h!=="Not-Started"||(d(!0),s(Fe(!0)))},[u,h,s]),p.useEffect(()=>{a||g!=="Not-Started"||(c(!0),s(Be(!0)))},[a,g,s]);const k=S=>{n(S)};return E?.loggedInUserRoleMap!=null?o.jsxs(pt,{children:[o.jsx(U,{isAppContentDrawerOpen:i,handleDrawerToggle:k}),o.jsx(gt,{navigate:e,location:t,companyId:x,currentTenant:m,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{k(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},ft=R.div`
|
|
18
|
-
display: flex;
|
|
19
|
-
height: 100%;
|
|
20
|
-
width: 100%;
|
|
21
|
-
flex: 1 1 auto;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,ht=K(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=P(e);return{bankSetupView:He(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:Q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(ye(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(Se(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(be(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?he(n,a,c,u):Je(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(Qe(i,a,n,c))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),bt=()=>{const e=V(),t=$(),s=O(),{tenantEmailDomain:r}=G(),i=Z(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=f(C=>P(C)),m=f(C=>C.settingsViewState.bankConnection.fetchState),h=Le(d,i?.loggedInUserRoleMap),g=Ne(d,i?.loggedInUserRoleMap),l=$e(d,i?.loggedInUserRoleMap),x=Ke(d,i?.loggedInUserRoleMap),E=Ge(d,i?.loggedInUserRoleMap),k=d.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ze(!1)))},[c,s,m]);const S=C=>{a(C)};return h||l||g||E?o.jsxs(ft,{children:[o.jsx(U,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),o.jsx(ht,{navigate:e,location:t,companyId:k,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:h,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:E,isTreasuryEnabled:x,onClickMenuIcon:()=>{S(!0)}})]}):o.jsx(N,{})},St=R.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
height: 100%;
|
|
28
|
-
width: 100%;
|
|
29
|
-
flex: 1 1 auto;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
align-items: center;
|
|
32
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,yt=K(function(e,t){const{companyId:s}=t,r=P(e),i=t.roleMap.bill_pay_admin,n=We(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:we.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:Q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(be("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(ye(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(Se(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(he(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ce(n))},handleConfirmCardSetupIntent:n=>{e(sn(n))},updateCardPaymentModalState:n=>{e(on({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(an(n,a,c))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(tn())},handleResetCardPaymentErrorStatuses:()=>{e(nn())},onBillingAddressSave:n=>{e(en(n))},onAddressEditHandler:n=>{if(n!=null){const a=tt(n);e(Xe({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Hn),Ct=()=>{const e=V(),t=$(),s=O(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=f(C=>P(C)),h=f(C=>C.cardPaymentViewState),g=f(C=>C.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Zn(h.addCardPaymentSourceStatus.fetchState),x=h.addCardPaymentSourceStatus.fetchState,E=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=Z();p.useEffect(()=>{E!=null&&s(Ye(E,!1))},[E,s]),p.useEffect(()=>{a||(c(!0),s(W()))},[a,s]),p.useEffect(()=>{u||(Ce(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&x==="Completed"&&s(W())},[l,x]);const S=C=>{n(C)};return k?.loggedInUserRoleMap!=null?o.jsxs(St,{children:[o.jsx(U,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),o.jsx(yt,{navigate:e,location:t,companyId:E,currentTenant:m,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:we.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},X="external_integrations",It=K(function(e){const t=rn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{pe.init("/connection/auth",n),pe.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(fn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(gn(a,d,J("revenue"),mn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const h="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(h)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(pn(a,c,J(u)))},onSaveConnectorCredentials:c=>{e(un(a,J("payments"),c))},onNotifyMe:c=>{e(dn(X,c,i))}}})(qn),xt=()=>{const e=V(),t=O(),{tenantEmailDomain:s}=G(),[r,i]=p.useState(!1),n=f(l=>l.tenantState.fetchState),a=f(l=>P(l)),c=a.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),d=Z(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(cn(X))},[t]);const h=l=>{i(l)},g=f(l=>ln(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(U,{isAppContentDrawerOpen:r,handleDrawerToggle:h}),o.jsx(It,{navigate:e,onClickMenuIcon:()=>{h(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,x])=>[l,x?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},At=R.div`
|
|
34
|
-
display: flex;
|
|
35
|
-
height: 100%;
|
|
36
|
-
width: 100%;
|
|
37
|
-
flex: 1 1 auto;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
align-items: center;
|
|
40
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,Et=R.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
height: 100%;
|
|
44
|
-
width: 100%;
|
|
45
|
-
flex: 1 1 auto;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
align-items: center;
|
|
48
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,wt=()=>{const e=O(),{tenantEmailDomain:t}=G(),[s,r]=p.useState(!1),i=f(l=>P(l)).companyId??j.getSignedInUserTenant(t)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=f(l=>hn(l,n.userId)),c=f(l=>bn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),h=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(Sn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(Et,{children:[o.jsx(U,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Qn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:h,onClickMenuIcon:()=>{d(!0)}})]})},vt=R.div`
|
|
50
|
-
display: flex;
|
|
51
|
-
height: 100%;
|
|
52
|
-
width: 100%;
|
|
53
|
-
flex: 1 1 auto;
|
|
54
|
-
flex-direction: column;
|
|
55
|
-
align-items: center;
|
|
56
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,ge=({appContent:e})=>{const t=O(),s=V(),r=$(),[i,n]=p.useState(!1),a=f(b=>P(b)),{tenantEmailDomain:c}=a,u=a.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=d(_.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(_.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(_.isTreasuryEnabled),x=f(b=>fe(b)),E=Ie(a),k=xe(g,a),S=!k&&x,C=Jn(a,h,g),{areTenantIdsInSync:T}=Yn();p.useEffect(()=>{T&&t(yn(u,S))},[u,t,S,T]);const w=f(b=>Cn(b,S)),F=w.fetchState==="Not-Started"||w.fetchState==="In-Progress"||u==null,z=In(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=b=>{n(b)};return o.jsxs(vt,{children:[o.jsx(U,{isAppContentDrawerOpen:i,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Wn,{myProfileView:w,isAccountingClassesEnabled:x,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:C===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{B(!0)},isLoading:F,isBankingOnlyTenant:k,isCardsOnlyTenant:E,onAddressClick:b=>{const D=function(I,M){let v=`/${I}/settings/my_profile`;return v=v.concat(`/new/${M}`),v}(c,b),y=Xn(r.state?.pathnameStackToGoBack,r.pathname);s(D,{state:{pathnameStackToGoBack:y}})},onGetOtp:b=>{const D={...w.myProfileLocalData,phone:b};t(re({localData:D})),t(wn(b,"MyProfile"))},onResendOtp:b=>{t(En(b,"MyProfile"))},onCancelClick:()=>{t(An())},onSaveClick:()=>{t(de("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{t(xn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&j.saveZeniOtpToken(b),t(de("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(re({localData:b}))}})]})};function jt(){const e=O(),t=f(l=>P(l)).companyId,s=f(l=>vn(l)),r=f(l=>Ae(l)),i=j.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(jn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(kn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(Pn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const h=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(Dn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(U,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(et,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:h,resetUpdateStatus:g})]})}function la(e){const[t,s]=p.useState(!1),r=f(l=>Ae(l)),i=f(l=>P(l)),n=Z(),a=j.getSignedInUser(),c=O(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(_.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Mn(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(On()))},[r.fetchState,t]);const h=xe(d,i),g=Ie(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Un(i)?o.jsxs(Y,{children:[Tn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(ut,{})}),_n(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(kt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Rn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(wt,{})}),Fn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(bt,{})}),Bn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(st,{productType:h?"zeni_accounts":g?"charge_cards":ot(i,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(it,{})}),zn(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(Ct,{})}),Ln(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(xt,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(ge,{appContent:o.jsx(at,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(ge,{})}),m&&o.jsx(A,{path:"notifications",element:o.jsx(jt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(Y,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function kt(e){return o.jsxs(Y,{children:[o.jsx(A,{path:"/",element:o.jsx(mt,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(ct,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(lt,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{la as default};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-2V3XhuUi.js";import{h as Y,g as Q,u as X,i as G,j as E,N as R,n as W,s as Qe}from"./core-C5uCD0QC.js";import{bF as Xe,ck as Ie,NS as ye,eR as V,cw as en,yu as Z,yj as nn,O2 as tn,O5 as an,qL as ee,qz as ne,kg as te,sK as z,O7 as Ae,fG as $e,fF as Ge,fE as We,O8 as sn,yD as on,Cu as ke,Cl as _e,Ci as ve,C9 as K,Co as Pe,Cr as Ee,Cx as we,tc as Te,fV as cn,cr as rn,f0 as un,e_ as dn,e$ as ln,bt as pn,O9 as mn,Bb as le,BP as yn,Oa as fn,bG as gn,DK as pe,CO as Sn,Ob as bn,Oc as hn,DO as Cn,DS as In,sD as An,Ii as kn,En as Ce,Fo as me,Od as _n,Oe as vn,Of as Pn,Og as He,Oh as En,KM as wn,Nf as Tn,KY as Dn,Oi as qe,Oj as Be,EJ as Ke,ko as On,qC as Je,sM as Un,bE as je,sY as Re,cu as Fn,Ok as Ye,fj as Bn,E5 as Vn,E9 as xn,Ol as jn,Eq as Ne,Om as Rn,On as Nn,Oo as zn,Op as Ln,fO as Mn,zO as Zn,Oq as $n,zT as Gn,zS as Wn}from"./zeni-epic-state-lec4Lm2t.js";import{k as ae,a as ie,G as de,m as De,aN as J,z as w,x as se,d as T,B as Oe,f as $,bz as Hn,at as oe,bA as x,bB as qn,bC as Kn,af as xe,bD as Jn,r as ze,au as Le,J as Yn,A as Qn,bE as Xn,bF as et,bG as nt,a7 as tt}from"./index-CXNJX-KR.js";import{a as C}from"./sentry-Bjq7jLMy.js";import{n as Ve,D as at,S as it}from"./mui-Dpp2C1dL.js";import{M as fe}from"./MobileAppDrawer-Djrnxmnv.js";import N from"./NotFoundScreen-C6fP8ezZ.js";import{a as Me}from"./analyticsHelper-llu9ZY3e.js";import{d as Ze}from"./routePaths-DDv-R3QG.js";import{B as Fe}from"./BusinessVerificationPageScreen-g2faFJJh.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]="a0648cec-fd93-4b55-a300-309eb5ece981",e._sentryDebugIdIdentifier="sentry-dbid-a0648cec-fd93-4b55-a300-309eb5ece981")}catch{}})();const st=Ve.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ot=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=tn(e),i=w.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Hn),ct=()=>{const e=Y(),o=Q(),t=X(),{tenantEmailDomain:a}=G(),c=ae(),n=Xe(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=De(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(F=>F.billPaySetupViewState.fetchState),A=E(F=>V(F)),_=E(F=>F.billPaySetupApproverViewState.fetchState),b=A.companyId??w.getSignedInUserTenant(a)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const D=F=>{S(F)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(R,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const F=O=>O.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:T,onLoad:O=>F(O)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:D}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{D(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Nt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Gt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Wt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Ht=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Jt=80,Yt=80,Qt=e=>e.companyId??w.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Xt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,ea=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=w.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{T.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(Te("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{T.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);T.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;T.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:x(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=Y(),o=Q(),t=X(),{tenantEmailDomain:a}=G(),c=ae(),n=E(L=>V(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),D=A&&h===!1,F=A===!1&&h,O=ye(r),B=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),j=w.getSignedInUserTenant(a)?.companyId??n.companyId,U=w.getSignedInUser(),Ue=L=>{ge(L)},Se=E(L=>mn(L,j));if(U==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||M!=="Not-Started"||j==null?q||M!=="Completed"||j==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(j,!1,!0)):(re(!0),t(le(j,!0)))},[q,M,j,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:()=>{T.trackPageLoaded($.Event.cardsSetupVisited),T.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Ue}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:j,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:B,isDebitCardOnlyEnabled:D,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:O})]}):u.jsx(Oe,{fetchState:"Not-Started"}):u.jsx(R,{to:"../promo"})},mt=Ve.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
height: 100%;
|
|
12
|
-
width: 100%;
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,yt=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=bn(e),i=hn(e,a),l=w.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),T.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=Y(),o=Q(),t=X(),{tenantEmailDomain:a}=G(),c=ae(),{useDynamicConfig:n}=ie(),i=De(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>V(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=w.getSignedInUserTenant(a)?.companyId??g.companyId,A=w.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(R,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:T,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Tn(e.companyConfigState),p=Dn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:D,companySubIndustry:F,countriesOfOperations:O,companySourceOfFunds:B,companySourceOfFundsDescription:ce,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:j,usNexus:U,usNexusTypes:Ue}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Fn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?je(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:D?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:O?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:B?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:j,usNexus:U,usNexusTypes:Ue?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:F}=p;let O;return A.selectDocumentType==="driverLicense"?O="driving_license":A.selectDocumentType==="passport"?O="passport":A.selectDocumentType==="stateId"?O="id_document":A.selectDocumentType==="ssnCard"&&(O="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?je(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:O,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(Un({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Be())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=Q(),n=X(),[i]=Qe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=G(),I=ae(),{useDynamicConfig:d}=ie(),m=De(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>V(h)),_=A.companyId??w.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),w.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let D;switch(e){case"zeni_accounts":D=En(h,_);break;case"zeni_treasury":D=He(h,_);break;case"charge_cards":D=Pn(h,_);break;case"reimbursement":D=vn(h,_);break;default:D=_n(h,_)}return D});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:h=>(D=>{switch(e){case"zeni_accounts":return D.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return D.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return D.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:T,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Qn(100,100,59)},ht=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=w.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Ye(e,a),p=He(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=jn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(Te("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Ne(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Nn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(Rn(s))},onConfirmFundAllocation:()=>{e(Ne(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Be())}}})(Xn),Ct=()=>{const e=Y(),o=Q(),t=X(),a=De(),c=Yn(),{tenantEmailDomain:n}=G(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(U=>U.treasurySetupViewState.fetchState),h=E(U=>U.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),D=E(U=>U.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=E(U=>U.treasuryDetailState.transactionsState?.fetchState),O=E(U=>V(U)),B=w.getSignedInUserTenant(n)?.companyId??O.companyId,ce=E(U=>Ye(U,B)),H=ce.isAtomicAccountExists,ge=!!O.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=w.getSignedInUser(),re=U=>{m(U)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||B==null||(v(!0),t(Ce(B,!0,!1)))},[S,k,B,t]),C.useEffect(()=>{g||h!=="Not-Started"||B==null||(f(!0),t(Bn()))},[g,h,B,t]),C.useEffect(()=>{P||D!=="Not-Started"||B==null||(A(!0),t(Vn()))},[P,D,B,t]),C.useEffect(()=>{_||F!=="Not-Started"||B==null||(b(!0),t(xn(!0)))},[_,F,B,t]);const M=O.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||H||j||!o.pathname.includes("setup")||r(!0)},[k,H,j]),O.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(R,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(Be()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:U=>U.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Be()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:B,currentTenant:O,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:H,analytics:T,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Ve(it)`
|
|
18
|
-
display: flex;
|
|
19
|
-
min-height: 100%;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
`,At=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:T,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Te("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=Y(),o=Q(),t=X(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>V(f)),S=w.getSignedInUserTenant(a)?.companyId??m.companyId,v=w.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(R,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:T,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Ve.div`
|
|
22
|
-
display: flex;
|
|
23
|
-
height: 100vh;
|
|
24
|
-
width: 100%;
|
|
25
|
-
flex: 1 1 auto;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
align-items: center;
|
|
28
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,vt=W(function(e,o){const t=V(e),a=w.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:T}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Wn(a))},onSubmitClick:()=>{e(Gn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=Y(),o=Q(),t=X(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=G(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>V(k)),v=De(),g=S.companyId??w.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),w.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(R,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:T,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:T,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Oe,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=W(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Fe,{productType:s}):t?u.jsx(R,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(R,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(ct,{}):t?u.jsx(R,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(N,{}):a?u.jsx(ft,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(kt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(R,{to:"../"}):u.jsx(N,{}):i?u.jsx(pt,{}):l?u.jsx(R,{to:"../"}):u.jsx(N,{})}}));function na(e){const{tenantEmailDomain:o}=G(),t=E(c=>V(c)).companyId??w.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(w.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Jt as A,Yt as P,na as S,Ht as a,Kt as b,ut as c,dt as d,rt as e,Qt as f,Zt as g,zt as h,Wt as i,qt as j,Xt as k,Gt as l,$t as m,Lt as n,Mt as o,Nt as p,ea as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-2V3XhuUi.js";import{a as u,b as T,q as A}from"./sentry-Bjq7jLMy.js";import{u as D,h as z,j as l,g as M,N as O,n as j}from"./core-C5uCD0QC.js";import{u as P,z as s,m as F,d as E,D as K,e as N,f as _,v as B,g as J,s as V,h as v}from"./index-CXNJX-KR.js";import{eR as Y,JY as $,JZ as q,eY as R,fp as W,K2 as H,fN as Z,cS as G,K3 as y,K4 as Q,K5 as X,bT as b}from"./zeni-epic-state-lec4Lm2t.js";import"./mui-Dpp2C1dL.js";import{u as ee}from"./useDeviceId-C2SjyoZO.js";import{f as te}from"./analyticsHelper-llu9ZY3e.js";import{t as ne}from"./getLocaleForTenant-CSnj06iQ.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.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]="12b6f3b0-8121-40e1-8b43-c285450e5a3d",t._sentryDebugIdIdentifier="sentry-dbid-12b6f3b0-8121-40e1-8b43-c285450e5a3d")}catch{}})();const ie=j(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)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:b(c),sourceUri:b(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(Q(n,a)))},clearSignInError:()=>{t(y())}}})(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,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=>Y(e)),I=l(e=>$(e)),m=M(),w=F().mode,U=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(q(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),K.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Z().then(()=>{const e=J();e!=null&&N(e)}),setTimeout(()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",G(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(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(B,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-2V3XhuUi.js";import{a}from"./sentry-Bjq7jLMy.js";import{u,g as m,h as p,N as g}from"./core-C5uCD0QC.js";import{z as d,B as b,t as y,d as f,f as h}from"./index-CXNJX-KR.js";import{fS as x,fT as I,Kk as j}from"./zeni-epic-state-lec4Lm2t.js";import{n as w}from"./mui-Dpp2C1dL.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.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]="34705871-a2bd-4cee-9254-bbd7be911f41",e._sentryDebugIdIdentifier="sentry-dbid-34705871-a2bd-4cee-9254-bbd7be911f41")}catch{}})();function $(){const e=u(),t=m(),i=p(),n=a.useRef(!1),l=d.isSignedIn(),r=t.state?.message==="logout",o=r||l;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),j(),y.reset(),f.trackLogout(h.Event.logoutSuccess),f.resetUserIdentity()}catch(c){console.error("Error during sign out:",c)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(k,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const k=w.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;export{$ as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-2V3XhuUi.js";import{a as h}from"./sentry-Bjq7jLMy.js";import{h as U,u as z,g as K,j as D,i as _,n as V}from"./core-C5uCD0QC.js";import{z as L,a as q,G as p,Y as H,x as M,d as O,f as W,cT as Z,r as g,q as J}from"./index-CXNJX-KR.js";import{eR as Q,Rn as F,H3 as y,Ro as x,Rj as Y,Gr as E,Rp as X,Gz as S,FV as aa,H4 as I,Rq as R,gV as ea,GW as ta,G$ as sa,GO as oa,GM as B,H0 as na,GJ as ia,Rr as la,Rs as ra,Rt as ca,Ru as ka,Rv as m,ed as ua,Rw as da,Rx as pa}from"./zeni-epic-state-lec4Lm2t.js";import{n as ma}from"./mui-Dpp2C1dL.js";import{u as Ta}from"./useAskAiCfoHostNavButtonProps-B-Hj-PQt.js";import{M as ga}from"./MobileAppDrawer-Djrnxmnv.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.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]="42bb1ab2-8c04-4d7b-9e4b-76278ba0c90b",e._sentryDebugIdIdentifier="sentry-dbid-42bb1ab2-8c04-4d7b-9e4b-76278ba0c90b")}catch{}})();const fa=ma.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ba=V(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,n=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,u=Y(e),i=L.isZeniUser();return{taskListView:n,tagListView:u,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:c,location:n,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:i}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=w(i,a),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(y(!0,u))},onTabChange:a=>{e(ka(a))},onParentTaskClick:a=>{const s=w(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(B(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(R({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ca({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(y(!0,u))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=J(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(B(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Ga(l,a);e(E({taskDetailLocalData:s}));const k=C(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(k,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(I({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(R({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(I({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(S(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(S(a,[s]))},handleNewTaskInitialization:a=>{if(e(E({taskDetailLocalData:{...X,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(i,t.localData.defaultTaskGroupId),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Z);function Na(){const e=U(),t=z(),o=K(),c=L.getSignedInUser(),n=D(r=>Q(r)),{taskGroupId:u}=_(),{useFeatureGate:i}=q(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,$]=h.useState(!1),b=D(r=>F(r,l)),G=D(r=>r.taskGroupState),T=b.fetchState,{isAiCfoAccessEnabled:j,onAskAiCfoClick:N}=Ta({mobileExploreReferrer:"Task Checklist"});if(H({isDataReady:T==="Completed"}),h.useEffect(()=>{t(y(!1,l))},[n?.tenantId,t,l]),h.useEffect(()=>{T==="Completed"&&t(x({taskGroupById:G.taskGroupById}))},[T,G.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return d.jsxs(d.Fragment,{children:[T==="Completed"?d.jsx(M,{analytics:O,onLoad:r=>(v=>v.trackPageLoaded(W.Event.taskListPage))(r)}):null,d.jsxs(fa,{children:[d.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{$(r)}}),d.jsx(ba,{location:o,navigate:e,currentTenant:n,taskGroupId:u,taskGroupState:G,localData:b.localData,uiState:b.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:j,onAskAiCfoClick:N})]})]})}const w=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,Ga=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=ua(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=da(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Na as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-2V3XhuUi.js";import se from"./NotFoundScreen-C6fP8ezZ.js";import{a as c}from"./sentry-Bjq7jLMy.js";import{h as M,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-C5uCD0QC.js";import{G6 as Z,G9 as le,G3 as de,eR as Y,Rj as H,Gn as J,G0 as pe,GT as ue,GM as ke,Rk as W,Rl as z,FY as me,FV as fe,qL as ge,qz as he,kg as Se,Gh as Ge,Rm as Ie,Gy as Te,Gv as be,Gc as Ee,Gs as Ce,Gr as De}from"./zeni-epic-state-lec4Lm2t.js";import{z as C,cR as xe,Z as Re,a as ye,G as T,q as X,r as v,x as je,d as N,f as ve,cS as we,h as V,at as Fe}from"./index-CXNJX-KR.js";import{n as Be}from"./mui-Dpp2C1dL.js";import{u as Pe}from"./useInitialThreadRequest-07AtACng.js";import{M as Ue}from"./MobileAppDrawer-Djrnxmnv.js";import Le from"./TaskListScreen-D3jwxPFn.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.js";import"./useAskAiCfoHostNavButtonProps-B-Hj-PQt.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]="e3bf31a5-f29e-4268-ab64-ca9113d8673a",e._sentryDebugIdIdentifier="sentry-dbid-e3bf31a5-f29e-4268-ab64-ca9113d8673a")}catch{}})();function $e(){const e=M(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[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 A,_=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Y(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:D}=d,b=r.recurringSourceTaskId,x=b!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(b)}`:void 0;var G;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((G=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=G,_=Object.values(G)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,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(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(be(a,o))},onUnsnoozeTask:a=>{e(Te(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=w(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Ie({taskId:s}))},onDeleteTaskClick:()=>{e(Ge(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(J(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(we);function j(){const e=M(),t=O(),s=ne(),u=Re(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Y(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(T.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(T.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(T.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(T.isTaskRecurringParentEnabled),{isFeatureEnabled:b}=a(T.isTaskGroupAssigneesEnabled),[x,G]=c.useState(!1),[p,K]=c.useState(!1),[F,Q]=c.useState(!1),[B,ee]=c.useState(!1),[P,R]=c.useState(!1),I=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(K(!0),t(J(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(Q(!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&&(I.current=!1,t(ke([r],null,{isArchived:!1})),R(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(I.current){if(E==="Error")return R(!1),void(I.current=!1);if(E==="Completed"){R(!1),I.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=w(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else I.current=!0},[P,E,l,s,e]);const $=g(i=>W(i,r)),y=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=w(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(je,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{G(i)}}),n.jsx(qe,{analytics:N,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:q,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:b})]})]})}const ze=Be.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,w=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(j,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(j,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(j,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-2V3XhuUi.js";import i from"./NotFoundScreen-C6fP8ezZ.js";import{T as r}from"./TransactionDetailScreen-C_-nFgWB.js";import"./sentry-Bjq7jLMy.js";import{o as a,p as o}from"./core-C5uCD0QC.js";import"./zeni-epic-state-lec4Lm2t.js";import"./recharts-CrS5Kd38.js";import"./index-CXNJX-KR.js";import"./mui-Dpp2C1dL.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./utils-Y3UWLN-V.js";import"./useAskAiCfoHostNavButtonProps-B-Hj-PQt.js";import"./decodeURIComponentSafe-WSnueMtI.js";import"./routePaths-DDv-R3QG.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{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,5 +0,0 @@
|
|
|
1
|
-
import{j as w}from"./liveblocks-2V3XhuUi.js";import{a as i}from"./sentry-Bjq7jLMy.js";import{u as H,k as Qe,j as S,t as fe,g as ge,h as Te,i as be,N as Xe,n as Ke}from"./core-C5uCD0QC.js";import{mU as he,eR as X,fO as Ze,Mb as ea,m5 as aa,l$ as ta,bn as na,cO as Ee,bs as Ie,qj as q,La as W,Mc as ve,Md as oe,LA as De,jT as Ce,Me as ke,LF as se,LG as ce,kI as Ae,Ia as ie,L4 as $,jN as Ue,jL as xe,jX as oa,mH as sa,Mf as ca,Mg as ia,up as Q,jS as we,Hv as Pe,cT as ra,cU as la,Mh as da,L3 as ua,Mi as ma,ul as pa,Mj as fa,Mk as ha,Ml as ya,Mm as Sa,Mn as ga,jW as Ta,Mo as ba,Mp as Ea,L5 as Ia,Mq as va,Mr as Da,Ms as Ca,Hp as ka,Hf as Aa,HE as Ua,jY as xa,Ib as ye,mM as wa}from"./zeni-epic-state-lec4Lm2t.js";import{a as Y,G as P,z as _e,aN as Le,m as Pa,J as _a,aO as La,A as Fa,q as te,k as Va,aP as Oa,r as ne,Y as Ba,aQ as Ra,d as Fe,aR as za,at as Na,a2 as ae}from"./index-CXNJX-KR.js";import{n as Ma,S as ja,D as Ga}from"./mui-Dpp2C1dL.js";import{u as $a}from"./useAskAiCfoHostNavButtonProps-B-Hj-PQt.js";import{d as Ve}from"./decodeURIComponentSafe-WSnueMtI.js";import{h as Oe,c as Be,g as Ha,e as qa}from"./routePaths-DDv-R3QG.js";import{t as Wa}from"./utils-Y3UWLN-V.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]="39a60b3f-a3dd-4497-9e57-4b733a7a338a",a._sentryDebugIdIdentifier="sentry-dbid-39a60b3f-a3dd-4497-9e57-4b733a7a338a")}catch{}})();function Ya(a=!0){const e=H(),s=Qe(),{useFeatureGate:t}=Y(),{isFeatureEnabled:n}=t(P.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!a||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"}))},[a,n,e,s])}function Ja(a,e){const s=function(){const r=H(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,U]=i.useState(null),{useDynamicConfig:T}=Y(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>X(h)),b=k.companyId,x=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:O,dismissedAccounts:N}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),M=i.useRef(_);M.current=_;const B=i.useRef(O);B.current=O;const L=i.useRef(N);L.current=N;const R=S(h=>ea(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=M.current;if(E==null)return;const u=E.accounts??[],G=new Set(h),K=B.current??{},J=L.current;for(const z of u)if(G.has(z.accountId)&&K[z.accountId]==null&&J?.[z.accountId]==null)return y(z.classificationType),U(z.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(aa(b,h,E,!0)),g(!1),y(null),U(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(ta(b,m)),g(!1),y(null),U(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:x,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),t=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(()=>{a==="In-Progress"&&(n.current=c.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a},[a]),s}const re=()=>{const a=_e.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:s}=e(P.isChainOfThoughtEnabled);return i.useMemo(()=>na(a)&&s,[a,s])};function Re(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ht(a,e){const s=H(),{useFeatureGate:t,useDynamicConfig:n}=Y(),o=S(u=>X(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=t(P.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=t(P.isExpenseAutomationEnabled),{configValue:y}=n(Le.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,U=re(),T=i.useMemo(()=>({id:a,type:q(e)}),[a,e]),f=S(u=>W(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const G=W(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return G==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[G]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),x=S(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),O=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),N=o.company?.companyInfo.firstMonthOfFY??1,M=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[B,L]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{L(!1),I(!1),j(!1)},[a,e]);const D=i.useCallback(()=>{L(!1),I(!1)},[]),[F,h]=i.useState(!1),E=O?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(B?R||x==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??x}))):(s(se()),s(ce()),L(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,B,R,x,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s($("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:U,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:x,vendorViewDetails:_,uiState:O,firstMonthOfFY:N,uncategorizedAccounts:M,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Qa={overlayWidth:new Fa(100,100,58)},Xa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Pa(),c=_a(),r=H(),p=S(y=>oe(y)),g=()=>{t()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(xe()),r(oa("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Ue({vendorId:void 0,localData:y}))}};return w.jsx(Ga,{anchor:"right",open:a,PaperProps:{style:{width:Qa.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:w.jsx(Ka,{onClick:y=>y.stopPropagation(),children:w.jsx(La,{...A})})})},Ka=Ma(ja)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`;function Za(a,e){a(sa({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function et({currentTransactionId:a,enabled:e=!0,buildPath:s,beforeNavigate:t,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||a==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;a.id===p.id&&a.type===p.type&&(r.current=c,t?.(),n(s(g),{replace:!0,state:o}))},[e,c,a,s,t,n,o])}const at=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=ge(),n=Te(),o=H(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Oe(g,A)&&(y={id:g,type:q(A)});const m=y!=null?S(T=>W(T,y)):void 0,U=()=>{const T=te(t.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(we(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(Q({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}U()},onCancel:()=>{y!=null&&o(ca({transactionId:y})),o(xe()),o(ia()),a(!0),U()}}},tt=Ke(function(a,e){const s=W(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=a.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=da(a,e.entity,"TransactionDetail"));const r=a.entityAutoCompleteState.autoCompleteText.common,p=ua(a,"common"),g=X(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${ae}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ae}/transaction_attachments_accounting_provider`:`${ae}/transaction_attachments`,attachmentUploadEndpoint:`${Na.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a($("common")),e.onBackClick!=null)return void e.onBackClick();const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ze(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(wa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(se()),a(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Be(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ye(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,c)=>{a(c===!0&&o!=null?we(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a($("common"))},onUploadAttachmentAttachment:t=>{a(Ua(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(Aa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ka({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,c)=>{e.transaction!=null&&a(Ca(e.selectedTransaction,e.transaction,t,n,o,c))},onResetLineItemsCategoryClassInLocalData:(t,n,o,c,r,p)=>{a(Da(t,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(va({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=te(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Wa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Ha(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qa(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{a(Pe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(Ia({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a($("common"))},onCancelAutoComplete:()=>{a($("common"))}},onFetchRecommendationsForEntity:(t,n,o,c)=>{a(Q({entity:t,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:c}=t;a(Ea(n,o,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(ba(t))},onSaveVendorInLocalData:(t,n,o,c,r)=>{if(a(Ta({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&a(Q({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),a(Ue({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(t,n,o,c,r)=>{a(ga({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&a(Q({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(Sa({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ya(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(ha(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(fa({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(pa(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(ma(t,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>Za(a,t):void 0}})(za);function yt(){const a=Te(),e=H(),s=ge(),{useFeatureGate:t,useDynamicConfig:n}=Y(),o=Va(),c=S(d=>X(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=t(P.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(P.isExpenseAutomationEnabled),{configValue:m}=n(Le.enableUncategorizedExpenseCategory),U=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),x=Oe(C,b),_=S(d=>d.transactionVendorViewState),O=re(),{isFeatureEnabled:N}=t(P.isTransactionCommentingEnabled),{isFeatureEnabled:M}=t(P.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=t(P.isProjectsTransactionsEnabled),L=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(x)return{id:C,type:q(b)}},[x,C,b]),l=I!=null?S(d=>W(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),E=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,G=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[K,J]=i.useState(!1),[z,le]=i.useState(!1),[Ne,de]=i.useState(!1),Me=i.useCallback(d=>Be(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);et({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Me,beforeNavigate:je,navigate:a,navigateState:s.state});const ue=()=>{J(!1),le(!1)},me=Oa();Ya();const Z=i.useRef(l?.transaction);Z.current=l?.transaction;const Ge=l?.transactionDetailUpdateStatus?.fetchState,V=Ja(Ge,()=>{const d=[];if(Z.current!=null)for(const ee of Z.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Pe(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);a("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,a,s.state,s.pathname,me]),i.useEffect(()=>{Ne||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(K?z||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),J(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e($("common"))},[]);const $e=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:He,onSaveSuccess:qe,onCancel:We}=at({closeDrawerHandler:d=>{k(!1),a(d?"../":"../..")}}),{isAiCfoAccessEnabled:Ye,onAskAiCfoClick:Je}=$a({mobileExploreReferrer:"Transaction Details"});return Ba({isDataReady:l?.fetchState==="Completed"}),x?w.jsxs(w.Fragment,{children:[pe!=null&&v&&w.jsx(Xa,{isOpen:v,transactionId:pe,onSaveVendor:He,onSaveSuccess:qe,onCancel:We}),w.jsx(tt,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:a,selectedTransaction:I,entity:D,isCOTEnabled:O,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:G,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:M,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:U,isAiCfoAccessEnabled:Ye,onAskAiCfoClick:Je,isTransactionCommentingEnabled:N,isProjectsTransactionsEnabled:B,companyId:L,companyName:R}),V.showPopup&&V.popupType!=null&&w.jsx(Ra,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):w.jsx(Xe,{to:ze($e.length)})}const ze=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},Se=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=nt(a),t=ot(a);Fe.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},nt=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},ot=a=>ra(a)===!0?a.customer?.name??"":la(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Xa as C,yt as T,Ya as a,Ja as b,at as c,tt as d,et as e,re as f,Za as g,ht as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-2V3XhuUi.js";import{h as K,g as H,u as Z,i as Q,j as h,N as G,n as W,o as Ye,p as j}from"./core-C5uCD0QC.js";import{eR as U,p_ as X,j5 as u,Py as ee,I1 as De,bo as le,Pz as ve,jI as te,LC as ae,PA as ue,PB as be,bE as P,HZ as ye,PC as Ee,PD as me,PE as je,I0 as Ae,PF as xe,PG as pe,PH as Me,PI as ge,PJ as Le,PK as Ce,PL as fe,Je as Be}from"./zeni-epic-state-lec4Lm2t.js";import{D as de,a as ne,G as q,d as w,ce,r as J,q as oe,V as Fe,S as Oe}from"./index-CXNJX-KR.js";import"./mui-Dpp2C1dL.js";import{a as g}from"./sentry-Bjq7jLMy.js";import{w as se}from"./withTransactionSidePanel-BMgKJwSH.js";import{p as ie,c as re}from"./routePaths-DDv-R3QG.js";import{u as ze}from"./utils-Y3UWLN-V.js";import{d as v}from"./decodeURIComponentSafe-WSnueMtI.js";import{Z as we}from"./ZeniAccountStatementScreen-Byji_IxT.js";import"./recharts-CrS5Kd38.js";import"./analytics-B5_QbYyf.js";import"./plaid-BYfDj3kT.js";import"./dnd-CtoEWKvO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTk6h7CK.js";import"./lexical-hLnHAypU.js";import"./pdf-BNUWc0Kr.js";import"./useAskAiCfoHostNavButtonProps-B-Hj-PQt.js";import"./TransactionDetailScreen-C_-nFgWB.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]="fb889919-3394-47e2-9702-2e6207e18d79",a._sentryDebugIdIdentifier="sentry-dbid-fb889919-3394-47e2-9702-2e6207e18d79")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>ze(a),Re=W(function(a,e){const t=ve(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(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=N(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:N(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=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),V=se(function({...a}){const e=K(),t=H(),n=Z(),c=t.pathname.split("/").find(r=>Ge.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>U(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>X(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(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=W(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??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(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=J(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),qe=se(function({referrerType:a,...e}){const t=K(),n=H(),c=Z(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=v(l??""),A=v(m??""),k=v(S??""),x=v(I??""),C=h(d=>be(d.transactionListState,A,p,k)),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>U(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=h(d=>X(d))&&r;let i;const z=Je(p,A,k,T,D,y,x);if(z){const d={startDate:P(D,"YYYY-MM-DD"),endDate:P(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(B(!0),w.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,S,T,D,y,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Je=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=W(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??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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(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=J(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),Ke=se(function({referrerType:a,...e}){const t=K(),n=H(),c=Z(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=v(l??""),A=v(m??""),k=v(S??""),x=v(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>U(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=h(d=>X(d))&&r;let i;const z=Ze(p,A,k,T,D,y,x);if(z){const d={startDate:P(D,"YYYY-MM-DD"),endDate:P(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(B(!0),w.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,S,T,D,y,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(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=J(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=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=K(),n=H(),c=Z(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=v(l??""),A=v(m??""),k=v(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(Y=>Me(Y.transactionListState,A,p)),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(Y=>U(Y)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,S,T,D,k);if(R){const Y={startDate:P(T,"YYYY-MM-DD"),endDate:P(D,"YYYY-MM-DD")},Pe=et(C?.dateRange,Y);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Pe}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=h(Y=>X(Y))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!b&&r!=null&&_&&(B(!0),w.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,S,T,D,y].filter(Y=>Y!=null);return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:Y=>F(Y),...e}):s.jsx(G,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&P(n,"YYYY-MM-DD").isValid()&&P(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=H().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>U(n)).tenantId],t=Oe();return s.jsxs(Ye,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ke,{referrerType:a})})]})}export{kt as default};
|