@mx-cartographer/experiences 7.4.8-alpha.mm1 → 7.4.9

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