@mx-cartographer/experiences 7.0.52-alpha.mega1 → 7.0.52-alpha.mega2

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