@mx-cartographer/experiences 7.4.8 → 7.4.10

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