@zeniai/web-app-ui 5.3.36-dev → 5.3.37-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 (125) hide show
  1. package/dist/assets/{AccountMappingScreen-Bo9SjIQs.js → AccountMappingScreen-_4EVBZGw.js} +2 -2
  2. package/dist/assets/AddressRoutes-C6JlNrLm.js +1 -0
  3. package/dist/assets/AddressScreen-ComPzmBu.js +9 -0
  4. package/dist/assets/{AiCfoScreen-DYQiSBc3.js → AiCfoScreen-Bvttsr6a.js} +1 -1
  5. package/dist/assets/{AppDrawer-oto4POkb.js → AppDrawer-Cxjonopq.js} +1 -1
  6. package/dist/assets/{BillPayApprovalRoutes-DUWk7mrJ.js → BillPayApprovalRoutes-Be2JdFb6.js} +1 -1
  7. package/dist/assets/{BillPayRoutes-CowHMkMc.js → BillPayRoutes-CFRnk7Qv.js} +1 -1
  8. package/dist/assets/{BusinessVerificationPageScreen-CBHdFJPr.js → BusinessVerificationPageScreen--yNhbNZF.js} +2 -2
  9. package/dist/assets/{CardsAiCfoScreen-gdSfcNDz.js → CardsAiCfoScreen-DY2qYkQk.js} +1 -1
  10. package/dist/assets/{ChargeCardRoutes-CJr3MIna.js → ChargeCardRoutes-D4rH2ugh.js} +1 -1
  11. package/dist/assets/CompanyPassportScreen-Da1QH72q.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-BhG6R3bg.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-DhSpA01b.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-D3V4jdlp.js → CustomerOnboardingRoutes-B-9UEIGr.js} +1 -1
  15. package/dist/assets/{DashboardRoutes-CnMEptqH.js → DashboardRoutes-CS50FAzC.js} +1 -1
  16. package/dist/assets/{DefaultTenantHome-sDg9RXF0.js → DefaultTenantHome-a2pDza0D.js} +1 -1
  17. package/dist/assets/DomesticWireDetailScreen-BeePCua8.js +18 -0
  18. package/dist/assets/{DrawerScreen-Cb3FMUNp.js → DrawerScreen-GzGq_S7g.js} +1 -1
  19. package/dist/assets/{EntityDetailRoutes-B4z6U0M7.js → EntityDetailRoutes-Hlxr9L7_.js} +1 -1
  20. package/dist/assets/{ExpenseAutomationRoutes-CxtmROEv.js → ExpenseAutomationRoutes-Dy6sqhAB.js} +5 -5
  21. package/dist/assets/FeaturePreviewScreen-C4P6gBWQ.js +1 -0
  22. package/dist/assets/{HubSpotOAuthCallbackScreen-CvQavsdh.js → HubSpotOAuthCallbackScreen-B6ByPirq.js} +1 -1
  23. package/dist/assets/{InboxNotificationsProvider-DpFe93lp.js → InboxNotificationsProvider-DEa_8AVv.js} +1 -1
  24. package/dist/assets/{InvoicingRoutes-CKDAZIay.js → InvoicingRoutes-Dd1pdXsc.js} +2 -2
  25. package/dist/assets/{MagicLinkRoutes-DovGoMLV.js → MagicLinkRoutes-B0No8CRx.js} +7 -7
  26. package/dist/assets/MagicLinkSignInScreen-dAeqizKV.js +12 -0
  27. package/dist/assets/MobileAppDrawer-BU-k0-97.js +1 -0
  28. package/dist/assets/NotFoundScreen-DZ0EcL3w.js +1 -0
  29. package/dist/assets/{NotificationRoutes-BeUGz2oT.js → NotificationRoutes-WrEpizjn.js} +1 -1
  30. package/dist/assets/{OAuthConsentScreen-BczDm8kb.js → OAuthConsentScreen-ciivzIvX.js} +1 -1
  31. package/dist/assets/{PandLWithForecastRoutes-D3GxV6j5.js → PandLWithForecastRoutes-lqrbmK3W.js} +1 -1
  32. package/dist/assets/{PaymentLinkScreen-BXRJjkWo.js → PaymentLinkScreen-C13pimFV.js} +3 -3
  33. package/dist/assets/{PeopleRoutes-D25kcrVR.js → PeopleRoutes-D3wy3tps.js} +3 -3
  34. package/dist/assets/PerformanceRoutes-mUHDtsOj.js +1 -0
  35. package/dist/assets/{Preview-DZav37Rr.js → Preview-CX3thmz9.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-BVDyTxl7.js → QBOConnectionScreen-s6A9jd5F.js} +1 -1
  37. package/dist/assets/{ReimbursementApprovalRoutes-BB31uN18.js → ReimbursementApprovalRoutes-B1Eaf8R5.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Caabj-x6.js → ReimbursementApprovalRuleDetailScreen-CfVvNkpm.js} +1 -1
  39. package/dist/assets/{ReimbursementRoutes-CulSVZ0W.js → ReimbursementRoutes-D6Wh5Zab.js} +5 -5
  40. package/dist/assets/{ReportsRoutes-C6Kwp2Hc.js → ReportsRoutes-Dqg6U4z6.js} +1 -1
  41. package/dist/assets/RewardsRoutes-Z2oqn2Mz.js +1 -0
  42. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CoClL9S-.js → ScheduleDetailsPrepaidExpensesScreen-BT1fazQP.js} +4 -4
  43. package/dist/assets/{ScreenRoutes-a0l23itl.js → ScreenRoutes-BfvWo8n7.js} +2 -2
  44. package/dist/assets/{SettingsRoutes-QF4q0Ccc.js → SettingsRoutes-BPqAraN0.js} +6 -6
  45. package/dist/assets/{SetupPagesScreen-BTAx9706.js → SetupPagesScreen-CdL3mWmh.js} +5 -5
  46. package/dist/assets/SignInScreen-D37W4Vu3.js +1 -0
  47. package/dist/assets/{SignOutScreen-BjjZMM3h.js → SignOutScreen-QYzOToVV.js} +1 -1
  48. package/dist/assets/{TaskListScreen-Ds2QBdT7.js → TaskListScreen-IpjmQCZM.js} +2 -2
  49. package/dist/assets/{TaskRoutes-B9rWCVPV.js → TaskRoutes-BSuBns5c.js} +2 -2
  50. package/dist/assets/TransactionDetailRoutes-DVGqIG1K.js +1 -0
  51. package/dist/assets/{TransactionDetailScreen-CsT2rgA9.js → TransactionDetailScreen-ztNW1t0S.js} +2 -2
  52. package/dist/assets/{TransactionListRoutes-CUT6tJhC.js → TransactionListRoutes-FBoKU5cp.js} +1 -1
  53. package/dist/assets/{TreasuryRoutes-DLm2Dxdv.js → TreasuryRoutes-CCybuieJ.js} +5 -5
  54. package/dist/assets/{VendorsRoutes-UZu-x_KY.js → VendorsRoutes-TUOD3QZ-.js} +10 -10
  55. package/dist/assets/{WiseConfirmationScreen-BY_oDNTz.js → WiseConfirmationScreen-DmBQRJcI.js} +1 -1
  56. package/dist/assets/{ZeniAccountRoutes-BO7pOpAA.js → ZeniAccountRoutes-Cy6oQuAU.js} +7 -7
  57. package/dist/assets/{ZeniAccountStatementScreen-D9MYrURY.js → ZeniAccountStatementScreen-BqYGkSqb.js} +1 -1
  58. package/dist/assets/{accountMappingHelper-DkWE8zWp.js → accountMappingHelper-B7U2cCqS.js} +1 -1
  59. package/dist/assets/{analytics-Vv7iwE-7.js → analytics-CwJdwpYA.js} +1 -1
  60. package/dist/assets/{analyticsHelper-De2OvKV1.js → analyticsHelper-dK3DOCZ4.js} +1 -1
  61. package/dist/assets/{core-FnF-Uc4O.js → core-BmuD0S3N.js} +1 -1
  62. package/dist/assets/{decodeURIComponentSafe-Dcy3wJS-.js → decodeURIComponentSafe-BxKRdZp_.js} +1 -1
  63. package/dist/assets/{dnd-r2xkhVF6.js → dnd-DlE2O-fD.js} +1 -1
  64. package/dist/assets/{empty-ClAnc2XI.js → empty-C4N1sGNA.js} +1 -1
  65. package/dist/assets/{empty-DQ1o_QD4.js → empty-DWNwnBUu.js} +1 -1
  66. package/dist/assets/{emptyVideoElement-C_Q7qtAB.js → emptyVideoElement-GiQdhxCl.js} +1 -1
  67. package/dist/assets/{epic-B5eMa5H9.js → epic-h6DZWVA3.js} +1 -1
  68. package/dist/assets/{expenseAutomationHelper-VQqpchU0.js → expenseAutomationHelper-DgFVpBsB.js} +1 -1
  69. package/dist/assets/{getLocaleForTenant-DYIzeFnW.js → getLocaleForTenant-DnI7jDkK.js} +1 -1
  70. package/dist/assets/{index-Dy5h_qvb.js → index-6JALuOxS.js} +1 -1
  71. package/dist/assets/{index-CvV3WXW-.js → index-B10C_aE8.js} +1 -1
  72. package/dist/assets/{index-Dm2xksv6.js → index-CG5GDUuE.js} +1 -1
  73. package/dist/assets/{index-Cq4yq1Os.js → index-CKmtWpp4.js} +1 -1
  74. package/dist/assets/{index-Ecojj-Pb.js → index-CSXIBJ_M.js} +25646 -25642
  75. package/dist/assets/{index-D-iD3FJs.js → index-CpsRiKNg.js} +2 -2
  76. package/dist/assets/{index-DwQy9RhB.js → index-DIFunX7I.js} +1 -1
  77. package/dist/assets/{index-DrlR6PPl.js → index-YvDKgUSm.js} +1 -1
  78. package/dist/assets/{lexical-DP-ZRRwN.js → lexical-BTBf0x2F.js} +1 -1
  79. package/dist/assets/{liveblocks-Bqt_XhHh.js → liveblocks-DFmQJs9l.js} +1 -1
  80. package/dist/assets/{lottie-Blhfr6ao.js → lottie-C08AxeP4.js} +1 -1
  81. package/dist/assets/{mui-gvvniK3d.js → mui-BM_3_akP.js} +1 -1
  82. package/dist/assets/{pathToGoBack-oY27p9ir.js → pathToGoBack-DSMtoOXp.js} +1 -1
  83. package/dist/assets/{pdf-DycQGpzo.js → pdf-i0V0lBaH.js} +3 -3
  84. package/dist/assets/{pdf-lib-CefI83Yi.js → pdf-lib-D5sCwB4Y.js} +1 -1
  85. package/dist/assets/{plaid-G8Bxl_Fw.js → plaid-C449LRBC.js} +1 -1
  86. package/dist/assets/{pusher-8Yj5cgDA.js → pusher-B_CEqXn9.js} +1 -1
  87. package/dist/assets/{react-BsNtT8x0.js → react-B6OqNeSK.js} +1 -1
  88. package/dist/assets/{react-BLuOwq7p.js → react-CAZE7TkS.js} +1 -1
  89. package/dist/assets/{react-DLm-_UY4.js → react-CIMZmDkd.js} +1 -1
  90. package/dist/assets/{react-BQrSoQIz.js → react-CQLAjY1C.js} +1 -1
  91. package/dist/assets/{react-CrQ-7Thk.js → react-CS2rsvM8.js} +1 -1
  92. package/dist/assets/{react-DCZHvq8F.js → react-D5102Hin.js} +1 -1
  93. package/dist/assets/{recharts-CUhuZXcR.js → recharts-CoBgaVyZ.js} +1 -1
  94. package/dist/assets/{routePaths-C3Wl814x.js → routePaths-V8Zj2E12.js} +1 -1
  95. package/dist/assets/{sentry-2yczjdjC.js → sentry-C-wepUYh.js} +1 -1
  96. package/dist/assets/{url-BbsAgfML.js → url-DJ3IUZcx.js} +1 -1
  97. package/dist/assets/{url-Q0BVeI-7.js → url-pet6UZww.js} +1 -1
  98. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DOFL_vWR.js → useAiCfoDashboardSuggestedQuestionsChips-BpFQvcSU.js} +1 -1
  99. package/dist/assets/useAskAiCfoHostNavButtonProps-9-Fy3nUU.js +1 -0
  100. package/dist/assets/{useChargeCardPusherEvents-BCU1j21B.js → useChargeCardPusherEvents-D6rHv_zT.js} +1 -1
  101. package/dist/assets/{useDeviceId-CcCyWvJO.js → useDeviceId-eYjWXyCF.js} +1 -1
  102. package/dist/assets/{useEmailConnectResultRefresh-DWR-6F3l.js → useEmailConnectResultRefresh-CEyJgwAN.js} +1 -1
  103. package/dist/assets/{useInitialThreadRequest-B4xEyjqp.js → useInitialThreadRequest-D9t0YCjO.js} +1 -1
  104. package/dist/assets/useTaskManagerAccess-BxZJAj1T.js +1 -0
  105. package/dist/assets/{utils-BW8U-ATx.js → utils-CJuELQS5.js} +1 -1
  106. package/dist/assets/{withTransactionSidePanel-Bbcq3RMx.js → withTransactionSidePanel-CzeazBMg.js} +2 -2
  107. package/dist/assets/{zeni-epic-state-Ch0HFr9W.js → zeni-epic-state-BzURQeUK.js} +3 -3
  108. package/dist/index.html +1 -1
  109. package/package.json +4 -4
  110. package/dist/assets/AddressRoutes-BWBOU6H9.js +0 -1
  111. package/dist/assets/AddressScreen-CJt2Q_Ar.js +0 -9
  112. package/dist/assets/CompanyPassportScreen-BOBPyOSL.js +0 -1
  113. package/dist/assets/ConnectionAuthScreen-0LexC8Yv.js +0 -11
  114. package/dist/assets/CustomerOnboardingAuthScreen-CPwImOYI.js +0 -1
  115. package/dist/assets/DomesticWireDetailScreen-5_2NP_sv.js +0 -18
  116. package/dist/assets/FeaturePreviewScreen-BQgcXL7a.js +0 -1
  117. package/dist/assets/MagicLinkSignInScreen-BuM1eFmv.js +0 -12
  118. package/dist/assets/MobileAppDrawer-BG_dPpHH.js +0 -1
  119. package/dist/assets/NotFoundScreen-B-YpUYOf.js +0 -1
  120. package/dist/assets/PerformanceRoutes-Rt6fwEVs.js +0 -1
  121. package/dist/assets/RewardsRoutes-C2QpGt1k.js +0 -1
  122. package/dist/assets/SignInScreen-Cp2wPfZe.js +0 -1
  123. package/dist/assets/TransactionDetailRoutes-BtwuKCIj.js +0 -1
  124. package/dist/assets/useAskAiCfoHostNavButtonProps-BC2E97t6.js +0 -1
  125. package/dist/assets/useTaskManagerAccess-C4k1vquW.js +0 -1
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-Bqt_XhHh.js";import{g as W,h as De,u as Fe,i as Oe,j as d,l as Ae,n as Pe,o as ee}from"./core-FnF-Uc4O.js";import{fE as $,Dt as R,U1 as Ee,l_ as le,tA as ce,up as O,lF as Le,lO as A,lG as P,kJ as E,kA as L,kz as Me,CD as ie,uu as Be,bq as ve,U2 as Ve,bn as xe,DQ as ze,U3 as Ge,U4 as Ye,ci as S,Cw as He,U5 as ae,U6 as qe,U7 as Ne,U8 as $e,U9 as Qe,Ua as Ze,Ub as Je,Uc as Xe,Ud as Ke,Ue as We,Uf as ea,Ug as aa,Uh as sa,Ui as U,Uj as M,Uk as B,Ul as v,Um as V,Un as x,Uo as z,Up as G,Uq as Y,Ur as H,eb as ta,Du as oa,Dh as se,Di as te,DA as na,Dm as oe,DG as ra,Us as la,Ut as ca,Uu as ia,Uv as da,Uw as pa,Ux as _a,Uy as fa,Uz as ma,UA as ba,UB as ua,dY as ha,dX as ya}from"./zeni-epic-state-Ch0HFr9W.js";import{an as wa,ao as Ca,ap as ga,a as Sa,a1 as Ia,O as de,y as q,z as pe,aq as Ra,Q as Ta,d as Ua,ar as ja,as as ka,a8 as Da,j as N,U as Fa,B as Oa,p as _e,at as Aa,au as Pa,av as Ea}from"./index-Ecojj-Pb.js";import"./mui-gvvniK3d.js";import La from"./NotFoundScreen-B-YpUYOf.js";import{F as Ma}from"./FeaturePreviewScreen-BQgcXL7a.js";import{a as b}from"./sentry-2yczjdjC.js";import{u as Ba}from"./useInitialThreadRequest-B4xEyjqp.js";import{t as ne,a as re,b as va}from"./routePaths-C3Wl814x.js";import{M as Va}from"./MobileAppDrawer-BG_dPpHH.js";import"./recharts-CUhuZXcR.js";import"./analytics-Vv7iwE-7.js";import"./plaid-G8Bxl_Fw.js";import"./dnd-r2xkhVF6.js";import"./stripe-cKAAJElX.js";import"./lottie-Blhfr6ao.js";import"./lexical-DP-ZRRwN.js";import"./pdf-DycQGpzo.js";import"./utils-BW8U-ATx.js";import"./InboxNotificationsProvider-DpFe93lp.js";import"./useTaskManagerAccess-C4k1vquW.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]="abb401d0-1ac2-45f9-91c4-7e07988f144b",e._sentryDebugIdIdentifier="sentry-dbid-abb401d0-1ac2-45f9-91c4-7e07988f144b")}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(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba()),e(ua())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=$(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(O(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(U(a)),(I(a)||S(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?va(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:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({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(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({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(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({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(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({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=S(t);l?(e(Xe({viewMode:a})),e(Ke({viewMode:a}))):r?(e(We({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(U(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(U(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(U(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e(Qe({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(qe({projectsToFilterOut:a})):I(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):e($e({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(Ye(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 Ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Pa(_),a=De(),s=Fe(),t=W(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(q.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=b.useState(!1),[Q,fe]=b.useState(!1),{isFeatureEnabled:Z}=l(q.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>$(n))),me=k.masterTOSInfo?.isMasterTOSAccepted??!1,be=k.company?.companyInfo.firstMonthOfFY??1,ue=Ba(Z?k?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:u}=Ra(),D=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),g=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),F=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(w(!0),s(O(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!Q&&C==="Completed"&&u&&(s(O(i.userId,!1,!0,!1)),fe(!0))}),[c,Q,C,u]),b.useEffect((()=>{if(c&&F.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(D){case"profit_and_loss":case"profit_and_loss_by_classes":s(Be(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(ie());break;case"balance_sheet":s(Me(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Le(h.timeframe))}}),[c,D,F,u,T,g]);const J=Ta(),Ce=J?.loggedInUserRole!=null&&ve(J?.loggedInUserRole)!==!0,[ge,Se]=b.useState(!1),X=n=>{Se(n)},Ie=Ua(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:Ue}=W(),K=wa(Ue??"")==="reports",je=Ca(Te),ke=b.useMemo((()=>K?xa:void 0),[K]);ga({canFetchSuggestedQuestions:je,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Da,{analytics:N,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Va,{isAppContentDrawerOpen:ge,handleDrawerToggle:X}),p.jsx(Ga,{firstMonthOfFY:be,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:D,analytics:N,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:F,handleDrawerToggle:X,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 Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Z,initialOpenThreadRequest:ue})]})}const j=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=>$(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(q.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ma,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ya,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
1
+ import{j as p}from"./liveblocks-DFmQJs9l.js";import{g as W,h as De,u as Fe,i as Oe,j as d,l as Ae,n as Pe,o as ee}from"./core-BmuD0S3N.js";import{fE as $,Dt as R,U1 as Ee,l_ as le,tA as ce,up as O,lF as Le,lO as A,lG as P,kJ as E,kA as L,kz as Me,CD as ie,uu as Be,bq as ve,U2 as Ve,bn as xe,DQ as ze,U3 as Ge,U4 as Ye,ci as S,Cw as He,U5 as ae,U6 as qe,U7 as Ne,U8 as $e,U9 as Qe,Ua as Ze,Ub as Je,Uc as Xe,Ud as Ke,Ue as We,Uf as ea,Ug as aa,Uh as sa,Ui as U,Uj as M,Uk as B,Ul as v,Um as V,Un as x,Uo as z,Up as G,Uq as Y,Ur as H,eb as ta,Du as oa,Dh as se,Di as te,DA as na,Dm as oe,DG as ra,Us as la,Ut as ca,Uu as ia,Uv as da,Uw as pa,Ux as _a,Uy as fa,Uz as ma,UA as ua,UB as ba,dY as ha,dX as ya}from"./zeni-epic-state-BzURQeUK.js";import{an as wa,ao as Ca,ap as ga,a as Sa,a1 as Ia,O as de,c as q,z as pe,aq as Ra,V as Ta,e as Ua,ar as ja,as as ka,a8 as Da,j as N,U as Fa,B as Oa,p as _e,at as Aa,au as Pa,av as Ea}from"./index-CSXIBJ_M.js";import"./mui-BM_3_akP.js";import La from"./NotFoundScreen-DZ0EcL3w.js";import{F as Ma}from"./FeaturePreviewScreen-C4P6gBWQ.js";import{a as u}from"./sentry-C-wepUYh.js";import{u as Ba}from"./useInitialThreadRequest-D9t0YCjO.js";import{t as ne,a as re,b as va}from"./routePaths-V8Zj2E12.js";import{M as Va}from"./MobileAppDrawer-BU-k0-97.js";import"./recharts-CoBgaVyZ.js";import"./analytics-CwJdwpYA.js";import"./plaid-C449LRBC.js";import"./dnd-DlE2O-fD.js";import"./stripe-cKAAJElX.js";import"./lottie-C08AxeP4.js";import"./lexical-BTBf0x2F.js";import"./pdf-i0V0lBaH.js";import"./utils-CJuELQS5.js";import"./InboxNotificationsProvider-DEa_8AVv.js";import"./useTaskManagerAccess-BxZJAj1T.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]="9e08d804-8955-4ad7-8a79-4d604f8a25a0",e._sentryDebugIdIdentifier="sentry-dbid-9e08d804-8955-4ad7-8a79-4d604f8a25a0")}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(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({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=$(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(O(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(U(a)),(I(a)||S(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?va(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:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({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(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({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(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({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(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({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=S(t);l?(e(Xe({viewMode:a})),e(Ke({viewMode:a}))):r?(e(We({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(U(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(U(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(U(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e(Qe({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(qe({projectsToFilterOut:a})):I(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):e($e({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(Ye(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 Ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Pa(_),a=De(),s=Fe(),t=W(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(q.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=u.useState(!1),[Q,fe]=u.useState(!1),{isFeatureEnabled:Z}=l(q.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>$(n))),me=k.masterTOSInfo?.isMasterTOSAccepted??!1,ue=k.company?.companyInfo.firstMonthOfFY??1,be=Ba(Z?k?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),D=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),g=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),F=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(O(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Q&&C==="Completed"&&b&&(s(O(i.userId,!1,!0,!1)),fe(!0))}),[c,Q,C,b]),u.useEffect((()=>{if(c&&F.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(D){case"profit_and_loss":case"profit_and_loss_by_classes":s(Be(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(ie());break;case"balance_sheet":s(Me(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Le(h.timeframe))}}),[c,D,F,b,T,g]);const J=Ta(),Ce=J?.loggedInUserRole!=null&&ve(J?.loggedInUserRole)!==!0,[ge,Se]=u.useState(!1),X=n=>{Se(n)},Ie=Ua(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:Ue}=W(),K=wa(Ue??"")==="reports",je=Ca(Te),ke=u.useMemo((()=>K?xa:void 0),[K]);ga({canFetchSuggestedQuestions:je,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Da,{analytics:N,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Va,{isAppContentDrawerOpen:ge,handleDrawerToggle:X}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:D,analytics:N,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:F,handleDrawerToggle:X,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 Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Z,initialOpenThreadRequest:be})]})}const j=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=>$(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(q.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ma,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ya,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-DFmQJs9l.js";import{z as j,a8 as E,j as p,U as N,e1 as S,O as k,c as C}from"./index-CSXIBJ_M.js";import"./mui-BM_3_akP.js";import g from"./NotFoundScreen-DZ0EcL3w.js";import{a as m}from"./sentry-C-wepUYh.js";import{u as I,j as h,h as F,g as L,l as U,n as _,o as u,N as y}from"./core-BmuD0S3N.js";import{fE as T,a17 as w,a18 as d,D8 as P,p_ as V,a19 as z,D6 as G}from"./zeni-epic-state-BzURQeUK.js";import"./recharts-CoBgaVyZ.js";import"./analytics-CwJdwpYA.js";import"./plaid-C449LRBC.js";import"./dnd-DlE2O-fD.js";import"./stripe-cKAAJElX.js";import"./lottie-C08AxeP4.js";import"./lexical-BTBf0x2F.js";import"./pdf-i0V0lBaH.js";import"./utils-CJuELQS5.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]="ea13526c-2b51-4cc4-87e1-ac15c9640417",e._sentryDebugIdIdentifier="sentry-dbid-ea13526c-2b51-4cc4-87e1-ac15c9640417")}catch{}})();const O=U((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=j.getSignedInUser();return{onDismissClick:()=>{e(d()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),p.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(d())},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}}))(S),R=()=>{const e=I(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>T(o))),c=F(),x=L(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>w(o))),b=f?.firstName!=null?f.firstName:"User";m.useEffect((()=>{e(d()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(v=>v.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(O,{navigate:c,location:x,currentTenant:r,companyName:D,userName:b,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(_,{children:[a.jsx(u,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(u,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(u,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as E}from"./liveblocks-Bqt_XhHh.js";import{a as I}from"./sentry-2yczjdjC.js";import{i as M,u as Z,h as W,g as z,j as h,l as q}from"./core-FnF-Uc4O.js";import{V$ as we,W0 as be,l_ as H,rS as Je,s2 as Ne,sk as je,si as Oe,sl as Pe,so as _e,W1 as Ve,fE as F,U_ as oe,W2 as de,gZ as X,cB as Q,cC as ee,Ey as ge,W3 as Se,EC as Me,Sn as ie,Ew as Ge,Eq as Re,W4 as ue,Ei as $e,Eh as Fe,Ec as Ue,En as Ye,ED as Ke,W5 as U,W6 as re,Ej as We,U$ as te,gN as fe,ET as Ee,EM as De,W7 as ke,rY as Ce,EG as ye,EE as ve,W8 as Ae,E_ as Ie,EX as xe,EH as Te,EZ as Be}from"./zeni-epic-state-Ch0HFr9W.js";import{a4 as ae,aY as ne,aZ as ze,z as Ze,h as qe,a7 as He,a8 as le,j as O,av as Xe,a_ as Qe,p as _,G as he,Z as me,a$ as et,b0 as tt,b1 as at}from"./index-Ecojj-Pb.js";import{n as pe}from"./mui-gvvniK3d.js";import{p as nt}from"./pathToGoBack-oY27p9ir.js";import K from"./NotFoundScreen-B-YpUYOf.js";import{c as V}from"./routePaths-C3Wl814x.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]="00c19c70-1131-48a1-8521-8305de83ce83",e._sentryDebugIdIdentifier="sentry-dbid-00c19c70-1131-48a1-8521-8305de83ce83")}catch{}})();function wt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:d}={}){const{accrualId:l}=M(),s=t??l,n=Z(),u=W(),a=z(),{accrual:c,actionFetchState:o,detailFetchState:f,localData:D}=h((i=>we(i,s??""))),C=h((i=>be(i))),x=h((i=>H(i))),r=I.useCallback((()=>{const i=ae(a.state?.pathnameStackToGoBack);u(i.poppedPathname??nt(4),{state:{pathnameStackToGoBack:i.newStack}})}),[a.state,u]),k=I.useRef(!1);return I.useEffect((()=>{o.fetchState!=="In-Progress"&&k.current&&o.fetchState==="Completed"&&(k.current=!1,r())}),[o.fetchState,r]),I.useEffect((()=>{s!=null&&c==null&&f.fetchState==="Not-Started"&&n(Je(s))}),[s,c,f.fetchState]),I.useEffect((()=>{n(Ne({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(K,{}):c==null?f.fetchState==="Not-Started"||f.fetchState==="In-Progress"?E.jsx(ne,{}):E.jsx(K,{}):E.jsx(ze,{isRenderedInPanel:e,accrual:c,actionFetchState:o.fetchState,isAccountingClassesEnabled:x,localData:D,newAccrualAccountsView:C,onAccrualFormChange:(i,m)=>{n(Ve({accrualId:i,localData:m}))},onAccrualFormClear:i=>{n(_e({accrualId:i}))},onApproveAndPost:i=>{n(Pe(s,i))},onNavigateBack:d??r,onRevert:(i,m)=>{k.current=!0,n(Oe(s,i,m))},onSkip:(i,m)=>{n(je(s,i,m))}})}const lt=he.getLocalizedStrings(),st=q((function(e,t){const d=de(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:d.linkBillExpenseView,transactions:d.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:d,location:l}=t;return{onTransactionSelect(s){e(Se({selectedTransaction:s}))},onBackClick:()=>{d("..",{relative:"path"})},onCancel(){e(Se({selectedTransaction:void 0})),e(Me()),d("..",{relative:"path"})},onTransactionClick:s=>{const n=`${V(s,t.tenantEmailDomain)}`,u=_(l.state?.pathnameStackToGoBack,l.pathname);d(n,{state:{pathnameStackToGoBack:u}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ge(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(Qe),bt=({setShouldNavigateBack:e})=>{const t=W(),d=z(),{scheduleDetailId:l,tenantEmailDomain:s}=M(),{scheduleType:n}=M();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const u=h((r=>F(r))),a=oe(n)??"accrued_expenses",c=Ze.getSignedInUser();if(c==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=h((r=>de(r,a))),f=o.selectedJELinkRowIndex,D=h((r=>X(r,u.companyId))),C=qe(o.updateStatus.fetchState);I.useEffect((()=>{C==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[C,o.updateStatus.fetchState]),I.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),I.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const x=o.linkBillExpenseView.fetchState==="Completed";return E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(He,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&f!=null?E.jsxs(E.Fragment,{children:[x===!0?E.jsx(le,{analytics:O,onLoad:()=>{ct(o,a,D)}}):null,E.jsx(st,{signedInUser:c,attachmentEndPoint:`${Xe}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:d,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:O,controllerUserDetails:D,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[f]})]}):null})},Le=e=>{const t=lt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},ct=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:u}=e.linkBillExpenseView,a=u.some((f=>f.isRecommendedTransaction===!0)),c=Q(d.controllers),o=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Le(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:c,controllerUserIds:o})},ot=pe.div`
1
+ import{j as E}from"./liveblocks-DFmQJs9l.js";import{a as I}from"./sentry-C-wepUYh.js";import{i as M,u as q,h as W,g as z,j as h,l as Z}from"./core-BmuD0S3N.js";import{V$ as we,W0 as be,l_ as H,rS as Je,s2 as Ne,sk as je,si as Oe,sl as Pe,so as _e,W1 as Ve,fE as F,U_ as oe,W2 as de,gZ as X,cB as Q,cC as ee,Ey as fe,W3 as Se,EC as Me,Sn as ie,Ew as Ge,Eq as Re,W4 as ue,Ei as $e,Eh as Fe,Ec as Ue,En as Ye,ED as Ke,W5 as U,W6 as re,Ej as We,U$ as te,gN as ge,ET as Ee,EM as De,W7 as ke,rY as Ce,EG as ye,EE as ve,W8 as Ae,E_ as Ie,EX as xe,EH as Te,EZ as Be}from"./zeni-epic-state-BzURQeUK.js";import{a4 as ae,aY as ne,aZ as ze,z as qe,l as Ze,a7 as He,a8 as le,j as O,av as Xe,a_ as Qe,p as _,G as he,K as me,a$ as et,b0 as tt,b1 as at}from"./index-CSXIBJ_M.js";import{n as pe}from"./mui-BM_3_akP.js";import{p as nt}from"./pathToGoBack-DSMtoOXp.js";import K from"./NotFoundScreen-DZ0EcL3w.js";import{c as V}from"./routePaths-V8Zj2E12.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]="a7141396-00e6-40a2-9e8f-61df8e9ff613",e._sentryDebugIdIdentifier="sentry-dbid-a7141396-00e6-40a2-9e8f-61df8e9ff613")}catch{}})();function wt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:d}={}){const{accrualId:l}=M(),s=t??l,n=q(),u=W(),a=z(),{accrual:c,actionFetchState:o,detailFetchState:g,localData:D}=h((i=>we(i,s??""))),C=h((i=>be(i))),x=h((i=>H(i))),r=I.useCallback((()=>{const i=ae(a.state?.pathnameStackToGoBack);u(i.poppedPathname??nt(4),{state:{pathnameStackToGoBack:i.newStack}})}),[a.state,u]),k=I.useRef(!1);return I.useEffect((()=>{o.fetchState!=="In-Progress"&&k.current&&o.fetchState==="Completed"&&(k.current=!1,r())}),[o.fetchState,r]),I.useEffect((()=>{s!=null&&c==null&&g.fetchState==="Not-Started"&&n(Je(s))}),[s,c,g.fetchState]),I.useEffect((()=>{n(Ne({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(K,{}):c==null?g.fetchState==="Not-Started"||g.fetchState==="In-Progress"?E.jsx(ne,{}):E.jsx(K,{}):E.jsx(ze,{isRenderedInPanel:e,accrual:c,actionFetchState:o.fetchState,isAccountingClassesEnabled:x,localData:D,newAccrualAccountsView:C,onAccrualFormChange:(i,m)=>{n(Ve({accrualId:i,localData:m}))},onAccrualFormClear:i=>{n(_e({accrualId:i}))},onApproveAndPost:i=>{n(Pe(s,i))},onNavigateBack:d??r,onRevert:(i,m)=>{k.current=!0,n(Oe(s,i,m))},onSkip:(i,m)=>{n(je(s,i,m))}})}const lt=he.getLocalizedStrings(),st=Z((function(e,t){const d=de(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:d.linkBillExpenseView,transactions:d.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:d,location:l}=t;return{onTransactionSelect(s){e(Se({selectedTransaction:s}))},onBackClick:()=>{d("..",{relative:"path"})},onCancel(){e(Se({selectedTransaction:void 0})),e(Me()),d("..",{relative:"path"})},onTransactionClick:s=>{const n=`${V(s,t.tenantEmailDomain)}`,u=_(l.state?.pathnameStackToGoBack,l.pathname);d(n,{state:{pathnameStackToGoBack:u}})},onLinkSave(){t.setShouldNavigateBack(!1),e(fe(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(Qe),bt=({setShouldNavigateBack:e})=>{const t=W(),d=z(),{scheduleDetailId:l,tenantEmailDomain:s}=M(),{scheduleType:n}=M();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const u=h((r=>F(r))),a=oe(n)??"accrued_expenses",c=qe.getSignedInUser();if(c==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=h((r=>de(r,a))),g=o.selectedJELinkRowIndex,D=h((r=>X(r,u.companyId))),C=Ze(o.updateStatus.fetchState);I.useEffect((()=>{C==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[C,o.updateStatus.fetchState]),I.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),I.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const x=o.linkBillExpenseView.fetchState==="Completed";return E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(He,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&g!=null?E.jsxs(E.Fragment,{children:[x===!0?E.jsx(le,{analytics:O,onLoad:()=>{ct(o,a,D)}}):null,E.jsx(st,{signedInUser:c,attachmentEndPoint:`${Xe}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:d,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:O,controllerUserDetails:D,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[g]})]}):null})},Le=e=>{const t=lt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},ct=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:u}=e.linkBillExpenseView,a=u.some((g=>g.isRecommendedTransaction===!0)),c=Q(d.controllers),o=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Le(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:c,controllerUserIds:o})},ot=pe.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as E}from"./liveblocks-Bqt_XhHh.js";import{a as I}from"./sentry-2yczjdj
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,dt=q((function(e){const t=F(e),d=e.entityAutoCompleteState.autoCompleteText.common,l=ue(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:d,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:d,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=ae(l.state?.pathnameStackToGoBack);n.poppedPathname==null?d("../schedules/accrued_expenses"):d(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ge(s,n))},onDelete:n=>{e(We(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,u)=>{n.trim().length>=2?e(re({searchString:n,entityType:u,searchOrigin:"common"})):n.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onEditAmount:(n,u)=>{e(Ke(s,n,u))},onJELinkClick:n=>{e(Ye({selectedJELinkRowIndex:n})),d("./edit_link")},onCancelAccrual:(n,u,a)=>{e(Ue(n,u,a))},onTransactionClick:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,u,a)=>{const{scheduleDetailsAccruedExpensesSection:c}=n,{amount:o,memo:f,months:D,scheduleAccruedExpenseCategory:C,scheduleClass:x,scheduleExpenseCategory:r,startDate:k,vendor:i}=c,m=x.selectedOption!=null?t.classList.find((T=>T.classId===x.selectedOption)):void 0,S=r.selectedOption!=null?t.accountList.find((T=>T.qboId===r.selectedOption)):void 0,L=C.selectedOption!=null?t.accruedAccountList.find((T=>T.qboId===C.selectedOption)):void 0,w=D?.selectedOption;e($e({scheduleType:s,localData:u,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||S?.accountId==null||t.isAccountingClassesEnabled!==!1&&m?.classId==null||L==null||i.selectedOption==null||f==null||o==null&&o==0||k==null||w==null||e(Fe({scheduleType:s}))}}}))(et),Jt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:d=!1,scheduleDetailIdOverride:l,onPanelNavigateBack:s}={})=>{const[n,u]=I.useState(!1),a=e??n,c=t??u,o=W(),f=z(),D=Z(),C=me(),{tenantEmailDomain:x}=M(),[r,k]=I.useState(!1);if(x==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=M(),m=l??i;let S;m!=="new"&&(S=m);const L=it(m),w=h((B=>B.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),T="accrued_expenses",y=h((B=>de(B,"accrued_expenses"))),b=h((B=>ie(B))),J=h((B=>B.classListState.fetchState)),N=h((B=>H(B))),v=b!=="Completed"||J!=="Completed";I.useEffect((()=>{r===!1&&v?(D(Ge(T,S)),k(!0)):v===!1&&r===!1&&m!=="new"&&(D(Re(T,m)),k(!0))}),[r]);const j=h((B=>F(B))),P=h((B=>X(B,j.companyId))),A=y.fetchState,G=y.allAccountList,R=y.allClassList,$=y.allAccruedAccountList,Y=y.scheduleAccruedDetailsLocalData;if(L!==!0||y.fetchState==="Error")return E.jsx(K,{});const g=A==="Completed"&&r===!0,p=y.selectedJEAccruedSchedule!=null;return A==="Completed"||A==="Not-Started"||d===!0&&p?E.jsxs(ot,{children:[g===!0?E.jsx(le,{analytics:O,onLoad:()=>{ut(y,T,P)}}):null,E.jsx(dt,{isRenderedInPanel:d,onPanelNavigateBack:s,setShouldNavigateBack:c,scheduleAccruedDetailsView:y,location:f,navigate:o,classList:R,accountList:G,shouldNavigateBack:a,accruedAccountList:$,scheduleLocalData:Y,selectedJEScheduleKey:w,scheduleDetailId:S,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:x,analytics:O,controllerUserDetails:P,isAccountingClassesEnabled:N,status:y.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ne,{})},it=e=>e!=null,ut=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=Q(d.controllers),n=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{...Le(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},rt=pe.div`
9
+ `,dt=Z((function(e){const t=F(e),d=e.entityAutoCompleteState.autoCompleteText.common,l=ue(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:d,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:d,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=ae(l.state?.pathnameStackToGoBack);n.poppedPathname==null?d("../schedules/accrued_expenses"):d(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(fe(s,n))},onDelete:n=>{e(We(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,u)=>{n.trim().length>=2?e(re({searchString:n,entityType:u,searchOrigin:"common"})):n.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onEditAmount:(n,u)=>{e(Ke(s,n,u))},onJELinkClick:n=>{e(Ye({selectedJELinkRowIndex:n})),d("./edit_link")},onCancelAccrual:(n,u,a)=>{e(Ue(n,u,a))},onTransactionClick:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,u,a)=>{const{scheduleDetailsAccruedExpensesSection:c}=n,{amount:o,memo:g,months:D,scheduleAccruedExpenseCategory:C,scheduleClass:x,scheduleExpenseCategory:r,startDate:k,vendor:i}=c,m=x.selectedOption!=null?t.classList.find((T=>T.classId===x.selectedOption)):void 0,S=r.selectedOption!=null?t.accountList.find((T=>T.qboId===r.selectedOption)):void 0,L=C.selectedOption!=null?t.accruedAccountList.find((T=>T.qboId===C.selectedOption)):void 0,w=D?.selectedOption;e($e({scheduleType:s,localData:u,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||S?.accountId==null||t.isAccountingClassesEnabled!==!1&&m?.classId==null||L==null||i.selectedOption==null||g==null||o==null&&o==0||k==null||w==null||e(Fe({scheduleType:s}))}}}))(et),Jt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:d=!1,scheduleDetailIdOverride:l,onPanelNavigateBack:s}={})=>{const[n,u]=I.useState(!1),a=e??n,c=t??u,o=W(),g=z(),D=q(),C=me(),{tenantEmailDomain:x}=M(),[r,k]=I.useState(!1);if(x==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=M(),m=l??i;let S;m!=="new"&&(S=m);const L=it(m),w=h((B=>B.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),T="accrued_expenses",y=h((B=>de(B,"accrued_expenses"))),b=h((B=>ie(B))),J=h((B=>B.classListState.fetchState)),N=h((B=>H(B))),v=b!=="Completed"||J!=="Completed";I.useEffect((()=>{r===!1&&v?(D(Ge(T,S)),k(!0)):v===!1&&r===!1&&m!=="new"&&(D(Re(T,m)),k(!0))}),[r]);const j=h((B=>F(B))),P=h((B=>X(B,j.companyId))),A=y.fetchState,G=y.allAccountList,R=y.allClassList,$=y.allAccruedAccountList,Y=y.scheduleAccruedDetailsLocalData;if(L!==!0||y.fetchState==="Error")return E.jsx(K,{});const f=A==="Completed"&&r===!0,p=y.selectedJEAccruedSchedule!=null;return A==="Completed"||A==="Not-Started"||d===!0&&p?E.jsxs(ot,{children:[f===!0?E.jsx(le,{analytics:O,onLoad:()=>{ut(y,T,P)}}):null,E.jsx(dt,{isRenderedInPanel:d,onPanelNavigateBack:s,setShouldNavigateBack:c,scheduleAccruedDetailsView:y,location:g,navigate:o,classList:R,accountList:G,shouldNavigateBack:a,accruedAccountList:$,scheduleLocalData:Y,selectedJEScheduleKey:w,scheduleDetailId:S,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:x,analytics:O,controllerUserDetails:P,isAccountingClassesEnabled:N,status:y.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ne,{})},it=e=>e!=null,ut=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=Q(d.controllers),n=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{...Le(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},rt=pe.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as E}from"./liveblocks-Bqt_XhHh.js";import{a as I}from"./sentry-2yczjdj
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,se=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ht=q((function(e){const t=F(e),d=te(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:d}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u="fixed_assets",a=n.flatMap((c=>c.error)).filter((c=>!!c))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const c=ae(t.location.state?.pathnameStackToGoBack);c.poppedPathname==null?d("../schedules/fixed_assets"):t.navigate(c.poppedPathname,{state:{pathnameStackToGoBack:c.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:c=>{e(Be(u,c,a.length>0))},onDelete:c=>{e(Te(u,c))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(u,t.selectedJEScheduleKey))},onEditAmount:(c,o)=>{e(Ie(u,c,o))},onJELinkClick:c=>{e(Ae({selectedJELinkRowIndex:c})),d("./edit_link")},onTransactionClick:c=>{const o=`${V(c,t.tenantEmailDomain)}`,f=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:f,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:c=>{const o=`${V(c,t.tenantEmailDomain)}`,f=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:f}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(c,o)=>{c.trim().length>=2?e(re({searchString:c,entityType:o,searchOrigin:"common"})):c.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(c,o)=>{const{scheduleDetailsFixedAssetsSection:f,scheduleDetailsListSection:D}=c,{scheduleClass:C,scheduleExpenseCategory:x,accumulatedDepreciationCategory:r,assetId:k,months:i,startDate:m,postingDate:S,vendor:L}=f,w=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((A=>A.id===L?.selectedOption)):void 0,T={id:w?.zeniId??L?.selectedOption??"",name:w?.name??L?.defaultOptions.find((A=>A.value===L?.selectedOption))?.label??"",logo:w?.logo},y=C.selectedOption!=null?t.classList.find((A=>A.classId===C.selectedOption)):void 0,b=x.selectedOption!=null?t.accountList.find((A=>A.qboId===x.selectedOption)):void 0,J=r.selectedOption!=null?t.depAccountList.find((A=>A.qboId===r.selectedOption)):void 0,N=i?.selectedOption,v=D.map(((A,G)=>({...t.scheduleLocalData.jeScheduleDetails[G],amount:{...t.scheduleLocalData.jeScheduleDetails[G].amount,amount:A.amount}}))),j=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,P=S.type==="lastDayOfMonth"||void 0;e(ye({scheduleType:u,localData:{selectedAccount:b?.accountId,selectedClass:y?.classId,selectedAccumulatedDepreciationCategory:J?.accountId,selectedDate:m,selectedMonths:N,assetId:k,jeScheduleDetails:v,lastDayOfMonth:P,selectedDayOfMonth:j,selectedVendor:T},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||J?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||b?.accountId==null||t.isAccountingClassesEnabled!==!1&&y?.classId==null||m==null||N==null||P!==!0&&j==null||e(ve({scheduleType:u}))}}}))(tt),Nt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelNavigateBack:d}={})=>{const l=W(),s=z(),n=Z(),u=me(),{tenantEmailDomain:a}=M(),[c,o]=I.useState(!1),{scheduleDetailId:f}=M(),D=t??f,C=s.state?.message==="expenseAutomation",x=mt(D),r=h((g=>g.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{r!=null&&r.length!==0||D!=="new"||l("../schedules/fixed_assets")}),[r,D]);const k="fixed_assets",i=h((g=>te(g,k))),m=h((g=>g.entityAutoCompleteState.autoCompleteText.common)),S=h((g=>ue(g,"common"))),L=h((g=>ie(g))),w=h((g=>g.classListState.fetchState)),T=h((g=>H(g))),y=h((g=>fe(g).selectedPeriod)),b=L!=="Completed"||w!=="Completed";I.useEffect((()=>{c===!1&&b?(n(Ee(k,R,!0)),o(!0)):b===!1&&c===!1&&(n(De(k,D==="new"?void 0:D,!0)),o(!0))}),[c]),I.useEffect((()=>{if(i.markAsCompleteStatus.fetchState==="Completed")if(n(ke()),C===!0){const{month:g,year:p}=y;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else l("../schedules/fixed_assets")}),[i.markAsCompleteStatus.fetchState]);const J=h((g=>F(g))),N=h((g=>X(g,J.companyId))),v=i.fetchState,j=i.allAccountList,P=i.allClassList,A=i.allDepreciationAccountList,G=i.scheduleDetailsLocalData.fixed_assets;let R;if(D!=="new"&&(R=D),x!==!0||i.fetchState==="Error")return E.jsx(K,{});const $=v==="Completed"&&c===!0,Y=i.selectedJEScheduleTransaction!=null;return v==="Completed"||e===!0&&Y?E.jsxs(rt,{children:[$===!0?E.jsx(le,{analytics:O,onLoad:()=>{St(i,k,N)}}):null,E.jsx(ht,{isRenderedInPanel:e,onPanelNavigateBack:d,location:s,navigate:l,classList:P,vendorSearchEntityAutoCompleteView:S,vendorSearchAutoCompleteData:{autoCompleteText:m,entityAutoCompleteView:S},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{n(Ce(g,p))},accountList:j,depAccountList:A,scheduleLocalData:G,selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:i.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:u,tenantEmailDomain:a,analytics:O,controllerUserDetails:N,isAccountingClassesEnabled:T,status:i.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},mt=e=>e!=null,pt=e=>({transactionDate:e.date.format(se),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),St=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...pt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(se)??null,endMonth:a.endDate?.format(se)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:u})},gt=pe.div`
17
+ `,se=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ht=Z((function(e){const t=F(e),d=te(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:d}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u="fixed_assets",a=n.flatMap((c=>c.error)).filter((c=>!!c))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const c=ae(t.location.state?.pathnameStackToGoBack);c.poppedPathname==null?d("../schedules/fixed_assets"):t.navigate(c.poppedPathname,{state:{pathnameStackToGoBack:c.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:c=>{e(Be(u,c,a.length>0))},onDelete:c=>{e(Te(u,c))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(u,t.selectedJEScheduleKey))},onEditAmount:(c,o)=>{e(Ie(u,c,o))},onJELinkClick:c=>{e(Ae({selectedJELinkRowIndex:c})),d("./edit_link")},onTransactionClick:c=>{const o=`${V(c,t.tenantEmailDomain)}`,g=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:g,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:c=>{const o=`${V(c,t.tenantEmailDomain)}`,g=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:g}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(c,o)=>{c.trim().length>=2?e(re({searchString:c,entityType:o,searchOrigin:"common"})):c.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(c,o)=>{const{scheduleDetailsFixedAssetsSection:g,scheduleDetailsListSection:D}=c,{scheduleClass:C,scheduleExpenseCategory:x,accumulatedDepreciationCategory:r,assetId:k,months:i,startDate:m,postingDate:S,vendor:L}=g,w=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((A=>A.id===L?.selectedOption)):void 0,T={id:w?.zeniId??L?.selectedOption??"",name:w?.name??L?.defaultOptions.find((A=>A.value===L?.selectedOption))?.label??"",logo:w?.logo},y=C.selectedOption!=null?t.classList.find((A=>A.classId===C.selectedOption)):void 0,b=x.selectedOption!=null?t.accountList.find((A=>A.qboId===x.selectedOption)):void 0,J=r.selectedOption!=null?t.depAccountList.find((A=>A.qboId===r.selectedOption)):void 0,N=i?.selectedOption,v=D.map(((A,G)=>({...t.scheduleLocalData.jeScheduleDetails[G],amount:{...t.scheduleLocalData.jeScheduleDetails[G].amount,amount:A.amount}}))),j=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,P=S.type==="lastDayOfMonth"||void 0;e(ye({scheduleType:u,localData:{selectedAccount:b?.accountId,selectedClass:y?.classId,selectedAccumulatedDepreciationCategory:J?.accountId,selectedDate:m,selectedMonths:N,assetId:k,jeScheduleDetails:v,lastDayOfMonth:P,selectedDayOfMonth:j,selectedVendor:T},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||J?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||b?.accountId==null||t.isAccountingClassesEnabled!==!1&&y?.classId==null||m==null||N==null||P!==!0&&j==null||e(ve({scheduleType:u}))}}}))(tt),Nt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelNavigateBack:d}={})=>{const l=W(),s=z(),n=q(),u=me(),{tenantEmailDomain:a}=M(),[c,o]=I.useState(!1),{scheduleDetailId:g}=M(),D=t??g,C=s.state?.message==="expenseAutomation",x=mt(D),r=h((f=>f.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{r!=null&&r.length!==0||D!=="new"||l("../schedules/fixed_assets")}),[r,D]);const k="fixed_assets",i=h((f=>te(f,k))),m=h((f=>f.entityAutoCompleteState.autoCompleteText.common)),S=h((f=>ue(f,"common"))),L=h((f=>ie(f))),w=h((f=>f.classListState.fetchState)),T=h((f=>H(f))),y=h((f=>ge(f).selectedPeriod)),b=L!=="Completed"||w!=="Completed";I.useEffect((()=>{c===!1&&b?(n(Ee(k,R,!0)),o(!0)):b===!1&&c===!1&&(n(De(k,D==="new"?void 0:D,!0)),o(!0))}),[c]),I.useEffect((()=>{if(i.markAsCompleteStatus.fetchState==="Completed")if(n(ke()),C===!0){const{month:f,year:p}=y;l(`../../month_end_close_checks/review/je_schedules/${f}-${p}`)}else l("../schedules/fixed_assets")}),[i.markAsCompleteStatus.fetchState]);const J=h((f=>F(f))),N=h((f=>X(f,J.companyId))),v=i.fetchState,j=i.allAccountList,P=i.allClassList,A=i.allDepreciationAccountList,G=i.scheduleDetailsLocalData.fixed_assets;let R;if(D!=="new"&&(R=D),x!==!0||i.fetchState==="Error")return E.jsx(K,{});const $=v==="Completed"&&c===!0,Y=i.selectedJEScheduleTransaction!=null;return v==="Completed"||e===!0&&Y?E.jsxs(rt,{children:[$===!0?E.jsx(le,{analytics:O,onLoad:()=>{St(i,k,N)}}):null,E.jsx(ht,{isRenderedInPanel:e,onPanelNavigateBack:d,location:s,navigate:l,classList:P,vendorSearchEntityAutoCompleteView:S,vendorSearchAutoCompleteData:{autoCompleteText:m,entityAutoCompleteView:S},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(f,p)=>{n(Ce(f,p))},accountList:j,depAccountList:A,scheduleLocalData:G,selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:i.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:u,tenantEmailDomain:a,analytics:O,controllerUserDetails:N,isAccountingClassesEnabled:T,status:i.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},mt=e=>e!=null,pt=e=>({transactionDate:e.date.format(se),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),St=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...pt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(se)??null,endMonth:a.endDate?.format(se)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:u})},ft=pe.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,4 +22,4 @@ import{j as E}from"./liveblocks-Bqt_XhHh.js";import{a as I}from"./sentry-2yczjdj
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,ce=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ft=q((function(e,t){const d=F(e),l=te(e,t.scheduleTab);return{tenantName:d.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=ae(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?d("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Be(t.scheduleTab,a,u.length>0))},onDelete:a=>{e(Te(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,c)=>{e(Ie(t.scheduleTab,a,c))},onJELinkClick:a=>{e(Ae({selectedJELinkRowIndex:a})),d("./edit_link")},onTransactionClick:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,c)=>{a.trim().length>=2?e(re({searchString:a,entityType:c,searchOrigin:"common"})):a.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(a,c)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:f}=a,{scheduleClass:D,scheduleExpenseCategory:C,months:x,startDate:r,postingDate:k,vendor:i}=o,m=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((v=>v.id===i?.selectedOption)):void 0,S={id:m?.zeniId??i?.selectedOption??"",name:m?.name??i?.defaultOptions.find((v=>v.value===i?.selectedOption))?.label??"",logo:m?.logo},L=D.selectedOption!=null?t.classList.find((v=>v.classId===D.selectedOption)):void 0,w=C.selectedOption!=null?t.accountList.find((v=>v.qboId===C.selectedOption)):void 0,T=x?.selectedOption,y=f.map(((v,j)=>({...t.scheduleLocalData.jeScheduleDetails[j],amount:{...t.scheduleLocalData.jeScheduleDetails[j].amount,amount:v.amount}}))),b=k.type==="day"?k.dayOfMonth?k.dayOfMonth:1:void 0,J=k.type==="lastDayOfMonth"||void 0,N={selectedAccount:w?.accountId,selectedClass:L?.classId,selectedDate:r,selectedMonths:T,jeScheduleDetails:y,lastDayOfMonth:J,selectedVendor:S,selectedDayOfMonth:b};e(ye({scheduleType:t.scheduleTab,localData:N,selectedJeScheduleDetailId:t.scheduleDetailId})),c!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||w?.accountId==null||t.isAccountingClassesEnabled!==!1&&L?.classId==null||r==null||T==null||J!==!0&&b==null||e(ve({scheduleType:t.scheduleTab}))}}}))(at),jt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:d,onPanelNavigateBack:l}={})=>{const s=W(),n=z(),u=Z(),a=me(),{tenantEmailDomain:c}=M(),[o,f]=I.useState(!1),D=n.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:x}=M(),r=t??x,k=Et(d??C,r),i=h((p=>p.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{i!=null&&i.length!==0||r!=="new"||s("../schedules/prepaid_expenses")}),[i,r]);const m=d??oe(C)??"prepaid_expenses",S=h((p=>te(p,m))),L=h((p=>p.entityAutoCompleteState.autoCompleteText.common)),w=h((p=>ue(p,"common"))),T=h((p=>ie(p))),y=h((p=>p.classListState.fetchState)),b=h((p=>H(p))),J=h((p=>fe(p).selectedPeriod)),N=T!=="Completed"||y!=="Completed";I.useEffect((()=>{o===!1&&N?(u(Ee(m,$,!0)),f(!0)):N===!1&&o===!1&&(u(De(m,r==="new"?void 0:r,!0)),f(!0))}),[o]),I.useEffect((()=>{if(S.markAsCompleteStatus.fetchState==="Completed")if(u(ke()),D===!0){const{month:p,year:B}=J;s(`../../month_end_close_checks/review/je_schedules/${p}-${B}`)}else s("../schedules/prepaid_expenses")}),[S.markAsCompleteStatus.fetchState]);const v=h((p=>F(p))),j=h((p=>X(p,v.companyId))),P=S.fetchState,A=S.allAccountList,G=S.allClassList,R=S.scheduleDetailsLocalData;let $;if(r!=="new"&&($=r),k!==!0||S.fetchState==="Error")return E.jsx(K,{});const Y=P==="Completed"&&o===!0,g=S.selectedJEScheduleTransaction!=null;return P==="Completed"||e===!0&&g?E.jsxs(gt,{children:[Y===!0?E.jsx(le,{analytics:O,onLoad:()=>{kt(S,m,j)}}):null,E.jsx(ft,{isRenderedInPanel:e,onPanelNavigateBack:l,location:n,vendorSearchEntityAutoCompleteView:w,vendorSearchAutoCompleteData:{autoCompleteText:L,entityAutoCompleteView:w},usedInExpenseAutomation:D,removeJeScheduleTransactionKey:(p,B)=>{u(Ce(p,B))},expenseAutomationSelectedPeriod:J,navigate:s,classList:G,accountList:A,scheduleLocalData:R[m],selectedJEScheduleKey:i,scheduleDetailId:$,selectedScheduledJournalEntries:S.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:c,scheduleTab:m,analytics:O,controllerUserDetails:j,isAccountingClassesEnabled:b,status:S.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},Et=(e,t)=>oe(e)!=null&&t!=null,Dt=e=>({transactionDate:e.date.format(ce),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),kt=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Dt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(ce)??null,endMonth:a.endDate?.format(ce)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:u})};export{wt as J,Nt as S,Jt as a,jt as b,bt as c};
25
+ `,ce=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,gt=Z((function(e,t){const d=F(e),l=te(e,t.scheduleTab);return{tenantName:d.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=ae(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?d("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Be(t.scheduleTab,a,u.length>0))},onDelete:a=>{e(Te(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,c)=>{e(Ie(t.scheduleTab,a,c))},onJELinkClick:a=>{e(Ae({selectedJELinkRowIndex:a})),d("./edit_link")},onTransactionClick:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,c)=>{a.trim().length>=2?e(re({searchString:a,entityType:c,searchOrigin:"common"})):a.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(a,c)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:g}=a,{scheduleClass:D,scheduleExpenseCategory:C,months:x,startDate:r,postingDate:k,vendor:i}=o,m=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((v=>v.id===i?.selectedOption)):void 0,S={id:m?.zeniId??i?.selectedOption??"",name:m?.name??i?.defaultOptions.find((v=>v.value===i?.selectedOption))?.label??"",logo:m?.logo},L=D.selectedOption!=null?t.classList.find((v=>v.classId===D.selectedOption)):void 0,w=C.selectedOption!=null?t.accountList.find((v=>v.qboId===C.selectedOption)):void 0,T=x?.selectedOption,y=g.map(((v,j)=>({...t.scheduleLocalData.jeScheduleDetails[j],amount:{...t.scheduleLocalData.jeScheduleDetails[j].amount,amount:v.amount}}))),b=k.type==="day"?k.dayOfMonth?k.dayOfMonth:1:void 0,J=k.type==="lastDayOfMonth"||void 0,N={selectedAccount:w?.accountId,selectedClass:L?.classId,selectedDate:r,selectedMonths:T,jeScheduleDetails:y,lastDayOfMonth:J,selectedVendor:S,selectedDayOfMonth:b};e(ye({scheduleType:t.scheduleTab,localData:N,selectedJeScheduleDetailId:t.scheduleDetailId})),c!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||w?.accountId==null||t.isAccountingClassesEnabled!==!1&&L?.classId==null||r==null||T==null||J!==!0&&b==null||e(ve({scheduleType:t.scheduleTab}))}}}))(at),jt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:d,onPanelNavigateBack:l}={})=>{const s=W(),n=z(),u=q(),a=me(),{tenantEmailDomain:c}=M(),[o,g]=I.useState(!1),D=n.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:x}=M(),r=t??x,k=Et(d??C,r),i=h((p=>p.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{i!=null&&i.length!==0||r!=="new"||s("../schedules/prepaid_expenses")}),[i,r]);const m=d??oe(C)??"prepaid_expenses",S=h((p=>te(p,m))),L=h((p=>p.entityAutoCompleteState.autoCompleteText.common)),w=h((p=>ue(p,"common"))),T=h((p=>ie(p))),y=h((p=>p.classListState.fetchState)),b=h((p=>H(p))),J=h((p=>ge(p).selectedPeriod)),N=T!=="Completed"||y!=="Completed";I.useEffect((()=>{o===!1&&N?(u(Ee(m,$,!0)),g(!0)):N===!1&&o===!1&&(u(De(m,r==="new"?void 0:r,!0)),g(!0))}),[o]),I.useEffect((()=>{if(S.markAsCompleteStatus.fetchState==="Completed")if(u(ke()),D===!0){const{month:p,year:B}=J;s(`../../month_end_close_checks/review/je_schedules/${p}-${B}`)}else s("../schedules/prepaid_expenses")}),[S.markAsCompleteStatus.fetchState]);const v=h((p=>F(p))),j=h((p=>X(p,v.companyId))),P=S.fetchState,A=S.allAccountList,G=S.allClassList,R=S.scheduleDetailsLocalData;let $;if(r!=="new"&&($=r),k!==!0||S.fetchState==="Error")return E.jsx(K,{});const Y=P==="Completed"&&o===!0,f=S.selectedJEScheduleTransaction!=null;return P==="Completed"||e===!0&&f?E.jsxs(ft,{children:[Y===!0?E.jsx(le,{analytics:O,onLoad:()=>{kt(S,m,j)}}):null,E.jsx(gt,{isRenderedInPanel:e,onPanelNavigateBack:l,location:n,vendorSearchEntityAutoCompleteView:w,vendorSearchAutoCompleteData:{autoCompleteText:L,entityAutoCompleteView:w},usedInExpenseAutomation:D,removeJeScheduleTransactionKey:(p,B)=>{u(Ce(p,B))},expenseAutomationSelectedPeriod:J,navigate:s,classList:G,accountList:A,scheduleLocalData:R[m],selectedJEScheduleKey:i,scheduleDetailId:$,selectedScheduledJournalEntries:S.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:c,scheduleTab:m,analytics:O,controllerUserDetails:j,isAccountingClassesEnabled:b,status:S.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},Et=(e,t)=>oe(e)!=null&&t!=null,Dt=e=>({transactionDate:e.date.format(ce),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),kt=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Dt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(ce)??null,endMonth:a.endDate?.format(ce)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:u})};export{wt as J,Nt as S,Jt as a,jt as b,bt as c};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-B-YpUYOf.js","assets/sentry-2yczjdjC.js","assets/core-FnF-Uc4O.js","assets/zeni-epic-state-Ch0HFr9W.js","assets/index-Ecojj-Pb.js","assets/mui-gvvniK3d.js","assets/analytics-Vv7iwE-7.js","assets/utils-BW8U-ATx.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-CnMEptqH.js","assets/withTransactionSidePanel-Bbcq3RMx.js","assets/useAskAiCfoHostNavButtonProps-BC2E97t6.js","assets/TransactionDetailScreen-CsT2rgA9.js","assets/decodeURIComponentSafe-Dcy3wJS-.js","assets/useInitialThreadRequest-B4xEyjqp.js","assets/routePaths-C3Wl814x.js","assets/expenseAutomationHelper-VQqpchU0.js","assets/analyticsHelper-De2OvKV1.js","assets/CompanyPassportScreen-BOBPyOSL.js","assets/MobileAppDrawer-BG_dPpHH.js","assets/InboxNotificationsProvider-DpFe93lp.js","assets/useTaskManagerAccess-C4k1vquW.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DOFL_vWR.js","assets/FeaturePreviewScreen-BQgcXL7a.js","assets/BillPayRoutes-CowHMkMc.js","assets/AddressScreen-CJt2Q_Ar.js","assets/DomesticWireDetailScreen-5_2NP_sv.js","assets/BusinessVerificationPageScreen-CBHdFJPr.js","assets/DrawerScreen-Cb3FMUNp.js","assets/SetupPagesScreen-BTAx9706.js","assets/BillPayApprovalRoutes-DUWk7mrJ.js","assets/ReimbursementApprovalRuleDetailScreen-Caabj-x6.js","assets/getLocaleForTenant-DYIzeFnW.js","assets/ReimbursementRoutes-CulSVZ0W.js","assets/ReimbursementApprovalRoutes-BB31uN18.js","assets/TransactionListRoutes-CUT6tJhC.js","assets/ZeniAccountStatementScreen-D9MYrURY.js","assets/SettingsRoutes-QF4q0Ccc.js","assets/AccountMappingScreen-Bo9SjIQs.js","assets/QBOConnectionScreen-BVDyTxl7.js","assets/empty-ClAnc2XI.js","assets/index-DrlR6PPl.js","assets/url-Q0BVeI-7.js","assets/index-Dy5h_qvb.js","assets/accountMappingHelper-DkWE8zWp.js","assets/useEmailConnectResultRefresh-DWR-6F3l.js","assets/ReportsRoutes-C6Kwp2Hc.js","assets/ChargeCardRoutes-CJr3MIna.js","assets/useChargeCardPusherEvents-BCU1j21B.js","assets/PeopleRoutes-D25kcrVR.js","assets/ExpenseAutomationRoutes-CxtmROEv.js","assets/ScheduleDetailsPrepaidExpensesScreen-CoClL9S-.js","assets/pathToGoBack-oY27p9ir.js","assets/TreasuryRoutes-DLm2Dxdv.js","assets/VendorsRoutes-UZu-x_KY.js","assets/ZeniAccountRoutes-BO7pOpAA.js","assets/AddressRoutes-BWBOU6H9.js","assets/PandLWithForecastRoutes-D3GxV6j5.js","assets/CustomerOnboardingRoutes-D3V4jdlp.js","assets/TransactionDetailRoutes-BtwuKCIj.js","assets/EntityDetailRoutes-B4z6U0M7.js","assets/InvoicingRoutes-CKDAZIay.js","assets/NotificationRoutes-BeUGz2oT.js","assets/PerformanceRoutes-Rt6fwEVs.js","assets/RewardsRoutes-C2QpGt1k.js","assets/TaskRoutes-B9rWCVPV.js","assets/TaskListScreen-Ds2QBdT7.js","assets/AiCfoScreen-DYQiSBc3.js","assets/CardsAiCfoScreen-gdSfcNDz.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as ms,fE as _s,dY as Es,dX as hs,Al as ps,dh as gs,c8 as Rs,gI as xs,g8 as js,de as pe,cG as Is,gm as Ts,cy as As,bE as bs,br as fs,Ts as ys,v as Ds,Tv as Cs,bq as vs,Tw as Os,bK as Ps,bJ as ws,bt as Us,cu as Fs,Tx as Ls,Ty as ks,d9 as Hs,dc as Vs,db as Ss,cF as Bs,cM as Ns,pR as ge,gh as Re,gX as Ms,gj as xe,gK as je,gL as Ie,gk as Zs}from"./zeni-epic-state-Ch0HFr9W.js";import{j as e}from"./liveblocks-Bqt_XhHh.js";import{a as w}from"./sentry-2yczjdjC.js";import{N as u,u as Gs,h as $s,i as zs,g as Ys,j as $,q as Te,n as qs,o as t}from"./core-FnF-Uc4O.js";import{N as l,E as Ws,u as Xs,z as y,O as Ks,d as Qs,g as Js,y as M,f as en,P as sn,Q as nn,L as F,G as Ae,t as _,R as tn,S as an,j as ne}from"./index-Ecojj-Pb.js";import"./mui-gvvniK3d.js";import{f as be}from"./analyticsHelper-De2OvKV1.js";import{t as on}from"./getLocaleForTenant-DYIzeFnW.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},A=new a.Error().stack;A&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[A]="926af3c4-2934-4b46-9d9d-f2d46b5be651",a._sentryDebugIdIdentifier="sentry-dbid-926af3c4-2934-4b46-9d9d-f2d46b5be651")}catch{}})();const rn=l((()=>s((()=>import("./NotFoundScreen-B-YpUYOf.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ln=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),un=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/bills`}),fe=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/treasury`}),ye=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/checking`}),De=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/cards`}),D=({showZeniAccountRoute:a,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:S,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(k===!0){if(a)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(fe,{tenantEmailDomain:v});if(O)return e.jsx(De,{tenantEmailDomain:v})}return a?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(fe,{tenantEmailDomain:v}):O?e.jsx(De,{tenantEmailDomain:v}):A?e.jsx(un,{tenantEmailDomain:v}):S?e.jsx(ln,{tenantEmailDomain:v}):e.jsx(rn,{})},dn={dashboard:()=>s((()=>import("./DashboardRoutes-CnMEptqH.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])),bills:()=>s((()=>import("./BillPayRoutes-CowHMkMc.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-CulSVZ0W.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])),transactions:()=>s((()=>import("./TransactionListRoutes-CUT6tJhC.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-QF4q0Ccc.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])),reports:()=>s((()=>import("./ReportsRoutes-C6Kwp2Hc.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CJr3MIna.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])),people:()=>s((()=>import("./PeopleRoutes-D25kcrVR.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CxtmROEv.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])),treasury:()=>s((()=>import("./TreasuryRoutes-DLm2Dxdv.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])),vendors:()=>s((()=>import("./VendorsRoutes-UZu-x_KY.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-BO7pOpAA.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8]))},cn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},mn=l((()=>s((()=>import("./ReportsRoutes-C6Kwp2Hc.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),_n=l((()=>s((()=>import("./AddressRoutes-BWBOU6H9.js")),__vite__mapDeps([56,1,2,3,25,4,5,6,7,0,8])))),En=l((()=>s((()=>import("./PeopleRoutes-D25kcrVR.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),hn=l((()=>s((()=>import("./PandLWithForecastRoutes-D3GxV6j5.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),pn=l((()=>s((()=>import("./CustomerOnboardingRoutes-D3V4jdlp.js")),__vite__mapDeps([58,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),gn=l((()=>s((()=>import("./VendorsRoutes-UZu-x_KY.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])))),Rn=l((()=>s((()=>import("./TransactionDetailRoutes-BtwuKCIj.js")),__vite__mapDeps([59,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-B4z6U0M7.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),xn=l((()=>s((()=>import("./DashboardRoutes-CnMEptqH.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-CowHMkMc.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])))),jn=l((()=>s((()=>import("./SettingsRoutes-QF4q0Ccc.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])))),In=l((()=>s((()=>import("./InvoicingRoutes-CKDAZIay.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,25,0,19,20,21,39,40,41,42,43,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-CulSVZ0W.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])))),Tn=l((()=>s((()=>import("./ZeniAccountRoutes-BO7pOpAA.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8])))),An=l((()=>s((()=>import("./TreasuryRoutes-DLm2Dxdv.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),bn=l((()=>s((()=>import("./TransactionListRoutes-CUT6tJhC.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),fn=l((()=>s((()=>import("./ChargeCardRoutes-CJr3MIna.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),yn=l((()=>s((()=>import("./NotificationRoutes-BeUGz2oT.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,21,8])))),Dn=l((()=>s((()=>import("./PerformanceRoutes-Rt6fwEVs.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,11,19,20,21,8])))),Cn=l((()=>s((()=>import("./ExpenseAutomationRoutes-CxtmROEv.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])))),vn=l((()=>s((()=>import("./RewardsRoutes-C2QpGt1k.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,0,8])))),On=l((()=>s((()=>import("./TaskRoutes-B9rWCVPV.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,14,19,20,21,66,11,8])))),Pn=l((()=>s((()=>import("./AiCfoScreen-DYQiSBc3.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,22,52,15,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-gdSfcNDz.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-B-YpUYOf.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),wn=l((()=>s((()=>import("./TaskListScreen-Ds2QBdT7.js").then((a=>a.f))),__vite__mapDeps([66,1,2,3,4,5,6,7,11,19,20,21,8])))),Un=({isDashboardAccess:a,showZeniAccountRoute:A,isUserHasBillPayAccess:S,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:H})=>{if(O===!0){if(A)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return v===!0&&H?e.jsx(u,{to:"cards"}):a?e.jsx(u,{to:"dashboard"}):A?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):S?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},we=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/dashboard`}),Mn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Gs(),S=$s(),{tenantEmailDomain:i}=zs(),k=Ws().mode,{setLoading:O,clearAllLoading:v,clearLoading:H}=Xs(),b=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),X=ms(I),z=Ys(),[L,Ue]=w.useState(!1),r=$((o=>_s(o))),{useFeatureGate:B}=Ks(),Z=Qs(),ae=Js(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=B(M.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=B(M.isDebitCardFeatureEnabled),T=$((o=>o.tenantState.fetchState)),p=$((o=>o.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?Es(oe,r):void 0,K=p==="Completed"||T==="Completed"?hs(r):void 0,re=p==="Completed"||T==="Completed"?ps(r)&&!gs(r):void 0,He=en(r,ke,oe),{isCardsHidden:Ve}=sn(r?.tenantId),Se=!He||!!Ve,{isFeatureEnabled:Be}=B(M.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=B(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=B(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||an==="DEV",Ze=r?.userRole!=null&&Rs(r.userRole),Y=$((o=>xs(o)));if(i!=null){const o=y.getSignedInUserTenant(i);I!=null&&o!=null&&be(I,r,k)}const G={tenantId:b,userId:I?.userId,sessionId:I?.zeniSessionId},ie=js(),h=nn(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=Is(h?.loggedInUserRoleMap),J=Te("/:tenantEmailDomain/onboarding/*")!==null,ee=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ze=$((o=>G.tenantId!=null?Ts(o,G.tenantId):void 0));w.useEffect((()=>{O(F.TENANT_FETCHING),a(i)}),[i]),w.useEffect((()=>{if(ee!=null&&b!=null){const o=ee.params.selectedPeriod;if(o!=null){const f=o.split("-");if(f.length===2){const d=As(Number(f[0])),n=Number(f[1]),c=bs(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=fs();c.isAfter(N,"month")===!1?A(ys(b,{month:d,year:n})):S(`/${i}/month_end_close_checks/review`)}}}}),[ee,b]),w.useEffect((()=>{L||(Ue(!0),O(F.TENANT_FETCHING))}),[L,G,ie,I,A,y]),w.useLayoutEffect((()=>{!Ds(ie,G)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,f,d,n){if(Re(f?.userId,f?.zeniSessionId,o.tenantId),d(Ms(!0)),d(xe(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=y.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(on(n)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,I,A,ze))}),[b]),w.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,f,d,n,c,N,V){if(d==null&&n==null)return void console.warn("There is no current tenant selected!!");const q=n!=null&&c?.zeniSessionId!=null,us=d==null||d.tenantId!==n,ds=d!=null&&d.excludedResources==null,cs=d!=null&&d.externalConnections==null;if(q&&us){V(xe(n));const W=y.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),Re(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),V(je(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),V(Ie(c.userId,n)))}else q&&ds&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),V(je(c.userId,n))),q&&cs&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),V(Ie(c.userId,n)));if(q){ne.identify(c.userId,{tenant_id:n});const W=n==null||n!=null&&(f==="Completed"||f==="Error");o==="Completed"||f!=="Not-Started"&&f!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),N(F.TENANT_FETCHING),V(Zs(c.userId,n,c.zeniSessionId))),W&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),V(ge(c.userId,c.zeniSessionId)))}})(T,p,r,b,I,O,A))}),[b,p]),w.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&Y.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Cs(Y.tenantsBaseInOrder)),I!=null&&be(I,r,k,void 0,Y.tenantsBaseInOrder))}),[Y,T,r,I]),w.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(v(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,b,L]);const le=w.useRef(!1);w.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(o=cn,f=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=dn[c];N!=null?N().then((()=>te((()=>d(n+1))))).catch((()=>te((()=>d(n+1))))):d(n+1)};te((()=>d(0)))}),f)})())}),[p,L]);const P=r?.userRole!=null&&vs(r?.userRole),{isFeatureEnabled:Ye}=B(M.isReferralFeatureEnabled),qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),We=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),U=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Se&&!P,Xe=Os(h?.loggedInUserRoleMap),Ke=r.externalConnections?.accounting[0]?.isValid,Qe=r.externalConnections?.fetchState==="Completed",se=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&Ps(h?.loggedInUserRoleMap),_e=Fe&&!P,Je=Le&&!P,es=ue&&ws(h?.loggedInUserRoleMap),ss=de&&Us(h?.loggedInUserRoleMap),ns=_e&&Fs(h?.loggedInUserRoleMap),ts=Ls(h?.loggedInUserRoleMap),as=ks(h?.loggedInUserRoleMap),os=Hs(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),g=Bs(h?.loggedInUserRoleMap),R=Ns(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&R,x=_e&&os,j=Je&&rs,m=de&&is,ls=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||$e===!0||Xe===!0||ts===!0||as===!0;return y.isSignedIn()?b==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&A(ge(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(se===!0||X&&!J)&&Qe&&Ke!==!0&&E===!1&&K===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||J||X?!L||se!==!1||J||X?L&&r?.userRole&&E!=null&&K!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(qs,{children:e.jsxs(t,{element:e.jsx(tn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Un,{isDashboardAccess:U,showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:U?e.jsx(xn,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:U?e.jsx(mn,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:ls||U?e.jsx(En,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:U?e.jsx(hn,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(pn,{})}),e.jsx(t,{path:"transaction/*",element:U&&P===!1||qe||We?e.jsx(Rn,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:U&&P===!1?e.jsx(bn,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:U&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:U&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(wn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(On,{})}),e.jsx(t,{path:"address/*",element:es||me||ns||ss?e.jsx(_n,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:x?e.jsx(Tn,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:j?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(Dn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&P===!1?e.jsx(Cn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(yn,{})}),e.jsx(t,{path:"vendors/*",element:Ge?e.jsx(gn,{}):e.jsx(C,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(jn,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me&&Ze?e.jsx(In,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(fn,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:Ye?e.jsx(vn,{}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Z?e.jsx(Pn,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"*",element:e.jsx(C,{})})]})}):null:(a(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(a(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),a(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{D as F,Mn as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DZ0EcL3w.js","assets/sentry-C-wepUYh.js","assets/core-BmuD0S3N.js","assets/zeni-epic-state-BzURQeUK.js","assets/index-CSXIBJ_M.js","assets/mui-BM_3_akP.js","assets/analytics-CwJdwpYA.js","assets/utils-CJuELQS5.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-CS50FAzC.js","assets/withTransactionSidePanel-CzeazBMg.js","assets/useAskAiCfoHostNavButtonProps-9-Fy3nUU.js","assets/TransactionDetailScreen-ztNW1t0S.js","assets/decodeURIComponentSafe-BxKRdZp_.js","assets/useInitialThreadRequest-D9t0YCjO.js","assets/routePaths-V8Zj2E12.js","assets/expenseAutomationHelper-DgFVpBsB.js","assets/analyticsHelper-dK3DOCZ4.js","assets/CompanyPassportScreen-Da1QH72q.js","assets/MobileAppDrawer-BU-k0-97.js","assets/InboxNotificationsProvider-DEa_8AVv.js","assets/useTaskManagerAccess-BxZJAj1T.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BpFQvcSU.js","assets/FeaturePreviewScreen-C4P6gBWQ.js","assets/BillPayRoutes-CFRnk7Qv.js","assets/AddressScreen-ComPzmBu.js","assets/DomesticWireDetailScreen-BeePCua8.js","assets/BusinessVerificationPageScreen--yNhbNZF.js","assets/DrawerScreen-GzGq_S7g.js","assets/SetupPagesScreen-CdL3mWmh.js","assets/BillPayApprovalRoutes-Be2JdFb6.js","assets/ReimbursementApprovalRuleDetailScreen-CfVvNkpm.js","assets/getLocaleForTenant-DnI7jDkK.js","assets/ReimbursementRoutes-D6Wh5Zab.js","assets/ReimbursementApprovalRoutes-B1Eaf8R5.js","assets/TransactionListRoutes-FBoKU5cp.js","assets/ZeniAccountStatementScreen-BqYGkSqb.js","assets/SettingsRoutes-BPqAraN0.js","assets/AccountMappingScreen-_4EVBZGw.js","assets/QBOConnectionScreen-s6A9jd5F.js","assets/empty-C4N1sGNA.js","assets/index-YvDKgUSm.js","assets/url-pet6UZww.js","assets/index-6JALuOxS.js","assets/accountMappingHelper-B7U2cCqS.js","assets/useEmailConnectResultRefresh-CEyJgwAN.js","assets/ReportsRoutes-Dqg6U4z6.js","assets/ChargeCardRoutes-D4rH2ugh.js","assets/useChargeCardPusherEvents-D6rHv_zT.js","assets/PeopleRoutes-D3wy3tps.js","assets/ExpenseAutomationRoutes-Dy6sqhAB.js","assets/ScheduleDetailsPrepaidExpensesScreen-BT1fazQP.js","assets/pathToGoBack-DSMtoOXp.js","assets/TreasuryRoutes-CCybuieJ.js","assets/VendorsRoutes-TUOD3QZ-.js","assets/ZeniAccountRoutes-Cy6oQuAU.js","assets/AddressRoutes-C6JlNrLm.js","assets/PandLWithForecastRoutes-lqrbmK3W.js","assets/CustomerOnboardingRoutes-B-9UEIGr.js","assets/TransactionDetailRoutes-DVGqIG1K.js","assets/EntityDetailRoutes-Hlxr9L7_.js","assets/InvoicingRoutes-Dd1pdXsc.js","assets/NotificationRoutes-WrEpizjn.js","assets/PerformanceRoutes-mUHDtsOj.js","assets/RewardsRoutes-Z2oqn2Mz.js","assets/TaskRoutes-BSuBns5c.js","assets/TaskListScreen-IpjmQCZM.js","assets/AiCfoScreen-Bvttsr6a.js","assets/CardsAiCfoScreen-DY2qYkQk.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as ms,fE as _s,dY as Es,dX as hs,Al as ps,dh as gs,c8 as Rs,gI as xs,g8 as js,de as pe,cG as Is,gm as Ts,cy as As,bE as bs,br as ys,Ts as Ds,v as fs,Tv as Cs,bq as vs,Tw as Os,bK as Ps,bJ as ws,bt as Us,cu as Fs,Tx as Ls,Ty as ks,d9 as Vs,dc as Hs,db as Ss,cF as Bs,cM as Ns,pR as ge,gh as Re,gX as Ms,gj as xe,gK as je,gL as Ie,gk as Zs}from"./zeni-epic-state-BzURQeUK.js";import{j as e}from"./liveblocks-DFmQJs9l.js";import{a as w}from"./sentry-C-wepUYh.js";import{N as u,u as Gs,h as $s,i as zs,g as Ys,j as $,q as Te,n as qs,o as t}from"./core-BmuD0S3N.js";import{P as l,E as Ws,u as Xs,z as D,O as Ks,e as Qs,m as Js,c as M,g as en,Q as sn,V as nn,L as F,G as Ae,t as _,R as tn,S as an,j as ne}from"./index-CSXIBJ_M.js";import"./mui-BM_3_akP.js";import{f as be}from"./analyticsHelper-dK3DOCZ4.js";import{t as on}from"./getLocaleForTenant-DnI7jDkK.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},A=new a.Error().stack;A&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[A]="b6829187-3665-430e-b825-ac1fce448371",a._sentryDebugIdIdentifier="sentry-dbid-b6829187-3665-430e-b825-ac1fce448371")}catch{}})();const rn=l((()=>s((()=>import("./NotFoundScreen-DZ0EcL3w.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ln=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),un=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/bills`}),ye=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/treasury`}),De=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/checking`}),fe=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/cards`}),f=({showZeniAccountRoute:a,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:S,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(k===!0){if(a)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(ye,{tenantEmailDomain:v});if(O)return e.jsx(fe,{tenantEmailDomain:v})}return a?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(ye,{tenantEmailDomain:v}):O?e.jsx(fe,{tenantEmailDomain:v}):A?e.jsx(un,{tenantEmailDomain:v}):S?e.jsx(ln,{tenantEmailDomain:v}):e.jsx(rn,{})},dn={dashboard:()=>s((()=>import("./DashboardRoutes-CS50FAzC.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])),bills:()=>s((()=>import("./BillPayRoutes-CFRnk7Qv.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-D6Wh5Zab.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])),transactions:()=>s((()=>import("./TransactionListRoutes-FBoKU5cp.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-BPqAraN0.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])),reports:()=>s((()=>import("./ReportsRoutes-Dqg6U4z6.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-D4rH2ugh.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])),people:()=>s((()=>import("./PeopleRoutes-D3wy3tps.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-Dy6sqhAB.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CCybuieJ.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])),vendors:()=>s((()=>import("./VendorsRoutes-TUOD3QZ-.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-Cy6oQuAU.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8]))},cn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},mn=l((()=>s((()=>import("./ReportsRoutes-Dqg6U4z6.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),_n=l((()=>s((()=>import("./AddressRoutes-C6JlNrLm.js")),__vite__mapDeps([56,1,2,3,25,4,5,6,7,0,8])))),En=l((()=>s((()=>import("./PeopleRoutes-D3wy3tps.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),hn=l((()=>s((()=>import("./PandLWithForecastRoutes-lqrbmK3W.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),pn=l((()=>s((()=>import("./CustomerOnboardingRoutes-B-9UEIGr.js")),__vite__mapDeps([58,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),gn=l((()=>s((()=>import("./VendorsRoutes-TUOD3QZ-.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])))),Rn=l((()=>s((()=>import("./TransactionDetailRoutes-DVGqIG1K.js")),__vite__mapDeps([59,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-Hlxr9L7_.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),xn=l((()=>s((()=>import("./DashboardRoutes-CS50FAzC.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-CFRnk7Qv.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])))),jn=l((()=>s((()=>import("./SettingsRoutes-BPqAraN0.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])))),In=l((()=>s((()=>import("./InvoicingRoutes-Dd1pdXsc.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,25,0,19,20,21,39,40,41,42,43,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-D6Wh5Zab.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])))),Tn=l((()=>s((()=>import("./ZeniAccountRoutes-Cy6oQuAU.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8])))),An=l((()=>s((()=>import("./TreasuryRoutes-CCybuieJ.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),bn=l((()=>s((()=>import("./TransactionListRoutes-FBoKU5cp.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),yn=l((()=>s((()=>import("./ChargeCardRoutes-D4rH2ugh.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),Dn=l((()=>s((()=>import("./NotificationRoutes-WrEpizjn.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,21,8])))),fn=l((()=>s((()=>import("./PerformanceRoutes-mUHDtsOj.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,11,19,20,21,8])))),Cn=l((()=>s((()=>import("./ExpenseAutomationRoutes-Dy6sqhAB.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])))),vn=l((()=>s((()=>import("./RewardsRoutes-Z2oqn2Mz.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,0,8])))),On=l((()=>s((()=>import("./TaskRoutes-BSuBns5c.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,14,19,20,21,66,11,8])))),Pn=l((()=>s((()=>import("./AiCfoScreen-Bvttsr6a.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,22,52,15,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-DY2qYkQk.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-DZ0EcL3w.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),wn=l((()=>s((()=>import("./TaskListScreen-IpjmQCZM.js").then((a=>a.f))),__vite__mapDeps([66,1,2,3,4,5,6,7,11,19,20,21,8])))),Un=({isDashboardAccess:a,showZeniAccountRoute:A,isUserHasBillPayAccess:S,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:V})=>{if(O===!0){if(A)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return v===!0&&V?e.jsx(u,{to:"cards"}):a?e.jsx(u,{to:"dashboard"}):A?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):S?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},we=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/dashboard`}),Mn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Gs(),S=$s(),{tenantEmailDomain:i}=zs(),k=Ws().mode,{setLoading:O,clearAllLoading:v,clearLoading:V}=Xs(),b=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),X=ms(I),z=Ys(),[L,Ue]=w.useState(!1),r=$((o=>_s(o))),{useFeatureGate:B}=Ks(),Z=Qs(),ae=Js(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=B(M.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=B(M.isDebitCardFeatureEnabled),T=$((o=>o.tenantState.fetchState)),p=$((o=>o.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?Es(oe,r):void 0,K=p==="Completed"||T==="Completed"?hs(r):void 0,re=p==="Completed"||T==="Completed"?ps(r)&&!gs(r):void 0,Ve=en(r,ke,oe),{isCardsHidden:He}=sn(r?.tenantId),Se=!Ve||!!He,{isFeatureEnabled:Be}=B(M.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=B(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=B(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||an==="DEV",Ze=r?.userRole!=null&&Rs(r.userRole),Y=$((o=>xs(o)));if(i!=null){const o=D.getSignedInUserTenant(i);I!=null&&o!=null&&be(I,r,k)}const G={tenantId:b,userId:I?.userId,sessionId:I?.zeniSessionId},ie=js(),h=nn(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=Is(h?.loggedInUserRoleMap),J=Te("/:tenantEmailDomain/onboarding/*")!==null,ee=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ze=$((o=>G.tenantId!=null?Ts(o,G.tenantId):void 0));w.useEffect((()=>{O(F.TENANT_FETCHING),a(i)}),[i]),w.useEffect((()=>{if(ee!=null&&b!=null){const o=ee.params.selectedPeriod;if(o!=null){const y=o.split("-");if(y.length===2){const d=As(Number(y[0])),n=Number(y[1]),c=bs(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=ys();c.isAfter(N,"month")===!1?A(Ds(b,{month:d,year:n})):S(`/${i}/month_end_close_checks/review`)}}}}),[ee,b]),w.useEffect((()=>{L||(Ue(!0),O(F.TENANT_FETCHING))}),[L,G,ie,I,A,D]),w.useLayoutEffect((()=>{!fs(ie,G)&&D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,y,d,n){if(Re(y?.userId,y?.zeniSessionId,o.tenantId),d(Ms(!0)),d(xe(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=D.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(on(n)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,I,A,ze))}),[b]),w.useEffect((()=>{D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,y,d,n,c,N,H){if(d==null&&n==null)return void console.warn("There is no current tenant selected!!");const q=n!=null&&c?.zeniSessionId!=null,us=d==null||d.tenantId!==n,ds=d!=null&&d.excludedResources==null,cs=d!=null&&d.externalConnections==null;if(q&&us){H(xe(n));const W=D.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),Re(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(je(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(Ie(c.userId,n)))}else q&&ds&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(je(c.userId,n))),q&&cs&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(Ie(c.userId,n)));if(q){ne.identify(c.userId,{tenant_id:n});const W=n==null||n!=null&&(y==="Completed"||y==="Error");o==="Completed"||y!=="Not-Started"&&y!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),N(F.TENANT_FETCHING),H(Zs(c.userId,n,c.zeniSessionId))),W&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(ge(c.userId,c.zeniSessionId)))}})(T,p,r,b,I,O,A))}),[b,p]),w.useEffect((()=>{D.isSignedIn()&&T==="Completed"&&Y.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),D.saveSignedInUserTenants(Cs(Y.tenantsBaseInOrder)),I!=null&&be(I,r,k,void 0,Y.tenantsBaseInOrder))}),[Y,T,r,I]),w.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(v(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,b,L]);const le=w.useRef(!1);w.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(o=cn,y=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=dn[c];N!=null?N().then((()=>te((()=>d(n+1))))).catch((()=>te((()=>d(n+1))))):d(n+1)};te((()=>d(0)))}),y)})())}),[p,L]);const P=r?.userRole!=null&&vs(r?.userRole),{isFeatureEnabled:Ye}=B(M.isReferralFeatureEnabled),qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),We=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),U=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Se&&!P,Xe=Os(h?.loggedInUserRoleMap),Ke=r.externalConnections?.accounting[0]?.isValid,Qe=r.externalConnections?.fetchState==="Completed",se=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&Ps(h?.loggedInUserRoleMap),_e=Fe&&!P,Je=Le&&!P,es=ue&&ws(h?.loggedInUserRoleMap),ss=de&&Us(h?.loggedInUserRoleMap),ns=_e&&Fs(h?.loggedInUserRoleMap),ts=Ls(h?.loggedInUserRoleMap),as=ks(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),g=Bs(h?.loggedInUserRoleMap),R=Ns(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&R,x=_e&&os,j=Je&&rs,m=de&&is,ls=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||$e===!0||Xe===!0||ts===!0||as===!0;return D.isSignedIn()?b==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&A(ge(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(se===!0||X&&!J)&&Qe&&Ke!==!0&&E===!1&&K===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||J||X?!L||se!==!1||J||X?L&&r?.userRole&&E!=null&&K!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(qs,{children:e.jsxs(t,{element:e.jsx(tn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Un,{isDashboardAccess:U,showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:U?e.jsx(xn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:U?e.jsx(mn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:ls||U?e.jsx(En,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:U?e.jsx(hn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(pn,{})}),e.jsx(t,{path:"transaction/*",element:U&&P===!1||qe||We?e.jsx(Rn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:U&&P===!1?e.jsx(bn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:U&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:U&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(wn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(On,{})}),e.jsx(t,{path:"address/*",element:es||me||ns||ss?e.jsx(_n,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:x?e.jsx(Tn,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:j?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(fn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&P===!1?e.jsx(Cn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(Dn,{})}),e.jsx(t,{path:"vendors/*",element:Ge?e.jsx(gn,{}):e.jsx(C,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(jn,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me&&Ze?e.jsx(In,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(yn,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:Ye?e.jsx(vn,{}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Z?e.jsx(Pn,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"*",element:e.jsx(C,{})})]})}):null:(a(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(a(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),a(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{f as F,Mn as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Bqt_XhHh.js";import{a as d}from"./sentry-2yczjdjC.js";import{h as Y,g as Z,u as T,i as N,j as C,l as H,n as z,o as k}from"./core-FnF-Uc4O.js";import{fE as w,YE as je,MU as ve,Yc as we,Yl as Ae,c8 as X,cT as De,cU as Ue,bq as Te,dd as _e,Fh as Re,YF as Me,Ol as Be,LL as Fe,LC as de,Lz as Le,Fl as ue,LF as pe,LI as ge,LO as W,Bx as ee,Fk as Oe,lt as $,lw as me,YG as Ye,mG as Ne,FD as Ve,UU as Ge,UV as $e,lr as Ze,YH as He,lu as Ke,u2 as Qe,UP as qe,UQ as ze,u6 as Je,hU as Xe,TP as q,hM as ae,hJ as We,hR as en,TQ as nn,FA as tn,YI as an,YJ as on,M0 as sn,l_ as rn,dX as fe,dY as he,YK as ln,gB as cn,U2 as dn,Fz as oe,gG as se,gF as un,Fy as pn,gE as gn,gD as mn,YL as fn,Tf as Ce,YM as hn,YN as Cn,YO as yn,YP as Sn,YQ as bn,YR as In,FG as xn,YS as En,Fx as ie,Fr as G,YT as kn,YU as Pn,YV as re,YW as jn,dQ as vn,YX as wn,YY as An,YZ as Dn,Tr as Un,c0 as Tn,c7 as _n,c6 as Rn,c1 as Mn,Y_ as Bn,c4 as Fn,c3 as Ln,c5 as On,c2 as Yn}from"./zeni-epic-state-Ch0HFr9W.js";import{bS as Nn,z as v,Q as V,a7 as ne,c2 as Vn,j as K,O as te,y as L,f as ye,P as Se,c3 as Gn,h as $n,Y as be,c4 as Zn,ai as Hn,c5 as Kn,c6 as Qn,aq as qn,c7 as zn,p as Jn,c as Ie,c8 as Xn}from"./index-Ecojj-Pb.js";import{n as B}from"./mui-gvvniK3d.js";import{u as xe}from"./useTaskManagerAccess-C4k1vquW.js";import{U as Wn}from"./AccountMappingScreen-Bo9SjIQs.js";import{t as et,A as nt}from"./AddressScreen-CJt2Q_Ar.js";import O from"./NotFoundScreen-B-YpUYOf.js";import{g as tt}from"./analyticsHelper-De2OvKV1.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-CBHdFJPr.js";import{C as st}from"./CompanyPassportScreen-BOBPyOSL.js";import{M as R}from"./MobileAppDrawer-BG_dPpHH.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DWR-6F3l.js";import{q as le}from"./QBOConnectionScreen-BVDyTxl7.js";import{B as lt}from"./BillPayApprovalRoutes-DUWk7mrJ.js";import{R as ct}from"./ReimbursementApprovalRoutes-BB31uN18.js";import"./recharts-CUhuZXcR.js";import"./analytics-Vv7iwE-7.js";import"./plaid-G8Bxl_Fw.js";import"./dnd-r2xkhVF6.js";import"./stripe-cKAAJElX.js";import"./lottie-Blhfr6ao.js";import"./lexical-DP-ZRRwN.js";import"./pdf-DycQGpzo.js";import"./utils-BW8U-ATx.js";import"./accountMappingHelper-DkWE8zWp.js";import"./routePaths-C3Wl814x.js";import"./InboxNotificationsProvider-DpFe93lp.js";import"./empty-ClAnc2XI.js";import"./pdf-lib-CefI83Yi.js";import"./index-DrlR6PPl.js";import"./url-Q0BVeI-7.js";import"./index-Dy5h_qvb.js";import"./decodeURIComponentSafe-Dcy3wJS-.js";import"./ReimbursementApprovalRuleDetailScreen-Caabj-x6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="4c725529-0655-40fb-8aa0-a6bf1f93907e",e._sentryDebugIdIdentifier="sentry-dbid-4c725529-0655-40fb-8aa0-a6bf1f93907e")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-DFmQJs9l.js";import{a as d}from"./sentry-C-wepUYh.js";import{h as V,g as $,u as T,i as Y,j as C,l as H,n as z,o as k}from"./core-BmuD0S3N.js";import{fE as w,YE as je,MU as ve,Yc as we,Yl as Ae,c8 as X,cT as De,cU as Ue,bq as Te,dd as _e,Fh as Re,YF as Me,Ol as Be,LL as Fe,LC as de,Lz as Le,Fl as ue,LF as pe,LI as ge,LO as W,Bx as ee,Fk as Oe,lt as Z,lw as me,YG as Ve,mG as Ye,FD as Ne,UU as Ge,UV as Ze,lr as $e,YH as He,lu as Ke,u2 as Qe,UP as qe,UQ as ze,u6 as Je,hU as Xe,TP as q,hM as ae,hJ as We,hR as en,TQ as nn,FA as tn,YI as an,YJ as on,M0 as sn,l_ as rn,dX as fe,dY as he,YK as ln,gB as cn,U2 as dn,Fz as oe,gG as se,gF as un,Fy as pn,gE as gn,gD as mn,YL as fn,Tf as Ce,YM as hn,YN as Cn,YO as yn,YP as Sn,YQ as bn,YR as In,FG as xn,YS as En,Fx as ie,Fr as G,YT as kn,YU as Pn,YV as re,YW as jn,dQ as vn,YX as wn,YY as An,YZ as Dn,Tr as Un,c0 as Tn,c7 as _n,c6 as Rn,c1 as Mn,Y_ as Bn,c4 as Fn,c3 as Ln,c5 as On,c2 as Vn}from"./zeni-epic-state-BzURQeUK.js";import{bS as Yn,z as v,V as N,a7 as ne,c2 as Nn,j as K,O as te,c as L,g as ye,Q as Se,c3 as Gn,l as Zn,Z as be,c4 as $n,ai as Hn,c5 as Kn,c6 as Qn,aq as qn,c7 as zn,p as Jn,d as Ie,c8 as Xn}from"./index-CSXIBJ_M.js";import{n as B}from"./mui-BM_3_akP.js";import{u as xe}from"./useTaskManagerAccess-BxZJAj1T.js";import{U as Wn}from"./AccountMappingScreen-_4EVBZGw.js";import{t as et,A as nt}from"./AddressScreen-ComPzmBu.js";import O from"./NotFoundScreen-DZ0EcL3w.js";import{g as tt}from"./analyticsHelper-dK3DOCZ4.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen--yNhbNZF.js";import{C as st}from"./CompanyPassportScreen-Da1QH72q.js";import{M as R}from"./MobileAppDrawer-BU-k0-97.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-CEyJgwAN.js";import{q as le}from"./QBOConnectionScreen-s6A9jd5F.js";import{B as lt}from"./BillPayApprovalRoutes-Be2JdFb6.js";import{R as ct}from"./ReimbursementApprovalRoutes-B1Eaf8R5.js";import"./recharts-CoBgaVyZ.js";import"./analytics-CwJdwpYA.js";import"./plaid-C449LRBC.js";import"./dnd-DlE2O-fD.js";import"./stripe-cKAAJElX.js";import"./lottie-C08AxeP4.js";import"./lexical-BTBf0x2F.js";import"./pdf-i0V0lBaH.js";import"./utils-CJuELQS5.js";import"./accountMappingHelper-B7U2cCqS.js";import"./routePaths-V8Zj2E12.js";import"./InboxNotificationsProvider-DEa_8AVv.js";import"./empty-C4N1sGNA.js";import"./pdf-lib-D5sCwB4Y.js";import"./index-YvDKgUSm.js";import"./url-pet6UZww.js";import"./index-6JALuOxS.js";import"./decodeURIComponentSafe-BxKRdZp_.js";import"./ReimbursementApprovalRuleDetailScreen-CfVvNkpm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="b4b28488-95ea-408a-ba63-1e0392bf308c",e._sentryDebugIdIdentifier="sentry-dbid-b4b28488-95ea-408a-ba63-1e0392bf308c")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-Bqt_XhHh.js";import{a as d}from"./sentry-2yczjdj
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=H((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Vn),pt=()=>{const e=Y(),l=Z(),o=T(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=V();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=H((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Nn),pt=()=>{const e=V(),l=$(),o=T(),{tenantEmailDomain:i}=Y(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Yn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=N();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-Bqt_XhHh.js";import{a as d}from"./sentry-2yczjdj
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=H((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Le(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Fe(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=Y(),l=Z(),o=T(),{tenantEmailDomain:i}=N(),r=V(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(L.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(L.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Te(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,_=ye(m,t,s),D=_e(m,r?.loggedInUserRoleMap)&&_,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Re(!1)))}),[h,o,p]);const M=A=>{u(A)};return b||j||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(O,{})},ht=B.div`
17
+ `,mt=H((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Le(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Fe(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=V(),l=$(),o=T(),{tenantEmailDomain:i}=Y(),r=N(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(L.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(L.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Te(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,_=ye(m,t,s),D=_e(m,r?.loggedInUserRoleMap)&&_,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Re(!1)))}),[h,o,p]);const M=A=>{u(A)};return b||j||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(O,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-Bqt_XhHh.js";import{a as d}from"./sentry-2yczjdj
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=H((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ye(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Ke(n))},updateCardPaymentModalState:n=>{e(He({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(Ze(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Ve(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Zn),yt=()=>{const e=Y(),l=Z(),o=T(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>w(P))),S=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=V();d.useEffect((()=>{E!=null&&o(Oe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=H((function(e){const l=ze(e,J);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(We(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,q("payments"),s))},onNotifyMe:s=>{K.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(Kn),bt=()=>{const e=Hn(),l=Y(),o=T(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=V(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(Qe(J))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:_,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:P,onAddPlaidAccount:_,onReLoginPlaidAccount:D,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=H((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ve(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Ke(n))},updateCardPaymentModalState:n=>{e(He({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e($e(n,t,s))},handleFetchPaymentSources:()=>{e(Z())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Ne(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ye({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))($n),yt=()=>{const e=V(),l=$(),o=T(),{tenantEmailDomain:i}=Y(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>w(P))),S=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Zn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=N();d.useEffect((()=>{E!=null&&o(Oe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o(Z()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o(Z())}),[p,b]);const j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=H((function(e){const l=ze(e,J);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(We(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,q("payments"),s))},onNotifyMe:s=>{K.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(Kn),bt=()=>{const e=Hn(),l=V(),o=T(),{tenantEmailDomain:i}=Y(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=N(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(Qe(J))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o(Z()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:_,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:P,onAddPlaidAccount:_,onReLoginPlaidAccount:D,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-Bqt_XhHh.js";import{a as d}from"./sentry-2yczjdj
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=T(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(Qn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=T(),{tenantEmailDomain:l}=Y(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(Qn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-Bqt_XhHh.js";import{a as d}from"./sentry-2yczjdj
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=T(),o=Y(),i=Z(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(L.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(L.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),j=!g&&b,P=ye(t,S,m),{isCardsHidden:_}=Se(t?.tenantId),D=!P||_,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((y=>cn(y,j))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const F=(function(ke,Pe){let Q=`/${ke}/settings/my_profile`;return Q=Q.concat(`/new/${Pe}`),Q})(s,y),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(F,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const F={...x.myProfileLocalData,phone:y};l(oe({localData:F})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,F)=>{l(un(y,F,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function Pt(){const e=T(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),_=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(Pn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(jn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(wn({groupId:f,channel:re(U),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:_,taskNotifications:M,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=V(),t=Ie(),s=T(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(L.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Tn(r)?a.jsxs(z,{children:[_n(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Fn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Yn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(z,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function jt(e){return a.jsxs(z,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{da as default};
49
+ `,ce=({appContent:e})=>{const l=T(),o=V(),i=$(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(L.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(L.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),j=!g&&b,P=ye(t,S,m),{isCardsHidden:_}=Se(t?.tenantId),D=!P||_,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((y=>cn(y,j))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const F=(function(ke,Pe){let Q=`/${ke}/settings/my_profile`;return Q=Q.concat(`/new/${Pe}`),Q})(s,y),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(F,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const F={...x.myProfileLocalData,phone:y};l(oe({localData:F})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,F)=>{l(un(y,F,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function Pt(){const e=T(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),_=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(Pn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(jn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(wn({groupId:f,channel:re(U),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:_,taskNotifications:M,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=N(),t=Ie(),s=T(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(L.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Tn(r)?a.jsxs(z,{children:[_n(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Fn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Vn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(z,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function jt(e){return a.jsxs(z,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{da as default};