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