@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.sms1

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 (182) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-BDXA6PWh.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CUztd3-b.mjs} +87 -83
  4. package/dist/AccountDetailsHeader-i3KFhNuo.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-QZspYAji.mjs} +6 -6
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DX5upmCS.mjs} +5 -5
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-BcnDpyLL.mjs} +19 -8
  8. package/dist/{Accounts-BRf_YeTf.mjs → Accounts-DXfZotRC.mjs} +1 -1
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Df2nII9u.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +23 -21
  13. package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-DTgyAMM7.mjs} +12 -10
  14. package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-C5cR-nfQ.mjs} +1 -1
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BIbTqYOH.mjs} +2 -2
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-BFfY3_zB.mjs} +3 -3
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-BFKcs-_K.mjs} +2 -2
  18. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  19. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  20. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-BbJB0nmu.mjs} +1 -1
  21. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  22. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  23. package/dist/Drawer-BEtCk82g.mjs +163 -0
  24. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  25. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
  26. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  27. package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
  28. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-DpWY3gVb.mjs} +5 -5
  29. package/dist/{Help-B6dIcujh.mjs → Help-BnPXM_N2.mjs} +2 -2
  30. package/dist/LineChart-bc1D9xBE.mjs +581 -0
  31. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
  32. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-NpXHhO1n.mjs} +177 -174
  33. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  34. package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  35. package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  36. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-lsuhEpn6.mjs} +2 -2
  37. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-CNmJWVeI.mjs} +241 -238
  38. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
  39. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  40. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +4 -4
  41. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-CqZh1SQa.mjs} +17 -17
  42. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BKcYmpv3.mjs} +46 -45
  43. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-Ni5tSQIO.mjs} +80 -73
  44. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  45. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  46. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
  47. package/dist/SpendingLegend-CjX-hX2O.mjs +193 -0
  48. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  49. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  50. package/dist/TransactionDetails-5M2vfr59.mjs +1379 -0
  51. package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-D-Q3BU9Z.mjs} +119 -121
  52. package/dist/TrendsStore-BW9FGQeE.mjs +182 -0
  53. package/dist/{User-BQUxBeZV.mjs → User-wXzDI4M8.mjs} +2 -2
  54. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-C0832BMe.mjs} +702 -723
  55. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-BhQ1Kx2z.mjs} +4 -4
  56. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  57. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  58. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  59. package/dist/accounts/index.es.js +229 -222
  60. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  61. package/dist/analytics/index.es.js +2 -2
  62. package/dist/budgets/index.es.js +380 -382
  63. package/dist/cashflow/index.es.js +405 -413
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +1 -1
  66. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  67. package/dist/common/components/Select.d.ts +4 -2
  68. package/dist/common/components/charts/LineChart.d.ts +12 -2
  69. package/dist/common/components/charts/index.d.ts +0 -3
  70. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  71. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  72. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  73. package/dist/common/components/drawer/Footer.d.ts +17 -0
  74. package/dist/common/hooks/index.d.ts +0 -1
  75. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  76. package/dist/common/index.es.js +320 -321
  77. package/dist/common/stores/GlobalStore.d.ts +7 -1
  78. package/dist/common/types/Finstrong.d.ts +54 -0
  79. package/dist/common/types/Global.d.ts +1 -0
  80. package/dist/common/types/Widgets.d.ts +1 -0
  81. package/dist/common/types/index.d.ts +1 -1
  82. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  83. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  84. package/dist/dashboard/index.es.js +2 -2
  85. package/dist/debts/index.es.js +506 -498
  86. package/dist/exportTransactionsToCSV-Cz2t0lmA.mjs +48 -0
  87. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  88. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  89. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  90. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  91. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  92. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  93. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  94. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  95. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  96. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  97. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  98. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  99. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  100. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  101. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  102. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  103. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  104. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  105. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  106. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  107. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  108. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  109. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  110. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  111. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  112. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  113. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  114. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  115. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  116. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  117. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  118. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  119. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  120. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  121. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  122. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  123. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  124. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  125. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  126. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  127. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  128. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  129. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  130. package/dist/finstrong/constants/index.d.ts +9 -0
  131. package/dist/finstrong/index.es.js +3171 -1063
  132. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  133. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  134. package/dist/goals/index.es.js +566 -562
  135. package/dist/help/index.es.js +3 -3
  136. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  137. package/dist/insights/index.es.js +1 -1
  138. package/dist/investments/index.es.js +437 -435
  139. package/dist/merchants/index.es.js +2 -2
  140. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  141. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  142. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  143. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  144. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  145. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  146. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  147. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  148. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  149. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  150. package/dist/microinsights/constants/App.d.ts +0 -1
  151. package/dist/microinsights/index.d.ts +3 -3
  152. package/dist/microinsights/index.es.js +7 -7
  153. package/dist/microinsights/interfaces.d.ts +0 -6
  154. package/dist/networth/index.es.js +188 -186
  155. package/dist/notifications/index.es.js +95 -96
  156. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  157. package/dist/recurringtransactions/index.es.js +584 -560
  158. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
  159. package/dist/settings/index.es.js +286 -280
  160. package/dist/spending/index.es.js +269 -421
  161. package/dist/spending/utils/SpendingData.d.ts +2 -1
  162. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  163. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  164. package/dist/transactions/index.es.js +226 -220
  165. package/dist/transactions/stores/TransactionStore.d.ts +1 -1
  166. package/dist/transactions/stores/UiStore.d.ts +0 -2
  167. package/dist/trends/index.es.js +963 -586
  168. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CFNF8766.mjs} +2 -2
  169. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  170. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  171. package/package.json +7 -7
  172. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  173. package/dist/Drawer-kEE73B87.mjs +0 -113
  174. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  175. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  176. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  177. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  178. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  179. package/dist/common/hooks/usePrevious.d.ts +0 -2
  180. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  181. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  182. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,15 +1,15 @@
1
- import { jsxs as g, jsx as e, Fragment as je } from "react/jsx-runtime";
2
- import l from "react";
3
- import { observer as I } from "mobx-react-lite";
4
- import { endOfMonth as ge } from "date-fns/endOfMonth";
1
+ import { jsxs as g, jsx as e, Fragment as Ge } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import { observer as E } from "mobx-react-lite";
4
+ import { endOfMonth as me } from "date-fns/endOfMonth";
5
5
  import { startOfMonth as J } from "date-fns/startOfMonth";
6
- import H from "@mui/material/Box";
6
+ import F from "@mui/material/Box";
7
7
  import B from "@mui/material/Stack";
8
8
  import ee from "@mui/material/styles/useTheme";
9
- import { Text as y, CategoryIcon as W, Icon as P, H1 as ze, H3 as ve } from "@mxenabled/mxui";
10
- import K from "@mui/material/List";
11
- import { u as w, i as D, j as te, m as U, q as ne, g as X, b as oe, h as ae, a as Ue, d as Ae } from "../hooks-D6XlXHf4.mjs";
12
- import { f as T } from "../NumberFormatting-Buh7u8Oi.mjs";
9
+ import { Text as y, CategoryIcon as H, Icon as P, H1 as je, H3 as Ae } from "@mxenabled/mxui";
10
+ import W from "@mui/material/List";
11
+ import { u as w, i as D, j as te, m as K, q as ne, g as X, b as oe, d as pe, h as ae, a as ze, n as Ue } from "../hooks-C41HAxM5.mjs";
12
+ import { f as T } from "../NumberFormatting-DjTD0t3W.mjs";
13
13
  import Te from "@mui/material/Button";
14
14
  import re from "@mui/material/Divider";
15
15
  import V from "@mui/material/ListItem";
@@ -17,38 +17,38 @@ import se from "@mui/material/ListItemAvatar";
17
17
  import Y from "@mui/material/ListItemButton";
18
18
  import Z from "@mui/material/ListItemText";
19
19
  import { b as R } from "../Localization-2MODESHW.mjs";
20
- import { D as $ } from "../Drawer-kEE73B87.mjs";
20
+ import { D as L } from "../Drawer-BEtCk82g.mjs";
21
21
  import Fe from "@mui/material/ListItemSecondaryAction";
22
- import { C as He } from "../CurrencyInput-DUsQbkXb.mjs";
23
- import { a as j } from "../Dialog-CWW597AF.mjs";
24
- import { C as We } from "../ConnectionsDrawer-ByGQE7D5.mjs";
22
+ import { C as He } from "../CurrencyInput-BFKcs-_K.mjs";
23
+ import { D as j } from "../Dialog-BPTr3qHE.mjs";
24
+ import { C as We } from "../ConnectionsDrawer-BFfY3_zB.mjs";
25
25
  import * as O from "d3";
26
26
  import Ke from "@mui/material/Tooltip";
27
27
  import { useTheme as Xe } from "@mui/material/styles";
28
28
  import { u as ie } from "../useScreenSize-B6JyS_Lj.mjs";
29
- import { L as z } from "../Loader-DUaFpDGv.mjs";
30
- import { E as ue } from "../EmptyState-DA_lfRBv.mjs";
31
- import { A as k, W as Ve } from "../WidgetContainer-BHWANqT4.mjs";
32
- import { u as Ye } from "../BudgetUtil-B2ZXyw-g.mjs";
33
- import { M as Ze } from "../MiniWidgetContainer-D0gfmbaF.mjs";
29
+ import { L as he } from "../Loader-DUaFpDGv.mjs";
30
+ import { E as de } from "../EmptyState-DoxNUae-.mjs";
31
+ import { A as k, W as Ve } from "../WidgetContainer-BhQ1Kx2z.mjs";
32
+ import { u as Ye } from "../BudgetUtil-Df2nII9u.mjs";
33
+ import { M as Ze } from "../MiniWidgetContainer-CmXpTylX.mjs";
34
34
  import { isAfter as qe } from "date-fns/isAfter";
35
35
  import { startOfToday as q } from "date-fns/startOfToday";
36
36
  import Je from "@mui/material/Alert";
37
37
  import Qe from "@mui/material/Snackbar";
38
- import _e from "@mui/material/Tab";
38
+ import Ce from "@mui/material/Tab";
39
39
  import et from "@mui/material/Tabs";
40
- import { e as tt } from "../exportTransactionsToCSV-7bVS7KXf.mjs";
41
- import { T as we, a as nt } from "../TransactionDetails-oP1eSuiS.mjs";
42
- import he from "@mui/material/Card";
43
- import fe from "@mui/material/CardContent";
44
- import { S as pe } from "../StatusBar-BK_uYHAB.mjs";
40
+ import { e as tt } from "../exportTransactionsToCSV-Cz2t0lmA.mjs";
41
+ import { T as we, a as nt } from "../TransactionDetails-5M2vfr59.mjs";
42
+ import fe from "@mui/material/Card";
43
+ import be from "@mui/material/CardContent";
44
+ import { S as ge } from "../StatusBar-BK_uYHAB.mjs";
45
45
  import { S as De } from "../SingleSegmentDonut-BgbLgwHi.mjs";
46
- import { u as ot, b as at } from "../CategorySelectorDrawer-DUe4lH5-.mjs";
47
- import Ie from "@mui/material/CardHeader";
46
+ import { u as ot, b as at } from "../CategorySelectorDrawer-DqJK_rrL.mjs";
47
+ import Ee from "@mui/material/CardHeader";
48
48
  import { subDays as rt } from "date-fns/subDays";
49
49
  import st from "@mui/material/IconButton";
50
- import { M as it } from "../ManageIncome-1s_q5W4X.mjs";
51
- const ct = I(() => {
50
+ import { M as it } from "../ManageIncome-NpXHhO1n.mjs";
51
+ const ct = E(() => {
52
52
  const { budgets: t } = w(), { totalBudgeted: o } = D(), { incomeTotal: i } = te(), s = i - o;
53
53
  return /* @__PURE__ */ g(B, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
54
54
  /* @__PURE__ */ g(B, { alignItems: "center", children: [
@@ -66,33 +66,33 @@ const ct = I(() => {
66
66
  /* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.remaining })
67
67
  ] })
68
68
  ] });
69
- }), lt = I(
69
+ }), lt = E(
70
70
  ({ category: t }) => {
71
- const { budgets: o } = w(), { budgets: i } = D(), s = l.useMemo(() => {
72
- const a = i.find((c) => c.category_guid === t.guid), n = T(t.totalAverageAmount, "0,0"), r = a ? R(o.recalculate_previous_budget, T(a.amount, "0,0")) : o.recalculate_new_budget;
71
+ const { budgets: o } = w(), { budgets: i } = D(), s = c.useMemo(() => {
72
+ const a = i.find((l) => l.category_guid === t.guid), n = T(t.totalAverageAmount, "0,0"), r = a ? R(o.recalculate_previous_budget, T(a.amount, "0,0")) : o.recalculate_new_budget;
73
73
  return `${n} - ${r}`;
74
74
  }, [o, i]);
75
- return /* @__PURE__ */ g(l.Fragment, { children: [
75
+ return /* @__PURE__ */ g(c.Fragment, { children: [
76
76
  /* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { children: [
77
- /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(W, { categoryGuid: t.guid, variant: "filled" }) }),
77
+ /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
78
78
  /* @__PURE__ */ e(Z, { primary: t.name, secondary: s })
79
79
  ] }) }),
80
80
  /* @__PURE__ */ e(re, {})
81
81
  ] }, t.guid);
82
82
  }
83
83
  ), dt = ({ onRecalculateBudgets: t }) => {
84
- const { budgets: o, common: i } = w(), { spendCategories: s } = U(), { recalculateBudgets: a, setAlert: n } = D(), [r, c] = l.useState(!1), d = s.filter((u) => u.totalAverageAmount > 0), m = async () => {
85
- await a(d), c(!1), n(o.alert_recalculated_budgets), t?.();
84
+ const { budgets: o, common: i } = w(), { spendCategories: s } = K(), { recalculateBudgets: a, setAlert: n } = D(), [r, l] = c.useState(!1), d = s.filter((u) => u.totalAverageAmount > 0), m = async () => {
85
+ await a(d), l(!1), n(o.alert_recalculated_budgets), t?.();
86
86
  };
87
- return /* @__PURE__ */ g(l.Fragment, { children: [
88
- /* @__PURE__ */ e(Te, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: o.recalculate_button }),
87
+ return /* @__PURE__ */ g(c.Fragment, { children: [
88
+ /* @__PURE__ */ e(Te, { onClick: () => l(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: o.recalculate_button }),
89
89
  /* @__PURE__ */ e(y, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: o.recalculate_help }),
90
90
  /* @__PURE__ */ e(
91
- $,
91
+ L,
92
92
  {
93
93
  ariaLabelClose: i.close_aria,
94
94
  isOpen: r,
95
- onClose: () => c(!1),
95
+ onClose: () => l(!1),
96
96
  onPrimaryAction: m,
97
97
  title: o.recalculate_title,
98
98
  children: /* @__PURE__ */ g(B, { children: [
@@ -100,7 +100,7 @@ const ct = I(() => {
100
100
  /* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: o.recalculate_description_top }),
101
101
  /* @__PURE__ */ e(y, { variant: "ParagraphSmall", children: o.recalculate_description_bottom })
102
102
  ] }),
103
- /* @__PURE__ */ e(H, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: d.map((u) => /* @__PURE__ */ e(lt, { category: u }, u.guid)) }) })
103
+ /* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children: d.map((u) => /* @__PURE__ */ e(lt, { category: u }, u.guid)) }) })
104
104
  ] })
105
105
  }
106
106
  )
@@ -131,13 +131,13 @@ const ct = I(() => {
131
131
  }
132
132
  )
133
133
  ] });
134
- }, ut = I(({ category: t, onAddBudget: o }) => {
135
- const { budgets: i, common: s } = w(), [a, n] = l.useState(!1), [r, c] = l.useState(
134
+ }, ut = E(({ category: t, onAddBudget: o }) => {
135
+ const { budgets: i, common: s } = w(), [a, n] = c.useState(!1), [r, l] = c.useState(
136
136
  `${t.totalAmount === 0 ? "" : t.totalAmount}`
137
137
  );
138
- return /* @__PURE__ */ g(l.Fragment, { children: [
138
+ return /* @__PURE__ */ g(c.Fragment, { children: [
139
139
  /* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () => n(!0), children: [
140
- /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(W, { categoryGuid: t.guid }) }),
140
+ /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
141
141
  /* @__PURE__ */ e(
142
142
  Z,
143
143
  {
@@ -156,17 +156,17 @@ const ct = I(() => {
156
156
  onClose: () => n(!1),
157
157
  onPrimaryAction: () => o(t, Number(r)),
158
158
  primaryText: i.add_save_button,
159
- children: /* @__PURE__ */ e(ce, { amount: r, categoryName: t.name, onAmountChanged: c })
159
+ children: /* @__PURE__ */ e(ce, { amount: r, categoryName: t.name, onAmountChanged: l })
160
160
  }
161
161
  )
162
162
  ] });
163
- }), Ee = I(({ onRecalculateBudgets: t }) => {
164
- const { budgets: o } = w(), { addBudget: i, setAlert: s, unbudgetedCategories: a } = D(), n = async (r, c) => {
165
- await i(r, c), s(R(o.alert_budget_created, r.name));
163
+ }), Ie = E(({ onRecalculateBudgets: t }) => {
164
+ const { budgets: o } = w(), { addBudget: i, setAlert: s, unbudgetedCategories: a } = D(), n = async (r, l) => {
165
+ await i(r, l), s(R(o.alert_budget_created, r.name));
166
166
  };
167
167
  return /* @__PURE__ */ g(B, { children: [
168
168
  /* @__PURE__ */ e(ct, {}),
169
- /* @__PURE__ */ e(H, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: a.map((r) => /* @__PURE__ */ e(
169
+ /* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children: a.map((r) => /* @__PURE__ */ e(
170
170
  ut,
171
171
  {
172
172
  category: r,
@@ -176,7 +176,7 @@ const ct = I(() => {
176
176
  )) }) }),
177
177
  /* @__PURE__ */ e(dt, { onRecalculateBudgets: t })
178
178
  ] });
179
- }), Ce = 5, Oe = 100, Q = 25, mt = (t) => {
179
+ }), Be = 5, Oe = 100, Q = 25, mt = (t) => {
180
180
  const o = (a) => {
181
181
  a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
182
182
  }, i = (a) => {
@@ -188,11 +188,11 @@ const ct = I(() => {
188
188
  }, gt = (t) => {
189
189
  let o = t.transaction_total / t.amount;
190
190
  o < 0 ? o = 0 : o > 1 && (o = 1);
191
- const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius - Ce * 2).outerRadius(t.radius - Ce).startAngle(0).endAngle(0);
191
+ const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius - Be * 2).outerRadius(t.radius - Be).startAngle(0).endAngle(0);
192
192
  return (n) => (a.endAngle(s(n)), a(t) || "");
193
193
  }, pt = (t) => {
194
194
  O.selectAll(".bubble").call(mt(t));
195
- }, Be = (t, o, i) => Math.min(Math.max(t, o), i), ht = (t, o, i) => {
195
+ }, Se = (t, o, i) => Math.min(Math.max(t, o), i), ht = (t, o, i) => {
196
196
  t.alpha(1).restart().force(
197
197
  "x",
198
198
  O.forceX().x(i / 2).strength(0.01)
@@ -203,16 +203,16 @@ const ct = I(() => {
203
203
  const s = t.nodes();
204
204
  s.forEach((a) => {
205
205
  const n = a.radius ?? Q;
206
- a.x = Be(a.x ?? 0, n, i - n), a.y = Be(a.y ?? 0, n, o - n);
206
+ a.x = Se(a.x ?? 0, n, i - n), a.y = Se(a.y ?? 0, n, o - n);
207
207
  }), O.selectAll(".bubble").data(s).attr("transform", (a) => `translate(${a.x},${a.y})`);
208
208
  });
209
209
  }, Me = (t, o) => O.scaleLinear().domain([t, o]).range([Q, Oe]), ft = (t) => {
210
210
  const o = t.reduce((n, r) => {
211
- const c = Math.max(r.transaction_total, r.amount);
212
- return c > n ? c : n;
211
+ const l = Math.max(r.transaction_total, r.amount);
212
+ return l > n ? l : n;
213
213
  }, 0), i = t.reduce((n, r) => {
214
- const c = Math.max(r.transaction_total, r.amount);
215
- return c < n ? c : n;
214
+ const l = Math.max(r.transaction_total, r.amount);
215
+ return l < n ? l : n;
216
216
  }, o), s = Me(i, o), a = t.map((n) => {
217
217
  const r = s(Math.max(n.transaction_total, n.amount)) || 25;
218
218
  return {
@@ -222,45 +222,45 @@ const ct = I(() => {
222
222
  });
223
223
  return O.forceSimulation(a).velocityDecay(0.05).force("collide", O.forceCollide((n) => n.radius + 2).strength(0.7));
224
224
  }, bt = (t, o, i) => {
225
- const a = Math.PI * Q ** 2 * t, n = i < 400 || o < 300, r = n ? 40 : 20, c = Math.max(100, i - r), d = Math.max(100, o - r), m = c * d;
225
+ const a = Math.PI * Q ** 2 * t, n = i < 400 || o < 300, r = n ? 40 : 20, l = Math.max(100, i - r), d = Math.max(100, o - r), m = l * d;
226
226
  let u = Q;
227
227
  if (a < m) {
228
- const f = Math.sqrt(m / (t * Math.PI)), h = Math.min(c, d) / 4;
229
- u = Math.min(Oe, f, h);
228
+ const h = Math.sqrt(m / (t * Math.PI)), p = Math.min(l, d) / 4;
229
+ u = Math.min(Oe, h, p);
230
230
  }
231
231
  return n && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
232
232
  }, yt = (t, o, i, s, a) => {
233
233
  const { maxRadius: n, minRadius: r } = bt(t, o, a);
234
234
  return O.scaleLinear().domain([s, i]).range([r, n]);
235
235
  }, _t = (t, o, i = !1, s, a) => {
236
- const n = o.map((m) => Math.max(m.transaction_total, m.amount)), r = Math.min(...n), c = Math.max(...n), d = i ? yt(t.length, s, c, r, a) : Me(r, c);
236
+ const n = o.map((m) => Math.max(m.transaction_total, m.amount)), r = Math.min(...n), l = Math.max(...n), d = i ? yt(t.length, s, l, r, a) : Me(r, l);
237
237
  return t.map((m) => ({
238
238
  ...m,
239
239
  radius: d(Math.max(m.transaction_total, m.amount))
240
240
  }));
241
- }, Se = 5, Ct = 2e3, Bt = ({ bubble: t }) => {
241
+ }, xe = 5, Ct = 2e3, Bt = ({ bubble: t }) => {
242
242
  const o = ee(), {
243
243
  amount: i,
244
244
  guid: s,
245
245
  budgetColors: { mercury: a },
246
246
  radius: n,
247
247
  transaction_total: r
248
- } = t, c = `mercury-${s}`;
249
- l.useEffect(() => {
250
- O.select(`.${c}`).selectAll(".status").remove(), O.select(`.${c}`).append("path").transition().duration(Ct).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => gt(t));
248
+ } = t, l = `mercury-${s}`;
249
+ c.useEffect(() => {
250
+ O.select(`.${l}`).selectAll(".status").remove(), O.select(`.${l}`).append("path").transition().duration(Ct).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => gt(t));
251
251
  }, [i, n, r]);
252
- const d = O.arc().innerRadius((m) => m - 2 * Se).outerRadius((m) => m - Se).startAngle(0).endAngle(2 * Math.PI);
253
- return /* @__PURE__ */ e("g", { className: c, children: /* @__PURE__ */ e(
252
+ const d = O.arc().innerRadius((m) => m - 2 * xe).outerRadius((m) => m - xe).startAngle(0).endAngle(2 * Math.PI);
253
+ return /* @__PURE__ */ e("g", { className: l, children: /* @__PURE__ */ e(
254
254
  "path",
255
255
  {
256
256
  d: d(n) || "",
257
257
  style: { fill: o.palette.common.white, fillOpacity: 0.35 }
258
258
  }
259
259
  ) });
260
- }, St = l.memo(Bt), G = 75, me = 50;
260
+ }, St = c.memo(Bt), G = 75, ue = 50;
261
261
  function xt({ bubble: t, isDraggable: o, onClick: i = () => {
262
262
  } }) {
263
- const [s, a] = l.useState(!1), n = Xe(), { availableWidth: r } = ne(), c = l.useMemo(() => {
263
+ const [s, a] = c.useState(!1), n = Xe(), { availableWidth: r } = ne(), l = c.useMemo(() => {
264
264
  if (t)
265
265
  return {
266
266
  amount: t.amount,
@@ -273,41 +273,41 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
273
273
  if (!t) return;
274
274
  const {
275
275
  budgetColors: { background: d, text: m },
276
- category: { icon: u, name: _ },
277
- guid: f,
278
- description: h,
279
- radius: p,
276
+ category: { icon: u, name: C },
277
+ guid: h,
278
+ description: p,
279
+ radius: f,
280
280
  x: S,
281
- y: b
282
- } = t, C = r < 400 ? -8 : -12;
283
- let v = C, A = C;
284
- p > G ? (v = -14, A = -45) : p > me && (A = -32);
281
+ y: _
282
+ } = t, b = r < 400 ? -8 : -12;
283
+ let A = b, v = b;
284
+ f > G ? (A = -14, v = -45) : f > ue && (v = -32);
285
285
  let x = 32;
286
- p <= G && (x = r < 400 ? 16 : 24);
287
- const E = `${t.category.name}: ${h}`, M = {
286
+ f <= G && (x = r < 400 ? 16 : 24);
287
+ const I = `${t.category.name}: ${p}`, M = {
288
288
  modifiers: [
289
289
  {
290
290
  name: "offset",
291
291
  options: { offset: [0, 15] }
292
292
  }
293
293
  ]
294
- }, N = (L) => {
295
- (L.key === "Enter" || L.key === " ") && (L.preventDefault(), i(t));
296
- }, F = () => {
294
+ }, $ = (U) => {
295
+ (U.key === "Enter" || U.key === " ") && (U.preventDefault(), i(t));
296
+ }, z = () => {
297
297
  a(!0);
298
- }, le = () => {
298
+ }, N = () => {
299
299
  a(!1);
300
300
  };
301
301
  return /* @__PURE__ */ g(
302
302
  "g",
303
303
  {
304
- "aria-label": `${_} - ${h}`,
304
+ "aria-label": `${C} - ${p}`,
305
305
  className: "bubble",
306
- id: `bubble-${f}`,
307
- onBlur: le,
306
+ id: `bubble-${h}`,
307
+ onBlur: N,
308
308
  onClick: () => i(t),
309
- onFocus: F,
310
- onKeyDown: N,
309
+ onFocus: z,
310
+ onKeyDown: $,
311
311
  onMouseEnter: () => a(!0),
312
312
  onMouseLeave: () => a(!1),
313
313
  role: "button",
@@ -315,7 +315,7 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
315
315
  tabIndex: 0,
316
316
  textAnchor: "middle",
317
317
  x: S,
318
- y: b,
318
+ y: _,
319
319
  children: [
320
320
  /* @__PURE__ */ e("style", { children: `
321
321
  .bubble:focus,
@@ -329,56 +329,47 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
329
329
  stroke-opacity: 0.8;
330
330
  }
331
331
  ` }),
332
- /* @__PURE__ */ e(
333
- Ke,
334
- {
335
- followCursor: !0,
336
- open: s,
337
- slotProps: { popper: M },
338
- title: E,
339
- children: /* @__PURE__ */ e("circle", { fill: d, id: `circle-${f}`, r: p })
340
- }
341
- ),
342
- /* @__PURE__ */ e("svg", { x: v, y: A, children: /* @__PURE__ */ e(P, { name: u, size: x, sx: { fill: m } }) }),
343
- p > G && /* @__PURE__ */ e(
332
+ /* @__PURE__ */ e(Ke, { open: s, slotProps: { popper: M }, title: I, children: /* @__PURE__ */ e("circle", { fill: d, id: `circle-${h}`, r: f }) }),
333
+ /* @__PURE__ */ e("svg", { x: A, y: v, children: /* @__PURE__ */ e(P, { name: u, size: x, sx: { fill: m } }) }),
334
+ f > G && /* @__PURE__ */ e(
344
335
  y,
345
336
  {
346
337
  bold: !0,
347
338
  component: "text",
348
- id: `budget-category-${f}`,
339
+ id: `budget-category-${h}`,
349
340
  sx: { fill: m },
350
341
  variant: "Small",
351
342
  y: 4,
352
- children: _
343
+ children: C
353
344
  }
354
345
  ),
355
- p > me && /* @__PURE__ */ e(
346
+ f > ue && /* @__PURE__ */ e(
356
347
  y,
357
348
  {
358
349
  bold: !0,
359
350
  component: "text",
360
- id: `budget-description-${f}-1`,
351
+ id: `budget-description-${h}-1`,
361
352
  sx: { fill: m },
362
353
  variant: "Body",
363
- y: p <= G ? 12 : 24,
364
- children: p <= G ? h.split(" ")[0] : h
354
+ y: f <= G ? 12 : 24,
355
+ children: f <= G ? p.split(" ")[0] : p
365
356
  }
366
357
  ),
367
- p <= G && p > me && /* @__PURE__ */ e(
358
+ f <= G && f > ue && /* @__PURE__ */ e(
368
359
  y,
369
360
  {
370
361
  component: "text",
371
- id: `budget-description-${f}-2`,
362
+ id: `budget-description-${h}-2`,
372
363
  sx: { fill: m },
373
364
  variant: "XSmall",
374
365
  y: 28,
375
- children: h.split(" ")[1]
366
+ children: p.split(" ")[1]
376
367
  }
377
368
  ),
378
- /* @__PURE__ */ e(St, { bubble: c })
369
+ /* @__PURE__ */ e(St, { bubble: l })
379
370
  ]
380
371
  },
381
- f
372
+ h
382
373
  );
383
374
  }
384
375
  const vt = ({
@@ -388,52 +379,52 @@ const vt = ({
388
379
  onClick: s = () => {
389
380
  }
390
381
  }) => {
391
- const [a, n] = l.useState([]), r = l.useRef(null), c = l.useRef(!1), { detailedBudgets: d } = D(), m = l.useCallback(() => {
392
- const u = r.current, _ = ft(d), f = _.nodes();
382
+ const [a, n] = c.useState([]), r = c.useRef(null), l = c.useRef(!1), { detailedBudgets: d } = D(), m = c.useCallback(() => {
383
+ const u = r.current, C = ft(d), h = C.nodes();
393
384
  if (u) {
394
- const h = u.nodes(), p = new Map(h.map((S) => [S.guid, S]));
395
- f.forEach((S) => {
396
- const b = p.get(S.guid);
397
- b && Object.assign(S, {
398
- vx: b.vx,
399
- vy: b.vy,
400
- x: b.x,
401
- y: b.y
385
+ const p = u.nodes(), f = new Map(p.map((S) => [S.guid, S]));
386
+ h.forEach((S) => {
387
+ const _ = f.get(S.guid);
388
+ _ && Object.assign(S, {
389
+ vx: _.vx,
390
+ vy: _.vy,
391
+ x: _.x,
392
+ y: _.y
402
393
  });
403
394
  });
404
395
  }
405
- r.current = _, c.current = !1, n(f);
396
+ r.current = C, l.current = !1, n(h);
406
397
  }, [d]);
407
- return l.useEffect(() => {
398
+ return c.useEffect(() => {
408
399
  m();
409
- }, [m]), l.useEffect(() => () => {
400
+ }, [m]), c.useEffect(() => () => {
410
401
  r.current && (r.current.stop(), r.current = null);
411
- }, []), l.useEffect(() => {
402
+ }, []), c.useEffect(() => {
412
403
  const u = r.current;
413
404
  if (!u) return;
414
- const _ = u.nodes(), f = o > 0 && o < 450 || t > 0 && t < 300, h = _t(_, d, f, t, o);
415
- u.nodes(h), ht(u, t, o), i && setTimeout(() => {
405
+ const C = u.nodes(), h = o > 0 && o < 450 || t > 0 && t < 300, p = _t(C, d, h, t, o);
406
+ u.nodes(p), ht(u, t, o), i && setTimeout(() => {
416
407
  pt(u);
417
- }, 0), n([...h]);
408
+ }, 0), n([...p]);
418
409
  }, [t, o, i, d]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: a.map((u) => /* @__PURE__ */ e(xt, { bubble: u, isDraggable: i, onClick: s }, u.guid)) });
419
- }, At = I(vt), Tt = ({
410
+ }, At = E(vt), Tt = ({
420
411
  isMiniWidget: t = !1,
421
412
  onConnectAccountsClick: o,
422
413
  createBudgetOnClick: i
423
414
  }) => {
424
- const { recalculateBudgets: s } = D(), { spendCategories: a } = U(), { budgets: n } = w(), { availableWidth: r } = ne(), { isMobile: c } = ie(r), d = t && c, [m, u] = l.useState(!1), [_, f] = l.useState(!1), [h, p] = l.useState(!1), S = l.useMemo(() => [...a.filter((C) => C.totalAverageAmount > 0)], [a]), b = async () => {
425
- p(!0);
426
- const { data: C, isSuccess: v } = await s(S);
427
- p(!1), v ? (C.length === 0 && f(!0), u(!1)) : u(!0);
415
+ const { recalculateBudgets: s } = D(), { spendCategories: a } = K(), { budgets: n } = w(), { availableWidth: r } = ne(), { isMobile: l } = ie(r), d = t && l, [m, u] = c.useState(!1), [C, h] = c.useState(!1), [p, f] = c.useState(!1), S = c.useMemo(() => [...a.filter((b) => b.totalAverageAmount > 0)], [a]), _ = async () => {
416
+ f(!0);
417
+ const { data: b, isSuccess: A } = await s(S);
418
+ f(!1), A ? (b.length === 0 && h(!0), u(!1)) : u(!0);
428
419
  };
429
- return h ? /* @__PURE__ */ e(z, {}) : m ? /* @__PURE__ */ e(
430
- ue,
420
+ return p ? /* @__PURE__ */ e(he, {}) : m ? /* @__PURE__ */ e(
421
+ de,
431
422
  {
432
423
  header: n.autogenerate_budgets_error_header,
433
424
  icon: "error",
434
425
  iconColor: "#4D4D4D",
435
- onClick: (C) => {
436
- C === "primary" ? b() : i();
426
+ onClick: (b) => {
427
+ b === "primary" ? _() : i();
437
428
  },
438
429
  primaryButton: n.autogenerate_budgets_error_primary_button,
439
430
  secondaryButton: n.zero_state_generate_budgets_secondary_button,
@@ -447,14 +438,14 @@ const vt = ({
447
438
  ...d && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
448
439
  }
449
440
  }
450
- ) : /* @__PURE__ */ e(je, { children: _ ? /* @__PURE__ */ e(
451
- ue,
441
+ ) : /* @__PURE__ */ e(Ge, { children: C ? /* @__PURE__ */ e(
442
+ de,
452
443
  {
453
444
  header: n.zero_state_generate_budgets_header,
454
445
  icon: "error",
455
446
  iconColor: "#4D4D4D",
456
- onClick: (C) => {
457
- C === "primary" ? o() : i();
447
+ onClick: (b) => {
448
+ b === "primary" ? o() : i();
458
449
  },
459
450
  primaryButton: n.zero_state_generate_budgets_primary_button,
460
451
  secondaryButton: n.zero_state_generate_budgets_secondary_button,
@@ -473,13 +464,13 @@ const vt = ({
473
464
  }
474
465
  }
475
466
  ) : /* @__PURE__ */ e(
476
- ue,
467
+ de,
477
468
  {
478
469
  header: n.create_budgets_title,
479
470
  icon: "bubble_chart",
480
471
  iconColor: "#1A1A1A",
481
- onClick: (C) => {
482
- C === "primary" ? b() : i();
472
+ onClick: (b) => {
473
+ b === "primary" ? _() : i();
483
474
  },
484
475
  primaryButton: n.empty_state_primary_button,
485
476
  secondaryButton: t ? void 0 : n.empty_state_secondary_button,
@@ -498,7 +489,7 @@ const vt = ({
498
489
  }
499
490
  }
500
491
  ) });
501
- }, Re = I(
492
+ }, Re = E(
502
493
  ({
503
494
  createBudgetOnClick: t = () => {
504
495
  },
@@ -508,34 +499,34 @@ const vt = ({
508
499
  shouldShowZeroState: a,
509
500
  unavailableWidth: n = 24
510
501
  }) => {
511
- const { onEvent: r } = X(), { setSelectedBudget: c } = D(), { isLoadingCategoryTotals: d } = U(), { isInitialized: m } = oe(), { accounts: u } = w(), { availableWidth: _ } = ne(), { isMobile: f } = ie(), [h, p] = l.useState(!1), S = l.useMemo(() => _ - n, [_]), b = (v) => {
512
- c(v), r(k.BUDGETS_CLICK_BUDGET_CATEGORY, {
513
- budget_category: v.category.name,
502
+ const { onEvent: r } = X(), { setSelectedBudget: l } = D(), { isInitialized: d } = oe(), { accounts: m } = w(), { availableWidth: u } = ne(), { isMobile: C } = ie(), [h, p] = c.useState(!1), f = c.useMemo(() => u - n, [u]), S = (b) => {
503
+ l(b), r(k.BUDGETS_CLICK_BUDGET_CATEGORY, {
504
+ budget_category: b.category.name,
514
505
  click_type: "bubble"
515
506
  });
516
- }, C = () => {
507
+ }, _ = () => {
517
508
  p(!0), r(k.ACCOUNTS_CLICK_CONNECT);
518
509
  };
519
- return d ? /* @__PURE__ */ e(B, { alignItems: "center", height: o, justifyContent: "center", width: Math.abs(S), children: /* @__PURE__ */ e(z, {}) }) : /* @__PURE__ */ g(
520
- H,
510
+ return /* @__PURE__ */ g(
511
+ F,
521
512
  {
522
- ml: a || f ? 0 : 24,
513
+ ml: a || C ? 0 : 24,
523
514
  sx: { alignSelf: "center", ...s && { height: "100%" } },
524
515
  children: [
525
- a || !m ? /* @__PURE__ */ e(
516
+ a || !d ? /* @__PURE__ */ e(
526
517
  Tt,
527
518
  {
528
519
  createBudgetOnClick: t,
529
520
  isMiniWidget: s,
530
- onConnectAccountsClick: C
521
+ onConnectAccountsClick: _
531
522
  }
532
523
  ) : /* @__PURE__ */ e(
533
524
  At,
534
525
  {
535
526
  height: o,
536
527
  isDraggable: i,
537
- onClick: b,
538
- width: S
528
+ onClick: S,
529
+ width: f
539
530
  }
540
531
  ),
541
532
  /* @__PURE__ */ e(
@@ -543,7 +534,7 @@ const vt = ({
543
534
  {
544
535
  onClose: () => p(!1),
545
536
  showConnectionsWidget: h,
546
- title: u.manage_connections
537
+ title: m.manage_connections
547
538
  }
548
539
  )
549
540
  ]
@@ -556,13 +547,13 @@ const vt = ({
556
547
  handleAddClick: i,
557
548
  shouldShowZeroState: s
558
549
  }) => {
559
- const { availableHeight: a = 0 } = ne(), n = l.useRef(null);
560
- l.useEffect(() => {
550
+ const { availableHeight: a = 0 } = ne(), n = c.useRef(null);
551
+ c.useEffect(() => {
561
552
  a > 0 && n.current === null && (n.current = a);
562
553
  }, [a]);
563
- const r = l.useMemo(() => {
564
- const c = n.current ?? a;
565
- return c > 0 ? Math.round(Math.max(120, Math.min(450, c * 0.8))) - 40 : 450;
554
+ const r = c.useMemo(() => {
555
+ const l = n.current ?? a;
556
+ return l > 0 ? Math.round(Math.max(120, Math.min(450, l * 0.8))) - 40 : 450;
566
557
  }, [a]);
567
558
  return /* @__PURE__ */ g(B, { sx: { height: "100%", justifyContent: "space-between" }, children: [
568
559
  /* @__PURE__ */ e(
@@ -574,55 +565,61 @@ const vt = ({
574
565
  shouldShowZeroState: s
575
566
  }
576
567
  ),
577
- !s && /* @__PURE__ */ g(H, { ml: 16, children: [
568
+ !s && /* @__PURE__ */ g(F, { ml: 16, children: [
578
569
  /* @__PURE__ */ e(y, { bold: !0, color: o < 0 ? "error.main" : "success.main", children: T(Math.abs(o), "0,0") }),
579
570
  /* @__PURE__ */ e(y, { children: o < 0 ? t.overspent_in_budgets : t.left_in_budgets })
580
571
  ] })
581
572
  ] });
582
573
  }, Dt = (t) => {
583
- const o = ee(), { onEvent: i } = X(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: n, setTheme: r } = D(), { budgets: c, common: d } = w(), { isCopyLoaded: m, isInitialized: u, selectedAccounts: _ } = oe(), { reloadCategoryTotals: f } = U(), h = Ye(), p = s.length === 0, [S, b] = l.useState(!1), C = () => {
574
+ const o = ee(), { onEvent: i } = X(), { visibleAccounts: s } = pe(), { detailedBudgets: a, isDataLoaded: n, loadBudgetData: r, setTheme: l } = D(), { budgets: d, common: m } = w(), { isInitialized: u, selectedAccounts: C, setSelectedAccounts: h } = oe(), { reloadCategoryTotals: p } = K(), f = Ye(), S = a.length === 0, [_, b] = c.useState(!1);
575
+ c.useEffect(() => {
576
+ n || r().finally();
577
+ }, []), c.useEffect(() => {
578
+ l(o);
579
+ }, [o]), c.useEffect(() => {
580
+ h(s);
581
+ }, [s]), c.useEffect(() => {
582
+ u && !n && p(
583
+ C,
584
+ J(/* @__PURE__ */ new Date()),
585
+ me(/* @__PURE__ */ new Date())
586
+ ).finally();
587
+ }, [u, C]);
588
+ const A = () => {
584
589
  b(!0), i(k.BUDGETS_CLICK_ADD);
585
590
  }, v = () => b(!1);
586
- return l.useEffect(() => {
587
- r(o);
588
- }, [o]), l.useEffect(() => {
589
- u && !a && f(_, J(/* @__PURE__ */ new Date()), ge(/* @__PURE__ */ new Date())).then(
590
- () => {
591
- n().finally();
592
- }
593
- );
594
- }, [u, _]), m ? /* @__PURE__ */ g(
591
+ return !u || !n ? /* @__PURE__ */ e(he, {}) : /* @__PURE__ */ g(
595
592
  Ze,
596
593
  {
597
594
  contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
598
- primaryCtaLabel: p ? c.get_started_cta : c.details_cta,
595
+ primaryCtaLabel: S ? d.get_started_cta : d.details_cta,
599
596
  sx: { height: "100%" },
600
- title: c.budgets_title,
597
+ title: d.budgets_title,
601
598
  ...t,
602
599
  children: [
603
- a ? /* @__PURE__ */ e(
600
+ /* @__PURE__ */ e(
604
601
  wt,
605
602
  {
606
- budgetsCopy: c,
607
- difference: h,
608
- handleAddClick: C,
609
- shouldShowZeroState: p
603
+ budgetsCopy: d,
604
+ difference: f,
605
+ handleAddClick: A,
606
+ shouldShowZeroState: S
610
607
  }
611
- ) : /* @__PURE__ */ e(z, {}),
608
+ ),
612
609
  /* @__PURE__ */ e(
613
- $,
610
+ L,
614
611
  {
615
- ariaLabelClose: d.close_aria,
616
- isOpen: S,
612
+ ariaLabelClose: m.close_aria,
613
+ isOpen: _,
617
614
  onClose: () => b(!1),
618
- title: c.add_new_title,
619
- children: /* @__PURE__ */ e(Ee, { onRecalculateBudgets: v })
615
+ title: d.add_new_title,
616
+ children: /* @__PURE__ */ e(Ie, { onRecalculateBudgets: v })
620
617
  }
621
618
  )
622
619
  ]
623
620
  }
624
- ) : /* @__PURE__ */ e(z, {});
625
- }, Ln = I(Dt), Le = ({ budget: t }) => {
621
+ );
622
+ }, kn = E(Dt), ke = ({ budget: t }) => {
626
623
  const {
627
624
  amount: o,
628
625
  budgetColors: { background: i },
@@ -630,26 +627,26 @@ const vt = ({
630
627
  category_guid: a,
631
628
  percentage: n,
632
629
  transaction_total: r
633
- } = t, c = [
630
+ } = t, l = [
634
631
  {
635
632
  color: i,
636
633
  percentage: `${n}%`
637
634
  }
638
635
  ];
639
- return /* @__PURE__ */ e(he, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ g(B, { alignItems: "center", gap: 16, children: [
640
- /* @__PURE__ */ e(W, { categoryGuid: a, size: 56 }),
641
- /* @__PURE__ */ e(ze, { children: `${T(r, "0,0")} / ${T(o, "0,0")}` }),
636
+ return /* @__PURE__ */ e(fe, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(be, { children: /* @__PURE__ */ g(B, { alignItems: "center", gap: 16, children: [
637
+ /* @__PURE__ */ e(H, { categoryGuid: a, size: 56 }),
638
+ /* @__PURE__ */ e(je, { children: `${T(r, "0,0")} / ${T(o, "0,0")}` }),
642
639
  /* @__PURE__ */ e(y, { bold: !0, variant: "XSmall", children: s }),
643
- /* @__PURE__ */ e(pe, { data: c, height: 10 })
640
+ /* @__PURE__ */ e(ge, { data: l, height: 10 })
644
641
  ] }) }) });
645
- }, It = I(() => {
642
+ }, Et = E(() => {
646
643
  const { budgets: t } = w();
647
644
  return /* @__PURE__ */ g(B, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
648
645
  /* @__PURE__ */ e(P, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
649
646
  /* @__PURE__ */ e(y, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
650
647
  /* @__PURE__ */ e(y, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
651
648
  ] });
652
- }), Et = I(({ budget: t }) => {
649
+ }), It = E(({ budget: t }) => {
653
650
  const {
654
651
  amount: o,
655
652
  budgetColors: { background: i },
@@ -658,7 +655,7 @@ const vt = ({
658
655
  transaction_total: n
659
656
  } = t, { setSelectedSubBudget: r } = D();
660
657
  return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () => r(t), children: [
661
- /* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(De, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(W, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
658
+ /* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(De, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
662
659
  /* @__PURE__ */ e(
663
660
  Z,
664
661
  {
@@ -670,20 +667,20 @@ const vt = ({
670
667
  }
671
668
  )
672
669
  ] }) });
673
- }), Ot = I(({ category: t, parentBudget: o }) => {
674
- const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } = ot(), { addBudget: r } = D(), [c, d] = l.useState(!1), [m, u] = l.useState(!1), [_, f] = l.useState(""), [h, p] = l.useState(void 0);
675
- l.useEffect(() => {
676
- n((C) => {
677
- const v = t.subCategories.find((A) => A.guid === C);
678
- v && (p(v), f(`${v.currentAmount === 0 ? "" : v.currentAmount}`), u(!0));
670
+ }), Ot = E(({ category: t, parentBudget: o }) => {
671
+ const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } = ot(), { addBudget: r } = D(), [l, d] = c.useState(!1), [m, u] = c.useState(!1), [C, h] = c.useState(""), [p, f] = c.useState(void 0);
672
+ c.useEffect(() => {
673
+ n((b) => {
674
+ const A = t.subCategories.find((v) => v.guid === b);
675
+ A && (f(A), h(`${A.currentAmount === 0 ? "" : A.currentAmount}`), u(!0));
679
676
  });
680
677
  }, []);
681
678
  const S = () => {
682
679
  a(t.guid), d(!0);
683
- }, b = async () => {
684
- h && Number(_) > 0 && (await r(h, Number(_), o.guid), u(!1), d(!1), p(void 0));
680
+ }, _ = async () => {
681
+ p && Number(C) > 0 && (await r(p, Number(C), o.guid), u(!1), d(!1), f(void 0));
685
682
  };
686
- return /* @__PURE__ */ g(H, { children: [
683
+ return /* @__PURE__ */ g(F, { children: [
687
684
  /* @__PURE__ */ e(V, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Y, { onClick: S, children: /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ g(B, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
688
685
  /* @__PURE__ */ g(B, { alignItems: "center", direction: "row", gap: 8, children: [
689
686
  /* @__PURE__ */ e(P, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
@@ -693,97 +690,97 @@ const vt = ({
693
690
  ] }) }) }) }),
694
691
  /* @__PURE__ */ e(re, {}),
695
692
  /* @__PURE__ */ e(
696
- $,
693
+ L,
697
694
  {
698
695
  ariaLabelClose: s.close_aria,
699
- isOpen: c,
696
+ isOpen: l,
700
697
  onClose: () => d(!1),
701
698
  title: i.add_sub_budget_title,
702
- children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(at, { category: t, subCategories: t.subCategories }) })
699
+ children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(at, { category: t, subCategories: t.subCategories }) })
703
700
  }
704
701
  ),
705
702
  /* @__PURE__ */ e(
706
703
  j,
707
704
  {
708
705
  copy: { close_aria: s.close_aria, title: i.add_title },
709
- disablePrimaryButton: Number(_) <= 0,
706
+ disablePrimaryButton: Number(C) <= 0,
710
707
  isOpen: m,
711
708
  onClose: () => u(!1),
712
- onPrimaryAction: b,
709
+ onPrimaryAction: _,
713
710
  primaryText: i.add_save_button,
714
711
  children: /* @__PURE__ */ e(
715
712
  ce,
716
713
  {
717
- amount: _,
718
- categoryName: h?.name || "",
719
- onAmountChanged: f
714
+ amount: C,
715
+ categoryName: p?.name || "",
716
+ onAmountChanged: h
720
717
  }
721
718
  )
722
719
  }
723
720
  )
724
721
  ] });
725
- }), Mt = I(({ budget: t }) => {
726
- const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: c, updateBudget: d } = D(), { filter: m, setFilter: u } = ae(), [_, f] = l.useState(!1), [h, p] = l.useState(!1), [S, b] = l.useState("");
727
- l.useEffect(() => {
728
- r && (b(`${r.amount}`), u({
722
+ }), Mt = E(({ budget: t }) => {
723
+ const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: l, updateBudget: d } = D(), { filter: m, setFilter: u } = ae(), [C, h] = c.useState(!1), [p, f] = c.useState(!1), [S, _] = c.useState("");
724
+ c.useEffect(() => {
725
+ r && (_(`${r.amount}`), u({
729
726
  ...m,
730
727
  custom: (x) => x.category_guid === r.category_guid
731
728
  }));
732
729
  }, [r]);
733
- const C = async () => {
730
+ const b = async () => {
734
731
  r && await d({
735
732
  ...r,
736
733
  amount: Number(S)
737
734
  });
738
- }, v = async () => {
739
- r && await n(r.guid), p(!1), A();
740
- }, A = () => {
735
+ }, A = async () => {
736
+ r && await n(r.guid), f(!1), v();
737
+ }, v = () => {
741
738
  u({
742
739
  ...m,
743
740
  custom: (x) => x.category_guid === t.category_guid || x.top_level_category_guid === t.category_guid
744
- }), c(void 0);
741
+ }), l(void 0);
745
742
  };
746
- return /* @__PURE__ */ g(l.Fragment, { children: [
747
- /* @__PURE__ */ g(K, { sx: { bgcolor: "background.paper" }, children: [
748
- i.length === 0 ? /* @__PURE__ */ e(It, {}) : i.map((x) => /* @__PURE__ */ g(l.Fragment, { children: [
749
- /* @__PURE__ */ e(Et, { budget: x }),
743
+ return /* @__PURE__ */ g(c.Fragment, { children: [
744
+ /* @__PURE__ */ g(W, { sx: { bgcolor: "background.paper" }, children: [
745
+ i.length === 0 ? /* @__PURE__ */ e(Et, {}) : i.map((x) => /* @__PURE__ */ g(c.Fragment, { children: [
746
+ /* @__PURE__ */ e(It, { budget: x }),
750
747
  /* @__PURE__ */ e(re, {})
751
748
  ] }, x.guid)),
752
749
  /* @__PURE__ */ e(Ot, { category: o, parentBudget: t })
753
750
  ] }),
754
751
  /* @__PURE__ */ e(
755
- $,
752
+ L,
756
753
  {
757
754
  ariaLabelClose: a.close_aria,
758
755
  isOpen: !!r,
759
- onClose: A,
760
- onPrimaryAction: () => f(!0),
761
- onSecondaryAction: () => p(!0),
756
+ onClose: v,
757
+ onPrimaryAction: () => h(!0),
758
+ onSecondaryAction: () => f(!0),
762
759
  primaryText: s.details_edit_button,
763
760
  secondaryText: s.details_delete_button,
764
761
  title: s.details_title,
765
762
  children: r && /* @__PURE__ */ g(B, { gap: 24, children: [
766
- /* @__PURE__ */ e(Le, { budget: r }),
763
+ /* @__PURE__ */ e(ke, { budget: r }),
767
764
  /* @__PURE__ */ e(we, { height: "100%" })
768
765
  ] })
769
766
  }
770
767
  ),
771
- r && /* @__PURE__ */ g(l.Fragment, { children: [
768
+ r && /* @__PURE__ */ g(c.Fragment, { children: [
772
769
  /* @__PURE__ */ e(
773
770
  j,
774
771
  {
775
772
  copy: { close_aria: a.close_aria, title: s.details_edit_title },
776
773
  disablePrimaryButton: Number(S) <= 0,
777
- isOpen: _,
778
- onClose: () => f(!1),
779
- onPrimaryAction: C,
774
+ isOpen: C,
775
+ onClose: () => h(!1),
776
+ onPrimaryAction: b,
780
777
  primaryText: s.edit_save_button,
781
778
  children: /* @__PURE__ */ e(
782
779
  ce,
783
780
  {
784
781
  amount: S,
785
782
  categoryName: r.category.name,
786
- onAmountChanged: b
783
+ onAmountChanged: _
787
784
  }
788
785
  )
789
786
  }
@@ -792,9 +789,9 @@ const vt = ({
792
789
  j,
793
790
  {
794
791
  copy: { close_aria: a.close_aria, title: s.delete_title },
795
- isOpen: h,
796
- onClose: () => p(!1),
797
- onPrimaryAction: v,
792
+ isOpen: p,
793
+ onClose: () => f(!1),
794
+ onPrimaryAction: A,
798
795
  primaryColor: "error",
799
796
  primaryText: "Delete",
800
797
  secondaryColor: "secondary",
@@ -803,41 +800,41 @@ const vt = ({
803
800
  )
804
801
  ] })
805
802
  ] });
806
- }), Rt = I(({ budget: t }) => {
807
- const { is_mobile_webview: o } = Ue(), { setAlert: i } = D(), { budgets: s, common: a, transactions: n } = w(), { isDesktop: r, isSmallTablet: c, isTablet: d } = ie(), {
803
+ }), Rt = E(({ budget: t }) => {
804
+ const { is_mobile_webview: o } = ze(), { setAlert: i } = D(), { budgets: s, common: a, transactions: n } = w(), { isDesktop: r, isSmallTablet: l, isTablet: d } = ie(), {
808
805
  sortedTransactions: m,
809
806
  sortedTransactionsWithSplits: u,
810
- tags: _
811
- } = ae(), [f, h] = l.useState(0), [p, S] = l.useState(""), b = l.useMemo(
812
- () => m.find((x) => x.guid === p),
813
- [p, m]
814
- ), C = (x, E) => {
815
- h(E);
816
- }, v = () => {
817
- tt(u, _), i(s.alert_csv_downloaded);
818
- }, A = m.length > 0 && !o && (r || d && !c);
807
+ tags: C
808
+ } = ae(), [h, p] = c.useState(0), [f, S] = c.useState(""), _ = c.useMemo(
809
+ () => m.find((x) => x.guid === f),
810
+ [f, m]
811
+ ), b = (x, I) => {
812
+ p(I);
813
+ }, A = () => {
814
+ tt(u, C), i(s.alert_csv_downloaded);
815
+ }, v = m.length > 0 && !o && (r || d && !l);
819
816
  return /* @__PURE__ */ g(B, { gap: 24, children: [
820
- /* @__PURE__ */ e(Le, { budget: t }),
817
+ /* @__PURE__ */ e(ke, { budget: t }),
821
818
  /* @__PURE__ */ g(B, { children: [
822
819
  /* @__PURE__ */ g(
823
820
  et,
824
821
  {
825
- onChange: C,
822
+ onChange: b,
826
823
  sx: { width: "100%" },
827
824
  textColor: "primary",
828
- value: f,
825
+ value: h,
829
826
  variant: "fullWidth",
830
827
  children: [
831
- /* @__PURE__ */ e(_e, { label: s.details_transactions_tab }),
832
- /* @__PURE__ */ e(_e, { label: s.details_subbudgets_tab })
828
+ /* @__PURE__ */ e(Ce, { label: s.details_transactions_tab }),
829
+ /* @__PURE__ */ e(Ce, { label: s.details_subbudgets_tab })
833
830
  ]
834
831
  }
835
832
  ),
836
- f === 0 && /* @__PURE__ */ g(B, { children: [
837
- A && /* @__PURE__ */ e(B, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
833
+ h === 0 && /* @__PURE__ */ g(B, { children: [
834
+ v && /* @__PURE__ */ e(B, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
838
835
  Te,
839
836
  {
840
- onClick: v,
837
+ onClick: A,
841
838
  startIcon: /* @__PURE__ */ e(P, { name: "ios_share" }),
842
839
  variant: "text",
843
840
  children: n.export_csv_btn
@@ -845,60 +842,60 @@ const vt = ({
845
842
  ) }),
846
843
  /* @__PURE__ */ e(we, { height: "100%", onClick: S })
847
844
  ] }),
848
- f === 1 && /* @__PURE__ */ e(Mt, { budget: t }),
845
+ h === 1 && /* @__PURE__ */ e(Mt, { budget: t }),
849
846
  /* @__PURE__ */ e(
850
- $,
847
+ L,
851
848
  {
852
849
  ariaLabelClose: a.close_aria,
853
- isOpen: !!b,
850
+ isOpen: !!_,
854
851
  onClose: () => S(""),
855
852
  title: s.details_transaction_drawer,
856
- children: b && /* @__PURE__ */ e(nt, { transaction: b })
853
+ children: _ && /* @__PURE__ */ e(nt, { transaction: _ })
857
854
  }
858
855
  )
859
856
  ] })
860
857
  ] });
861
- }), Lt = I(() => {
858
+ }), kt = E(() => {
862
859
  const { selectedAccountGuids: t } = oe(), { budgets: o, common: i } = w(), {
863
860
  dateRange: s,
864
861
  deleteBudget: a,
865
862
  selectedBudget: n,
866
863
  selectedSubBudget: r,
867
- setAlert: c,
864
+ setAlert: l,
868
865
  setSelectedBudget: d,
869
866
  updateBudget: m
870
- } = D(), { setFilter: u } = ae(), [_, f] = l.useState(!1), [h, p] = l.useState(!1), [S, b] = l.useState(!1), [C, v] = l.useState("");
871
- l.useEffect(() => {
872
- n && !r && (v(`${n.amount}`), f(!0), u({
867
+ } = D(), { setFilter: u } = ae(), [C, h] = c.useState(!1), [p, f] = c.useState(!1), [S, _] = c.useState(!1), [b, A] = c.useState("");
868
+ c.useEffect(() => {
869
+ n && !r && (A(`${n.amount}`), h(!0), u({
873
870
  accounts: t,
874
871
  dateRange: s,
875
872
  custom: (M) => M.category_guid === n.category_guid || M.top_level_category_guid === n.category_guid,
876
873
  showSplits: !0
877
874
  }));
878
875
  }, [n]);
879
- const A = async () => {
876
+ const v = async () => {
880
877
  n && (await m({
881
878
  ...n,
882
- amount: Number(C),
883
- percentage: n.category.totalAmount / Number(C) * 100
884
- }), c(R(o.alert_budget_updated, n.category.name)));
879
+ amount: Number(b),
880
+ percentage: n.category.totalAmount / Number(b) * 100
881
+ }), l(R(o.alert_budget_updated, n.category.name)));
885
882
  }, x = async () => {
886
- n && (await a(n.guid), c(R(o.alert_budget_deleted, n.category.name))), b(!1), E();
887
- }, E = () => {
888
- f(!1), setTimeout(() => {
883
+ n && (await a(n.guid), l(R(o.alert_budget_deleted, n.category.name))), _(!1), I();
884
+ }, I = () => {
885
+ h(!1), setTimeout(() => {
889
886
  d(void 0);
890
887
  }, 250);
891
888
  };
892
889
  if (n)
893
- return /* @__PURE__ */ g(l.Fragment, { children: [
890
+ return /* @__PURE__ */ g(c.Fragment, { children: [
894
891
  /* @__PURE__ */ e(
895
- $,
892
+ L,
896
893
  {
897
894
  ariaLabelClose: i.close_aria,
898
- isOpen: _,
899
- onClose: E,
900
- onPrimaryAction: () => p(!0),
901
- onSecondaryAction: () => b(!0),
895
+ isOpen: C,
896
+ onClose: I,
897
+ onPrimaryAction: () => f(!0),
898
+ onSecondaryAction: () => _(!0),
902
899
  primaryText: o.details_edit_button,
903
900
  secondaryColor: "error",
904
901
  secondaryText: o.details_delete_button,
@@ -910,17 +907,17 @@ const vt = ({
910
907
  j,
911
908
  {
912
909
  copy: { close_aria: i.close_aria, title: o.details_edit_title },
913
- disablePrimaryButton: Number(C) <= 0,
914
- isOpen: h,
915
- onClose: () => p(!1),
916
- onPrimaryAction: A,
910
+ disablePrimaryButton: Number(b) <= 0,
911
+ isOpen: p,
912
+ onClose: () => f(!1),
913
+ onPrimaryAction: v,
917
914
  primaryText: o.edit_save_button,
918
915
  children: /* @__PURE__ */ e(
919
916
  ce,
920
917
  {
921
- amount: C,
918
+ amount: b,
922
919
  categoryName: n.category.name,
923
- onAmountChanged: v
920
+ onAmountChanged: A
924
921
  }
925
922
  )
926
923
  }
@@ -930,7 +927,7 @@ const vt = ({
930
927
  {
931
928
  copy: { close_aria: i.close_aria, title: o.delete_title },
932
929
  isOpen: S,
933
- onClose: () => b(!1),
930
+ onClose: () => _(!1),
934
931
  onPrimaryAction: x,
935
932
  primaryColor: "error",
936
933
  primaryText: o.details_delete_button,
@@ -939,18 +936,18 @@ const vt = ({
939
936
  }
940
937
  )
941
938
  ] });
942
- }), kt = ({ budget: t, onClick: o }) => {
939
+ }), Lt = ({ budget: t, onClick: o }) => {
943
940
  const {
944
941
  amount: i,
945
942
  budgetColors: { background: s, description: a },
946
943
  category_guid: n,
947
944
  description: r,
948
- percentage: c,
945
+ percentage: l,
949
946
  subBudgets: d,
950
947
  transaction_total: m
951
948
  } = t;
952
949
  return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () => o?.(t), children: [
953
- /* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(De, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(W, { categoryGuid: n, variant: "basic" }) }) }),
950
+ /* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(De, { color: s, percent: l, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: n, variant: "basic" }) }) }),
954
951
  /* @__PURE__ */ e(
955
952
  Z,
956
953
  {
@@ -963,70 +960,70 @@ const vt = ({
963
960
  ] }),
964
961
  secondary: /* @__PURE__ */ g(B, { component: "span", direction: "row", justifyContent: "space-between", children: [
965
962
  /* @__PURE__ */ e(y, { variant: "XSmall", children: `${d.length} Sub-budgets` }),
966
- /* @__PURE__ */ e(y, { bold: c > 100, color: a, variant: "XSmall", children: r })
963
+ /* @__PURE__ */ e(y, { bold: l > 100, color: a, variant: "XSmall", children: r })
967
964
  ] })
968
965
  }
969
966
  )
970
967
  ] }) });
971
- }, $t = I(() => {
968
+ }, $t = E(() => {
972
969
  const { onEvent: t } = X(), { budgets: o } = w(), { detailedBudgets: i, setSelectedBudget: s } = D(), a = (n) => {
973
970
  s(n), t(k.BUDGETS_CLICK_BUDGET_CATEGORY, {
974
971
  budget_category: n.category.name,
975
972
  click_type: "list"
976
973
  });
977
974
  };
978
- return /* @__PURE__ */ g(he, { elevation: 2, children: [
979
- /* @__PURE__ */ e(Ie, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(ve, { children: o.budget_categories_title }) }),
980
- /* @__PURE__ */ e(fe, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(K, { children: i.map((n) => /* @__PURE__ */ g(l.Fragment, { children: [
981
- /* @__PURE__ */ e(kt, { budget: n, onClick: a }),
975
+ return /* @__PURE__ */ g(fe, { elevation: 2, children: [
976
+ /* @__PURE__ */ e(Ee, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: o.budget_categories_title }) }),
977
+ /* @__PURE__ */ e(be, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(W, { children: i.map((n) => /* @__PURE__ */ g(c.Fragment, { children: [
978
+ /* @__PURE__ */ e(Lt, { budget: n, onClick: a }),
982
979
  /* @__PURE__ */ e(re, {})
983
980
  ] }, n.guid)) }) })
984
981
  ] });
985
- }), Nt = I(() => {
986
- const t = ee(), { onEvent: o } = X(), { visibleAccounts: i } = Ae(), { budgets: s, common: a, recurring: n } = w(), { incomeCategories: r, spendCategories: c } = U(), { detailedBudgets: d, totalBudgeted: m } = D(), { incomeTotal: u } = te(), { setFilter: _ } = ae(), [f, h] = l.useState(!1), [p, S] = l.useMemo(() => {
987
- const A = c.reduce((N, F) => N + F.totalAmount, 0);
988
- let x = A / m;
982
+ }), Nt = E(() => {
983
+ const t = ee(), { onEvent: o } = X(), { visibleAccounts: i } = pe(), { budgets: s, common: a, recurring: n } = w(), { incomeCategories: r, spendCategories: l } = K(), { detailedBudgets: d, totalBudgeted: m } = D(), { incomeTotal: u } = te(), { setFilter: C } = ae(), [h, p] = c.useState(!1), [f, S] = c.useMemo(() => {
984
+ const v = l.reduce(($, z) => $ + z.totalAmount, 0);
985
+ let x = v / m;
989
986
  x > 1 && (x = 1);
990
- let E = t.palette.success.main;
991
- x > 0.8 && x < 1 ? E = t.palette.warning.main : x >= 1 && (E = t.palette.error.main);
987
+ let I = t.palette.success.main;
988
+ x > 0.8 && x < 1 ? I = t.palette.warning.main : x >= 1 && (I = t.palette.error.main);
992
989
  const M = [
993
990
  {
994
- color: E,
991
+ color: I,
995
992
  percentage: `${x}`
996
993
  }
997
994
  ];
998
- return [A, M];
999
- }, [d, c]), [b, C] = l.useMemo(() => {
1000
- const A = Math.abs(
1001
- r.reduce((M, N) => M + N.totalAmount, 0)
995
+ return [v, M];
996
+ }, [d, l]), [_, b] = c.useMemo(() => {
997
+ const v = Math.abs(
998
+ r.reduce((M, $) => M + $.totalAmount, 0)
1002
999
  );
1003
- let x = A / u;
1000
+ let x = v / u;
1004
1001
  x > 1 && (x = 1);
1005
- const E = [
1002
+ const I = [
1006
1003
  {
1007
1004
  color: t.palette.secondary.main,
1008
1005
  percentage: `${x}`
1009
1006
  }
1010
1007
  ];
1011
- return [A, E];
1012
- }, [r, u]), v = () => {
1013
- _({
1014
- accounts: i.map((A) => A.guid),
1008
+ return [v, I];
1009
+ }, [r, u]), A = () => {
1010
+ C({
1011
+ accounts: i.map((v) => v.guid),
1015
1012
  dateRange: {
1016
1013
  start: rt(/* @__PURE__ */ new Date(), 90),
1017
1014
  end: /* @__PURE__ */ new Date()
1018
1015
  }
1019
- }), h(!0), o(k.BUDGETS_CLICK_EDIT_INCOME);
1016
+ }), p(!0), o(k.BUDGETS_CLICK_EDIT_INCOME);
1020
1017
  };
1021
- return /* @__PURE__ */ g(he, { elevation: 2, sx: { overflow: "visible" }, children: [
1022
- /* @__PURE__ */ e(Ie, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(ve, { children: s.overview_title }) }),
1023
- /* @__PURE__ */ e(fe, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ g(B, { gap: 24, children: [
1018
+ return /* @__PURE__ */ g(fe, { elevation: 2, sx: { overflow: "visible" }, children: [
1019
+ /* @__PURE__ */ e(Ee, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: s.overview_title }) }),
1020
+ /* @__PURE__ */ e(be, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ g(B, { gap: 24, children: [
1024
1021
  /* @__PURE__ */ g(B, { gap: 8, children: [
1025
1022
  /* @__PURE__ */ e(y, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
1026
- /* @__PURE__ */ e(pe, { data: S, height: 16 }),
1023
+ /* @__PURE__ */ e(ge, { data: S, height: 16 }),
1027
1024
  /* @__PURE__ */ e(y, { variant: "Small", children: R(
1028
1025
  s.spending_description,
1029
- T(p, "0,0"),
1026
+ T(f, "0,0"),
1030
1027
  T(m, "0,0")
1031
1028
  ) })
1032
1029
  ] }),
@@ -1037,105 +1034,106 @@ const vt = ({
1037
1034
  st,
1038
1035
  {
1039
1036
  "aria-label": n.manage_income,
1040
- onClick: v,
1037
+ onClick: A,
1041
1038
  sx: { p: 0 },
1042
1039
  children: /* @__PURE__ */ e(P, { color: "primary", name: "edit" })
1043
1040
  }
1044
1041
  )
1045
1042
  ] }),
1046
- /* @__PURE__ */ e(pe, { data: C, height: 16 }),
1043
+ /* @__PURE__ */ e(ge, { data: b, height: 16 }),
1047
1044
  /* @__PURE__ */ e(y, { variant: "Small", children: R(
1048
1045
  s.income_description,
1049
- T(b, "0,0"),
1046
+ T(_, "0,0"),
1050
1047
  T(u, "0,0")
1051
1048
  ) })
1052
1049
  ] })
1053
1050
  ] }) }),
1054
1051
  /* @__PURE__ */ e(
1055
- $,
1052
+ L,
1056
1053
  {
1057
1054
  ariaLabelClose: a.close_aria,
1058
- isOpen: f,
1059
- onClose: () => h(!1),
1055
+ isOpen: h,
1056
+ onClose: () => p(!1),
1060
1057
  title: n.manage_income,
1061
1058
  children: /* @__PURE__ */ e(it, { forOverview: !0 })
1062
1059
  }
1063
1060
  )
1064
1061
  ] });
1065
- }), xe = 480, kn = I(({ onBackClick: t, sx: o }) => {
1066
- const i = ee(), { onEvent: s } = X(), { visibleAccounts: a } = Ae(), { budgets: n, common: r } = w(), { isCopyLoaded: c, isInitialized: d, selectedAccounts: m, setDisplayedDate: u, setSelectedAccounts: _ } = oe(), {
1067
- alert: f,
1068
- dateRange: h,
1069
- isDataLoaded: p,
1062
+ }), ve = 480, Ln = E(({ onBackClick: t, sx: o }) => {
1063
+ const i = ee(), { onEvent: s } = X(), { onLoad: a } = Ue(), { visibleAccounts: n } = pe(), { budgets: r, common: l } = w(), { isInitialized: d, selectedAccounts: m, setDisplayedDate: u, setSelectedAccounts: C } = oe(), {
1064
+ alert: h,
1065
+ dateRange: p,
1066
+ isDataLoaded: f,
1070
1067
  loadBudgetData: S,
1071
- setDateRange: b,
1072
- setAlert: C,
1073
- setTheme: v,
1074
- detailedBudgets: A
1075
- } = D(), { loadRepeatingTransactions: x, setDateRange: E } = te(), { reloadCategoryTotals: M } = U(), { isSmallTablet: N, isMobile: F, isSmallMobile: le } = ie(), L = N || F || le, [ke, de] = l.useState(!1);
1076
- l.useEffect(() => (v(i), _(a), b({ start: J(q()), end: ge(q()) }), s(k.BUDGETS_VIEW), () => {
1077
- b({ start: J(q()), end: ge(q()) });
1078
- }), []), l.useEffect(() => {
1079
- _(a);
1080
- }, [a]), l.useEffect(() => {
1081
- d && (u(h.start, h.end), M(m, h.start, h.end).finally(), E(h), p || (x().finally(), S().finally()));
1082
- }, [d, m, h]);
1083
- const $e = (ye) => {
1084
- b({ start: ye[0] || /* @__PURE__ */ new Date(), end: ye[1] || /* @__PURE__ */ new Date() });
1085
- }, Ne = () => {
1068
+ setDateRange: _,
1069
+ setAlert: b,
1070
+ setTheme: A,
1071
+ detailedBudgets: v
1072
+ } = D(), { setDateRange: x } = te(), { reloadCategoryTotals: I } = K(), { isSmallTablet: M, isMobile: $, isSmallMobile: z } = ie(), N = M || $ || z, [U, le] = c.useState(!1);
1073
+ c.useEffect(() => {
1074
+ A(i), S().finally(() => {
1075
+ s(k.BUDGETS_VIEW), a?.("BubbleBudgetsWidget");
1076
+ });
1077
+ }, []), c.useEffect(() => (C(n), _({ start: J(q()), end: me(q()) }), () => {
1078
+ _({ start: J(q()), end: me(q()) });
1079
+ }), [n]), c.useEffect(() => {
1080
+ d && (u(p.start, p.end), I(m, p.start, p.end).finally(), x(p));
1081
+ }, [d, m, p]);
1082
+ const Le = (_e) => {
1083
+ _({ start: _e[0] || /* @__PURE__ */ new Date(), end: _e[1] || /* @__PURE__ */ new Date() });
1084
+ }, $e = () => {
1086
1085
  s(k.BUDGETS_CLICK_FILTER);
1087
- }, be = () => {
1088
- de(!0), s(k.BUDGETS_CLICK_ADD);
1089
- }, Pe = () => {
1090
- de(!1);
1091
- }, Ge = qe(h.end, J(/* @__PURE__ */ new Date()));
1092
- return !c || !d || !p ? /* @__PURE__ */ e(z, {}) : /* @__PURE__ */ g(
1086
+ }, ye = () => {
1087
+ le(!0), s(k.BUDGETS_CLICK_ADD);
1088
+ }, Ne = () => {
1089
+ le(!1);
1090
+ }, Pe = qe(p.end, J(/* @__PURE__ */ new Date()));
1091
+ return !d || !f ? /* @__PURE__ */ e(he, {}) : /* @__PURE__ */ g(
1093
1092
  Ve,
1094
1093
  {
1095
- accountOptions: a,
1094
+ accountOptions: n,
1096
1095
  actions: [
1097
1096
  {
1098
1097
  iconName: "add",
1099
- label: n.add_title,
1100
- onClick: be
1098
+ label: r.add_title,
1099
+ onClick: ye
1101
1100
  }
1102
1101
  ],
1103
1102
  calendarActions: {
1104
- onRangeChanged: $e,
1105
- shouldDisableNext: Ge,
1103
+ onRangeChanged: Le,
1104
+ shouldDisableNext: Pe,
1106
1105
  shouldDisablePicker: !0
1107
1106
  },
1108
- onAccountsFilterClick: Ne,
1107
+ onAccountsFilterClick: $e,
1109
1108
  onBackClick: t,
1110
1109
  sx: o,
1111
- title: n.budgets_title,
1110
+ title: r.budgets_title,
1112
1111
  children: [
1113
- (!d || !p) && /* @__PURE__ */ e(z, {}),
1114
- d && p && /* @__PURE__ */ g(
1112
+ /* @__PURE__ */ g(
1115
1113
  B,
1116
1114
  {
1117
- direction: L ? "column" : "row",
1115
+ direction: N ? "column" : "row",
1118
1116
  height: "100%",
1119
1117
  sx: { justifyContent: "center" },
1120
1118
  width: "100%",
1121
1119
  children: [
1122
- /* @__PURE__ */ e(B, { height: L ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
1120
+ /* @__PURE__ */ e(B, { height: N ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
1123
1121
  Re,
1124
1122
  {
1125
- createBudgetOnClick: be,
1126
- height: L ? 450 : 800,
1123
+ createBudgetOnClick: ye,
1124
+ height: N ? 450 : 800,
1127
1125
  isDraggable: !0,
1128
- shouldShowZeroState: A.length === 0,
1129
- unavailableWidth: L ? 0 : xe
1126
+ shouldShowZeroState: v.length === 0,
1127
+ unavailableWidth: N ? 0 : ve
1130
1128
  }
1131
1129
  ) }),
1132
- A.length !== 0 && /* @__PURE__ */ g(
1130
+ v.length !== 0 && /* @__PURE__ */ g(
1133
1131
  B,
1134
1132
  {
1135
1133
  gap: 24,
1136
1134
  height: "100%",
1137
1135
  sx: { mr: 24, mt: 48 },
1138
- width: L ? "100%" : xe,
1136
+ width: N ? "100%" : ve,
1139
1137
  children: [
1140
1138
  /* @__PURE__ */ e(Nt, {}),
1141
1139
  /* @__PURE__ */ e($t, {})
@@ -1145,15 +1143,15 @@ const vt = ({
1145
1143
  ]
1146
1144
  }
1147
1145
  ),
1148
- /* @__PURE__ */ e(Lt, {}),
1146
+ /* @__PURE__ */ e(kt, {}),
1149
1147
  /* @__PURE__ */ e(
1150
- $,
1148
+ L,
1151
1149
  {
1152
- ariaLabelClose: r.close_aria,
1153
- isOpen: ke,
1154
- onClose: () => de(!1),
1155
- title: n.add_new_title,
1156
- children: /* @__PURE__ */ e(Ee, { onRecalculateBudgets: Pe })
1150
+ ariaLabelClose: l.close_aria,
1151
+ isOpen: U,
1152
+ onClose: () => le(!1),
1153
+ title: r.add_new_title,
1154
+ children: /* @__PURE__ */ e(Ie, { onRecalculateBudgets: Ne })
1157
1155
  }
1158
1156
  ),
1159
1157
  /* @__PURE__ */ e(
@@ -1162,18 +1160,18 @@ const vt = ({
1162
1160
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
1163
1161
  autoHideDuration: 3500,
1164
1162
  onClose: () => {
1165
- C("");
1163
+ b("");
1166
1164
  },
1167
- open: !!f,
1165
+ open: !!h,
1168
1166
  children: /* @__PURE__ */ e(
1169
1167
  Je,
1170
1168
  {
1171
1169
  onClose: () => {
1172
- C("");
1170
+ b("");
1173
1171
  },
1174
1172
  severity: "success",
1175
1173
  variant: "filled",
1176
- children: f
1174
+ children: h
1177
1175
  }
1178
1176
  )
1179
1177
  }
@@ -1183,6 +1181,6 @@ const vt = ({
1183
1181
  );
1184
1182
  });
1185
1183
  export {
1186
- Ln as BubbleBudgetsMiniWidget,
1187
- kn as BubbleBudgetsWidget
1184
+ kn as BubbleBudgetsMiniWidget,
1185
+ Ln as BubbleBudgetsWidget
1188
1186
  };