@mx-cartographer/experiences 7.11.13 → 7.11.14-alpha.bb1
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 +275 -275
- package/package.json +1 -1
package/dist/budgets/index.es.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import { jsxs as u, jsx as e, Fragment as Je } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { endOfMonth as
|
|
3
|
+
import { observer as w } from "mobx-react-lite";
|
|
4
|
+
import { endOfMonth as xe } from "date-fns/endOfMonth";
|
|
5
5
|
import { isAfter as Qe } from "date-fns/isAfter";
|
|
6
|
-
import { startOfMonth as
|
|
7
|
-
import { startOfToday as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import { startOfMonth as le } from "date-fns/startOfMonth";
|
|
7
|
+
import { startOfToday as ie } from "date-fns/startOfToday";
|
|
8
|
+
import ve from "@mui/material/Alert";
|
|
9
|
+
import Te from "@mui/material/Snackbar";
|
|
10
10
|
import x from "@mui/material/Stack";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import ue from "@mui/material/styles/useTheme";
|
|
12
|
+
import W from "@mui/material/Box";
|
|
13
13
|
import Z from "@mui/material/List";
|
|
14
|
-
import { Text as S, CategoryIcon as
|
|
15
|
-
import { u as
|
|
14
|
+
import { Text as S, CategoryIcon as H, Icon as G, H2 as Ge, H3 as je, P as Ce } from "@mxenabled/mxui";
|
|
15
|
+
import { u as D, i as E, j as me, m as q, p as ge, a as Fe, g as J, b as Q, h as ee, d as ze } from "../hooks-zu7yblbi.mjs";
|
|
16
16
|
import { f as T } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
17
|
+
import De from "@mui/material/Button";
|
|
18
|
+
import pe from "@mui/material/Divider";
|
|
19
19
|
import te from "@mui/material/ListItem";
|
|
20
|
-
import
|
|
20
|
+
import he from "@mui/material/ListItemAvatar";
|
|
21
21
|
import oe from "@mui/material/ListItemButton";
|
|
22
22
|
import ne from "@mui/material/ListItemText";
|
|
23
|
-
import { b as
|
|
23
|
+
import { b as M } from "../Localization-2MODESHW.mjs";
|
|
24
24
|
import { D as $ } from "../Drawer-DV4NTsFg.mjs";
|
|
25
25
|
import et from "@mui/material/ListItemSecondaryAction";
|
|
26
26
|
import { C as tt } from "../CurrencyInput-CDY0awYV.mjs";
|
|
27
|
-
import { D as
|
|
27
|
+
import { D as U } from "../Dialog-DdCwLgrl.mjs";
|
|
28
28
|
import { C as ot } from "../ConnectionsDrawer-c7HaKeRj.mjs";
|
|
29
|
-
import * as
|
|
29
|
+
import * as L from "d3";
|
|
30
30
|
import nt from "@mui/material/Tooltip";
|
|
31
|
-
import { useTheme as
|
|
32
|
-
import { u as
|
|
33
|
-
import { L as
|
|
34
|
-
import { E as
|
|
31
|
+
import { useTheme as Ue, alpha as at } from "@mui/material/styles";
|
|
32
|
+
import { u as fe } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
33
|
+
import { L as be } from "../Loader-D3rjKx72.mjs";
|
|
34
|
+
import { E as Se } from "../EmptyState-DHAkGsjk.mjs";
|
|
35
35
|
import { A as P } from "../Analytics-i5h6BxR1.mjs";
|
|
36
36
|
import Re from "@mui/material/Tab";
|
|
37
37
|
import rt from "@mui/material/Tabs";
|
|
38
38
|
import { e as st } from "../exportTransactionsToCSV-YXwmzmUp.mjs";
|
|
39
|
-
import { T as
|
|
39
|
+
import { T as Ee } from "../TransactionList-BibbhhS9.mjs";
|
|
40
40
|
import { T as it } from "../TransactionDetails-CCLMsk_N.mjs";
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import { S as
|
|
44
|
-
import { S as
|
|
41
|
+
import we from "@mui/material/Card";
|
|
42
|
+
import Ie from "@mui/material/CardContent";
|
|
43
|
+
import { S as Ae } from "../StatusBar-BK_uYHAB.mjs";
|
|
44
|
+
import { S as We } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
45
45
|
import { u as ct, b as lt } from "../CategorySelectorDrawer-BMmxw2oY.mjs";
|
|
46
|
-
import
|
|
46
|
+
import He from "@mui/material/CardHeader";
|
|
47
47
|
import { subDays as dt } from "date-fns/subDays";
|
|
48
48
|
import ut from "@mui/material/IconButton";
|
|
49
49
|
import { M as mt } from "../ManageIncome-LQhY19hv.mjs";
|
|
50
|
-
import { u as
|
|
50
|
+
import { u as Ve } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
|
|
51
51
|
import { W as gt } from "../WidgetContainer-sC5KLXHI.mjs";
|
|
52
52
|
import { u as pt } from "../BudgetUtil-CTpLz9lw.mjs";
|
|
53
53
|
import { M as ht } from "../MiniWidgetContainer-DhEx4qKi.mjs";
|
|
54
54
|
import { ChevronRight as ft } from "@mxenabled/mx-icons";
|
|
55
|
-
import { b as
|
|
55
|
+
import { b as Le } from "../CategoryUtil-Cufq3fxg.mjs";
|
|
56
56
|
import { S as bt } from "../StatusIndicator-0iX3Gnnu.mjs";
|
|
57
57
|
import { b as _t } from "../User-CoANIQIA.mjs";
|
|
58
58
|
import { i as yt } from "../DateUtil-CVXVMbjf.mjs";
|
|
59
59
|
import { f as Ct } from "../DateFormats-Cs-NbEZ7.mjs";
|
|
60
|
-
const St =
|
|
61
|
-
const { budgets: t } =
|
|
60
|
+
const St = w(() => {
|
|
61
|
+
const { budgets: t } = D(), { totalBudgeted: n } = E(), { incomeTotal: i } = me(), s = i - n;
|
|
62
62
|
return /* @__PURE__ */ u(x, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
63
63
|
/* @__PURE__ */ u(x, { alignItems: "center", children: [
|
|
64
64
|
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(i, "0,0") }),
|
|
@@ -75,26 +75,26 @@ const St = I(() => {
|
|
|
75
75
|
/* @__PURE__ */ e(S, { color: "secondary", variant: "Small", children: t.remaining })
|
|
76
76
|
] })
|
|
77
77
|
] });
|
|
78
|
-
}), Bt =
|
|
78
|
+
}), Bt = w(
|
|
79
79
|
({ category: t }) => {
|
|
80
|
-
const { budgets: n } =
|
|
81
|
-
const a = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"), o = a ?
|
|
80
|
+
const { budgets: n } = D(), { budgets: i } = E(), s = l.useMemo(() => {
|
|
81
|
+
const a = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"), o = a ? M(n.recalculate_previous_budget, T(a.amount, "0,0")) : n.recalculate_new_budget;
|
|
82
82
|
return `${r} - ${o}`;
|
|
83
83
|
}, [n, i]);
|
|
84
84
|
return /* @__PURE__ */ u(l.Fragment, { children: [
|
|
85
85
|
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { children: [
|
|
86
|
-
/* @__PURE__ */ e(
|
|
86
|
+
/* @__PURE__ */ e(he, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
87
87
|
/* @__PURE__ */ e(ne, { primary: t.name, secondary: s })
|
|
88
88
|
] }) }),
|
|
89
|
-
/* @__PURE__ */ e(
|
|
89
|
+
/* @__PURE__ */ e(pe, {})
|
|
90
90
|
] }, t.guid);
|
|
91
91
|
}
|
|
92
92
|
), xt = ({ onRecalculateBudgets: t }) => {
|
|
93
|
-
const { budgets: n, common: i } =
|
|
93
|
+
const { budgets: n, common: i } = D(), { spendCategories: s } = q(), { recalculateBudgets: a, setAlert: r } = E(), [o, c] = l.useState(!1), g = s.filter((m) => m.totalAverageAmount > 0), d = async () => {
|
|
94
94
|
await a(g), c(!1), r(n.alert_recalculated_budgets), t?.();
|
|
95
95
|
};
|
|
96
96
|
return /* @__PURE__ */ u(l.Fragment, { children: [
|
|
97
|
-
/* @__PURE__ */ e(
|
|
97
|
+
/* @__PURE__ */ e(De, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: n.recalculate_button }),
|
|
98
98
|
/* @__PURE__ */ e(S, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: n.recalculate_help }),
|
|
99
99
|
/* @__PURE__ */ e(
|
|
100
100
|
$,
|
|
@@ -109,24 +109,24 @@ const St = I(() => {
|
|
|
109
109
|
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: n.recalculate_description_top }),
|
|
110
110
|
/* @__PURE__ */ e(S, { variant: "ParagraphSmall", children: n.recalculate_description_bottom })
|
|
111
111
|
] }),
|
|
112
|
-
/* @__PURE__ */ e(
|
|
112
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(Z, { children: g.map((m) => /* @__PURE__ */ e(Bt, { category: m }, m.guid)) }) })
|
|
113
113
|
] })
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
] });
|
|
117
|
-
},
|
|
117
|
+
}, _e = ({
|
|
118
118
|
amount: t,
|
|
119
119
|
categoryName: n,
|
|
120
120
|
onAmountChanged: i
|
|
121
121
|
}) => {
|
|
122
|
-
const { budgets: s } =
|
|
122
|
+
const { budgets: s } = D(), { totalBudgeted: a } = E(), { incomeTotal: r } = me(), o = r - a;
|
|
123
123
|
return /* @__PURE__ */ u(x, { gap: 16, children: [
|
|
124
124
|
/* @__PURE__ */ u(x, { children: [
|
|
125
|
-
/* @__PURE__ */ e(S, { children:
|
|
125
|
+
/* @__PURE__ */ e(S, { children: M(
|
|
126
126
|
s.add_description_top,
|
|
127
127
|
T(o, "0,0")
|
|
128
128
|
) }),
|
|
129
|
-
/* @__PURE__ */ e(S, { children:
|
|
129
|
+
/* @__PURE__ */ e(S, { children: M(s.add_description_bottom, n) })
|
|
130
130
|
] }),
|
|
131
131
|
/* @__PURE__ */ e(
|
|
132
132
|
tt,
|
|
@@ -140,13 +140,13 @@ const St = I(() => {
|
|
|
140
140
|
}
|
|
141
141
|
)
|
|
142
142
|
] });
|
|
143
|
-
}, At =
|
|
144
|
-
const { budgets: i, common: s } =
|
|
143
|
+
}, At = w(({ category: t, onAddBudget: n }) => {
|
|
144
|
+
const { budgets: i, common: s } = D(), [a, r] = l.useState(!1), [o, c] = l.useState(
|
|
145
145
|
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
146
146
|
);
|
|
147
147
|
return /* @__PURE__ */ u(l.Fragment, { children: [
|
|
148
148
|
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { onClick: () => r(!0), children: [
|
|
149
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(he, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
|
|
150
150
|
/* @__PURE__ */ e(
|
|
151
151
|
ne,
|
|
152
152
|
{
|
|
@@ -154,10 +154,10 @@ const St = I(() => {
|
|
|
154
154
|
secondary: T(t.totalAmount, "0,0")
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
|
-
/* @__PURE__ */ e(et, { children: /* @__PURE__ */ e(
|
|
157
|
+
/* @__PURE__ */ e(et, { children: /* @__PURE__ */ e(G, { name: "add", size: 20 }) })
|
|
158
158
|
] }) }, t.guid),
|
|
159
159
|
/* @__PURE__ */ e(
|
|
160
|
-
|
|
160
|
+
U,
|
|
161
161
|
{
|
|
162
162
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
163
163
|
disablePrimaryButton: Number(o) <= 0,
|
|
@@ -165,17 +165,17 @@ const St = I(() => {
|
|
|
165
165
|
onClose: () => r(!1),
|
|
166
166
|
onPrimaryAction: () => n(t, Number(o)),
|
|
167
167
|
primaryText: i.add_save_button,
|
|
168
|
-
children: /* @__PURE__ */ e(
|
|
168
|
+
children: /* @__PURE__ */ e(_e, { amount: o, categoryName: t.name, onAmountChanged: c })
|
|
169
169
|
}
|
|
170
170
|
)
|
|
171
171
|
] });
|
|
172
|
-
}),
|
|
173
|
-
const { budgets: i } =
|
|
174
|
-
await s(c, g), t?.(), a(
|
|
172
|
+
}), Ke = w(({ onAddBudget: t, onRecalculateBudgets: n }) => {
|
|
173
|
+
const { budgets: i } = D(), { addBudget: s, setAlert: a, unbudgetedCategories: r } = E(), o = async (c, g) => {
|
|
174
|
+
await s(c, g), t?.(), a(M(i.alert_budget_created, c.name));
|
|
175
175
|
};
|
|
176
176
|
return /* @__PURE__ */ u(x, { children: [
|
|
177
177
|
/* @__PURE__ */ e(St, {}),
|
|
178
|
-
/* @__PURE__ */ e(
|
|
178
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(Z, { children: r.map((c) => /* @__PURE__ */ e(
|
|
179
179
|
At,
|
|
180
180
|
{
|
|
181
181
|
category: c,
|
|
@@ -185,7 +185,7 @@ const St = I(() => {
|
|
|
185
185
|
)) }) }),
|
|
186
186
|
/* @__PURE__ */ e(xt, { onRecalculateBudgets: n })
|
|
187
187
|
] });
|
|
188
|
-
}),
|
|
188
|
+
}), Ne = 5, Xe = 100, de = 25, vt = (t) => {
|
|
189
189
|
const n = (a) => {
|
|
190
190
|
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
191
191
|
}, i = (a) => {
|
|
@@ -193,62 +193,62 @@ const St = I(() => {
|
|
|
193
193
|
}, s = (a) => {
|
|
194
194
|
a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
|
|
195
195
|
};
|
|
196
|
-
return
|
|
196
|
+
return L.drag().on("start", n).on("drag", i).on("end", s);
|
|
197
197
|
}, Tt = (t) => {
|
|
198
198
|
let n = t.transaction_total / t.amount;
|
|
199
199
|
n < 0 ? n = 0 : n > 1 && (n = 1);
|
|
200
|
-
const i = n * 2 * Math.PI, s =
|
|
200
|
+
const i = n * 2 * Math.PI, s = L.interpolate(0, i), a = L.arc().cornerRadius(5).innerRadius(t.radius - Ne * 2).outerRadius(t.radius - Ne).startAngle(0).endAngle(0);
|
|
201
201
|
return (r) => (a.endAngle(s(r)), a(t) || "");
|
|
202
202
|
}, Dt = (t) => {
|
|
203
|
-
|
|
204
|
-
},
|
|
203
|
+
L.selectAll(".bubble").call(vt(t));
|
|
204
|
+
}, ke = (t, n, i) => Math.min(Math.max(t, n), i), Et = (t, n, i) => {
|
|
205
205
|
t.alpha(1).restart().force(
|
|
206
206
|
"x",
|
|
207
|
-
|
|
207
|
+
L.forceX().x(i / 2).strength(0.01)
|
|
208
208
|
).force(
|
|
209
209
|
"y",
|
|
210
|
-
|
|
210
|
+
L.forceY().y(n / 2).strength(0.02)
|
|
211
211
|
).on("tick", () => {
|
|
212
212
|
const s = t.nodes();
|
|
213
213
|
s.forEach((a) => {
|
|
214
|
-
const r = a.radius ??
|
|
215
|
-
a.x =
|
|
216
|
-
}),
|
|
214
|
+
const r = a.radius ?? de;
|
|
215
|
+
a.x = ke(a.x ?? 0, r, i - r), a.y = ke(a.y ?? 0, r, n - r);
|
|
216
|
+
}), L.selectAll(".bubble").data(s).attr("transform", (a) => `translate(${a.x},${a.y})`);
|
|
217
217
|
});
|
|
218
|
-
},
|
|
218
|
+
}, Ye = (t, n) => L.scaleLinear().domain([t, n]).range([de, Xe]), wt = (t) => {
|
|
219
219
|
const n = t.reduce((r, o) => {
|
|
220
220
|
const c = Math.max(o.transaction_total, o.amount);
|
|
221
221
|
return c > r ? c : r;
|
|
222
222
|
}, 0), i = t.reduce((r, o) => {
|
|
223
223
|
const c = Math.max(o.transaction_total, o.amount);
|
|
224
224
|
return c < r ? c : r;
|
|
225
|
-
}, n), s =
|
|
225
|
+
}, n), s = Ye(i, n), a = t.map((r) => {
|
|
226
226
|
const o = s(Math.max(r.transaction_total, r.amount)) || 25;
|
|
227
227
|
return {
|
|
228
228
|
...r,
|
|
229
229
|
radius: o
|
|
230
230
|
};
|
|
231
231
|
});
|
|
232
|
-
return
|
|
232
|
+
return L.forceSimulation(a).velocityDecay(0.05).force("collide", L.forceCollide((r) => r.radius + 2).strength(0.7));
|
|
233
233
|
}, It = (t, n, i) => {
|
|
234
|
-
const a = Math.PI *
|
|
235
|
-
let m =
|
|
234
|
+
const a = Math.PI * de ** 2 * t, r = i < 400 || n < 300, o = r ? 40 : 20, c = Math.max(100, i - o), g = Math.max(100, n - o), d = c * g;
|
|
235
|
+
let m = de;
|
|
236
236
|
if (a < d) {
|
|
237
237
|
const h = Math.sqrt(d / (t * Math.PI)), _ = Math.min(c, g) / 4;
|
|
238
|
-
m = Math.min(
|
|
238
|
+
m = Math.min(Xe, h, _);
|
|
239
239
|
}
|
|
240
240
|
return r && t <= 3 && (m = Math.min(m, 45)), { minRadius: Math.max(20, m * 0.6), maxRadius: m };
|
|
241
241
|
}, Ot = (t, n, i, s, a) => {
|
|
242
242
|
const { maxRadius: r, minRadius: o } = It(t, n, a);
|
|
243
|
-
return
|
|
244
|
-
},
|
|
245
|
-
const r = n.map((d) => Math.max(d.transaction_total, d.amount)), o = Math.min(...r), c = Math.max(...r), g = i ? Ot(t.length, s, c, o, a) :
|
|
243
|
+
return L.scaleLinear().domain([s, i]).range([o, r]);
|
|
244
|
+
}, Mt = (t, n, i = !1, s, a) => {
|
|
245
|
+
const r = n.map((d) => Math.max(d.transaction_total, d.amount)), o = Math.min(...r), c = Math.max(...r), g = i ? Ot(t.length, s, c, o, a) : Ye(o, c);
|
|
246
246
|
return t.map((d) => ({
|
|
247
247
|
...d,
|
|
248
248
|
radius: g(Math.max(d.transaction_total, d.amount))
|
|
249
249
|
}));
|
|
250
|
-
},
|
|
251
|
-
const n =
|
|
250
|
+
}, $e = 5, Rt = 2e3, Lt = ({ bubble: t }) => {
|
|
251
|
+
const n = ue(), {
|
|
252
252
|
amount: i,
|
|
253
253
|
guid: s,
|
|
254
254
|
budgetColors: { mercury: a },
|
|
@@ -256,9 +256,9 @@ const St = I(() => {
|
|
|
256
256
|
transaction_total: o
|
|
257
257
|
} = t, c = `mercury-${s}`;
|
|
258
258
|
l.useEffect(() => {
|
|
259
|
-
|
|
259
|
+
L.select(`.${c}`).selectAll(".status").remove(), L.select(`.${c}`).append("path").transition().duration(Rt).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => Tt(t));
|
|
260
260
|
}, [i, r, o]);
|
|
261
|
-
const g =
|
|
261
|
+
const g = L.arc().innerRadius((d) => d - 2 * $e).outerRadius((d) => d - $e).startAngle(0).endAngle(2 * Math.PI);
|
|
262
262
|
return /* @__PURE__ */ e("g", { className: c, children: /* @__PURE__ */ e(
|
|
263
263
|
"path",
|
|
264
264
|
{
|
|
@@ -266,10 +266,10 @@ const St = I(() => {
|
|
|
266
266
|
style: { fill: n.palette.common.white, fillOpacity: 0.35 }
|
|
267
267
|
}
|
|
268
268
|
) });
|
|
269
|
-
}, Nt = l.memo(Lt),
|
|
269
|
+
}, Nt = l.memo(Lt), z = 75, Be = 50;
|
|
270
270
|
function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
271
271
|
} }) {
|
|
272
|
-
const [s, a] = l.useState(!1), r =
|
|
272
|
+
const [s, a] = l.useState(!1), r = Ue(), { availableWidth: o } = ge(), c = l.useMemo(() => {
|
|
273
273
|
if (t)
|
|
274
274
|
return {
|
|
275
275
|
amount: t.amount,
|
|
@@ -290,21 +290,21 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
290
290
|
y: v
|
|
291
291
|
} = t, A = o < 400 ? -8 : -12;
|
|
292
292
|
let b = A, y = A;
|
|
293
|
-
f >
|
|
293
|
+
f > z ? (b = -14, y = -45) : f > Be && (y = -32);
|
|
294
294
|
let B = 32;
|
|
295
|
-
f <=
|
|
296
|
-
const
|
|
295
|
+
f <= z && (B = o < 400 ? 16 : 24);
|
|
296
|
+
const I = `${t.category.name}: ${_}`, N = {
|
|
297
297
|
modifiers: [
|
|
298
298
|
{
|
|
299
299
|
name: "offset",
|
|
300
300
|
options: { offset: [0, 15] }
|
|
301
301
|
}
|
|
302
302
|
]
|
|
303
|
-
},
|
|
304
|
-
(
|
|
305
|
-
},
|
|
303
|
+
}, R = (k) => {
|
|
304
|
+
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), i(t));
|
|
305
|
+
}, O = () => {
|
|
306
306
|
a(!0);
|
|
307
|
-
},
|
|
307
|
+
}, j = () => {
|
|
308
308
|
a(!1);
|
|
309
309
|
};
|
|
310
310
|
return /* @__PURE__ */ u(
|
|
@@ -313,10 +313,10 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
313
313
|
"aria-label": `${p} - ${_}`,
|
|
314
314
|
className: "bubble",
|
|
315
315
|
id: `bubble-${h}`,
|
|
316
|
-
onBlur:
|
|
316
|
+
onBlur: j,
|
|
317
317
|
onClick: () => i(t),
|
|
318
|
-
onFocus:
|
|
319
|
-
onKeyDown:
|
|
318
|
+
onFocus: O,
|
|
319
|
+
onKeyDown: R,
|
|
320
320
|
onMouseEnter: () => a(!0),
|
|
321
321
|
onMouseLeave: () => a(!1),
|
|
322
322
|
role: "button",
|
|
@@ -338,9 +338,9 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
338
338
|
stroke-opacity: 0.8;
|
|
339
339
|
}
|
|
340
340
|
` }),
|
|
341
|
-
/* @__PURE__ */ e(nt, { open: s, slotProps: { popper:
|
|
342
|
-
/* @__PURE__ */ e("svg", { x: b, y, children: /* @__PURE__ */ e(
|
|
343
|
-
f >
|
|
341
|
+
/* @__PURE__ */ e(nt, { open: s, slotProps: { popper: N }, title: I, children: /* @__PURE__ */ e("circle", { fill: g, id: `circle-${h}`, r: f }) }),
|
|
342
|
+
/* @__PURE__ */ e("svg", { x: b, y, children: /* @__PURE__ */ e(G, { name: m, size: B, sx: { fill: d } }) }),
|
|
343
|
+
f > z && /* @__PURE__ */ e(
|
|
344
344
|
S,
|
|
345
345
|
{
|
|
346
346
|
bold: !0,
|
|
@@ -352,7 +352,7 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
352
352
|
children: p
|
|
353
353
|
}
|
|
354
354
|
),
|
|
355
|
-
f >
|
|
355
|
+
f > Be && /* @__PURE__ */ e(
|
|
356
356
|
S,
|
|
357
357
|
{
|
|
358
358
|
bold: !0,
|
|
@@ -360,11 +360,11 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
360
360
|
id: `budget-description-${h}-1`,
|
|
361
361
|
sx: { fill: d },
|
|
362
362
|
variant: "Body",
|
|
363
|
-
y: f <=
|
|
364
|
-
children: f <=
|
|
363
|
+
y: f <= z ? 12 : 24,
|
|
364
|
+
children: f <= z ? _.split(" ")[0] : _
|
|
365
365
|
}
|
|
366
366
|
),
|
|
367
|
-
f <=
|
|
367
|
+
f <= z && f > Be && /* @__PURE__ */ e(
|
|
368
368
|
S,
|
|
369
369
|
{
|
|
370
370
|
component: "text",
|
|
@@ -388,7 +388,7 @@ const $t = ({
|
|
|
388
388
|
onClick: s = () => {
|
|
389
389
|
}
|
|
390
390
|
}) => {
|
|
391
|
-
const [a, r] = l.useState([]), o = l.useRef(null), c = l.useRef(!1), { detailedBudgets: g } =
|
|
391
|
+
const [a, r] = l.useState([]), o = l.useRef(null), c = l.useRef(!1), { detailedBudgets: g } = E(), d = l.useCallback(() => {
|
|
392
392
|
const m = o.current, p = wt(g), h = p.nodes();
|
|
393
393
|
if (m) {
|
|
394
394
|
const _ = m.nodes(), f = new Map(_.map((C) => [C.guid, C]));
|
|
@@ -411,23 +411,23 @@ const $t = ({
|
|
|
411
411
|
}, []), l.useEffect(() => {
|
|
412
412
|
const m = o.current;
|
|
413
413
|
if (!m) return;
|
|
414
|
-
const p = m.nodes(), h = n > 0 && n < 450 || t > 0 && t < 300, _ =
|
|
414
|
+
const p = m.nodes(), h = n > 0 && n < 450 || t > 0 && t < 300, _ = Mt(p, g, h, t, n);
|
|
415
415
|
m.nodes(_), Et(m, t, n), i && setTimeout(() => {
|
|
416
416
|
Dt(m);
|
|
417
417
|
}, 0), r([..._]);
|
|
418
418
|
}, [t, n, i, g]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(n), children: a.map((m) => /* @__PURE__ */ e(kt, { bubble: m, isDraggable: i, onClick: s }, m.guid)) });
|
|
419
|
-
}, Pt =
|
|
419
|
+
}, Pt = w($t), Gt = ({
|
|
420
420
|
isMiniWidget: t = !1,
|
|
421
421
|
onConnectAccountsClick: n,
|
|
422
422
|
createBudgetOnClick: i
|
|
423
423
|
}) => {
|
|
424
|
-
const { config: s } =
|
|
424
|
+
const { config: s } = Fe(), { recalculateBudgets: a } = E(), { spendCategories: r } = q(), { budgets: o } = D(), { availableWidth: c } = ge(), { isMobile: g } = fe(c), d = t && g, [m, p] = l.useState(!1), [h, _] = l.useState(!1), [f, C] = l.useState(!1), v = l.useMemo(() => [...r.filter((b) => b.totalAverageAmount > 0)], [r]), A = async () => {
|
|
425
425
|
C(!0);
|
|
426
426
|
const { data: b, isSuccess: y } = await a(v);
|
|
427
427
|
C(!1), y ? (b.length === 0 && _(!0), p(!1)) : p(!0);
|
|
428
428
|
};
|
|
429
|
-
return f ? /* @__PURE__ */ e(
|
|
430
|
-
|
|
429
|
+
return f ? /* @__PURE__ */ e(be, {}) : m ? /* @__PURE__ */ e(
|
|
430
|
+
Se,
|
|
431
431
|
{
|
|
432
432
|
header: o.autogenerate_budgets_error_header,
|
|
433
433
|
icon: "error",
|
|
@@ -448,7 +448,7 @@ const $t = ({
|
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
) : /* @__PURE__ */ e(Je, { children: h ? /* @__PURE__ */ e(
|
|
451
|
-
|
|
451
|
+
Se,
|
|
452
452
|
{
|
|
453
453
|
header: o.zero_state_generate_budgets_header,
|
|
454
454
|
icon: "error",
|
|
@@ -473,7 +473,7 @@ const $t = ({
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
) : /* @__PURE__ */ e(
|
|
476
|
-
|
|
476
|
+
Se,
|
|
477
477
|
{
|
|
478
478
|
header: o.create_budgets_title,
|
|
479
479
|
icon: "bubble_chart",
|
|
@@ -498,7 +498,7 @@ const $t = ({
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
) });
|
|
501
|
-
},
|
|
501
|
+
}, Ze = w(
|
|
502
502
|
({
|
|
503
503
|
createBudgetOnClick: t = () => {
|
|
504
504
|
},
|
|
@@ -508,7 +508,7 @@ const $t = ({
|
|
|
508
508
|
shouldShowZeroState: a,
|
|
509
509
|
unavailableWidth: r = 24
|
|
510
510
|
}) => {
|
|
511
|
-
const { onEvent: o } = J(), { setSelectedBudget: c } =
|
|
511
|
+
const { onEvent: o } = J(), { setSelectedBudget: c } = E(), { isInitialized: g } = Q(), { accounts: d } = D(), { availableWidth: m } = ge(), { isMobile: p } = fe(), [h, _] = l.useState(!1), f = l.useMemo(() => m - r, [m]), C = (A) => {
|
|
512
512
|
c(A), o(P.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
513
513
|
budget_category: A.category.name,
|
|
514
514
|
click_type: "bubble"
|
|
@@ -517,7 +517,7 @@ const $t = ({
|
|
|
517
517
|
_(!0), o(P.ACCOUNTS_CLICK_CONNECT);
|
|
518
518
|
};
|
|
519
519
|
return /* @__PURE__ */ u(
|
|
520
|
-
|
|
520
|
+
W,
|
|
521
521
|
{
|
|
522
522
|
ml: a || p ? 0 : 24,
|
|
523
523
|
sx: { alignSelf: "center", ...s && { height: "100%" } },
|
|
@@ -550,7 +550,7 @@ const $t = ({
|
|
|
550
550
|
}
|
|
551
551
|
);
|
|
552
552
|
}
|
|
553
|
-
),
|
|
553
|
+
), qe = ({ budget: t }) => {
|
|
554
554
|
const {
|
|
555
555
|
amount: n,
|
|
556
556
|
budgetColors: { background: i },
|
|
@@ -564,29 +564,29 @@ const $t = ({
|
|
|
564
564
|
percentage: `${r}%`
|
|
565
565
|
}
|
|
566
566
|
];
|
|
567
|
-
return /* @__PURE__ */ e(
|
|
568
|
-
/* @__PURE__ */ e(
|
|
569
|
-
/* @__PURE__ */ e(
|
|
567
|
+
return /* @__PURE__ */ e(we, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(Ie, { children: /* @__PURE__ */ u(x, { alignItems: "center", gap: 16, children: [
|
|
568
|
+
/* @__PURE__ */ e(H, { categoryGuid: a, size: 56 }),
|
|
569
|
+
/* @__PURE__ */ e(Ge, { variant: "H1", children: `${T(o, "0,0")} / ${T(n, "0,0")}` }),
|
|
570
570
|
/* @__PURE__ */ e(S, { bold: !0, variant: "XSmall", children: s }),
|
|
571
|
-
/* @__PURE__ */ e(
|
|
571
|
+
/* @__PURE__ */ e(Ae, { data: c, height: 10 })
|
|
572
572
|
] }) }) });
|
|
573
|
-
}, jt =
|
|
574
|
-
const { budgets: t } =
|
|
573
|
+
}, jt = w(() => {
|
|
574
|
+
const { budgets: t } = D();
|
|
575
575
|
return /* @__PURE__ */ u(x, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
576
|
-
/* @__PURE__ */ e(
|
|
576
|
+
/* @__PURE__ */ e(G, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
577
577
|
/* @__PURE__ */ e(S, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
|
|
578
578
|
/* @__PURE__ */ e(S, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
|
|
579
579
|
] });
|
|
580
|
-
}), Ft =
|
|
580
|
+
}), Ft = w(({ budget: t }) => {
|
|
581
581
|
const {
|
|
582
582
|
amount: n,
|
|
583
583
|
budgetColors: { background: i },
|
|
584
584
|
category: s,
|
|
585
585
|
percentage: a,
|
|
586
586
|
transaction_total: r
|
|
587
|
-
} = t, { setSelectedSubBudget: o } =
|
|
587
|
+
} = t, { setSelectedSubBudget: o } = E();
|
|
588
588
|
return /* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { onClick: () => o(t), children: [
|
|
589
|
-
/* @__PURE__ */ e(
|
|
589
|
+
/* @__PURE__ */ e(he, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(We, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
|
590
590
|
/* @__PURE__ */ e(
|
|
591
591
|
ne,
|
|
592
592
|
{
|
|
@@ -598,8 +598,8 @@ const $t = ({
|
|
|
598
598
|
}
|
|
599
599
|
)
|
|
600
600
|
] }) });
|
|
601
|
-
}), zt =
|
|
602
|
-
const { budgets: i, common: s } =
|
|
601
|
+
}), zt = w(({ category: t, parentBudget: n }) => {
|
|
602
|
+
const { budgets: i, common: s } = D(), { setExpandedGuid: a, setOnSelect: r } = ct(), { addBudget: o } = E(), [c, g] = l.useState(!1), [d, m] = l.useState(!1), [p, h] = l.useState(""), [_, f] = l.useState(void 0);
|
|
603
603
|
l.useEffect(() => {
|
|
604
604
|
r((A) => {
|
|
605
605
|
const b = t.subCategories.find((y) => y.guid === A);
|
|
@@ -611,15 +611,15 @@ const $t = ({
|
|
|
611
611
|
}, v = async () => {
|
|
612
612
|
_ && Number(p) > 0 && (await o(_, Number(p), n.guid), m(!1), g(!1), f(void 0));
|
|
613
613
|
};
|
|
614
|
-
return /* @__PURE__ */ u(
|
|
614
|
+
return /* @__PURE__ */ u(W, { children: [
|
|
615
615
|
/* @__PURE__ */ e(te, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(oe, { onClick: C, children: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ u(x, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
616
616
|
/* @__PURE__ */ u(x, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
617
|
-
/* @__PURE__ */ e(
|
|
617
|
+
/* @__PURE__ */ e(G, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
618
618
|
/* @__PURE__ */ e(S, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
|
|
619
619
|
] }),
|
|
620
|
-
/* @__PURE__ */ e(
|
|
620
|
+
/* @__PURE__ */ e(G, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
621
621
|
] }) }) }) }),
|
|
622
|
-
/* @__PURE__ */ e(
|
|
622
|
+
/* @__PURE__ */ e(pe, {}),
|
|
623
623
|
/* @__PURE__ */ e(
|
|
624
624
|
$,
|
|
625
625
|
{
|
|
@@ -631,7 +631,7 @@ const $t = ({
|
|
|
631
631
|
}
|
|
632
632
|
),
|
|
633
633
|
/* @__PURE__ */ e(
|
|
634
|
-
|
|
634
|
+
U,
|
|
635
635
|
{
|
|
636
636
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
637
637
|
disablePrimaryButton: Number(p) <= 0,
|
|
@@ -640,7 +640,7 @@ const $t = ({
|
|
|
640
640
|
onPrimaryAction: v,
|
|
641
641
|
primaryText: i.add_save_button,
|
|
642
642
|
children: /* @__PURE__ */ e(
|
|
643
|
-
|
|
643
|
+
_e,
|
|
644
644
|
{
|
|
645
645
|
amount: p,
|
|
646
646
|
categoryName: _?.name || "",
|
|
@@ -650,8 +650,8 @@ const $t = ({
|
|
|
650
650
|
}
|
|
651
651
|
)
|
|
652
652
|
] });
|
|
653
|
-
}), Ut =
|
|
654
|
-
const { category: n, subBudgets: i } = t, { budgets: s, common: a } =
|
|
653
|
+
}), Ut = w(({ budget: t }) => {
|
|
654
|
+
const { category: n, subBudgets: i } = t, { budgets: s, common: a } = D(), { deleteBudget: r, selectedSubBudget: o, setSelectedSubBudget: c, updateBudget: g } = E(), { filter: d, setFilter: m } = ee(), [p, h] = l.useState(!1), [_, f] = l.useState(!1), [C, v] = l.useState("");
|
|
655
655
|
l.useEffect(() => {
|
|
656
656
|
o && (v(`${o.amount}`), m({
|
|
657
657
|
...d,
|
|
@@ -675,7 +675,7 @@ const $t = ({
|
|
|
675
675
|
/* @__PURE__ */ u(Z, { sx: { bgcolor: "background.paper" }, children: [
|
|
676
676
|
i.length === 0 ? /* @__PURE__ */ e(jt, {}) : i.map((B) => /* @__PURE__ */ u(l.Fragment, { children: [
|
|
677
677
|
/* @__PURE__ */ e(Ft, { budget: B }),
|
|
678
|
-
/* @__PURE__ */ e(
|
|
678
|
+
/* @__PURE__ */ e(pe, {})
|
|
679
679
|
] }, B.guid)),
|
|
680
680
|
/* @__PURE__ */ e(zt, { category: n, parentBudget: t })
|
|
681
681
|
] }),
|
|
@@ -691,14 +691,14 @@ const $t = ({
|
|
|
691
691
|
secondaryText: s.details_delete_button,
|
|
692
692
|
title: s.details_title,
|
|
693
693
|
children: o && /* @__PURE__ */ u(x, { gap: 24, children: [
|
|
694
|
-
/* @__PURE__ */ e(
|
|
695
|
-
/* @__PURE__ */ e(
|
|
694
|
+
/* @__PURE__ */ e(qe, { budget: o }),
|
|
695
|
+
/* @__PURE__ */ e(Ee, { height: "100%" })
|
|
696
696
|
] })
|
|
697
697
|
}
|
|
698
698
|
),
|
|
699
699
|
o && /* @__PURE__ */ u(l.Fragment, { children: [
|
|
700
700
|
/* @__PURE__ */ e(
|
|
701
|
-
|
|
701
|
+
U,
|
|
702
702
|
{
|
|
703
703
|
copy: { close_aria: a.close_aria, title: s.details_edit_title },
|
|
704
704
|
disablePrimaryButton: Number(C) <= 0,
|
|
@@ -707,7 +707,7 @@ const $t = ({
|
|
|
707
707
|
onPrimaryAction: A,
|
|
708
708
|
primaryText: s.edit_save_button,
|
|
709
709
|
children: /* @__PURE__ */ e(
|
|
710
|
-
|
|
710
|
+
_e,
|
|
711
711
|
{
|
|
712
712
|
amount: C,
|
|
713
713
|
categoryName: o.category.name,
|
|
@@ -717,7 +717,7 @@ const $t = ({
|
|
|
717
717
|
}
|
|
718
718
|
),
|
|
719
719
|
/* @__PURE__ */ e(
|
|
720
|
-
|
|
720
|
+
U,
|
|
721
721
|
{
|
|
722
722
|
copy: { close_aria: a.close_aria, title: s.delete_title },
|
|
723
723
|
isOpen: _,
|
|
@@ -726,26 +726,26 @@ const $t = ({
|
|
|
726
726
|
primaryColor: "error",
|
|
727
727
|
primaryText: "Delete",
|
|
728
728
|
secondaryColor: "secondary",
|
|
729
|
-
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children:
|
|
729
|
+
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children: M(s.delete_description, o.category.name) })
|
|
730
730
|
}
|
|
731
731
|
)
|
|
732
732
|
] })
|
|
733
733
|
] });
|
|
734
|
-
}), Wt =
|
|
735
|
-
const { is_mobile_webview: n } =
|
|
734
|
+
}), Wt = w(({ budget: t }) => {
|
|
735
|
+
const { is_mobile_webview: n } = Fe(), { setAlert: i } = E(), { budgets: s, common: a, transactions: r } = D(), { isDesktop: o, isSmallTablet: c, isTablet: g } = fe(), {
|
|
736
736
|
sortedTransactions: d,
|
|
737
737
|
sortedTransactionsWithSplits: m,
|
|
738
738
|
tags: p
|
|
739
739
|
} = ee(), [h, _] = l.useState(0), [f, C] = l.useState(""), v = l.useMemo(
|
|
740
740
|
() => d.find((B) => B.guid === f),
|
|
741
741
|
[f, d]
|
|
742
|
-
), A = (B,
|
|
743
|
-
_(
|
|
742
|
+
), A = (B, I) => {
|
|
743
|
+
_(I);
|
|
744
744
|
}, b = () => {
|
|
745
745
|
st(m, p), i(s.alert_csv_downloaded);
|
|
746
746
|
}, y = d.length > 0 && !n && (o || g && !c);
|
|
747
747
|
return /* @__PURE__ */ u(x, { gap: 24, children: [
|
|
748
|
-
/* @__PURE__ */ e(
|
|
748
|
+
/* @__PURE__ */ e(qe, { budget: t }),
|
|
749
749
|
/* @__PURE__ */ u(x, { children: [
|
|
750
750
|
/* @__PURE__ */ u(
|
|
751
751
|
rt,
|
|
@@ -763,15 +763,15 @@ const $t = ({
|
|
|
763
763
|
),
|
|
764
764
|
h === 0 && /* @__PURE__ */ u(x, { children: [
|
|
765
765
|
y && /* @__PURE__ */ e(x, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
766
|
-
|
|
766
|
+
De,
|
|
767
767
|
{
|
|
768
768
|
onClick: b,
|
|
769
|
-
startIcon: /* @__PURE__ */ e(
|
|
769
|
+
startIcon: /* @__PURE__ */ e(G, { name: "ios_share" }),
|
|
770
770
|
variant: "text",
|
|
771
771
|
children: r.export_csv_btn
|
|
772
772
|
}
|
|
773
773
|
) }),
|
|
774
|
-
/* @__PURE__ */ e(
|
|
774
|
+
/* @__PURE__ */ e(Ee, { height: "100%", onClick: C })
|
|
775
775
|
] }),
|
|
776
776
|
h === 1 && /* @__PURE__ */ e(Ut, { budget: t }),
|
|
777
777
|
/* @__PURE__ */ e(
|
|
@@ -786,8 +786,8 @@ const $t = ({
|
|
|
786
786
|
)
|
|
787
787
|
] })
|
|
788
788
|
] });
|
|
789
|
-
}), Ht =
|
|
790
|
-
const { selectedAccountGuids: t } = Q(), { budgets: n, common: i } =
|
|
789
|
+
}), Ht = w(() => {
|
|
790
|
+
const { selectedAccountGuids: t } = Q(), { budgets: n, common: i } = D(), {
|
|
791
791
|
alert: s,
|
|
792
792
|
dateRange: a,
|
|
793
793
|
deleteBudget: r,
|
|
@@ -796,12 +796,12 @@ const $t = ({
|
|
|
796
796
|
setAlert: g,
|
|
797
797
|
setSelectedBudget: d,
|
|
798
798
|
updateBudget: m
|
|
799
|
-
} =
|
|
799
|
+
} = E(), { setFilter: p } = ee(), [h, _] = l.useState(!1), [f, C] = l.useState(!1), [v, A] = l.useState(!1), [b, y] = l.useState("");
|
|
800
800
|
l.useEffect(() => {
|
|
801
801
|
o && !c && (y(`${o.amount}`), _(!0), p({
|
|
802
802
|
accounts: t,
|
|
803
803
|
dateRange: a,
|
|
804
|
-
custom: (
|
|
804
|
+
custom: (O) => O.category_guid === o.category_guid || O.top_level_category_guid === o.category_guid,
|
|
805
805
|
showSplits: !0
|
|
806
806
|
}));
|
|
807
807
|
}, [o]);
|
|
@@ -810,14 +810,14 @@ const $t = ({
|
|
|
810
810
|
...o,
|
|
811
811
|
amount: Number(b),
|
|
812
812
|
percentage: o.category.totalAmount / Number(b) * 100
|
|
813
|
-
}), C(!1), g(
|
|
814
|
-
},
|
|
815
|
-
o && (await r(o.guid), g(
|
|
816
|
-
},
|
|
813
|
+
}), C(!1), g(M(n.alert_budget_updated, o.category.name)));
|
|
814
|
+
}, I = async () => {
|
|
815
|
+
o && (await r(o.guid), g(M(n.alert_budget_deleted, o.category.name))), N();
|
|
816
|
+
}, N = () => {
|
|
817
817
|
_(!1), setTimeout(() => {
|
|
818
818
|
d(void 0);
|
|
819
819
|
}, 250);
|
|
820
|
-
},
|
|
820
|
+
}, R = () => {
|
|
821
821
|
C(!1), y(`${o?.amount}`);
|
|
822
822
|
};
|
|
823
823
|
if (o)
|
|
@@ -827,7 +827,7 @@ const $t = ({
|
|
|
827
827
|
{
|
|
828
828
|
ariaLabelClose: i.close_aria,
|
|
829
829
|
isOpen: h,
|
|
830
|
-
onClose:
|
|
830
|
+
onClose: N,
|
|
831
831
|
onPrimaryAction: () => C(!0),
|
|
832
832
|
onSecondaryAction: () => A(!0),
|
|
833
833
|
primaryText: n.details_edit_button,
|
|
@@ -837,30 +837,30 @@ const $t = ({
|
|
|
837
837
|
children: [
|
|
838
838
|
/* @__PURE__ */ e(Wt, { budget: o }),
|
|
839
839
|
/* @__PURE__ */ e(
|
|
840
|
-
|
|
840
|
+
Te,
|
|
841
841
|
{
|
|
842
842
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
843
843
|
autoHideDuration: 3500,
|
|
844
844
|
onClose: () => g(""),
|
|
845
845
|
open: !!s,
|
|
846
|
-
children: /* @__PURE__ */ e(
|
|
846
|
+
children: /* @__PURE__ */ e(ve, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children: s })
|
|
847
847
|
}
|
|
848
848
|
)
|
|
849
849
|
]
|
|
850
850
|
}
|
|
851
851
|
),
|
|
852
852
|
/* @__PURE__ */ e(
|
|
853
|
-
|
|
853
|
+
U,
|
|
854
854
|
{
|
|
855
855
|
copy: { close_aria: i.close_aria, title: n.details_edit_title },
|
|
856
856
|
disablePrimaryButton: Number(b) <= 0,
|
|
857
857
|
isOpen: f,
|
|
858
|
-
onClose:
|
|
858
|
+
onClose: R,
|
|
859
859
|
onPrimaryAction: B,
|
|
860
|
-
onSecondaryAction:
|
|
860
|
+
onSecondaryAction: R,
|
|
861
861
|
primaryText: n.edit_save_button,
|
|
862
862
|
children: /* @__PURE__ */ e(
|
|
863
|
-
|
|
863
|
+
_e,
|
|
864
864
|
{
|
|
865
865
|
amount: b,
|
|
866
866
|
categoryName: o.category.name,
|
|
@@ -870,16 +870,16 @@ const $t = ({
|
|
|
870
870
|
}
|
|
871
871
|
),
|
|
872
872
|
/* @__PURE__ */ e(
|
|
873
|
-
|
|
873
|
+
U,
|
|
874
874
|
{
|
|
875
875
|
copy: { close_aria: i.close_aria, title: n.delete_title },
|
|
876
876
|
isOpen: v,
|
|
877
877
|
onClose: () => A(!1),
|
|
878
|
-
onPrimaryAction:
|
|
878
|
+
onPrimaryAction: I,
|
|
879
879
|
primaryColor: "error",
|
|
880
880
|
primaryText: n.details_delete_button,
|
|
881
881
|
secondaryColor: "secondary",
|
|
882
|
-
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children:
|
|
882
|
+
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children: M(n.delete_description, o.category.name) })
|
|
883
883
|
}
|
|
884
884
|
)
|
|
885
885
|
] });
|
|
@@ -894,7 +894,7 @@ const $t = ({
|
|
|
894
894
|
transaction_total: d
|
|
895
895
|
} = t;
|
|
896
896
|
return /* @__PURE__ */ e(te, { children: /* @__PURE__ */ u(oe, { onClick: () => n?.(t), children: [
|
|
897
|
-
/* @__PURE__ */ e(
|
|
897
|
+
/* @__PURE__ */ e(he, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(We, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: r, variant: "basic" }) }) }),
|
|
898
898
|
/* @__PURE__ */ e(
|
|
899
899
|
ne,
|
|
900
900
|
{
|
|
@@ -912,47 +912,47 @@ const $t = ({
|
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
] }) });
|
|
915
|
-
}, Kt =
|
|
916
|
-
const { onEvent: t } = J(), { budgets: n } =
|
|
915
|
+
}, Kt = w(() => {
|
|
916
|
+
const { onEvent: t } = J(), { budgets: n } = D(), { detailedBudgets: i, setSelectedBudget: s } = E(), a = (r) => {
|
|
917
917
|
s(r), t(P.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
918
918
|
budget_category: r.category.name,
|
|
919
919
|
click_type: "list"
|
|
920
920
|
});
|
|
921
921
|
};
|
|
922
|
-
return /* @__PURE__ */ u(
|
|
923
|
-
/* @__PURE__ */ e(
|
|
924
|
-
/* @__PURE__ */ e(
|
|
922
|
+
return /* @__PURE__ */ u(we, { elevation: 2, children: [
|
|
923
|
+
/* @__PURE__ */ e(He, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(je, { children: n.budget_categories_title }) }),
|
|
924
|
+
/* @__PURE__ */ e(Ie, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(Z, { children: i.map((r) => /* @__PURE__ */ u(l.Fragment, { children: [
|
|
925
925
|
/* @__PURE__ */ e(Vt, { budget: r, onClick: a }),
|
|
926
|
-
/* @__PURE__ */ e(
|
|
926
|
+
/* @__PURE__ */ e(pe, {})
|
|
927
927
|
] }, r.guid)) }) })
|
|
928
928
|
] });
|
|
929
|
-
}), Xt =
|
|
930
|
-
const t =
|
|
931
|
-
const y = c.reduce((
|
|
929
|
+
}), Xt = w(() => {
|
|
930
|
+
const t = ue(), { onEvent: n } = J(), { visibleAccounts: i } = ze(), { budgets: s, common: a, recurring: r } = D(), { incomeCategories: o, spendCategories: c } = q(), { detailedBudgets: g, totalBudgeted: d } = E(), { incomeTotal: m } = me(), { setFilter: p } = ee(), [h, _] = l.useState(!1), [f, C] = l.useMemo(() => {
|
|
931
|
+
const y = c.reduce((R, O) => R + O.totalAmount, 0);
|
|
932
932
|
let B = y / d;
|
|
933
933
|
B > 1 && (B = 1);
|
|
934
|
-
let
|
|
935
|
-
B > 0.8 && B < 1 ?
|
|
936
|
-
const
|
|
934
|
+
let I = t.palette.success.main;
|
|
935
|
+
B > 0.8 && B < 1 ? I = t.palette.warning.main : B >= 1 && (I = t.palette.error.main);
|
|
936
|
+
const N = [
|
|
937
937
|
{
|
|
938
|
-
color:
|
|
938
|
+
color: I,
|
|
939
939
|
percentage: `${B}`
|
|
940
940
|
}
|
|
941
941
|
];
|
|
942
|
-
return [y,
|
|
942
|
+
return [y, N];
|
|
943
943
|
}, [g, c]), [v, A] = l.useMemo(() => {
|
|
944
944
|
const y = Math.abs(
|
|
945
|
-
o.reduce((
|
|
945
|
+
o.reduce((N, R) => N + R.totalAmount, 0)
|
|
946
946
|
);
|
|
947
947
|
let B = y / m;
|
|
948
948
|
B > 1 && (B = 1);
|
|
949
|
-
const
|
|
949
|
+
const I = [
|
|
950
950
|
{
|
|
951
951
|
color: t.palette.secondary.main,
|
|
952
952
|
percentage: `${B}`
|
|
953
953
|
}
|
|
954
954
|
];
|
|
955
|
-
return [y,
|
|
955
|
+
return [y, I];
|
|
956
956
|
}, [o, m]), b = () => {
|
|
957
957
|
p({
|
|
958
958
|
accounts: i.map((y) => y.guid),
|
|
@@ -962,13 +962,13 @@ const $t = ({
|
|
|
962
962
|
}
|
|
963
963
|
}), _(!0), n(P.BUDGETS_CLICK_EDIT_INCOME);
|
|
964
964
|
};
|
|
965
|
-
return /* @__PURE__ */ u(
|
|
966
|
-
/* @__PURE__ */ e(
|
|
967
|
-
/* @__PURE__ */ e(
|
|
965
|
+
return /* @__PURE__ */ u(we, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
966
|
+
/* @__PURE__ */ e(He, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(je, { children: s.overview_title }) }),
|
|
967
|
+
/* @__PURE__ */ e(Ie, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ u(x, { gap: 24, children: [
|
|
968
968
|
/* @__PURE__ */ u(x, { gap: 8, children: [
|
|
969
969
|
/* @__PURE__ */ e(S, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
|
|
970
|
-
/* @__PURE__ */ e(
|
|
971
|
-
/* @__PURE__ */ e(S, { variant: "Small", children:
|
|
970
|
+
/* @__PURE__ */ e(Ae, { data: C, height: 16 }),
|
|
971
|
+
/* @__PURE__ */ e(S, { variant: "Small", children: M(
|
|
972
972
|
s.spending_description,
|
|
973
973
|
T(f, "0,0"),
|
|
974
974
|
T(d, "0,0")
|
|
@@ -983,12 +983,12 @@ const $t = ({
|
|
|
983
983
|
"aria-label": r.manage_income,
|
|
984
984
|
onClick: b,
|
|
985
985
|
sx: { p: 0 },
|
|
986
|
-
children: /* @__PURE__ */ e(
|
|
986
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "edit" })
|
|
987
987
|
}
|
|
988
988
|
)
|
|
989
989
|
] }),
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
/* @__PURE__ */ e(S, { variant: "Small", children:
|
|
990
|
+
/* @__PURE__ */ e(Ae, { data: A, height: 16 }),
|
|
991
|
+
/* @__PURE__ */ e(S, { variant: "Small", children: M(
|
|
992
992
|
s.income_description,
|
|
993
993
|
T(v, "0,0"),
|
|
994
994
|
T(m, "0,0")
|
|
@@ -1006,8 +1006,8 @@ const $t = ({
|
|
|
1006
1006
|
}
|
|
1007
1007
|
)
|
|
1008
1008
|
] });
|
|
1009
|
-
}),
|
|
1010
|
-
const i =
|
|
1009
|
+
}), Pe = 480, nn = w(({ onBackClick: t, sx: n }) => {
|
|
1010
|
+
const i = ue(), { onEvent: s } = J(), { visibleAccounts: a } = ze(), { budgets: r, common: o } = D(), { isInitialized: c, selectedAccounts: g, setDisplayedDate: d } = Q(), {
|
|
1011
1011
|
alert: m,
|
|
1012
1012
|
dateRange: p,
|
|
1013
1013
|
isDataLoaded: h,
|
|
@@ -1016,46 +1016,46 @@ const $t = ({
|
|
|
1016
1016
|
setAlert: C,
|
|
1017
1017
|
setTheme: v,
|
|
1018
1018
|
detailedBudgets: A
|
|
1019
|
-
} =
|
|
1020
|
-
|
|
1019
|
+
} = E(), { setDateRange: b } = me(), { loadDateRangeCategoryTotals: y, loadMonthlyCategoryTotals: B } = q(), { isSmallTablet: I, isMobile: N, isSmallMobile: R } = fe(), O = I || N || R, [j, k] = l.useState(!1);
|
|
1020
|
+
Ve({
|
|
1021
1021
|
widgetName: "BubbleBudgetsWidget",
|
|
1022
1022
|
isLoaded: h
|
|
1023
1023
|
}), l.useEffect(() => {
|
|
1024
1024
|
v(i), h || _().finally(() => {
|
|
1025
1025
|
s(P.BUDGETS_VIEW);
|
|
1026
1026
|
});
|
|
1027
|
-
}, []), l.useEffect(() => (f({ start: ie(
|
|
1028
|
-
f({ start: ie(
|
|
1027
|
+
}, []), l.useEffect(() => (f({ start: le(ie()), end: xe(ie()) }), () => {
|
|
1028
|
+
f({ start: le(ie()), end: xe(ie()) });
|
|
1029
1029
|
}), [a]), l.useEffect(() => {
|
|
1030
|
-
c && (d(p.start, p.end), y(g, p.start, p.end).finally(), b(p));
|
|
1030
|
+
c && (d(p.start, p.end), y(g, p.start, p.end).finally(), B(g).finally(), b(p));
|
|
1031
1031
|
}, [c, g, p]);
|
|
1032
|
-
const
|
|
1033
|
-
f({ start:
|
|
1034
|
-
},
|
|
1032
|
+
const ae = (se) => {
|
|
1033
|
+
f({ start: se[0] || /* @__PURE__ */ new Date(), end: se[1] || /* @__PURE__ */ new Date() });
|
|
1034
|
+
}, V = () => {
|
|
1035
1035
|
s(P.BUDGETS_CLICK_FILTER);
|
|
1036
|
-
},
|
|
1036
|
+
}, re = () => {
|
|
1037
1037
|
k(!0), s(P.BUDGETS_CLICK_ADD);
|
|
1038
|
-
},
|
|
1038
|
+
}, F = () => {
|
|
1039
1039
|
k(!1);
|
|
1040
|
-
},
|
|
1040
|
+
}, K = () => {
|
|
1041
1041
|
k(!1);
|
|
1042
|
-
}, X = Qe(p.end,
|
|
1043
|
-
return !c || !h ? /* @__PURE__ */ e(
|
|
1042
|
+
}, X = Qe(p.end, le(/* @__PURE__ */ new Date()));
|
|
1043
|
+
return !c || !h ? /* @__PURE__ */ e(be, {}) : /* @__PURE__ */ u(
|
|
1044
1044
|
gt,
|
|
1045
1045
|
{
|
|
1046
1046
|
actions: [
|
|
1047
1047
|
{
|
|
1048
1048
|
iconName: "add",
|
|
1049
1049
|
label: r.add_title,
|
|
1050
|
-
onClick:
|
|
1050
|
+
onClick: re
|
|
1051
1051
|
}
|
|
1052
1052
|
],
|
|
1053
1053
|
calendarActions: {
|
|
1054
|
-
onRangeChanged:
|
|
1054
|
+
onRangeChanged: ae,
|
|
1055
1055
|
shouldDisableNext: X,
|
|
1056
1056
|
shouldDisablePicker: !0
|
|
1057
1057
|
},
|
|
1058
|
-
onAccountsFilterClick:
|
|
1058
|
+
onAccountsFilterClick: V,
|
|
1059
1059
|
onBackClick: t,
|
|
1060
1060
|
sx: n,
|
|
1061
1061
|
title: r.budgets_title,
|
|
@@ -1063,19 +1063,19 @@ const $t = ({
|
|
|
1063
1063
|
/* @__PURE__ */ u(
|
|
1064
1064
|
x,
|
|
1065
1065
|
{
|
|
1066
|
-
direction:
|
|
1066
|
+
direction: O ? "column" : "row",
|
|
1067
1067
|
height: "100%",
|
|
1068
1068
|
sx: { justifyContent: "center" },
|
|
1069
1069
|
width: "100%",
|
|
1070
1070
|
children: [
|
|
1071
|
-
/* @__PURE__ */ e(x, { height:
|
|
1072
|
-
|
|
1071
|
+
/* @__PURE__ */ e(x, { height: O ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1072
|
+
Ze,
|
|
1073
1073
|
{
|
|
1074
|
-
createBudgetOnClick:
|
|
1075
|
-
height:
|
|
1074
|
+
createBudgetOnClick: re,
|
|
1075
|
+
height: O ? 450 : 800,
|
|
1076
1076
|
isDraggable: !0,
|
|
1077
1077
|
shouldShowZeroState: A.length === 0,
|
|
1078
|
-
unavailableWidth:
|
|
1078
|
+
unavailableWidth: O ? 0 : Pe
|
|
1079
1079
|
}
|
|
1080
1080
|
) }),
|
|
1081
1081
|
A.length !== 0 && /* @__PURE__ */ u(
|
|
@@ -1084,7 +1084,7 @@ const $t = ({
|
|
|
1084
1084
|
gap: 24,
|
|
1085
1085
|
height: "100%",
|
|
1086
1086
|
sx: { mr: 24, mt: 48 },
|
|
1087
|
-
width:
|
|
1087
|
+
width: O ? "100%" : Pe,
|
|
1088
1088
|
children: [
|
|
1089
1089
|
/* @__PURE__ */ e(Xt, {}),
|
|
1090
1090
|
/* @__PURE__ */ e(Kt, {})
|
|
@@ -1099,20 +1099,20 @@ const $t = ({
|
|
|
1099
1099
|
$,
|
|
1100
1100
|
{
|
|
1101
1101
|
ariaLabelClose: o.close_aria,
|
|
1102
|
-
isOpen:
|
|
1102
|
+
isOpen: j,
|
|
1103
1103
|
onClose: () => k(!1),
|
|
1104
1104
|
title: r.add_new_title,
|
|
1105
1105
|
children: /* @__PURE__ */ e(
|
|
1106
|
-
|
|
1106
|
+
Ke,
|
|
1107
1107
|
{
|
|
1108
|
-
onAddBudget:
|
|
1109
|
-
onRecalculateBudgets:
|
|
1108
|
+
onAddBudget: F,
|
|
1109
|
+
onRecalculateBudgets: K
|
|
1110
1110
|
}
|
|
1111
1111
|
)
|
|
1112
1112
|
}
|
|
1113
1113
|
),
|
|
1114
1114
|
/* @__PURE__ */ e(
|
|
1115
|
-
|
|
1115
|
+
Te,
|
|
1116
1116
|
{
|
|
1117
1117
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1118
1118
|
autoHideDuration: 3500,
|
|
@@ -1121,7 +1121,7 @@ const $t = ({
|
|
|
1121
1121
|
},
|
|
1122
1122
|
open: !!m,
|
|
1123
1123
|
children: /* @__PURE__ */ e(
|
|
1124
|
-
|
|
1124
|
+
ve,
|
|
1125
1125
|
{
|
|
1126
1126
|
closeText: "",
|
|
1127
1127
|
onClose: () => {
|
|
@@ -1143,7 +1143,7 @@ const $t = ({
|
|
|
1143
1143
|
handleAddClick: i,
|
|
1144
1144
|
shouldShowZeroState: s
|
|
1145
1145
|
}) => {
|
|
1146
|
-
const { availableHeight: a = 0 } =
|
|
1146
|
+
const { availableHeight: a = 0 } = ge(), r = l.useRef(null);
|
|
1147
1147
|
l.useEffect(() => {
|
|
1148
1148
|
a > 0 && r.current === null && (r.current = a);
|
|
1149
1149
|
}, [a]);
|
|
@@ -1153,7 +1153,7 @@ const $t = ({
|
|
|
1153
1153
|
}, [a]);
|
|
1154
1154
|
return /* @__PURE__ */ u(x, { sx: { height: "100%", justifyContent: "space-between" }, children: [
|
|
1155
1155
|
/* @__PURE__ */ e(
|
|
1156
|
-
|
|
1156
|
+
Ze,
|
|
1157
1157
|
{
|
|
1158
1158
|
createBudgetOnClick: i,
|
|
1159
1159
|
height: o,
|
|
@@ -1161,13 +1161,13 @@ const $t = ({
|
|
|
1161
1161
|
shouldShowZeroState: s
|
|
1162
1162
|
}
|
|
1163
1163
|
),
|
|
1164
|
-
!s && /* @__PURE__ */ u(
|
|
1164
|
+
!s && /* @__PURE__ */ u(W, { ml: 16, children: [
|
|
1165
1165
|
/* @__PURE__ */ e(S, { bold: !0, color: n < 0 ? "error.main" : "success.main", children: T(Math.abs(n), "0,0") }),
|
|
1166
1166
|
/* @__PURE__ */ e(S, { children: n < 0 ? t.overspent_in_budgets : t.left_in_budgets })
|
|
1167
1167
|
] })
|
|
1168
1168
|
] });
|
|
1169
1169
|
}, Zt = (t) => {
|
|
1170
|
-
const n =
|
|
1170
|
+
const n = ue(), { onEvent: i } = J(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: r, setTheme: o } = E(), { budgets: c, common: g } = D(), { isInitialized: d, selectedAccounts: m } = Q(), { loadDateRangeCategoryTotals: p } = q(), h = pt(), [_, f] = l.useState(!1);
|
|
1171
1171
|
l.useEffect(() => {
|
|
1172
1172
|
a || r().finally();
|
|
1173
1173
|
}, []), l.useEffect(() => {
|
|
@@ -1175,8 +1175,8 @@ const $t = ({
|
|
|
1175
1175
|
}, [n]), l.useEffect(() => {
|
|
1176
1176
|
d && !a && p(
|
|
1177
1177
|
m,
|
|
1178
|
-
|
|
1179
|
-
|
|
1178
|
+
le(/* @__PURE__ */ new Date()),
|
|
1179
|
+
xe(/* @__PURE__ */ new Date())
|
|
1180
1180
|
).finally();
|
|
1181
1181
|
}, [d, m, a]);
|
|
1182
1182
|
const C = () => {
|
|
@@ -1184,10 +1184,10 @@ const $t = ({
|
|
|
1184
1184
|
}, v = () => {
|
|
1185
1185
|
f(!1);
|
|
1186
1186
|
}, A = () => f(!1);
|
|
1187
|
-
if (
|
|
1187
|
+
if (Ve({
|
|
1188
1188
|
widgetName: "BubbleBudgetsMiniWidget",
|
|
1189
1189
|
isLoaded: a
|
|
1190
|
-
}), !d || !a) return /* @__PURE__ */ e(
|
|
1190
|
+
}), !d || !a) return /* @__PURE__ */ e(be, {});
|
|
1191
1191
|
const b = s.length === 0;
|
|
1192
1192
|
return /* @__PURE__ */ u(
|
|
1193
1193
|
ht,
|
|
@@ -1215,7 +1215,7 @@ const $t = ({
|
|
|
1215
1215
|
onClose: () => f(!1),
|
|
1216
1216
|
title: c.add_new_title,
|
|
1217
1217
|
children: /* @__PURE__ */ e(
|
|
1218
|
-
|
|
1218
|
+
Ke,
|
|
1219
1219
|
{
|
|
1220
1220
|
onAddBudget: v,
|
|
1221
1221
|
onRecalculateBudgets: A
|
|
@@ -1226,7 +1226,7 @@ const $t = ({
|
|
|
1226
1226
|
]
|
|
1227
1227
|
}
|
|
1228
1228
|
);
|
|
1229
|
-
}, an =
|
|
1229
|
+
}, an = w(Zt), ce = {
|
|
1230
1230
|
CANCEL_DELETE: "Cancel - Delete",
|
|
1231
1231
|
END_SAVE: "End - Save",
|
|
1232
1232
|
END_DELETE: "End - Delete",
|
|
@@ -1241,37 +1241,37 @@ const $t = ({
|
|
|
1241
1241
|
setAlert: g,
|
|
1242
1242
|
setSelectedBudget: d,
|
|
1243
1243
|
updateBudget: m
|
|
1244
|
-
} =
|
|
1244
|
+
} = E(), { budgets: p, common: h } = D(), { isCopyLoaded: _, selectedAccountGuids: f } = Q(), C = Ue(), { setFilter: v } = ee(), [A, b] = l.useState(""), [y, B] = l.useState(null), [I, N] = l.useState(!1), R = l.useRef(!1);
|
|
1245
1245
|
if (l.useEffect(() => {
|
|
1246
1246
|
!o || c || (b(`${o.amount}`), v({
|
|
1247
1247
|
accounts: f,
|
|
1248
1248
|
dateRange: a,
|
|
1249
|
-
custom: ({ category_guid: Y, top_level_category_guid:
|
|
1250
|
-
const { category_guid:
|
|
1251
|
-
return Y ===
|
|
1249
|
+
custom: ({ category_guid: Y, top_level_category_guid: ye }) => {
|
|
1250
|
+
const { category_guid: Me } = o;
|
|
1251
|
+
return Y === Me || ye === Me;
|
|
1252
1252
|
},
|
|
1253
1253
|
showSplits: !0
|
|
1254
|
-
}),
|
|
1255
|
-
}, [o]), !_) return /* @__PURE__ */ e(
|
|
1254
|
+
}), N(!0));
|
|
1255
|
+
}, [o]), !_) return /* @__PURE__ */ e(be, {});
|
|
1256
1256
|
if (!o) return null;
|
|
1257
|
-
const
|
|
1258
|
-
b(""), B(null),
|
|
1257
|
+
const O = () => {
|
|
1258
|
+
b(""), B(null), N(!1), setTimeout(() => {
|
|
1259
1259
|
d(void 0), t?.();
|
|
1260
1260
|
}, 250);
|
|
1261
|
-
},
|
|
1262
|
-
y === "delete" && n?.(
|
|
1263
|
-
},
|
|
1261
|
+
}, j = () => {
|
|
1262
|
+
y === "delete" && n?.(ce.CANCEL_DELETE, A), b(o.amount ? `${o.amount}` : ""), B(null);
|
|
1263
|
+
}, k = async () => {
|
|
1264
1264
|
if (y === "edit") {
|
|
1265
|
-
if (
|
|
1266
|
-
|
|
1265
|
+
if (R.current) return;
|
|
1266
|
+
R.current = !0, await m({
|
|
1267
1267
|
...o,
|
|
1268
1268
|
amount: Number(A)
|
|
1269
|
-
}), n?.(
|
|
1270
|
-
|
|
1271
|
-
), B(null),
|
|
1269
|
+
}), n?.(ce.END_SAVE, A), g(
|
|
1270
|
+
M(p.alert_budget_updated, o.category.name)
|
|
1271
|
+
), B(null), R.current = !1;
|
|
1272
1272
|
}
|
|
1273
|
-
y === "delete" && (await r(o.guid), n?.(
|
|
1274
|
-
}, ae = o.transaction_total ?? 0,
|
|
1273
|
+
y === "delete" && (await r(o.guid), n?.(ce.END_DELETE, A), O());
|
|
1274
|
+
}, ae = o.transaction_total ?? 0, V = o.amount ?? 0, re = Math.max(0, V - ae), F = V > 0 ? Math.min(100, ae / V * 100) : 0, K = {
|
|
1275
1275
|
off: {
|
|
1276
1276
|
iconColor: "error"
|
|
1277
1277
|
},
|
|
@@ -1282,9 +1282,9 @@ const $t = ({
|
|
|
1282
1282
|
iconColor: "warning"
|
|
1283
1283
|
}
|
|
1284
1284
|
};
|
|
1285
|
-
let
|
|
1286
|
-
|
|
1287
|
-
const { iconColor:
|
|
1285
|
+
let X = K.on;
|
|
1286
|
+
F >= 100 ? X = K.off : F >= 50 && (X = K.near);
|
|
1287
|
+
const { iconColor: se } = X, Oe = (Y, ye) => M(Y, /* @__PURE__ */ e("b", { children: ye }));
|
|
1288
1288
|
return /* @__PURE__ */ u(l.Fragment, { children: [
|
|
1289
1289
|
/* @__PURE__ */ u(
|
|
1290
1290
|
$,
|
|
@@ -1294,14 +1294,14 @@ const $t = ({
|
|
|
1294
1294
|
px: 24,
|
|
1295
1295
|
py: 16
|
|
1296
1296
|
},
|
|
1297
|
-
isOpen:
|
|
1298
|
-
onClose:
|
|
1297
|
+
isOpen: I,
|
|
1298
|
+
onClose: O,
|
|
1299
1299
|
onPrimaryAction: () => B(
|
|
1300
1300
|
"edit"
|
|
1301
1301
|
/* EDIT */
|
|
1302
1302
|
),
|
|
1303
1303
|
onSecondaryAction: () => {
|
|
1304
|
-
n?.(
|
|
1304
|
+
n?.(ce.START_DELETE, A), B(
|
|
1305
1305
|
"delete"
|
|
1306
1306
|
/* DELETE */
|
|
1307
1307
|
);
|
|
@@ -1314,10 +1314,10 @@ const $t = ({
|
|
|
1314
1314
|
pr: 24
|
|
1315
1315
|
}
|
|
1316
1316
|
},
|
|
1317
|
-
title:
|
|
1317
|
+
title: M(p.details_type_title, o.category.name),
|
|
1318
1318
|
children: [
|
|
1319
1319
|
/* @__PURE__ */ u(
|
|
1320
|
-
|
|
1320
|
+
W,
|
|
1321
1321
|
{
|
|
1322
1322
|
sx: {
|
|
1323
1323
|
bgcolor: "background.paper",
|
|
@@ -1338,8 +1338,8 @@ const $t = ({
|
|
|
1338
1338
|
px: 24
|
|
1339
1339
|
},
|
|
1340
1340
|
children: [
|
|
1341
|
-
/* @__PURE__ */ e(
|
|
1342
|
-
i && /* @__PURE__ */ e(
|
|
1341
|
+
/* @__PURE__ */ e(Ce, { bold: !0, variant: "subtitle1", children: yt(o.start_date) }),
|
|
1342
|
+
i && /* @__PURE__ */ e(De, { endIcon: /* @__PURE__ */ e(ft, {}), onClick: i, sx: { height: 28 }, children: /* @__PURE__ */ e(S, { bold: !0, variant: "body2", children: "Spending History" }) })
|
|
1343
1343
|
]
|
|
1344
1344
|
}
|
|
1345
1345
|
),
|
|
@@ -1347,32 +1347,32 @@ const $t = ({
|
|
|
1347
1347
|
bt,
|
|
1348
1348
|
{
|
|
1349
1349
|
amount: /* @__PURE__ */ u(x, { sx: { alignItems: "baseline", flexDirection: "row", gap: 4 }, children: [
|
|
1350
|
-
/* @__PURE__ */ e(
|
|
1351
|
-
/* @__PURE__ */ e(
|
|
1352
|
-
/* @__PURE__ */ e(
|
|
1350
|
+
/* @__PURE__ */ e(Ge, { children: T(o.transaction_total, "0,0.00") }),
|
|
1351
|
+
/* @__PURE__ */ e(Ce, { color: "text.secondary", variant: "body2", children: "/" }),
|
|
1352
|
+
/* @__PURE__ */ e(Ce, { color: "text.secondary", variant: "body2", children: T(o.amount, "0,0.00") })
|
|
1353
1353
|
] }),
|
|
1354
|
-
completeColor: `${
|
|
1354
|
+
completeColor: `${se}.main`,
|
|
1355
1355
|
icon: /* @__PURE__ */ e(
|
|
1356
|
-
|
|
1356
|
+
H,
|
|
1357
1357
|
{
|
|
1358
1358
|
categoryGuid: o.category.guid,
|
|
1359
1359
|
size: 44,
|
|
1360
1360
|
sx: {
|
|
1361
|
-
bgcolor: at(
|
|
1362
|
-
border: `1px solid ${
|
|
1361
|
+
bgcolor: at(Le(o.category.guid, C), 0.15),
|
|
1362
|
+
border: `1px solid ${Le(o.category.guid, C)}`,
|
|
1363
1363
|
color: "text.primary"
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
),
|
|
1367
|
-
label:
|
|
1367
|
+
label: Oe(
|
|
1368
1368
|
p.spent_label,
|
|
1369
1369
|
Ct(new Date(o.start_date * 1e3), { month: "short" })
|
|
1370
1370
|
),
|
|
1371
|
-
leftLabel:
|
|
1372
|
-
percentComplete:
|
|
1373
|
-
rightLabel:
|
|
1371
|
+
leftLabel: M(p.percent_spent, F.toFixed()),
|
|
1372
|
+
percentComplete: F,
|
|
1373
|
+
rightLabel: M(
|
|
1374
1374
|
p.balance_left,
|
|
1375
|
-
T(
|
|
1375
|
+
T(re, "0,0.00")
|
|
1376
1376
|
),
|
|
1377
1377
|
sx: {
|
|
1378
1378
|
pb: 24,
|
|
@@ -1384,15 +1384,15 @@ const $t = ({
|
|
|
1384
1384
|
]
|
|
1385
1385
|
}
|
|
1386
1386
|
),
|
|
1387
|
-
/* @__PURE__ */ e(
|
|
1387
|
+
/* @__PURE__ */ e(Ee, {}),
|
|
1388
1388
|
s && /* @__PURE__ */ e(
|
|
1389
|
-
|
|
1389
|
+
Te,
|
|
1390
1390
|
{
|
|
1391
1391
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
1392
1392
|
autoHideDuration: 3500,
|
|
1393
1393
|
onClose: () => g(""),
|
|
1394
1394
|
open: !!s,
|
|
1395
|
-
children: /* @__PURE__ */ e(
|
|
1395
|
+
children: /* @__PURE__ */ e(ve, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children: s })
|
|
1396
1396
|
}
|
|
1397
1397
|
)
|
|
1398
1398
|
]
|
|
@@ -1402,14 +1402,14 @@ const $t = ({
|
|
|
1402
1402
|
_t,
|
|
1403
1403
|
{
|
|
1404
1404
|
closeAriaLabel: h.close_aria,
|
|
1405
|
-
content:
|
|
1405
|
+
content: Oe(
|
|
1406
1406
|
p[y === "edit" ? "edit_budget_content" : "delete_description"],
|
|
1407
1407
|
o.category.name
|
|
1408
1408
|
),
|
|
1409
1409
|
handleInputChange: (Y) => b(Y.toString()),
|
|
1410
|
-
handleModalClose:
|
|
1411
|
-
handlePrimaryAction:
|
|
1412
|
-
handleSecondaryAction:
|
|
1410
|
+
handleModalClose: j,
|
|
1411
|
+
handlePrimaryAction: k,
|
|
1412
|
+
handleSecondaryAction: j,
|
|
1413
1413
|
inputLabel: y === "edit" ? p.details_edit_title : "",
|
|
1414
1414
|
inputValue: A,
|
|
1415
1415
|
isOpen: !0,
|
|
@@ -1421,7 +1421,7 @@ const $t = ({
|
|
|
1421
1421
|
}
|
|
1422
1422
|
)
|
|
1423
1423
|
] });
|
|
1424
|
-
}, rn =
|
|
1424
|
+
}, rn = w(qt);
|
|
1425
1425
|
export {
|
|
1426
1426
|
an as BubbleBudgetsMiniWidget,
|
|
1427
1427
|
nn as BubbleBudgetsWidget,
|