@mx-cartographer/experiences 7.10.30 → 7.10.32

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 (33) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{BudgetUtil-DKNyjCWc.mjs → BudgetUtil-CHDuDNhl.mjs} +69 -71
  3. package/dist/{ExportCsvAction-8uWKc_e2.mjs → ExportCsvAction-BqNTIBjm.mjs} +2 -2
  4. package/dist/{ManageIncome-BtOMmeKb.mjs → ManageIncome-CWQoWlbs.mjs} +3 -3
  5. package/dist/{RecurringSettings-DOgdSycO.mjs → RecurringSettings-BapZfEnY.mjs} +1 -1
  6. package/dist/StatusIndicator-0iX3Gnnu.mjs +55 -0
  7. package/dist/{Transaction-RmKYEKSk.mjs → Transaction-BiOMLCAA.mjs} +4 -3
  8. package/dist/TransactionDetails-c7ncR7HI.mjs +1172 -0
  9. package/dist/{TransactionList-Dxi733-M.mjs → TransactionList-CmZSDhKW.mjs} +1 -1
  10. package/dist/{TransactionStore-B-fc3CsB.mjs → TransactionStore-DoBXsvqm.mjs} +2 -2
  11. package/dist/accounts/index.es.js +2 -2
  12. package/dist/budgets/components/BudgetDetailsDrawerV2.d.ts +2 -1
  13. package/dist/budgets/index.es.js +759 -740
  14. package/dist/cashflow/index.es.js +3 -3
  15. package/dist/common/components/CurrencyDialog.d.ts +1 -1
  16. package/dist/common/index.es.js +6 -6
  17. package/dist/common/types/localization/BudgetsCopy.d.ts +1 -0
  18. package/dist/{exportTransactionsToCSV-RUWymyA3.mjs → exportTransactionsToCSV-YO3xewit.mjs} +1 -1
  19. package/dist/finstrong/index.es.js +3 -3
  20. package/dist/insights/components/insights/CategorySpendingV2/types/CategorySpendingV2.d.ts +1 -0
  21. package/dist/insights/components/shared/ChartDrawerTemplate/ChartDrawerTemplate.d.ts +2 -1
  22. package/dist/insights/components/shared/ChartTransactionWithDrillDown.d.ts +2 -1
  23. package/dist/insights/components/shared/StatusIndicator.d.ts +1 -1
  24. package/dist/insights/index.es.js +698 -690
  25. package/dist/recurringtransactions/index.es.js +4 -4
  26. package/dist/spending/index.es.js +3 -3
  27. package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.d.ts +6 -0
  28. package/dist/transactions/constants/Actions.d.ts +4 -3
  29. package/dist/transactions/index.es.js +10 -10
  30. package/dist/trends/index.es.js +3 -3
  31. package/package.json +1 -1
  32. package/dist/StatusIndicator-yCwjN_ky.mjs +0 -55
  33. package/dist/TransactionDetails-BYKl7pix.mjs +0 -1158
@@ -1,133 +1,134 @@
1
- import { jsxs as m, jsx as e, Fragment as Ve } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as e, Fragment as qe } from "react/jsx-runtime";
2
2
  import l from "react";
3
- import { observer as E } from "mobx-react-lite";
4
- import { endOfMonth as Ce } from "date-fns/endOfMonth";
5
- import { isAfter as Xe } from "date-fns/isAfter";
6
- import { startOfMonth as re } from "date-fns/startOfMonth";
7
- import { startOfToday as ae } from "date-fns/startOfToday";
8
- import ke from "@mui/material/Alert";
9
- import Ne from "@mui/material/Snackbar";
10
- import S from "@mui/material/Stack";
11
- import ie from "@mui/material/styles/useTheme";
3
+ import { observer as I } from "mobx-react-lite";
4
+ import { endOfMonth as Be } from "date-fns/endOfMonth";
5
+ import { isAfter as Je } from "date-fns/isAfter";
6
+ import { startOfMonth as ce } from "date-fns/startOfMonth";
7
+ import { startOfToday as se } from "date-fns/startOfToday";
8
+ import Ae from "@mui/material/Alert";
9
+ import ve from "@mui/material/Snackbar";
10
+ import x from "@mui/material/Stack";
11
+ import de from "@mui/material/styles/useTheme";
12
12
  import W from "@mui/material/Box";
13
- import Y from "@mui/material/List";
14
- import { Text as C, CategoryIcon as H, Icon as j, H2 as Ye, H3 as Se } from "@mxenabled/mxui";
15
- import { u as w, k as D, i as ce, m as Z, p as le, a as $e, g as q, b as J, h as Q, d as Pe } from "../hooks-DWJQ4phS.mjs";
13
+ import Z from "@mui/material/List";
14
+ import { Text as S, CategoryIcon as H, Icon as j, H2 as Pe, H3 as Ge, P as ye } from "@mxenabled/mxui";
15
+ import { u as D, k as E, i as ue, m as q, p as me, a as je, g as J, b as Q, h as ee, d as Fe } from "../hooks-DWJQ4phS.mjs";
16
16
  import { f as T } from "../NumberFormatting-DjTD0t3W.mjs";
17
- import xe from "@mui/material/Button";
18
- import de from "@mui/material/Divider";
19
- import ee from "@mui/material/ListItem";
20
- import ue from "@mui/material/ListItemAvatar";
21
- import te from "@mui/material/ListItemButton";
22
- import oe from "@mui/material/ListItemText";
23
- import { b as M } from "../Localization-2MODESHW.mjs";
24
- import { D as $ } from "../Drawer-DV4NTsFg.mjs";
25
- import Ze from "@mui/material/ListItemSecondaryAction";
26
- import { C as qe } from "../CurrencyInput-6U2Ln1bK.mjs";
17
+ import Te from "@mui/material/Button";
18
+ import ge from "@mui/material/Divider";
19
+ import te from "@mui/material/ListItem";
20
+ import pe from "@mui/material/ListItemAvatar";
21
+ import oe from "@mui/material/ListItemButton";
22
+ import ne from "@mui/material/ListItemText";
23
+ import { b as R } from "../Localization-2MODESHW.mjs";
24
+ import { D as k } from "../Drawer-DV4NTsFg.mjs";
25
+ import Qe from "@mui/material/ListItemSecondaryAction";
26
+ import { C as et } from "../CurrencyInput-6U2Ln1bK.mjs";
27
27
  import { D as U } from "../Dialog-BqUCsQvo.mjs";
28
- import { C as Je } from "../ConnectionsDrawer-uWuM7QfF.mjs";
29
- import * as R from "d3";
30
- import Qe from "@mui/material/Tooltip";
31
- import { useTheme as Ge, alpha as et } from "@mui/material/styles";
32
- import { u as me } from "../useScreenSize-B6JyS_Lj.mjs";
33
- import { L as ge } from "../Loader-D3rjKx72.mjs";
34
- import { E as _e } from "../EmptyState-DHAkGsjk.mjs";
28
+ import { C as tt } from "../ConnectionsDrawer-uWuM7QfF.mjs";
29
+ import * as M from "d3";
30
+ import ot from "@mui/material/Tooltip";
31
+ import { useTheme as ze, alpha as nt } from "@mui/material/styles";
32
+ import { u as he } from "../useScreenSize-B6JyS_Lj.mjs";
33
+ import { L as fe } from "../Loader-D3rjKx72.mjs";
34
+ import { E as Ce } from "../EmptyState-DHAkGsjk.mjs";
35
35
  import { A as G } from "../Analytics-i5h6BxR1.mjs";
36
- import Ie from "@mui/material/Tab";
37
- import tt from "@mui/material/Tabs";
38
- import { e as ot } from "../exportTransactionsToCSV-RUWymyA3.mjs";
39
- import { T as Ae } from "../TransactionList-Dxi733-M.mjs";
40
- import { T as nt } from "../TransactionDetails-BYKl7pix.mjs";
41
- import ve from "@mui/material/Card";
42
- import Te from "@mui/material/CardContent";
43
- import { S as Be } from "../StatusBar-BK_uYHAB.mjs";
44
- import { S as je } from "../SingleSegmentDonut-BgbLgwHi.mjs";
45
- import { u as at, b as rt } from "../CategorySelectorDrawer-CW0bCdqR.mjs";
46
- import we from "@mui/material/CardHeader";
47
- import { subDays as st } from "date-fns/subDays";
48
- import it from "@mui/material/IconButton";
49
- import { M as ct } from "../ManageIncome-BtOMmeKb.mjs";
50
- import { u as Fe } from "../useWidgetLoadTimer-BbV8q0k6.mjs";
51
- import { W as lt } from "../WidgetContainer-W9s0Jt3H.mjs";
52
- import { u as dt, C as ut } from "../BudgetUtil-DKNyjCWc.mjs";
53
- import { M as mt } from "../MiniWidgetContainer-BPuE3cfO.mjs";
54
- import { Icon as gt, ChevronRight as pt } from "@mxenabled/mx-icons";
55
- import { b as Ee } from "../CategoryUtil-Cufq3fxg.mjs";
56
- import { S as ht } from "../StatusIndicator-yCwjN_ky.mjs";
57
- import { f as ft } from "../DateFormats-Cs-NbEZ7.mjs";
58
- const bt = E(() => {
59
- const { budgets: t } = w(), { totalBudgeted: a } = D(), { incomeTotal: i } = ce(), s = i - a;
60
- return /* @__PURE__ */ m(S, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
61
- /* @__PURE__ */ m(S, { alignItems: "center", children: [
62
- /* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: T(i, "0,0") }),
63
- /* @__PURE__ */ e(C, { color: "secondary", variant: "Small", children: t.projected_income })
36
+ import Re from "@mui/material/Tab";
37
+ import at from "@mui/material/Tabs";
38
+ import { e as rt } from "../exportTransactionsToCSV-YO3xewit.mjs";
39
+ import { T as De } from "../TransactionList-CmZSDhKW.mjs";
40
+ import { T as st } from "../TransactionDetails-c7ncR7HI.mjs";
41
+ import Ee from "@mui/material/Card";
42
+ import we from "@mui/material/CardContent";
43
+ import { S as xe } from "../StatusBar-BK_uYHAB.mjs";
44
+ import { S as Ue } from "../SingleSegmentDonut-BgbLgwHi.mjs";
45
+ import { u as it, b as ct } from "../CategorySelectorDrawer-CW0bCdqR.mjs";
46
+ import We from "@mui/material/CardHeader";
47
+ import { subDays as lt } from "date-fns/subDays";
48
+ import dt from "@mui/material/IconButton";
49
+ import { M as ut } from "../ManageIncome-CWQoWlbs.mjs";
50
+ import { u as He } from "../useWidgetLoadTimer-BbV8q0k6.mjs";
51
+ import { W as mt } from "../WidgetContainer-W9s0Jt3H.mjs";
52
+ import { u as gt, C as pt } from "../BudgetUtil-CHDuDNhl.mjs";
53
+ import { M as ht } from "../MiniWidgetContainer-BPuE3cfO.mjs";
54
+ import { ChevronRight as ft } from "@mxenabled/mx-icons";
55
+ import { b as Me } from "../CategoryUtil-Cufq3fxg.mjs";
56
+ import { S as bt } from "../StatusIndicator-0iX3Gnnu.mjs";
57
+ import { i as _t } from "../DateUtil-CVXVMbjf.mjs";
58
+ import { f as yt } from "../DateFormats-Cs-NbEZ7.mjs";
59
+ const Ct = I(() => {
60
+ const { budgets: t } = D(), { totalBudgeted: n } = E(), { incomeTotal: i } = ue(), s = i - n;
61
+ return /* @__PURE__ */ u(x, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
62
+ /* @__PURE__ */ u(x, { alignItems: "center", children: [
63
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(i, "0,0") }),
64
+ /* @__PURE__ */ e(S, { color: "secondary", variant: "Small", children: t.projected_income })
64
65
  ] }),
65
- /* @__PURE__ */ e(C, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
66
- /* @__PURE__ */ m(S, { alignItems: "center", children: [
67
- /* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: T(a, "0,0") }),
68
- /* @__PURE__ */ e(C, { color: "secondary", variant: "Small", children: t.budgeted })
66
+ /* @__PURE__ */ e(S, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
67
+ /* @__PURE__ */ u(x, { alignItems: "center", children: [
68
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(n, "0,0") }),
69
+ /* @__PURE__ */ e(S, { color: "secondary", variant: "Small", children: t.budgeted })
69
70
  ] }),
70
- /* @__PURE__ */ e(C, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
71
- /* @__PURE__ */ m(S, { alignItems: "center", children: [
72
- /* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: T(s, "0,0") }),
73
- /* @__PURE__ */ e(C, { color: "secondary", variant: "Small", children: t.remaining })
71
+ /* @__PURE__ */ e(S, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
72
+ /* @__PURE__ */ u(x, { alignItems: "center", children: [
73
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(s, "0,0") }),
74
+ /* @__PURE__ */ e(S, { color: "secondary", variant: "Small", children: t.remaining })
74
75
  ] })
75
76
  ] });
76
- }), _t = E(
77
+ }), St = I(
77
78
  ({ category: t }) => {
78
- const { budgets: a } = w(), { budgets: i } = D(), s = l.useMemo(() => {
79
- const o = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"), n = o ? M(a.recalculate_previous_budget, T(o.amount, "0,0")) : a.recalculate_new_budget;
80
- return `${r} - ${n}`;
81
- }, [a, i]);
82
- return /* @__PURE__ */ m(l.Fragment, { children: [
83
- /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ m(te, { children: [
84
- /* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
85
- /* @__PURE__ */ e(oe, { primary: t.name, secondary: s })
79
+ const { budgets: n } = D(), { budgets: i } = E(), s = l.useMemo(() => {
80
+ const a = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"), o = a ? R(n.recalculate_previous_budget, T(a.amount, "0,0")) : n.recalculate_new_budget;
81
+ return `${r} - ${o}`;
82
+ }, [n, i]);
83
+ return /* @__PURE__ */ u(l.Fragment, { children: [
84
+ /* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { children: [
85
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
86
+ /* @__PURE__ */ e(ne, { primary: t.name, secondary: s })
86
87
  ] }) }),
87
- /* @__PURE__ */ e(de, {})
88
+ /* @__PURE__ */ e(ge, {})
88
89
  ] }, t.guid);
89
90
  }
90
- ), yt = ({ onRecalculateBudgets: t }) => {
91
- const { budgets: a, common: i } = w(), { spendCategories: s } = Z(), { recalculateBudgets: o, setAlert: r } = D(), [n, c] = l.useState(!1), u = s.filter((g) => g.totalAverageAmount > 0), d = async () => {
92
- await o(u), c(!1), r(a.alert_recalculated_budgets), t?.();
91
+ ), Bt = ({ onRecalculateBudgets: t }) => {
92
+ const { budgets: n, common: i } = D(), { spendCategories: s } = q(), { recalculateBudgets: a, setAlert: r } = E(), [o, c] = l.useState(!1), g = s.filter((m) => m.totalAverageAmount > 0), d = async () => {
93
+ await a(g), c(!1), r(n.alert_recalculated_budgets), t?.();
93
94
  };
94
- return /* @__PURE__ */ m(l.Fragment, { children: [
95
- /* @__PURE__ */ e(xe, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: a.recalculate_button }),
96
- /* @__PURE__ */ e(C, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: a.recalculate_help }),
95
+ return /* @__PURE__ */ u(l.Fragment, { children: [
96
+ /* @__PURE__ */ e(Te, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: n.recalculate_button }),
97
+ /* @__PURE__ */ e(S, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: n.recalculate_help }),
97
98
  /* @__PURE__ */ e(
98
- $,
99
+ k,
99
100
  {
100
101
  ariaLabelClose: i.close_aria,
101
- isOpen: n,
102
+ isOpen: o,
102
103
  onClose: () => c(!1),
103
104
  onPrimaryAction: d,
104
- title: a.recalculate_title,
105
- children: /* @__PURE__ */ m(S, { children: [
106
- /* @__PURE__ */ m(S, { mx: 24, my: 16, children: [
107
- /* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: a.recalculate_description_top }),
108
- /* @__PURE__ */ e(C, { variant: "ParagraphSmall", children: a.recalculate_description_bottom })
105
+ title: n.recalculate_title,
106
+ children: /* @__PURE__ */ u(x, { children: [
107
+ /* @__PURE__ */ u(x, { mx: 24, my: 16, children: [
108
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: n.recalculate_description_top }),
109
+ /* @__PURE__ */ e(S, { variant: "ParagraphSmall", children: n.recalculate_description_bottom })
109
110
  ] }),
110
- /* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(Y, { children: u.map((g) => /* @__PURE__ */ e(_t, { category: g }, g.guid)) }) })
111
+ /* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(Z, { children: g.map((m) => /* @__PURE__ */ e(St, { category: m }, m.guid)) }) })
111
112
  ] })
112
113
  }
113
114
  )
114
115
  ] });
115
- }, pe = ({
116
+ }, be = ({
116
117
  amount: t,
117
- categoryName: a,
118
+ categoryName: n,
118
119
  onAmountChanged: i
119
120
  }) => {
120
- const { budgets: s } = w(), { totalBudgeted: o } = D(), { incomeTotal: r } = ce(), n = r - o;
121
- return /* @__PURE__ */ m(S, { gap: 16, children: [
122
- /* @__PURE__ */ m(S, { children: [
123
- /* @__PURE__ */ e(C, { children: M(
121
+ const { budgets: s } = D(), { totalBudgeted: a } = E(), { incomeTotal: r } = ue(), o = r - a;
122
+ return /* @__PURE__ */ u(x, { gap: 16, children: [
123
+ /* @__PURE__ */ u(x, { children: [
124
+ /* @__PURE__ */ e(S, { children: R(
124
125
  s.add_description_top,
125
- T(n, "0,0")
126
+ T(o, "0,0")
126
127
  ) }),
127
- /* @__PURE__ */ e(C, { children: M(s.add_description_bottom, a) })
128
+ /* @__PURE__ */ e(S, { children: R(s.add_description_bottom, n) })
128
129
  ] }),
129
130
  /* @__PURE__ */ e(
130
- qe,
131
+ et,
131
132
  {
132
133
  amount: t,
133
134
  autoFocus: !0,
@@ -138,136 +139,136 @@ const bt = E(() => {
138
139
  }
139
140
  )
140
141
  ] });
141
- }, Ct = E(({ category: t, onAddBudget: a }) => {
142
- const { budgets: i, common: s } = w(), [o, r] = l.useState(!1), [n, c] = l.useState(
142
+ }, xt = I(({ category: t, onAddBudget: n }) => {
143
+ const { budgets: i, common: s } = D(), [a, r] = l.useState(!1), [o, c] = l.useState(
143
144
  `${t.totalAmount === 0 ? "" : t.totalAmount}`
144
145
  );
145
- return /* @__PURE__ */ m(l.Fragment, { children: [
146
- /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ m(te, { onClick: () => r(!0), children: [
147
- /* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
146
+ return /* @__PURE__ */ u(l.Fragment, { children: [
147
+ /* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { onClick: () => r(!0), children: [
148
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
148
149
  /* @__PURE__ */ e(
149
- oe,
150
+ ne,
150
151
  {
151
152
  primary: t.name,
152
153
  secondary: T(t.totalAmount, "0,0")
153
154
  }
154
155
  ),
155
- /* @__PURE__ */ e(Ze, { children: /* @__PURE__ */ e(j, { name: "add", size: 20 }) })
156
+ /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e(j, { name: "add", size: 20 }) })
156
157
  ] }) }, t.guid),
157
158
  /* @__PURE__ */ e(
158
159
  U,
159
160
  {
160
161
  copy: { close_aria: s.close_aria, title: i.add_title },
161
- disablePrimaryButton: Number(n) <= 0,
162
- isOpen: o,
162
+ disablePrimaryButton: Number(o) <= 0,
163
+ isOpen: a,
163
164
  onClose: () => r(!1),
164
- onPrimaryAction: () => a(t, Number(n)),
165
+ onPrimaryAction: () => n(t, Number(o)),
165
166
  primaryText: i.add_save_button,
166
- children: /* @__PURE__ */ e(pe, { amount: n, categoryName: t.name, onAmountChanged: c })
167
+ children: /* @__PURE__ */ e(be, { amount: o, categoryName: t.name, onAmountChanged: c })
167
168
  }
168
169
  )
169
170
  ] });
170
- }), ze = E(({ onAddBudget: t, onRecalculateBudgets: a }) => {
171
- const { budgets: i } = w(), { addBudget: s, setAlert: o, unbudgetedCategories: r } = D(), n = async (c, u) => {
172
- await s(c, u), t?.(), o(M(i.alert_budget_created, c.name));
171
+ }), Ve = I(({ onAddBudget: t, onRecalculateBudgets: n }) => {
172
+ const { budgets: i } = D(), { addBudget: s, setAlert: a, unbudgetedCategories: r } = E(), o = async (c, g) => {
173
+ await s(c, g), t?.(), a(R(i.alert_budget_created, c.name));
173
174
  };
174
- return /* @__PURE__ */ m(S, { children: [
175
- /* @__PURE__ */ e(bt, {}),
176
- /* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(Y, { children: r.map((c) => /* @__PURE__ */ e(
177
- Ct,
175
+ return /* @__PURE__ */ u(x, { children: [
176
+ /* @__PURE__ */ e(Ct, {}),
177
+ /* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(Z, { children: r.map((c) => /* @__PURE__ */ e(
178
+ xt,
178
179
  {
179
180
  category: c,
180
- onAddBudget: n
181
+ onAddBudget: o
181
182
  },
182
183
  c.guid
183
184
  )) }) }),
184
- /* @__PURE__ */ e(yt, { onRecalculateBudgets: a })
185
+ /* @__PURE__ */ e(Bt, { onRecalculateBudgets: n })
185
186
  ] });
186
- }), Oe = 5, Ue = 100, se = 25, Bt = (t) => {
187
- const a = (o) => {
188
- o.active || t.alphaTarget(0.3).restart(), o.subject.fx = o.subject.x, o.subject.fy = o.subject.y;
189
- }, i = (o) => {
190
- o.subject.fx = o.x, o.subject.fy = o.y;
191
- }, s = (o) => {
192
- o.active || t.alphaTarget(0), o.subject.fx = null, o.subject.fy = null;
187
+ }), Le = 5, Ke = 100, le = 25, At = (t) => {
188
+ const n = (a) => {
189
+ a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
190
+ }, i = (a) => {
191
+ a.subject.fx = a.x, a.subject.fy = a.y;
192
+ }, s = (a) => {
193
+ a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
193
194
  };
194
- return R.drag().on("start", a).on("drag", i).on("end", s);
195
- }, St = (t) => {
196
- let a = t.transaction_total / t.amount;
197
- a < 0 ? a = 0 : a > 1 && (a = 1);
198
- const i = a * 2 * Math.PI, s = R.interpolate(0, i), o = R.arc().cornerRadius(5).innerRadius(t.radius - Oe * 2).outerRadius(t.radius - Oe).startAngle(0).endAngle(0);
199
- return (r) => (o.endAngle(s(r)), o(t) || "");
200
- }, xt = (t) => {
201
- R.selectAll(".bubble").call(Bt(t));
202
- }, Me = (t, a, i) => Math.min(Math.max(t, a), i), At = (t, a, i) => {
195
+ return M.drag().on("start", n).on("drag", i).on("end", s);
196
+ }, vt = (t) => {
197
+ let n = t.transaction_total / t.amount;
198
+ n < 0 ? n = 0 : n > 1 && (n = 1);
199
+ const i = n * 2 * Math.PI, s = M.interpolate(0, i), a = M.arc().cornerRadius(5).innerRadius(t.radius - Le * 2).outerRadius(t.radius - Le).startAngle(0).endAngle(0);
200
+ return (r) => (a.endAngle(s(r)), a(t) || "");
201
+ }, Tt = (t) => {
202
+ M.selectAll(".bubble").call(At(t));
203
+ }, Ne = (t, n, i) => Math.min(Math.max(t, n), i), Dt = (t, n, i) => {
203
204
  t.alpha(1).restart().force(
204
205
  "x",
205
- R.forceX().x(i / 2).strength(0.01)
206
+ M.forceX().x(i / 2).strength(0.01)
206
207
  ).force(
207
208
  "y",
208
- R.forceY().y(a / 2).strength(0.02)
209
+ M.forceY().y(n / 2).strength(0.02)
209
210
  ).on("tick", () => {
210
211
  const s = t.nodes();
211
- s.forEach((o) => {
212
- const r = o.radius ?? se;
213
- o.x = Me(o.x ?? 0, r, i - r), o.y = Me(o.y ?? 0, r, a - r);
214
- }), R.selectAll(".bubble").data(s).attr("transform", (o) => `translate(${o.x},${o.y})`);
212
+ s.forEach((a) => {
213
+ const r = a.radius ?? le;
214
+ a.x = Ne(a.x ?? 0, r, i - r), a.y = Ne(a.y ?? 0, r, n - r);
215
+ }), M.selectAll(".bubble").data(s).attr("transform", (a) => `translate(${a.x},${a.y})`);
215
216
  });
216
- }, We = (t, a) => R.scaleLinear().domain([t, a]).range([se, Ue]), vt = (t) => {
217
- const a = t.reduce((r, n) => {
218
- const c = Math.max(n.transaction_total, n.amount);
217
+ }, Xe = (t, n) => M.scaleLinear().domain([t, n]).range([le, Ke]), Et = (t) => {
218
+ const n = t.reduce((r, o) => {
219
+ const c = Math.max(o.transaction_total, o.amount);
219
220
  return c > r ? c : r;
220
- }, 0), i = t.reduce((r, n) => {
221
- const c = Math.max(n.transaction_total, n.amount);
221
+ }, 0), i = t.reduce((r, o) => {
222
+ const c = Math.max(o.transaction_total, o.amount);
222
223
  return c < r ? c : r;
223
- }, a), s = We(i, a), o = t.map((r) => {
224
- const n = s(Math.max(r.transaction_total, r.amount)) || 25;
224
+ }, n), s = Xe(i, n), a = t.map((r) => {
225
+ const o = s(Math.max(r.transaction_total, r.amount)) || 25;
225
226
  return {
226
227
  ...r,
227
- radius: n
228
+ radius: o
228
229
  };
229
230
  });
230
- return R.forceSimulation(o).velocityDecay(0.05).force("collide", R.forceCollide((r) => r.radius + 2).strength(0.7));
231
- }, Tt = (t, a, i) => {
232
- const o = Math.PI * se ** 2 * t, r = i < 400 || a < 300, n = r ? 40 : 20, c = Math.max(100, i - n), u = Math.max(100, a - n), d = c * u;
233
- let g = se;
234
- if (o < d) {
235
- const h = Math.sqrt(d / (t * Math.PI)), _ = Math.min(c, u) / 4;
236
- g = Math.min(Ue, h, _);
231
+ return M.forceSimulation(a).velocityDecay(0.05).force("collide", M.forceCollide((r) => r.radius + 2).strength(0.7));
232
+ }, wt = (t, n, i) => {
233
+ const a = Math.PI * le ** 2 * t, r = i < 400 || n < 300, o = r ? 40 : 20, c = Math.max(100, i - o), g = Math.max(100, n - o), d = c * g;
234
+ let m = le;
235
+ if (a < d) {
236
+ const h = Math.sqrt(d / (t * Math.PI)), _ = Math.min(c, g) / 4;
237
+ m = Math.min(Ke, h, _);
237
238
  }
238
- return r && t <= 3 && (g = Math.min(g, 45)), { minRadius: Math.max(20, g * 0.6), maxRadius: g };
239
- }, wt = (t, a, i, s, o) => {
240
- const { maxRadius: r, minRadius: n } = Tt(t, a, o);
241
- return R.scaleLinear().domain([s, i]).range([n, r]);
242
- }, Dt = (t, a, i = !1, s, o) => {
243
- const r = a.map((d) => Math.max(d.transaction_total, d.amount)), n = Math.min(...r), c = Math.max(...r), u = i ? wt(t.length, s, c, n, o) : We(n, c);
239
+ return r && t <= 3 && (m = Math.min(m, 45)), { minRadius: Math.max(20, m * 0.6), maxRadius: m };
240
+ }, It = (t, n, i, s, a) => {
241
+ const { maxRadius: r, minRadius: o } = wt(t, n, a);
242
+ return M.scaleLinear().domain([s, i]).range([o, r]);
243
+ }, Ot = (t, n, i = !1, s, a) => {
244
+ const r = n.map((d) => Math.max(d.transaction_total, d.amount)), o = Math.min(...r), c = Math.max(...r), g = i ? It(t.length, s, c, o, a) : Xe(o, c);
244
245
  return t.map((d) => ({
245
246
  ...d,
246
- radius: u(Math.max(d.transaction_total, d.amount))
247
+ radius: g(Math.max(d.transaction_total, d.amount))
247
248
  }));
248
- }, Re = 5, It = 2e3, Et = ({ bubble: t }) => {
249
- const a = ie(), {
249
+ }, ke = 5, Rt = 2e3, Mt = ({ bubble: t }) => {
250
+ const n = de(), {
250
251
  amount: i,
251
252
  guid: s,
252
- budgetColors: { mercury: o },
253
+ budgetColors: { mercury: a },
253
254
  radius: r,
254
- transaction_total: n
255
+ transaction_total: o
255
256
  } = t, c = `mercury-${s}`;
256
257
  l.useEffect(() => {
257
- R.select(`.${c}`).selectAll(".status").remove(), R.select(`.${c}`).append("path").transition().duration(It).delay(0).attr("class", "status").attr("style", `fill: ${o}; fill-opacity: 1;`).attrTween("d", () => St(t));
258
- }, [i, r, n]);
259
- const u = R.arc().innerRadius((d) => d - 2 * Re).outerRadius((d) => d - Re).startAngle(0).endAngle(2 * Math.PI);
258
+ M.select(`.${c}`).selectAll(".status").remove(), M.select(`.${c}`).append("path").transition().duration(Rt).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => vt(t));
259
+ }, [i, r, o]);
260
+ const g = M.arc().innerRadius((d) => d - 2 * ke).outerRadius((d) => d - ke).startAngle(0).endAngle(2 * Math.PI);
260
261
  return /* @__PURE__ */ e("g", { className: c, children: /* @__PURE__ */ e(
261
262
  "path",
262
263
  {
263
- d: u(r) || "",
264
- style: { fill: a.palette.common.white, fillOpacity: 0.35 }
264
+ d: g(r) || "",
265
+ style: { fill: n.palette.common.white, fillOpacity: 0.35 }
265
266
  }
266
267
  ) });
267
- }, Ot = l.memo(Et), z = 75, ye = 50;
268
- function Mt({ bubble: t, isDraggable: a, onClick: i = () => {
268
+ }, Lt = l.memo(Mt), z = 75, Se = 50;
269
+ function Nt({ bubble: t, isDraggable: n, onClick: i = () => {
269
270
  } }) {
270
- const [s, o] = l.useState(!1), r = Ge(), { availableWidth: n } = le(), c = l.useMemo(() => {
271
+ const [s, a] = l.useState(!1), r = ze(), { availableWidth: o } = me(), c = l.useMemo(() => {
271
272
  if (t)
272
273
  return {
273
274
  amount: t.amount,
@@ -279,18 +280,18 @@ function Mt({ bubble: t, isDraggable: a, onClick: i = () => {
279
280
  }, [t.amount, t.budgetColors, t.guid, t.radius, t.transaction_total]);
280
281
  if (!t) return;
281
282
  const {
282
- budgetColors: { background: u, text: d },
283
- category: { icon: g, name: f },
283
+ budgetColors: { background: g, text: d },
284
+ category: { icon: m, name: p },
284
285
  guid: h,
285
286
  description: _,
286
- radius: p,
287
- x: y,
288
- y: b
289
- } = t, A = n < 400 ? -8 : -12;
290
- let B = A, v = A;
291
- p > z ? (B = -14, v = -45) : p > ye && (v = -32);
292
- let x = 32;
293
- p <= z && (x = n < 400 ? 16 : 24);
287
+ radius: f,
288
+ x: C,
289
+ y: v
290
+ } = t, A = o < 400 ? -8 : -12;
291
+ let b = A, y = A;
292
+ f > z ? (b = -14, y = -45) : f > Se && (y = -32);
293
+ let B = 32;
294
+ f <= z && (B = o < 400 ? 16 : 24);
294
295
  const O = `${t.category.name}: ${_}`, L = {
295
296
  modifiers: [
296
297
  {
@@ -298,31 +299,31 @@ function Mt({ bubble: t, isDraggable: a, onClick: i = () => {
298
299
  options: { offset: [0, 15] }
299
300
  }
300
301
  ]
301
- }, I = (N) => {
302
- (N.key === "Enter" || N.key === " ") && (N.preventDefault(), i(t));
303
- }, k = () => {
304
- o(!0);
305
- }, P = () => {
306
- o(!1);
302
+ }, w = (P) => {
303
+ (P.key === "Enter" || P.key === " ") && (P.preventDefault(), i(t));
304
+ }, N = () => {
305
+ a(!0);
306
+ }, $ = () => {
307
+ a(!1);
307
308
  };
308
- return /* @__PURE__ */ m(
309
+ return /* @__PURE__ */ u(
309
310
  "g",
310
311
  {
311
- "aria-label": `${f} - ${_}`,
312
+ "aria-label": `${p} - ${_}`,
312
313
  className: "bubble",
313
314
  id: `bubble-${h}`,
314
- onBlur: P,
315
+ onBlur: $,
315
316
  onClick: () => i(t),
316
- onFocus: k,
317
- onKeyDown: I,
318
- onMouseEnter: () => o(!0),
319
- onMouseLeave: () => o(!1),
317
+ onFocus: N,
318
+ onKeyDown: w,
319
+ onMouseEnter: () => a(!0),
320
+ onMouseLeave: () => a(!1),
320
321
  role: "button",
321
- style: { cursor: a ? "pointer" : "default" },
322
+ style: { cursor: n ? "pointer" : "default" },
322
323
  tabIndex: 0,
323
324
  textAnchor: "middle",
324
- x: y,
325
- y: b,
325
+ x: C,
326
+ y: v,
326
327
  children: [
327
328
  /* @__PURE__ */ e("style", { children: `
328
329
  .bubble:focus,
@@ -336,10 +337,10 @@ function Mt({ bubble: t, isDraggable: a, onClick: i = () => {
336
337
  stroke-opacity: 0.8;
337
338
  }
338
339
  ` }),
339
- /* @__PURE__ */ e(Qe, { open: s, slotProps: { popper: L }, title: O, children: /* @__PURE__ */ e("circle", { fill: u, id: `circle-${h}`, r: p }) }),
340
- /* @__PURE__ */ e("svg", { x: B, y: v, children: /* @__PURE__ */ e(j, { name: g, size: x, sx: { fill: d } }) }),
341
- p > z && /* @__PURE__ */ e(
342
- C,
340
+ /* @__PURE__ */ e(ot, { open: s, slotProps: { popper: L }, title: O, children: /* @__PURE__ */ e("circle", { fill: g, id: `circle-${h}`, r: f }) }),
341
+ /* @__PURE__ */ e("svg", { x: b, y, children: /* @__PURE__ */ e(j, { name: m, size: B, sx: { fill: d } }) }),
342
+ f > z && /* @__PURE__ */ e(
343
+ S,
343
344
  {
344
345
  bold: !0,
345
346
  component: "text",
@@ -347,23 +348,23 @@ function Mt({ bubble: t, isDraggable: a, onClick: i = () => {
347
348
  sx: { fill: d },
348
349
  variant: "Small",
349
350
  y: 4,
350
- children: f
351
+ children: p
351
352
  }
352
353
  ),
353
- p > ye && /* @__PURE__ */ e(
354
- C,
354
+ f > Se && /* @__PURE__ */ e(
355
+ S,
355
356
  {
356
357
  bold: !0,
357
358
  component: "text",
358
359
  id: `budget-description-${h}-1`,
359
360
  sx: { fill: d },
360
361
  variant: "Body",
361
- y: p <= z ? 12 : 24,
362
- children: p <= z ? _.split(" ")[0] : _
362
+ y: f <= z ? 12 : 24,
363
+ children: f <= z ? _.split(" ")[0] : _
363
364
  }
364
365
  ),
365
- p <= z && p > ye && /* @__PURE__ */ e(
366
- C,
366
+ f <= z && f > Se && /* @__PURE__ */ e(
367
+ S,
367
368
  {
368
369
  component: "text",
369
370
  id: `budget-description-${h}-2`,
@@ -373,69 +374,69 @@ function Mt({ bubble: t, isDraggable: a, onClick: i = () => {
373
374
  children: _.split(" ")[1]
374
375
  }
375
376
  ),
376
- /* @__PURE__ */ e(Ot, { bubble: c })
377
+ /* @__PURE__ */ e(Lt, { bubble: c })
377
378
  ]
378
379
  },
379
380
  h
380
381
  );
381
382
  }
382
- const Rt = ({
383
+ const kt = ({
383
384
  height: t,
384
- width: a,
385
+ width: n,
385
386
  isDraggable: i = !1,
386
387
  onClick: s = () => {
387
388
  }
388
389
  }) => {
389
- const [o, r] = l.useState([]), n = l.useRef(null), c = l.useRef(!1), { detailedBudgets: u } = D(), d = l.useCallback(() => {
390
- const g = n.current, f = vt(u), h = f.nodes();
391
- if (g) {
392
- const _ = g.nodes(), p = new Map(_.map((y) => [y.guid, y]));
393
- h.forEach((y) => {
394
- const b = p.get(y.guid);
395
- b && Object.assign(y, {
396
- vx: b.vx,
397
- vy: b.vy,
398
- x: b.x,
399
- y: b.y
390
+ const [a, r] = l.useState([]), o = l.useRef(null), c = l.useRef(!1), { detailedBudgets: g } = E(), d = l.useCallback(() => {
391
+ const m = o.current, p = Et(g), h = p.nodes();
392
+ if (m) {
393
+ const _ = m.nodes(), f = new Map(_.map((C) => [C.guid, C]));
394
+ h.forEach((C) => {
395
+ const v = f.get(C.guid);
396
+ v && Object.assign(C, {
397
+ vx: v.vx,
398
+ vy: v.vy,
399
+ x: v.x,
400
+ y: v.y
400
401
  });
401
402
  });
402
403
  }
403
- n.current = f, c.current = !1, r(h);
404
- }, [u]);
404
+ o.current = p, c.current = !1, r(h);
405
+ }, [g]);
405
406
  return l.useEffect(() => {
406
407
  d();
407
408
  }, [d]), l.useEffect(() => () => {
408
- n.current && (n.current.stop(), n.current = null);
409
+ o.current && (o.current.stop(), o.current = null);
409
410
  }, []), l.useEffect(() => {
410
- const g = n.current;
411
- if (!g) return;
412
- const f = g.nodes(), h = a > 0 && a < 450 || t > 0 && t < 300, _ = Dt(f, u, h, t, a);
413
- g.nodes(_), At(g, t, a), i && setTimeout(() => {
414
- xt(g);
411
+ const m = o.current;
412
+ if (!m) return;
413
+ const p = m.nodes(), h = n > 0 && n < 450 || t > 0 && t < 300, _ = Ot(p, g, h, t, n);
414
+ m.nodes(_), Dt(m, t, n), i && setTimeout(() => {
415
+ Tt(m);
415
416
  }, 0), r([..._]);
416
- }, [t, a, i, u]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(a), children: o.map((g) => /* @__PURE__ */ e(Mt, { bubble: g, isDraggable: i, onClick: s }, g.guid)) });
417
- }, Lt = E(Rt), kt = ({
417
+ }, [t, n, i, g]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(n), children: a.map((m) => /* @__PURE__ */ e(Nt, { bubble: m, isDraggable: i, onClick: s }, m.guid)) });
418
+ }, $t = I(kt), Pt = ({
418
419
  isMiniWidget: t = !1,
419
- onConnectAccountsClick: a,
420
+ onConnectAccountsClick: n,
420
421
  createBudgetOnClick: i
421
422
  }) => {
422
- const { config: s } = $e(), { recalculateBudgets: o } = D(), { spendCategories: r } = Z(), { budgets: n } = w(), { availableWidth: c } = le(), { isMobile: u } = me(c), d = t && u, [g, f] = l.useState(!1), [h, _] = l.useState(!1), [p, y] = l.useState(!1), b = l.useMemo(() => [...r.filter((B) => B.totalAverageAmount > 0)], [r]), A = async () => {
423
- y(!0);
424
- const { data: B, isSuccess: v } = await o(b);
425
- y(!1), v ? (B.length === 0 && _(!0), f(!1)) : f(!0);
423
+ const { config: s } = je(), { recalculateBudgets: a } = E(), { spendCategories: r } = q(), { budgets: o } = D(), { availableWidth: c } = me(), { isMobile: g } = he(c), d = t && g, [m, p] = l.useState(!1), [h, _] = l.useState(!1), [f, C] = l.useState(!1), v = l.useMemo(() => [...r.filter((b) => b.totalAverageAmount > 0)], [r]), A = async () => {
424
+ C(!0);
425
+ const { data: b, isSuccess: y } = await a(v);
426
+ C(!1), y ? (b.length === 0 && _(!0), p(!1)) : p(!0);
426
427
  };
427
- return p ? /* @__PURE__ */ e(ge, {}) : g ? /* @__PURE__ */ e(
428
- _e,
428
+ return f ? /* @__PURE__ */ e(fe, {}) : m ? /* @__PURE__ */ e(
429
+ Ce,
429
430
  {
430
- header: n.autogenerate_budgets_error_header,
431
+ header: o.autogenerate_budgets_error_header,
431
432
  icon: "error",
432
433
  iconColor: "#4D4D4D",
433
- onClick: (B) => {
434
- B === "primary" ? A() : i();
434
+ onClick: (b) => {
435
+ b === "primary" ? A() : i();
435
436
  },
436
- primaryButton: n.autogenerate_budgets_error_primary_button,
437
- secondaryButton: n.zero_state_generate_budgets_secondary_button,
438
- subText: n.autogenerate_budgets_error_subheader,
437
+ primaryButton: o.autogenerate_budgets_error_primary_button,
438
+ secondaryButton: o.zero_state_generate_budgets_secondary_button,
439
+ subText: o.autogenerate_budgets_error_subheader,
439
440
  sx: {
440
441
  width: { sm: 468 },
441
442
  ".buttons-footer": {
@@ -445,18 +446,18 @@ const Rt = ({
445
446
  ...d && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
446
447
  }
447
448
  }
448
- ) : /* @__PURE__ */ e(Ve, { children: h ? /* @__PURE__ */ e(
449
- _e,
449
+ ) : /* @__PURE__ */ e(qe, { children: h ? /* @__PURE__ */ e(
450
+ Ce,
450
451
  {
451
- header: n.zero_state_generate_budgets_header,
452
+ header: o.zero_state_generate_budgets_header,
452
453
  icon: "error",
453
454
  iconColor: "#4D4D4D",
454
- onClick: (B) => {
455
- B === "primary" ? a() : i();
455
+ onClick: (b) => {
456
+ b === "primary" ? n() : i();
456
457
  },
457
- primaryButton: s.show_connections_widget_in_master ? n.zero_state_generate_budgets_primary_button : void 0,
458
- secondaryButton: n.zero_state_generate_budgets_secondary_button,
459
- subText: n.zero_state_generate_budgets_subheader,
458
+ primaryButton: s.show_connections_widget_in_master ? o.zero_state_generate_budgets_primary_button : void 0,
459
+ secondaryButton: o.zero_state_generate_budgets_secondary_button,
460
+ subText: o.zero_state_generate_budgets_subheader,
460
461
  sx: {
461
462
  width: t ? "100%" : { sm: 500 },
462
463
  height: t ? "100%" : { sm: 468 },
@@ -471,17 +472,17 @@ const Rt = ({
471
472
  }
472
473
  }
473
474
  ) : /* @__PURE__ */ e(
474
- _e,
475
+ Ce,
475
476
  {
476
- header: n.create_budgets_title,
477
+ header: o.create_budgets_title,
477
478
  icon: "bubble_chart",
478
479
  iconColor: "#1A1A1A",
479
- onClick: (B) => {
480
- B === "primary" ? A() : i();
480
+ onClick: (b) => {
481
+ b === "primary" ? A() : i();
481
482
  },
482
- primaryButton: n.empty_state_primary_button,
483
- secondaryButton: t ? void 0 : n.empty_state_secondary_button,
484
- subText: n.empty_state_subheader,
483
+ primaryButton: o.empty_state_primary_button,
484
+ secondaryButton: t ? void 0 : o.empty_state_secondary_button,
485
+ subText: o.empty_state_subheader,
485
486
  sx: {
486
487
  width: t ? "100%" : { sm: 432 },
487
488
  height: t ? "100%" : { sm: 468 },
@@ -496,48 +497,48 @@ const Rt = ({
496
497
  }
497
498
  }
498
499
  ) });
499
- }, He = E(
500
+ }, Ye = I(
500
501
  ({
501
502
  createBudgetOnClick: t = () => {
502
503
  },
503
- height: a,
504
+ height: n,
504
505
  isDraggable: i = !1,
505
506
  isMiniWidget: s = !1,
506
- shouldShowZeroState: o,
507
+ shouldShowZeroState: a,
507
508
  unavailableWidth: r = 24
508
509
  }) => {
509
- const { onEvent: n } = q(), { setSelectedBudget: c } = D(), { isInitialized: u } = J(), { accounts: d } = w(), { availableWidth: g } = le(), { isMobile: f } = me(), [h, _] = l.useState(!1), p = l.useMemo(() => g - r, [g]), y = (A) => {
510
- c(A), n(G.BUDGETS_CLICK_BUDGET_CATEGORY, {
510
+ const { onEvent: o } = J(), { setSelectedBudget: c } = E(), { isInitialized: g } = Q(), { accounts: d } = D(), { availableWidth: m } = me(), { isMobile: p } = he(), [h, _] = l.useState(!1), f = l.useMemo(() => m - r, [m]), C = (A) => {
511
+ c(A), o(G.BUDGETS_CLICK_BUDGET_CATEGORY, {
511
512
  budget_category: A.category.name,
512
513
  click_type: "bubble"
513
514
  });
514
- }, b = () => {
515
- _(!0), n(G.ACCOUNTS_CLICK_CONNECT);
515
+ }, v = () => {
516
+ _(!0), o(G.ACCOUNTS_CLICK_CONNECT);
516
517
  };
517
- return /* @__PURE__ */ m(
518
+ return /* @__PURE__ */ u(
518
519
  W,
519
520
  {
520
- ml: o || f ? 0 : 24,
521
+ ml: a || p ? 0 : 24,
521
522
  sx: { alignSelf: "center", ...s && { height: "100%" } },
522
523
  children: [
523
- o || !u ? /* @__PURE__ */ e(
524
- kt,
524
+ a || !g ? /* @__PURE__ */ e(
525
+ Pt,
525
526
  {
526
527
  createBudgetOnClick: t,
527
528
  isMiniWidget: s,
528
- onConnectAccountsClick: b
529
+ onConnectAccountsClick: v
529
530
  }
530
531
  ) : /* @__PURE__ */ e(
531
- Lt,
532
+ $t,
532
533
  {
533
- height: a,
534
+ height: n,
534
535
  isDraggable: i,
535
- onClick: y,
536
- width: p
536
+ onClick: C,
537
+ width: f
537
538
  }
538
539
  ),
539
540
  /* @__PURE__ */ e(
540
- Je,
541
+ tt,
541
542
  {
542
543
  onClose: () => _(!1),
543
544
  showConnectionsWidget: h,
@@ -548,99 +549,99 @@ const Rt = ({
548
549
  }
549
550
  );
550
551
  }
551
- ), Ke = ({ budget: t }) => {
552
+ ), Ze = ({ budget: t }) => {
552
553
  const {
553
- amount: a,
554
+ amount: n,
554
555
  budgetColors: { background: i },
555
556
  category: { name: s },
556
- category_guid: o,
557
+ category_guid: a,
557
558
  percentage: r,
558
- transaction_total: n
559
+ transaction_total: o
559
560
  } = t, c = [
560
561
  {
561
562
  color: i,
562
563
  percentage: `${r}%`
563
564
  }
564
565
  ];
565
- return /* @__PURE__ */ e(ve, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ m(S, { alignItems: "center", gap: 16, children: [
566
- /* @__PURE__ */ e(H, { categoryGuid: o, size: 56 }),
567
- /* @__PURE__ */ e(Ye, { variant: "H1", children: `${T(n, "0,0")} / ${T(a, "0,0")}` }),
568
- /* @__PURE__ */ e(C, { bold: !0, variant: "XSmall", children: s }),
569
- /* @__PURE__ */ e(Be, { data: c, height: 10 })
566
+ return /* @__PURE__ */ e(Ee, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(we, { children: /* @__PURE__ */ u(x, { alignItems: "center", gap: 16, children: [
567
+ /* @__PURE__ */ e(H, { categoryGuid: a, size: 56 }),
568
+ /* @__PURE__ */ e(Pe, { variant: "H1", children: `${T(o, "0,0")} / ${T(n, "0,0")}` }),
569
+ /* @__PURE__ */ e(S, { bold: !0, variant: "XSmall", children: s }),
570
+ /* @__PURE__ */ e(xe, { data: c, height: 10 })
570
571
  ] }) }) });
571
- }, Nt = E(() => {
572
- const { budgets: t } = w();
573
- return /* @__PURE__ */ m(S, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
572
+ }, Gt = I(() => {
573
+ const { budgets: t } = D();
574
+ return /* @__PURE__ */ u(x, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
574
575
  /* @__PURE__ */ e(j, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
575
- /* @__PURE__ */ e(C, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
576
- /* @__PURE__ */ e(C, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
576
+ /* @__PURE__ */ e(S, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
577
+ /* @__PURE__ */ e(S, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
577
578
  ] });
578
- }), $t = E(({ budget: t }) => {
579
+ }), jt = I(({ budget: t }) => {
579
580
  const {
580
- amount: a,
581
+ amount: n,
581
582
  budgetColors: { background: i },
582
583
  category: s,
583
- percentage: o,
584
+ percentage: a,
584
585
  transaction_total: r
585
- } = t, { setSelectedSubBudget: n } = D();
586
- return /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ m(te, { onClick: () => n(t), children: [
587
- /* @__PURE__ */ e(ue, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(je, { color: i, percent: o, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
586
+ } = t, { setSelectedSubBudget: o } = E();
587
+ return /* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { onClick: () => o(t), children: [
588
+ /* @__PURE__ */ e(pe, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Ue, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
588
589
  /* @__PURE__ */ e(
589
- oe,
590
+ ne,
590
591
  {
591
- primary: /* @__PURE__ */ e(S, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: t.category.name }) }),
592
- secondary: /* @__PURE__ */ e(S, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(C, { fontWeight: 400, variant: "Body", children: `
592
+ primary: /* @__PURE__ */ e(x, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.category.name }) }),
593
+ secondary: /* @__PURE__ */ e(x, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(S, { fontWeight: 400, variant: "Body", children: `
593
594
  ${T(r, "0,0")} /
594
- ${T(a, "0,0")}
595
+ ${T(n, "0,0")}
595
596
  ` }) })
596
597
  }
597
598
  )
598
599
  ] }) });
599
- }), Pt = E(({ category: t, parentBudget: a }) => {
600
- const { budgets: i, common: s } = w(), { setExpandedGuid: o, setOnSelect: r } = at(), { addBudget: n } = D(), [c, u] = l.useState(!1), [d, g] = l.useState(!1), [f, h] = l.useState(""), [_, p] = l.useState(void 0);
600
+ }), Ft = I(({ category: t, parentBudget: n }) => {
601
+ const { budgets: i, common: s } = D(), { setExpandedGuid: a, setOnSelect: r } = it(), { addBudget: o } = E(), [c, g] = l.useState(!1), [d, m] = l.useState(!1), [p, h] = l.useState(""), [_, f] = l.useState(void 0);
601
602
  l.useEffect(() => {
602
603
  r((A) => {
603
- const B = t.subCategories.find((v) => v.guid === A);
604
- B && (p(B), h(`${B.currentAmount === 0 ? "" : B.currentAmount}`), g(!0));
604
+ const b = t.subCategories.find((y) => y.guid === A);
605
+ b && (f(b), h(`${b.currentAmount === 0 ? "" : b.currentAmount}`), m(!0));
605
606
  });
606
607
  }, []);
607
- const y = () => {
608
- o(t.guid), u(!0);
609
- }, b = async () => {
610
- _ && Number(f) > 0 && (await n(_, Number(f), a.guid), g(!1), u(!1), p(void 0));
608
+ const C = () => {
609
+ a(t.guid), g(!0);
610
+ }, v = async () => {
611
+ _ && Number(p) > 0 && (await o(_, Number(p), n.guid), m(!1), g(!1), f(void 0));
611
612
  };
612
- return /* @__PURE__ */ m(W, { children: [
613
- /* @__PURE__ */ e(ee, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(te, { onClick: y, children: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ m(S, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
614
- /* @__PURE__ */ m(S, { alignItems: "center", direction: "row", gap: 8, children: [
613
+ return /* @__PURE__ */ u(W, { children: [
614
+ /* @__PURE__ */ e(te, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(oe, { onClick: C, children: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ u(x, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
615
+ /* @__PURE__ */ u(x, { alignItems: "center", direction: "row", gap: 8, children: [
615
616
  /* @__PURE__ */ e(j, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
616
- /* @__PURE__ */ e(C, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
617
+ /* @__PURE__ */ e(S, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
617
618
  ] }),
618
619
  /* @__PURE__ */ e(j, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
619
620
  ] }) }) }) }),
620
- /* @__PURE__ */ e(de, {}),
621
+ /* @__PURE__ */ e(ge, {}),
621
622
  /* @__PURE__ */ e(
622
- $,
623
+ k,
623
624
  {
624
625
  ariaLabelClose: s.close_aria,
625
626
  isOpen: c,
626
- onClose: () => u(!1),
627
+ onClose: () => g(!1),
627
628
  title: i.add_sub_budget_title,
628
- children: /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(rt, { category: t, subCategories: t.subCategories }) })
629
+ children: /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(ct, { category: t, subCategories: t.subCategories }) })
629
630
  }
630
631
  ),
631
632
  /* @__PURE__ */ e(
632
633
  U,
633
634
  {
634
635
  copy: { close_aria: s.close_aria, title: i.add_title },
635
- disablePrimaryButton: Number(f) <= 0,
636
+ disablePrimaryButton: Number(p) <= 0,
636
637
  isOpen: d,
637
- onClose: () => g(!1),
638
- onPrimaryAction: b,
638
+ onClose: () => m(!1),
639
+ onPrimaryAction: v,
639
640
  primaryText: i.add_save_button,
640
641
  children: /* @__PURE__ */ e(
641
- pe,
642
+ be,
642
643
  {
643
- amount: f,
644
+ amount: p,
644
645
  categoryName: _?.name || "",
645
646
  onAmountChanged: h
646
647
  }
@@ -648,68 +649,68 @@ const Rt = ({
648
649
  }
649
650
  )
650
651
  ] });
651
- }), Gt = E(({ budget: t }) => {
652
- const { category: a, subBudgets: i } = t, { budgets: s, common: o } = w(), { deleteBudget: r, selectedSubBudget: n, setSelectedSubBudget: c, updateBudget: u } = D(), { filter: d, setFilter: g } = Q(), [f, h] = l.useState(!1), [_, p] = l.useState(!1), [y, b] = l.useState("");
652
+ }), zt = I(({ budget: t }) => {
653
+ const { category: n, subBudgets: i } = t, { budgets: s, common: a } = D(), { deleteBudget: r, selectedSubBudget: o, setSelectedSubBudget: c, updateBudget: g } = E(), { filter: d, setFilter: m } = ee(), [p, h] = l.useState(!1), [_, f] = l.useState(!1), [C, v] = l.useState("");
653
654
  l.useEffect(() => {
654
- n && (b(`${n.amount}`), g({
655
+ o && (v(`${o.amount}`), m({
655
656
  ...d,
656
- custom: (x) => x.category_guid === n.category_guid
657
+ custom: (B) => B.category_guid === o.category_guid
657
658
  }));
658
- }, [n]);
659
+ }, [o]);
659
660
  const A = async () => {
660
- n && await u({
661
- ...n,
662
- amount: Number(y)
661
+ o && await g({
662
+ ...o,
663
+ amount: Number(C)
663
664
  });
664
- }, B = async () => {
665
- n && await r(n.guid), p(!1), v();
666
- }, v = () => {
667
- g({
665
+ }, b = async () => {
666
+ o && await r(o.guid), f(!1), y();
667
+ }, y = () => {
668
+ m({
668
669
  ...d,
669
- custom: (x) => x.category_guid === t.category_guid || x.top_level_category_guid === t.category_guid
670
+ custom: (B) => B.category_guid === t.category_guid || B.top_level_category_guid === t.category_guid
670
671
  }), c(void 0);
671
672
  };
672
- return /* @__PURE__ */ m(l.Fragment, { children: [
673
- /* @__PURE__ */ m(Y, { sx: { bgcolor: "background.paper" }, children: [
674
- i.length === 0 ? /* @__PURE__ */ e(Nt, {}) : i.map((x) => /* @__PURE__ */ m(l.Fragment, { children: [
675
- /* @__PURE__ */ e($t, { budget: x }),
676
- /* @__PURE__ */ e(de, {})
677
- ] }, x.guid)),
678
- /* @__PURE__ */ e(Pt, { category: a, parentBudget: t })
673
+ return /* @__PURE__ */ u(l.Fragment, { children: [
674
+ /* @__PURE__ */ u(Z, { sx: { bgcolor: "background.paper" }, children: [
675
+ i.length === 0 ? /* @__PURE__ */ e(Gt, {}) : i.map((B) => /* @__PURE__ */ u(l.Fragment, { children: [
676
+ /* @__PURE__ */ e(jt, { budget: B }),
677
+ /* @__PURE__ */ e(ge, {})
678
+ ] }, B.guid)),
679
+ /* @__PURE__ */ e(Ft, { category: n, parentBudget: t })
679
680
  ] }),
680
681
  /* @__PURE__ */ e(
681
- $,
682
+ k,
682
683
  {
683
- ariaLabelClose: o.close_aria,
684
- isOpen: !!n,
685
- onClose: v,
684
+ ariaLabelClose: a.close_aria,
685
+ isOpen: !!o,
686
+ onClose: y,
686
687
  onPrimaryAction: () => h(!0),
687
- onSecondaryAction: () => p(!0),
688
+ onSecondaryAction: () => f(!0),
688
689
  primaryText: s.details_edit_button,
689
690
  secondaryText: s.details_delete_button,
690
691
  title: s.details_title,
691
- children: n && /* @__PURE__ */ m(S, { gap: 24, children: [
692
- /* @__PURE__ */ e(Ke, { budget: n }),
693
- /* @__PURE__ */ e(Ae, { height: "100%" })
692
+ children: o && /* @__PURE__ */ u(x, { gap: 24, children: [
693
+ /* @__PURE__ */ e(Ze, { budget: o }),
694
+ /* @__PURE__ */ e(De, { height: "100%" })
694
695
  ] })
695
696
  }
696
697
  ),
697
- n && /* @__PURE__ */ m(l.Fragment, { children: [
698
+ o && /* @__PURE__ */ u(l.Fragment, { children: [
698
699
  /* @__PURE__ */ e(
699
700
  U,
700
701
  {
701
- copy: { close_aria: o.close_aria, title: s.details_edit_title },
702
- disablePrimaryButton: Number(y) <= 0,
703
- isOpen: f,
702
+ copy: { close_aria: a.close_aria, title: s.details_edit_title },
703
+ disablePrimaryButton: Number(C) <= 0,
704
+ isOpen: p,
704
705
  onClose: () => h(!1),
705
706
  onPrimaryAction: A,
706
707
  primaryText: s.edit_save_button,
707
708
  children: /* @__PURE__ */ e(
708
- pe,
709
+ be,
709
710
  {
710
- amount: y,
711
- categoryName: n.category.name,
712
- onAmountChanged: b
711
+ amount: C,
712
+ categoryName: o.category.name,
713
+ onAmountChanged: v
713
714
  }
714
715
  )
715
716
  }
@@ -717,36 +718,36 @@ const Rt = ({
717
718
  /* @__PURE__ */ e(
718
719
  U,
719
720
  {
720
- copy: { close_aria: o.close_aria, title: s.delete_title },
721
+ copy: { close_aria: a.close_aria, title: s.delete_title },
721
722
  isOpen: _,
722
- onClose: () => p(!1),
723
- onPrimaryAction: B,
723
+ onClose: () => f(!1),
724
+ onPrimaryAction: b,
724
725
  primaryColor: "error",
725
726
  primaryText: "Delete",
726
727
  secondaryColor: "secondary",
727
- children: /* @__PURE__ */ e(C, { variant: "Paragraph", children: M(s.delete_description, n.category.name) })
728
+ children: /* @__PURE__ */ e(S, { variant: "Paragraph", children: R(s.delete_description, o.category.name) })
728
729
  }
729
730
  )
730
731
  ] })
731
732
  ] });
732
- }), jt = E(({ budget: t }) => {
733
- const { is_mobile_webview: a } = $e(), { setAlert: i } = D(), { budgets: s, common: o, transactions: r } = w(), { isDesktop: n, isSmallTablet: c, isTablet: u } = me(), {
733
+ }), Ut = I(({ budget: t }) => {
734
+ const { is_mobile_webview: n } = je(), { setAlert: i } = E(), { budgets: s, common: a, transactions: r } = D(), { isDesktop: o, isSmallTablet: c, isTablet: g } = he(), {
734
735
  sortedTransactions: d,
735
- sortedTransactionsWithSplits: g,
736
- tags: f
737
- } = Q(), [h, _] = l.useState(0), [p, y] = l.useState(""), b = l.useMemo(
738
- () => d.find((x) => x.guid === p),
739
- [p, d]
740
- ), A = (x, O) => {
736
+ sortedTransactionsWithSplits: m,
737
+ tags: p
738
+ } = ee(), [h, _] = l.useState(0), [f, C] = l.useState(""), v = l.useMemo(
739
+ () => d.find((B) => B.guid === f),
740
+ [f, d]
741
+ ), A = (B, O) => {
741
742
  _(O);
742
- }, B = () => {
743
- ot(g, f), i(s.alert_csv_downloaded);
744
- }, v = d.length > 0 && !a && (n || u && !c);
745
- return /* @__PURE__ */ m(S, { gap: 24, children: [
746
- /* @__PURE__ */ e(Ke, { budget: t }),
747
- /* @__PURE__ */ m(S, { children: [
748
- /* @__PURE__ */ m(
749
- tt,
743
+ }, b = () => {
744
+ rt(m, p), i(s.alert_csv_downloaded);
745
+ }, y = d.length > 0 && !n && (o || g && !c);
746
+ return /* @__PURE__ */ u(x, { gap: 24, children: [
747
+ /* @__PURE__ */ e(Ze, { budget: t }),
748
+ /* @__PURE__ */ u(x, { children: [
749
+ /* @__PURE__ */ u(
750
+ at,
750
751
  {
751
752
  onChange: A,
752
753
  sx: { width: "100%" },
@@ -754,94 +755,94 @@ const Rt = ({
754
755
  value: h,
755
756
  variant: "fullWidth",
756
757
  children: [
757
- /* @__PURE__ */ e(Ie, { label: s.details_transactions_tab }),
758
- /* @__PURE__ */ e(Ie, { label: s.details_subbudgets_tab })
758
+ /* @__PURE__ */ e(Re, { label: s.details_transactions_tab }),
759
+ /* @__PURE__ */ e(Re, { label: s.details_subbudgets_tab })
759
760
  ]
760
761
  }
761
762
  ),
762
- h === 0 && /* @__PURE__ */ m(S, { children: [
763
- v && /* @__PURE__ */ e(S, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
764
- xe,
763
+ h === 0 && /* @__PURE__ */ u(x, { children: [
764
+ y && /* @__PURE__ */ e(x, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
765
+ Te,
765
766
  {
766
- onClick: B,
767
+ onClick: b,
767
768
  startIcon: /* @__PURE__ */ e(j, { name: "ios_share" }),
768
769
  variant: "text",
769
770
  children: r.export_csv_btn
770
771
  }
771
772
  ) }),
772
- /* @__PURE__ */ e(Ae, { height: "100%", onClick: y })
773
+ /* @__PURE__ */ e(De, { height: "100%", onClick: C })
773
774
  ] }),
774
- h === 1 && /* @__PURE__ */ e(Gt, { budget: t }),
775
+ h === 1 && /* @__PURE__ */ e(zt, { budget: t }),
775
776
  /* @__PURE__ */ e(
776
- $,
777
+ k,
777
778
  {
778
- ariaLabelClose: o.close_aria,
779
- isOpen: !!b,
780
- onClose: () => y(""),
779
+ ariaLabelClose: a.close_aria,
780
+ isOpen: !!v,
781
+ onClose: () => C(""),
781
782
  title: s.details_transaction_drawer,
782
- children: b && /* @__PURE__ */ e(nt, { transaction: b })
783
+ children: v && /* @__PURE__ */ e(st, { transaction: v })
783
784
  }
784
785
  )
785
786
  ] })
786
787
  ] });
787
- }), Ft = E(() => {
788
- const { selectedAccountGuids: t } = J(), { budgets: a, common: i } = w(), {
788
+ }), Wt = I(() => {
789
+ const { selectedAccountGuids: t } = Q(), { budgets: n, common: i } = D(), {
789
790
  alert: s,
790
- dateRange: o,
791
+ dateRange: a,
791
792
  deleteBudget: r,
792
- selectedBudget: n,
793
+ selectedBudget: o,
793
794
  selectedSubBudget: c,
794
- setAlert: u,
795
+ setAlert: g,
795
796
  setSelectedBudget: d,
796
- updateBudget: g
797
- } = D(), { setFilter: f } = Q(), [h, _] = l.useState(!1), [p, y] = l.useState(!1), [b, A] = l.useState(!1), [B, v] = l.useState("");
797
+ updateBudget: m
798
+ } = E(), { setFilter: p } = ee(), [h, _] = l.useState(!1), [f, C] = l.useState(!1), [v, A] = l.useState(!1), [b, y] = l.useState("");
798
799
  l.useEffect(() => {
799
- n && !c && (v(`${n.amount}`), _(!0), f({
800
+ o && !c && (y(`${o.amount}`), _(!0), p({
800
801
  accounts: t,
801
- dateRange: o,
802
- custom: (k) => k.category_guid === n.category_guid || k.top_level_category_guid === n.category_guid,
802
+ dateRange: a,
803
+ custom: (N) => N.category_guid === o.category_guid || N.top_level_category_guid === o.category_guid,
803
804
  showSplits: !0
804
805
  }));
805
- }, [n]);
806
- const x = async () => {
807
- n && (await g({
808
- ...n,
809
- amount: Number(B),
810
- percentage: n.category.totalAmount / Number(B) * 100
811
- }), y(!1), u(M(a.alert_budget_updated, n.category.name)));
806
+ }, [o]);
807
+ const B = async () => {
808
+ o && (await m({
809
+ ...o,
810
+ amount: Number(b),
811
+ percentage: o.category.totalAmount / Number(b) * 100
812
+ }), C(!1), g(R(n.alert_budget_updated, o.category.name)));
812
813
  }, O = async () => {
813
- n && (await r(n.guid), u(M(a.alert_budget_deleted, n.category.name))), L();
814
+ o && (await r(o.guid), g(R(n.alert_budget_deleted, o.category.name))), L();
814
815
  }, L = () => {
815
816
  _(!1), setTimeout(() => {
816
817
  d(void 0);
817
818
  }, 250);
818
- }, I = () => {
819
- y(!1), v(`${n?.amount}`);
819
+ }, w = () => {
820
+ C(!1), y(`${o?.amount}`);
820
821
  };
821
- if (n)
822
- return /* @__PURE__ */ m(l.Fragment, { children: [
823
- /* @__PURE__ */ m(
824
- $,
822
+ if (o)
823
+ return /* @__PURE__ */ u(l.Fragment, { children: [
824
+ /* @__PURE__ */ u(
825
+ k,
825
826
  {
826
827
  ariaLabelClose: i.close_aria,
827
828
  isOpen: h,
828
829
  onClose: L,
829
- onPrimaryAction: () => y(!0),
830
+ onPrimaryAction: () => C(!0),
830
831
  onSecondaryAction: () => A(!0),
831
- primaryText: a.details_edit_button,
832
+ primaryText: n.details_edit_button,
832
833
  secondaryColor: "error",
833
- secondaryText: a.details_delete_button,
834
- title: a.details_title,
834
+ secondaryText: n.details_delete_button,
835
+ title: n.details_title,
835
836
  children: [
836
- /* @__PURE__ */ e(jt, { budget: n }),
837
+ /* @__PURE__ */ e(Ut, { budget: o }),
837
838
  /* @__PURE__ */ e(
838
- Ne,
839
+ ve,
839
840
  {
840
841
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
841
842
  autoHideDuration: 3500,
842
- onClose: () => u(""),
843
+ onClose: () => g(""),
843
844
  open: !!s,
844
- children: /* @__PURE__ */ e(ke, { closeText: "", onClose: () => u(""), severity: "success", variant: "filled", children: s })
845
+ children: /* @__PURE__ */ e(Ae, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children: s })
845
846
  }
846
847
  )
847
848
  ]
@@ -850,19 +851,19 @@ const Rt = ({
850
851
  /* @__PURE__ */ e(
851
852
  U,
852
853
  {
853
- copy: { close_aria: i.close_aria, title: a.details_edit_title },
854
- disablePrimaryButton: Number(B) <= 0,
855
- isOpen: p,
856
- onClose: I,
857
- onPrimaryAction: x,
858
- onSecondaryAction: I,
859
- primaryText: a.edit_save_button,
854
+ copy: { close_aria: i.close_aria, title: n.details_edit_title },
855
+ disablePrimaryButton: Number(b) <= 0,
856
+ isOpen: f,
857
+ onClose: w,
858
+ onPrimaryAction: B,
859
+ onSecondaryAction: w,
860
+ primaryText: n.edit_save_button,
860
861
  children: /* @__PURE__ */ e(
861
- pe,
862
+ be,
862
863
  {
863
- amount: B,
864
- categoryName: n.category.name,
865
- onAmountChanged: v
864
+ amount: b,
865
+ categoryName: o.category.name,
866
+ onAmountChanged: y
866
867
  }
867
868
  )
868
869
  }
@@ -870,264 +871,264 @@ const Rt = ({
870
871
  /* @__PURE__ */ e(
871
872
  U,
872
873
  {
873
- copy: { close_aria: i.close_aria, title: a.delete_title },
874
- isOpen: b,
874
+ copy: { close_aria: i.close_aria, title: n.delete_title },
875
+ isOpen: v,
875
876
  onClose: () => A(!1),
876
877
  onPrimaryAction: O,
877
878
  primaryColor: "error",
878
- primaryText: a.details_delete_button,
879
+ primaryText: n.details_delete_button,
879
880
  secondaryColor: "secondary",
880
- children: /* @__PURE__ */ e(C, { variant: "Paragraph", children: M(a.delete_description, n.category.name) })
881
+ children: /* @__PURE__ */ e(S, { variant: "Paragraph", children: R(n.delete_description, o.category.name) })
881
882
  }
882
883
  )
883
884
  ] });
884
- }), zt = ({ budget: t, onClick: a }) => {
885
+ }), Ht = ({ budget: t, onClick: n }) => {
885
886
  const {
886
887
  amount: i,
887
- budgetColors: { background: s, description: o },
888
+ budgetColors: { background: s, description: a },
888
889
  category_guid: r,
889
- description: n,
890
+ description: o,
890
891
  percentage: c,
891
- subBudgets: u,
892
+ subBudgets: g,
892
893
  transaction_total: d
893
894
  } = t;
894
- return /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ m(te, { onClick: () => a?.(t), children: [
895
- /* @__PURE__ */ e(ue, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(je, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: r, variant: "basic" }) }) }),
895
+ return /* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { onClick: () => n?.(t), children: [
896
+ /* @__PURE__ */ e(pe, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Ue, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: r, variant: "basic" }) }) }),
896
897
  /* @__PURE__ */ e(
897
- oe,
898
+ ne,
898
899
  {
899
- primary: /* @__PURE__ */ m(S, { component: "span", direction: "row", justifyContent: "space-between", children: [
900
- /* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: t.category.name }),
901
- /* @__PURE__ */ e(C, { fontWeight: 400, variant: "Body", children: `
900
+ primary: /* @__PURE__ */ u(x, { component: "span", direction: "row", justifyContent: "space-between", children: [
901
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.category.name }),
902
+ /* @__PURE__ */ e(S, { fontWeight: 400, variant: "Body", children: `
902
903
  ${T(d, "0,0")} /
903
904
  ${T(i, "0,0")}
904
905
  ` })
905
906
  ] }),
906
- secondary: /* @__PURE__ */ m(S, { component: "span", direction: "row", justifyContent: "space-between", children: [
907
- /* @__PURE__ */ e(C, { variant: "XSmall", children: `${u.length} Sub-budgets` }),
908
- /* @__PURE__ */ e(C, { bold: c > 100, color: o, variant: "XSmall", children: n })
907
+ secondary: /* @__PURE__ */ u(x, { component: "span", direction: "row", justifyContent: "space-between", children: [
908
+ /* @__PURE__ */ e(S, { variant: "XSmall", children: `${g.length} Sub-budgets` }),
909
+ /* @__PURE__ */ e(S, { bold: c > 100, color: a, variant: "XSmall", children: o })
909
910
  ] })
910
911
  }
911
912
  )
912
913
  ] }) });
913
- }, Ut = E(() => {
914
- const { onEvent: t } = q(), { budgets: a } = w(), { detailedBudgets: i, setSelectedBudget: s } = D(), o = (r) => {
914
+ }, Vt = I(() => {
915
+ const { onEvent: t } = J(), { budgets: n } = D(), { detailedBudgets: i, setSelectedBudget: s } = E(), a = (r) => {
915
916
  s(r), t(G.BUDGETS_CLICK_BUDGET_CATEGORY, {
916
917
  budget_category: r.category.name,
917
918
  click_type: "list"
918
919
  });
919
920
  };
920
- return /* @__PURE__ */ m(ve, { elevation: 2, children: [
921
- /* @__PURE__ */ e(we, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Se, { children: a.budget_categories_title }) }),
922
- /* @__PURE__ */ e(Te, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(Y, { children: i.map((r) => /* @__PURE__ */ m(l.Fragment, { children: [
923
- /* @__PURE__ */ e(zt, { budget: r, onClick: o }),
924
- /* @__PURE__ */ e(de, {})
921
+ return /* @__PURE__ */ u(Ee, { elevation: 2, children: [
922
+ /* @__PURE__ */ e(We, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ge, { children: n.budget_categories_title }) }),
923
+ /* @__PURE__ */ e(we, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(Z, { children: i.map((r) => /* @__PURE__ */ u(l.Fragment, { children: [
924
+ /* @__PURE__ */ e(Ht, { budget: r, onClick: a }),
925
+ /* @__PURE__ */ e(ge, {})
925
926
  ] }, r.guid)) }) })
926
927
  ] });
927
- }), Wt = E(() => {
928
- const t = ie(), { onEvent: a } = q(), { visibleAccounts: i } = Pe(), { budgets: s, common: o, recurring: r } = w(), { incomeCategories: n, spendCategories: c } = Z(), { detailedBudgets: u, totalBudgeted: d } = D(), { incomeTotal: g } = ce(), { setFilter: f } = Q(), [h, _] = l.useState(!1), [p, y] = l.useMemo(() => {
929
- const v = c.reduce((I, k) => I + k.totalAmount, 0);
930
- let x = v / d;
931
- x > 1 && (x = 1);
928
+ }), Kt = I(() => {
929
+ const t = de(), { onEvent: n } = J(), { visibleAccounts: i } = Fe(), { budgets: s, common: a, recurring: r } = D(), { incomeCategories: o, spendCategories: c } = q(), { detailedBudgets: g, totalBudgeted: d } = E(), { incomeTotal: m } = ue(), { setFilter: p } = ee(), [h, _] = l.useState(!1), [f, C] = l.useMemo(() => {
930
+ const y = c.reduce((w, N) => w + N.totalAmount, 0);
931
+ let B = y / d;
932
+ B > 1 && (B = 1);
932
933
  let O = t.palette.success.main;
933
- x > 0.8 && x < 1 ? O = t.palette.warning.main : x >= 1 && (O = t.palette.error.main);
934
+ B > 0.8 && B < 1 ? O = t.palette.warning.main : B >= 1 && (O = t.palette.error.main);
934
935
  const L = [
935
936
  {
936
937
  color: O,
937
- percentage: `${x}`
938
+ percentage: `${B}`
938
939
  }
939
940
  ];
940
- return [v, L];
941
- }, [u, c]), [b, A] = l.useMemo(() => {
942
- const v = Math.abs(
943
- n.reduce((L, I) => L + I.totalAmount, 0)
941
+ return [y, L];
942
+ }, [g, c]), [v, A] = l.useMemo(() => {
943
+ const y = Math.abs(
944
+ o.reduce((L, w) => L + w.totalAmount, 0)
944
945
  );
945
- let x = v / g;
946
- x > 1 && (x = 1);
946
+ let B = y / m;
947
+ B > 1 && (B = 1);
947
948
  const O = [
948
949
  {
949
950
  color: t.palette.secondary.main,
950
- percentage: `${x}`
951
+ percentage: `${B}`
951
952
  }
952
953
  ];
953
- return [v, O];
954
- }, [n, g]), B = () => {
955
- f({
956
- accounts: i.map((v) => v.guid),
954
+ return [y, O];
955
+ }, [o, m]), b = () => {
956
+ p({
957
+ accounts: i.map((y) => y.guid),
957
958
  dateRange: {
958
- start: st(/* @__PURE__ */ new Date(), 90),
959
+ start: lt(/* @__PURE__ */ new Date(), 90),
959
960
  end: /* @__PURE__ */ new Date()
960
961
  }
961
- }), _(!0), a(G.BUDGETS_CLICK_EDIT_INCOME);
962
+ }), _(!0), n(G.BUDGETS_CLICK_EDIT_INCOME);
962
963
  };
963
- return /* @__PURE__ */ m(ve, { elevation: 2, sx: { overflow: "visible" }, children: [
964
- /* @__PURE__ */ e(we, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Se, { children: s.overview_title }) }),
965
- /* @__PURE__ */ e(Te, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ m(S, { gap: 24, children: [
966
- /* @__PURE__ */ m(S, { gap: 8, children: [
967
- /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
968
- /* @__PURE__ */ e(Be, { data: y, height: 16 }),
969
- /* @__PURE__ */ e(C, { variant: "Small", children: M(
964
+ return /* @__PURE__ */ u(Ee, { elevation: 2, sx: { overflow: "visible" }, children: [
965
+ /* @__PURE__ */ e(We, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ge, { children: s.overview_title }) }),
966
+ /* @__PURE__ */ e(we, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ u(x, { gap: 24, children: [
967
+ /* @__PURE__ */ u(x, { gap: 8, children: [
968
+ /* @__PURE__ */ e(S, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
969
+ /* @__PURE__ */ e(xe, { data: C, height: 16 }),
970
+ /* @__PURE__ */ e(S, { variant: "Small", children: R(
970
971
  s.spending_description,
971
- T(p, "0,0"),
972
+ T(f, "0,0"),
972
973
  T(d, "0,0")
973
974
  ) })
974
975
  ] }),
975
- /* @__PURE__ */ m(S, { gap: 8, children: [
976
- /* @__PURE__ */ m(S, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
977
- /* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: s.income_title }),
976
+ /* @__PURE__ */ u(x, { gap: 8, children: [
977
+ /* @__PURE__ */ u(x, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
978
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: s.income_title }),
978
979
  /* @__PURE__ */ e(
979
- it,
980
+ dt,
980
981
  {
981
982
  "aria-label": r.manage_income,
982
- onClick: B,
983
+ onClick: b,
983
984
  sx: { p: 0 },
984
985
  children: /* @__PURE__ */ e(j, { color: "primary", name: "edit" })
985
986
  }
986
987
  )
987
988
  ] }),
988
- /* @__PURE__ */ e(Be, { data: A, height: 16 }),
989
- /* @__PURE__ */ e(C, { variant: "Small", children: M(
989
+ /* @__PURE__ */ e(xe, { data: A, height: 16 }),
990
+ /* @__PURE__ */ e(S, { variant: "Small", children: R(
990
991
  s.income_description,
991
- T(b, "0,0"),
992
- T(g, "0,0")
992
+ T(v, "0,0"),
993
+ T(m, "0,0")
993
994
  ) })
994
995
  ] })
995
996
  ] }) }),
996
997
  /* @__PURE__ */ e(
997
- $,
998
+ k,
998
999
  {
999
- ariaLabelClose: o.close_aria,
1000
+ ariaLabelClose: a.close_aria,
1000
1001
  isOpen: h,
1001
1002
  onClose: () => _(!1),
1002
1003
  title: r.manage_income,
1003
- children: /* @__PURE__ */ e(ct, { forOverview: !0 })
1004
+ children: /* @__PURE__ */ e(ut, { forOverview: !0 })
1004
1005
  }
1005
1006
  )
1006
1007
  ] });
1007
- }), Le = 480, qo = E(({ onBackClick: t, sx: a }) => {
1008
- const i = ie(), { onEvent: s } = q(), { visibleAccounts: o } = Pe(), { budgets: r, common: n } = w(), { isInitialized: c, selectedAccounts: u, setDisplayedDate: d } = J(), {
1009
- alert: g,
1010
- dateRange: f,
1008
+ }), $e = 480, tn = I(({ onBackClick: t, sx: n }) => {
1009
+ const i = de(), { onEvent: s } = J(), { visibleAccounts: a } = Fe(), { budgets: r, common: o } = D(), { isInitialized: c, selectedAccounts: g, setDisplayedDate: d } = Q(), {
1010
+ alert: m,
1011
+ dateRange: p,
1011
1012
  isDataLoaded: h,
1012
1013
  loadBudgetData: _,
1013
- setDateRange: p,
1014
- setAlert: y,
1015
- setTheme: b,
1014
+ setDateRange: f,
1015
+ setAlert: C,
1016
+ setTheme: v,
1016
1017
  detailedBudgets: A
1017
- } = D(), { setDateRange: B } = ce(), { loadDateRangeCategoryTotals: v } = Z(), { isSmallTablet: x, isMobile: O, isSmallMobile: L } = me(), I = x || O || L, [k, P] = l.useState(!1);
1018
- Fe({
1018
+ } = E(), { setDateRange: b } = ue(), { loadDateRangeCategoryTotals: y } = q(), { isSmallTablet: B, isMobile: O, isSmallMobile: L } = he(), w = B || O || L, [N, $] = l.useState(!1);
1019
+ He({
1019
1020
  widgetName: "BubbleBudgetsWidget",
1020
1021
  isLoaded: h
1021
1022
  }), l.useEffect(() => {
1022
- b(i), h || _().finally(() => {
1023
+ v(i), h || _().finally(() => {
1023
1024
  s(G.BUDGETS_VIEW);
1024
1025
  });
1025
- }, []), l.useEffect(() => (p({ start: re(ae()), end: Ce(ae()) }), () => {
1026
- p({ start: re(ae()), end: Ce(ae()) });
1027
- }), [o]), l.useEffect(() => {
1028
- c && (d(f.start, f.end), v(u, f.start, f.end).finally(), B(f));
1029
- }, [c, u, f]);
1030
- const N = (V) => {
1031
- p({ start: V[0] || /* @__PURE__ */ new Date(), end: V[1] || /* @__PURE__ */ new Date() });
1032
- }, K = () => {
1026
+ }, []), l.useEffect(() => (f({ start: ce(se()), end: Be(se()) }), () => {
1027
+ f({ start: ce(se()), end: Be(se()) });
1028
+ }), [a]), l.useEffect(() => {
1029
+ c && (d(p.start, p.end), y(g, p.start, p.end).finally(), b(p));
1030
+ }, [c, g, p]);
1031
+ const P = (re) => {
1032
+ f({ start: re[0] || /* @__PURE__ */ new Date(), end: re[1] || /* @__PURE__ */ new Date() });
1033
+ }, V = () => {
1033
1034
  s(G.BUDGETS_CLICK_FILTER);
1035
+ }, ae = () => {
1036
+ $(!0), s(G.BUDGETS_CLICK_ADD);
1034
1037
  }, F = () => {
1035
- P(!0), s(G.BUDGETS_CLICK_ADD);
1036
- }, he = () => {
1037
- P(!1);
1038
- }, ne = () => {
1039
- P(!1);
1040
- }, fe = Xe(f.end, re(/* @__PURE__ */ new Date()));
1041
- return !c || !h ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ m(
1042
- lt,
1038
+ $(!1);
1039
+ }, K = () => {
1040
+ $(!1);
1041
+ }, X = Je(p.end, ce(/* @__PURE__ */ new Date()));
1042
+ return !c || !h ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ u(
1043
+ mt,
1043
1044
  {
1044
1045
  actions: [
1045
1046
  {
1046
1047
  iconName: "add",
1047
1048
  label: r.add_title,
1048
- onClick: F
1049
+ onClick: ae
1049
1050
  }
1050
1051
  ],
1051
1052
  calendarActions: {
1052
- onRangeChanged: N,
1053
- shouldDisableNext: fe,
1053
+ onRangeChanged: P,
1054
+ shouldDisableNext: X,
1054
1055
  shouldDisablePicker: !0
1055
1056
  },
1056
- onAccountsFilterClick: K,
1057
+ onAccountsFilterClick: V,
1057
1058
  onBackClick: t,
1058
- sx: a,
1059
+ sx: n,
1059
1060
  title: r.budgets_title,
1060
1061
  children: [
1061
- /* @__PURE__ */ m(
1062
- S,
1062
+ /* @__PURE__ */ u(
1063
+ x,
1063
1064
  {
1064
- direction: I ? "column" : "row",
1065
+ direction: w ? "column" : "row",
1065
1066
  height: "100%",
1066
1067
  sx: { justifyContent: "center" },
1067
1068
  width: "100%",
1068
1069
  children: [
1069
- /* @__PURE__ */ e(S, { height: I ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
1070
- He,
1070
+ /* @__PURE__ */ e(x, { height: w ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
1071
+ Ye,
1071
1072
  {
1072
- createBudgetOnClick: F,
1073
- height: I ? 450 : 800,
1073
+ createBudgetOnClick: ae,
1074
+ height: w ? 450 : 800,
1074
1075
  isDraggable: !0,
1075
1076
  shouldShowZeroState: A.length === 0,
1076
- unavailableWidth: I ? 0 : Le
1077
+ unavailableWidth: w ? 0 : $e
1077
1078
  }
1078
1079
  ) }),
1079
- A.length !== 0 && /* @__PURE__ */ m(
1080
- S,
1080
+ A.length !== 0 && /* @__PURE__ */ u(
1081
+ x,
1081
1082
  {
1082
1083
  gap: 24,
1083
1084
  height: "100%",
1084
1085
  sx: { mr: 24, mt: 48 },
1085
- width: I ? "100%" : Le,
1086
+ width: w ? "100%" : $e,
1086
1087
  children: [
1087
- /* @__PURE__ */ e(Wt, {}),
1088
- /* @__PURE__ */ e(Ut, {})
1088
+ /* @__PURE__ */ e(Kt, {}),
1089
+ /* @__PURE__ */ e(Vt, {})
1089
1090
  ]
1090
1091
  }
1091
1092
  )
1092
1093
  ]
1093
1094
  }
1094
1095
  ),
1095
- /* @__PURE__ */ e(Ft, {}),
1096
+ /* @__PURE__ */ e(Wt, {}),
1096
1097
  /* @__PURE__ */ e(
1097
- $,
1098
+ k,
1098
1099
  {
1099
- ariaLabelClose: n.close_aria,
1100
- isOpen: k,
1101
- onClose: () => P(!1),
1100
+ ariaLabelClose: o.close_aria,
1101
+ isOpen: N,
1102
+ onClose: () => $(!1),
1102
1103
  title: r.add_new_title,
1103
1104
  children: /* @__PURE__ */ e(
1104
- ze,
1105
+ Ve,
1105
1106
  {
1106
- onAddBudget: he,
1107
- onRecalculateBudgets: ne
1107
+ onAddBudget: F,
1108
+ onRecalculateBudgets: K
1108
1109
  }
1109
1110
  )
1110
1111
  }
1111
1112
  ),
1112
1113
  /* @__PURE__ */ e(
1113
- Ne,
1114
+ ve,
1114
1115
  {
1115
1116
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
1116
1117
  autoHideDuration: 3500,
1117
1118
  onClose: () => {
1118
- y("");
1119
+ C("");
1119
1120
  },
1120
- open: !!g,
1121
+ open: !!m,
1121
1122
  children: /* @__PURE__ */ e(
1122
- ke,
1123
+ Ae,
1123
1124
  {
1124
1125
  closeText: "",
1125
1126
  onClose: () => {
1126
- y("");
1127
+ C("");
1127
1128
  },
1128
1129
  severity: "success",
1129
1130
  variant: "filled",
1130
- children: g
1131
+ children: m
1131
1132
  }
1132
1133
  )
1133
1134
  }
@@ -1135,87 +1136,87 @@ const Rt = ({
1135
1136
  ]
1136
1137
  }
1137
1138
  );
1138
- }), Ht = ({
1139
+ }), Xt = ({
1139
1140
  budgetsCopy: t,
1140
- difference: a,
1141
+ difference: n,
1141
1142
  handleAddClick: i,
1142
1143
  shouldShowZeroState: s
1143
1144
  }) => {
1144
- const { availableHeight: o = 0 } = le(), r = l.useRef(null);
1145
+ const { availableHeight: a = 0 } = me(), r = l.useRef(null);
1145
1146
  l.useEffect(() => {
1146
- o > 0 && r.current === null && (r.current = o);
1147
- }, [o]);
1148
- const n = l.useMemo(() => {
1149
- const c = r.current ?? o;
1147
+ a > 0 && r.current === null && (r.current = a);
1148
+ }, [a]);
1149
+ const o = l.useMemo(() => {
1150
+ const c = r.current ?? a;
1150
1151
  return c > 0 ? Math.round(Math.max(120, Math.min(450, c * 0.8))) - 40 : 450;
1151
- }, [o]);
1152
- return /* @__PURE__ */ m(S, { sx: { height: "100%", justifyContent: "space-between" }, children: [
1152
+ }, [a]);
1153
+ return /* @__PURE__ */ u(x, { sx: { height: "100%", justifyContent: "space-between" }, children: [
1153
1154
  /* @__PURE__ */ e(
1154
- He,
1155
+ Ye,
1155
1156
  {
1156
1157
  createBudgetOnClick: i,
1157
- height: n,
1158
+ height: o,
1158
1159
  isMiniWidget: !0,
1159
1160
  shouldShowZeroState: s
1160
1161
  }
1161
1162
  ),
1162
- !s && /* @__PURE__ */ m(W, { ml: 16, children: [
1163
- /* @__PURE__ */ e(C, { bold: !0, color: a < 0 ? "error.main" : "success.main", children: T(Math.abs(a), "0,0") }),
1164
- /* @__PURE__ */ e(C, { children: a < 0 ? t.overspent_in_budgets : t.left_in_budgets })
1163
+ !s && /* @__PURE__ */ u(W, { ml: 16, children: [
1164
+ /* @__PURE__ */ e(S, { bold: !0, color: n < 0 ? "error.main" : "success.main", children: T(Math.abs(n), "0,0") }),
1165
+ /* @__PURE__ */ e(S, { children: n < 0 ? t.overspent_in_budgets : t.left_in_budgets })
1165
1166
  ] })
1166
1167
  ] });
1167
- }, Kt = (t) => {
1168
- const a = ie(), { onEvent: i } = q(), { detailedBudgets: s, isDataLoaded: o, loadBudgetData: r, setTheme: n } = D(), { budgets: c, common: u } = w(), { isInitialized: d, selectedAccounts: g } = J(), { loadDateRangeCategoryTotals: f } = Z(), h = dt(), [_, p] = l.useState(!1);
1168
+ }, Yt = (t) => {
1169
+ const n = de(), { onEvent: i } = J(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: r, setTheme: o } = E(), { budgets: c, common: g } = D(), { isInitialized: d, selectedAccounts: m } = Q(), { loadDateRangeCategoryTotals: p } = q(), h = gt(), [_, f] = l.useState(!1);
1169
1170
  l.useEffect(() => {
1170
- o || r().finally();
1171
+ a || r().finally();
1171
1172
  }, []), l.useEffect(() => {
1172
- n(a);
1173
- }, [a]), l.useEffect(() => {
1174
- d && !o && f(
1175
- g,
1176
- re(/* @__PURE__ */ new Date()),
1177
- Ce(/* @__PURE__ */ new Date())
1173
+ o(n);
1174
+ }, [n]), l.useEffect(() => {
1175
+ d && !a && p(
1176
+ m,
1177
+ ce(/* @__PURE__ */ new Date()),
1178
+ Be(/* @__PURE__ */ new Date())
1178
1179
  ).finally();
1179
- }, [d, g, o]);
1180
- const y = () => {
1181
- p(!0), i(G.BUDGETS_CLICK_ADD);
1182
- }, b = () => {
1183
- p(!1);
1184
- }, A = () => p(!1);
1185
- if (Fe({
1180
+ }, [d, m, a]);
1181
+ const C = () => {
1182
+ f(!0), i(G.BUDGETS_CLICK_ADD);
1183
+ }, v = () => {
1184
+ f(!1);
1185
+ }, A = () => f(!1);
1186
+ if (He({
1186
1187
  widgetName: "BubbleBudgetsMiniWidget",
1187
- isLoaded: o
1188
- }), !d || !o) return /* @__PURE__ */ e(ge, {});
1189
- const B = s.length === 0;
1190
- return /* @__PURE__ */ m(
1191
- mt,
1188
+ isLoaded: a
1189
+ }), !d || !a) return /* @__PURE__ */ e(fe, {});
1190
+ const b = s.length === 0;
1191
+ return /* @__PURE__ */ u(
1192
+ ht,
1192
1193
  {
1193
1194
  contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
1194
- primaryCtaLabel: B ? c.get_started_cta : c.details_cta,
1195
+ primaryCtaLabel: b ? c.get_started_cta : c.details_cta,
1195
1196
  sx: { height: "100%" },
1196
1197
  title: c.budgets_title,
1197
1198
  ...t,
1198
1199
  children: [
1199
1200
  /* @__PURE__ */ e(
1200
- Ht,
1201
+ Xt,
1201
1202
  {
1202
1203
  budgetsCopy: c,
1203
1204
  difference: h,
1204
- handleAddClick: y,
1205
- shouldShowZeroState: B
1205
+ handleAddClick: C,
1206
+ shouldShowZeroState: b
1206
1207
  }
1207
1208
  ),
1208
1209
  /* @__PURE__ */ e(
1209
- $,
1210
+ k,
1210
1211
  {
1211
- ariaLabelClose: u.close_aria,
1212
+ ariaLabelClose: g.close_aria,
1212
1213
  isOpen: _,
1213
- onClose: () => p(!1),
1214
+ onClose: () => f(!1),
1214
1215
  title: c.add_new_title,
1215
1216
  children: /* @__PURE__ */ e(
1216
- ze,
1217
+ Ve,
1217
1218
  {
1218
- onAddBudget: b,
1219
+ onAddBudget: v,
1219
1220
  onRecalculateBudgets: A
1220
1221
  }
1221
1222
  )
@@ -1224,182 +1225,200 @@ const Rt = ({
1224
1225
  ]
1225
1226
  }
1226
1227
  );
1227
- }, Jo = E(Kt), Vt = ({ onClose: t, onViewHistory: a }) => {
1228
+ }, on = I(Yt), ie = {
1229
+ CANCEL_DELETE: "Cancel - Delete",
1230
+ END_SAVE: "End - Save",
1231
+ END_START: "End - Start",
1232
+ START_DELETE: "Start - Delete"
1233
+ }, Zt = ({ onClose: t, onEvent: n, onViewHistory: i }) => {
1228
1234
  const {
1229
- dateRange: i,
1230
- deleteBudget: s,
1235
+ alert: s,
1236
+ dateRange: a,
1237
+ deleteBudget: r,
1231
1238
  selectedBudget: o,
1232
- selectedSubBudget: r,
1233
- setSelectedBudget: n,
1234
- updateBudget: c
1235
- } = D(), { budgets: u, common: d } = w(), { isCopyLoaded: g, selectedAccountGuids: f } = J(), h = Ge(), { setFilter: _ } = Q(), [p, y] = l.useState(""), [b, A] = l.useState(null), [B, v] = l.useState(!1);
1239
+ selectedSubBudget: c,
1240
+ setAlert: g,
1241
+ setSelectedBudget: d,
1242
+ updateBudget: m
1243
+ } = E(), { budgets: p, common: h } = D(), { isCopyLoaded: _, selectedAccountGuids: f } = Q(), C = ze(), { setFilter: v } = ee(), [A, b] = l.useState(""), [y, B] = l.useState(null), [O, L] = l.useState(!1);
1236
1244
  if (l.useEffect(() => {
1237
- !o || r || (y(`${o.amount}`), _({
1245
+ !o || c || (b(`${o.amount}`), v({
1238
1246
  accounts: f,
1239
- dateRange: i,
1240
- custom: ({ category_guid: X, top_level_category_guid: be }) => {
1241
- const { category_guid: De } = o;
1242
- return X === De || be === De;
1247
+ dateRange: a,
1248
+ custom: ({ category_guid: Y, top_level_category_guid: _e }) => {
1249
+ const { category_guid: Oe } = o;
1250
+ return Y === Oe || _e === Oe;
1243
1251
  },
1244
1252
  showSplits: !0
1245
- }), v(!0));
1246
- }, [o]), !g) return /* @__PURE__ */ e(ge, {});
1253
+ }), L(!0));
1254
+ }, [o]), !_) return /* @__PURE__ */ e(fe, {});
1247
1255
  if (!o) return null;
1248
- const x = () => {
1249
- y(""), A(null), v(!1), setTimeout(() => {
1250
- n(void 0), t?.();
1256
+ const w = () => {
1257
+ b(""), B(null), L(!1), setTimeout(() => {
1258
+ d(void 0), t?.();
1251
1259
  }, 250);
1252
- }, O = () => {
1253
- y(o.amount ? `${o.amount}` : ""), A(null);
1254
- }, L = async () => {
1255
- b === "edit" && (await c({
1260
+ }, N = () => {
1261
+ y === "delete" && n?.(ie.CANCEL_DELETE, A), b(o.amount ? `${o.amount}` : ""), B(null);
1262
+ }, $ = async () => {
1263
+ y === "edit" && (await m({
1256
1264
  ...o,
1257
- amount: Number(p)
1258
- }), A(null)), b === "delete" && (await s(o.guid), x());
1259
- }, I = o.transaction_total ?? 0, k = o.amount ?? 0, P = Math.max(0, k - I), N = k > 0 ? Math.min(100, I / k * 100) : 0, K = {
1265
+ amount: Number(A)
1266
+ }), n?.(ie.END_SAVE, A), g(
1267
+ R(p.alert_budget_updated, o.category.name)
1268
+ ), B(null)), y === "delete" && (await r(o.guid), n?.(ie.END_START, A), w());
1269
+ }, P = o.transaction_total ?? 0, V = o.amount ?? 0, ae = Math.max(0, V - P), F = V > 0 ? Math.min(100, P / V * 100) : 0, K = {
1260
1270
  off: {
1261
- iconColor: "error",
1262
- iconName: "error",
1263
- statusName: u.status_off_track
1271
+ iconColor: "error"
1264
1272
  },
1265
1273
  on: {
1266
- iconColor: "success",
1267
- iconName: "check_circle",
1268
- statusName: u.status_on_track
1274
+ iconColor: "success"
1269
1275
  },
1270
1276
  near: {
1271
- iconColor: "warning",
1272
- iconName: "info",
1273
- statusName: u.status_near
1277
+ iconColor: "warning"
1274
1278
  }
1275
1279
  };
1276
- let F = K.on;
1277
- N >= 100 ? F = K.off : N >= 50 && (F = K.near);
1278
- const { statusName: he, iconColor: ne, iconName: fe } = F, V = (X, be) => M(X, /* @__PURE__ */ e("b", { children: be }));
1279
- return /* @__PURE__ */ m(l.Fragment, { children: [
1280
- /* @__PURE__ */ m(
1281
- $,
1280
+ let X = K.on;
1281
+ F >= 100 ? X = K.off : F >= 50 && (X = K.near);
1282
+ const { iconColor: re } = X, Ie = (Y, _e) => R(Y, /* @__PURE__ */ e("b", { children: _e }));
1283
+ return /* @__PURE__ */ u(l.Fragment, { children: [
1284
+ /* @__PURE__ */ u(
1285
+ k,
1282
1286
  {
1283
- ariaLabelClose: d.close_aria,
1287
+ ariaLabelClose: h.close_aria,
1284
1288
  footerStyles: {
1285
1289
  px: 24,
1286
1290
  py: 16
1287
1291
  },
1288
- isOpen: B,
1289
- onClose: x,
1290
- onPrimaryAction: () => A(
1292
+ isOpen: O,
1293
+ onClose: w,
1294
+ onPrimaryAction: () => B(
1291
1295
  "edit"
1292
1296
  /* EDIT */
1293
1297
  ),
1294
- onSecondaryAction: () => A(
1295
- "delete"
1296
- /* DELETE */
1297
- ),
1298
- primaryText: u.details_edit_button,
1298
+ onSecondaryAction: () => {
1299
+ n?.(ie.START_DELETE, A), B(
1300
+ "delete"
1301
+ /* DELETE */
1302
+ );
1303
+ },
1304
+ primaryText: p.details_edit_button,
1299
1305
  secondaryColor: "error",
1300
- secondaryText: u.details_delete_button,
1301
- title: u.details_title,
1306
+ secondaryText: p.details_delete_button,
1307
+ sx: {
1308
+ "& .list-wrapper": {
1309
+ pr: 24
1310
+ }
1311
+ },
1312
+ title: R(p.details_type_title, o.category.name),
1302
1313
  children: [
1303
- /* @__PURE__ */ m(W, { sx: { bgcolor: "background.paper" }, children: [
1304
- /* @__PURE__ */ e(
1305
- we,
1306
- {
1307
- subheader: /* @__PURE__ */ m(S, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
1308
- /* @__PURE__ */ e(gt, { color: ne, fill: !0, name: fe }),
1309
- /* @__PURE__ */ e(C, { color: "text.secondary", uppercase: !0, variant: "body2", children: he })
1310
- ] }),
1311
- sx: {
1312
- alignItems: "flex-start",
1313
- pb: 8,
1314
- pt: 24,
1315
- px: 24
1316
- },
1317
- title: /* @__PURE__ */ e(Se, { children: M(
1318
- u.details_type_title,
1319
- o.category.name
1320
- ) })
1321
- }
1322
- ),
1323
- /* @__PURE__ */ e(
1324
- ht,
1325
- {
1326
- amount: T(o.amount, "0,0.00"),
1327
- completeColor: `${ne}.main`,
1328
- icon: /* @__PURE__ */ e(
1329
- H,
1314
+ /* @__PURE__ */ u(
1315
+ W,
1316
+ {
1317
+ sx: {
1318
+ bgcolor: "background.paper",
1319
+ borderBottomColor: "divider",
1320
+ borderBottomStyle: "solid",
1321
+ borderBottomWidth: 1
1322
+ },
1323
+ children: [
1324
+ /* @__PURE__ */ u(
1325
+ x,
1330
1326
  {
1331
- categoryGuid: o.category.guid,
1332
- size: 44,
1333
1327
  sx: {
1334
- bgcolor: et(Ee(o.category.guid, h), 0.15),
1335
- border: `1px solid ${Ee(o.category.guid, h)}`,
1336
- color: "text.primary"
1337
- }
1328
+ alignItems: "center",
1329
+ flexDirection: "row",
1330
+ gap: 12,
1331
+ justifyContent: "space-between",
1332
+ pt: 16,
1333
+ px: 24
1334
+ },
1335
+ children: [
1336
+ /* @__PURE__ */ e(ye, { bold: !0, variant: "subtitle1", children: _t(o.start_date) }),
1337
+ i && /* @__PURE__ */ e(Te, { endIcon: /* @__PURE__ */ e(ft, {}), onClick: i, sx: { height: 28 }, children: /* @__PURE__ */ e(S, { bold: !0, variant: "body2", children: "Spending History" }) })
1338
+ ]
1338
1339
  }
1339
1340
  ),
1340
- label: V(
1341
- u.spent_label,
1342
- ft(new Date(o.start_date * 1e3), { month: "short" })
1343
- ),
1344
- leftLabel: M(u.percent_spent, N.toFixed()),
1345
- percentComplete: N,
1346
- rightLabel: M(
1347
- u.balance_left,
1348
- T(P, "0,0.00")
1341
+ /* @__PURE__ */ e(
1342
+ bt,
1343
+ {
1344
+ amount: /* @__PURE__ */ u(x, { sx: { alignItems: "baseline", flexDirection: "row", gap: 4 }, children: [
1345
+ /* @__PURE__ */ e(Pe, { children: T(o.transaction_total, "0,0.00") }),
1346
+ /* @__PURE__ */ e(ye, { color: "text.secondary", variant: "body2", children: "/" }),
1347
+ /* @__PURE__ */ e(ye, { color: "text.secondary", variant: "body2", children: T(o.amount, "0,0.00") })
1348
+ ] }),
1349
+ completeColor: `${re}.main`,
1350
+ icon: /* @__PURE__ */ e(
1351
+ H,
1352
+ {
1353
+ categoryGuid: o.category.guid,
1354
+ size: 44,
1355
+ sx: {
1356
+ bgcolor: nt(Me(o.category.guid, C), 0.15),
1357
+ border: `1px solid ${Me(o.category.guid, C)}`,
1358
+ color: "text.primary"
1359
+ }
1360
+ }
1361
+ ),
1362
+ label: Ie(
1363
+ p.spent_label,
1364
+ yt(new Date(o.start_date * 1e3), { month: "short" })
1365
+ ),
1366
+ leftLabel: R(p.percent_spent, F.toFixed()),
1367
+ percentComplete: F,
1368
+ rightLabel: R(
1369
+ p.balance_left,
1370
+ T(ae, "0,0.00")
1371
+ ),
1372
+ sx: {
1373
+ pb: 24,
1374
+ pt: 16,
1375
+ px: 24
1376
+ }
1377
+ }
1349
1378
  )
1350
- }
1351
- ),
1352
- /* @__PURE__ */ m(
1353
- S,
1354
- {
1355
- sx: {
1356
- alignItems: "center",
1357
- borderBottomColor: "divider",
1358
- borderBottomStyle: "solid",
1359
- borderBottomWidth: 1,
1360
- flexDirection: "row",
1361
- justifyContent: "space-between",
1362
- pb: 4,
1363
- pt: 16,
1364
- px: 24
1365
- },
1366
- children: [
1367
- /* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: u.details_transactions_tab }),
1368
- a && /* @__PURE__ */ e(xe, { endIcon: /* @__PURE__ */ e(pt, {}), onClick: a, sx: { height: 28 }, children: /* @__PURE__ */ e(C, { bold: !0, variant: "body2", children: d.view_history }) })
1369
- ]
1370
- }
1371
- )
1372
- ] }),
1373
- /* @__PURE__ */ e(Ae, {})
1379
+ ]
1380
+ }
1381
+ ),
1382
+ /* @__PURE__ */ e(De, {}),
1383
+ s && /* @__PURE__ */ e(
1384
+ ve,
1385
+ {
1386
+ anchorOrigin: { horizontal: "right", vertical: "bottom" },
1387
+ autoHideDuration: 3500,
1388
+ onClose: () => g(""),
1389
+ open: !!s,
1390
+ children: /* @__PURE__ */ e(Ae, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children: s })
1391
+ }
1392
+ )
1374
1393
  ]
1375
1394
  }
1376
1395
  ),
1377
- b && /* @__PURE__ */ e(
1378
- ut,
1396
+ y && /* @__PURE__ */ e(
1397
+ pt,
1379
1398
  {
1380
- closeAriaLabel: d.close_aria,
1381
- content: V(
1382
- u[b === "edit" ? "edit_budget_content" : "delete_description"],
1399
+ closeAriaLabel: h.close_aria,
1400
+ content: Ie(
1401
+ p[y === "edit" ? "edit_budget_content" : "delete_description"],
1383
1402
  o.category.name
1384
1403
  ),
1385
- handleInputChange: (X) => y(X.toString()),
1386
- handleModalClose: O,
1387
- handlePrimaryAction: L,
1388
- handleSecondaryAction: O,
1389
- inputLabel: b === "edit" ? u.details_edit_title : "",
1390
- inputValue: p,
1404
+ handleInputChange: (Y) => b(Y.toString()),
1405
+ handleModalClose: N,
1406
+ handlePrimaryAction: $,
1407
+ handleSecondaryAction: N,
1408
+ inputLabel: y === "edit" ? p.details_edit_title : "",
1409
+ inputValue: A,
1391
1410
  isOpen: !0,
1392
- primaryColor: b === "edit" ? "primary" : "error",
1393
- primaryText: u[b === "edit" ? "add_save_button" : "details_delete_button"],
1394
- secondaryColor: b === "edit" ? "primary" : "inherit",
1395
- secondaryText: d.cancel_button,
1396
- title: u[b === "edit" ? "details_edit_title" : "delete_title"]
1411
+ primaryColor: y === "edit" ? "primary" : "error",
1412
+ primaryText: p[y === "edit" ? "add_save_button" : "details_delete_button"],
1413
+ secondaryColor: y === "edit" ? "primary" : "inherit",
1414
+ secondaryText: h.cancel_button,
1415
+ title: p[y === "edit" ? "details_edit_title" : "delete_title"]
1397
1416
  }
1398
1417
  )
1399
1418
  ] });
1400
- }, Qo = E(Vt);
1419
+ }, nn = I(Zt);
1401
1420
  export {
1402
- Jo as BubbleBudgetsMiniWidget,
1403
- qo as BubbleBudgetsWidget,
1404
- Qo as BudgetDetailsDrawerV2
1421
+ on as BubbleBudgetsMiniWidget,
1422
+ tn as BubbleBudgetsWidget,
1423
+ nn as BudgetDetailsDrawerV2
1405
1424
  };