@zeniai/web-app-ui 5.1.47-prod → 5.1.48-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.
Files changed (153) hide show
  1. package/dist/assets/AddressRoutes-Cfx49so1.js +1 -0
  2. package/dist/assets/AddressScreen-BdkkfpOD.js +9 -0
  3. package/dist/assets/AiCfoScreen-CJ2jNf-v.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-C9K9cwdL.js +1 -0
  5. package/dist/assets/BillPayRoutes-DI9tqZg4.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-BvxrLE03.js +9 -0
  7. package/dist/assets/CardsAiCfoScreen-7dPiCcoy.js +14 -0
  8. package/dist/assets/ChargeCardRoutes-BIha80p-.js +71 -0
  9. package/dist/assets/{CompanyPassportScreen-BHBRpTNd.js → CompanyPassportScreen-CuQ-1lmT.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-CZ8o3YZi.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-BnNax-8a.js +1 -0
  12. package/dist/assets/CustomerOnboardingRoutes-BgHk9KVG.js +23 -0
  13. package/dist/assets/{DashboardRoutes-lDbgT5_d.js → DashboardRoutes-BRz85PCY.js} +4 -4
  14. package/dist/assets/DefaultTenantHome-BcFCHmoG.js +1 -0
  15. package/dist/assets/{DomesticWireDetailScreen-Dn7p8SPr.js → DomesticWireDetailScreen-BgEqXJEl.js} +3 -3
  16. package/dist/assets/DrawerScreen-_1RQlY4y.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-C7uFwXUz.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-C-CBTBm8.js +25 -0
  19. package/dist/assets/FeaturePreviewScreen-CeZNu_Vi.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-C0pKe0vy.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-7XFxi-_N.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-CGIo0N71.js +12 -0
  23. package/dist/assets/MobileAppDrawer-D6Fu3M_x.js +1 -0
  24. package/dist/assets/NotFoundScreen-_JeeXwwE.js +1 -0
  25. package/dist/assets/NotificationRoutes-DN56rmti.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-DCckgFNN.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-DQXcPbfr.js +1 -0
  28. package/dist/assets/PeopleRoutes-CVdNkMW2.js +22 -0
  29. package/dist/assets/PerformanceRoutes-BFxcHJn-.js +1 -0
  30. package/dist/assets/{Preview-BHEObHoJ.js → Preview-BohCuc6u.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-BAPCbPKb.js → QBOConnectionScreen-CL_uJ9x0.js} +1 -1
  32. package/dist/assets/ReferralListScreen-Cb-o7kTE.js +5 -0
  33. package/dist/assets/ReimbursementApprovalRoutes-BV3UuxT_.js +1 -0
  34. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DGivgXWQ.js +1 -0
  35. package/dist/assets/{ReimbursementRoutes-Cmimfbf4.js → ReimbursementRoutes-CqFV9Upl.js} +12 -12
  36. package/dist/assets/ReportsRoutes-iiURxm9r.js +1 -0
  37. package/dist/assets/RewardsRoutes-6b8h1meH.js +1 -0
  38. package/dist/assets/ScreenRoutes-BVYp-4m8.js +2 -0
  39. package/dist/assets/SettingsRoutes-DOfAWDHL.js +57 -0
  40. package/dist/assets/SetupPagesScreen-Djxd17id.js +29 -0
  41. package/dist/assets/SignInScreen-D7gytnqh.js +1 -0
  42. package/dist/assets/SignOutScreen-C-j9YPM-.js +9 -0
  43. package/dist/assets/TaskListScreen-Dreq2LHj.js +9 -0
  44. package/dist/assets/TaskRoutes-Dy3OoIyM.js +9 -0
  45. package/dist/assets/TransactionDetailRoutes-Bs9ghT0l.js +1 -0
  46. package/dist/assets/{TransactionDetailScreen-CozykG2Q.js → TransactionDetailScreen-s_jEo2WG.js} +2 -2
  47. package/dist/assets/TransactionListRoutes-BgdTO4HR.js +1 -0
  48. package/dist/assets/TreasuryRoutes-8u7u_9F8.js +37 -0
  49. package/dist/assets/{VendorsRoutes-BYYZm0_J.js → VendorsRoutes-CYZmnwrv.js} +27 -27
  50. package/dist/assets/WiseConfirmationScreen-BiPmlGq6.js +12 -0
  51. package/dist/assets/ZeniAccountRoutes-DO2fE8r2.js +73 -0
  52. package/dist/assets/ZeniAccountStatementScreen-Cb_rEVWr.js +9 -0
  53. package/dist/assets/{accountMappingHelper-D9IbN5NL.js → accountMappingHelper-DwVJRdRo.js} +1 -1
  54. package/dist/assets/{analytics-8yCBzFii.js → analytics-BUvTITrb.js} +1 -1
  55. package/dist/assets/{analyticsHelper-BUrYWaH0.js → analyticsHelper-DaDCazpC.js} +1 -1
  56. package/dist/assets/{core-DaoZ0mzV.js → core-wjM80qIn.js} +2 -2
  57. package/dist/assets/{decodeURIComponentSafe-CT-RXMn2.js → decodeURIComponentSafe-4aj60Fs2.js} +1 -1
  58. package/dist/assets/dnd-BK3JI-SF.js +6 -0
  59. package/dist/assets/{empty-B9cRtYeB.js → empty-CUF5cU17.js} +1 -1
  60. package/dist/assets/{index-CXhmQqwt.js → empty-D8a3KaBg.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-DxIfP66t.js → emptyVideoElement-DDXARDvi.js} +1 -1
  62. package/dist/assets/epic-sEosDzE-.js +2 -0
  63. package/dist/assets/getLocaleForTenant-yX1iEbj2.js +1 -0
  64. package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
  65. package/dist/assets/{index-CsDLZEHL.js → index-BVZpKi1S.js} +2 -2
  66. package/dist/assets/index-CWHzFtd9.js +1 -0
  67. package/dist/assets/{index-BuRHobSz.js → index-D3VvkPFN.js} +1 -1
  68. package/dist/assets/{index-SN8JkE3y.js → index-D8Ajpofo.js} +1 -1
  69. package/dist/assets/{index-BkJ9YS4P.js → index-DApnMePi.js} +1 -1
  70. package/dist/assets/{index-xSp8Aw5x.js → index-Det3Ki3b.js} +30766 -26745
  71. package/dist/assets/{index-3voO_WTs.js → index-DuIPJrPJ.js} +1 -1
  72. package/dist/assets/index-DypTJFR1.js +1 -0
  73. package/dist/assets/{lexical-BR5Axn3q.js → lexical-DcicQSkI.js} +1 -1
  74. package/dist/assets/{liveblocks-ROiwr0XR.js → liveblocks-GsPfxkQ7.js} +1 -1
  75. package/dist/assets/{lottie-Cxd9fXM7.js → lottie-C5rIATv6.js} +1 -1
  76. package/dist/assets/{mui-jKmSXrkP.js → mui-BSDa87ap.js} +1 -1
  77. package/dist/assets/{pathToGoBack-CWIwxqQ9.js → pathToGoBack-CAzQiLsh.js} +1 -1
  78. package/dist/assets/{pdf-Cqgowyhq.js → pdf-BLNuomMl.js} +4 -4
  79. package/dist/assets/{pdf-lib-VsNbkX93.js → pdf-lib-BR9HrRu8.js} +1 -1
  80. package/dist/assets/{plaid-CsY42MZh.js → plaid-50YvjniW.js} +1 -1
  81. package/dist/assets/{pusher-BqDP33er.js → pusher-DyWQA0RT.js} +1 -1
  82. package/dist/assets/{react-C4jq5zCX.js → react-BKGEXYtN.js} +1 -1
  83. package/dist/assets/{react-DkXNbjDp.js → react-Ci53z-6c.js} +1 -1
  84. package/dist/assets/{react-Dmip9fE7.js → react-CrU6fZvx.js} +1 -1
  85. package/dist/assets/{react-DqFs0eyv.js → react-Dj2j64JD.js} +1 -1
  86. package/dist/assets/{react-DWjM1EOh.js → react-DmfWUkEA.js} +1 -1
  87. package/dist/assets/{react-BCRZjlIY.js → react-uWUXgbgu.js} +1 -1
  88. package/dist/assets/{recharts-vW3zMy9G.js → recharts-D4VpFd5q.js} +3 -3
  89. package/dist/assets/{routePaths-BjdFjRu7.js → routePaths-CbGdb8gZ.js} +1 -1
  90. package/dist/assets/{sentry-Op00XcfN.js → sentry-B2TzMFx9.js} +1 -1
  91. package/dist/assets/{url-CLX-K3dV.js → url-CcjxrMLZ.js} +1 -1
  92. package/dist/assets/{url-CiX2hJ1z.js → url-D1xNpCnF.js} +1 -1
  93. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DGPqOxot.js → useAiCfoDashboardSuggestedQuestionsChips-D8RjKLM8.js} +1 -1
  94. package/dist/assets/useAskAiCfoHostNavButtonProps-BXGcqvyl.js +1 -0
  95. package/dist/assets/useCashManagementBanner-CdVrtcFk.js +1 -0
  96. package/dist/assets/{useDeviceId-CYBc1TbS.js → useDeviceId-t80vtq4B.js} +1 -1
  97. package/dist/assets/useInitialThreadRequest-D9NRPlO5.js +1 -0
  98. package/dist/assets/{utils-CVP2GEpN.js → utils-BwzhiOdE.js} +2 -2
  99. package/dist/assets/{withTransactionSidePanel-BZUNl79-.js → withTransactionSidePanel-D8vEjelm.js} +4 -4
  100. package/dist/assets/zeni-epic-state-DrcliB1J.js +13 -0
  101. package/dist/index.html +1 -1
  102. package/package.json +4 -4
  103. package/dist/assets/AddressRoutes-CAggasJu.js +0 -1
  104. package/dist/assets/AddressScreen-JkoZB79T.js +0 -9
  105. package/dist/assets/AiCfoScreen-CSGNHbJi.js +0 -22
  106. package/dist/assets/BillPayApprovalRoutes-Dckd7sQy.js +0 -1
  107. package/dist/assets/BillPayRoutes-CFr0X6Ji.js +0 -119
  108. package/dist/assets/BusinessVerificationPageScreen-BuoAkAk1.js +0 -9
  109. package/dist/assets/ChargeCardRoutes-WJfGDu6n.js +0 -71
  110. package/dist/assets/ConnectionAuthScreen-GWmjFhHq.js +0 -11
  111. package/dist/assets/CustomerOnboardingAuthScreen-B1yQ8OBF.js +0 -1
  112. package/dist/assets/CustomerOnboardingRoutes-CribKIVS.js +0 -23
  113. package/dist/assets/DefaultTenantHome-lTd76tGV.js +0 -1
  114. package/dist/assets/DrawerScreen-DZo7wlG2.js +0 -1
  115. package/dist/assets/EntityDetailRoutes-CnqnVRxl.js +0 -1
  116. package/dist/assets/ExpenseAutomationRoutes-CJ-obKPF.js +0 -25
  117. package/dist/assets/FeaturePreviewScreen-CSWuoEjB.js +0 -1
  118. package/dist/assets/HubSpotOAuthCallbackScreen-CAf9KzQf.js +0 -1
  119. package/dist/assets/MagicLinkRoutes-GFTLiZOL.js +0 -72
  120. package/dist/assets/MagicLinkSignInScreen--mo8ssnF.js +0 -12
  121. package/dist/assets/MobileAppDrawer-dBCfsF1C.js +0 -1
  122. package/dist/assets/NotFoundScreen-DDkj43NB.js +0 -1
  123. package/dist/assets/NotificationRoutes-CyJZyj2-.js +0 -1
  124. package/dist/assets/OAuthConsentScreen-BuKGF_fl.js +0 -1
  125. package/dist/assets/PandLWithForecastRoutes-BZP93fZa.js +0 -1
  126. package/dist/assets/PeopleRoutes-BtkHhRpi.js +0 -22
  127. package/dist/assets/PerformanceRoutes-kXzSq5NP.js +0 -1
  128. package/dist/assets/ReferralListScreen-DFt7FGC2.js +0 -5
  129. package/dist/assets/ReimbursementApprovalRoutes-B7CWf6-a.js +0 -1
  130. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DNjpo5Dl.js +0 -1
  131. package/dist/assets/ReportsRoutes-DX49Q0Ws.js +0 -1
  132. package/dist/assets/RewardsRoutes-Bwg23mER.js +0 -1
  133. package/dist/assets/ScreenRoutes-Btlokf6G.js +0 -2
  134. package/dist/assets/SettingsRoutes-BSmm45fX.js +0 -57
  135. package/dist/assets/SetupPagesScreen-DrWpVdg2.js +0 -29
  136. package/dist/assets/SignInScreen-De2S808h.js +0 -1
  137. package/dist/assets/SignOutScreen-DdPy9wTu.js +0 -9
  138. package/dist/assets/TaskListScreen-1JBylGjm.js +0 -9
  139. package/dist/assets/TaskRoutes-r8FYF8j2.js +0 -9
  140. package/dist/assets/TransactionDetailRoutes-Cs_kQRui.js +0 -1
  141. package/dist/assets/TransactionListRoutes-KbrDX2Dq.js +0 -1
  142. package/dist/assets/TreasuryRoutes-BgzMyXQv.js +0 -37
  143. package/dist/assets/WiseConfirmationScreen-cVo28rWb.js +0 -12
  144. package/dist/assets/ZeniAccountRoutes-DB2YApyR.js +0 -57
  145. package/dist/assets/ZeniAccountStatementScreen-CXiFWvbO.js +0 -9
  146. package/dist/assets/dnd-DX6CLvc-.js +0 -6
  147. package/dist/assets/empty-CG8jL9zt.js +0 -1
  148. package/dist/assets/epic-BhesE3KK.js +0 -2
  149. package/dist/assets/getLocaleForTenant-thNouA6-.js +0 -1
  150. package/dist/assets/index-q0tBcaxR.js +0 -1
  151. package/dist/assets/useAskAiCfoHostNavButtonProps-DqUqid3a.js +0 -1
  152. package/dist/assets/useInitialThreadRequest-BoUnzsNE.js +0 -1
  153. package/dist/assets/zeni-epic-state-BE7Zc7jP.js +0 -13
@@ -0,0 +1 @@
1
+ import{j as p}from"./liveblocks-GsPfxkQ7.js";import{g as H,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-wjM80qIn.js";import{eW as v,fs as I,M0 as Te,ks as K,qN as Q,rC as k,kg as Re,jk as Me,uZ as X,rH as Oe,bt as ke,M1 as Ae,bn as Fe,w6 as De,M2 as je,M3 as Ee,uR as Pe,M4 as Y,M5 as ve,M6 as Le,M7 as Be,M8 as Ve,M9 as w,Ma as A,Mb as F,Mc as N,Md as D,Me as j,dJ as Ue,vO as xe,vC as $,vD as q,vU as ze,vH as Z,v_ as He,Mf as Ge,Mg as Ye,Mh as Ne,Mi as $e,Mj as qe,fd as Ze,fb as We}from"./zeni-epic-state-DrcliB1J.js";import{T as Je,V as Ke,W as Qe,X as Xe,K as ea,N as ee,f as E,z as ae,Y as aa,j as sa,a as ta,Z as oa,_ as na,s as ra,c as P,e as ia,$ as la,n as se,a0 as ca,a1 as da,a2 as pa}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import fa from"./NotFoundScreen-_JeeXwwE.js";import{F as ma}from"./FeaturePreviewScreen-CeZNu_Vi.js";import{a as _}from"./sentry-B2TzMFx9.js";import{u as ua}from"./useInitialThreadRequest-D9NRPlO5.js";import{t as W,a as J,b as _a}from"./routePaths-CbGdb8gZ.js";import{M as ha}from"./MobileAppDrawer-D6Fu3M_x.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.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]="70de546c-e4c3-4065-a63b-40b55a14e5dd",e._sentryDebugIdIdentifier="sentry-dbid-70de546c-e4c3-4065-a63b-40b55a14e5dd")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=Ae(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:Q(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(He(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return W(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?W(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({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(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=H(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(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),V=d(n=>K(n)),M=d(n=>Q(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(k(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(X());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&ke(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=H(),z=Je(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Qe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=We(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-GsPfxkQ7.js";import{N as x,z as w,aN as y,s as I,c as p,e as F,d5 as P,f as T}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import m from"./NotFoundScreen-_JeeXwwE.js";import{a as u}from"./sentry-B2TzMFx9.js";import{u as L,j as b,h as V,g as A,n as R,o as U,p as f}from"./core-wjM80qIn.js";import{eW as z,Ta as C,Pp as Y,Tb as v,vt as G,fj as O,Tc as W,vr as q}from"./zeni-epic-state-DrcliB1J.js";import{R as j}from"./ReferralListScreen-Cb-o7kTE.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import"./MobileAppDrawer-D6Fu3M_x.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]="aa78870c-973b-463c-9f99-5223be648179",a._sentryDebugIdIdentifier="sentry-dbid-aa78870c-973b-463c-9f99-5223be648179")}catch{}})();const B=R(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,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=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(W({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),H=()=>{const a=L(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=x(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),N=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),D=Y(k);u.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(G()),s(!0))},[]),u.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(O(!0)))},[l.fetchState,a]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(B,{navigate:c,location:_,currentTenant:r,companyName:S,userName:N,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function fa(){const{useFeatureGate:a}=x(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(f,{path:"/",element:t?e.jsx(j,{}):e.jsx(m,{})}),e.jsx(f,{path:"how-it-works",element:t?e.jsx(j,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(f,{path:"refer/*",element:t?e.jsx(H,{}):e.jsx(m,{})}),e.jsx(f,{path:"*",element:e.jsx(m,{})})]})}export{fa as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BRz85PCY.js","assets/sentry-B2TzMFx9.js","assets/core-wjM80qIn.js","assets/zeni-epic-state-DrcliB1J.js","assets/index-Det3Ki3b.js","assets/mui-BSDa87ap.js","assets/analytics-BUvTITrb.js","assets/utils-BwzhiOdE.js","assets/withTransactionSidePanel-D8vEjelm.js","assets/useAskAiCfoHostNavButtonProps-BXGcqvyl.js","assets/TransactionDetailScreen-s_jEo2WG.js","assets/decodeURIComponentSafe-4aj60Fs2.js","assets/routePaths-CbGdb8gZ.js","assets/NotFoundScreen-_JeeXwwE.js","assets/useInitialThreadRequest-D9NRPlO5.js","assets/analyticsHelper-DaDCazpC.js","assets/CompanyPassportScreen-CuQ-1lmT.js","assets/MobileAppDrawer-D6Fu3M_x.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D8RjKLM8.js","assets/FeaturePreviewScreen-CeZNu_Vi.js","assets/ReferralListScreen-Cb-o7kTE.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-DI9tqZg4.js","assets/AddressScreen-BdkkfpOD.js","assets/DomesticWireDetailScreen-BgEqXJEl.js","assets/DrawerScreen-_1RQlY4y.js","assets/SetupPagesScreen-Djxd17id.js","assets/BusinessVerificationPageScreen-BvxrLE03.js","assets/BillPayApprovalRoutes-C9K9cwdL.js","assets/ReimbursementApprovalRuleDetailScreen-DGivgXWQ.js","assets/getLocaleForTenant-yX1iEbj2.js","assets/ReimbursementRoutes-CqFV9Upl.js","assets/ReimbursementApprovalRoutes-BV3UuxT_.js","assets/TransactionListRoutes-BgdTO4HR.js","assets/ZeniAccountStatementScreen-Cb_rEVWr.js","assets/SettingsRoutes-DOfAWDHL.js","assets/accountMappingHelper-DwVJRdRo.js","assets/QBOConnectionScreen-CL_uJ9x0.js","assets/empty-CUF5cU17.js","assets/index-D3VvkPFN.js","assets/url-CcjxrMLZ.js","assets/index-DypTJFR1.js","assets/ReportsRoutes-iiURxm9r.js","assets/ChargeCardRoutes-BIha80p-.js","assets/PeopleRoutes-CVdNkMW2.js","assets/ExpenseAutomationRoutes-C-CBTBm8.js","assets/TreasuryRoutes-8u7u_9F8.js","assets/useCashManagementBanner-CdVrtcFk.js","assets/VendorsRoutes-CYZmnwrv.js","assets/pathToGoBack-CAzQiLsh.js","assets/ZeniAccountRoutes-DO2fE8r2.js","assets/AddressRoutes-Cfx49so1.js","assets/PandLWithForecastRoutes-DQXcPbfr.js","assets/CustomerOnboardingRoutes-BgHk9KVG.js","assets/TransactionDetailRoutes-Bs9ghT0l.js","assets/EntityDetailRoutes-C7uFwXUz.js","assets/NotificationRoutes-DN56rmti.js","assets/PerformanceRoutes-BFxcHJn-.js","assets/RewardsRoutes-6b8h1meH.js","assets/TaskRoutes-Dy3OoIyM.js","assets/TaskListScreen-Dreq2LHj.js","assets/AiCfoScreen-CJ2jNf-v.js","assets/CardsAiCfoScreen-7dPiCcoy.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bn as ls,eW as cs,fd as ds,fb as ms,fc as us,gi as _s,f1 as Es,cU as Ae,cB as ps,ft as As,ct as xs,bE as gs,bq as Is,fy as Ts,v as js,Ly as hs,bt as Us,Lz as bs,bK as Hs,fv as Rs,bJ as Ds,bs as ys,cp as fs,LA as Cs,LB as vs,cR as Os,cT as Ps,cS as Fs,cA as Ls,cH as Bs,o5 as xe,f9 as ge,gs as ks,fC as Ie,gp as Te,gq as je,fD as Vs}from"./zeni-epic-state-DrcliB1J.js";import{j as e}from"./liveblocks-GsPfxkQ7.js";import{a as v}from"./sentry-B2TzMFx9.js";import{u as Ss,h as Ns,i as Ms,g as Zs,j as G,l as he,N as c,o as ws,p as t}from"./core-wjM80qIn.js";import{m as zs,u as Gs,z as H,N as $s,a as qs,H as Ws,f as L,j as Ys,L as B,D as Ue,t as _,P as Js,c as se,l}from"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import{f as be}from"./analyticsHelper-DaDCazpC.js";import{t as Ks}from"./getLocaleForTenant-yX1iEbj2.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="0ad15423-64e3-4b84-8a25-9e7be7dea71a",i._sentryDebugIdIdentifier="sentry-dbid-0ad15423-64e3-4b84-8a25-9e7be7dea71a")}catch{}})();const Qs={dashboard:()=>a(()=>import("./DashboardRoutes-BRz85PCY.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:()=>a(()=>import("./BillPayRoutes-DI9tqZg4.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:()=>a(()=>import("./ReimbursementRoutes-CqFV9Upl.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:()=>a(()=>import("./TransactionListRoutes-BgdTO4HR.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-DOfAWDHL.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:()=>a(()=>import("./ReportsRoutes-iiURxm9r.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BIha80p-.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21])),people:()=>a(()=>import("./PeopleRoutes-CVdNkMW2.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-C-CBTBm8.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-8u7u_9F8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-CYZmnwrv.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-DO2fE8r2.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},ea=l(()=>a(()=>import("./ReportsRoutes-iiURxm9r.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),sa=l(()=>a(()=>import("./AddressRoutes-Cfx49so1.js"),__vite__mapDeps([51,1,2,3,23,4,5,6,7,13,21]))),aa=l(()=>a(()=>import("./PeopleRoutes-CVdNkMW2.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),na=l(()=>a(()=>import("./PandLWithForecastRoutes-DQXcPbfr.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),ta=l(()=>a(()=>import("./CustomerOnboardingRoutes-BgHk9KVG.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),ia=l(()=>a(()=>import("./VendorsRoutes-CYZmnwrv.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21]))),ra=l(()=>a(()=>import("./TransactionDetailRoutes-Bs9ghT0l.js"),__vite__mapDeps([54,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-C7uFwXUz.js"),__vite__mapDeps([55,1,2,3,4,5,6,7,11,8,9,10,12,21]))),oa=l(()=>a(()=>import("./DashboardRoutes-BRz85PCY.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]))),Re=l(()=>a(()=>import("./BillPayRoutes-DI9tqZg4.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]))),la=l(()=>a(()=>import("./SettingsRoutes-DOfAWDHL.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),De=l(()=>a(()=>import("./ReimbursementRoutes-CqFV9Upl.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]))),ca=l(()=>a(()=>import("./ZeniAccountRoutes-DO2fE8r2.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))),da=l(()=>a(()=>import("./TreasuryRoutes-8u7u_9F8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21]))),ma=l(()=>a(()=>import("./TransactionListRoutes-BgdTO4HR.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ua=l(()=>a(()=>import("./ChargeCardRoutes-BIha80p-.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21]))),_a=l(()=>a(()=>import("./NotificationRoutes-DN56rmti.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,21]))),Ea=l(()=>a(()=>import("./PerformanceRoutes-BFxcHJn-.js"),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,17,21]))),pa=l(()=>a(()=>import("./ExpenseAutomationRoutes-C-CBTBm8.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),Aa=l(()=>a(()=>import("./RewardsRoutes-6b8h1meH.js"),__vite__mapDeps([58,1,2,3,4,5,6,7,13,20,9,17,21]))),xa=l(()=>a(()=>import("./TaskRoutes-Dy3OoIyM.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,14,17,60,9,21]))),ga=l(()=>a(()=>import("./AiCfoScreen-CJ2jNf-v.js"),__vite__mapDeps([61,1,2,3,4,5,6,7,18,49,21]))),ye=l(()=>a(()=>import("./CardsAiCfoScreen-7dPiCcoy.js"),__vite__mapDeps([62,1,2,3,7,4,5,6,21]))),D=l(()=>a(()=>import("./NotFoundScreen-_JeeXwwE.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ia=l(()=>a(()=>import("./TaskListScreen-Dreq2LHj.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,9,17,21])));function wa({setTenantEmailDomain:i}){const U=Ss(),V=Ns(),{tenantEmailDomain:o}=Ms(),S=zs().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),y=H.getSignedInUserTenant(o)?.tenantId,j=H.getSignedInUser(),K=ls(j),$=Zs(),[N,Ce]=v.useState(!1),r=G(n=>cs(n)),{useFeatureGate:P}=$s(),w=qs(),ve=Ws(),{isFeatureEnabled:Oe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Pe}=P(L.isExpenseAutomationEnabledV2),Fe=Pe||Oe&&K,{isFeatureEnabled:Le}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Be}=P(L.isTreasuryEnabled),{isFeatureEnabled:ke}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=P(L.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),p=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=p==="Completed"||h==="Completed"?ds(ne,r):void 0,q=p==="Completed"||h==="Completed"?ms(r):void 0,Ve=p==="Completed"||h==="Completed"?us(r):void 0,Se=ke||ne||!!Ve||!!q||!!u,{isFeatureEnabled:Ne}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=P(L.isAiCfoFileUploadEnabled),W=G(n=>_s(n));if(o!=null){const n=H.getSignedInUserTenant(o);j!=null&&n!=null&&be(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},te=Es(),E=Ys(),Me=r.company==null||E?.loggedInUserRoleMap!=null&&Ae(E.loggedInUserRole),Ze=ps(E?.loggedInUserRoleMap),ie=v.useRef(!0),re=he("/:tenantEmailDomain/onboarding/*")!==null,X=he("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),we=G(n=>z.tenantId!=null?As(n,z.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&y!=null){const n=X.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=xs(Number(b[0])),s=Number(b[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,Ue.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(Ts(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,y]),v.useEffect(()=>{N||(Ce(!0),f(B.TENANT_FETCHING)),ie.current?ie.current=!1:!js(te,z)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s){if(ge(b?.userId,b?.zeniSessionId,n.tenantId),d(ks(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&Ue.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?se.identify(n.userId,{tenant_id:n.tenantId}):se.resetUserIdentity()}(z,j,U,we))},[z,te,j,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,is=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,os=d!=null&&d.externalConnections==null;if(Y&&is){k(Ie(s));const J=H.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(m.userId,s)))}else Y&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),Y&&os&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(m.userId,s)));if(Y){se.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(Vs(m.userId,s,m.zeniSessionId))),J&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,p,r,y,j,f,U))},[y,p]),v.useEffect(()=>{H.isSignedIn()&&h==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),j!=null&&be(j,r,S,void 0,W.tenantsBaseInOrder))},[W,h,r,j]),v.useEffect(()=>{p==="In-Progress"&&f(B.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[p,h,y,N]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&p==="Completed"&&N&&(oe.current=!0,function(n=Xs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Qs[m];M!=null?M().then(()=>ae(()=>d(s+1))).catch(()=>ae(()=>d(s+1))):d(s+1)};ae(()=>d(0))},b)}())},[p,N]);const C=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:ze}=P(L.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,ce=Se&&!C,qe=bs(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,me=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,ue=me&&Hs(E?.loggedInUserRoleMap),_e=Le&&!C,Ye=r.company!=null&&Rs(r.company),Je=Be&&Ye===!0&&!C,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ce&&ys(E?.loggedInUserRoleMap),Xe=_e&&fs(E?.loggedInUserRoleMap),es=Cs(E?.loggedInUserRoleMap),ss=vs(E?.loggedInUserRoleMap),A=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),I=Ls(E?.loggedInUserRoleMap),T=Bs(E?.loggedInUserRoleMap),Ee=le&&I,pe=me&&T,as=_e&&A,ns=Je&&x,ee=ce&&g,ts=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||qe===!0||es===!0||ss===!0;return H.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||h==="Completed"?(de===!0||K&&!re)&&We===!1&&u===!1&&q===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||de!==!1||re||K?N&&r?.userRole&&u!=null&&q!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(ws,{children:e.jsxs(t,{element:e.jsx(Js,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Ta,{isDashboardAccess:F,isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:q})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(oa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(ea,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ts||F?e.jsx(aa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(na,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(ta,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||Ge||$e?e.jsx(ra,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(ma,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ia,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xa,{})}),e.jsx(t,{path:"address/*",element:Ke||ue||Xe||Qe?e.jsx(sa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:as?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:ns?e.jsx(da,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ve?e.jsx(Ea,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:Fe&&C===!1?e.jsx(pa,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_a,{})}),e.jsx(t,{path:"vendors/*",element:Me?e.jsx(ia,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Ne?e.jsx(la,{hasAdminLevelAccess:ue}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:ee?e.jsx(ua,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:ze?e.jsx(Aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(ga,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Ta=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ba,{tenantEmailDomain:O}):S?e.jsx(Ua,{tenantEmailDomain:O}):U?e.jsx(Ha,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(ja,{tenantEmailDomain:O}):e.jsx(D,{}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ba=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),fe=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wa as default};
@@ -0,0 +1,57 @@
1
+ import{j as o}from"./liveblocks-GsPfxkQ7.js";import{a as p}from"./sentry-B2TzMFx9.js";import{h as V,g as Q,u as M,j as h,s as se,n as $,i as K,o as W,p as E}from"./core-wjM80qIn.js";import{bn as Ee,eW as T,gn as Ae,mW as ve,Q0 as we,hz as ue,NC as ke,qN as Pe,ks as pe,mS as je,hB as Te,NE as De,ND as Me,Q1 as Ue,z3 as _e,En as Re,PB as Be,PK as Fe,c7 as ee,cM as ze,cN as Ve,LK as Le,Q2 as Oe,LL as Ne,xw as Qe,Q3 as $e,GO as Ke,E3 as Ge,DW as ge,DT as Ze,xA as me,DZ as he,E0 as fe,E6 as ne,t_ as te,xz as He,k4 as Y,k7 as be,Q4 as qe,l8 as Je,xP as We,Mx as Ye,My as Xe,k2 as en,Q5 as nn,k5 as tn,rf as an,Q6 as on,Q7 as sn,rj as cn,hk as ln,LT as J,hd as rn,hg as dn,LU as un,xM as pn,Q8 as gn,Q9 as mn,Ek as hn,fb as Se,fd as ye,Qa as fn,gb as bn,M1 as Sn,xL as ie,gg as ce,gf as yn,xK as Cn,ge as In,gd as xn,Qb as En,fg as Ce,Qc as An,Qd as vn,xS as wn,xJ as le,Qe as kn,fx as Pn,xG as jn,b_ as Tn,c6 as Dn,c5 as Mn,b$ as Un,c3 as _n,c2 as Rn,c1 as Bn,c4 as Fn,c0 as zn}from"./zeni-epic-state-DrcliB1J.js";import{N as ae,f as R,z as w,af as Ie,bO as Vn,c as q,e as Ln,bz as On,j as G,B as oe,bP as Nn,bQ as Qn,aq as $n,h as xe,bR as Kn,bS as Gn,bT as Zn,a9 as Hn,Y as qn,bU as Jn,n as Wn,bV as Yn}from"./index-Det3Ki3b.js";import{n as B}from"./mui-BSDa87ap.js";import{M as U}from"./MobileAppDrawer-D6Fu3M_x.js";import{a as Z,g as H,m as Xn}from"./accountMappingHelper-DwVJRdRo.js";import{t as et,A as nt}from"./AddressScreen-BdkkfpOD.js";import N from"./NotFoundScreen-_JeeXwwE.js";import{g as tt}from"./analyticsHelper-DaDCazpC.js";import{B as at}from"./BusinessVerificationPageScreen-BvxrLE03.js";import{C as ot}from"./CompanyPassportScreen-CuQ-1lmT.js";import{q as re}from"./QBOConnectionScreen-CL_uJ9x0.js";import{B as st}from"./BillPayApprovalRoutes-C9K9cwdL.js";import{R as it}from"./ReimbursementApprovalRoutes-BV3UuxT_.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./routePaths-CbGdb8gZ.js";import"./empty-CUF5cU17.js";import"./pdf-lib-BR9HrRu8.js";import"./index-D3VvkPFN.js";import"./url-CcjxrMLZ.js";import"./index-DypTJFR1.js";import"./decodeURIComponentSafe-4aj60Fs2.js";import"./ReimbursementApprovalRuleDetailScreen-DGivgXWQ.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]="b0a8e5a8-1bd4-41d8-a180-12710302e698",e._sentryDebugIdIdentifier="sentry-dbid-b0a8e5a8-1bd4-41d8-a180-12710302e698")}catch{}})();const ct=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
+ `,lt=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:pe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Pe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizationThreshold:t.capitalizationThreshold,capitalizationThresholdMaxCeiling:t.capitalizationThresholdMaxCeiling,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationThresholds:t.onSaveCapitalizationThresholds}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:C}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:k,accruedExpensesAccount:A}=d,{bankAccount:S,expenseCategory1099:x}=m,v=Z(t.accountMappingView.incomeAccountList,f.selectedOption),F=Z(t.accountMappingView.expenseAccountList,g.selectedOption),L=Z(t.accountMappingView.billPayAccountList,l.selectedOption),O=Z(t.accountMappingView.reimbursementsAccountList,C.selectedOption),z=H(t.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=H(t.accountMappingView.fixedAssetsAccountList,k.selectedOptions),D=H(t.accountMappingView.accruedExpensesAccountList,A.selectedOptions),y=H(t.accountMappingView.bankAccounts1099FilingAccountList,S.selectedOptions),P=Xn(t.accountMappingView.expenseAccounts1099FilingAccountList,x),_={selectedIncomeAccountId:v?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:L?.accountId,selectedReimbursementsAccountId:O?.accountId,selectedPrepaidExpensesAccountIds:z.map(j=>j.accountId),selectedFixedAssetsAccountIds:b.map(j=>j.accountId),selectedAccruedExpensesAccountIds:D.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:y.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:P};e(Me({data:_}))},onBackClick:()=>{Ie(r)===!1?(s("../../dashboard"),e(De())):e(ue())},onSaveClick:()=>{e(Te()),i&&q.track(Ln.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(je(t.currentTenant.companyId,n))}}})(Vn),rt=()=>{const e=V(),t=Q(),s=M(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=w.getSignedInUser(),f=Ee(m),g=h(y=>T(y)),{capitalizableAccounts:l,capitalizationThreshold:C,capitalizationThresholdMaxCeiling:I,isCapitalizationThresholdSaving:k,currencySymbol:A}=h(y=>{const P=y.tenantState.currentTenantId,_=P!=null?y.tenantState.tenantsById[P]:void 0,j=Ae(y.companyState,g.companyId);return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizationThreshold:_?.capitalizationThreshold??null,capitalizationThresholdMaxCeiling:_?.capitalizationThresholdMaxCeiling??null,isCapitalizationThresholdSaving:y.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}},se),S=p.useCallback((y,P)=>{s(ve(g.companyId,y,P))},[s,g.companyId]),x=h(y=>we(y.accountState),se),v=p.useMemo(()=>{const y={};for(const P of x)P.accountId!=null&&P.accountName!=null&&(y[P.accountId]=P.accountName);return y},[x]),[F,L]=p.useState(!1),[O,z]=p.useState(!1);p.useEffect(()=>{F===!1&&(s(ue()),L(!0))},[F]);const b=h(y=>ke(y)),D=y=>{z(y)};return o.jsxs(ct,{children:[o.jsx(U,{isAppContentDrawerOpen:O,handleDrawerToggle:D}),o.jsx(lt,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:v,capitalizationThreshold:C,capitalizationThresholdMaxCeiling:I,currencySymbol:A,isCapitalizationThresholdSaving:k,onSaveCapitalizationThresholds:S,location:t,isSettings:Ie(t),onClickMenuIcon:()=>D(!0)})]})},dt=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
+ `,ut=$(function(e,t){const s=T(e),r=Be(e),i=Fe(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:q}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Nn),pt=()=>{const e=V(),t=Q(),s=M(),{tenantEmailDomain:r}=K(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(x=>T(x)),f=h(x=>x.billPaySetupApproverViewState.fetchState),g=h(x=>x.remiSetupApproverViewState.fetchState),l=h(x=>Ue(x)),{isApprovalRulesV3Enabled:C,isLoading:I}=On(m?.tenantId),k=m.companyId??w.getSignedInUserTenant(r)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const A=G();p.useEffect(()=>{u||f!=="Not-Started"||I||(d(!0),s(_e(!0,!0,C)))},[u,f,I,C,s]),p.useEffect(()=>{a||g!=="Not-Started"||I||(c(!0),s(Re(!0,!1,!1,C)))},[a,g,I,C,s]);const S=x=>{n(x)};return A?.loggedInUserRoleMap!=null?o.jsxs(dt,{children:[o.jsx(U,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),o.jsx(ut,{navigate:e,location:t,companyId:k,currentTenant:m,roleMap:A.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},gt=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
+ `,mt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=T(e);return{bankSetupView:$e(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(fe(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(he(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(me(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?ge(n,a,c,u):Ze(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(Ge(i,a,n,c))},onRemoveConnection:n=>{e(Ke(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Qn),ht=()=>{const e=V(),t=Q(),s=M(),{tenantEmailDomain:r}=K(),i=G(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(S=>T(S)),m=h(S=>S.settingsViewState.bankConnection.fetchState),f=ze(d,i?.loggedInUserRoleMap),g=Ve(d,i?.loggedInUserRoleMap),l=Le(d,i?.loggedInUserRoleMap),C=Oe(d,i?.loggedInUserRoleMap),I=Ne(d,i?.loggedInUserRoleMap),k=d.companyId??w.getSignedInUserTenant(r)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Qe(!1)))},[c,s,m]);const A=S=>{a(S)};return f||l||g||I?o.jsxs(gt,{children:[o.jsx(U,{isAppContentDrawerOpen:n,handleDrawerToggle:A}),o.jsx(mt,{navigate:e,location:t,companyId:k,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:C,onClickMenuIcon:()=>{A(!0)}})]}):o.jsx(N,{})},ft=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
+ `,bt=$(function(e,t){const{companyId:s}=t,r=T(e),i=t.roleMap.bill_pay_admin,n=qe(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:xe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(me("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(fe(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(he(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(ge(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(be(n))},handleConfirmCardSetupIntent:n=>{e(tn(n))},updateCardPaymentModalState:n=>{e(nn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(en(n,a,c))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(Xe())},handleResetCardPaymentErrorStatuses:()=>{e(Ye())},onBillingAddressSave:n=>{e(We(n))},onAddressEditHandler:n=>{if(n!=null){const a=et(n);e(Je({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Kn),St=()=>{const e=V(),t=Q(),s=M(),{tenantEmailDomain:r}=K(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(S=>T(S)),f=h(S=>S.cardPaymentViewState),g=h(S=>S.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=$n(f.addCardPaymentSourceStatus.fetchState),C=f.addCardPaymentSourceStatus.fetchState,I=m.companyId??w.getSignedInUserTenant(r)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=G();p.useEffect(()=>{I!=null&&s(He(I,!1))},[I,s]),p.useEffect(()=>{a||(c(!0),s(Y()))},[a,s]),p.useEffect(()=>{u||(be(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&C==="Completed"&&s(Y())},[l,C]);const A=S=>{n(S)};return k?.loggedInUserRoleMap!=null?o.jsxs(ft,{children:[o.jsx(U,{isAppContentDrawerOpen:i,handleDrawerToggle:A}),o.jsx(bt,{navigate:e,location:t,companyId:I,currentTenant:m,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{A(!0)},googleAPIKey:xe.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},X="external_integrations",yt=$(function(e){const t=sn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(pn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(dn(a,d,J("revenue"),un("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(rn(a,c,J(u)))},onSaveConnectorCredentials:c=>{e(ln(a,J("payments"),c))},onNotifyMe:c=>{e(cn(X,c,i))}}})(Gn),Ct=()=>{const e=V(),t=M(),{tenantEmailDomain:s}=K(),[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>T(l)),c=a.companyId??w.getSignedInUserTenant(s)?.companyId,u=w.getSignedInUser(),d=G(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(an(X))},[t]);const f=l=>{i(l)},g=h(l=>on(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(It,{children:[o.jsx(U,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(yt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,C])=>[l,C?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},It=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
+ `,xt=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
+ `,Et=()=>{const e=M(),{tenantEmailDomain:t}=K(),[s,r]=p.useState(!1),i=h(l=>T(l)).companyId??w.getSignedInUserTenant(t)?.companyId,n=w.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>gn(l,n.userId)),c=h(l=>mn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(hn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(xt,{children:[o.jsx(U,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Zn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},At=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
+ `,de=({appContent:e})=>{const t=M(),s=V(),r=Q(),[i,n]=p.useState(!1),a=h(b=>T(b)),{tenantEmailDomain:c}=a,u=a.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(R.isTreasuryEnabled),C=h(b=>pe(b)),I=Se(a),k=ye(g,a),A=!k&&C,S=Hn(a,f,g),{areTenantIdsInSync:x}=qn();p.useEffect(()=>{x&&t(fn(u,A))},[u,t,A,x]);const v=h(b=>bn(b,A)),F=v.fetchState==="Not-Started"||v.fetchState==="In-Progress"||u==null,L=Sn(a),O=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,z=b=>{n(b)};return o.jsxs(At,{children:[o.jsx(U,{isAppContentDrawerOpen:i,handleDrawerToggle:z}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Jn,{myProfileView:v,isAccountingClassesEnabled:C,isReimbursementDisabled:O===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:S===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:L===!1,onClickMenuIcon:()=>{z(!0)},isLoading:F,isBankingOnlyTenant:k,isCardsOnlyTenant:I,onAddressClick:b=>{const D=function(P,_){let j=`/${P}/settings/my_profile`;return j=j.concat(`/new/${_}`),j}(c,b),y=Wn(r.state?.pathnameStackToGoBack,r.pathname);s(D,{state:{pathnameStackToGoBack:y}})},onGetOtp:b=>{const D={...v.myProfileLocalData,phone:b};t(ie({localData:D})),t(xn(b,"MyProfile"))},onResendOtp:b=>{t(In(b,"MyProfile"))},onCancelClick:()=>{t(Cn())},onSaveClick:()=>{t(ce("MyProfile",v.myProfileLocalData.phone,v.myProfileLocalData.otpChallenge,v.myProfileLocalData.dateOfBirth,v.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{t(yn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&w.saveZeniOtpToken(b),t(ce("MyProfile",v.myProfileLocalData.phone,v.myProfileLocalData.otpChallenge,v.myProfileLocalData.dateOfBirth,v.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(ie({localData:b}))}})]})};function vt(){const e=M(),t=h(l=>T(l)).companyId,s=h(l=>En(l)),r=h(l=>Ce(l)),i=w.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(An(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(vn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(wn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(le(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(kn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(le(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(U,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(Yn,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function ia(e){const[t,s]=p.useState(!1),r=h(l=>Ce(l)),i=h(l=>T(l)),n=G(),a=w.getSignedInUser(),c=M(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(R.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Pn(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(jn()))},[r.fetchState,t]);const f=ye(d,i),g=Se(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(W,{children:[Dn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"accounting/*",element:o.jsx(rt,{})}),Mn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"approval_rules/*",element:o.jsx(wt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Un(i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"my_bank_connections",element:o.jsx(Et,{})}),_n(i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"bank_connections",element:o.jsx(ht,{})}),Rn(i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"business_verification",element:o.jsx(at,{productType:f?"zeni_accounts":g?"charge_cards":tt(i,n?.loggedInUserRoleMap)})}),Bn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(E,{path:"company_details",element:o.jsx(ot,{})}),Fn(n?.loggedInUserRole??[],i)&&o.jsx(E,{path:"billing",element:o.jsx(St,{})}),zn(n?.loggedInUserRole??[],d,i)&&o.jsx(E,{path:"integrations",element:o.jsx(Ct,{})}),o.jsx(E,{path:"my_profile/new/:addressType",element:o.jsx(de,{appContent:o.jsx(nt,{isSubPage:!1})})}),o.jsx(E,{path:"my_profile",element:o.jsx(de,{})}),m&&o.jsx(E,{path:"notifications",element:o.jsx(vt,{})}),o.jsx(E,{path:"*",element:o.jsx(N,{})})]}):o.jsx(W,{children:o.jsx(E,{path:"*",element:o.jsx(N,{})})}):null}function wt(e){return o.jsxs(W,{children:[o.jsx(E,{path:"/",element:o.jsx(pt,{})}),o.jsx(E,{path:"bills/approval-rules/*",element:o.jsx(st,{})}),o.jsx(E,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(it,{}):o.jsx(N,{})}),o.jsx(E,{path:"*",element:o.jsx(N,{})})]})}export{ia as default};
@@ -0,0 +1,29 @@
1
+ import{j as u}from"./liveblocks-GsPfxkQ7.js";import{h as X,g as Y,u as ee,i as G,j as _,N as j,n as H,t as Ye}from"./core-wjM80qIn.js";import{bJ as en,cp as Ie,Pp as ye,eW as V,cB as nn,zk as $,z3 as tn,PB as an,PE as sn,ry as ne,rm as te,l0 as ae,tw as L,PG as Ae,gf as $e,ge as We,gd as Ge,PH as on,zt as cn,E3 as ke,DW as Pe,DT as _e,DK as J,DZ as ve,E0 as Ee,E6 as we,t_ as Te,gu as rn,cw as un,fd as dn,fb as ln,fc as pn,bs as mn,PI as yn,CK as le,Dm as fn,PJ as gn,bK as Sn,Fm as pe,En as bn,PK as hn,PL as Cn,Fq as In,Fu as An,tp as kn,JU as Pn,F$ as Ce,G$ as me,PM as _n,PN as vn,PO as En,PP as He,PQ as wn,Ml as Tn,OO as Dn,Mw as Un,PR as Ke,PS as Ve,Gl as qe,l8 as On,rp as Je,ty as Fn,bE as je,tK as Re,cz as Vn,PT as Qe,fw as Bn,FJ as xn,FN as jn,PU as Rn,G2 as Ne,PV as Nn,PW as zn,PX as Ln,PY as Mn,gn as Zn,AE as $n,PZ as Wn,AJ as Gn,AI as Hn}from"./zeni-epic-state-DrcliB1J.js";import{j as ie,N as se,f as de,m as De,aN as Q,bz as Xe,z as D,s as oe,c as U,B as Ue,e as W,bA as Kn,at as ce,bB as B,bC as qn,bD as Jn,af as xe,bE as Qn,n as ze,au as Le,K as Xn,w as Yn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-Det3Ki3b.js";import{a as C}from"./sentry-B2TzMFx9.js";import{n as Be,D as it,S as st}from"./mui-BSDa87ap.js";import{M as fe}from"./MobileAppDrawer-D6Fu3M_x.js";import z from"./NotFoundScreen-_JeeXwwE.js";import{a as Me}from"./analyticsHelper-DaDCazpC.js";import{d as Ze}from"./routePaths-CbGdb8gZ.js";import{B as Fe}from"./BusinessVerificationPageScreen-BvxrLE03.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]="f305d194-971a-4eb7-b8dc-4bf8078bcff8",e._sentryDebugIdIdentifier="sentry-dbid-f305d194-971a-4eb7-b8dc-4bf8078bcff8")}catch{}})();const ot=Be.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
+ `,ct=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=an(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=sn(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",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.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($(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(ve(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"bill_pay","bill_pay_setup"):_e("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(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e($(a,!0))},onGetOtp:(n,i)=>{e(Ge(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(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(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),rt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=G(),c=ie(),n=en(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=se(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=De(),{configValue:A}=s(Q.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),P=C.useRef(!1),[g,S]=C.useState(!1),w=_(E=>E.billPaySetupViewState.fetchState),I=_(E=>V(E)),h=_(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:T,isLoading:k}=Xe(I?.tenantId),m=I.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{P.current||w!=="Not-Started"||m==null?P.current||w!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(P.current=!0,t($(m,!1,!0))):(P.current=!0,t($(m,!0)))},[w,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,T)))},[g,h,k,T,t]);const F=E=>{b(E)};if(v===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const E=N=>N.trackPageLoaded(W.Event.billPaySetup);return u.jsxs(ot,{children:[u.jsx(oe,{analytics:U,onLoad:N=>E(N)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:F}),u.jsx(ct,{navigate:e,location:o,companyId:m,currentTenant:I,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})},zt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Lt=e=>`/${e}/cards`,Mt=e=>`/${e}/cards/setup`,Zt=e=>`/${e}/cards/onboard`,$t=(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},Wt=(e,o)=>e.find(t=>t.id===o),Gt=(e,o,t)=>!e||!o||t.fetchState==="Completed",ut=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Ht=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Kt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>B(n.accountBalance.available.amount)),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Jt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Qt=80,Xt=80,Yt=e=>e.companyId??D.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,dt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,lt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ea=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,na=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),pt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=D.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",f=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.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:f,businessVerificationStatus:A}=o;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(Te("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(ve(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(a,"charge_cards")):i===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const P=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?Pe(d,y,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),P=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:B(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(qn),mt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=G(),c=ie(),n=_(M=>V(M)),{useDynamicConfig:i,useFeatureGate:l}=se(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Q.zeniAccountsConfig),{configValue:p}=i(Q.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=_(M=>rn(M,n.companyId)),P=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,w=dn(A,n),I=dt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:w}),h=ln(n),T=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=lt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:T,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),v=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),N=Ie(c?.loggedInUserRoleMap),[K,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=_(M=>M.chargeCardSetupViewState.fetchState),x=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=M=>{ge(M)},Se=_(M=>yn(M,x));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||x==null?q||Z!=="Completed"||x==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(x,!1,!0)):(re(!0),t(le(x,!0)))},[q,Z,x,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=ut(m,I,S,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{U.trackPageLoaded(W.Event.cardsSetupVisited),U.trackCardsCardSetupView(P,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:K,handleDrawerToggle:Oe}),u.jsx(pt,{autoPayThreshold:f,navigate:e,location:o,companyId:x,currentTenant:n,isEarlyPayEnabled:y,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:E,isDebitCardOnlyEnabled:v,isCreditCardOnlyEnabled:R,chargeCardSetUpView:Se,isCreditCardProductVisible:m,isDebitCardFeatureEnabled:I,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:P,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:N,accountsPromoConfig:F})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},yt=Be.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
+ `,ft=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=hn(e),i=Cn(e,a),l=D.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",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.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:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.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(ve(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"reimbursement","reimbursement_setup"):_e("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(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(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")}}})(Jn),gt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=G(),c=ie(),{useDynamicConfig:n}=se(),i=De(),{configValue:l}=n(Q.zeniAccountsConfig),s=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),P=_(m=>m.remiSetupViewState.fetchState),g=_(m=>V(m)),S=_(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:I}=Xe(g?.tenantId),h=D.getSignedInUserTenant(a)?.companyId??g.companyId,T=D.getSignedInUser(),k=m=>{A(m)};if(T==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||P!=="Not-Started"||h==null?d.current||P!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[P,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,w)))},[y,S,I,w,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded(W.Event.reimbursementSetup);return u.jsxs(yt,{children:[u.jsx(oe,{analytics:U,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:f,handleDrawerToggle:k}),u.jsx(ft,{navigate:e,location:o,companyId:h,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{k(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},St=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Tn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},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:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:P,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:w,syncToken:I,fileIds:h,incDate:T,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:N,transactionVolume:K,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:x,usNexus:O,usNexusTypes:Oe}=s,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?Vn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:T!=null?je(T?.toString()):T,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:N,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:x,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:P,syncToken:w};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:P,dob:g,phone:S,syncToken:w,selectDocument:I,role:h,ownership:T,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:P,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:w,titleAtCompany:h.selectedOption,ownershipInCompany:T,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:s=>{e(L(t,s,a))},onSendForVerificationClick:s=>{e(L(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A={};f.forEach((d,y)=>{A[y]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A=Object.fromEntries(f.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onBackClick:()=>{e(Fn({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Ve())}}})(Qn),bt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=Y(),n=ee(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=G(),A=ie(),{useDynamicConfig:d}=se(),y=De(),{configValue:b}=d(Q.zeniAccountsConfig),P=ye(b),g=_(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=_(m=>m.companyConfigState.fetchState),w=_(m=>m.userRoleConfigState.fetchState),I=_(m=>V(m)),h=I.companyId??D.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),w==="Not-Started"&&n(Pn(!0))},[S,w,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n($(h,!0))}},[r,g,h,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let T;switch(e){case"zeni_accounts":T=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":T=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":T=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":T=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:T=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=_(m=>{let v;switch(e){case"zeni_accounts":v=wn(m,h);break;case"zeni_treasury":v=He(m,h);break;case"charge_cards":v=En(m,h);break;case"reimbursement":v=vn(m,h);break;default:v=_n(m,h)}return v});return T===!1?null:k.fetchState==="Completed"&&T===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded(W.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded(W.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded(W.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(St,{businessVerificationDetails:k,navigate:a,location:c,companyId:h,analytics:U,currentTenant:I,productType:e,roleMap:A.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:P.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},ht={overlayWidth:new Yn(100,100,59)},Ct=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=He(e,a),f=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",A=Rn(e),d=A.transactions,y=Ke(e),b=A.accountSummary?.totalBalance?.amount,P=d.length===0||b===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:y,isFirstTransfer:P,isDisabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.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(Ln(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(ve(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?Pe(s,r,"zeni_treasury","treasury_setup"):_e("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(L(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Ne(!1))}r===!0&&e(qe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(Nn(s))},onConfirmFundAllocation:()=>{e(Ne(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Ve())}}})(et),It=()=>{const e=X(),o=Y(),t=ee(),a=De(),c=Xn(),{tenantEmailDomain:n}=G(),{useDynamicConfig:i}=se(),l=ie(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=i(Q.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,P]=C.useState(!1),[g,S]=C.useState(!1),[w,I]=C.useState(!1),[h,T]=C.useState(!1),k=_(O=>O.treasurySetupViewState.fetchState),m=_(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=_(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=_(O=>O.treasuryDetailState.transactionsState?.fetchState),F=_(O=>V(O)),E=D.getSignedInUserTenant(n)?.companyId??F.companyId,N=_(O=>Qe(O,E)),K=N.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(P(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(Bn()))},[g,m,E,t]),C.useEffect(()=>{w||v!=="Not-Started"||E==null||(I(!0),t(xn()))},[w,v,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(T(!0),t(jn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,x=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{s||k!=="Completed"||K||x||!o.pathname.includes("setup")||r(!0)},[k,K,x]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(it,{onClose:()=>{t(Ve()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(At,{onClick:O=>O.stopPropagation(),children:u.jsx(bt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ve()),e("../setup")}})})}),u.jsx(Ct,{navigate:e,location:o,companyId:E,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:A,isAccountsEnabled:ge,isAllocationDone:K,analytics:U,treasurySetupView:N,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},At=Be(st)`
18
+ display: flex;
19
+ min-height: 100%;
20
+ flex-direction: column;
21
+ `,kt=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Mn(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:U,filesEndPoint:`${ce.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(ve(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"zeni_accounts","account_setup"):_e("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(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}})(nt),Pt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=se(),n=ie(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Q.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=_(S=>S.zeniAccountSetupViewState.fetchState),y=_(S=>V(S)),b=D.getSignedInUserTenant(a)?.companyId??y.companyId,P=D.getSignedInUser(),g=S=>{p(S)};if(P==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=w=>w.trackPageLoaded(W.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:w=>S(w)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(kt,{navigate:e,location:o,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Be.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=H(function(e,o){const t=V(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Wn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:n,analytics:U}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Gn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ae({files:a}))},onDeleteFile:a=>{e(te(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ne(a,c.split(".")[0]))}}})(tt),Et=()=>{const e=X(),o=Y(),t=ee(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=G(),p=ie(),{useFeatureGate:f}=se(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=_(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=_(k=>k.billPaySetupViewState.fetchState),b=_(k=>V(k)),P=De(),g=b.companyId??D.getSignedInUserTenant(r)?.companyId,S=_(k=>Zn(k.companyState,b.companyId)),w=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=w?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t($n(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(i(!0),t($(g,!0)))},[y,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,T=k=>{s(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(oe,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded(W.Event.billPayBusinessVerification,void 0))(k)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:T}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:P.colors.grey5}})},wt=H(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($(t,!0,!0))}}}}})(at(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(j,{to:"../"}):u.jsx(z,{});case"international-wire":return o?u.jsx(Et,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});default:return o?u.jsx(rt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(z,{}):a?u.jsx(gt,{}):u.jsx(z,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(z,{}):c?u.jsx(Pt,{}):u.jsx(z,{});case"zeni_treasury":return n===!0?u.jsx(It,{}):u.jsx(z,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(z,{}):i?u.jsx(mt,{}):l?u.jsx(j,{to:"../"}):u.jsx(z,{})}}));function ta(e){const{tenantEmailDomain:o}=G(),t=_(c=>V(c)).companyId??D.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(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:t,...a})}export{Qt as A,Xt as P,ta as S,Kt as a,Jt as b,dt as c,lt as d,ut as e,Yt as f,$t as g,Lt as h,Ht as i,qt as j,ea as k,Gt as l,Wt as m,Mt as n,Zt as o,zt as p,na as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-GsPfxkQ7.js";import{a as u,b as D,q as T}from"./sentry-B2TzMFx9.js";import{u as A,h as z,j as l,g as M,N as O,n as j}from"./core-wjM80qIn.js";import{u as F,z as s,m as P,c as w,D as B,d as _,e as N,Q as V,g as W,I as Y,h as v}from"./index-Det3Ki3b.js";import{eW as $,Lx as q,Ly as G,f9 as J,fC as Q,LD as H,gm as K,cY as R,LE as b,LF as X,LG as Z,bY as y}from"./zeni-epic-state-DrcliB1J.js";import"./mui-BSDa87ap.js";import{u as ee}from"./useDeviceId-t80vtq4B.js";import{f as te}from"./analyticsHelper-DaDCazpC.js";import{t as ne}from"./getLocaleForTenant-yX1iEbj2.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.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]="c675df04-ab81-4b1e-aee3-448d2ef59661",t._sentryDebugIdIdentifier="sentry-dbid-c675df04-ab81-4b1e-aee3-448d2ef59661")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({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())}}})(Y),ae=D.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:C,accountUnlockTime:h}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>$(e)),I=l(e=>q(e)),m=M(),E=P().mode,x=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[L.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(G(I.tenantsInOrder),o.zeniSessionId),J(o.userId,o.zeniSessionId,r.tenantId),i(Q(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),K().then(()=>{const e=W();e!=null&&_(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))},2e3))},[S,p,k,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:h}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-GsPfxkQ7.js";import{a as n}from"./sentry-B2TzMFx9.js";import{u,g as m,h as g,N as p}from"./core-wjM80qIn.js";import{z as d,B as y,t as b,c as f,e as h}from"./index-Det3Ki3b.js";import{gr as x,gs as I,LV as w}from"./zeni-epic-state-DrcliB1J.js";import{n as j}from"./mui-BSDa87ap.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.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]="5424b042-dd01-43e9-a9f6-5da77ab9383d",e._sentryDebugIdIdentifier="sentry-dbid-5424b042-dd01-43e9-a9f6-5da77ab9383d")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),l=d.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),w(),b.reset(),f.trackLogout(h.Event.logoutSuccess),f.resetUserIdentity()}catch(c){console.error("Error during sign out:",c)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.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 u}from"./liveblocks-GsPfxkQ7.js";import{a as G}from"./sentry-B2TzMFx9.js";import{h as _,u as v,g as K,j as b,i as z,n as W}from"./core-wjM80qIn.js";import{z as F,N as q,f as p,_ as H,s as M,c as O,e as V,d8 as Z,n as g,p as Q}from"./index-Det3Ki3b.js";import{eW as J,Th as R,IG as C,Ti as x,Td as X,I2 as y,Tj as Y,Ia as E,Hw as aa,IH as S,Tk as B,hF as ea,Ix as ta,IC as sa,Ip as oa,In as w,ID as na,Ik as ia,Tl as la,Tm as ra,Tn as ka,To as ca,Tp as T,ei as da,Tq as ua,Tr as pa}from"./zeni-epic-state-DrcliB1J.js";import{n as Ta}from"./mui-BSDa87ap.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import{M as ga}from"./MobileAppDrawer-D6Fu3M_x.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.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]="f9dc1b26-3e84-479e-9a2e-bf5d2552c3ed",e._sentryDebugIdIdentifier="sentry-dbid-f9dc1b26-3e84-479e-9a2e-bf5d2552c3ed")}catch{}})();const fa=Ta.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
+ `,ha=W(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=X(e),i=F.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Q(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(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const c=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{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(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Z);function $a(){const e=_(),t=v(),o=K(),k=F.getSignedInUser(),n=b(r=>J(r)),{taskGroupId:d}=z(),{useFeatureGate:i}=q(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,j]=G.useState(!1),h=b(r=>R(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:$}=ma({mobileExploreReferrer:"Task Checklist"});if(H({isDataReady:m==="Completed"}),G.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),G.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(M,{analytics:O,onLoad:r=>(U=>U.trackPageLoaded(V.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{j(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:N,onAskAiCfoClick:$})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{$a as default};
@@ -0,0 +1,9 @@
1
+ import{j as n}from"./liveblocks-GsPfxkQ7.js";import se from"./NotFoundScreen-_JeeXwwE.js";import{a as c}from"./sentry-B2TzMFx9.js";import{h as q,u as M,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-wjM80qIn.js";import{HJ as O,HM as le,HG as de,eW as Z,Td as J,H_ as W,HD as pe,Iu as ue,In as ke,Te as Q,Tf as z,Hz as me,Hw as fe,ry as ge,rm as he,l0 as Se,HU as Ie,Tg as Te,I9 as be,I6 as Ee,HP as Ge,I3 as Ce,I2 as De}from"./zeni-epic-state-DrcliB1J.js";import{z as C,d6 as xe,R as ye,N as je,f as b,p as X,n as v,s as we,c as N,e as ve,d7 as Re,h as V,at as Fe}from"./index-Det3Ki3b.js";import{n as Be}from"./mui-BSDa87ap.js";import{u as Pe}from"./useInitialThreadRequest-D9NRPlO5.js";import{M as Ue}from"./MobileAppDrawer-D6Fu3M_x.js";import Le from"./TaskListScreen-Dreq2LHj.js";import"./recharts-D4VpFd5q.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./useAskAiCfoHostNavButtonProps-BXGcqvyl.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]="76a39bca-a678-4111-af6f-39422515400b",e._sentryDebugIdIdentifier="sentry-dbid-76a39bca-a678-4111-af6f-39422515400b")}catch{}})();function He(){const e=q(),t=M(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,_=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,_=Object.values(I)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>z(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(W(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=q(),t=M(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,Y]=c.useState(!1),[F,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(W(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(K(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,G,l,s,e]);const H=g(i=>Q(i,r)),j=H.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&H.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(we,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:N,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Be.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(w,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(w,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(He,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(w,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-GsPfxkQ7.js";import i from"./NotFoundScreen-_JeeXwwE.js";import{T as r}from"./TransactionDetailScreen-s_jEo2WG.js";import"./sentry-B2TzMFx9.js";import{o as a,p as o}from"./core-wjM80qIn.js";import"./zeni-epic-state-DrcliB1J.js";import"./recharts-D4VpFd5q.js";import"./index-Det3Ki3b.js";import"./mui-BSDa87ap.js";import"./analytics-BUvTITrb.js";import"./plaid-50YvjniW.js";import"./dnd-BK3JI-SF.js";import"./stripe-DMRn4zHo.js";import"./lottie-C5rIATv6.js";import"./lexical-DcicQSkI.js";import"./pdf-BLNuomMl.js";import"./utils-BwzhiOdE.js";import"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import"./decodeURIComponentSafe-4aj60Fs2.js";import"./routePaths-CbGdb8gZ.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]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -1,5 +1,5 @@
1
- import{j as w}from"./liveblocks-ROiwr0XR.js";import{a as r}from"./sentry-Op00XcfN.js";import{u as N,k as Je,j as h,t as Qe,g as he,h as ge,i as Se,N as Xe,n as Ze}from"./core-DaoZ0mzV.js";import{mU as me,eR as J,fO as Ke,m5 as ea,m3 as aa,bn as ta,cP as ye,bt as Te,qj as G,La as $,Mb as be,Mc as ae,LA as Ee,jT as Ie,Md as ve,LF as te,LG as ne,kI as Ce,Ia as oe,L4 as M,jN as De,jL as ke,jX as na,mH as oa,Me as sa,Mf as ia,up as Y,jS as Ae,Hv as xe,cU as ra,cV as ca,Mg as la,L3 as da,Mh as ua,ul as ma,Mi as pa,Mj as fa,Mk as ha,Ml as ga,Mm as Sa,jW as ya,Mn as Ta,Mo as ba,L5 as Ea,Mp as Ia,Mq as va,Mr as Ca,Hp as Da,Hf as ka,HE as Aa,jY as xa,Ib as pe,mM as wa}from"./zeni-epic-state-BE7Zc7jP.js";import{s as H,d as F,z as we,aN as Fe,m as Fa,J as Ua,aO as Pa,A as _a,r as K,k as La,aP as Va,v as ee,Z as Ba,aQ as Oa,e as Ue,aR as Ra,at as za,a2 as Z}from"./index-xSp8Aw5x.js";import{n as Ma,S as Na,D as ja}from"./mui-jKmSXrkP.js";import{u as Ga}from"./useAskAiCfoHostNavButtonProps-DqUqid3a.js";import{d as Pe}from"./decodeURIComponentSafe-CT-RXMn2.js";import{h as _e,c as Le,g as $a,e as Ha}from"./routePaths-BjdFjRu7.js";import{t as qa}from"./utils-CVP2GEpN.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="c1df1e83-6e99-4d66-a644-18148eee239f",a._sentryDebugIdIdentifier="sentry-dbid-c1df1e83-6e99-4d66-a644-18148eee239f")}catch{}})();function Wa(a=!0){const e=N(),s=Je(),{useFeatureGate:t}=H(),{isFeatureEnabled:n}=t(F.isCreateTransferEntryFromExpenseEnabled);r.useEffect(()=>{if(!a||n!==!0)return;const o=i=>{const l=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return l!=="In-Progress"&&l!=="Completed"};o("transferEntryEligible")&&e(me({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(me({kind:"creditCardOnlyEligible"}))},[a,n,e,s])}function Ya(a,e){const s=function(){const l=N(),[m,f]=r.useState(!1),[E,p]=r.useState(null),{useDynamicConfig:g}=H(),{configValue:U,isDynamicConfigLoading:T}=g("transaction_categorization_config"),u=!T&&U?.capitalization_enabled===!0,D=h(v=>J(v)),I=D.companyId,A=h(v=>Ke(v.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:b,globalThreshold:k,maxCeiling:P,onboardingShownForPrepaid:_,onboardingShownForFixedAsset:B}=h(v=>{const S=v.tenantState.currentTenantId,c=S!=null?v.tenantState.tenantsById[S]:void 0;return{capitalizableAccounts:c?.capitalizableAccounts??null,globalThreshold:c?.capitalizationThreshold??null,maxCeiling:c?.capitalizationThresholdMaxCeiling??null,onboardingShownForPrepaid:c?.capitalizationOnboardingShownForPrepaid===!0,onboardingShownForFixedAsset:c?.capitalizationOnboardingShownForFixedAsset===!0}},Qe),j=r.useCallback(v=>{if(!u||b==null||k!=null&&k>0)return;const S=b.accounts??[],c=new Set(v);let V=!1,C=!1;for(const x of S)c.has(x.accountId)&&(x.classificationType==="prepaid"?V=!0:x.classificationType==="fixed_asset"&&(C=!0));V&&!_?(p("prepaid"),f(!0)):C&&!B&&(p("fixed_asset"),f(!0))},[u,b,k,_,B]),O=r.useCallback(v=>{E!=null&&(l(ea(I,v,P,E)),f(!1),p(null))},[l,I,E,P]),L=r.useCallback(()=>{E!=null&&(l(aa(I,E)),f(!1),p(null))},[l,I,E]);return{showPopup:m&&u,popupType:E,currencySymbol:A,checkAndShowPopup:j,handleSubmit:O,handleDismiss:L}}(),t=r.useRef(void 0),n=r.useRef([]),o=r.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=r.useRef(e);return i.current=e,r.useEffect(()=>{a==="In-Progress"&&(n.current=i.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a},[a]),s}const se=()=>{const a=we.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return r.useMemo(()=>ta(a)&&s,[a,s])};function Ve(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ft(a,e){const s=N(),{useFeatureGate:t,useDynamicConfig:n}=H(),o=h(y=>J(y)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ye(o.userRole),m=o.userRole!=null&&Te(o.userRole),{isFeatureEnabled:f}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:E}=t(F.isExpenseAutomationEnabled),{configValue:p}=n(Fe.enableUncategorizedExpenseCategory),g=p?.uncategorized_expense_category_enabled===!0,U=se(),T=r.useMemo(()=>({id:a,type:G(e)}),[a,e]),u=h(y=>$(y,T)),D=u?.transactionDetailUpdateStatus?.fetchState,I=u?.transactionDetailLocalData?.lineItemById,A=h(y=>{const W=$(y,T)?.transactionDetailLocalData.vendorUpdates?.id;return W==null?"Not-Started":y.transactionVendorViewState.editVendorStateById[W]?.saveStatus.fetchState??"Not-Started"}),b=r.useMemo(()=>u?.fetchState==="Completed"?Ve(u?.transaction):void 0,[u?.fetchState,u?.transaction]),k=h(y=>{if(b!=null)return be(y.customerIncomeState,y.vendorExpenseState,y.trendState,b,"month")}),P=h(y=>ae(y)),_=h(y=>{if(b!=null)return Ee(y.trendWithTransactionsState,b,"TransactionDetail")}),B=o.company?.companyInfo.firstMonthOfFY??1,j=h(y=>Ie(y.accountState,y.accountListState,"accountList")),[O,L]=r.useState(!1),[v,S]=r.useState(!1),[c,V]=r.useState(!1);r.useEffect(()=>{L(!1),S(!1),V(!1)},[a,e]);const C=r.useCallback(()=>{L(!1),S(!1)},[]),[x,R]=r.useState(!1),q=_?.selectedPeriod?.timePeriod;return r.useEffect(()=>{c||u==null||u.transaction==null||(s(ve({id:u.transaction.id,type:u.transaction.type})),V(!0)),b!=null&&(!i||l&&m===!1)&&(O?v||k==null||(S(!0),s(oe(b,"TransactionDetail",{timeframe:"month",timePeriod:q??k}))):(s(te()),s(ne()),L(!0),s(Ce(b))))},[s,c,u?.fetchState,u?.transaction,b,i,l,m,O,v,k,q]),r.useEffect(()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?R(!0):R(!1)},[P.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:m,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isChainOfThoughtEnabled:U,selectedTransaction:T,transactionDetail:u,rawDetailSaveStatus:D,rawDetailLineItemById:I,vendorSaveStatus:A,tranEntity:b,defaultTrendTransactionTimePeriod:k,vendorViewDetails:P,uiState:_,firstMonthOfFY:B,uncategorizedAccounts:j,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:x,setIsCreateVendorDrawerOpen:R}}const Ja={overlayWidth:new _a(100,100,58)},Qa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Fa(),i=Ua(),l=N(),m=h(p=>ae(p)),f=()=>{t()},E={vendorDetailView:n??m,onSaveSuccess:()=>{l(ke()),l(na("Not-Started")),s()},onSaveVendor:e,onCancelClick:f,saveVendorDetailLocalData:p=>{l(De({vendorId:void 0,localData:p}))}};return w.jsx(ja,{anchor:"right",open:a,PaperProps:{style:{width:Ja.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:f,children:w.jsx(Xa,{onClick:p=>p.stopPropagation(),children:w.jsx(Pa,{...E})})})},Xa=Ma(Na)`
1
+ import{j as w}from"./liveblocks-GsPfxkQ7.js";import{a as r}from"./sentry-B2TzMFx9.js";import{u as G,k as Ye,j as h,s as Ke,g as he,h as ge,i as Se,N as Qe,n as Ze}from"./core-wjM80qIn.js";import{nJ as me,eW as Y,gn as Xe,mW as ea,mE as aa,bn as ta,cU as ye,bt as Te,r6 as j,MK as $,NL as be,NM as ae,N8 as Ee,kD as ve,NN as Ie,Nd as te,Ne as ne,ls as Ce,JN as oe,ME as z,kx as De,kv as ke,kH as na,nw as oa,NO as sa,NP as ia,va as J,kC as Ae,J6 as xe,cZ as ra,c_ as ca,NQ as la,MD as da,NR as ua,v6 as ma,NS as pa,NT as fa,NU as ha,NV as ga,NW as Sa,kG as ya,NX as Ta,NY as ba,MF as Ea,NZ as va,N_ as Ia,N$ as Ca,J0 as Da,IS as ka,Jf as Aa,kI as xa,JO as pe,nB as wa}from"./zeni-epic-state-DrcliB1J.js";import{N as W,f as F,z as we,aN as Fe,m as Fa,K as Na,aO as Ua,w as _a,p as X,j as Pa,aP as Va,n as ee,_ as Ba,aQ as Oa,c as Ne,aR as La,at as Ra,a2 as Z}from"./index-Det3Ki3b.js";import{n as za,S as Ga,D as Ma}from"./mui-BSDa87ap.js";import{u as ja}from"./useAskAiCfoHostNavButtonProps-BXGcqvyl.js";import{d as Ue}from"./decodeURIComponentSafe-4aj60Fs2.js";import{h as _e,c as Pe,g as $a,e as Wa}from"./routePaths-CbGdb8gZ.js";import{u as qa}from"./utils-BwzhiOdE.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="e532a741-3b77-4fd1-9ff4-9b8628b45fec",a._sentryDebugIdIdentifier="sentry-dbid-e532a741-3b77-4fd1-9ff4-9b8628b45fec")}catch{}})();function Ha(a=!0){const e=G(),s=Ye(),{useFeatureGate:t}=W(),{isFeatureEnabled:n}=t(F.isCreateTransferEntryFromExpenseEnabled);r.useEffect(()=>{if(!a||n!==!0)return;const o=i=>{const l=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return l!=="In-Progress"&&l!=="Completed"};o("transferEntryEligible")&&e(me({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(me({kind:"creditCardOnlyEligible"}))},[a,n,e,s])}function Ja(a,e){const s=function(){const l=G(),[m,f]=r.useState(!1),[E,p]=r.useState(null),{useDynamicConfig:g}=W(),{configValue:N,isDynamicConfigLoading:T}=g("transaction_categorization_config"),u=!T&&N?.capitalization_enabled===!0,D=h(I=>Y(I)),v=D.companyId,A=h(I=>Xe(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:b,globalThreshold:k,maxCeiling:U,onboardingShownForPrepaid:_,onboardingShownForFixedAsset:B}=h(I=>{const S=I.tenantState.currentTenantId,c=S!=null?I.tenantState.tenantsById[S]:void 0;return{capitalizableAccounts:c?.capitalizableAccounts??null,globalThreshold:c?.capitalizationThreshold??null,maxCeiling:c?.capitalizationThresholdMaxCeiling??null,onboardingShownForPrepaid:c?.capitalizationOnboardingShownForPrepaid===!0,onboardingShownForFixedAsset:c?.capitalizationOnboardingShownForFixedAsset===!0}},Ke),M=r.useCallback(I=>{if(!u||b==null||k!=null&&k>0)return;const S=b.accounts??[],c=new Set(I);let V=!1,C=!1;for(const x of S)c.has(x.accountId)&&(x.classificationType==="prepaid"?V=!0:x.classificationType==="fixed_asset"&&(C=!0));V&&!_?(p("prepaid"),f(!0)):C&&!B&&(p("fixed_asset"),f(!0))},[u,b,k,_,B]),O=r.useCallback(I=>{E!=null&&(l(ea(v,I,U,E)),f(!1),p(null))},[l,v,E,U]),P=r.useCallback(()=>{E!=null&&(l(aa(v,E)),f(!1),p(null))},[l,v,E]);return{showPopup:m&&u,popupType:E,currencySymbol:A,checkAndShowPopup:M,handleSubmit:O,handleDismiss:P}}(),t=r.useRef(void 0),n=r.useRef([]),o=r.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=r.useRef(e);return i.current=e,r.useEffect(()=>{a==="In-Progress"&&(n.current=i.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a},[a]),s}const se=()=>{const a=we.getSignedInUser(),{useFeatureGate:e}=W(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return r.useMemo(()=>ta(a)&&s,[a,s])};function Ve(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ft(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=W(),o=h(y=>Y(y)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ye(o.userRole),m=o.userRole!=null&&Te(o.userRole),{isFeatureEnabled:f}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:E}=t(F.isExpenseAutomationEnabled),{configValue:p}=n(Fe.enableUncategorizedExpenseCategory),g=p?.uncategorized_expense_category_enabled===!0,N=se(),T=r.useMemo(()=>({id:a,type:j(e)}),[a,e]),u=h(y=>$(y,T)),D=u?.transactionDetailUpdateStatus?.fetchState,v=u?.transactionDetailLocalData?.lineItemById,A=h(y=>{const H=$(y,T)?.transactionDetailLocalData.vendorUpdates?.id;return H==null?"Not-Started":y.transactionVendorViewState.editVendorStateById[H]?.saveStatus.fetchState??"Not-Started"}),b=r.useMemo(()=>u?.fetchState==="Completed"?Ve(u?.transaction):void 0,[u?.fetchState,u?.transaction]),k=h(y=>{if(b!=null)return be(y.customerIncomeState,y.vendorExpenseState,y.trendState,b,"month")}),U=h(y=>ae(y)),_=h(y=>{if(b!=null)return Ee(y.trendWithTransactionsState,b,"TransactionDetail")}),B=o.company?.companyInfo.firstMonthOfFY??1,M=h(y=>ve(y.accountState,y.accountListState,"accountList")),[O,P]=r.useState(!1),[I,S]=r.useState(!1),[c,V]=r.useState(!1);r.useEffect(()=>{P(!1),S(!1),V(!1)},[a,e]);const C=r.useCallback(()=>{P(!1),S(!1)},[]),[x,L]=r.useState(!1),q=_?.selectedPeriod?.timePeriod;return r.useEffect(()=>{c||u==null||u.transaction==null||(s(Ie({id:u.transaction.id,type:u.transaction.type})),V(!0)),b!=null&&(!i||l&&m===!1)&&(O?I||k==null||(S(!0),s(oe(b,"TransactionDetail",{timeframe:"month",timePeriod:q??k}))):(s(te()),s(ne()),P(!0),s(Ce(b))))},[s,c,u?.fetchState,u?.transaction,b,i,l,m,O,I,k,q]),r.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{s(z("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:m,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isChainOfThoughtEnabled:N,selectedTransaction:T,transactionDetail:u,rawDetailSaveStatus:D,rawDetailLineItemById:v,vendorSaveStatus:A,tranEntity:b,defaultTrendTransactionTimePeriod:k,vendorViewDetails:U,uiState:_,firstMonthOfFY:B,uncategorizedAccounts:M,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:x,setIsCreateVendorDrawerOpen:L}}const Ya={overlayWidth:new _a(100,100,58)},Ka=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Fa(),i=Na(),l=G(),m=h(p=>ae(p)),f=()=>{t()},E={vendorDetailView:n??m,onSaveSuccess:()=>{l(ke()),l(na("Not-Started")),s()},onSaveVendor:e,onCancelClick:f,saveVendorDetailLocalData:p=>{l(De({vendorId:void 0,localData:p}))}};return w.jsx(Ma,{anchor:"right",open:a,PaperProps:{style:{width:Ya.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:f,children:w.jsx(Qa,{onClick:p=>p.stopPropagation(),children:w.jsx(Ua,{...E})})})},Qa=za(Ga)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `;function Za(a,e){a(oa({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:G(e.transactionType),sourceTransactionType:G(e.sourceTransactionType)}))}function Ka({currentTransactionId:a,enabled:e=!0,buildPath:s,beforeNavigate:t,navigate:n,navigateState:o}){const i=h(m=>m.createTransferEntryState.lastTransferEntryReplacement),l=r.useRef(null);r.useEffect(()=>{if(!e||i==null||a==null||l.current===i)return;const{previousTransactionId:m,newTransactionId:f}=i;a.id===m.id&&a.type===m.type&&(l.current=i,t?.(),n(s(f),{replace:!0,state:o}))},[e,i,a,s,t,n,o])}const et=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=he(),n=ge(),o=N(),i=se(),{transactionTypeEncoded:l,transactionId:m}=Se(),f=e??m,E=s??Pe(l??"");let p;_e(f,E)&&(p={id:f,type:G(E)});const g=p!=null?h(T=>$(T,p)):void 0,U=()=>{const T=K(t.state?.pathnameStackToGoBack),u=T.poppedPathname??((D=2)=>{let I="../";for(let A=0;A<D;A++)I=`${I}../`;return I})(1);n(u,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:p,onSaveVendor:()=>{o(Ae(p,void 0))},onSaveSuccess:()=>{if(g!=null&&g?.transaction&&g?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&g?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=g?.transactionDetailLocalData.vendorUpdates,u={id:g?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:g?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:g?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:g?.transaction?.id,type:g?.transaction?.type},transaction:g?.transaction,lineIds:g?.transaction?.lines?.map(I=>I.id)??[]};o(Y({entity:u,amount:g?.transaction?.amount.amount,transactionDetails:D,flowType:"detail",isFetchCOT:i}))}U()},onCancel:()=>{p!=null&&o(sa({transactionId:p})),o(ke()),o(ia()),a(!0),U()}}},at=Ze(function(a,e){const s=$(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=we.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=la(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,m=da(a,"common"),f=J(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${Z}/transaction_attachment`,transactionAttachmentsEndpointToFetch:f.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/transaction_attachments_accounting_provider`:`${Z}/transaction_attachments`,attachmentUploadEndpoint:`${za.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ue,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:m},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(M("common")),e.onBackClick!=null)return void e.onBackClick();const t=K(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Be(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(wa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(te()),a(ne());const n=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Le(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(pe(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(oe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(pe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?Ae(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(M("common"))},onUploadAttachmentAttachment:t=>{a(Aa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ka(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(Da({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(Ca(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,m)=>{a(va(t,n,o,i,l,m))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(Ia({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=K(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=qa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${$a(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Ha(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(xe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(Ea({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(M("common"))},onCancelAutoComplete:()=>{a(M("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(Y({entity:t,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ba(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(Ta(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(ya({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(Y({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s})),a(De({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const m=e.transaction,f=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(m.type??"")}/${m.id}/vendor/create`,{state:{pathnameStackToGoBack:f}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(Sa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(Y({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(ga({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ha(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(fa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(pa({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(ma(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(ua(t,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>Za(a,t):void 0}})(Ra);function ht(){const a=ge(),e=N(),s=he(),{useFeatureGate:t,useDynamicConfig:n}=H(),o=La(),i=h(d=>J(d)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),m=i.userRole!=null&&ye(i.userRole),f=i.userRole!=null&&Te(i.userRole),{isFeatureEnabled:E}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:p}=t(F.isExpenseAutomationEnabled),{configValue:g}=n(Fe.enableUncategorizedExpenseCategory),U=g?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:u,transactionId:D}=Se(),[I,A]=r.useState(!1),b=Pe(u??""),k=_e(D,b),P=h(d=>d.transactionVendorViewState),_=se(),{isFeatureEnabled:B}=t(F.isTransactionCommentingEnabled),{isFeatureEnabled:j}=t(F.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:O}=t(F.isProjectsTransactionsEnabled),L=o?.currentTenant?.companyId,v=o?.currentTenant?.companyName,S=r.useMemo(()=>{if(k)return{id:D,type:G(b)}},[k,D,b]),c=S!=null?h(d=>$(d,S)):void 0,V=c?.transactionDetailLocalData.vendorUpdates?.id!=null?P.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ve(c?.transaction):void 0,x=h(d=>C!=null?be(d.customerIncomeState,d.vendorExpenseState,d.trendState,C,"month"):void 0),R=h(d=>ae(d)),q=h(d=>C!=null?Ee(d.trendWithTransactionsState,C,"TransactionDetail"):void 0),y=i.company?.companyInfo.firstMonthOfFY??1,W=h(d=>Ie(d.accountState,d.accountListState,"accountList")),[Oe,ie]=r.useState(!1),[Re,re]=r.useState(!1),[ze,ce]=r.useState(!1),Me=r.useCallback(d=>Le(d,T??"")+s.search,[T,s.search]),Ne=r.useCallback(()=>{ce(!1)},[]);Ka({currentTransactionId:S,enabled:T!=null&&T!=="",buildPath:Me,beforeNavigate:Ne,navigate:a,navigateState:s.state});const le=()=>{ie(!1),re(!1)},de=Va();Wa();const Q=r.useRef(c?.transaction);Q.current=c?.transaction;const je=c?.transactionDetailUpdateStatus?.fetchState,z=Ya(je,()=>{const d=[];if(Q.current!=null)for(const X of Q.current.lines??[])"account"in X&&X.account?.accountId!=null&&d.push(X.account.accountId);return d});r.useEffect(()=>{S!=null&&c!=null&&c.fetchState==="Not-Started"&&(e(xe(S,!1)),le())},[e,S,c?.fetchState]),r.useEffect(()=>{if(S!=null&&c?.fetchState==="Error"){const d=ee(s.state?.pathnameStackToGoBack,s.pathname);a("page-not-found",{replace:!0,state:de?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[S,c?.fetchState,a,s.state,s.pathname,de]),r.useEffect(()=>{ze||c==null||c.transaction==null||(e(ve({id:c.transaction.id,type:c.transaction.type})),ce(!0)),C==null&&c?.fetchState==="Completed"&&fe(c?.transaction),C!=null&&(!l||m&&f===!1)&&(Oe?Re||x==null||(re(!0),e(oe(C,"TransactionDetail",{timeframe:"month",timePeriod:q?.selectedPeriod?.timePeriod??x}))):(e(te()),e(ne()),fe(c?.transaction),ie(!0),e(Ce(C))))},[c?.fetchState,c?.transaction,x,l]),r.useEffect(()=>{R.newVendorState?.vendorDetailLocalData?.vendorName!=null?A(!0):A(!1)},[R.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{e(M("common"))},[]);const Ge=[u,D].filter(d=>d!=null),{transactionId:ue,onSaveVendor:$e,onSaveSuccess:He,onCancel:qe}=et({closeDrawerHandler:d=>{A(!1),a(d?"../":"../..")}}),{isAiCfoAccessEnabled:We,onAskAiCfoClick:Ye}=Ga({mobileExploreReferrer:"Transaction Details"});return Ba({isDataReady:c?.fetchState==="Completed"}),k?w.jsxs(w.Fragment,{children:[ue!=null&&I&&w.jsx(Qa,{isOpen:I,transactionId:ue,onSaveVendor:$e,onSaveSuccess:He,onCancel:qe}),w.jsx(at,{hideDeleteAttachment:!0,firstMonthOfFY:y,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:a,selectedTransaction:S,entity:C,isCOTEnabled:_,defaultTrendTransactionTimePeriod:x,resetTrendIsFetchedStates:le,transaction:c?.transaction,uncategorizedAccounts:W,vendorSaveStatus:V,isVendorBulkUpdateOnTransactionEnabled:E,isCreateTransferEntryFromExpenseEnabled:j,isExpenseAutomationEnabled:p,isUncategorizedExpenseCategoryEnabled:U,isAiCfoAccessEnabled:We,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:B,isProjectsTransactionsEnabled:O,companyId:L,companyName:v}),z.showPopup&&z.popupType!=null&&w.jsx(Oa,{popupType:z.popupType,currencySymbol:z.currencySymbol,onSubmit:z.handleSubmit,onDismiss:z.handleDismiss})]}):w.jsx(Xe,{to:Be(Ge.length)})}const Be=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},fe=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=tt(a),t=nt(a);Ue.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},tt=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},nt=a=>ra(a)===!0?a.customer?.name??"":ca(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Qa as C,ht as T,Wa as a,Ya as b,et as c,at as d,Ka as e,se as f,Za as g,ft as u};
5
+ `;function Za(a,e){a(oa({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:j(e.transactionType),sourceTransactionType:j(e.sourceTransactionType)}))}function Xa({currentTransactionId:a,enabled:e=!0,buildPath:s,beforeNavigate:t,navigate:n,navigateState:o}){const i=h(m=>m.createTransferEntryState.lastTransferEntryReplacement),l=r.useRef(null);r.useEffect(()=>{if(!e||i==null||a==null||l.current===i)return;const{previousTransactionId:m,newTransactionId:f}=i;a.id===m.id&&a.type===m.type&&(l.current=i,t?.(),n(s(f),{replace:!0,state:o}))},[e,i,a,s,t,n,o])}const et=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=he(),n=ge(),o=G(),i=se(),{transactionTypeEncoded:l,transactionId:m}=Se(),f=e??m,E=s??Ue(l??"");let p;_e(f,E)&&(p={id:f,type:j(E)});const g=p!=null?h(T=>$(T,p)):void 0,N=()=>{const T=X(t.state?.pathnameStackToGoBack),u=T.poppedPathname??((D=2)=>{let v="../";for(let A=0;A<D;A++)v=`${v}../`;return v})(1);n(u,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:p,onSaveVendor:()=>{o(Ae(p,void 0))},onSaveSuccess:()=>{if(g!=null&&g?.transaction&&g?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&g?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=g?.transactionDetailLocalData.vendorUpdates,u={id:g?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:g?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:g?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:g?.transaction?.id,type:g?.transaction?.type},transaction:g?.transaction,lineIds:g?.transaction?.lines?.map(v=>v.id)??[]};o(J({entity:u,amount:g?.transaction?.amount.amount,transactionDetails:D,flowType:"detail",isFetchCOT:i}))}N()},onCancel:()=>{p!=null&&o(sa({transactionId:p})),o(ke()),o(ia()),a(!0),N()}}},at=Ze(function(a,e){const s=$(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=we.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=la(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,m=da(a,"common"),f=Y(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${Z}/transaction_attachment`,transactionAttachmentsEndpointToFetch:f.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/transaction_attachments_accounting_provider`:`${Z}/transaction_attachments`,attachmentUploadEndpoint:`${Ra.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ne,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:m},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(z("common")),e.onBackClick!=null)return void e.onBackClick();const t=X(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Be(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(wa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(te()),a(ne());const n=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Pe(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(pe(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(oe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(pe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?Ae(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(z("common"))},onUploadAttachmentAttachment:t=>{a(Aa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ka(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(Da({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(Ca(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,m)=>{a(Ia(t,n,o,i,l,m))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(va({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=X(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=qa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${$a(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Wa(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(xe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(Ea({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(z("common"))},onCancelAutoComplete:()=>{a(z("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(J({entity:t,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ba(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(Ta(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(ya({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(J({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s})),a(De({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const m=e.transaction,f=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(m.type??"")}/${m.id}/vendor/create`,{state:{pathnameStackToGoBack:f}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(Sa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(J({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(ga({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ha(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(fa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(pa({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(ma(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(ua(t,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>Za(a,t):void 0}})(La);function ht(){const a=ge(),e=G(),s=he(),{useFeatureGate:t,useDynamicConfig:n}=W(),o=Pa(),i=h(d=>Y(d)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),m=i.userRole!=null&&ye(i.userRole),f=i.userRole!=null&&Te(i.userRole),{isFeatureEnabled:E}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:p}=t(F.isExpenseAutomationEnabled),{configValue:g}=n(Fe.enableUncategorizedExpenseCategory),N=g?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:u,transactionId:D}=Se(),[v,A]=r.useState(!1),b=Ue(u??""),k=_e(D,b),U=h(d=>d.transactionVendorViewState),_=se(),{isFeatureEnabled:B}=t(F.isTransactionCommentingEnabled),{isFeatureEnabled:M}=t(F.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:O}=t(F.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,I=o?.currentTenant?.companyName,S=r.useMemo(()=>{if(k)return{id:D,type:j(b)}},[k,D,b]),c=S!=null?h(d=>$(d,S)):void 0,V=c?.transactionDetailLocalData.vendorUpdates?.id!=null?U.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ve(c?.transaction):void 0,x=h(d=>C!=null?be(d.customerIncomeState,d.vendorExpenseState,d.trendState,C,"month"):void 0),L=h(d=>ae(d)),q=h(d=>C!=null?Ee(d.trendWithTransactionsState,C,"TransactionDetail"):void 0),y=i.company?.companyInfo.firstMonthOfFY??1,H=h(d=>ve(d.accountState,d.accountListState,"accountList")),[Oe,ie]=r.useState(!1),[Le,re]=r.useState(!1),[Re,ce]=r.useState(!1),ze=r.useCallback(d=>Pe(d,T??"")+s.search,[T,s.search]),Ge=r.useCallback(()=>{ce(!1)},[]);Xa({currentTransactionId:S,enabled:T!=null&&T!=="",buildPath:ze,beforeNavigate:Ge,navigate:a,navigateState:s.state});const le=()=>{ie(!1),re(!1)},de=Va();Ha();const K=r.useRef(c?.transaction);K.current=c?.transaction;const Me=c?.transactionDetailUpdateStatus?.fetchState,R=Ja(Me,()=>{const d=[];if(K.current!=null)for(const Q of K.current.lines??[])"account"in Q&&Q.account?.accountId!=null&&d.push(Q.account.accountId);return d});r.useEffect(()=>{S!=null&&c!=null&&c.fetchState==="Not-Started"&&(e(xe(S,!1)),le())},[e,S,c?.fetchState]),r.useEffect(()=>{if(S!=null&&c?.fetchState==="Error"){const d=ee(s.state?.pathnameStackToGoBack,s.pathname);a("page-not-found",{replace:!0,state:de?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[S,c?.fetchState,a,s.state,s.pathname,de]),r.useEffect(()=>{Re||c==null||c.transaction==null||(e(Ie({id:c.transaction.id,type:c.transaction.type})),ce(!0)),C==null&&c?.fetchState==="Completed"&&fe(c?.transaction),C!=null&&(!l||m&&f===!1)&&(Oe?Le||x==null||(re(!0),e(oe(C,"TransactionDetail",{timeframe:"month",timePeriod:q?.selectedPeriod?.timePeriod??x}))):(e(te()),e(ne()),fe(c?.transaction),ie(!0),e(Ce(C))))},[c?.fetchState,c?.transaction,x,l]),r.useEffect(()=>{L.newVendorState?.vendorDetailLocalData?.vendorName!=null?A(!0):A(!1)},[L.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{e(z("common"))},[]);const je=[u,D].filter(d=>d!=null),{transactionId:ue,onSaveVendor:$e,onSaveSuccess:We,onCancel:qe}=et({closeDrawerHandler:d=>{A(!1),a(d?"../":"../..")}}),{isAiCfoAccessEnabled:He,onAskAiCfoClick:Je}=ja({mobileExploreReferrer:"Transaction Details"});return Ba({isDataReady:c?.fetchState==="Completed"}),k?w.jsxs(w.Fragment,{children:[ue!=null&&v&&w.jsx(Ka,{isOpen:v,transactionId:ue,onSaveVendor:$e,onSaveSuccess:We,onCancel:qe}),w.jsx(at,{hideDeleteAttachment:!0,firstMonthOfFY:y,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:a,selectedTransaction:S,entity:C,isCOTEnabled:_,defaultTrendTransactionTimePeriod:x,resetTrendIsFetchedStates:le,transaction:c?.transaction,uncategorizedAccounts:H,vendorSaveStatus:V,isVendorBulkUpdateOnTransactionEnabled:E,isCreateTransferEntryFromExpenseEnabled:M,isExpenseAutomationEnabled:p,isUncategorizedExpenseCategoryEnabled:N,isAiCfoAccessEnabled:He,onAskAiCfoClick:Je,isTransactionCommentingEnabled:B,isProjectsTransactionsEnabled:O,companyId:P,companyName:I}),R.showPopup&&R.popupType!=null&&w.jsx(Oa,{popupType:R.popupType,currencySymbol:R.currencySymbol,onSubmit:R.handleSubmit,onDismiss:R.handleDismiss})]}):w.jsx(Qe,{to:Be(je.length)})}const Be=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},fe=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=tt(a),t=nt(a);Ne.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},tt=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},nt=a=>ra(a)===!0?a.customer?.name??"":ca(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Ka as C,ht as T,Ha as a,Ja as b,et as c,at as d,Xa as e,se as f,Za as g,ft as u};