@zeniai/web-app-ui 5.3.61-qa → 5.3.62-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 (139) hide show
  1. package/dist/assets/{AccountMappingScreen-OaD-Ww7N.js → AccountMappingScreen-DwM3_WTC.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-C71W3EXR.js → ActualMatchingMatchDetailScreen---3NQIlW.js} +1 -1
  3. package/dist/assets/AddressRoutes-CRWje5aU.js +1 -0
  4. package/dist/assets/AddressScreen-DwDn6adU.js +9 -0
  5. package/dist/assets/{AiCfoScreen-DO4viMbN.js → AiCfoScreen-CmI1WP3p.js} +1 -1
  6. package/dist/assets/{AppDrawer-BoBT503t.js → AppDrawer-CqAnDatC.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-UWoiHhFS.js → BillPayApprovalRoutes-uF3lLPXa.js} +1 -1
  8. package/dist/assets/BillPayRoutes-CxGXv0Eb.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-DjqyigwM.js → BusinessVerificationPageScreen-CWJBny4J.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-cEaT6Zqk.js → CardsAiCfoScreen-DTmIk225.js} +1 -1
  11. package/dist/assets/ChargeCardRoutes-CBA-C6S5.js +71 -0
  12. package/dist/assets/{CompanyPassportScreen-CHnMtfXr.js → CompanyPassportScreen-C0r5_u0C.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-D97ZGKWy.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-DREpIR3e.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-CkVSR1Hr.js → CustomerOnboardingRoutes-BFK8USjA.js} +3 -3
  16. package/dist/assets/DashboardRoutes-CIiFmVuR.js +20 -0
  17. package/dist/assets/{DefaultTenantHome-BWjmQO2E.js → DefaultTenantHome-BWhhfpNZ.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-Cs9T_IgO.js → DomesticWireDetailScreen-C8g5HYbF.js} +4 -4
  19. package/dist/assets/{DrawerScreen-CO5oDn6f.js → DrawerScreen-jGeXohet.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-QbthrUVk.js → EntityDetailRoutes-DDbPZyaE.js} +1 -1
  21. package/dist/assets/ExpenseAutomationRoutes-BhSlFN1-.js +38 -0
  22. package/dist/assets/{FeaturePreviewScreen-DWBL39rh.js → FeaturePreviewScreen-t-KcIePh.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-DAce4xun.js → HubSpotOAuthCallbackScreen-B9Xsd5UE.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-B4UF_uUg.js → InboxNotificationsProvider-DcarX1j5.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-BQHOoyRc.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-phTux1TG.js → MagicLinkRoutes-CfUJpVA_.js} +4 -4
  27. package/dist/assets/{MagicLinkSignInScreen-D-3VGahG.js → MagicLinkSignInScreen-BR70G8WN.js} +1 -1
  28. package/dist/assets/MobileAppDrawer-DqgtjBKX.js +1 -0
  29. package/dist/assets/NotFoundScreen-C2GrPpNy.js +1 -0
  30. package/dist/assets/{NotificationRoutes-YZJK1G-i.js → NotificationRoutes-C1V1-m3K.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-BgBHYWlo.js → OAuthConsentScreen-UVKKdhYW.js} +1 -1
  32. package/dist/assets/PandLWithForecastRoutes-x9MBz-SJ.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-DCGfHELs.js → PaymentLinkScreen-BtszXnNs.js} +9 -9
  34. package/dist/assets/{PeopleRoutes-BWFloBGz.js → PeopleRoutes-By-929Rc.js} +3 -3
  35. package/dist/assets/PerformanceRoutes-DwUVercL.js +1 -0
  36. package/dist/assets/{Preview-Co3i0Xrb.js → Preview-Dxr01VGI.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-DYxxHcdI.js → QBOConnectionScreen-Chdjbcg8.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-CMbfshMX.js → ReimbursementApprovalRoutes-DVM8rE5F.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CrWl9trk.js → ReimbursementApprovalRuleDetailScreen-Bf1LI70e.js} +1 -1
  40. package/dist/assets/ReimbursementRoutes-ByU4nWbt.js +68 -0
  41. package/dist/assets/ReportsRoutes-Be1H67SI.js +1 -0
  42. package/dist/assets/RewardsRoutes-iweGs61q.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DTNyy-6E.js → ScheduleDetailsPrepaidExpensesScreen-HIrqgD7A.js} +4 -4
  44. package/dist/assets/{ScreenRoutes-DP4Wjips.js → ScreenRoutes-CFuAOQvL.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-CDD6OVir.js → SettingsRoutes-CYdVWZYv.js} +5 -5
  46. package/dist/assets/{SetupPagesScreen-BlUoKvnc.js → SetupPagesScreen-BccJSzRN.js} +5 -5
  47. package/dist/assets/SignInScreen-DM0sUU51.js +1 -0
  48. package/dist/assets/SignOutScreen-Bs1NyDBL.js +9 -0
  49. package/dist/assets/{TaskListScreen-UsJ67eRj.js → TaskListScreen-DQj6h_q_.js} +2 -2
  50. package/dist/assets/{TaskRoutes-CH6htYb8.js → TaskRoutes-DY92MrHK.js} +1 -1
  51. package/dist/assets/TransactionDetailRoutes-BFj2-oES.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-fc6wRDCa.js +5 -0
  53. package/dist/assets/TransactionListRoutes-DoEWtZb8.js +1 -0
  54. package/dist/assets/TreasuryRoutes-BwZlVh2U.js +37 -0
  55. package/dist/assets/{VendorsRoutes-jSHZV8MZ.js → VendorsRoutes-rWAhbgUX.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-Bf_MMExc.js → WiseConfirmationScreen-twAmgAST.js} +1 -1
  57. package/dist/assets/ZeniAccountRoutes-BqSVR2HC.js +57 -0
  58. package/dist/assets/{ZeniAccountStatementScreen-CcOG7C5Z.js → ZeniAccountStatementScreen-xKZWX655.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-Ci74NLEW.js → accountMappingHelper-DpfYWNe6.js} +1 -1
  60. package/dist/assets/{analytics-8lQ_GaR7.js → analytics-CiEh1qKr.js} +1 -1
  61. package/dist/assets/{analyticsHelper-Bi6R9Hrj.js → analyticsHelper-DHPcRAai.js} +1 -1
  62. package/dist/assets/{core-B-8b0iz9.js → core-Caq7Zbsp.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-hAviH84T.js → decodeURIComponentSafe-DmjyT4t5.js} +1 -1
  64. package/dist/assets/{dnd-CtOxA7uX.js → dnd-DwckO6rX.js} +1 -1
  65. package/dist/assets/{empty-CyiOIGJw.js → empty-CviwvzhB.js} +1 -1
  66. package/dist/assets/{empty-ZUR8mjP1.js → empty-Dl3LsHNf.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-Dch9mr3K.js → emptyVideoElement-0ADxBh21.js} +1 -1
  68. package/dist/assets/{epic-C_YIXfJm.js → epic-DqqOk9a9.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-BzOPc0En.js → expenseAutomationHelper-B83Qa5Jl.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-BYXijL7f.js → getLocaleForTenant-YgJPw-1W.js} +1 -1
  71. package/dist/assets/{index-BUsi93tT.js → index-B3LhL1WI.js} +2 -2
  72. package/dist/assets/{index-DeS-5gfC.js → index-BLBexBOn.js} +1 -1
  73. package/dist/assets/{index-CzpjeHcU.js → index-BggnOuo1.js} +1 -1
  74. package/dist/assets/{index-CgYr_9vs.js → index-Bi5Vnzzf.js} +1 -1
  75. package/dist/assets/{index-Ce-G0Vp2.js → index-BsIiLcaT.js} +1 -1
  76. package/dist/assets/{index-Bg2deWZq.js → index-DOXJLxdR.js} +23226 -23221
  77. package/dist/assets/{index-haVo7C6B.js → index-DZj1fENq.js} +1 -1
  78. package/dist/assets/{index-b65XjN06.js → index-De1Gw5gW.js} +1 -1
  79. package/dist/assets/{lexical-BVt4M34U.js → lexical-mmp2B1vq.js} +1 -1
  80. package/dist/assets/{liveblocks-BjcYyeQ6.js → liveblocks-CIxx6Ub6.js} +1 -1
  81. package/dist/assets/{lottie-BdAYiWcR.js → lottie-CrKh4Q_r.js} +1 -1
  82. package/dist/assets/{mui-C33Oegsm.js → mui-DI0hUuFr.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Bgu6njoM.js → pathToGoBack-Ch5lrOj1.js} +1 -1
  84. package/dist/assets/{pdf-BkfulyEw.js → pdf-BlhN83fm.js} +3 -3
  85. package/dist/assets/{pdf-lib-D8o-uP9K.js → pdf-lib-WBpN-CHj.js} +1 -1
  86. package/dist/assets/{plaid-Bt28AVCt.js → plaid-CXvI7t9H.js} +1 -1
  87. package/dist/assets/{pusher-BWEmmbE9.js → pusher-BZAjVztW.js} +1 -1
  88. package/dist/assets/{react-BAH__mX9.js → react-BHfk4QRe.js} +1 -1
  89. package/dist/assets/{react-CIEK2Ei-.js → react-BqA23JAy.js} +1 -1
  90. package/dist/assets/{react-Dqb011PB.js → react-BsygV86H.js} +1 -1
  91. package/dist/assets/{react-B7GqIpoL.js → react-XoZ7aD8C.js} +1 -1
  92. package/dist/assets/{react-DT9gMpbF.js → react-rmAoHvXj.js} +1 -1
  93. package/dist/assets/{react-Ls8UDl46.js → react-tooGqts4.js} +1 -1
  94. package/dist/assets/{recharts-DkYxIsLi.js → recharts-DKmpCGIA.js} +1 -1
  95. package/dist/assets/{routePaths-Cz0AF8Dx.js → routePaths-C1OqXYGB.js} +1 -1
  96. package/dist/assets/{sentry-DZ9rNYfw.js → sentry-BCPOyc0G.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-Te2Zqy4u.js → stripSplatSuffix-Dmnnw5Oe.js} +1 -1
  98. package/dist/assets/{url-BjdrSaU1.js → url-CdxI2rEH.js} +1 -1
  99. package/dist/assets/{url-DY2r7CPa.js → url-JduagIhH.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-BzNeeZZT.js → useActualMatchingMatchDetail-6t8vcRTI.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CI6Qx_-n.js → useAiCfoDashboardSuggestedQuestionsChips-BO7_rPaJ.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-BvhP40c_.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-1CQ78Q4X.js → useChargeCardPusherEvents-2nVivR1x.js} +1 -1
  104. package/dist/assets/{useDeviceId-gFU5q5zf.js → useDeviceId-2NJBbYPM.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-BkOsYAaQ.js → useEmailConnectResultRefresh-QqukN5jp.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-C3Htu0iZ.js → useInitialThreadRequest-uu8NipM7.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-DxrmaJfc.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-Da1LpD5U.js → useTaskManagerPusherEvents-D5Hm7um3.js} +1 -1
  109. package/dist/assets/{utils-D3rZq_G4.js → utils-rX2IEvjD.js} +1 -1
  110. package/dist/assets/withTransactionSidePanel-C1wVwRW0.js +25 -0
  111. package/dist/assets/{zeni-epic-state-95zxmizy.js → zeni-epic-state-DROyxOLw.js} +3 -3
  112. package/dist/index.html +1 -1
  113. package/package.json +3 -3
  114. package/dist/assets/AddressRoutes-BVz7TQgL.js +0 -1
  115. package/dist/assets/AddressScreen-DyDl-tRh.js +0 -9
  116. package/dist/assets/BillPayRoutes-GFA8LUX-.js +0 -119
  117. package/dist/assets/ChargeCardRoutes-D4YlLVsI.js +0 -71
  118. package/dist/assets/ConnectionAuthScreen-DoG98aIj.js +0 -11
  119. package/dist/assets/CustomerOnboardingAuthScreen-sNk7vsur.js +0 -1
  120. package/dist/assets/DashboardRoutes-mW-tjMuc.js +0 -20
  121. package/dist/assets/ExpenseAutomationRoutes-DOepnh8G.js +0 -38
  122. package/dist/assets/InvoicingRoutes-BNkUMYuP.js +0 -2
  123. package/dist/assets/MobileAppDrawer-CHFdUHPo.js +0 -1
  124. package/dist/assets/NotFoundScreen-BPIsWBDH.js +0 -1
  125. package/dist/assets/PandLWithForecastRoutes-gJp3CGBo.js +0 -1
  126. package/dist/assets/PerformanceRoutes-DE0kFKjY.js +0 -1
  127. package/dist/assets/ReimbursementRoutes-ChwPWyQv.js +0 -68
  128. package/dist/assets/ReportsRoutes-CYsPWlxq.js +0 -1
  129. package/dist/assets/RewardsRoutes-C-TWFvBa.js +0 -1
  130. package/dist/assets/SignInScreen-3WOvV3S5.js +0 -1
  131. package/dist/assets/SignOutScreen-CKL0FwKr.js +0 -9
  132. package/dist/assets/TransactionDetailRoutes-D6Gttu9Z.js +0 -1
  133. package/dist/assets/TransactionDetailScreen-CN2_Ei-4.js +0 -5
  134. package/dist/assets/TransactionListRoutes-BBUdWZ4f.js +0 -1
  135. package/dist/assets/TreasuryRoutes-BqcgWSjx.js +0 -37
  136. package/dist/assets/ZeniAccountRoutes-CBtuSj8X.js +0 -57
  137. package/dist/assets/useAskAiCfoHostNavButtonProps-BZHyrLWc.js +0 -1
  138. package/dist/assets/useTaskManagerAccess-C6qhVozS.js +0 -1
  139. package/dist/assets/withTransactionSidePanel-iXTpLDC6.js +0 -25
@@ -1 +0,0 @@
1
- import{j as p}from"./liveblocks-BjcYyeQ6.js";import{g as J,h as Fe,u as Oe,i as De,j as d,l as Ae,n as Pe,o as ee}from"./core-B-8b0iz9.js";import{fF as q,Eb as R,UQ as Ee,l$ as le,ua as ce,u$ as D,lG as Le,lP as A,lH as P,kK as E,kB as L,kA as Ue,Dj as ie,v4 as Me,bq as Be,UR as ve,bn as xe,Ey as ze,US as Ge,UT as He,ci as g,Dc as Ye,UU as ae,UV as $e,UW as Ne,UX as qe,UY as Ze,UZ as Ke,U_ as Qe,U$ as We,V0 as Xe,V1 as Je,V2 as ea,V3 as aa,V4 as sa,V5 as j,V6 as U,V7 as M,V8 as B,V9 as v,Va as x,Vb as z,Vc as G,Vd as H,Ve as Y,ei as ta,Ec as oa,D$ as se,E0 as te,Ei as na,E4 as oe,Eo as ra,Vf as la,Vg as ca,Vh as ia,Vi as da,Vj as pa,Vk as _a,Vl as fa,Vm as ma,Vn as ua,Vo as ba,d_ as ha,dZ as ya}from"./zeni-epic-state-95zxmizy.js";import{ao as wa,ap as Ca,aq as Sa,a as ga,a2 as Ia,o as de,S as $,z as pe,ar as Ra,K as Ta,d as ja,as as ka,at as Va,a9 as Fa,k as N,V as Oa,x as Da,p as _e,au as Aa,av as Pa,aw as Ea}from"./index-Bg2deWZq.js";import"./mui-C33Oegsm.js";import La from"./NotFoundScreen-BPIsWBDH.js";import{F as Ua}from"./FeaturePreviewScreen-DWBL39rh.js";import{a as u}from"./sentry-DZ9rNYfw.js";import{u as Ma}from"./useInitialThreadRequest-C3Htu0iZ.js";import{t as ne,a as re,b as Ba}from"./routePaths-Cz0AF8Dx.js";import{M as va}from"./MobileAppDrawer-CHFdUHPo.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.js";import"./InboxNotificationsProvider-B4UF_uUg.js";import"./useTaskManagerAccess-C6qhVozS.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]="1484741a-651a-438f-9778-c9dac16f6ee7",e._sentryDebugIdIdentifier="sentry-dbid-1484741a-651a-438f-9778-c9dac16f6ee7")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:N,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(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(oa({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=ta(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 f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(U({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(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e($e({projectsToFilterOut:a})):I(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),m=Pa(_),a=Fe(),s=Oe(),t=J(),{tenantEmailDomain:r}=De(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l($.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:K}=l($.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const V=d((n=>q(n))),me=V.masterTOSInfo?.isMasterTOSAccepted??!1,ue=V.company?.companyInfo.firstMonthOfFY??1,be=Ma(K?V?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Ue(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Le(h.timeframe))}}),[c,F,O,b,T,S]);const Q=Ta(),Ce=Q?.loggedInUserRole!=null&&Be(Q?.loggedInUserRole)!==!0,[Se,ge]=u.useState(!1),W=n=>{ge(n)},Ie=ja(),Re=ka();return(function(n){const{isDataReady:Te}=n,{pathname:je}=J(),X=wa(je??"")==="reports",ke=Ca(Te),Ve=u.useMemo((()=>X?xa:void 0),[X]);Sa({canFetchSuggestedQuestions:ke,pageContexts:Ve})})({isDataReady:C==="Completed"}),Va({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Fa,{analytics:N,onLoad:n=>n.trackPageLoaded(Oa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:F,analytics:N,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Da({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:K,initialOpenThreadRequest:be})]})}const k=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o($.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ua,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-BjcYyeQ6.js";import{z as b,a9 as N,k as p,V as k,e3 as D,o as E,S as I}from"./index-Bg2deWZq.js";import"./mui-C33Oegsm.js";import g from"./NotFoundScreen-BPIsWBDH.js";import{a as c}from"./sentry-DZ9rNYfw.js";import{u as C,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-B-8b0iz9.js";import{fF as V,a1$ as w,a20 as d,DS as _,p$ as P,a21 as $,DQ as z}from"./zeni-epic-state-95zxmizy.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.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]="432fbc7a-7f55-4762-a186-0b99b97aff69",e._sentryDebugIdIdentifier="sentry-dbid-432fbc7a-7f55-4762-a186-0b99b97aff69")}catch{}})();const G=T((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(d()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),p.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e($({localData:s}))},onSubmitSuccess:()=>{e(d())},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}}))(D),Q=()=>{const e=C(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>V(o))),l=F(),j=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),x=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(d()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:p,onLoad:o=>(v=>v.trackPageLoaded(k.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:j,currentTenant:r,companyName:S,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=E(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(Q,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1 +0,0 @@
1
- import{j as u}from"./liveblocks-BjcYyeQ6.js";import{a as f,R as T,q as A}from"./sentry-DZ9rNYfw.js";import{u as z,h as D,j as c,g as j,N as F,l as M}from"./core-B-8b0iz9.js";import{u as P,z as s,E as O,k as w,G as _,U as N,V as B,W as V,Y as $,Z as W,_ as v}from"./index-Bg2deWZq.js";import{fF as Z,TZ as q,Uh as J,gi as R,gk as G,Um as H,gU as Y,dj as K,Un as y,Uo as Q,Up as X,b$ as U}from"./zeni-epic-state-95zxmizy.js";import"./mui-C33Oegsm.js";import{u as ee}from"./useDeviceId-gFU5q5zf.js";import{f as te}from"./analyticsHelper-Bi6R9Hrj.js";import{t as ne}from"./getLocaleForTenant-BYXijL7f.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.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]="36c1ebcf-7cc5-4e94-a464-6332da20a70b",t._sentryDebugIdIdentifier="sentry-dbid-36c1ebcf-7cc5-4e94-a464-6332da20a70b")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(l),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(y())}}}))(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),L=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>Z(e))),I=c((e=>q(e))),m=j(),E=O().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Y().then((()=>{const e=$();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,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 u.jsx(F,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?u.jsx(V,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-BjcYyeQ6.js";import{a as i}from"./sentry-DZ9rNYfw.js";import{u as l,g as c,N as u}from"./core-B-8b0iz9.js";import{z as n,k as a,V as m,a8 as p}from"./index-Bg2deWZq.js";import{gX as g,UD as b}from"./zeni-epic-state-95zxmizy.js";import{n as y}from"./mui-C33Oegsm.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.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]="f4b76bd2-89db-4a73-8e75-e35ebd015b8f",e._sentryDebugIdIdentifier="sentry-dbid-f4b76bd2-89db-4a73-8e75-e35ebd015b8f")}catch{}})();function N(){const e=l(),t=c(),r=i.useRef(!1),d=n.isSignedIn(),o=t.state?.message==="logout"||d;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
2
- 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{N as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-BjcYyeQ6.js";import i from"./NotFoundScreen-BPIsWBDH.js";import{T as r}from"./TransactionDetailScreen-CN2_Ei-4.js";import"./sentry-DZ9rNYfw.js";import{n as a,o as e}from"./core-B-8b0iz9.js";import"./zeni-epic-state-95zxmizy.js";import"./recharts-DkYxIsLi.js";import"./index-Bg2deWZq.js";import"./mui-C33Oegsm.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.js";import"./useAskAiCfoHostNavButtonProps-BZHyrLWc.js";import"./decodeURIComponentSafe-hAviH84T.js";import"./useInitialThreadRequest-C3Htu0iZ.js";import"./routePaths-Cz0AF8Dx.js";import"./expenseAutomationHelper-BzOPc0En.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1,5 +0,0 @@
1
- import{j as R}from"./liveblocks-BjcYyeQ6.js";import{a as i}from"./sentry-DZ9rNYfw.js";import{u as j,k as st,j as g,s as ge,g as De,h as Ce,i as Ae,N as ct,l as it}from"./core-B-8b0iz9.js";import{pv as Ie,fF as ee,gV as rt,UK as lt,oB as dt,ob as ut,DF as se,WY as mt,gh as pt,bn as ft,df as Re,bq as _e,sS as H,VQ as Y,WZ as we,W_ as le,We as Pe,ma as Fe,W$ as Ue,Wj as de,Wk as ue,m$ as xe,Sf as me,WU as $,m4 as Ve,m2 as Le,me as ht,pi as St,X0 as yt,X1 as Tt,Dw as Q,m9 as Be,RA as Oe,cm as bt,dl as gt,X2 as It,WT as vt,X3 as Et,X4 as kt,X5 as Dt,X6 as Ct,Ds as At,X7 as Rt,X8 as _t,X9 as wt,Xa as Pt,Xb as Ft,md as Ut,Xc as xt,Xd as Vt,WV as Lt,Xe as Bt,Xf as Ot,Xg as Nt,Ru as zt,Rk as jt,RJ as Mt,mf as Wt,Sg as ve,pn as Xt}from"./zeni-epic-state-95zxmizy.js";import{o as K,S as _,k as G,b3 as $t,z as Ne,E as Gt,a2 as qt,b4 as Ht,ac as Yt,a5 as ce,K as Kt,b5 as Jt,p as ie,at as Qt,b6 as Zt,b7 as en,b8 as tn,af as nn,aw as oe}from"./index-Bg2deWZq.js";import{n as an,S as on,D as sn}from"./mui-C33Oegsm.js";import{u as cn}from"./useAskAiCfoHostNavButtonProps-BZHyrLWc.js";import{d as ze}from"./decodeURIComponentSafe-hAviH84T.js";import{u as rn}from"./useInitialThreadRequest-C3Htu0iZ.js";import{h as je,c as Me,g as ln,e as dn}from"./routePaths-Cz0AF8Dx.js";import{u as un}from"./expenseAutomationHelper-BzOPc0En.js";import{A as mn}from"./utils-D3rZq_G4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="56a01da2-3440-4838-983f-9b53b0426146",t._sentryDebugIdIdentifier="sentry-dbid-56a01da2-3440-4838-983f-9b53b0426146")}catch{}})();function pn(t=!0){const e=j(),o=st(),{useFeatureGate:n}=K(),{isFeatureEnabled:a}=n(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function fn(t,e){const o=(function(){const d=j(),[T,S]=i.useState(!1),[D,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:y}=K(),{configValue:I,isDynamicConfigLoading:h}=y("transaction_categorization_config"),b=!h&&I?.capitalization_enabled===!0,k=g((r=>ee(r))),C=k.companyId,w=g((r=>rt(r.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:P,dismissedAccounts:F}=g((r=>{const v=r.tenantState.currentTenantId,E=v!=null?r.tenantState.tenantsById[v]:void 0;return{capitalizableAccounts:E?.capitalizableAccounts??null,capitalizableAccountOverrides:E?.capitalizableAccountOverrides??null,dismissedAccounts:E?.capitalizationOnboardingDismissedAccounts??null}}),ge),V=i.useRef(A);V.current=A;const U=i.useRef(P);U.current=P;const L=i.useRef(F);L.current=F;const B=g((r=>lt(r.accountState)),ge),q=i.useMemo((()=>{const r={};for(const v of B)v.accountId!=null&&v.accountName!=null&&(r[v.accountId]=v.accountName);return r}),[B]),M=l!=null?q[l]??null:null,O=i.useCallback((r=>{if(!b)return;const v=V.current;if(v==null)return;const E=v.accounts??[],X=new Set(r),J=U.current??{},te=L.current;for(const N of E)if(X.has(N.accountId)&&J[N.accountId]==null&&te?.[N.accountId]==null)return p(N.classificationType),u(N.accountId),void S(!0)}),[b]),W=i.useCallback(((r,v)=>{d(dt(C,r,v,!0)),S(!1),p(null),u(null)}),[d,C]),f=i.useCallback((()=>{l!=null&&(d(ut(C,l)),S(!1),p(null),u(null))}),[d,C,l]);return{showPopup:T&&b,popupType:D,popupAccountId:l,popupAccountName:M,currencySymbol:w,checkAndShowPopup:O,handleSubmit:W,handleDismiss:f}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const z=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,Z=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),We=(t,e,o)=>{G.trackRecommendationFeedbackRetracted(Z(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Bn=(t,e)=>{const o=new Set(e.map(String));z.forEach(((n,a)=>{o.has(n.transactionId)&&(z.delete(a),We(t,n.feedback,n.transactionId))}))},On=t=>{const e=new Set(t.map(String));z.forEach(((o,n)=>{e.has(o.transactionId)&&z.delete(n)}))};function hn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(mt),{isEnabled:d,fallbackTransactionId:T}=t,S=i.useCallback((u=>u.transactionId??T??""),[T]),D=i.useCallback((u=>{if(!d)return;const y=S(u);if(y==="")return;if(u.outcome!=="accepted")return void n(u);((h,b,k,C)=>{const w=Ee(b,k,C),A=z.get(w);return A!=null&&(z.delete(w),We(h,A.feedback,A.transactionId),!0)})(e,y,u.lineId,u.dimension)||(((h,b)=>{G.trackRecommendationAccepted(Z(h,b))})(u,y),e(se(re(u,y,{}))))}),[d,S,e]),p=i.useCallback((u=>{if(o==null)return;const y=S(o);((I,h,b)=>{G.trackRecommendationFeedbackSubmitted({...Z(I,h),feedbackReason:b})})(o,y,u),e(se(re(o,y,{reasonText:u,skipped:!1}))),((I,h)=>{z.set(Ee(h,I.lineId,I.dimension),{feedback:I,transactionId:h})})(o,y),s(!0)}),[o,S,e]),l=i.useCallback((()=>{var u,y;o!=null&&(u=o,y=S(o),G.trackRecommendationFeedbackSkipped(Z(u,y)),s(!1),n(null))}),[o,S]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(pt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:D,popup:o!=null?R.jsx($t,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=K(),{isFeatureEnabled:o}=e(_.isChainOfThoughtEnabled);return i.useMemo((()=>ft(t)&&o),[t,o])};function Xe(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Nn(t,e){const o=j(),{useFeatureGate:n}=K(),a=g((f=>ee(f))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),d=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:T}=n(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:S}=n(_.isExpenseAutomationEnabled),D=pe(),p=i.useMemo((()=>({id:t,type:H(e)})),[t,e]),l=g((f=>Y(f,p))),u=l?.transactionDetailUpdateStatus?.fetchState,y=l?.transactionDetailLocalData?.lineItemById,I=g((f=>{const r=Y(f,p)?.transactionDetailLocalData.vendorUpdates?.id;return r==null?"Not-Started":f.transactionVendorViewState.editVendorStateById[r]?.saveStatus.fetchState??"Not-Started"})),h=i.useMemo((()=>l?.fetchState==="Completed"?Xe(l?.transaction):void 0),[l?.fetchState,l?.transaction]),b=g((f=>{if(h!=null)return we(f.customerIncomeState,f.vendorExpenseState,f.trendState,h,"month")})),k=g((f=>le(f))),C=g((f=>{if(h!=null)return Pe(f.trendWithTransactionsState,h,"TransactionDetail")})),w=a.company?.companyInfo.firstMonthOfFY??1,A=g((f=>Fe(f.accountState,f.accountListState,"accountList"))),[P,F]=i.useState(!1),[V,U]=i.useState(!1),[L,B]=i.useState(!1);i.useEffect((()=>{F(!1),U(!1),B(!1)}),[t,e]);const q=i.useCallback((()=>{F(!1),U(!1)}),[]),[M,O]=i.useState(!1),W=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{L||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),B(!0)),h!=null&&(!s||c&&d===!1)&&(P?V||b==null||(U(!0),o(me(h,"TransactionDetail",{timeframe:"month",timePeriod:W??b}))):(o(de()),o(ue()),F(!0),o(xe(h))))}),[o,L,l?.fetchState,l?.transaction,h,s,c,d,P,V,b,W]),i.useEffect((()=>{k.newVendorState?.vendorDetailLocalData?.vendorName!=null?O(!0):O(!1)}),[k.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o($("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:S,isChainOfThoughtEnabled:D,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:y,vendorSaveStatus:I,tranEntity:h,defaultTrendTransactionTimePeriod:b,vendorViewDetails:k,uiState:C,firstMonthOfFY:w,uncategorizedAccounts:A,resetTrendIsFetchedStates:q,isCreateVendorDrawerOpen:M,setIsCreateVendorDrawerOpen:O}}const Sn={overlayWidth:new Yt(100,100,58)},yn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=Gt(),c=qt(),d=j(),T=g((p=>le(p))),S=()=>{n()},D={vendorDetailView:a??T,onSaveSuccess:()=>{d(Le()),d(ht("Not-Started")),o()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:p=>{d(Ve({vendorId:void 0,localData:p}))}};return R.jsx(sn,{anchor:"right",open:t,PaperProps:{style:{width:Sn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:R.jsx(Tn,{onClick:p=>p.stopPropagation(),children:R.jsx(Ht,{...D})})})},Tn=an(on)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `;function bn(t,e){t(St({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:H(e.transactionType),sourceTransactionType:H(e.sourceTransactionType)}))}function gn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((T=>T.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:T,newTransactionId:S}=c;t.id===T.id&&t.type===T.type&&(d.current=c,n?.(),a(o(S),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const In=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=j(),c=pe(),{transactionTypeEncoded:d,transactionId:T}=Ae(),S=e??T,D=o??ze(d??"");let p;je(S,D)&&(p={id:S,type:H(D)});const l=p!=null?g((y=>Y(y,p))):void 0,u=()=>{const y=ce(n.state?.pathnameStackToGoBack),I=y.poppedPathname??((h=2)=>{let b="../";for(let k=0;k<h;k++)b=`${b}../`;return b})(1);a(I,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=l?.transactionDetailLocalData.vendorUpdates,I={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},h={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((b=>b.id))??[]};s(Q({entity:I,amount:l?.transaction?.amount.amount,transactionDetails:h,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(yt({transactionId:p})),s(Le()),s(Tt()),t(!0),u()}}},vn=it((function(t,e){const o=Y(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=It(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,T=vt(t,"common"),S=ee(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:S.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${nn.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:G,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:T},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t($("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Me(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ve(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):Wt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t($("common"))},onUploadAttachmentAttachment:n=>{t(Mt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(jt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(zt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Nt(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,T)=>{t(Ot(n,a,s,c,d,T))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Bt({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=mn(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${dn(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Lt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t($("common"))},onCancelAutoComplete:()=>{t($("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(Q({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(Vt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(xt(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Ut({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(Q({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(Ve({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const T=e.transaction,S=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(T.type??"")}/${T.id}/vendor/create`,{state:{pathnameStackToGoBack:S}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(Ft({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(Q({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(Pt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(wt(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(_t(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(Rt({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(At(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Ct(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>bn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(Dt(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(Et(a,n))}}}))(tn);function zn(){const t=Ce(),e=j(),o=De(),{useFeatureGate:n}=K(),a=Kt(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&Re(s.userRole),T=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:S}=n(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:D}=n(_.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[y,I]=i.useState(!1),h=ze(l??""),b=je(u,h),k=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:w}=n(_.isRecommendationFeedbackEnabled),A=Jt(),{onRecommendationSelection:P,popup:F}=hn({isEnabled:w,fallbackTransactionId:u}),V=i.useMemo((()=>({...A,onRecommendationSelection:P})),[A,P]),{isFeatureEnabled:U}=n(_.isTransactionCommentingEnabled),{isFeatureEnabled:L}=n(_.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(_.isProjectsTransactionsEnabled),{isFeatureEnabled:q}=n(_.isTransactionSplitEnabled),M=a?.currentTenant?.companyId,O=a?.currentTenant?.companyName,W=rn(M),f=i.useMemo((()=>{if(b)return{id:u,type:H(h)}}),[b,u,h]),r=f!=null?g((m=>Y(m,f))):void 0,v=r?.transactionDetailLocalData.vendorUpdates?.id!=null?k.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",E=r?.fetchState==="Completed"?Xe(r?.transaction):void 0,X=g((m=>E!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,E,"month"):void 0)),J=g((m=>le(m))),te=g((m=>E!=null?Pe(m.trendWithTransactionsState,E,"TransactionDetail"):void 0)),N=s.company?.companyInfo.firstMonthOfFY??1,Ge=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[qe,fe]=i.useState(!1),[He,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Ke=i.useCallback((m=>Me(m,p??"")+o.search),[p,o.search]),Je=i.useCallback((()=>{Se(!1)}),[]);gn({currentTransactionId:f,enabled:p!=null&&p!=="",buildPath:Ke,beforeNavigate:Je,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=un();pn();const ne=i.useRef(r?.transaction);ne.current=r?.transaction;const Qe=r?.transactionDetailUpdateStatus?.fetchState,x=fn(Qe,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{f!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(f,!1)),ye())}),[e,f,r?.fetchState]),i.useEffect((()=>{if(f!=null&&r?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[f,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||r==null||r.transaction==null||(e(Ue({id:r.transaction.id,type:r.transaction.type})),Se(!0));const m=o.state?.searchContext;E==null&&r?.fetchState==="Completed"&&ke(r?.transaction,m),E!=null&&(!c||d&&T===!1)&&(qe?He||X==null||(he(!0),e(me(E,"TransactionDetail",{timeframe:"month",timePeriod:te?.selectedPeriod?.timePeriod??X}))):(e(de()),e(ue()),ke(r?.transaction,m),fe(!0),e(xe(E))))}),[r?.fetchState,r?.transaction,X,c]),i.useEffect((()=>{J.newVendorState?.vendorDetailLocalData?.vendorName!=null?I(!0):I(!1)}),[J.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e($("common"))}),[]);const Ze=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}=In({closeDrawerHandler:m=>{I(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:at,onAskAiCfoClick:ot}=cn({mobileExploreReferrer:"Transaction Details"});return Qt({isDataReady:r?.fetchState==="Completed"}),b?R.jsxs(R.Fragment,{children:[be!=null&&y&&R.jsx(yn,{isOpen:y,transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}),R.jsx(Zt,{toolkit:V,children:R.jsx(vn,{hideDeleteAttachment:!0,firstMonthOfFY:N,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:f,entity:E,isCOTEnabled:C,defaultTrendTransactionTimePeriod:X,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:Ge,vendorSaveStatus:v,isVendorBulkUpdateOnTransactionEnabled:S,isCreateTransferEntryFromExpenseEnabled:L,isExpenseAutomationEnabled:D,isAiCfoAccessEnabled:at,onAskAiCfoClick:ot,isTransactionCommentingEnabled:U,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:q,companyId:M,companyName:O,initialOpenThreadRequest:W})}),F,x.showPopup&&x.popupType!=null&&R.jsx(en,{popupType:x.popupType,currencySymbol:x.currencySymbol,accountId:x.popupAccountId??"",accountName:x.popupAccountName??"",onSubmit:x.handleSubmit,onDismiss:x.handleDismiss})]}):R.jsx(ct,{to:$e(Ze.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ke=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=En(t),a=kn(t);G.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},En=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.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 a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},kn=t=>bt(t)===!0?t.customer?.name??"":gt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{yn as C,zn as T,hn as a,pn as b,fn as c,In as d,vn as e,gn as f,pe as g,bn as h,On as i,ke as l,Bn as r,Nn as u};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BjcYyeQ6.js";import{h as K,g as U,u as Z,i as X,j as g,N as q,l as H,n as Me,o as C}from"./core-B-8b0iz9.js";import{fF as Q,ua as ee,lf as p,eE as te,S6 as Se,br as pe,$K as Be,l$ as ae,Wg as ne,$L as fe,$M as Le,bE as k,S2 as he,$N as Fe,$O as Te,$P as Oe,S5 as ge,$Q as $e,$R as De,$S as Ge,$T as Ie,$U as ze,$V as we,$W as ye,Ti as Re}from"./zeni-epic-state-95zxmizy.js";import{o as ce,S as J,k as F,G as ke,de as oe,p as w,a5 as se,ar as _e,Q as Ve}from"./index-Bg2deWZq.js";import"./mui-C33Oegsm.js";import{a as y}from"./sentry-DZ9rNYfw.js";import{w as ie}from"./withTransactionSidePanel-iXTpLDC6.js";import{p as re,c as de}from"./routePaths-Cz0AF8Dx.js";import{B as Ne}from"./utils-D3rZq_G4.js";import{d as j}from"./decodeURIComponentSafe-hAviH84T.js";import{Z as Je}from"./ZeniAccountStatementScreen-CcOG7C5Z.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./useAskAiCfoHostNavButtonProps-BZHyrLWc.js";import"./TransactionDetailScreen-CN2_Ei-4.js";import"./useInitialThreadRequest-C3Htu0iZ.js";import"./expenseAutomationHelper-BzOPc0En.js";import"./stripSplatSuffix-Te2Zqy4u.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]="aabf1800-f1ed-4031-a64a-787a2a7bd7dc",a._sentryDebugIdIdentifier="sentry-dbid-aabf1800-f1ed-4031-a64a-787a2a7bd7dc")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ne(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},qe=H((function(a,e){const t=Be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=N(e.selectedAccount.tranListType),d=Ke(t,n,c,o,e.bookCloseDate);F.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Se(o,p(d),!1,o==="missingReceipts"?Ye():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=K(),t=U(),n=Z(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=X(),{accountType:Y,title:b,subTitle:A}=Qe(o),f="month",T=g((l=>Q(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:h}=S(J.isProjectsTransactionsEnabled),I=g((l=>ee(l)))&&h,{dataAvailable:x,initialTimeframeTick:O}=We(o,v,T.bookCloseDate),[P,$]=y.useState(!1),[E,G]=y.useState(void 0),u=y.useMemo((()=>{const l=p(O);return{tranListType:o,accountType:te(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){$(!0),F.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Se(l,u.period,!0,l==="missingReceipts"?Ye():void 0))}}),[P,u,n]);let M=u;return u!=null&&E!=null&&(M={...u,period:E}),c==null||M==null?s.jsx(q,{to:"../"}):s.jsx(qe,{firstMonthOfFY:v,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:M,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>G(l),...a})})),Qe=a=>{let e="",t="";const n=ke.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},We=(a,e,t)=>{const n=pe();let c=pe().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ke=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ze=H((function(a,e){const t=Fe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Xe=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=Z(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Le(r.transactionListState,h,S,I))),[P,$]=y.useState(!1),[E,G]=y.useState(void 0),u=g((r=>Q(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),z=g((r=>ee(r)))&&m;let i;const L=He(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=et(O?.dateRange,r);i={accountId:h,accountType:te(S),classId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||($(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(Ze,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>G(r),...e}):s.jsx(q,{to:be(R.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=H((function(a,e){const t=$e(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=Z(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Oe(r.transactionListState,h,S,I))),[P,$]=y.useState(!1),[E,G]=y.useState(void 0),u=g((r=>Q(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),z=g((r=>ee(r)))&&m;let i;const L=nt(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=ct(O?.dateRange,r);i={accountId:h,accountType:te(S),projectId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||($(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>G(r),...e}):s.jsx(q,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=H((function(a,e){const t=ze(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=Z(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=X(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(v!=null&&v==="exclude_subaccounts"),O=g((D=>Ge(D.transactionListState,h,S))),[P,$]=y.useState(!1),[E,G]=y.useState(void 0),u=g((D=>Q(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const z=st(S,h,b,A,f,I);if(z){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(O?.dateRange,D);m={accountId:h,accountType:te(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:L}=ce(),{isFeatureEnabled:B}=L(J.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),W=new URLSearchParams(xe??"");W.set("view","full"),W.set("thread_id",le),W.set("entity_type",D.entityType);const Ce=w(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${W.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=L(J.isProjectsTransactionsEnabled),_=g((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=_e();y.useEffect((()=>{!P&&m!=null&&ue&&($(!0),F.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const Ee=[d,Y,b,A,f,T].filter((D=>D!=null));return z&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:_,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>G(D),...e}):s.jsx(q,{to:Pe(Ee.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Bt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>Q(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(Je,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/missing-receipts/*",element:t?s.jsx(q,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(C,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Xe,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Bt as default};
@@ -1,37 +0,0 @@
1
- import{j as e}from"./liveblocks-BjcYyeQ6.js";import{h as L,g as F,u as U,i as M,j as y,N as D,l as V,n as Te,o as k}from"./core-B-8b0iz9.js";import{cv as N,fF as v,Zj as P,Ow as ae,Od as H,Oe as ne,Zl as Ie,Oz as we,Zh as Ce,Zi as se,Zx as ke,MA as je,Cd as Ae,Zn as be,OG as Ee,Zk as re,dd as q,GK as oe,dZ as ve,d_ as De,$H as Le,$I as Fe,Of as Ue,$J as Pe,Og as Be,Op as Oe,bq as Re,bJ as Me,cG as Ve,bK as Ne,cu as _e,bt as Ze,Ui as ze,ct as Ge}from"./zeni-epic-state-95zxmizy.js";import{K as _,j as $e,z as E,a9 as Z,k as A,d7 as He,d8 as qe,d9 as $,a2 as K,E as Ke,ar as Je,at as We,o as ie,S as O,ac as Qe,a8 as Xe,da as Ye,af as J,p as et,db as tt,a5 as W,dc as at,aj as nt,a0 as X,dd as st,f as rt}from"./index-Bg2deWZq.js";import{D as ot,n as R,S as it}from"./mui-C33Oegsm.js";import ct from"./NotFoundScreen-BPIsWBDH.js";import{S as Y}from"./SetupPagesScreen-BlUoKvnc.js";import{a as p}from"./sentry-DZ9rNYfw.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-BZHyrLWc.js";import{u as ut}from"./useInitialThreadRequest-C3Htu0iZ.js";import{M as ce}from"./MobileAppDrawer-CHFdUHPo.js";import{F as dt}from"./FeaturePreviewScreen-DWBL39rh.js";import{a as ee}from"./analyticsHelper-Bi6R9Hrj.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.js";import"./BusinessVerificationPageScreen-DjqyigwM.js";import"./routePaths-Cz0AF8Dx.js";import"./InboxNotificationsProvider-B4UF_uUg.js";import"./useTaskManagerAccess-C6qhVozS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="0907433a-ce25-49b6-a9cd-12e49cdaa456",t._sentryDebugIdIdentifier="sentry-dbid-0907433a-ce25-49b6-a9cd-12e49cdaa456")}catch{}})();const pt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(He);function mt(){const t=L(),a=F(),n=U(),{tenantEmailDomain:o}=M(),i=_(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=$e(r),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((w=>P(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(H()))}),[l,I,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const B=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!B&&e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:B,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{$(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{$(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(qe),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=M(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>v(I))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>P(I,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(H()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{$(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=R.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: ${t=>t.theme.colors.grey4};
9
- `,St={overlayWidth:new Qe(100,100,48)},ht=V((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:P(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:o,location:i,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=xt(s):d==="statements"?c=Tt(s):d==="taxLetter"?c=It(s):d==="settings"&&(c=wt(s));const S=et(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(d,c)=>{t(Le({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Ye);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=F(),o=L(),i=U(),r=K(),m=Ke(),s=y((b=>v(b))),{tenantEmailDomain:d}=M(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[S,T]=p.useState(!1),l=y((b=>re(b))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=N(h?.loggedInUserRoleMap),I=q(h?.loggedInUserRoleMap),{areTenantIdsInSync:B}=Je();p.useEffect((()=>{u==="Not-Started"&&!S&&B&&(T(!0),i(oe(!0)))}),[S,i,u,B]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&o("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,o]);const w=()=>{o("..")},[le,ue]=p.useState(!1),Q=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});We({isDataReady:u==="Completed"});const{useFeatureGate:z}=ie(),{isFeatureEnabled:me}=z(O.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=z(O.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=z(O.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=ve(s),he=De(me,s);if(Se===!0&&he!==!0)return e.jsx(dt,{});if(C){const b=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(Z,{analytics:A,onLoad:()=>{}}):null,e.jsx(ot,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:A,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&I?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Xe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Ct=R(it)`
10
- display: flex;
11
- min-height: 100%;
12
- flex-direction: column;
13
- `,kt=R.div`
14
- display: flex;
15
- height: 100vh;
16
- width: 100%;
17
- flex: 1 1 auto;
18
- flex-direction: column;
19
- align-items: center;
20
- background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=L(),a=U(),n=K(),o=F(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Fe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(tt,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=W(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const At=R.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: ${t=>t.theme.colors.grey4};
29
- `;function bt(){const t=L(),a=K(),n=F(),o=U(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Pe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Be(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=W(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const Et=V((function(t,a){const{companyId:n}=a,o=P(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Oe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=F(),o=U(),{tenantEmailDomain:i}=M(),[r,m]=p.useState(!1),s=y((g=>v(g))),[d,c]=p.useState(!1),S=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||S?.fetchState!=="Not-Started"||T==null||(c(!0),o(H()))}),[S,o]);const T=E.getSignedInUserTenant(i)?.companyId??s.companyId,l=E.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=_(),C=N(f?.loggedInUserRoleMap),h=q(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||h)){if(n.state?.message==="activation"){const g=W(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return S?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{analytics:A,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(Et,{analytics:A,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=R.div`
30
- display: flex;
31
- width: 100%;
32
- height: 100%;
33
- flex-direction: row;
34
- justify-content: center;
35
- align-items: center;
36
- background-color: ${t=>t.theme.colors.grey5};
37
- `;function aa(){const t=F(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=q(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),c=Ve(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&_e(r?.loggedInUserRoleMap),l=o&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(O.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&Ze(r?.loggedInUserRoleMap),C=ze(r?.loggedInUserRoleMap),h=Ge(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(bt,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};
@@ -1,57 +0,0 @@
1
- import{j as e}from"./liveblocks-BjcYyeQ6.js";import{u as _,h as ae,g as W,i as N,j as D,l as te,N as ee,n as Fe,o as C}from"./core-B-8b0iz9.js";import{$m as $e,Lv as Ue,$n as ze,fF as R,GI as _e,$o as An,cu as ne,cv as Me,GC as kn,$p as Dn,$q as In,GF as Sn,GM as ge,Gz as Pn,Gw as bn,YX as le,$r as vn,P0 as jn,WT as En,P2 as Tn,mI as be,$s as Bn,uX as Ve,uL as Ze,mz as Ge,mC as ve,WU as je,WV as On,$t as Ln,mB as Rn,mY as Fn,mq as $n,kQ as Un,kP as zn,$u as _n,$v as he,OJ as Mn,$w as Vn,$x as Zn,Zb as ye,$y as Ee,$z as Gn,Pd as Hn,Zx as Wn,MA as He,Cd as We,$A as Nn,Pa as Yn,$B as Ne,da as xe,Ph as Ye,dZ as qe,d_ as Ce,Pf as qn,Mu as Kn,P7 as Jn,$C as Ke,$D as Je,OL as Xe,OV as Te,$E as Xn,Zo as Qn,Pi as ea,bq as na,bJ as aa,cG as ta,bK as oa,bt as sa,Ui as ia}from"./zeni-epic-state-95zxmizy.js";import{K as oe,o as Z,S as z,z as P,aw as we,E as F,a8 as de,cY as ra,a2 as V,ac as Y,a5 as Qe,j as ca,q as Be,k as B,cZ as la,af as Ae,c_ as da,a9 as ue,c$ as ua,V as ke,bj as H,d0 as pa,ar as ma,at as en,d1 as Oe,d2 as ga,p as ce,d3 as ha,aj as fa,d4 as ya,d5 as xa,f as Ca,H as wa}from"./index-Bg2deWZq.js";import{n as $,D as q,S as K}from"./mui-C33Oegsm.js";import Q from"./NotFoundScreen-BPIsWBDH.js";import{S as Le}from"./SetupPagesScreen-BlUoKvnc.js";import{F as nn}from"./FeaturePreviewScreen-DWBL39rh.js";import{a as m}from"./sentry-DZ9rNYfw.js";import{M as pe}from"./MobileAppDrawer-CHFdUHPo.js";import{A as Aa,D as ka,V as Da}from"./DomesticWireDetailScreen-Cs9T_IgO.js";import{A as Ia}from"./AddressScreen-DyDl-tRh.js";import{u as an}from"./useAskAiCfoHostNavButtonProps-BZHyrLWc.js";import{Z as Sa}from"./ZeniAccountStatementScreen-CcOG7C5Z.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.js";import"./BusinessVerificationPageScreen-DjqyigwM.js";import"./routePaths-Cz0AF8Dx.js";import"./analyticsHelper-Bi6R9Hrj.js";import"./InboxNotificationsProvider-B4UF_uUg.js";import"./useTaskManagerAccess-C6qhVozS.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="a36b5e9a-93d6-4c44-a12f-c7628a0cdef5",n._sentryDebugIdIdentifier="sentry-dbid-a36b5e9a-93d6-4c44-a12f-c7628a0cdef5")}catch{}})();const Pa=$.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: ${n=>n.theme.colors.grey4};
9
- `;function Re({isEditDrawerOpen:n}){const a=F(),[i,t]=m.useState(!1),{autoTransferRulePageProps:o,isLoading:r}=(function({isEditDrawerOpen:d=!1}={}){const c=_(),p=ae(),h=W(),{ruleId:f,tenantEmailDomain:s}=N(),l=oe(),{useFeatureGate:g}=Z(),y=D((u=>$e(u))),w=D((u=>Ue(u.depositAccountState,u.depositAccountListState))),I=D((u=>ze(u))),A=D((u=>R(u))),{isFeatureEnabled:b}=g(z.isTreasuryEnabled),x=y?.fetchState??"Not-Started",k=A?.companyId??(s==null?void 0:P.getSignedInUserTenant(s)?.companyId);m.useEffect((()=>{x==="Not-Started"&&k!=null&&c(_e(!0))}),[c,x,k]);const v=y?.fetchState!=="Completed";if(v)return{autoTransferRulePageProps:void 0,isLoading:v};const O=A?.company!=null&&An(A.company),j=!!(b&&O),E=ne(l?.loggedInUserRoleMap)||Me(l?.loggedInUserRoleMap),T=P.getSignedInUser(),L={userId:T?.userId??"",sessionId:T?.zeniSessionId??"",tenantId:A?.tenantId??""},S=!!h.state?.scrollToAddRule;return{isLoading:v,autoTransferRulePageProps:{autoTransferRuleView:y,companyName:A?.companyName??"",hasAdminLevelAccess:E,includeTreasuryOption:j,transferLimit:5e5,authParams:L,currentTenant:A,depositAccountListView:w,downloadAccountDetailEndPoint:`${we}/account_details`,editingRuleId:f,isEditDrawerOpen:d,scrollToAddRule:S,zeniAccountsConfigDetail:I,onBackClick:()=>p(".."),onCreateRule:()=>{c(bn())},onUpdateRule:u=>{c(ge(u))},onDeleteClick:u=>{c(Pn(u))},onPauseClick:u=>{c(ge(u,!0,!1))},onResumeClick:u=>{c(ge(u,!1,!0))},onActivityClick:(u,M)=>{c(Sn(u,M))},onUpdateRuleLocalData:u=>{c(In(u))},clearRuleLocalData:()=>{c(Dn())},onEditClick:u=>{p(`./${u}/edit`)},onEditDrawerClose:()=>{p("../../",{relative:"path"})},onReviewClick:()=>{c(kn())}}}})({isEditDrawerOpen:n});return r||o==null?e.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}}):e.jsxs(Pa,{children:[e.jsx(pe,{isAppContentDrawerOpen:i,handleDrawerToggle:d=>{t(d)}}),e.jsx(ra,{...o})]})}const ba={overlayWidth:new Y(100,100,58)},va=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:i})=>{const t=_(),o=F(),r=V();if(P.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(q,{onClose:()=>{i(!0),t(le())},anchor:"right",open:a,PaperProps:{style:{width:ba.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(ja,{onClick:d=>d.stopPropagation(),children:e.jsx(Aa,{vendorIdParam:n,accountContext:"express-pay"})})})},ja=$(K)`
10
- display: flex;
11
- min-height: 100%;
12
- flex-direction: column;
13
- `,Ea={overlayWidth:new Y(100,100,58)},Ta=({isDrawerOpen:n,closeDrawerHandler:a})=>{const i=_(),t=F(),o=V();if(P.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return e.jsx(q,{onClose:()=>{a(!0),i(le())},anchor:"right",open:n,PaperProps:{style:{width:Ea.overlayWidth.valuePercentage(o),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:t.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(Ba,{onClick:r=>r.stopPropagation(),children:e.jsx(Ia,{accountContext:"express-pay",addressTypeParam:"vendor_address"})})})},Ba=$(K)`
14
- display: flex;
15
- min-height: 100%;
16
- flex-direction: column;
17
- `,Oa={overlayWidth:new Y(100,100,58)},La=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:i})=>{const t=_(),o=F(),r=V();if(P.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(q,{onClose:()=>{i(!0),t(le())},anchor:"right",open:a,PaperProps:{style:{width:Oa.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(Ra,{onClick:d=>d.stopPropagation(),children:e.jsx(ka,{vendorIdParam:n,accountContext:"express-pay"})})})},Ra=$(K)`
18
- display: flex;
19
- min-height: 100%;
20
- flex-direction: column;
21
- `,Fa=$.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: ${n=>n.theme.colors.grey4};
29
- `,$a=te((function(n,a){const i=R(n),t=P.getSignedInUser(),o=i.tenantId,r={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:o??""},d=a.expressPayDetails,c=n.entityAutoCompleteState.autoCompleteText.common,p=En(n,"common");return{expressPayDetails:d,fileProps:{authParams:r,filesEndPoint:`${Ae.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:p},analytics:a.analytics}}),(function(n,a){const{navigate:i}=a;return{onSaveVendor:t=>{n(zn(t,void 0,void 0,!0))},saveVendorDetailLocalData:(t,o)=>{n(ve({vendorId:o,localData:t}))},saveExpressPayLocalData:t=>{n(Un({localData:t}))},onVendorSelected:t=>{t!=null&&n($n(t,!1))},updateSelectedVendorForCreate:t=>{n(Fn(t))},initializeVendorAddress:()=>{n(Rn())},resetVendorSaveStatus:t=>{n(Ln({vendorId:t}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(t,o)=>{t.trim().length>=2?n(On({searchString:t,entityType:o,searchOrigin:"common"})):t.trim().length===0&&n(je("common"))},onCancelAutoComplete:()=>{n(je("common"))}},chooseNewVendor:t=>{n(ve({localData:{vendorName:t}}))},onClickAddAccount:t=>{t.method.toLowerCase().indexOf("ach")!==-1?i("./add-ach",{relative:"path"}):t.method.toLowerCase().indexOf("wire")!==-1&&t.method.toLowerCase().indexOf("domestic")!==-1&&i("./add-wire",{relative:"path"})},updateFilesEntity:t=>{n(Ge({files:t}))},onDeleteFile:t=>{n(Ze(t))},onEditFileName:(t,o)=>{n(Ve(t,o.split(".")[0]))},onBackClick:t=>{t!=null&&n(be(t)),n(be()),n(Bn()),n(le()),i("../",{relative:"path"})},onSchedulePayment:()=>{n(Tn())}}}))(la);function ie({isAddACHDrawerOpen:n,isAddWireDrawerOpen:a,isAddAddressDrawerOpen:i}){const t=ae(),o=W(),r=_(),[d,c]=m.useState(!1),{tenantEmailDomain:p}=N(),h=oe(),f=D((u=>u.expressPayState.fetchState)),s=D((u=>R(u))),l=D((u=>vn(u))),g=l.expressPayLocalData?.vendorId,y=s.companyId??P.getSignedInUserTenant(p)?.companyId,[w,I]=m.useState(!1),[A,b]=m.useState(!1),[x,k]=m.useState(!1),v=Qe(o.state?.pathnameStackToGoBack),{poppedPathname:O}=v,j=O?.split("/"),E=j?.[j.length-1];m.useEffect((()=>{n===!0?I(!0):(I(!1),document.body.style.overflow="auto")}),[n]),m.useEffect((()=>{a===!0?b(!0):(b(!1),document.body.style.overflow="auto")}),[a]),m.useEffect((()=>{i===!0?k(!0):(k(!1),document.body.style.overflow="auto")}),[i]),m.useEffect((()=>{f==="Not-Started"&&r(jn(!0,!0))}),[f,r]);const T=ca(l.vendorViewDetails.bankAccountCreationState?.fetchState);if(m.useEffect((()=>{T==="In-Progress"&&l.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&S()}),[T,l.vendorViewDetails.bankAccountCreationState?.fetchState]),P.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const L=u=>{c(u)},S=()=>{I(!1),b(!1),t("../",{relative:"path"})};return e.jsxs(Fa,{children:[Be(o)?e.jsx(pe,{isAppContentDrawerOpen:d,handleDrawerToggle:L}):null,w===!0?e.jsx(va,{vendorId:g,closeDrawerHandler:S,isDrawerOpen:w}):null,A===!0?e.jsx(La,{vendorId:g,closeDrawerHandler:S,isDrawerOpen:A}):null,x===!0?e.jsx(Ta,{closeDrawerHandler:S,isDrawerOpen:x}):null,e.jsx(Da,{vendorId:g,isExpressPayPage:!0}),e.jsx($a,{navigate:t,location:o,companyId:y,accountId:E,analytics:B,currentTenant:s,vendorId:g,roleMap:h?.loggedInUserRoleMap,isSettings:Be(o),expressPayDetails:l,onClickMenuIcon:()=>{L(!0)}})]})}const Ua={overlayWidth:new Y(100,100,58)},za=({authParams:n,downloadAccountDetailEndPoint:a,isAccountInfoDrawerOpen:i,zeniBankAccountDetail:t,closeDrawerHandler:o})=>{const r=F(),d=V(),c=D((s=>ze(s))),p=D((s=>R(s)));if(P.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const h=()=>{o(!0)},f={depositAccount:t,onDismissClick:h,zeniAccountsConfigDetail:c,authParams:n,downloadAccountDetailEndPoint:a,currentTenant:p};return e.jsx(q,{anchor:"right",open:i,PaperProps:{style:{width:Ua.overlayWidth.valuePercentage(d),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:r.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>h(),children:e.jsx(_a,{onClick:s=>s.stopPropagation(),children:e.jsx(da,{...f})})})},_a=$(K)`
30
- display: flex;
31
- min-height: 100%;
32
- flex-direction: column;
33
- `,Ma={overlayWidth:new Y(100,100,58)},tn=({isCheckDepositDrawerOpen:n,closeDrawerHandler:a})=>{const i=F(),t=V(),o=_(),r=D((s=>R(s))),d=P.getSignedInUser(),c=r.tenantId,p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c??""};if(d==null)throw Error("Can't access check deposit page without signing in...");const h=D((s=>_n(s))),f={analytics:B,checkDeposit:h,filesEndPoint:`${Ae.fileMicroServiceBaseUrl}`,authParams:p,onSaveChangesToLocalStore:s=>{o(Vn(s))},updateFilesEntity:s=>{o(Ge({files:s}))},onAnotherTransferClick:()=>{o(he())},onDeleteFile:s=>{o(Ze(s))},onEditFileName:(s,l)=>{o(Ve(s,l.split(".")[0]))},onCheckDpositClick:()=>{o(Mn())},onDismissClick:()=>{a(!0),o(he())}};return e.jsxs(e.Fragment,{children:[e.jsx(ue,{analytics:B,onLoad:s=>(l=>l.trackPageLoaded(ke.Event.accountsDepositCheckFormViewed))(s)}),e.jsx(q,{anchor:"right",open:n,PaperProps:{style:{width:Ma.overlayWidth.valuePercentage(t),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(s,l)=>(l==="backdropClick"||l==="escapeKeyDown")&&(a(!0),void o(he())),children:e.jsx(Va,{onClick:s=>s.stopPropagation(),children:e.jsx(ua,{...f})})})]})},Va=$(K)`
34
- display: flex;
35
- min-height: 100%;
36
- flex-direction: column;
37
- `,Za={overlayWidth:new Y(100,100,58)},Ga=te((function(n,a){const i=a.currentTenant?.companyId;return{plaidConnectionDetails:Wn(n,i,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Ue(n.depositAccountState,n.depositAccountListState)}}),(function(n,a){return{onReviewClick:()=>n(Yn()),clearReviewTransferDetail:()=>n(Nn()),onFetchLinkTokenClick:i=>{n(We("external_account",i))},onEstablishConnectionClick:i=>{n(He(i,a.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}}))(pa),on=({isTransferDrawerOpen:n,authParams:a,downloadAccountDetailEndPoint:i,closeDrawerHandler:t,zeniAccountsConfig:o})=>{const r=D((x=>Zn(x))),d=D((x=>R(x))),c=F(),p=V(),h=_(),{accountId:f}=N(),[s,l]=m.useState("achTransfer"),[g,y]=m.useState(!1);if(P.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:w}=Z(),{configValue:I}=w(H.zeniAccountsConfig),A=ye(I),b=()=>{t(!0),h(Ee())};return m.useEffect((()=>{r.reviewTransferDetail.fetchState==="Completed"&&y(!0)}),[y,r.reviewTransferDetail.fetchState]),e.jsxs(e.Fragment,{children:[e.jsx(ue,{analytics:B,onLoad:x=>(k=>k.trackPageLoaded(ke.Event.zeniAccountsTransferFormViewed))(x)}),e.jsx(q,{onClose:()=>{(s==="achTransfer"&&g===!1||s==="achTransfer"&&g&&r.fetchState==="Completed")&&b()},anchor:"right",open:n,PaperProps:{style:{width:Za.overlayWidth.valuePercentage(p),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(Ha,{onClick:x=>x.stopPropagation(),children:e.jsx(Ga,{analytics:B,transferDetails:r,authParams:a,downloadAccountDetailEndPoint:i,onTransferClick:()=>{B.trackTransferBetweenAccountsFormClicked("Transfer",r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",r.transferDetailLocalData.transferFrom?.label,r.transferDetailLocalData.transferTo?.label,r.transferDetailLocalData.amount.amount,r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,r.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,r.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&r.transferDetailLocalData.transferTo?.accType==="depositAccount"&&o.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&r.transferDetailLocalData.amount.amount>o.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),h(Hn(f))},onDismissClick:b,onSaveChangesToLocalStore:x=>{h(Gn(x))},onAnotherTransferClick:()=>{y(!1),h(Ee())},currentTenant:d,zeniAccountsConfigDetail:o,currentDrawerContent:s,setCurrentDrawerContent:l,showReviewContent:g,setShowReviewContent:y,onBackClick:()=>{},maxInsuredAmount:A.maxInsuredAmount})})})]})},Ha=$(K)`
38
- display: flex;
39
- min-height: 100%;
40
- flex-direction: column;
41
- `,Wa=$.div`
42
- display: flex;
43
- min-height: 100%;
44
- width: 100%;
45
- flex: 1 1 auto;
46
- flex-direction: column;
47
- align-items: center;
48
- background-color: ${n=>n.theme.colors.grey4};
49
- `,Na=te((function(n,a){return{zeniAccountListView:Ne(n),isExpressPayEnabled:a.isExpressPayEnabled,analytics:a.analytics}}),(function(n,a){const{navigate:i,currentTenant:t,location:o,companyId:r,handleDrawerToggle:d,analytics:c,isBillPayEnabled:p,isDebitCardFeatureEnabled:h}=a,{tenantEmailDomain:f}=t;return{onZeniAccountClick:(s,l)=>{c.trackAccountsListPageClicked("Accounts Row Item Click",l,"active");const g=Ya(f,s),y=ce(o.state?.pathnameStackToGoBack,o.pathname);i(g,{state:{pathnameStackToGoBack:y}})},onSettingsClick:()=>{c.trackAccountsListPageClicked("Settings Icon"),i("setup")},onReloadTransactions:()=>{n(Ye(!1))},handleMoveMoneyOptionSelection:(s,l)=>{let g="page-not-found";s==="sendMoney"&&(g=ln(f)),s==="payBill"?g=sn(t,p,h):s==="transfer"?(g=rn(f),l!=null&&n(Ke(l))):s==="checkDeposit"&&(g=cn(f));const y=ce(o.state?.pathnameStackToGoBack,o.pathname);i(g,{state:{pathnameStackToGoBack:y}})},unlinkPaymentAccount:(s,l)=>{c.trackAccountsListPageClicked("Unlink Account",l),n(Jn(s))},onFetchLinkTokenClick:(s,l)=>{n(We("external_account",s,l))},onUpdatePaymentAccountStatus:(s,l,g)=>{n(Kn(s,l,"zeni_accounts","external_account",g))},onEstablishConnectionClick:s=>{n(He(s,r,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:s=>{n(qn(s))},onClickMenuIcon:()=>{d(!0)},onAutoTransferClick:s=>{const l="./auto-transfer";s?i(l,{state:{...o.state,scrollToAddRule:!0}}):i(l)}}}))(ga);function fe({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a}){const i=W(),t=ae(),o=_(),r=V(),{tenantEmailDomain:d}=N(),{useDynamicConfig:c,useFeatureGate:p}=Z(),h=F(),{configValue:f}=c(H.zeniAccountsConfig),{isFeatureEnabled:s}=p(z.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(z.isAutoTransferRuleEnabled),{isFeatureEnabled:g}=p(z.isCheckingCommentingEnabled),y=ye(f),w=D((U=>R(U))),I=w.companyId??P.getSignedInUserTenant(d)?.companyId,{configValue:A}=c(H.expressPayConfig),b=A.is_enable_all_tenants===!0||A.tenant_ids!=null&&A.tenant_ids.includes(w.tenantId),[x,k]=m.useState(!1),[v,O]=m.useState(!1),[j,E]=m.useState(!1),[T,L]=m.useState(!1),S=D((U=>Ne(U))),u=S.fetchState,M=D((U=>$e(U))),J=M?.fetchState??"Not-Started",me=!!w.companyZeniAccountInfo?.info?.isZeniAccountEnabled,se=oe(),G=!!w.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,X=ne(se?.loggedInUserRoleMap),dn=xe(se?.loggedInUserRoleMap),un=!!w.companyBillPayInfo?.info?.isBillPayEnabled,De=P.getSignedInUser(),pn={userId:De?.userId??"",sessionId:De?.zeniSessionId??"",tenantId:w.tenantId??""},mn=`${we}/account_details`,{areTenantIdsInSync:Ie}=ma();m.useEffect((()=>{!x&&Ie&&(k(!0),o(Ye(!1)))}),[x,o,u,Ie]),m.useEffect((()=>{!v&&J==="Not-Started"&&I&&(O(!0),o(_e(!0)))}),[v,J,I,o]),m.useEffect((()=>{n!=null&&n===!0?E(!0):(E(!1),document.body.style.overflow="auto")}),[n]),m.useEffect((()=>{L(a!=null&&a===!0)}),[a]);const Se=()=>{E(!1),t("..")},[gn,hn]=m.useState(!1),Pe=U=>{hn(U)},{isAiCfoAccessEnabled:fn,onAskAiCfoClick:yn}=an({mobileExploreReferrer:"Checking Accounts"});en({isDataReady:u==="Completed"});const xn=qe(w),Cn=Ce(s,w);return xn===!0&&Cn!==!0?e.jsx(nn,{}):me?e.jsxs(e.Fragment,{children:[S.fetchState==="Completed"&&j===!1&&T===!1?e.jsx(ue,{analytics:B,onLoad:U=>(wn=>{wn.trackAccountsListPageViewed(S.depositAccountsSelectorView.depositAccounts.length,S.externalAccountsSelectorView.paymentAccounts.length,Oe(S.summary?.totalBalance.available.amount??0),Oe(S.summary?.totalInterest.available.amount??0),S.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield)})(U)}):null,j===!0?e.jsx(on,{closeDrawerHandler:Se,isTransferDrawerOpen:j,zeniAccountsConfig:S.zeniAccountsConfig,authParams:pn,downloadAccountDetailEndPoint:mn}):null,T===!0?e.jsx(tn,{closeDrawerHandler:Se,isCheckDepositDrawerOpen:T}):null,e.jsxs(Wa,{windowSize:r,children:[e.jsx(pe,{isAppContentDrawerOpen:gn,handleDrawerToggle:Pe}),e.jsx(Na,{zeniBankListView:S,navigate:t,currentTenant:w,location:i,companyId:I,analytics:B,maxInsuredAmount:y.maxInsuredAmount,isExpressPayEnabled:b,isBillPayEnabled:un,isCheckingCommentingEnabled:g,isDebitCardFeatureEnabled:s,isAutoTransferRuleEnabled:l,handleDrawerToggle:Pe,isAiCfoAccessEnabled:fn,onAskAiCfoClick:yn})]})]}):G&&X?e.jsx(ee,{to:"../setup"}):w.companyZeniAccountInfo?.info&&!G&&dn?e.jsx(ee,{to:"../promo",state:i.state}):e.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}})}const sn=(n,a,i)=>{const t=Ce(i,n),{tenantEmailDomain:o}=n;return t===!0||a===!1?`/${o}/bills`:`/${o}/bill/new`},Ya=(n,a)=>`/${n}/checking/${a}`,rn=(n,a)=>a==null?`/${n}/checking/transfer`:`/${n}/checking/${a}/transfer`,cn=(n,a)=>a==null?`/${n}/checking/check-deposit`:`/${n}/checking/${a}/check-deposit`,ln=n=>`/${n}/checking/express-pay`,qa=$.div`
50
- display: flex;
51
- width: 100%;
52
- flex: 1 1 auto;
53
- flex-direction: column;
54
- align-items: center;
55
- min-height: 100vh;
56
- background-color: ${n=>n.theme.colors.grey4};
57
- `,Ka=te((function(n,a){const{currentTenant:i}=a,t=Je(n,a.accountId),o=P.getSignedInUser(),r=n.tenantState.currentTenantId,d={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:r??""},c=t.accountDetail?.id??"";return{currentTenantCompanyName:i.companyName??"",authParams:d,downloadEndPoint:`${Ae.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${c}`,zeniAccountDetail:t,isExpressPayEnabled:a.isExpressPayEnabled,fetchState:t.fetchState}}),(function(n,a){const{navigate:i,currentTenant:t,location:o,accountId:r}=a,{tenantEmailDomain:d}=t;return{handleMoveMoneyOptionSelection:(c,p)=>{let h="page-not-found";c==="sendMoney"?h=ln(d):c==="payBill"?h=sn(t,a.isBillPayEnabled,a.isDebitCardFeatureEnabled):c==="transfer"?(h=rn(d,r),p!=null&&n(Ke(p))):c==="checkDeposit"?(h=cn(d,r),p!=null&&n(Xn(p))):c==="accountStatement"&&(h=Xa(d,r));const f=ce(o.state?.pathnameStackToGoBack,o.pathname);i(h,{state:{pathnameStackToGoBack:f}})},onAccountDetailClick:()=>{const c=Ja(d,r),p=ce(o.state?.pathnameStackToGoBack,o.pathname);i(c,{state:{pathnameStackToGoBack:p}})},onEditNameClick:c=>{n(Te(r,"editName",c))},onReloadZeniAccountDetailPage:()=>{n(Xe(r,!1))},onCloseAccountClick:()=>{n(Te(r,"closeAccount",""))},onBackClick:()=>{i("../",{relative:"path"})}}}))(ha);function re({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a,isAccountInfoDrawerOpen:i}){const t=W(),o=ae(),r=_(),d=V(),{tenantEmailDomain:c,accountId:p}=N(),{useDynamicConfig:h}=Z(),{useFeatureGate:f}=Z(),{isFeatureEnabled:s}=f(z.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=f(z.isCheckingCommentingEnabled),g=D((X=>R(X))),{configValue:y}=h(H.expressPayConfig),w=y.is_enable_all_tenants===!0||y.tenant_ids!=null&&y.tenant_ids.includes(g.tenantId),I=!!g.companyBillPayInfo?.info?.isBillPayEnabled,A=P.getSignedInUser(),b=g.companyId??P.getSignedInUserTenant(c)?.companyId,x={userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:g.tenantId??""},k=`${we}/account_details`,[v,O]=m.useState(!1),[j,E]=m.useState(!1),[T,L]=m.useState(!1),[S,u]=m.useState(!1),M=D((X=>Je(X,p??""))),J=M.fetchState,{isAiCfoAccessEnabled:me,onAskAiCfoClick:se}=an({mobileExploreReferrer:"Checking Account Detail"});en({isDataReady:J==="Completed"}),m.useEffect((()=>{v||(r(Xe(p??"",!1)),O(!0))}),[v,r,J]),m.useEffect((()=>{u(i!=null&&i===!0)}),[i]),m.useEffect((()=>{n!=null&&n===!0?E(!0):(E(!1),document.body.style.overflow="auto")}),[n]),m.useEffect((()=>{L(a!=null&&a===!0)}),[a]);const G=()=>{u(!1),o("..")};return e.jsxs(e.Fragment,{children:[S===!0&&M.accountDetail!=null?e.jsx(za,{authParams:x,downloadAccountDetailEndPoint:k,closeDrawerHandler:G,isAccountInfoDrawerOpen:S,zeniBankAccountDetail:M.accountDetail}):null,j===!0?e.jsx(on,{closeDrawerHandler:G,isTransferDrawerOpen:j,zeniAccountsConfig:M.zeniAccountsConfig,authParams:x,downloadAccountDetailEndPoint:k}):null,T===!0?e.jsx(tn,{closeDrawerHandler:G,isCheckDepositDrawerOpen:T}):null,e.jsx(qa,{windowSize:d,children:e.jsx(Ka,{navigate:o,currentTenant:g,location:t,companyId:b,isDebitCardFeatureEnabled:s,accountId:p??"",isBillPayEnabled:I,isCheckingCommentingEnabled:l,isExpressPayEnabled:w,isAiCfoAccessEnabled:me,onAskAiCfoClick:se})})]})}const Ja=(n,a)=>`/${n}/checking/${a}/account-info`,Xa=(n,a)=>`/${n}/checking/${a}/statements`,Qa=te((function(n,a){const{companyId:i}=a;return{zeniAccountSetupView:Qn(n,i)}}),(function(n,a){const{navigate:i,companyId:t}=a;return{onSetupButtonClick:()=>{B.trackAccountsPromoPageClicked("Setup Accounts"),n(ea(t))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{i("../setup",{relative:"path"})}}}))(xa),et=()=>{const n=ae(),a=W(),{tenantEmailDomain:i}=N(),{useDynamicConfig:t}=Z(),o=fa(),r=F(),[d,c]=m.useState(!1),[p,h]=m.useState(!1),f=D((k=>R(k))),{configValue:s}=t(H.zeniAccountsConfig),l=ye(s);m.useEffect((()=>{p===!1&&a.state?.message==="activation"&&h(!0)}),[a.state]);const g=P.getSignedInUserTenant(i)?.companyId??f.companyId,y=P.getSignedInUser(),w=!!f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,I=k=>{c(k)};if(y==null)throw Error("Can't access Zeni account promo page without signing in...");const A=oe(),b=ne(A?.loggedInUserRoleMap),x=xe(A?.loggedInUserRoleMap);if(w&&b)return e.jsx(ee,{to:"../../checking/setup"});if(f.company?.companyZeniAccountInfo&&(!w&&b||x)){if(a.state?.message==="activation"){const k=Qe(a.state?.pathnameStackToGoBack);n(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:k.newStack}})}return e.jsxs(e.Fragment,{children:[e.jsx(ya,{showConfetti:p}),e.jsx(ue,{analytics:B,onLoad:k=>(v=>v.trackPageLoaded(ke.Event.accountsPromoPageViewed))(k)}),e.jsx(pe,{isAppContentDrawerOpen:d,handleDrawerToggle:I}),e.jsx(Qa,{analytics:B,navigate:n,companyId:g,meetingUrl:o("zeni_accounts_promo"),onClickMenuIcon:()=>{I(!0)},maxAnnualPercentageYield:l.maxAnnualPercentageYield,maxInsuredAmount:l.maxInsuredAmount,exampleBankBalance:3e6})]})}return e.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Et(){const n=W(),a=D((L=>R(L))),i=F(),{useFeatureGate:t,useDynamicConfig:o}=Z(),r=oe(),d=ne(r?.loggedInUserRoleMap),c=xe(r?.loggedInUserRoleMap),p=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled,h=!!a.company?.companyZeniAccountInfo?.isZeniAccountTOSAccepted,{isFeatureEnabled:f}=t(z.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=t(z.isDebitCardFeatureEnabled),l=qe(a),g=Ce(s,a),y=a?.userRole!=null&&na(a?.userRole),w=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!y)&&aa(r?.loggedInUserRoleMap),I=ta(r?.loggedInUserRoleMap),A=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!y)&&oa(r?.loggedInUserRoleMap),b=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!y,{configValue:x}=o(H.expressPayConfig),k=x.is_enable_all_tenants===!0||x.tenant_ids!=null&&x.tenant_ids.includes(a.tenantId),{isFeatureEnabled:v}=t(z.isAutoTransferRuleEnabled),O=Ca(a,f,s)&&!y&&sa(r?.loggedInUserRoleMap),j=ia(r?.loggedInUserRoleMap),E=b&&ne(r?.loggedInUserRoleMap),T=E||Me(r?.loggedInUserRoleMap);return e.jsxs(Fe,{children:[e.jsx(C,{path:"setup",element:e.jsx(Le,{isBillPayAdminLevelAccess:w,isUserHasOnlyBillPayAccess:I,isReimbursementAdminLevelAccess:A,isZeniAccountAdminLevelAccess:E,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:j,productType:"zeni_accounts",type:"setup"})}),e.jsx(C,{path:"verification",element:e.jsx(Le,{isBillPayAdminLevelAccess:w,isUserHasOnlyBillPayAccess:I,isReimbursementAdminLevelAccess:A,isZeniAccountAdminLevelAccess:E,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:j,productType:"zeni_accounts",type:"verification"})}),v?e.jsxs(e.Fragment,{children:[e.jsx(C,{path:"auto-transfer",element:e.jsx(Re,{})}),T?e.jsx(C,{path:"auto-transfer/:ruleId/edit",element:e.jsx(Re,{isEditDrawerOpen:!0})}):null]}):e.jsx(C,{path:"auto-transfer",element:e.jsx(Q,{})}),k&&d?e.jsxs(e.Fragment,{children:[e.jsx(C,{path:"express-pay",element:e.jsx(ie,{})}),e.jsx(C,{path:"express-pay/add-ach",element:e.jsx(ie,{isAddACHDrawerOpen:!0})}),e.jsx(C,{path:"express-pay/add-wire/add-address",element:e.jsx(ie,{isAddAddressDrawerOpen:!0})}),e.jsx(C,{path:"express-pay/add-wire",element:e.jsx(ie,{isAddWireDrawerOpen:!0})})]}):e.jsx(C,{path:"express-pay",element:e.jsx(Q,{})}),e.jsx(C,{path:"promo",element:e.jsx(et,{})}),l&&!g?e.jsx(C,{path:"/*",element:e.jsx(nn,{})}):p?e.jsxs(e.Fragment,{children:[e.jsx(C,{path:"/",element:e.jsx(fe,{})}),e.jsx(C,{path:"transfer",element:e.jsx(fe,{isTransferDrawerOpen:!0})}),e.jsx(C,{path:"check-deposit",element:e.jsx(fe,{isCheckDepositDrawerOpen:!0})}),e.jsx(C,{path:"cash_management/*",element:e.jsx(Q,{})}),e.jsx(C,{path:":accountId/*",element:e.jsx(nt,{})}),e.jsx(C,{path:"*",element:e.jsx(Q,{})})]}):h&&d?e.jsx(C,{path:"*",element:e.jsx(ee,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&c?e.jsx(C,{path:"*",element:e.jsx(ee,{to:"../promo",state:n.state})}):e.jsx(C,{path:"*",element:e.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${wa.sp1} ${i.colors.dropShadowNormal}`}})})]})}function nt(){return e.jsxs(Fe,{children:[e.jsx(C,{path:"/",element:e.jsx(re,{})}),e.jsx(C,{path:"account-info",element:e.jsx(re,{isAccountInfoDrawerOpen:!0})}),e.jsx(C,{path:"transfer",element:e.jsx(re,{isTransferDrawerOpen:!0})}),e.jsx(C,{path:"check-deposit",element:e.jsx(re,{isCheckDepositDrawerOpen:!0})}),e.jsx(C,{path:"statements",element:e.jsx(Sa,{})}),e.jsx(C,{path:"*",element:e.jsx(Q,{})})]})}export{Et as default};
@@ -1 +0,0 @@
1
- import{a as b}from"./sentry-DZ9rNYfw.js";import{h as u,g,i as h,j as S}from"./core-B-8b0iz9.js";import{fF as y}from"./zeni-epic-state-95zxmizy.js";import{a as k,a2 as C,d as A,as as T,x as I,p as v,av as w}from"./index-Bg2deWZq.js";import"./mui-C33Oegsm.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]="333121ff-0c4a-4546-af1b-92470f445d61",e._sentryDebugIdIdentifier="sentry-dbid-333121ff-0c4a-4546-af1b-92470f445d61")}catch{}})();function j(e){const{mobileExploreReferrer:t}=e,{isAiCfoOpen:f,setIsAiCfoOpen:r}=k(),s=u(),o=g(),{tenantEmailDomain:n}=h(),d=C(),i=w(d),l=A(),p=T(),m=S((a=>a.tenantState.fetchState==="Completed"||a.tenantState.activeTenantFetchState.fetchState==="Completed"?y(a):void 0)),c=m?.masterTOSInfo?.isMasterTOSAccepted??!1;return{isAiCfoAccessEnabled:p&&l&&!f,onAskAiCfoClick:b.useCallback((()=>{if(n!=null)if(c)if(i){const a=v(o.state?.pathnameStackToGoBack,o.pathname);s(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:a,referrer:t}})}else r(!0);else I({location:o,navigate:s,mergeState:{referrer:t}})}),[c,i,o,t,s,r,n])}}export{j as u};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-DZ9rNYfw.js";import{bn as i}from"./zeni-epic-state-95zxmizy.js";import{o as d,S as o}from"./index-Bg2deWZq.js";import"./mui-C33Oegsm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="83b04413-7ee7-465a-900b-080e7b8d7073",e._sentryDebugIdIdentifier="sentry-dbid-83b04413-7ee7-465a-900b-080e7b8d7073")}catch{}})();const c=e=>{const{useFeatureGate:s}=d(),{isFeatureEnabled:n}=s(o.isTaskManagerCustomerUserAccessEnabled),{isFeatureEnabled:t}=s(o.isTaskManagerNotificationControlsEnabled),a=r.useMemo((()=>i(e)),[e]);return{isNotificationControlsEnabled:a||t,isTaskManagerAccessEnabled:a||n,isZeniUser:a}};export{c as u};
@@ -1,25 +0,0 @@
1
- import{j as d}from"./liveblocks-BjcYyeQ6.js";import{R as Q,a as t}from"./sentry-DZ9rNYfw.js";import{K as ue,o as O,S as C,b5 as me,at as pe,ba as fe,b6 as be,b7 as he,a2 as Te,bb as H}from"./index-Bg2deWZq.js";import{c as q,n as $}from"./mui-C33Oegsm.js";import{u as Pe}from"./useAskAiCfoHostNavButtonProps-BZHyrLWc.js";import{u as Ee,a as ve,b as ye,c as Se,d as xe,l as Ie,C as Ce,e as ge,f as we}from"./TransactionDetailScreen-CN2_Ei-4.js";import{h as F,g as k,i as j,u as Oe,j as $e}from"./core-B-8b0iz9.js";import{sS as Fe,VQ as ke,RA as je}from"./zeni-epic-state-95zxmizy.js";import{m as De,s as Me}from"./stripSplatSuffix-Te2Zqy4u.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]="db4e91fe-c410-413b-a039-13fee44e9d8f",a._sentryDebugIdIdentifier="sentry-dbid-db4e91fe-c410-413b-a039-13fee44e9d8f")}catch{}})();const _=$.div`
2
- ${({$active:a})=>a&&q`
3
- display: flex;
4
- flex-direction: column;
5
- height: 100%;
6
- `}
7
- `,Y=$.div`
8
- ${({$active:a})=>a&&q`
9
- flex: 1;
10
- min-height: 0;
11
- display: flex;
12
- flex-direction: column;
13
- box-sizing: border-box;
14
- min-width: 0;
15
- overflow-x: hidden;
16
- overflow-y: auto;
17
- `}
18
- `,Ve=$.div`
19
- display: flex;
20
- flex: 1;
21
- flex-direction: column;
22
- min-height: 0;
23
- min-width: 0;
24
- box-sizing: border-box;
25
- `,Ae=Q.memo((({isFullView:a,transactionId:e,transactionType:v,isTransactionCommentingEnabled:y,onBackToList:u,onClose:o})=>{const i=F(),m=k(),{tenantEmailDomain:r}=j(),h=ue(),{useFeatureGate:n}=O(),{isFeatureEnabled:f}=n(C.isCreateTransferEntryFromExpenseEnabled),p=o!=null&&a!==!0,c=h?.currentTenant?.companyId,S=h?.currentTenant?.companyName,{isFeatureEnabled:g}=n(C.isProjectsTransactionsEnabled),{isFeatureEnabled:T}=n(C.isTransactionSplitEnabled),{selectedTransaction:s,transactionDetail:P,tranEntity:x,isChainOfThoughtEnabled:b,defaultTrendTransactionTimePeriod:l,resetTrendIsFetchedStates:E,uncategorizedAccounts:D,vendorSaveStatus:J,isVendorBulkUpdateOnTransactionEnabled:W,isExpenseAutomationEnabled:X,firstMonthOfFY:Z,isCreateVendorDrawerOpen:M,rawDetailSaveStatus:ee,rawDetailLineItemById:V}=Ee(e,v),{isFeatureEnabled:ne}=n(C.isRecommendationFeedbackEnabled),A=me(),{onRecommendationSelection:R,popup:ae}=ve({isEnabled:ne,fallbackTransactionId:e}),te=t.useMemo((()=>({...A,onRecommendationSelection:R})),[A,R]);ye(a===!0);const N=t.useRef(V);N.current=V;const I=Se(ee,(()=>{const w=[],B=N.current;if(B!=null)for(const de of Object.values(B)){const U=de.account;U?.accountId!=null&&w.push(U.accountId)}return w})),{transactionId:L,onSaveVendor:se,onSaveSuccess:ie,onCancel:oe}=xe({closeDrawerHandler:()=>{},overrideTransactionId:e,overrideTransactionType:v}),{isAiCfoAccessEnabled:re,onAskAiCfoClick:ce}=Pe({mobileExploreReferrer:"Transaction Details"}),z=a===!0&&re;pe({isDataReady:a===!0&&P?.fetchState==="Completed"});const G=t.useRef(null);if(t.useEffect((()=>{if(G.current!==e&&P?.fetchState==="Completed"){G.current=e;const w=m.state?.searchContext;Ie(P.transaction,w)}}),[m.state,P,e]),P==null)return d.jsx(_,{$active:p,children:d.jsx(Y,{$active:p,children:d.jsx(fe,{})})});const le=d.jsxs(d.Fragment,{children:[L!=null&&M?d.jsx(Ce,{isOpen:M,transactionId:L,onSaveVendor:se,onSaveSuccess:ie,onCancel:oe}):null,d.jsx(Ve,{children:d.jsx(be,{toolkit:te,children:d.jsx(ge,{hideDeleteAttachment:!0,firstMonthOfFY:Z,isDisabled:P?.transaction?.type==="transfer"&&h?.connectionName==="netsuite"?"readonly":void 0,isNavBarVisible:!p,tenantEmailDomain:r??"",location:m,navigate:i,selectedTransaction:s,entity:x,isCOTEnabled:b,isCreateTransferEntryFromExpenseEnabled:f,defaultTrendTransactionTimePeriod:l,resetTrendIsFetchedStates:E,transaction:P?.transaction,uncategorizedAccounts:D,vendorSaveStatus:J,isVendorBulkUpdateOnTransactionEnabled:W,isExpenseAutomationEnabled:X,isAiCfoAccessEnabled:z,onAskAiCfoClick:z?ce:void 0,isTransactionCommentingEnabled:y,isProjectsTransactionsEnabled:g,isTransactionSplitEnabled:T,companyId:c,companyName:S,onBackClick:u})})}),ae,I.showPopup&&I.popupType!=null&&d.jsx(he,{popupType:I.popupType,currencySymbol:I.currencySymbol,accountId:I.popupAccountId??"",accountName:I.popupAccountName??"",onSubmit:I.handleSubmit,onDismiss:I.handleDismiss})]});return d.jsx(_,{$active:p,children:d.jsx(Y,{$active:p,children:le})})})),Re=[];function Ne(a){const{childPathPattern:e,enabled:v=!0,listPath:y}=a,u=F(),o=j(),i=k(),m=Te(),r=m==="small"||m==="medium-compact",h=o["*"]??"",n=De(e,i.pathname,h),f=v&&!r&&n!=null,p=t.useMemo((()=>new URLSearchParams(i.search).get("view")),[i.search]),c=f&&p==="full",S=n?.slice(1).join("\0"),g=t.useMemo((()=>n==null?Re:n.slice(1)),[S]),T=t.useMemo((()=>y??Me(e,i.pathname,h)),[e,y,i.pathname,h]),s=t.useRef({isOpen:f,locationState:i.state,basePath:T,pathname:i.pathname,search:i.search});s.current.isOpen=f,s.current.locationState=i.state,s.current.basePath=T,s.current.pathname=i.pathname,s.current.search=i.search;const P=t.useCallback(((l,E)=>{u(`${s.current.basePath}/${l}`,{replace:E?.replace??!1,state:E?.extraState!=null?{...s.current.locationState,...E.extraState}:s.current.locationState})}),[u]),x=t.useCallback((()=>{s.current.isOpen&&u(s.current.basePath,{replace:!0,state:s.current.locationState})}),[u]),b=t.useCallback((()=>{const l=new URLSearchParams(s.current.search);l.set("view","full"),u(`${s.current.pathname}?${l.toString()}`,{replace:!0,state:s.current.locationState})}),[u]);return t.useEffect((()=>{if(!f)return;const l=E=>{if(E.key==="Escape"){if(E.target?.closest('[role="dialog"], [role="alertdialog"]'))return;if(!c&&(document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement||document.activeElement instanceof HTMLSelectElement))return void document.activeElement.blur();x()}};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)}),[f,c,x]),{backToList:x,basePath:T,closePanel:x,isFullView:c,isMobile:r,isOpen:f,matchGroups:g,maximize:b,navigateToChild:P}}function K(a){try{return decodeURIComponent(a)}catch{return a}}const Le=/^transaction\/([^/]+)\/([^/?]+)$/;function ze(a){return function(e){const v=e.displayName??e.name??"Component",y=Q.memo(e),u=o=>{const{useFeatureGate:i}=O(),{isFeatureEnabled:m}=i(a.gateName??C.isTransactionDetailSplitViewEnabled),r=a.usePanelSetup(a.gateName==null||m),h=t.useContext(H),n=t.useMemo((()=>r.selectedItemId==null?h:{closePanel:r.sidePanel.closePanel,maximize:r.sidePanel.maximize,selectedItemId:r.selectedItemId}),[h,r.sidePanel.closePanel,r.sidePanel.maximize,r.selectedItemId]);return d.jsx(H.Provider,{value:n,children:d.jsx(y,{...o,...r.injectedProps})})};return u.displayName=`${a.displayNamePrefix}(${v})`,u}}const Je=ze({displayNamePrefix:"withTransactionSidePanel",gateName:C.isTransactionDetailSplitViewEnabled,usePanelSetup:function(a){const e=(function(o=!0){const i=F(),m=k(),r=Oe(),h=j(),n=Ne({childPathPattern:Le,enabled:o}),f=n.matchGroups[0]!=null&&n.matchGroups[0]!==""?Fe(K(n.matchGroups[0])):void 0,p=n.matchGroups[1]!=null&&n.matchGroups[1]!==""?K(n.matchGroups[1]):void 0,c=t.useMemo((()=>{if(o&&p!=null&&f!=null)return{id:p,type:f}}),[o,p,f]),S=$e((b=>{if(c!=null)return ke(b,c)})),g=t.useMemo((()=>n.isOpen&&c!=null?S==null?"In-Progress":S.fetchState:"Not-Started"),[n.isOpen,c,S]),T=h.tenantEmailDomain??m.pathname.split("/").find(Boolean)??"";t.useEffect((()=>{n.isOpen&&c!=null&&r(je(c,!1))}),[r,n.isOpen,c]);const s=t.useRef({isOpen:n.isOpen,transactionId:p});s.current={isOpen:n.isOpen,transactionId:p};const P=t.useCallback((b=>{const l=encodeURIComponent(b.type);return n.isMobile||!o?`/${T}/transaction/${l}/${b.id}${m.search}`:`${n.basePath}/transaction/${l}/${b.id}${m.search}`}),[n.isMobile,n.basePath,o,T,m.search]);we({currentTransactionId:c,enabled:T!=="",buildPath:P,navigate:i,navigateState:m.state});const x=t.useCallback(((b,l,E)=>{!n.isMobile&&o?s.current.isOpen&&s.current.transactionId===b?n.closePanel():n.navigateToChild(`transaction/${encodeURIComponent(l)}/${b}`,{replace:s.current.isOpen,extraState:E!=null?{searchContext:E}:void 0}):i(`/${T}/transaction/${encodeURIComponent(l)}/${b}`)}),[i,n.isMobile,n.navigateToChild,n.closePanel,o,T]);return{backToList:n.closePanel,closePanel:n.closePanel,fetchState:g,isFullView:n.isFullView,isOpen:n.isOpen,maximize:n.maximize,openPanel:x,selectedTransactionId:o?c:void 0,transactionDetail:o?S:void 0,transactionId:o?p:void 0,transactionType:o?f:void 0}})(a),{useFeatureGate:v}=O(),{isFeatureEnabled:y}=v(C.isTransactionCommentingEnabled),u=t.useMemo((()=>{if(e.isOpen&&e.transactionId!=null&&e.transactionType!=null)return d.jsx(Ae,{isFullView:e.isFullView,isTransactionCommentingEnabled:y,transactionId:e.transactionId,transactionType:e.transactionType,onBackToList:e.closePanel,onClose:e.closePanel})}),[e.isOpen,e.isFullView,e.transactionId,e.transactionType,e.closePanel,y]);return{injectedProps:t.useMemo((()=>a?{closeSidePanel:e.closePanel,openTransactionPanel:e.openPanel,panelContent:u,sidePanelIsFullView:e.isFullView,sidePanelIsOpen:e.isOpen}:{}),[a,e.closePanel,e.openPanel,u,e.isFullView,e.isOpen]),selectedItemId:e.transactionId,sidePanel:e}}});export{ze as a,Ne as u,Je as w};