@mx-cartographer/experiences 7.0.52-alpha.mega6 → 7.0.52-alpha.mega7

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