@zeniai/web-app-ui 5.1.75-dev → 5.1.76-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-BwsHnOH8.js +1 -0
- package/dist/assets/AddressScreen-CAtyAvAs.js +9 -0
- package/dist/assets/AiCfoScreen-D-u3zZeh.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-C9pR0_l1.js +1 -0
- package/dist/assets/BillPayRoutes-CmZHJWuj.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-CBwqYBjF.js +9 -0
- package/dist/assets/ChargeCardRoutes-BapvAll0.js +71 -0
- package/dist/assets/{CompanyPassportScreen-DavSJynu.js → CompanyPassportScreen-Bc_61P8x.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-ChtPjyOS.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DIF1UKGf.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-CHcuZpK3.js +23 -0
- package/dist/assets/{DashboardRoutes-Brg8B8gk.js → DashboardRoutes-KKfELT68.js} +4 -4
- package/dist/assets/DefaultTenantHome-jBJso_C6.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-BpuUIzPP.js +18 -0
- package/dist/assets/DrawerScreen-iltW1aDR.js +1 -0
- package/dist/assets/EntityDetailRoutes-BKjoJvHi.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-DyYkiLeH.js +25 -0
- package/dist/assets/FeaturePreviewScreen-BZoG5bFs.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-BaRTPuiA.js +1 -0
- package/dist/assets/MagicLinkRoutes-CqR6QAtm.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DLVoUEmm.js +12 -0
- package/dist/assets/MobileAppDrawer-9x3MntXc.js +1 -0
- package/dist/assets/NotFoundScreen-_z9DP-yZ.js +1 -0
- package/dist/assets/NotificationRoutes-Djfnd3nr.js +1 -0
- package/dist/assets/OAuthConsentScreen-BwhWE0vr.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CVL93nhx.js +1 -0
- package/dist/assets/PeopleRoutes-D3dMO3Oa.js +22 -0
- package/dist/assets/PerformanceRoutes-OkJlvpcW.js +1 -0
- package/dist/assets/{Preview-DIWTyMQY.js → Preview-C1-82nYG.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DXq_HXCX.js → QBOConnectionScreen-BcBoTeUC.js} +1 -1
- package/dist/assets/{ReferralListScreen-DNdLnut4.js → ReferralListScreen-CAfKHWlD.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-GMPo499D.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-ilSdM3T_.js +1 -0
- package/dist/assets/{ReimbursementRoutes-Bb9JPi0m.js → ReimbursementRoutes-BCzqaCd0.js} +12 -12
- package/dist/assets/ReportsRoutes-sECeRqYD.js +1 -0
- package/dist/assets/RewardsRoutes-DccykIgv.js +1 -0
- package/dist/assets/ScreenRoutes-CX9dtujm.js +2 -0
- package/dist/assets/SettingsRoutes-DkiGjvE8.js +57 -0
- package/dist/assets/SetupPagesScreen-D5qsyJcA.js +29 -0
- package/dist/assets/SignInScreen-BoIMwzOO.js +1 -0
- package/dist/assets/SignOutScreen-Paf7hNrb.js +9 -0
- package/dist/assets/TaskListScreen-4INm3wUC.js +9 -0
- package/dist/assets/TaskRoutes-BqUtiKFz.js +9 -0
- package/dist/assets/TransactionDetailRoutes-Cbya-6yV.js +1 -0
- package/dist/assets/{TransactionDetailScreen-DB5lxQrk.js → TransactionDetailScreen-DSbk67SD.js} +2 -2
- package/dist/assets/TransactionListRoutes-18Xdo-CX.js +1 -0
- package/dist/assets/TreasuryRoutes-BLFuB0DM.js +37 -0
- package/dist/assets/{VendorsRoutes-CwYVQ8VQ.js → VendorsRoutes-C7cLMHN4.js} +19 -19
- package/dist/assets/WiseConfirmationScreen-CnHMJMAk.js +12 -0
- package/dist/assets/ZeniAccountRoutes-DEFgshzq.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-CahtqojG.js +9 -0
- package/dist/assets/{accountMappingHelper-s2xO6MjH.js → accountMappingHelper-DB6fTWzq.js} +1 -1
- package/dist/assets/{analytics-Ba6zmRos.js → analytics-CGnNJ1B3.js} +1 -1
- package/dist/assets/{analyticsHelper-Cq2pq-lr.js → analyticsHelper-B3wwzf_V.js} +1 -1
- package/dist/assets/{core-D6ttr5iw.js → core-BQch-SEa.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-D0vQ4d1Q.js → decodeURIComponentSafe-BlZKyc9K.js} +1 -1
- package/dist/assets/dnd-DtFKtvlf.js +6 -0
- package/dist/assets/{empty-B81gHGCB.js → empty-CnUVdn1j.js} +1 -1
- package/dist/assets/empty-DBOryUxv.js +1 -0
- package/dist/assets/{emptyVideoElement-DNxKi3mL.js → emptyVideoElement-CMOPMd9b.js} +1 -1
- package/dist/assets/epic-Cn810zkq.js +2 -0
- package/dist/assets/{getLocaleForTenant-O3Y2pcaQ.js → getLocaleForTenant-CQkHA1My.js} +1 -1
- package/dist/assets/{index-DL-oj321.js → index-BDydFdLA.js} +1 -1
- package/dist/assets/{index-pFVjg2n3.js → index-BJcfizgW.js} +1 -1
- package/dist/assets/{index-DK3W-xXd.js → index-BKzmRWFJ.js} +2 -2
- package/dist/assets/{index-ilZtTEZn.js → index-C6_U0a3I.js} +40263 -45717
- package/dist/assets/{index-CETE-7wR.js → index-C75IsDSW.js} +1 -1
- package/dist/assets/{index-DyaqeLYa.js → index-CdbMVgUL.js} +1 -1
- package/dist/assets/{empty-0_eSm854.js → index-CjwtZFvv.js} +1 -1
- package/dist/assets/index-DZkdTIsz.js +1 -0
- package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
- package/dist/assets/{lexical-T2nlwAPk.js → lexical-BBRytn_R.js} +1 -1
- package/dist/assets/{liveblocks-CS0rfBBF.js → liveblocks-Bi6jUyhM.js} +1 -1
- package/dist/assets/{lottie-CZmubsAo.js → lottie-CB8QpQmy.js} +1 -1
- package/dist/assets/{mui-vLo47rlo.js → mui-D4v6d6vq.js} +1 -1
- package/dist/assets/{pathToGoBack-CkJN8BOO.js → pathToGoBack-iBZHU0oy.js} +1 -1
- package/dist/assets/{pdf-CdoB_huE.js → pdf-BNQvW5mJ.js} +3 -3
- package/dist/assets/{pdf-lib-RRzqb1kw.js → pdf-lib-BkMwujYN.js} +1 -1
- package/dist/assets/{plaid-IKw4XOsd.js → plaid-DWupRB-M.js} +1 -1
- package/dist/assets/{pusher-Cj6_igRe.js → pusher-Dkp2Jrxx.js} +1 -1
- package/dist/assets/{react-D95yXzXQ.js → react-4loJCMRC.js} +1 -1
- package/dist/assets/{react-BkKsXl-3.js → react-BnoWjI1_.js} +1 -1
- package/dist/assets/{react-CCfELnN3.js → react-CZ9x9aZs.js} +1 -1
- package/dist/assets/{react-BDJBiih3.js → react-CtfVTLhb.js} +1 -1
- package/dist/assets/{react-BbjDrfEs.js → react-D6_PfBEK.js} +1 -1
- package/dist/assets/{react-CppN-oCz.js → react-DZeesIBx.js} +1 -1
- package/dist/assets/{recharts-BDyAk4nR.js → recharts-6oV2OwTy.js} +3 -3
- package/dist/assets/{routePaths-C1rKvS5o.js → routePaths-CGRC3p-8.js} +1 -1
- package/dist/assets/{sentry-CEfOando.js → sentry-DwScFzsh.js} +1 -1
- package/dist/assets/{url-BQNo9gT5.js → url-CA34r-nZ.js} +1 -1
- package/dist/assets/{url-C9_bAZjF.js → url-uJs8N0Ig.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Btwm3vJo.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-0ztMF6vl.js +1 -0
- package/dist/assets/{useDeviceId-DISstVTH.js → useDeviceId-B2Yksaa2.js} +1 -1
- package/dist/assets/useInitialThreadRequest-B5cDCn22.js +1 -0
- package/dist/assets/{utils-DKj7mVPA.js → utils-Dwr2wQrV.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-DeW-W6do.js → withTransactionSidePanel-D1jVzWuM.js} +4 -4
- package/dist/assets/zeni-epic-state-DxVQhBoO.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-BqX5wkCR.js +0 -1
- package/dist/assets/AddressScreen-ScWWmTbP.js +0 -9
- package/dist/assets/AiCfoScreen-quWQqhzX.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-CQmYX8YN.js +0 -1
- package/dist/assets/BillPayRoutes-jZS0wJcj.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-DFgVqXvI.js +0 -9
- package/dist/assets/CardsAiCfoScreen-BbBCL2AM.js +0 -14
- package/dist/assets/ChargeCardRoutes-BPGek5pB.js +0 -71
- package/dist/assets/ConnectionAuthScreen-BbANlW5J.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-kiJ2IeW7.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-6ipmFo_1.js +0 -30
- package/dist/assets/DefaultTenantHome-B6se2qjz.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-jS6brB2p.js +0 -18
- package/dist/assets/DrawerScreen-D0g6PABS.js +0 -1
- package/dist/assets/EntityDetailRoutes-qim0q068.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-D3rXxAM_.js +0 -25
- package/dist/assets/FeaturePreviewScreen-Y7t6ABdh.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-BUpxwCNc.js +0 -1
- package/dist/assets/MagicLinkRoutes-5wgvqx65.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CelaLjKf.js +0 -12
- package/dist/assets/MobileAppDrawer-Sx7ydj7A.js +0 -1
- package/dist/assets/NotFoundScreen-BDl5tn8o.js +0 -1
- package/dist/assets/NotificationRoutes-Cdcu8PTz.js +0 -1
- package/dist/assets/OAuthConsentScreen-C5pyboC-.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DjwWiUAb.js +0 -1
- package/dist/assets/PeopleRoutes-x62_g_WP.js +0 -22
- package/dist/assets/PerformanceRoutes-DQciMsYC.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-BazeprVG.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js +0 -1
- package/dist/assets/ReportsRoutes-DB2v4EPm.js +0 -1
- package/dist/assets/RewardsRoutes-ChJyJSHY.js +0 -1
- package/dist/assets/ScreenRoutes-8R8Dd2d9.js +0 -2
- package/dist/assets/SettingsRoutes-oK_kou4I.js +0 -57
- package/dist/assets/SetupPagesScreen-CVKPKeC9.js +0 -29
- package/dist/assets/SignInScreen-C7vB3Bra.js +0 -1
- package/dist/assets/SignOutScreen-CQYa9Dvp.js +0 -9
- package/dist/assets/TaskListScreen-WRcn05lO.js +0 -9
- package/dist/assets/TaskRoutes-DoWinBID.js +0 -9
- package/dist/assets/TransactionDetailRoutes-B4ryZwp2.js +0 -1
- package/dist/assets/TransactionListRoutes-6SM8gNlu.js +0 -1
- package/dist/assets/TreasuryRoutes-DHuVCY9q.js +0 -37
- package/dist/assets/WiseConfirmationScreen-DLnf9dkP.js +0 -12
- package/dist/assets/ZeniAccountRoutes-u96OM2YN.js +0 -73
- package/dist/assets/ZeniAccountStatementScreen-D9UEHLLF.js +0 -9
- package/dist/assets/dnd-C751Xq24.js +0 -6
- package/dist/assets/epic-BpVO28im.js +0 -2
- package/dist/assets/index-lXh6fiHl.js +0 -1
- package/dist/assets/index-xNwL9wH4.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-33WX5dhg.js +0 -1
- package/dist/assets/useCashManagementBanner-CBJfpbK7.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-Cvnaf2Z-.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-BzWsu8a4.js +0 -1
- package/dist/assets/useInitialThreadRequest-Bx57kb_d.js +0 -1
- package/dist/assets/zeni-epic-state-Cl3jFj7z.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as p}from"./liveblocks-Bi6jUyhM.js";import{g as z,h as ge,u as Ce,i as Ie,j as d,n as Se,o as we,p as G}from"./core-BQch-SEa.js";import{eS as L,fg as I,Kt as Te,jJ as Q,p$ as X,qQ as F,jx as Re,iB as Oe,ue as W,qV as Ae,bs as Fe,Ku as ke,bn as De,vn as je,Kv as Ee,Kw as Pe,u6 as Me,Kx as Y,Ky as Le,Kz as ve,KA as Be,KB as Ke,KC as S,KD as k,KE as D,KF as H,KG as j,KH as E,dF as Ue,v3 as Ve,uT as N,uU as $,v9 as xe,uY as q,vf as ze,KI as Ge,KJ as Ye,KK as He,KL as Ne,KM as $e,f1 as qe,e$ as Ze}from"./zeni-epic-state-DxVQhBoO.js";import{M as Je,N as Qe,T as Xe,U as We,X as ea,a as ee,G as P,z as ae,Y as aa,I as sa,c as ta,Z as oa,$ as na,s as ra,d as M,f as ia,a0 as la,q as se,a1 as ca,a2 as da,a3 as pa}from"./index-C6_U0a3I.js";import"./mui-D4v6d6vq.js";import fa from"./NotFoundScreen-_z9DP-yZ.js";import{F as ma}from"./FeaturePreviewScreen-BZoG5bFs.js";import{a as _}from"./sentry-DwScFzsh.js";import{u as ua}from"./useInitialThreadRequest-B5cDCn22.js";import{t as Z,a as J,b as _a}from"./routePaths-CGRC3p-8.js";import{M as ha}from"./MobileAppDrawer-9x3MntXc.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.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]="ddcd76b3-99a2-4b2d-b1f9-483c19bf816d",e._sentryDebugIdIdentifier="sentry-dbid-ddcd76b3-99a2-4b2d-b1f9-483c19bf816d")}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(Ye()),e(He()),e(Ne()),e($e())},ga=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=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:M,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(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($(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(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(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($(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 Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(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?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:w(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(H({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(H({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",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Me()),o.isAccountingProjectsEnabled&&e(W())},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}=We(),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=>L(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=>Q(n)),O=d(n=>X(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),A=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&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(W());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,K,O]);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=Je(he??"")==="reports",be=Qe(_e),ye=_.useMemo(()=>x?ba:void 0,[x]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:M,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:M,filter:b,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,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 w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function xa(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=qe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{xa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-Bi6jUyhM.js";import{a as x,z as w,aN as y,s as E,d as p,f as F,cQ as R,G as L}from"./index-C6_U0a3I.js";import"./mui-D4v6d6vq.js";import l from"./NotFoundScreen-_z9DP-yZ.js";import{a as d}from"./sentry-DwScFzsh.js";import{u as P,j as b,h as T,g as U,n as V,o as z,p as u}from"./core-BQch-SEa.js";import{eS as A,Ri as C,NU as G,Rj as _,uK as Y,f7 as K,Rk as O,uI as Q}from"./zeni-epic-state-DxVQhBoO.js";import{R as j}from"./ReferralListScreen-CAfKHWlD.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.js";import"./useAskAiCfoHostNavButtonProps-0ztMF6vl.js";import"./MobileAppDrawer-9x3MntXc.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="91b1e5ea-ac3d-4711-989a-02ab9edc168d",a._sentryDebugIdIdentifier="sentry-dbid-91b1e5ea-ac3d-4711-989a-02ab9edc168d")}catch{}})();const q=V(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,o=w.getSignedInUser();return{onDismissClick:()=>{a(_()),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)}a(Q())},onUpdateInviteFormLocalData:s=>{a(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(R),B=()=>{const a=P(),[t,n]=d.useState(!1),[o,s]=d.useState(!1),r=b(i=>A(i)),c=T(),k=U(),{useDynamicConfig:g}=x(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(i=>C(i)),N=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),v=G(S);d.useEffect(()=>{a(_()),r?.rewardsLastViewedTime==null&&o===!1&&(a(Y()),s(!0))},[]),d.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),a(K(!0)))},[m.fetchState,a]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[m.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:i=>(I=>I.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,e.jsx(q,{navigate:c,location:k,currentTenant:r,companyName:D,userName:N,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=x(),{isFeatureEnabled:t}=a(L.isReferralFeatureEnabled);return e.jsxs(z,{children:[e.jsx(u,{path:"/",element:t?e.jsx(j,{}):e.jsx(l,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(j,{isReferralDrawerOpen:!0}):e.jsx(l,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(B,{}):e.jsx(l,{})}),e.jsx(u,{path:"*",element:e.jsx(l,{})})]})}export{ua as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-KKfELT68.js","assets/sentry-DwScFzsh.js","assets/core-BQch-SEa.js","assets/zeni-epic-state-DxVQhBoO.js","assets/index-C6_U0a3I.js","assets/mui-D4v6d6vq.js","assets/analytics-CGnNJ1B3.js","assets/utils-Dwr2wQrV.js","assets/withTransactionSidePanel-D1jVzWuM.js","assets/useAskAiCfoHostNavButtonProps-0ztMF6vl.js","assets/TransactionDetailScreen-DSbk67SD.js","assets/decodeURIComponentSafe-BlZKyc9K.js","assets/routePaths-CGRC3p-8.js","assets/NotFoundScreen-_z9DP-yZ.js","assets/useInitialThreadRequest-B5cDCn22.js","assets/analyticsHelper-B3wwzf_V.js","assets/CompanyPassportScreen-Bc_61P8x.js","assets/MobileAppDrawer-9x3MntXc.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Btwm3vJo.js","assets/FeaturePreviewScreen-BZoG5bFs.js","assets/ReferralListScreen-CAfKHWlD.js","assets/index-R6GjjTB3.css","assets/BillPayRoutes-CmZHJWuj.js","assets/AddressScreen-CAtyAvAs.js","assets/DomesticWireDetailScreen-BpuUIzPP.js","assets/DrawerScreen-iltW1aDR.js","assets/SetupPagesScreen-D5qsyJcA.js","assets/BusinessVerificationPageScreen-CBwqYBjF.js","assets/BillPayApprovalRoutes-C9pR0_l1.js","assets/ReimbursementApprovalRuleDetailScreen-ilSdM3T_.js","assets/getLocaleForTenant-CQkHA1My.js","assets/ReimbursementRoutes-BCzqaCd0.js","assets/ReimbursementApprovalRoutes-GMPo499D.js","assets/TransactionListRoutes-18Xdo-CX.js","assets/ZeniAccountStatementScreen-CahtqojG.js","assets/SettingsRoutes-DkiGjvE8.js","assets/accountMappingHelper-DB6fTWzq.js","assets/QBOConnectionScreen-BcBoTeUC.js","assets/empty-CnUVdn1j.js","assets/index-BJcfizgW.js","assets/url-CA34r-nZ.js","assets/index-DZkdTIsz.js","assets/ReportsRoutes-sECeRqYD.js","assets/ChargeCardRoutes-BapvAll0.js","assets/PeopleRoutes-D3dMO3Oa.js","assets/ExpenseAutomationRoutes-DyYkiLeH.js","assets/TreasuryRoutes-BLFuB0DM.js","assets/VendorsRoutes-C7cLMHN4.js","assets/pathToGoBack-iBZHU0oy.js","assets/ZeniAccountRoutes-DEFgshzq.js","assets/AddressRoutes-BwsHnOH8.js","assets/PandLWithForecastRoutes-CVL93nhx.js","assets/CustomerOnboardingRoutes-CHcuZpK3.js","assets/TransactionDetailRoutes-Cbya-6yV.js","assets/EntityDetailRoutes-BKjoJvHi.js","assets/NotificationRoutes-Djfnd3nr.js","assets/PerformanceRoutes-OkJlvpcW.js","assets/RewardsRoutes-DccykIgv.js","assets/TaskRoutes-BqUtiKFz.js","assets/TaskListScreen-4INm3wUC.js","assets/AiCfoScreen-D-u3zZeh.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as n,bn as as,eS as ts,f1 as rs,e$ as is,fK as os,eW as ls,cP as pe,cw as cs,fh as ds,co as us,bE as ms,bo as _s,fm as Es,v as ps,J$ as As,bs as hs,K0 as Is,bG as gs,fj as xs,bF as Ts,bt as js,ck as Rs,K1 as Us,K2 as Ds,cL as fs,cO as ys,cN as bs,cv as Cs,cB as Hs,nh as Ae,eZ as he,fU as vs,fq as Ie,fR as ge,fS as xe,fr as Os}from"./zeni-epic-state-DxVQhBoO.js";import{j as e}from"./liveblocks-Bi6jUyhM.js";import{a as v}from"./sentry-DwScFzsh.js";import{u as Ps,h as Fs,i as Ls,g as ks,j as G,l as Te,N as c,o as Bs,p as t}from"./core-BQch-SEa.js";import{m as Ss,u as Vs,z as D,a as Ns,c as ws,k as Zs,G as B,i as Ms,I as Gs,L as F,D as je,t as m,P as $s,d as Q,l}from"./index-C6_U0a3I.js";import"./mui-D4v6d6vq.js";import{f as Re}from"./analyticsHelper-B3wwzf_V.js";import{t as zs}from"./getLocaleForTenant-CQkHA1My.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new r.Error().stack;j&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[j]="f78a06f7-83cb-4529-8d73-29c684387af9",r._sentryDebugIdIdentifier="sentry-dbid-f78a06f7-83cb-4529-8d73-29c684387af9")}catch{}})();const Ks={dashboard:()=>n(()=>import("./DashboardRoutes-KKfELT68.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-CmZHJWuj.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-BCzqaCd0.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-18Xdo-CX.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-DkiGjvE8.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-sECeRqYD.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-BapvAll0.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-D3dMO3Oa.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-DyYkiLeH.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-BLFuB0DM.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-C7cLMHN4.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-DEFgshzq.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Ws=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],X=r=>{"requestIdleCallback"in window?requestIdleCallback(r):setTimeout(r,100)},Ys=l(()=>n(()=>import("./ReportsRoutes-sECeRqYD.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),qs=l(()=>n(()=>import("./AddressRoutes-BwsHnOH8.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),Js=l(()=>n(()=>import("./PeopleRoutes-D3dMO3Oa.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),Qs=l(()=>n(()=>import("./PandLWithForecastRoutes-CVL93nhx.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),Xs=l(()=>n(()=>import("./CustomerOnboardingRoutes-CHcuZpK3.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),en=l(()=>n(()=>import("./VendorsRoutes-C7cLMHN4.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),sn=l(()=>n(()=>import("./TransactionDetailRoutes-Cbya-6yV.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-BKjoJvHi.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),nn=l(()=>n(()=>import("./DashboardRoutes-KKfELT68.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]))),De=l(()=>n(()=>import("./BillPayRoutes-CmZHJWuj.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]))),an=l(()=>n(()=>import("./SettingsRoutes-DkiGjvE8.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]))),fe=l(()=>n(()=>import("./ReimbursementRoutes-BCzqaCd0.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]))),tn=l(()=>n(()=>import("./ZeniAccountRoutes-DEFgshzq.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),rn=l(()=>n(()=>import("./TreasuryRoutes-BLFuB0DM.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),on=l(()=>n(()=>import("./TransactionListRoutes-18Xdo-CX.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ln=l(()=>n(()=>import("./ChargeCardRoutes-BapvAll0.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),cn=l(()=>n(()=>import("./NotificationRoutes-Djfnd3nr.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),dn=l(()=>n(()=>import("./PerformanceRoutes-OkJlvpcW.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),un=l(()=>n(()=>import("./ExpenseAutomationRoutes-DyYkiLeH.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),mn=l(()=>n(()=>import("./RewardsRoutes-DccykIgv.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),_n=l(()=>n(()=>import("./TaskRoutes-BqUtiKFz.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),En=l(()=>n(()=>import("./AiCfoScreen-D-u3zZeh.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),b=l(()=>n(()=>import("./NotFoundScreen-_z9DP-yZ.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),pn=l(()=>n(()=>import("./TaskListScreen-4INm3wUC.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function Vn({setTenantEmailDomain:r}){const j=Ps(),S=Fs(),{tenantEmailDomain:o}=Ls(),V=Ss().mode,{setLoading:C,clearAllLoading:O,clearLoading:N}=Vs(),y=D.getSignedInUserTenant(o)?.tenantId,x=D.getSignedInUser(),ee=as(x),$=ks(),[w,be]=v.useState(!1),i=G(a=>ts(a)),{useFeatureGate:L}=Ns(),Y=ws(),se=Zs(),{isFeatureEnabled:Ce}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:He}=L(B.isTreasuryEnabled),{isFeatureEnabled:ve}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=L(B.isDebitCardFeatureEnabled),R=G(a=>a.tenantState.fetchState),T=G(a=>a.tenantState.activeTenantFetchState.fetchState),_=T==="Completed"||R==="Completed"?rs(ne,i):void 0,q=T==="Completed"||R==="Completed"?is(i):void 0,Oe=Ms(i,ve,ne),{isFeatureEnabled:Pe}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:Fe}=L(B.isAiCfoFileUploadEnabled),z=G(a=>os(a));if(o!=null){const a=D.getSignedInUserTenant(o);x!=null&&a!=null&&Re(x,i,V)}const M={tenantId:y,userId:x?.userId,sessionId:x?.zeniSessionId},ae=ls(),E=Gs(),Le=i.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),ke=cs(E?.loggedInUserRoleMap),te=v.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,J=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Be=G(a=>M.tenantId!=null?ds(a,M.tenantId):void 0);v.useEffect(()=>{C(F.TENANT_FETCHING),r(o)},[o]),v.useEffect(()=>{if(J!=null&&y!=null){const a=J.params.selectedPeriod;if(a!=null){const U=a.split("-");if(U.length===2){const d=us(Number(U[0])),s=Number(U[1]),u=ms(`01-${d<10?`0${d}`:d}-${s}`,je.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=_s();u.isAfter(Z,"month")===!1?j(Es(y,{month:d,year:s})):S("./month_end_close_checks/review")}}}},[J,y]),v.useEffect(()=>{w||(be(!0),C(F.TENANT_FETCHING)),te.current?te.current=!1:!ps(ae,M)&&D.isSignedIn()&&(C(F.TENANT_FETCHING),function(a,U,d,s){if(he(U?.userId,U?.zeniSessionId,a.tenantId),d(vs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&m.clearTenant(a.tenantId),a.tenantId!=null){const u=D.getSignedInUserTenantWithId(a.tenantId);s&&je.updateAppLocaleID(zs(s)),u?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(u?.tenantEmailDomain)}a.userId!=null?Q.identify(a.userId,{tenant_id:a.tenantId}):Q.resetUserIdentity()}(M,x,j,Be))},[M,ae,x,j,D]),v.useEffect(()=>{D.isSignedIn()&&(C(F.TENANT_FETCHING),function(a,U,d,s,u,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const K=s!=null&&u?.zeniSessionId!=null,es=d==null||d.tenantId!==s,ss=d!=null&&d.excludedResources==null,ns=d!=null&&d.externalConnections==null;if(K&&es){k(Ie(s));const W=D.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),he(u?.userId,u?.zeniSessionId,s),m.shouldFetchExcludedResources(s)&&(m.markExcludedResourcesFetchStarted(s),k(ge(u.userId,s))),m.shouldFetchConnections(s)&&(m.markConnectionsFetchStarted(s),k(xe(u.userId,s)))}else K&&ss&&m.shouldFetchExcludedResources(s)&&(m.markExcludedResourcesFetchStarted(s),k(ge(u.userId,s))),K&&ns&&m.shouldFetchConnections(s)&&(m.markConnectionsFetchStarted(s),k(xe(u.userId,s)));if(K){Q.identify(u.userId,{tenant_id:s});const W=s==null||s!=null&&(U==="Completed"||U==="Error");a==="Completed"||U!=="Not-Started"&&U!=="Error"||s==null||!m.shouldFetchActiveTenant(s)||(m.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Os(u.userId,s,u.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&m.shouldFetchAllTenants()&&(m.markAllTenantsFetchStarted(),k(Ae(u.userId,u.zeniSessionId)))}}(R,T,i,y,x,C,j))},[y,T]),v.useEffect(()=>{D.isSignedIn()&&R==="Completed"&&z.tenantsBaseInOrder.length>0&&(N(F.TENANT_FETCHING),D.saveSignedInUserTenants(As(z.tenantsBaseInOrder)),x!=null&&Re(x,i,V,void 0,z.tenantsBaseInOrder))},[z,R,i,x]),v.useEffect(()=>{T==="In-Progress"&&C(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&y!=null?(O(),m.markActiveTenantFetchCompleted(y)):T==="Error"&&y!=null&&(m.markActiveTenantFetchFailed(y),N(F.TENANT_FETCHING),N(F.TENANT_SWITCHING))),R!=="Completed"&&R!=="Error"||(R==="Completed"?m.markAllTenantsFetchCompleted():R==="Error"&&m.markAllTenantsFetchFailed())},[T,R,y,w]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&T==="Completed"&&w&&(ie.current=!0,function(a=Ws,U=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const u=a[s],Z=Ks[u];Z!=null?Z().then(()=>X(()=>d(s+1))).catch(()=>X(()=>d(s+1))):d(s+1)};X(()=>d(0))},U)}())},[T,w]);const H=i?.userRole!=null&&hs(i?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ve=i?.userRole!=null&&i.userRole.includes("charge_card_user"),Ne=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&pe(i.userRole),oe=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!H,le=Oe&&!H,we=Is(E?.loggedInUserRoleMap),Ze=i.externalConnections?.accounting[0]?.isValid,ce=i.company?.companyOnboardingInfo.isOnboardingCompleted,de=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!H,ue=de&&gs(E?.loggedInUserRoleMap),me=Ce&&!H,Me=i.company!=null&&xs(i.company),Ge=He&&Me===!0&&!H,$e=oe&&Ts(E?.loggedInUserRoleMap),ze=le&&js(E?.loggedInUserRoleMap),Ke=me&&Rs(E?.loggedInUserRoleMap),We=Us(E?.loggedInUserRoleMap),Ye=Ds(E?.loggedInUserRoleMap),p=fs(E?.loggedInUserRoleMap),A=ys(E?.loggedInUserRoleMap),qe=bs(E?.loggedInUserRoleMap),h=Cs(E?.loggedInUserRoleMap),I=Hs(E?.loggedInUserRoleMap),_e=oe&&h,Ee=de&&I,Je=me&&p,Qe=Ge&&A,g=le&&qe,Xe=i.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||ke===!0||we===!0||We===!0||Ye===!0;return D.isSignedIn()?y==null?R==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(x!=null&&R!=="In-Progress"&&j(Ae(x.userId,x.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||R==="Completed"?(ce===!0||ee&&!re)&&Ze===!1&&_===!1&&q===!1?(r(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!w||ce!==!1||re||ee?w&&i?.userRole&&_!=null&&q!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Bs,{children:e.jsxs(t,{element:e.jsx($s,{}),children:[e.jsx(t,{path:"/",element:e.jsx(An,{isDashboardAccess:P,isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,isTenantCardsOnly:q,showChargeCardRoute:g})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(nn,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Ys,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:Xe||P?e.jsx(Js,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(Qs,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(Xs,{})}),e.jsx(t,{path:"transaction/*",element:P&&H===!1||Ve||Ne?e.jsx(sn,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&H===!1?e.jsx(on,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&H===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isTenantBankingOnly:_,isUserHasTreasuryAccess:A,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&H===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(pn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"address/*",element:$e||ue||Ke||ze?e.jsx(qs,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Je?e.jsx(tn,{}):e.jsx(b,{})}),e.jsx(t,{path:"treasury/*",element:Qe?e.jsx(rn,{}):e.jsx(b,{})}),e.jsx(t,{path:"performance",element:se===!0?e.jsx(dn,{}):e.jsx(ye,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:se===!0&&H===!1?e.jsx(un,{}):e.jsx(ye,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(cn,{})}),e.jsx(t,{path:"vendors/*",element:Le?e.jsx(en,{}):e.jsx(b,{})}),e.jsx(t,{path:"bill/*",element:_e?e.jsx(De,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:_e?e.jsx(De,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(fe,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(fe,{}):e.jsx(f,{isUserHasZeniAccountsAccess:p,isUserHasBillPayAccess:h,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:A,isTenantBankingOnly:_,showChargeCardRoute:g,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Pe?e.jsx(an,{hasAdminLevelAccess:ue}):e.jsx(b,{})}),e.jsx(t,{path:"cards/*",element:g?e.jsx(ln,{}):e.jsx(b,{})}),e.jsx(t,{path:"rewards/*",element:Se?e.jsx(mn,{}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo",element:Y?e.jsx(c,{to:"explore"}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo/",element:Y?e.jsx(c,{to:"explore"}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Y?e.jsx(En,{isFileUploadEnabled:Fe}):e.jsx(b,{})}),e.jsx(t,{path:"*",element:e.jsx(b,{})})]})}):null:(r(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),r(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const An=({isDashboardAccess:r,isUserHasZeniAccountsAccess:j,isUserHasBillPayAccess:S,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:V,isTenantBankingOnly:C,isTenantCardsOnly:O,showChargeCardRoute:N})=>C===!0&&j?e.jsx(c,{to:"checking"}):O===!0&&N?e.jsx(c,{to:"cards"}):r?e.jsx(c,{to:"dashboard"}):j?e.jsx(c,{to:"checking"}):V?e.jsx(c,{to:"treasury"}):N?e.jsx(c,{to:"cards"}):S?e.jsx(c,{to:"bills"}):o?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),f=({isUserHasZeniAccountsAccess:r,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:o,isTenantBankingOnly:V,showChargeCardRoute:C,tenantEmailDomain:O})=>V===!0||r?e.jsx(xn,{tenantEmailDomain:O}):o?e.jsx(gn,{tenantEmailDomain:O}):C?e.jsx(Tn,{tenantEmailDomain:O}):j?e.jsx(In,{tenantEmailDomain:O}):S?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(b,{}),hn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/reimbursements`}),In=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/bills`}),gn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/treasury`}),xn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/checking`}),Tn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/cards`}),ye=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/dashboard`});export{f as FallBackRoute,Vn as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-Bi6jUyhM.js";import{a as p}from"./sentry-DwScFzsh.js";import{h as z,g as $,u as F,j as f,t as ce,n as K,i as G,o as Y,p as E}from"./core-BQch-SEa.js";import{bn as ke,eS as P,fP as Pe,m6 as le,Md as De,gQ as me,M4 as Me,p$ as Ue,jJ as fe,m2 as Oe,gS as Te,M6 as _e,M5 as Fe,Ov as Re,yl as Be,CQ as Ve,O4 as ze,Od as Le,c1 as ne,cG as Ne,cH as $e,Kb as Ke,Ow as Ge,Kc as He,wN as qe,Ox as Qe,Fc as Ze,Cw as Je,Cn as he,Ck as Xe,wR as be,Cq as Se,Ct as Ce,Cz as te,td as ae,wQ as Ye,jl as W,jo as ye,Oy as We,kp as en,x4 as nn,K$ as tn,L0 as an,jj as on,Oz as sn,jm as cn,qt as ln,OA as rn,OB as dn,qx as un,gA as pn,Kk as X,gp as gn,gw as mn,Kl as fn,x1 as hn,OC as bn,OD as Sn,CN as Cn,e$ as Ie,f1 as xe,OE as yn,fD as In,Ku as xn,x0 as re,fI as de,fH as En,w$ as An,fG as wn,fF as vn,OF as jn,f4 as Ee,OG as kn,OH as Pn,x7 as Dn,w_ as ue,OI as Mn,fl as Un,wX as On,bU as Tn,c0 as _n,b$ as Fn,bV as Rn,bZ as Bn,bY as Vn,bX as zn,b_ as Ln,bW as Nn}from"./zeni-epic-state-DxVQhBoO.js";import{a as Z,G as _,z as v,af as Ae,bK as $n,d as J,f as Kn,I as H,B as oe,bL as Gn,i as we,bM as Hn,aq as qn,j as ve,bN as Qn,bO as Zn,bP as Jn,Y as Xn,bQ as Yn,q as Wn,bR as et}from"./index-C6_U0a3I.js";import{n as B}from"./mui-D4v6d6vq.js";import{M as R}from"./MobileAppDrawer-9x3MntXc.js";import{a as q,g as Q,m as nt}from"./accountMappingHelper-DB6fTWzq.js";import{t as tt,A as at}from"./AddressScreen-CAtyAvAs.js";import N from"./NotFoundScreen-_z9DP-yZ.js";import{g as ot}from"./analyticsHelper-B3wwzf_V.js";import{B as st}from"./BusinessVerificationPageScreen-CBwqYBjF.js";import{C as it}from"./CompanyPassportScreen-Bc_61P8x.js";import{q as pe}from"./QBOConnectionScreen-BcBoTeUC.js";import{B as ct}from"./BillPayApprovalRoutes-C9pR0_l1.js";import{R as lt}from"./ReimbursementApprovalRoutes-GMPo499D.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.js";import"./routePaths-CGRC3p-8.js";import"./empty-CnUVdn1j.js";import"./pdf-lib-BkMwujYN.js";import"./index-BJcfizgW.js";import"./url-CA34r-nZ.js";import"./index-DZkdTIsz.js";import"./decodeURIComponentSafe-BlZKyc9K.js";import"./ReimbursementApprovalRuleDetailScreen-ilSdM3T_.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]="cd54ce84-8259-418e-a9c3-915ac141dee6",e._sentryDebugIdIdentifier="sentry-dbid-cd54ce84-8259-418e-a9c3-915ac141dee6")}catch{}})();const rt=B.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:Ue(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:l,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:g,filing1099Section:m}=n,{incomeAccount:b,expenseAccount:d}=a,{billPayAccount:c}=r,{reimbursementsAccount:y}=u,{prepaidExpensesAccount:A,fixedAssetsAccount:j,accruedExpensesAccount:C}=g,{bankAccount:k,expenseCategory1099:M}=m,I=q(t.accountMappingView.incomeAccountList,b.selectedOption),O=q(t.accountMappingView.expenseAccountList,d.selectedOption),D=q(t.accountMappingView.billPayAccountList,c.selectedOption),L=q(t.accountMappingView.reimbursementsAccountList,y.selectedOption),V=Q(t.accountMappingView.prepaidExpensesAccountList,A.selectedOptions),h=Q(t.accountMappingView.fixedAssetsAccountList,j.selectedOptions),U=Q(t.accountMappingView.accruedExpensesAccountList,C.selectedOptions),S=Q(t.accountMappingView.bankAccounts1099FilingAccountList,k.selectedOptions),x=nt(t.accountMappingView.expenseAccounts1099FilingAccountList,M),T={selectedIncomeAccountId:I?.accountId,selectedExpenseAccountId:O?.accountId,selectedBillPayAccountId:D?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:V.map(w=>w.accountId),selectedFixedAssetsAccountIds:h.map(w=>w.accountId),selectedAccruedExpensesAccountIds:U.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:S.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Fe({data:T}))},onBackClick:()=>{Ae(l)===!1?(s("../../dashboard"),e(_e())):e(me())},onSaveClick:()=>{e(Te()),i&&J.track(Kn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Oe(t.currentTenant.companyId,n))}}})($n),ut=()=>{const e=z(),t=$(),s=F(),{useFeatureGate:l,useDynamicConfig:i}=Z(),{isFeatureEnabled:n}=l(_.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=l(_.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:r,isDynamicConfigLoading:u}=i("transaction_categorization_config"),g=!u&&r?.capitalization_enabled===!0,m=v.getSignedInUser(),b=ke(m),d=f(S=>P(S)),{capitalizableAccounts:c,capitalizableAccountOverrides:y,isCapitalizationThresholdSaving:A,currencySymbol:j}=f(S=>{const x=S.tenantState.currentTenantId,T=x!=null?S.tenantState.tenantsById[x]:void 0,w=Pe(S.companyState,d.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:S.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:w?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),C=p.useCallback((S,x)=>{s(le(d.companyId,S,x))},[s,d.companyId]),k=p.useCallback(S=>{const x={...y??{}},T=Object.entries(S);for(const[se,ie]of T)ie===null?delete x[se]:x[se]=ie;const[w,je]=T[0]??[];w!=null&&s(le(d.companyId,w,je,void 0,Object.keys(x).length>0?x:null))},[s,d.companyId,y]),M=f(S=>De(S.accountState),ce),I=p.useMemo(()=>{const S={};for(const x of M)x.accountId!=null&&x.accountName!=null&&(S[x.accountId]=x.accountName);return S},[M]),[O,D]=p.useState(!1),[L,V]=p.useState(!1);p.useEffect(()=>{O===!1&&(s(me()),D(!0))},[O]);const h=f(S=>Me(S)),U=S=>{V(S)};return o.jsxs(rt,{children:[o.jsx(R,{isAppContentDrawerOpen:L,handleDrawerToggle:U}),o.jsx(dt,{currentTenant:d,navigate:e,accountMappingView:h,isFiling1099FeatureEnabled:n&&b,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:g,capitalizableAccounts:c,accountNamesById:I,capitalizableAccountOverrides:y,currencySymbol:j,isCapitalizationThresholdSaving:A,onSaveCapitalizationAccountThreshold:C,onSaveCapitalizationAccountThresholds:k,location:t,isSettings:Ae(t),onClickMenuIcon:()=>U(!0)})]})},pt=B.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),l=ze(e),i=Le(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ne(s?.userRole??[])||n)&&"readonly",billpayApprovalView:l,remiApproverView:i,analytics:J}},function(e,t){const{navigate:s,currentTenant:l}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),mt=()=>{const e=z(),t=$(),s=F(),{tenantEmailDomain:l}=G(),[i,n]=p.useState(!1),[a,r]=p.useState(!1),[u,g]=p.useState(!1),m=f(C=>P(C)),b=f(C=>C.billPaySetupApproverViewState.fetchState),d=f(C=>C.remiSetupApproverViewState.fetchState),c=f(C=>Re(C)),y=m.companyId??v.getSignedInUserTenant(l)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const A=H();p.useEffect(()=>{u||b!=="Not-Started"||(g(!0),s(Be(!0)))},[u,b,s]),p.useEffect(()=>{a||d!=="Not-Started"||(r(!0),s(Ve(!0)))},[a,d,s]);const j=C=>{n(C)};return A?.loggedInUserRoleMap!=null?o.jsxs(pt,{children:[o.jsx(R,{isAppContentDrawerOpen:i,handleDrawerToggle:j}),o.jsx(gt,{navigate:e,location:t,companyId:y,currentTenant:m,roleMap:A.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):o.jsx(oe,{fetchState:c.fetchState})},ft=B.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:l,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:r}=t,u=P(e);return{bankSetupView:Qe(e,s,n,a,l,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,t){const{navigate:s,currentTenant:l,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,r)=>{e(ae(a,n,r))},onEstablishConnectionClick:(n,a,r)=>{e(te(n,i,a,r))},onUpdatePaymentAccountStatus:(n,a,r,u,g)=>{e(Ce(n,a,g,u,r))},onUpdatePaymentAccountLoginStatus:(n,a,r,u)=>{e(Se(!1,n,u,r,a))},onEstablishConnectionSuccess:(n,a)=>{e(be(a,n))},onUpdateAccountClick:(n,a,r,u,g)=>{e(g==="paymentAccount"?he(n,a,r,u):Xe(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,r)=>{e(Je(i,a,n,r))},onRemoveConnection:n=>{e(Ze(n))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Hn),bt=()=>{const e=z(),t=$(),s=F(),{tenantEmailDomain:l}=G(),i=H(),{useFeatureGate:n}=Z(),{isFeatureEnabled:a}=n(_.isChargeCardFeatureEnabled),{isFeatureEnabled:r}=n(_.isDebitCardFeatureEnabled),[u,g]=p.useState(!1),[m,b]=p.useState(!1),d=f(D=>P(D)),c=f(D=>D.settingsViewState.bankConnection.fetchState),y=Ne(d,i?.loggedInUserRoleMap),A=$e(d,i?.loggedInUserRoleMap),j=Ke(d,i?.loggedInUserRoleMap),C=Ge(d,i?.loggedInUserRoleMap),k=we(d,a,r),M=He(d,i?.loggedInUserRoleMap)&&k,I=d.companyId??v.getSignedInUserTenant(l)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{m||c==="Completed"||(b(!0),s(qe(!1)))},[m,s,c]);const O=D=>{g(D)};return y||j||A||M?o.jsxs(ft,{children:[o.jsx(R,{isAppContentDrawerOpen:u,handleDrawerToggle:O}),o.jsx(ht,{navigate:e,location:t,companyId:I,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:y,isRemiEnabled:A,isZeniAccountEnabled:j,isChargeCardEnabled:M,isTreasuryEnabled:C,onClickMenuIcon:()=>{O(!0)}})]}):o.jsx(N,{})},St=B.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
|
+
`,Ct=K(function(e,t){const{companyId:s}=t,l=P(e),i=t.roleMap.bill_pay_admin,n=We(e,s),{uiState:a}=n,r=(ne(l?.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:ve.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:l.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:J}},function(e,t){const{navigate:s,currentTenant:l,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(ae("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(te(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(be("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,r)=>{e(Ce(n,a,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(Se(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(he(n,a,"billing","billing_setup"))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(ye(n))},handleConfirmCardSetupIntent:n=>{e(cn(n))},updateCardPaymentModalState:n=>{e(sn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,r)=>{e(on(n,a,r))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(an())},handleResetCardPaymentErrorStatuses:()=>{e(tn())},onBillingAddressSave:n=>{e(nn(n))},onAddressEditHandler:n=>{if(n!=null){const a=tt(n);e(en({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Qn),yt=()=>{const e=z(),t=$(),s=F(),{tenantEmailDomain:l}=G(),[i,n]=p.useState(!1),[a,r]=p.useState(!1),[u,g]=p.useState(!1),m=f(k=>P(k)),b=f(k=>k.cardPaymentViewState),d=f(k=>k.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),c=qn(b.addCardPaymentSourceStatus.fetchState),y=b.addCardPaymentSourceStatus.fetchState,A=m.companyId??v.getSignedInUserTenant(l)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=H();p.useEffect(()=>{A!=null&&s(Ye(A,!1))},[A,s]),p.useEffect(()=>{a||(r(!0),s(W()))},[a,s]),p.useEffect(()=>{u||(ye(["card"]),g(!0))},[u]),p.useEffect(()=>{c==="In-Progress"&&y==="Completed"&&s(W())},[c,y]);const C=k=>{n(k)};return j?.loggedInUserRoleMap!=null?o.jsxs(St,{children:[o.jsx(R,{isAppContentDrawerOpen:i,handleDrawerToggle:C}),o.jsx(Ct,{navigate:e,location:t,companyId:A,currentTenant:m,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{C(!0)},googleAPIKey:ve.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:d})},ee="external_integrations",It=K(function(e){const t=dn(e,ee);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:l,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{pe.init("/connection/auth",n),pe.handleClick()},onRefreshClick:()=>{l.integrations.refreshQBO.fetchState!=="In-Progress"&&e(hn())},onSaveChargeBeeCredentials:(r,u)=>{const g=l.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;g!=null&&e(mn(a,g,X("revenue"),fn("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const g=l.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(g!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:g,redirect_uri:m,tenant_id:a}));const b="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(b)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(r,u)=>{e(gn(a,r,X(u)))},onSaveConnectorCredentials:r=>{e(pn(a,X("payments"),r))},onNotifyMe:r=>{e(un(ee,r,i))}}})(Zn),xt=()=>{const e=z(),t=F(),{tenantEmailDomain:s}=G(),[l,i]=p.useState(!1),n=f(c=>c.tenantState.fetchState),a=f(c=>P(c)),r=a.companyId??v.getSignedInUserTenant(s)?.companyId,u=v.getSignedInUser(),g=H(),m=ne(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(ln(ee))},[t]);const b=c=>{i(c)},d=f(c=>rn(c,r));return g?.loggedInUserRoleMap!=null?o.jsxs(Et,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:b}),o.jsx(It,{navigate:e,onClickMenuIcon:()=>{b(!0)},isAdmin:m,integrationsView:d,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:d.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:d.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:d.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:d.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:d.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(d.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([c,y])=>[c,y?.message])),deleteConnectionState:d.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:d.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},Et=B.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
|
+
`,At=B.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=F(),{tenantEmailDomain:t}=G(),[s,l]=p.useState(!1),i=f(c=>P(c)).companyId??v.getSignedInUserTenant(t)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=f(c=>bn(c,n.userId)),r=f(c=>Sn(c,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,g=c=>{l(c)},m=p.useCallback(c=>{e(ae("user_reimbursement_account",c))},[]),b=p.useCallback(c=>{e(te(c,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(Cn(n.userId))},[n.userId,a.fetchState]);const d=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(At,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:g}),o.jsx(Jn,{plaidConnectionDetails:u,isLoading:d,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:b,onClickMenuIcon:()=>{g(!0)}})]})},vt=B.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=F(),s=z(),l=$(),[i,n]=p.useState(!1),a=f(h=>P(h)),{tenantEmailDomain:r}=a,u=a.companyId??v.getSignedInUserTenant(r)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:g}=Z(),{isFeatureEnabled:m}=g(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=g(_.isChargeCardFeatureEnabled),{isFeatureEnabled:d}=g(_.isDebitCardFeatureEnabled),{isFeatureEnabled:c}=g(_.isTreasuryEnabled),y=f(h=>fe(h)),A=Ie(a),j=xe(d,a),C=!j&&y,k=we(a,b,d),{areTenantIdsInSync:M}=Xn();p.useEffect(()=>{M&&t(yn(u,C))},[u,t,C,M]);const I=f(h=>In(h,C)),O=I.fetchState==="Not-Started"||I.fetchState==="In-Progress"||u==null,D=xn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,V=h=>{n(h)};return o.jsxs(vt,{children:[o.jsx(R,{isAppContentDrawerOpen:i,handleDrawerToggle:V}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Yn,{myProfileView:I,isAccountingClassesEnabled:y,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:k===!1,isTreasuryDisabled:c===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{V(!0)},isLoading:O,isBankingOnlyTenant:j,isCardsOnlyTenant:A,onAddressClick:h=>{const U=function(x,T){let w=`/${x}/settings/my_profile`;return w=w.concat(`/new/${T}`),w}(r,h),S=Wn(l.state?.pathnameStackToGoBack,l.pathname);s(U,{state:{pathnameStackToGoBack:S}})},onGetOtp:h=>{const U={...I.myProfileLocalData,phone:h};t(re({localData:U})),t(vn(h,"MyProfile"))},onResendOtp:h=>{t(wn(h,"MyProfile"))},onCancelClick:()=>{t(An())},onSaveClick:()=>{t(de("MyProfile",I.myProfileLocalData.phone,I.myProfileLocalData.otpChallenge,I.myProfileLocalData.dateOfBirth,I.addressData?.addressToCreate))},onVerifyOtp:(h,U)=>{t(En(h,U,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&v.saveZeniOtpToken(h),t(de("MyProfile",I.myProfileLocalData.phone,I.myProfileLocalData.otpChallenge,I.myProfileLocalData.dateOfBirth,I.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{t(re({localData:h}))}})]})};function jt(){const e=F(),t=f(c=>P(c)).companyId,s=f(c=>jn(c)),l=f(c=>Ee(c)),i=v.getSignedInUser(),[n,a]=p.useState(!1),r=p.useCallback(c=>{a(c)},[]),u=p.useCallback(c=>{e(kn(c))},[]),g=p.useCallback(()=>{i?.userEmail!=null&&e(Pn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(Dn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const b=p.useCallback(()=>{const c=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(c,t))},[t,l.notificationSettings.monthEndInsightsNotificationSettings.enabled]),d=p.useCallback(()=>{e(Mn())},[]);return p.useEffect(()=>{if(l.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const c=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(c,t))}},[s.fetchState,t,l.notificationSettings.monthEndInsightsNotificationSettings.enabled,l.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),o.jsx(et,{notificationSettingsView:s,onFormDataChange:u,onCancel:g,onSave:m,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:b,resetUpdateStatus:d})]})}function la(e){const[t,s]=p.useState(!1),l=f(c=>Ee(c)),i=f(c=>P(c)),n=H(),a=v.getSignedInUser(),r=F(),{useFeatureGate:u}=Z(),{isFeatureEnabled:g}=u(_.isDebitCardFeatureEnabled),m=a?.userEmail==null||l.fetchState!=="Completed"||Un(l.notificationSettings,a.userEmail,g,i);p.useEffect(()=>{l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&t===!1&&(s(!0),r(On()))},[l.fetchState,t]);const b=xe(g,i),d=Ie(i);return l.fetchState!=="In-Progress"&&l.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(Y,{children:[_n(n?.loggedInUserRole??[],g,i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"accounting/*",element:o.jsx(ut,{})}),Fn(n?.loggedInUserRole??[],g,i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"approval_rules/*",element:o.jsx(kt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Rn(i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"my_bank_connections",element:o.jsx(wt,{})}),Bn(i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"bank_connections",element:o.jsx(bt,{})}),Vn(i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"business_verification",element:o.jsx(st,{productType:b?"zeni_accounts":d?"charge_cards":ot(i,n?.loggedInUserRoleMap)})}),zn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"company_details",element:o.jsx(it,{})}),Ln(n?.loggedInUserRole??[],i)&&o.jsx(E,{path:"billing",element:o.jsx(yt,{})}),Nn(n?.loggedInUserRole??[],g,i)&&o.jsx(E,{path:"integrations",element:o.jsx(xt,{})}),o.jsx(E,{path:"my_profile/new/:addressType",element:o.jsx(ge,{appContent:o.jsx(at,{isSubPage:!1})})}),o.jsx(E,{path:"my_profile",element:o.jsx(ge,{})}),m&&o.jsx(E,{path:"notifications",element:o.jsx(jt,{})}),o.jsx(E,{path:"*",element:o.jsx(N,{})})]}):o.jsx(Y,{children:o.jsx(E,{path:"*",element:o.jsx(N,{})})}):null}function kt(e){return o.jsxs(Y,{children:[o.jsx(E,{path:"/",element:o.jsx(mt,{})}),o.jsx(E,{path:"bills/approval-rules/*",element:o.jsx(ct,{})}),o.jsx(E,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(lt,{}):o.jsx(N,{})}),o.jsx(E,{path:"*",element:o.jsx(N,{})})]})}export{la as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-Bi6jUyhM.js";import{h as X,g as J,u as Y,i as G,j as E,N,n as W,s as Je}from"./core-BQch-SEa.js";import{bF as Ye,ck as Ie,NU as ye,eS as V,cw as en,yw as Z,yl as nn,O4 as tn,O7 as an,qM as ee,qA as ne,kh as te,sL as z,O9 as Ae,fH as $e,fG as Ge,fF as We,Oa as sn,yF as on,Cw as ke,Cn as _e,Ck as ve,Cb as K,Cq as Pe,Ct as Ee,Cz as we,td as Te,fW as cn,cr as rn,f1 as un,e$ as dn,f0 as ln,bt as pn,Ob as mn,Bd as le,BR as yn,Oc as fn,bG as gn,DM as pe,CQ as Sn,Od as bn,Oe as hn,DQ as Cn,DU as In,sE as An,Ik as kn,Ep as Ce,Fq as me,Of as _n,Og as vn,Oh as Pn,Oi as qe,Oj as En,KO as wn,Nh as Tn,K_ as Dn,Ok as He,Ol as Be,EL as Ke,kp as On,qD as Qe,sN as Un,bE as je,sZ as Ne,cu as Fn,Om as Xe,fk as Bn,E7 as Vn,Eb as xn,On as jn,Es as Re,Oo as Nn,Op as Rn,Oq as zn,Or as Ln,fP as Mn,zQ as Zn,Os as $n,zV as Gn,zU as Wn}from"./zeni-epic-state-DxVQhBoO.js";import{I as ae,a as ie,G as de,m as De,aN as Q,z as w,s as se,d as T,B as Oe,f as $,bz as qn,at as oe,bA as x,bB as Hn,bC as Kn,af as xe,bD as Qn,q as ze,au as Le,X as Xn,w as Jn,bE as Yn,bF as et,bG as nt,a8 as tt}from"./index-C6_U0a3I.js";import{a as C}from"./sentry-DwScFzsh.js";import{n as Ve,D as at,S as it}from"./mui-D4v6d6vq.js";import{M as fe}from"./MobileAppDrawer-9x3MntXc.js";import R from"./NotFoundScreen-_z9DP-yZ.js";import{a as Me}from"./analyticsHelper-B3wwzf_V.js";import{d as Ze}from"./routePaths-CGRC3p-8.js";import{B as Fe}from"./BusinessVerificationPageScreen-CBwqYBjF.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]="11c42e02-abe7-4015-a44d-5e7317aec186",e._sentryDebugIdIdentifier="sentry-dbid-11c42e02-abe7-4015-a44d-5e7317aec186")}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")}}})(qn),ct=()=>{const e=X(),o=J(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),n=Ye(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(Q.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(N,{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}})},Rt=(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,qt=(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,Ht=(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,Qt=80,Xt=80,Jt=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),Yt=({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))}}})(Hn),pt=()=>{const e=X(),o=J(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),n=E(L=>V(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Q.zeniAccountsConfig),{configValue:p}=i(Q.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),[q,ge]=C.useState(!1),[H,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(()=>{H||M!=="Not-Started"||j==null?H||M!=="Completed"||j==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(j,!1,!0)):(re(!0),t(le(j,!0)))},[H,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:q,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(N,{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=X(),o=J(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),{useDynamicConfig:n}=ie(),i=De(),{configValue:l}=n(Q.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(N,{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"?He(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:q,transactionVolumeDescription:ge,purposeOfAccount:H,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:q?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:H?.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(Ne({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(Ne({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(Qe(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())}}})(Qn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=J(),n=Y(),[i]=Je(),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(Q.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=qe(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 Jn(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=Xe(e,a),p=qe(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=He(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(Re(!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(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(Nn(s))},onConfirmFundAllocation:()=>{e(Re(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())}}})(Yn),Ct=()=>{const e=X(),o=J(),t=Y(),a=De(),c=Xn(),{tenantEmailDomain:n}=G(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(Q.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=>Xe(U,B)),q=ce.isAtomicAccountExists,ge=!!O.companyZeniAccountInfo?.info?.isZeniAccountEnabled,H=w.getSignedInUser(),re=U=>{m(U)};if(H==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"||q||j||!o.pathname.includes("setup")||r(!0)},[k,q,j]),O.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(N,{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:q,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=X(),o=J(),t=Y(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Q.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(N,{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(Qe(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=X(),o=J(),t=Y(),[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(N,{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(N,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(N,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ct,{}):t?u.jsx(N,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(R,{}):a?u.jsx(ft,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(kt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(N,{to:"../"}):u.jsx(R,{}):i?u.jsx(pt,{}):l?u.jsx(N,{to:"../"}):u.jsx(R,{})}}));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{Qt as A,Xt as P,na as S,qt as a,Kt as b,ut as c,dt as d,rt as e,Jt as f,Zt as g,zt as h,Wt as i,Ht as j,Yt as k,Gt as l,$t as m,Lt as n,Mt as o,Rt as p,ea as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-Bi6jUyhM.js";import{a as u,b as T,q as A}from"./sentry-DwScFzsh.js";import{u as D,h as z,j as l,g as M,N as j,n as O}from"./core-BQch-SEa.js";import{u as F,z as s,m as P,d as E,D as _,e as K,f as B,A as J,g as N,h as $,j as v}from"./index-C6_U0a3I.js";import{eS as q,J_ as V,J$ as W,eZ as Z,fq as H,K4 as G,fO as Q,cT as R,K5 as b,K6 as X,K7 as Y,bT as y}from"./zeni-epic-state-DxVQhBoO.js";import"./mui-D4v6d6vq.js";import{u as ee}from"./useDeviceId-B2Yksaa2.js";import{f as te}from"./analyticsHelper-B3wwzf_V.js";import{t as ne}from"./getLocaleForTenant-CQkHA1My.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.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]="68686461-6e99-4820-94bb-6f589740d7e8",t._sentryDebugIdIdentifier="sentry-dbid-68686461-6e99-4820-94bb-6f589740d7e8")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{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(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=F(),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=>q(e)),I=l(e=>V(e)),m=M(),w=P().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(W(I.tenantsInOrder),o.zeniSessionId),Z(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then(()=>{const e=N();e!=null&&K(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(J,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-Bi6jUyhM.js";import{a as n}from"./sentry-DwScFzsh.js";import{u,g as m,h as p,N as g}from"./core-BQch-SEa.js";import{z as f,B as y,t as b,d,f as h}from"./index-C6_U0a3I.js";import{fT as x,fU as I,Km as j}from"./zeni-epic-state-DxVQhBoO.js";import{n as w}from"./mui-D4v6d6vq.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.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]="942bcaf7-6052-4bd0-9a01-95967fcd39f6",e._sentryDebugIdIdentifier="sentry-dbid-942bcaf7-6052-4bd0-9a01-95967fcd39f6")}catch{}})();function $(){const e=u(),t=m(),i=p(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),j(),b.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=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};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as p}from"./liveblocks-Bi6jUyhM.js";import{a as D}from"./sentry-DwScFzsh.js";import{h as U,u as z,g as K,j as b,i as _,n as H}from"./core-BQch-SEa.js";import{z as L,a as q,G as d,$ as O,s as W,d as M,f as Q,cT as V,q as g,p as Z}from"./index-C6_U0a3I.js";import{eS as X,Rp as F,H5 as y,Rq as x,Rl as Y,Gt as E,Rr as J,GB as S,FX as aa,H6 as I,Rs as R,gW as ea,GY as ta,H1 as sa,GQ as oa,GO as B,H2 as na,GL as ia,Rt as la,Ru as ra,Rv as ca,Rw as ka,Rx as m,ee as ua,Ry as pa,Rz as da}from"./zeni-epic-state-DxVQhBoO.js";import{n as ma}from"./mui-D4v6d6vq.js";import{u as Ta}from"./useAskAiCfoHostNavButtonProps-0ztMF6vl.js";import{M as ga}from"./MobileAppDrawer-9x3MntXc.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.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]="74f5ee0c-e749-4869-81c9-4569e89383b4",e._sentryDebugIdIdentifier="sentry-dbid-74f5ee0c-e749-4869-81c9-4569e89383b4")}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
|
+
`,Ga=H(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=Z(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=ha(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:{...J,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`)}}})(V);function Na(){const e=U(),t=z(),o=K(),c=L.getSignedInUser(),n=b(r=>X(r)),{taskGroupId:u}=_(),{useFeatureGate:i}=q(),{isFeatureEnabled:l}=i(d.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(d.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(d.isTaskCategorizationEnabled),{isFeatureEnabled:k}=i(d.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(d.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(d.isTaskRecurringParentEnabled),[P,$]=D.useState(!1),G=b(r=>F(r,l)),h=b(r=>r.taskGroupState),T=G.fetchState,{isAiCfoAccessEnabled:j,onAskAiCfoClick:N}=Ta({mobileExploreReferrer:"Task Checklist"});if(O({isDataReady:T==="Completed"}),D.useEffect(()=>{t(y(!1,l))},[n?.tenantId,t,l]),D.useEffect(()=>{T==="Completed"&&t(x({taskGroupById:h.taskGroupById}))},[T,h.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return p.jsxs(p.Fragment,{children:[T==="Completed"?p.jsx(W,{analytics:M,onLoad:r=>(v=>v.trackPageLoaded(Q.Event.taskListPage))(r)}):null,p.jsxs(fa,{children:[p.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{$(r)}}),p.jsx(Ga,{location:o,navigate:e,currentTenant:n,taskGroupId:u,taskGroupState:h,localData:G.localData,uiState:G.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}`,ha=(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=pa(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=da(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Na as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-Bi6jUyhM.js";import se from"./NotFoundScreen-_z9DP-yZ.js";import{a as c}from"./sentry-DwScFzsh.js";import{h as M,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as ce,p as g}from"./core-BQch-SEa.js";import{G8 as Z,Gb as le,G5 as de,eS as K,Rl as X,Gp as H,G2 as pe,GV as ue,GO as ke,Rm as Q,Rn as A,F_ as me,FX as ge,qM as fe,qA as he,kh as Se,Gj as Ge,Ro as Ie,GA as Te,Gx as be,Ge as Ee,Gu as Ce,Gt as De}from"./zeni-epic-state-DxVQhBoO.js";import{z as C,cR as xe,K as je,a as Re,G as T,p as W,q as w,s as ye,d as N,f as we,cS as ve,j as V,at as Fe}from"./index-C6_U0a3I.js";import{n as Be}from"./mui-D4v6d6vq.js";import{u as Pe}from"./useInitialThreadRequest-B5cDCn22.js";import{M as Ue}from"./MobileAppDrawer-9x3MntXc.js";import Le from"./TaskListScreen-4INm3wUC.js";import"./recharts-6oV2OwTy.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.js";import"./useAskAiCfoHostNavButtonProps-0ztMF6vl.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]="9862931e-9372-499d-a209-1e27cb52e2b6",e._sentryDebugIdIdentifier="sentry-dbid-9862931e-9372-499d-a209-1e27cb52e2b6")}catch{}})();function $e(){const e=M(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(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 z,_=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=K(e),l=r.taskGroupId??u,k=l!=null?A(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=X(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)!==z&&(z=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=>A(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=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(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(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=M(),t=O(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=f(i=>K(i)),k=Pe(l?.companyId),{useFeatureGate:a}=Re(),{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,Y]=c.useState(!1),[F,J]=c.useState(!1),[B,ee]=c.useState(!1),[P,j]=c.useState(!1),I=c.useRef(!1),E=f(i=>i.taskListState.updateTasksFetchState.fetchState),U=f(i=>X(i)),L=f(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(H(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(J(!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})),j(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(I.current){if(E==="Error")return j(!1),void(I.current=!1);if(E==="Completed"){j(!1),I.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else I.current=!0},[P,E,l,s,e]);const $=f(i=>Q(i,r)),R=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(R==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[R==="Completed"?n.jsx(ye,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ae,{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:R,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:b})]})]})}const Ae=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
|
+
`,v=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(g,{path:"/new",element:n.jsx(y,{})}),n.jsx(g,{path:"/new/:taskGroupId",element:n.jsx(y,{})}),n.jsx(g,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(g,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(g,{path:"/:taskId",element:n.jsx(y,{})}),n.jsx(g,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-Bi6jUyhM.js";import i from"./NotFoundScreen-_z9DP-yZ.js";import{T as r}from"./TransactionDetailScreen-DSbk67SD.js";import"./sentry-DwScFzsh.js";import{o as a,p as o}from"./core-BQch-SEa.js";import"./zeni-epic-state-DxVQhBoO.js";import"./recharts-6oV2OwTy.js";import"./index-C6_U0a3I.js";import"./mui-D4v6d6vq.js";import"./analytics-CGnNJ1B3.js";import"./plaid-DWupRB-M.js";import"./dnd-DtFKtvlf.js";import"./stripe-DMRn4zHo.js";import"./lottie-CB8QpQmy.js";import"./lexical-BBRytn_R.js";import"./pdf-BNQvW5mJ.js";import"./utils-Dwr2wQrV.js";import"./useAskAiCfoHostNavButtonProps-0ztMF6vl.js";import"./decodeURIComponentSafe-BlZKyc9K.js";import"./routePaths-CGRC3p-8.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};
|
package/dist/assets/{TransactionDetailScreen-DB5lxQrk.js → TransactionDetailScreen-DSbk67SD.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as P}from"./liveblocks-Bi6jUyhM.js";import{a as i}from"./sentry-DwScFzsh.js";import{u as H,k as Je,j as S,t as fe,g as ge,h as Te,i as be,N as Qe,n as Ze}from"./core-BQch-SEa.js";import{mV as he,eS as Q,fP as Ke,Md as et,m6 as tt,m0 as at,bn as nt,cP as Ee,bs as Ie,qk as q,Lc as W,Me as ve,Mf as oe,LC as De,jU as Ce,Mg as ke,LH as se,LI as ce,kJ as Ae,Ic as ie,L6 as $,jO as Ue,jM as xe,jY as ot,mI as st,Mh as ct,Mi as it,ur as J,jT as Pe,Hx as we,cU as rt,cV as lt,Mj as dt,L5 as ut,Mk as mt,un as pt,Ml as ft,Mm as ht,Mn as yt,Mo as St,Mp as gt,jX as Tt,Mq as bt,Mr as Et,L7 as It,Ms as vt,Mt as Dt,Mu as Ct,Hr as kt,Hh as At,HG as Ut,jZ as xt,Id as ye,mN as Pt}from"./zeni-epic-state-DxVQhBoO.js";import{a as Y,G as w,z as _e,aN as Le,m as wt,X as _t,aO as Lt,w as Ft,p as ae,I as Vt,aP as Ot,q as ne,$ as Bt,aQ as Rt,d as Fe,aR as zt,at as Nt,a3 as te}from"./index-C6_U0a3I.js";import{n as Mt,S as jt,D as Gt}from"./mui-D4v6d6vq.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-0ztMF6vl.js";import{d as Ve}from"./decodeURIComponentSafe-BlZKyc9K.js";import{h as Oe,c as Be,g as Ht,e as qt}from"./routePaths-CGRC3p-8.js";import{t as Wt}from"./utils-Dwr2wQrV.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="bf9d082e-454b-453c-ae79-edf65849620a",t._sentryDebugIdIdentifier="sentry-dbid-bf9d082e-454b-453c-ae79-edf65849620a")}catch{}})();function Yt(t=!0){const e=H(),s=Je(),{useFeatureGate:a}=Y(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Xt(t,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=>Q(h)),b=k.companyId,x=S(h=>Ke(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=>et(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),Z=B.current??{},X=L.current;for(const z of u)if(G.has(z.accountId)&&Z[z.accountId]==null&&X?.[z.accountId]==null)return y(z.classificationType),U(z.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),U(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(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}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=H(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=S(u=>Q(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}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Le.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,U=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,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)},[t,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 Jt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=H(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(xe()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Ue({vendorId:void 0,localData:y}))}};return P.jsx(Gt,{anchor:"right",open:t,PaperProps:{style:{width:Jt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:P.jsx(Zt,{onClick:y=>y.stopPropagation(),children:P.jsx(Lt,{...A})})})},Zt=Mt(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function Zt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=q(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Be(g,A)&&(y={id:g,type:W(A)});const m=y!=null?S(T=>H(T,y)):void 0,O=()=>{const T=ae(a.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(xe(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(Y({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Xe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,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(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ne(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(Y({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({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:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Zt(t,a):void 0}})(Lt);function ya(){const t=Te(),e=q(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),c=S(d=>Q(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}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),U=Be(C,b),_=S(d=>d.transactionVendorViewState),B=re(),{isFeatureEnabled:z}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:N}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:W(b)}},[U,C,b]),l=I!=null?S(d=>H(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,$=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[X,K]=i.useState(!1),[L,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback(d=>Ne(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{K(!1),le(!1)},me=Bt();Jt();const Z=i.useRef(l?.transaction);Z.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Kt($e,()=>{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(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{ze||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)&&(X?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),K(!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(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ke}=Mt({mobileExploreReferrer:"Transaction Details"});return Nt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Qt,{isOpen:v,transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ke,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:N,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&x.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Qe,{to:Le(Me.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.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=a;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}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,Jt as a,Kt as b,ta as c,aa as d,ea as e,re as f,Zt as g,ha as u};
|
|
5
|
+
`;function Kt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=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=ae(a.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(Pe(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(J({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}U()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(xe()),o(it()),t(!0),U()}}},aa=Ze(function(t,e){const s=W(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${Nt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,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(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t($("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??ze(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(Pt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Be(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?Pe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xt({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t($("common"))},onUploadAttachmentAttachment:a=>{t(Ut(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Wt(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Ht(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t($("common"))},onCancelAutoComplete:()=>{t($("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(J({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(J({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(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:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(J({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Kt(t,a):void 0}})(zt);function ya(){const t=Te(),e=H(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=Vt(),c=S(d=>Q(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}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.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}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:M}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=a(w.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")),[Z,X]=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)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Me,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{X(!1),le(!1)},me=Ot();Yt();const K=i.useRef(l?.transaction);K.current=l?.transaction;const Ge=l?.transactionDetailUpdateStatus?.fetchState,V=Xt(Ge,()=>{const d=[];if(K.current!=null)for(const ee of K.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(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,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)&&(Z?z||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),X(!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}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Ye,onAskAiCfoClick:Xe}=$t({mobileExploreReferrer:"Transaction Details"});return Bt({isDataReady:l?.fetchState==="Completed"}),x?P.jsxs(P.Fragment,{children:[pe!=null&&v&&P.jsx(Qt,{isOpen:v,transactionId:pe,onSaveVendor:He,onSaveSuccess:qe,onCancel:We}),P.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,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:Xe,isTransactionCommentingEnabled:N,isProjectsTransactionsEnabled:B,companyId:L,companyName:R}),V.showPopup&&V.popupType!=null&&P.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):P.jsx(Qe,{to:ze($e.length)})}const ze=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.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=a;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}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,Yt as a,Xt as b,ta as c,aa as d,ea as e,re as f,Kt as g,ha as u};
|