@mx-cartographer/experiences 7.2.15-alpha.sms3 → 7.2.16-alpha.mm0

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