@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.
- package/dist/budgets/index.es.js +365 -365
- package/package.json +1 -1
package/dist/budgets/index.es.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
28
|
-
import { D as
|
|
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 = (
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
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",
|
|
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
|
|
63
|
-
return (n) => (
|
|
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,
|
|
67
|
-
const
|
|
68
|
-
t.alpha(1).restart().force("x",
|
|
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
|
|
72
|
-
c.x <
|
|
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,
|
|
79
|
-
const l = Math.max(
|
|
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),
|
|
82
|
-
const l = Math.max(
|
|
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),
|
|
85
|
-
const
|
|
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:
|
|
88
|
+
radius: r
|
|
89
89
|
};
|
|
90
90
|
});
|
|
91
|
-
return O.forceSimulation(
|
|
92
|
-
}, ut = (t, o,
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
if (
|
|
96
|
-
const _ = Math.sqrt(
|
|
97
|
-
|
|
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 && (
|
|
100
|
-
}, mt = (t, o,
|
|
101
|
-
const { maxRadius: n, minRadius:
|
|
102
|
-
return O.scaleLinear().domain([
|
|
103
|
-
}, gt = (t, o,
|
|
104
|
-
const n = o.map((
|
|
105
|
-
return t.map((
|
|
106
|
-
...
|
|
107
|
-
radius: c(Math.max(
|
|
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:
|
|
112
|
-
guid:
|
|
113
|
-
budgetColors: { mercury:
|
|
111
|
+
amount: s,
|
|
112
|
+
guid: i,
|
|
113
|
+
budgetColors: { mercury: a },
|
|
114
114
|
radius: n,
|
|
115
|
-
transaction_total:
|
|
116
|
-
} = t, l = `mercury-${
|
|
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: ${
|
|
119
|
-
}, [
|
|
120
|
-
const c = O.arc().innerRadius((
|
|
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:
|
|
129
|
+
function _t({ bubble: t, isDraggable: o, isMiniWidget: s, onClick: i = () => {
|
|
130
130
|
} }) {
|
|
131
|
-
const [
|
|
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:
|
|
143
|
+
budgetColors: { background: m, text: u },
|
|
144
144
|
category: { icon: y, name: _ },
|
|
145
|
-
guid:
|
|
146
|
-
description:
|
|
145
|
+
guid: h,
|
|
146
|
+
description: p,
|
|
147
147
|
radius: f,
|
|
148
|
-
x:
|
|
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}: ${
|
|
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-${
|
|
168
|
-
onClick: () =>
|
|
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:
|
|
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:
|
|
181
|
-
slotProps: { popper:
|
|
180
|
+
open: a,
|
|
181
|
+
slotProps: { popper: N },
|
|
182
182
|
title: M,
|
|
183
|
-
children: /* @__PURE__ */ e("circle", { fill:
|
|
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:
|
|
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-${
|
|
193
|
-
sx: { fill:
|
|
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-${
|
|
205
|
-
sx: { fill:
|
|
204
|
+
id: `budget-description-${h}-1`,
|
|
205
|
+
sx: { fill: u },
|
|
206
206
|
variant: "Body",
|
|
207
207
|
y: f <= $ ? 12 : 24,
|
|
208
|
-
children: f <= $ ?
|
|
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-${
|
|
216
|
-
sx: { fill:
|
|
215
|
+
id: `budget-description-${h}-2`,
|
|
216
|
+
sx: { fill: u },
|
|
217
217
|
variant: "XSmall",
|
|
218
218
|
y: 28,
|
|
219
|
-
children:
|
|
219
|
+
children: p.split(" ")[1]
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
222
|
/* @__PURE__ */ e(ft, { bubble: c })
|
|
223
223
|
]
|
|
224
224
|
},
|
|
225
|
-
|
|
225
|
+
h
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
228
|
const yt = ({
|
|
229
229
|
height: t,
|
|
230
230
|
width: o,
|
|
231
|
-
isDraggable:
|
|
232
|
-
isMiniWidget:
|
|
233
|
-
onClick:
|
|
231
|
+
isDraggable: s = !1,
|
|
232
|
+
isMiniWidget: i = !1,
|
|
233
|
+
onClick: a = () => {
|
|
234
234
|
}
|
|
235
235
|
}) => {
|
|
236
|
-
const [n,
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
239
|
-
const
|
|
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
|
|
242
|
-
|
|
243
|
-
vx:
|
|
244
|
-
vy:
|
|
245
|
-
x:
|
|
246
|
-
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,
|
|
250
|
+
l.current = y, r(_);
|
|
251
251
|
}, [c]);
|
|
252
252
|
return d.useEffect(() => {
|
|
253
|
-
|
|
254
|
-
}, [
|
|
253
|
+
m();
|
|
254
|
+
}, [m]), d.useEffect(() => () => {
|
|
255
255
|
l.current && (l.current.stop(), l.current = null);
|
|
256
256
|
}, []), d.useEffect(() => {
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
259
|
-
const y =
|
|
260
|
-
|
|
261
|
-
}, [t, o,
|
|
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:
|
|
265
|
-
isDraggable:
|
|
266
|
-
isMiniWidget:
|
|
267
|
-
onClick:
|
|
264
|
+
bubble: u,
|
|
265
|
+
isDraggable: s,
|
|
266
|
+
isMiniWidget: i,
|
|
267
|
+
onClick: a
|
|
268
268
|
},
|
|
269
|
-
|
|
269
|
+
u.guid
|
|
270
270
|
)) });
|
|
271
271
|
}, bt = E(yt), Ct = ({
|
|
272
272
|
isMiniWidget: t = !1,
|
|
273
273
|
onConnectAccountsClick: o,
|
|
274
|
-
createBudgetOnClick:
|
|
274
|
+
createBudgetOnClick: s
|
|
275
275
|
}) => {
|
|
276
|
-
const { recalculateBudgets:
|
|
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:
|
|
279
|
-
y(!1), f ? (
|
|
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
|
|
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: (
|
|
288
|
-
|
|
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:
|
|
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: (
|
|
307
|
-
|
|
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: (
|
|
330
|
-
|
|
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:
|
|
353
|
-
isMiniWidget:
|
|
354
|
-
shouldShowZeroState:
|
|
352
|
+
isDraggable: s = !1,
|
|
353
|
+
isMiniWidget: i = !1,
|
|
354
|
+
shouldShowZeroState: a,
|
|
355
355
|
unavailableWidth: n = 24
|
|
356
356
|
}) => {
|
|
357
|
-
const { onEvent:
|
|
358
|
-
l(v),
|
|
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
|
-
|
|
363
|
+
p(!0), r(L.ACCOUNTS_CLICK_CONNECT);
|
|
364
364
|
};
|
|
365
|
-
return c ? /* @__PURE__ */ e(
|
|
366
|
-
|
|
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:
|
|
370
|
+
isMiniWidget: i,
|
|
371
371
|
onConnectAccountsClick: A
|
|
372
372
|
}
|
|
373
373
|
) : /* @__PURE__ */ e(
|
|
374
374
|
bt,
|
|
375
375
|
{
|
|
376
376
|
height: o,
|
|
377
|
-
isDraggable:
|
|
378
|
-
isMiniWidget:
|
|
379
|
-
onClick:
|
|
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: () =>
|
|
387
|
-
showConnectionsWidget:
|
|
388
|
-
title:
|
|
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:
|
|
395
|
-
return /* @__PURE__ */ g(
|
|
396
|
-
/* @__PURE__ */ g(
|
|
397
|
-
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: T(
|
|
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(
|
|
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(
|
|
407
|
-
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: T(
|
|
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:
|
|
414
|
-
const
|
|
415
|
-
return `${n} - ${
|
|
416
|
-
}, [o,
|
|
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:
|
|
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:
|
|
427
|
-
await
|
|
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
|
-
|
|
433
|
+
k,
|
|
434
434
|
{
|
|
435
|
-
ariaLabelClose:
|
|
436
|
-
isOpen:
|
|
435
|
+
ariaLabelClose: s.close_aria,
|
|
436
|
+
isOpen: r,
|
|
437
437
|
onClose: () => l(!1),
|
|
438
|
-
onPrimaryAction:
|
|
438
|
+
onPrimaryAction: m,
|
|
439
439
|
title: o.recalculate_title,
|
|
440
|
-
children: /* @__PURE__ */ g(
|
|
441
|
-
/* @__PURE__ */ g(
|
|
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((
|
|
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:
|
|
453
|
+
onAmountChanged: s
|
|
454
454
|
}) => {
|
|
455
|
-
const { budgets:
|
|
456
|
-
return /* @__PURE__ */ g(
|
|
457
|
-
/* @__PURE__ */ g(
|
|
458
|
-
/* @__PURE__ */ e(b, { children:
|
|
459
|
-
|
|
460
|
-
T(
|
|
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:
|
|
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:
|
|
469
|
+
label: i.add_label,
|
|
470
470
|
minAmount: 0,
|
|
471
|
-
setAmount:
|
|
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:
|
|
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:
|
|
496
|
-
disablePrimaryButton: Number(
|
|
497
|
-
isOpen:
|
|
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(
|
|
500
|
-
primaryText:
|
|
501
|
-
children: /* @__PURE__ */ e(ae, { amount:
|
|
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:
|
|
507
|
-
await
|
|
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(
|
|
509
|
+
return /* @__PURE__ */ g(S, { children: [
|
|
510
510
|
/* @__PURE__ */ e(St, {}),
|
|
511
|
-
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(X, { children:
|
|
511
|
+
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(X, { children: a.map((r) => /* @__PURE__ */ e(
|
|
512
512
|
vt,
|
|
513
513
|
{
|
|
514
|
-
category:
|
|
514
|
+
category: r,
|
|
515
515
|
onAddBudget: n
|
|
516
516
|
},
|
|
517
|
-
|
|
517
|
+
r.guid
|
|
518
518
|
)) }) }),
|
|
519
519
|
/* @__PURE__ */ e(xt, { onRecalculateBudgets: t })
|
|
520
520
|
] });
|
|
521
521
|
}), At = (t) => {
|
|
522
|
-
const o = J(), {
|
|
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
|
|
525
|
-
return
|
|
524
|
+
const M = a.length;
|
|
525
|
+
return M === 0 ? 75 : Math.min(75 + 10 * M, 175);
|
|
526
526
|
}
|
|
527
527
|
return 370;
|
|
528
|
-
}, [s,
|
|
529
|
-
|
|
530
|
-
},
|
|
531
|
-
|
|
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
|
-
|
|
534
|
+
l(o);
|
|
535
535
|
}, [o]), d.useEffect(() => {
|
|
536
|
-
|
|
536
|
+
y && !n && h(_, q(/* @__PURE__ */ new Date()), le(/* @__PURE__ */ new Date())).then(
|
|
537
537
|
() => {
|
|
538
|
-
|
|
538
|
+
r().finally();
|
|
539
539
|
}
|
|
540
540
|
);
|
|
541
|
-
}, [
|
|
541
|
+
}, [y, _]), u ? /* @__PURE__ */ g(
|
|
542
542
|
Ke,
|
|
543
543
|
{
|
|
544
|
-
primaryCtaLabel:
|
|
545
|
-
title:
|
|
544
|
+
primaryCtaLabel: f ? c.get_started_cta : c.details_cta,
|
|
545
|
+
title: c.budgets_title,
|
|
546
546
|
...t,
|
|
547
547
|
children: [
|
|
548
|
-
|
|
549
|
-
|
|
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:
|
|
559
|
-
height:
|
|
558
|
+
createBudgetOnClick: C,
|
|
559
|
+
height: A,
|
|
560
560
|
isMiniWidget: !0,
|
|
561
|
-
shouldShowZeroState:
|
|
561
|
+
shouldShowZeroState: f
|
|
562
562
|
}
|
|
563
563
|
),
|
|
564
|
-
!
|
|
565
|
-
/* @__PURE__ */ e(b, { bold: !0, color:
|
|
566
|
-
/* @__PURE__ */ e(b, { children:
|
|
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
|
-
|
|
572
|
+
k,
|
|
573
573
|
{
|
|
574
574
|
ariaLabelClose: m.close_aria,
|
|
575
|
-
isOpen:
|
|
576
|
-
onClose: () =>
|
|
577
|
-
title:
|
|
578
|
-
children: /* @__PURE__ */ e(Oe, { onRecalculateBudgets:
|
|
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:
|
|
588
|
-
category: { name:
|
|
589
|
-
category_guid:
|
|
587
|
+
budgetColors: { background: s },
|
|
588
|
+
category: { name: i },
|
|
589
|
+
category_guid: a,
|
|
590
590
|
percentage: n,
|
|
591
|
-
transaction_total:
|
|
591
|
+
transaction_total: r
|
|
592
592
|
} = t, l = [
|
|
593
593
|
{
|
|
594
|
-
color:
|
|
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(
|
|
599
|
-
/* @__PURE__ */ e(H, { categoryGuid:
|
|
600
|
-
/* @__PURE__ */ e(je, { children: `${T(
|
|
601
|
-
/* @__PURE__ */ e(b, { bold: !0, variant: "XSmall", children:
|
|
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(
|
|
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:
|
|
615
|
-
category:
|
|
616
|
-
percentage:
|
|
614
|
+
budgetColors: { background: s },
|
|
615
|
+
category: i,
|
|
616
|
+
percentage: a,
|
|
617
617
|
transaction_total: n
|
|
618
|
-
} = t, { setSelectedSubBudget:
|
|
619
|
-
return /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ g(K, { onClick: () =>
|
|
620
|
-
/* @__PURE__ */ e(oe, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Te, { color:
|
|
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(
|
|
625
|
-
secondary: /* @__PURE__ */ e(
|
|
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:
|
|
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 && (
|
|
637
|
+
v && (p(v), _(`${v.currentAmount === 0 ? "" : v.currentAmount}`), u(!0));
|
|
638
638
|
});
|
|
639
639
|
}, []);
|
|
640
640
|
const f = () => {
|
|
641
|
-
|
|
642
|
-
},
|
|
643
|
-
|
|
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(
|
|
647
|
-
/* @__PURE__ */ g(
|
|
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:
|
|
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
|
-
|
|
655
|
+
k,
|
|
656
656
|
{
|
|
657
|
-
ariaLabelClose:
|
|
657
|
+
ariaLabelClose: i.close_aria,
|
|
658
658
|
isOpen: l,
|
|
659
659
|
onClose: () => c(!1),
|
|
660
|
-
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:
|
|
667
|
+
copy: { close_aria: i.close_aria, title: s.add_title },
|
|
668
668
|
disablePrimaryButton: Number(y) <= 0,
|
|
669
|
-
isOpen:
|
|
670
|
-
onClose: () =>
|
|
671
|
-
onPrimaryAction:
|
|
672
|
-
primaryText:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
688
|
-
...
|
|
689
|
-
custom: (C) => C.category_guid ===
|
|
687
|
+
r && (B(`${r.amount}`), u({
|
|
688
|
+
...m,
|
|
689
|
+
custom: (C) => C.category_guid === r.category_guid
|
|
690
690
|
}));
|
|
691
|
-
}, [
|
|
691
|
+
}, [r]);
|
|
692
692
|
const A = async () => {
|
|
693
|
-
|
|
694
|
-
...
|
|
693
|
+
r && await c({
|
|
694
|
+
...r,
|
|
695
695
|
amount: Number(f)
|
|
696
696
|
});
|
|
697
697
|
}, v = async () => {
|
|
698
|
-
|
|
698
|
+
r && await n(r.guid), p(!1), x();
|
|
699
699
|
}, x = () => {
|
|
700
|
-
|
|
701
|
-
...
|
|
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
|
-
|
|
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
|
-
|
|
714
|
+
k,
|
|
715
715
|
{
|
|
716
|
-
ariaLabelClose:
|
|
717
|
-
isOpen: !!
|
|
716
|
+
ariaLabelClose: a.close_aria,
|
|
717
|
+
isOpen: !!r,
|
|
718
718
|
onClose: x,
|
|
719
719
|
onPrimaryAction: () => _(!0),
|
|
720
|
-
onSecondaryAction: () =>
|
|
721
|
-
primaryText:
|
|
722
|
-
secondaryText:
|
|
723
|
-
title:
|
|
724
|
-
children:
|
|
725
|
-
/* @__PURE__ */ e(Me, { budget:
|
|
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
|
-
|
|
730
|
+
r && /* @__PURE__ */ g(d.Fragment, { children: [
|
|
731
731
|
/* @__PURE__ */ e(
|
|
732
732
|
j,
|
|
733
733
|
{
|
|
734
|
-
copy: { close_aria:
|
|
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:
|
|
739
|
+
primaryText: i.edit_save_button,
|
|
740
740
|
children: /* @__PURE__ */ e(
|
|
741
741
|
ae,
|
|
742
742
|
{
|
|
743
743
|
amount: f,
|
|
744
|
-
categoryName:
|
|
745
|
-
onAmountChanged:
|
|
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:
|
|
754
|
-
isOpen:
|
|
755
|
-
onClose: () =>
|
|
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:
|
|
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:
|
|
767
|
-
sortedTransactions:
|
|
768
|
-
sortedTransactionsWithSplits:
|
|
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(), [_,
|
|
771
|
-
() =>
|
|
772
|
-
[
|
|
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
|
-
|
|
774
|
+
h(w);
|
|
775
775
|
}, v = () => {
|
|
776
|
-
Qe(
|
|
777
|
-
}, x =
|
|
778
|
-
return /* @__PURE__ */ g(
|
|
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(
|
|
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:
|
|
791
|
-
/* @__PURE__ */ e(ye, { label:
|
|
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(
|
|
796
|
-
x && /* @__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
|
-
|
|
809
|
+
k,
|
|
810
810
|
{
|
|
811
|
-
ariaLabelClose:
|
|
812
|
-
isOpen: !!
|
|
811
|
+
ariaLabelClose: a.close_aria,
|
|
812
|
+
isOpen: !!B,
|
|
813
813
|
onClose: () => f(""),
|
|
814
|
-
title:
|
|
815
|
-
children:
|
|
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:
|
|
822
|
-
dateRange:
|
|
823
|
-
deleteBudget:
|
|
821
|
+
const { selectedAccountGuids: t } = Q(), { budgets: o, common: s } = I(), {
|
|
822
|
+
dateRange: i,
|
|
823
|
+
deleteBudget: a,
|
|
824
824
|
selectedBudget: n,
|
|
825
|
-
selectedSubBudget:
|
|
825
|
+
selectedSubBudget: r,
|
|
826
826
|
setAlert: l,
|
|
827
827
|
setSelectedBudget: c,
|
|
828
|
-
updateBudget:
|
|
829
|
-
} = D(), { setFilter:
|
|
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 && !
|
|
831
|
+
n && !r && (v(`${n.amount}`), _(!0), u({
|
|
832
832
|
accounts: t,
|
|
833
|
-
dateRange:
|
|
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
|
|
839
|
+
n && (await m({
|
|
840
840
|
...n,
|
|
841
841
|
amount: Number(A),
|
|
842
842
|
percentage: n.category.totalAmount / Number(A) * 100
|
|
843
|
-
}), l(
|
|
843
|
+
}), l(R(o.alert_budget_updated, n.category.name)));
|
|
844
844
|
}, C = async () => {
|
|
845
|
-
n && (await
|
|
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
|
-
|
|
854
|
+
k,
|
|
855
855
|
{
|
|
856
|
-
ariaLabelClose:
|
|
856
|
+
ariaLabelClose: s.close_aria,
|
|
857
857
|
isOpen: y,
|
|
858
858
|
onClose: w,
|
|
859
|
-
onPrimaryAction: () =>
|
|
860
|
-
onSecondaryAction: () =>
|
|
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:
|
|
871
|
+
copy: { close_aria: s.close_aria, title: o.details_edit_title },
|
|
872
872
|
disablePrimaryButton: Number(A) <= 0,
|
|
873
|
-
isOpen:
|
|
874
|
-
onClose: () =>
|
|
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:
|
|
890
|
+
copy: { close_aria: s.close_aria, title: o.delete_title },
|
|
891
891
|
isOpen: f,
|
|
892
|
-
onClose: () =>
|
|
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:
|
|
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:
|
|
904
|
-
budgetColors: { background:
|
|
903
|
+
amount: s,
|
|
904
|
+
budgetColors: { background: i, description: a },
|
|
905
905
|
category_guid: n,
|
|
906
|
-
description:
|
|
906
|
+
description: r,
|
|
907
907
|
percentage: l,
|
|
908
908
|
subBudgets: c,
|
|
909
|
-
transaction_total:
|
|
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:
|
|
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(
|
|
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(
|
|
920
|
-
${T(
|
|
919
|
+
${T(m, "0,0")} /
|
|
920
|
+
${T(s, "0,0")}
|
|
921
921
|
` })
|
|
922
922
|
] }),
|
|
923
|
-
secondary: /* @__PURE__ */ g(
|
|
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:
|
|
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:
|
|
932
|
-
|
|
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:
|
|
940
|
-
/* @__PURE__ */ e(Mt, { budget: n, onClick:
|
|
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:
|
|
946
|
-
const x = l.reduce((
|
|
947
|
-
let C = x /
|
|
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]), [
|
|
958
|
+
}, [c, l]), [B, A] = d.useMemo(() => {
|
|
959
959
|
const x = Math.abs(
|
|
960
|
-
|
|
960
|
+
r.reduce((M, N) => M + N.totalAmount, 0)
|
|
961
961
|
);
|
|
962
|
-
let C = x /
|
|
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
|
-
}, [
|
|
971
|
+
}, [r, u]), v = () => {
|
|
972
972
|
y({
|
|
973
|
-
accounts:
|
|
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
|
-
}),
|
|
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:
|
|
982
|
-
/* @__PURE__ */ e(he, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ g(
|
|
983
|
-
/* @__PURE__ */ g(
|
|
984
|
-
/* @__PURE__ */ e(b, { bold: !0, sx: { mb: 8 }, variant: "Body", children:
|
|
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:
|
|
987
|
-
|
|
988
|
-
T(
|
|
989
|
-
T(
|
|
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(
|
|
993
|
-
/* @__PURE__ */ g(
|
|
994
|
-
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children:
|
|
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:
|
|
1007
|
-
|
|
1008
|
-
T(
|
|
1009
|
-
T(
|
|
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
|
-
|
|
1014
|
+
k,
|
|
1015
1015
|
{
|
|
1016
|
-
ariaLabelClose:
|
|
1016
|
+
ariaLabelClose: a.close_aria,
|
|
1017
1017
|
isOpen: _,
|
|
1018
|
-
onClose: () =>
|
|
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
|
|
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:
|
|
1028
|
-
isDataLoaded:
|
|
1027
|
+
dateRange: h,
|
|
1028
|
+
isDataLoaded: p,
|
|
1029
1029
|
loadBudgetData: f,
|
|
1030
|
-
setDateRange:
|
|
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:
|
|
1035
|
-
d.useEffect(() => (v(
|
|
1036
|
-
|
|
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(
|
|
1039
|
-
}, [
|
|
1040
|
-
c && (
|
|
1041
|
-
}, [c,
|
|
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
|
-
|
|
1043
|
+
B({ start: _e[0] || /* @__PURE__ */ new Date(), end: _e[1] || /* @__PURE__ */ new Date() });
|
|
1044
1044
|
}, Ne = () => {
|
|
1045
|
-
|
|
1045
|
+
i(L.BUDGETS_CLICK_FILTER);
|
|
1046
1046
|
}, fe = () => {
|
|
1047
|
-
se(!0),
|
|
1047
|
+
se(!0), i(L.BUDGETS_CLICK_ADD);
|
|
1048
1048
|
}, Pe = () => {
|
|
1049
1049
|
se(!1);
|
|
1050
|
-
}, $e = Ve(
|
|
1051
|
-
return !l || !c || !
|
|
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:
|
|
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 || !
|
|
1073
|
-
c &&
|
|
1074
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
1109
|
+
k,
|
|
1110
1110
|
{
|
|
1111
|
-
ariaLabelClose:
|
|
1111
|
+
ariaLabelClose: r.close_aria,
|
|
1112
1112
|
isOpen: Le,
|
|
1113
1113
|
onClose: () => se(!1),
|
|
1114
1114
|
title: n.add_new_title,
|