@mx-cartographer/experiences 7.1.3-alpha.mm1 → 7.1.4
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 +13 -0
- package/dist/{Account-DKy2na__.mjs → Account-8IUM_CLv.mjs} +1 -1
- package/dist/{AccountDetailsContent-CCOCsdoL.mjs → AccountDetailsContent-CuZSSAEc.mjs} +8 -8
- package/dist/{AccountDetailsHeader-Ca9SPAjA.mjs → AccountDetailsHeader-BZBsIKdF.mjs} +6 -6
- package/dist/{AccountFields-DDAr5SEq.mjs → AccountFields-BD_0GT68.mjs} +2 -2
- package/dist/{AccountListItem-CMes1Q7Z.mjs → AccountListItem-CllIBCao.mjs} +4 -4
- package/dist/{AccountStore-DYOG9MYj.mjs → AccountStore-BL0FE1QL.mjs} +53 -45
- package/dist/{Accounts-BNvFndCa.mjs → Accounts-Bvc9TJaO.mjs} +1 -1
- package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-psfk-Amb.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-BmenK5bu.mjs} +1 -1
- package/dist/{ConnectDrawer-CHG5Lv_B.mjs → ConnectDrawer-CPTXh70j.mjs} +8 -8
- package/dist/{ConnectionsDrawer-BeB6ab8V.mjs → ConnectionsDrawer-Dkb4vBmt.mjs} +2 -2
- package/dist/{CurrencyInput-CsCy7uaS.mjs → CurrencyInput-C4xNRL2W.mjs} +1 -1
- package/dist/{DebtsStore-BblTVTMD.mjs → DebtsStore-D4grpB4m.mjs} +1 -1
- package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-CBJAfyAw.mjs} +3 -3
- package/dist/{GoalStore-CSsU4LR2.mjs → GoalStore-B5MZzPLZ.mjs} +2 -2
- package/dist/{Help-B6dIcujh.mjs → Help-CzBAsKA2.mjs} +1 -1
- package/dist/{LineChart-D4GI7nVh.mjs → LineChart-B35qvXik.mjs} +1 -1
- package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-DSrYDGAP.mjs} +1 -1
- package/dist/{ManageIncome-DqG75uQd.mjs → ManageIncome-DUuT-yMV.mjs} +34 -34
- package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-C4QQHfD7.mjs} +1 -1
- package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-DTQdRK-3.mjs} +1 -1
- package/dist/{NetWorthStore-BbA7H83o.mjs → NetWorthStore-Do1Gk8Te.mjs} +2 -2
- package/dist/{NotificationSettings-BRm_EJZV.mjs → NotificationSettings-BuShgjn6.mjs} +3 -3
- package/dist/{OriginalBalanceAction-CAaVbVMO.mjs → OriginalBalanceAction-BsxcvNEF.mjs} +3 -3
- package/dist/{RecurringSettings-B9l_Axnd.mjs → RecurringSettings-BVOt46uV.mjs} +3 -3
- package/dist/{TransactionDetails-DPvvi4Iu.mjs → TransactionDetails-_cXLXTd3.mjs} +5 -5
- package/dist/{TransactionStore-CBrJOY0H.mjs → TransactionStore-B-Tq_YFE.mjs} +2 -2
- package/dist/{TrendsStore-DCYbpXPO.mjs → TrendsStore-ZZ8X36lJ.mjs} +1 -1
- package/dist/{User-BQUxBeZV.mjs → User-DaJAQ09j.mjs} +1 -1
- package/dist/{WidgetContainer-BMWagbIl.mjs → WidgetContainer-DtPnPQZY.mjs} +10 -10
- package/dist/accounts/index.es.js +13 -13
- package/dist/accounts/stores/AccountStore.d.ts +2 -0
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +10 -10
- package/dist/cashflow/index.es.js +381 -387
- package/dist/categories/index.es.js +1 -1
- package/dist/common/context/GlobalDataProvider.d.ts +0 -1
- package/dist/common/context/hooks.d.ts +0 -3
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +49 -50
- package/dist/dashboard/index.es.js +77 -79
- package/dist/debts/index.es.js +9 -9
- package/dist/{exportTransactionsToCSV-7bVS7KXf.mjs → exportTransactionsToCSV-D8TTNrrE.mjs} +1 -1
- package/dist/finstrong/index.es.js +6 -6
- package/dist/goals/index.es.js +52 -52
- package/dist/help/index.es.js +3 -3
- package/dist/hooks-CE2TKk4a.mjs +74 -0
- package/dist/investments/index.es.js +3 -3
- package/dist/merchants/index.es.js +1 -1
- package/dist/networth/index.es.js +7 -7
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +19 -19
- package/dist/settings/index.es.js +6 -6
- package/dist/spending/index.es.js +4 -4
- package/dist/transactions/index.es.js +13 -13
- package/dist/trends/index.es.js +449 -449
- package/dist/{useAccountDisplayName-BEorBm5u.mjs → useAccountDisplayName-BXGkZN5B.mjs} +2 -2
- package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-DSnpkUq0.mjs} +1 -1
- package/package.json +1 -1
- package/dist/hooks-D6XlXHf4.mjs +0 -77
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
1
|
+
import { jsxs as o, Fragment as B, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import p, { useState as J } from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { addMonths as
|
|
5
|
-
import { startOfToday as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import { observer as T } from "mobx-react-lite";
|
|
4
|
+
import { addMonths as Pe } from "date-fns/addMonths";
|
|
5
|
+
import { startOfToday as W } from "date-fns/startOfToday";
|
|
6
|
+
import D from "@mui/material/Box";
|
|
7
|
+
import v from "@mui/material/Divider";
|
|
8
8
|
import s from "@mui/material/Stack";
|
|
9
|
-
import
|
|
10
|
-
import { Text as
|
|
11
|
-
import { G as
|
|
12
|
-
import { C as
|
|
13
|
-
import { u as
|
|
9
|
+
import ce from "@mui/material/styles/useTheme";
|
|
10
|
+
import { Text as u, P as k, Icon as G, InstitutionLogo as xe, H1 as me, H2 as qe } from "@mxenabled/mxui";
|
|
11
|
+
import { G as Xe, t as ue, u as N, p as le, d as Oe, b as Y, j as U, g as Ne, h as ke, a as Ye, o as Qe } from "../hooks-CE2TKk4a.mjs";
|
|
12
|
+
import { C as O } from "../CurrencyText-kyC1aseI.mjs";
|
|
13
|
+
import { u as he } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
14
14
|
import { L as te } from "../Loader-DUaFpDGv.mjs";
|
|
15
|
-
import { I as
|
|
15
|
+
import { I as pe } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
16
16
|
import { C as Gn } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
17
|
-
import { b as
|
|
18
|
-
import { M as Ve } from "../MiniWidgetContainer-
|
|
17
|
+
import { b as $ } from "../Localization-2MODESHW.mjs";
|
|
18
|
+
import { M as Ve } from "../MiniWidgetContainer-DTQdRK-3.mjs";
|
|
19
19
|
import { E as Ke } from "../EmptyState-DA_lfRBv.mjs";
|
|
20
|
-
import { R as Je } from "../RecurringSettings-
|
|
20
|
+
import { R as Je } from "../RecurringSettings-BVOt46uV.mjs";
|
|
21
21
|
import Ze from "@mui/material/Tabs";
|
|
22
22
|
import ye from "@mui/material/Tab";
|
|
23
|
-
import { getUnixTime as
|
|
23
|
+
import { getUnixTime as z } from "date-fns/getUnixTime";
|
|
24
24
|
import ee from "@mui/material/List";
|
|
25
25
|
import ne from "@mui/material/ListItem";
|
|
26
|
-
import { A as et } from "../AccountListItem-
|
|
26
|
+
import { A as et } from "../AccountListItem-CllIBCao.mjs";
|
|
27
27
|
import { f as Q, D as V } from "../Dialog-CWW597AF.mjs";
|
|
28
28
|
import tt from "@mui/material/ListSubheader";
|
|
29
29
|
import { f as Z } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
30
|
-
import { isAfter as
|
|
31
|
-
import { isBefore as
|
|
32
|
-
import { isToday as
|
|
30
|
+
import { isAfter as He } from "date-fns/isAfter";
|
|
31
|
+
import { isBefore as Fe } from "date-fns/isBefore";
|
|
32
|
+
import { isToday as We } from "date-fns/isToday";
|
|
33
33
|
import { addDays as Ce } from "date-fns/addDays";
|
|
34
34
|
import { alpha as nt, keyframes as ot } from "@mui/material/styles";
|
|
35
35
|
import { DataGridPro as at } from "@mui/x-data-grid-pro";
|
|
36
36
|
import { T as Se } from "../TabContentContainer-j01JYR_7.mjs";
|
|
37
|
-
import
|
|
38
|
-
import { M as it, S as rt, i as st, d as we, c as ct } from "../ManageIncome-
|
|
39
|
-
import { D as
|
|
37
|
+
import M from "@mui/material/Button";
|
|
38
|
+
import { M as it, S as rt, i as st, d as we, c as ct } from "../ManageIncome-DUuT-yMV.mjs";
|
|
39
|
+
import { D as $e } from "../Drawer-kEE73B87.mjs";
|
|
40
40
|
import { formatISO as lt } from "date-fns/formatISO";
|
|
41
41
|
import { fromUnixTime as _e } from "date-fns/fromUnixTime";
|
|
42
42
|
import { startOfMonth as dt } from "date-fns/startOfMonth";
|
|
43
|
-
import { subDays as
|
|
44
|
-
import { S as mt, b as ut } from "../TransactionDetails-
|
|
45
|
-
import { F as ht, R as Ie, e as
|
|
43
|
+
import { subDays as Me } from "date-fns/subDays";
|
|
44
|
+
import { S as mt, b as ut } from "../TransactionDetails-_cXLXTd3.mjs";
|
|
45
|
+
import { F as ht, R as Ie, e as De } from "../RecurringTransactions-ej39mgA6.mjs";
|
|
46
46
|
import { h as pt } from "../DateUtil-BcuH7ErC.mjs";
|
|
47
47
|
import { endOfToday as ft } from "date-fns/endOfToday";
|
|
48
|
-
import { W as
|
|
49
|
-
import { F as gt, A as
|
|
48
|
+
import { W as ve, A as Ae } from "../WidgetContainer-DtPnPQZY.mjs";
|
|
49
|
+
import { F as gt, A as j } from "../Fetch-87LIQbEA.mjs";
|
|
50
50
|
const K = () => {
|
|
51
|
-
if (!p.useContext(
|
|
51
|
+
if (!p.useContext(Xe))
|
|
52
52
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
53
|
-
return
|
|
53
|
+
return ue().uiStore;
|
|
54
54
|
}, bt = ({ remaining: a }) => {
|
|
55
|
-
const { cashflow: n } =
|
|
56
|
-
return /* @__PURE__ */ o(
|
|
55
|
+
const { cashflow: n } = N();
|
|
56
|
+
return /* @__PURE__ */ o(B, { children: [
|
|
57
57
|
/* @__PURE__ */ e(
|
|
58
|
-
|
|
58
|
+
D,
|
|
59
59
|
{
|
|
60
60
|
sx: {
|
|
61
61
|
borderRadius: "1px",
|
|
@@ -65,38 +65,38 @@ const K = () => {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
69
|
+
/* @__PURE__ */ e(O, { amount: a, bold: !0, sx: { fontSize: 12 } })
|
|
70
70
|
] });
|
|
71
|
-
},
|
|
72
|
-
const a =
|
|
73
|
-
daysUntilNextIncome:
|
|
71
|
+
}, fe = T(bt), xt = () => {
|
|
72
|
+
const a = ce(), { availableWidth: n } = le(), { isMobile: t } = he(), { visibleCashAccounts: r, visibleCashBalance: f } = Oe(), { selectedAccounts: x, selectedAccountGuids: c, setSelectedAccounts: g } = Y(), { cashflow: l } = N(), {
|
|
73
|
+
daysUntilNextIncome: i,
|
|
74
74
|
expensesTilNextIncome: m,
|
|
75
75
|
selectedCashAccounts: d,
|
|
76
|
-
setNextIncome:
|
|
77
|
-
setSelectedCashAccounts:
|
|
78
|
-
setUpcomingExpenses:
|
|
79
|
-
} = K(), { isDataLoaded:
|
|
76
|
+
setNextIncome: b,
|
|
77
|
+
setSelectedCashAccounts: C,
|
|
78
|
+
setUpcomingExpenses: S
|
|
79
|
+
} = K(), { isDataLoaded: R, nextIncomeRecurrence: H, upcomingExpenses: F } = U();
|
|
80
80
|
p.useEffect(() => {
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
g(r);
|
|
82
|
+
}, [r]), p.useEffect(() => {
|
|
83
|
+
C(
|
|
84
|
+
r.filter((w) => c.includes(w.guid))
|
|
85
85
|
);
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
const
|
|
90
|
-
() =>
|
|
91
|
-
[c,
|
|
92
|
-
),
|
|
93
|
-
() => m.filter((
|
|
86
|
+
}, [r, x]), p.useEffect(() => {
|
|
87
|
+
H && b(H), S(F);
|
|
88
|
+
}, [H, F]);
|
|
89
|
+
const h = p.useMemo(
|
|
90
|
+
() => r.filter((w) => c.includes(w.guid)).reduce((w, P) => w + (P?.balance || 0), 0),
|
|
91
|
+
[c, F]
|
|
92
|
+
), I = p.useMemo(
|
|
93
|
+
() => m.filter((w) => c.includes(w.accountGuid || "")).reduce((w, P) => w + P.amount, 0),
|
|
94
94
|
[c, m]
|
|
95
|
-
),
|
|
96
|
-
() =>
|
|
97
|
-
[
|
|
95
|
+
), L = p.useMemo(
|
|
96
|
+
() => h - I,
|
|
97
|
+
[h, I]
|
|
98
98
|
);
|
|
99
|
-
return
|
|
99
|
+
return R ? /* @__PURE__ */ e(D, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: n > 710 ? /* @__PURE__ */ o(
|
|
100
100
|
s,
|
|
101
101
|
{
|
|
102
102
|
border: `1px solid ${a.palette.border.light}`,
|
|
@@ -106,45 +106,45 @@ const K = () => {
|
|
|
106
106
|
px: 24,
|
|
107
107
|
children: [
|
|
108
108
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
109
|
-
/* @__PURE__ */ e(
|
|
110
|
-
/* @__PURE__ */ e(
|
|
109
|
+
/* @__PURE__ */ e(O, { amount: h, variant: "H2" }),
|
|
110
|
+
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: $(
|
|
111
111
|
l.total_cash_accounts,
|
|
112
112
|
d.length
|
|
113
113
|
) })
|
|
114
114
|
] }),
|
|
115
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
115
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(G, { name: "remove" }) }),
|
|
116
116
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
-
/* @__PURE__ */ e(
|
|
117
|
+
/* @__PURE__ */ e(O, { amount: I, variant: "H2" }),
|
|
118
|
+
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: $(l.expenses_due, m.length) })
|
|
119
119
|
] }),
|
|
120
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
120
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(G, { name: "equal" }) }),
|
|
121
121
|
/* @__PURE__ */ o(s, { pb: 14, pr: 24, pt: 12, children: [
|
|
122
|
-
/* @__PURE__ */ e(
|
|
122
|
+
/* @__PURE__ */ e(O, { amount: L, variant: "H2" }),
|
|
123
123
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
124
|
-
/* @__PURE__ */ e(
|
|
125
|
-
/* @__PURE__ */ e(
|
|
124
|
+
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: l.available_to_spend }),
|
|
125
|
+
/* @__PURE__ */ e(pe, { body: l.tooltip_body, title: l.tooltip_title })
|
|
126
126
|
] })
|
|
127
127
|
] }),
|
|
128
|
-
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(
|
|
129
|
-
/* @__PURE__ */ e(
|
|
130
|
-
/* @__PURE__ */ e(
|
|
128
|
+
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(B, { children: [
|
|
129
|
+
/* @__PURE__ */ e(u, { variant: "H2", children: $(l.days, i) }),
|
|
130
|
+
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: l.next_paycheck })
|
|
131
131
|
] }) })
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
) : /* @__PURE__ */ o(s, { border: `1px solid ${a.palette.border.light}`, borderRadius: 1, children: [
|
|
135
135
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
136
|
-
/* @__PURE__ */ e(
|
|
136
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: $(
|
|
137
137
|
l.total_cash_accounts,
|
|
138
138
|
d.length
|
|
139
139
|
) }),
|
|
140
|
-
/* @__PURE__ */ e(
|
|
140
|
+
/* @__PURE__ */ e(O, { amount: f, bold: !0, variant: "XSmall" })
|
|
141
141
|
] }),
|
|
142
|
-
/* @__PURE__ */ e(
|
|
142
|
+
/* @__PURE__ */ e(v, {}),
|
|
143
143
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
144
|
-
/* @__PURE__ */ e(
|
|
145
|
-
/* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: $(l.expenses_due, m.length) }),
|
|
145
|
+
/* @__PURE__ */ e(O, { amount: I, bold: !0, symbol: "-", variant: "XSmall" })
|
|
146
146
|
] }),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
147
|
+
/* @__PURE__ */ e(v, {}),
|
|
148
148
|
/* @__PURE__ */ e(
|
|
149
149
|
s,
|
|
150
150
|
{
|
|
@@ -156,51 +156,51 @@ const K = () => {
|
|
|
156
156
|
justifyContent: "space-between",
|
|
157
157
|
px: 16,
|
|
158
158
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
159
|
-
children: /* @__PURE__ */ e(
|
|
159
|
+
children: /* @__PURE__ */ e(fe, { remaining: L })
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
/* @__PURE__ */ e(
|
|
162
|
+
/* @__PURE__ */ e(v, {}),
|
|
163
163
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
164
|
-
/* @__PURE__ */ e(
|
|
165
|
-
/* @__PURE__ */ e(
|
|
164
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: l.next_paycheck }),
|
|
165
|
+
/* @__PURE__ */ e(u, { bold: !0, variant: "XSmall", children: $(l.days, i) })
|
|
166
166
|
] })
|
|
167
167
|
] }) }) : /* @__PURE__ */ e(te, { height: t ? 210 : 120 });
|
|
168
|
-
}, yt =
|
|
168
|
+
}, yt = T(xt), Ct = ({
|
|
169
169
|
onPrimaryCtaClick: a,
|
|
170
170
|
onSecondaryCtaClick: n,
|
|
171
171
|
sx: t = {}
|
|
172
172
|
}) => {
|
|
173
|
-
const { cashflow:
|
|
173
|
+
const { cashflow: r } = N(), { isCopyLoaded: f, isInitialized: x } = Y(), { loadRepeatingTransactions: c, income: g, isDataLoaded: l, setDateRange: i } = U();
|
|
174
174
|
p.useEffect(() => {
|
|
175
|
-
|
|
176
|
-
}, [
|
|
177
|
-
const m = l && !
|
|
175
|
+
x && (i({ start: W(), end: Pe(W(), 1) }), c().finally());
|
|
176
|
+
}, [x]);
|
|
177
|
+
const m = l && !g.length;
|
|
178
178
|
return f ? /* @__PURE__ */ o(
|
|
179
179
|
Ve,
|
|
180
180
|
{
|
|
181
181
|
className: "mx-exp-cashflow-miniwidget",
|
|
182
182
|
onPrimaryCtaClick: a,
|
|
183
|
-
primaryCtaLabel:
|
|
184
|
-
subTitle: m || !l ? void 0 :
|
|
183
|
+
primaryCtaLabel: r.primary_cta,
|
|
184
|
+
subTitle: m || !l ? void 0 : r.sub_title,
|
|
185
185
|
sx: t,
|
|
186
|
-
title:
|
|
186
|
+
title: r.title,
|
|
187
187
|
children: [
|
|
188
188
|
!l && /* @__PURE__ */ e(te, {}),
|
|
189
189
|
l && (m ? /* @__PURE__ */ e(
|
|
190
190
|
Ke,
|
|
191
191
|
{
|
|
192
|
-
header:
|
|
192
|
+
header: r.create,
|
|
193
193
|
icon: "local_atm",
|
|
194
194
|
onClick: n,
|
|
195
|
-
primaryButton:
|
|
195
|
+
primaryButton: r.add_income,
|
|
196
196
|
primaryButtonStartIcon: "add",
|
|
197
|
-
subText:
|
|
197
|
+
subText: r.create_description
|
|
198
198
|
}
|
|
199
199
|
) : /* @__PURE__ */ e(yt, {}))
|
|
200
200
|
]
|
|
201
201
|
}
|
|
202
202
|
) : /* @__PURE__ */ e(te, {});
|
|
203
|
-
}, Hn =
|
|
203
|
+
}, Hn = T(Ct), St = ({ remaining: a }) => /* @__PURE__ */ e(
|
|
204
204
|
ne,
|
|
205
205
|
{
|
|
206
206
|
sx: {
|
|
@@ -213,19 +213,19 @@ const K = () => {
|
|
|
213
213
|
borderBottomRightRadius: "3px",
|
|
214
214
|
minHeight: "auto"
|
|
215
215
|
},
|
|
216
|
-
children: /* @__PURE__ */ e(
|
|
216
|
+
children: /* @__PURE__ */ e(fe, { remaining: a })
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
var oe = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(oe || {});
|
|
220
|
-
const wt = ({ recurrence: a }) => /* @__PURE__ */ o(
|
|
220
|
+
const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
221
221
|
/* @__PURE__ */ o(ne, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
222
222
|
/* @__PURE__ */ o(s, { alignItems: "center", height: 32, width: 32, children: [
|
|
223
|
-
/* @__PURE__ */ e(
|
|
224
|
-
/* @__PURE__ */ e(
|
|
223
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.MONTH) }),
|
|
224
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.DAY) })
|
|
225
225
|
] }),
|
|
226
|
-
/* @__PURE__ */ e(
|
|
226
|
+
/* @__PURE__ */ e(u, { sx: { flexGrow: 1, fontSize: 13 }, children: a.name }),
|
|
227
227
|
/* @__PURE__ */ e(
|
|
228
|
-
|
|
228
|
+
O,
|
|
229
229
|
{
|
|
230
230
|
amount: a.amount,
|
|
231
231
|
bold: !0,
|
|
@@ -233,10 +233,10 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
233
233
|
}
|
|
234
234
|
)
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ e(
|
|
237
|
-
] }), Ee =
|
|
238
|
-
const { cashflow: t } =
|
|
239
|
-
return /* @__PURE__ */ o(
|
|
236
|
+
/* @__PURE__ */ e(v, {})
|
|
237
|
+
] }), Ee = T(wt), _t = ({ total: a, type: n }) => {
|
|
238
|
+
const { cashflow: t } = N();
|
|
239
|
+
return /* @__PURE__ */ o(B, { children: [
|
|
240
240
|
/* @__PURE__ */ o(
|
|
241
241
|
tt,
|
|
242
242
|
{
|
|
@@ -250,36 +250,36 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
250
250
|
px: 24
|
|
251
251
|
},
|
|
252
252
|
children: [
|
|
253
|
-
/* @__PURE__ */ e(
|
|
254
|
-
/* @__PURE__ */ o(
|
|
253
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 12 }, children: n === oe.EXPENSE ? t.expenses : t.income }),
|
|
254
|
+
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
255
255
|
n === oe.EXPENSE ? "-" : "+",
|
|
256
256
|
Z(a, "0,0.00")
|
|
257
257
|
] })
|
|
258
258
|
]
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
|
-
/* @__PURE__ */ e(
|
|
261
|
+
/* @__PURE__ */ e(v, {})
|
|
262
262
|
] });
|
|
263
|
-
}, Te =
|
|
264
|
-
const { availableWidth: a } =
|
|
263
|
+
}, Te = T(_t), se = (a, n) => (t) => t.accountGuid === a.guid && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), It = () => {
|
|
264
|
+
const { availableWidth: a } = le(), { cashflow: n } = N(), { upcomingExpenses: t, upcomingIncome: r } = U(), { dateRange: f, selectedCashAccounts: x } = K();
|
|
265
265
|
return /* @__PURE__ */ o(s, { children: [
|
|
266
266
|
/* @__PURE__ */ o(s, { direction: a < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
267
|
-
/* @__PURE__ */ e(
|
|
268
|
-
/* @__PURE__ */ o(
|
|
267
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
268
|
+
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
269
269
|
Q(f.start, V.FULL_MONTH_DAY),
|
|
270
270
|
" -",
|
|
271
271
|
" ",
|
|
272
272
|
Q(f.end, V.FULL_MONTH_DAY)
|
|
273
273
|
] })
|
|
274
274
|
] }),
|
|
275
|
-
/* @__PURE__ */ e(s, { children:
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
),
|
|
279
|
-
(d,
|
|
275
|
+
/* @__PURE__ */ e(s, { children: x.map((c) => {
|
|
276
|
+
const g = r.filter(se(c, f)).sort((d, b) => z(d.expectedDate) - z(b.expectedDate)), l = t.filter(
|
|
277
|
+
se(c, f)
|
|
278
|
+
), i = g.reduce(
|
|
279
|
+
(d, b) => d + b.amount,
|
|
280
280
|
0
|
|
281
281
|
), m = l.reduce(
|
|
282
|
-
(d,
|
|
282
|
+
(d, b) => d + b.amount,
|
|
283
283
|
0
|
|
284
284
|
);
|
|
285
285
|
return /* @__PURE__ */ o(
|
|
@@ -303,13 +303,13 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
),
|
|
306
|
-
/* @__PURE__ */ e(
|
|
307
|
-
|
|
306
|
+
/* @__PURE__ */ e(v, {}),
|
|
307
|
+
g.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
308
308
|
ee,
|
|
309
309
|
{
|
|
310
|
-
subheader: /* @__PURE__ */ e(Te, { total:
|
|
310
|
+
subheader: /* @__PURE__ */ e(Te, { total: i, type: oe.INCOME }),
|
|
311
311
|
sx: { width: "100%" },
|
|
312
|
-
children:
|
|
312
|
+
children: g.map((d) => /* @__PURE__ */ e(Ee, { recurrence: d }, d.repeatingTransactionGuid))
|
|
313
313
|
}
|
|
314
314
|
) }),
|
|
315
315
|
l.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
@@ -323,7 +323,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
323
323
|
/* @__PURE__ */ e(
|
|
324
324
|
St,
|
|
325
325
|
{
|
|
326
|
-
remaining: (c.available_balance || c.balance || 0) +
|
|
326
|
+
remaining: (c.available_balance || c.balance || 0) + i - m
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
]
|
|
@@ -332,14 +332,14 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
332
332
|
);
|
|
333
333
|
}) })
|
|
334
334
|
] });
|
|
335
|
-
},
|
|
336
|
-
const { availableWidth: a } =
|
|
335
|
+
}, Dt = T(It), vt = () => {
|
|
336
|
+
const { availableWidth: a } = le(), n = ce(), { cashflow: t } = N(), { upcomingExpenses: r, upcomingIncome: f } = U(), { dateRange: x, selectedCashAccounts: c } = K(), g = [
|
|
337
337
|
{
|
|
338
338
|
field: "account",
|
|
339
339
|
flex: 1.5,
|
|
340
340
|
headerName: t.accounts,
|
|
341
|
-
renderCell: ({ value: { name:
|
|
342
|
-
const
|
|
341
|
+
renderCell: ({ value: { name: i, nickname: m, institution_guid: d, account_number: b } }) => {
|
|
342
|
+
const C = m || i;
|
|
343
343
|
return /* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
344
344
|
/* @__PURE__ */ e(
|
|
345
345
|
xe,
|
|
@@ -349,7 +349,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
349
349
|
size: 16
|
|
350
350
|
}
|
|
351
351
|
),
|
|
352
|
-
/* @__PURE__ */ e(
|
|
352
|
+
/* @__PURE__ */ e(u, { variant: "body2", children: `${C} ${b ? `*${b}` : ""}` })
|
|
353
353
|
] });
|
|
354
354
|
}
|
|
355
355
|
},
|
|
@@ -358,31 +358,31 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
358
358
|
flex: 1,
|
|
359
359
|
headerName: t.balance,
|
|
360
360
|
type: "number",
|
|
361
|
-
renderCell: (
|
|
361
|
+
renderCell: (i) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: Z(i.value, "0,0.00") })
|
|
362
362
|
},
|
|
363
363
|
{
|
|
364
364
|
field: "income",
|
|
365
365
|
flex: 1,
|
|
366
366
|
headerName: t.projected_income,
|
|
367
367
|
type: "number",
|
|
368
|
-
renderCell: (
|
|
368
|
+
renderCell: (i) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `+${Z(i.value, "0,0.00")}` })
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
field: "expenses",
|
|
372
372
|
flex: 1.1,
|
|
373
373
|
headerName: t.projected_expenses,
|
|
374
374
|
type: "number",
|
|
375
|
-
renderCell: (
|
|
375
|
+
renderCell: (i) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `-${Z(i.value, "0,0.00")}` })
|
|
376
376
|
},
|
|
377
377
|
{
|
|
378
378
|
field: "remaining",
|
|
379
379
|
flex: 1,
|
|
380
380
|
headerName: t.remaining,
|
|
381
381
|
type: "number",
|
|
382
|
-
renderCell: (
|
|
383
|
-
const m =
|
|
382
|
+
renderCell: (i) => {
|
|
383
|
+
const m = i.row.balance + i.row.income - i.row.expenses;
|
|
384
384
|
return /* @__PURE__ */ e(
|
|
385
|
-
|
|
385
|
+
u,
|
|
386
386
|
{
|
|
387
387
|
color: Math.sign(m) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
388
388
|
variant: "Small",
|
|
@@ -391,23 +391,23 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
], l = p.useMemo(() => c.map((
|
|
395
|
-
const m =
|
|
396
|
-
|
|
397
|
-
).reduce((
|
|
398
|
-
|
|
399
|
-
).reduce((
|
|
394
|
+
], l = p.useMemo(() => c.map((i) => {
|
|
395
|
+
const m = r.filter(
|
|
396
|
+
se(i, { start: W(), end: Ce(W(), 30) })
|
|
397
|
+
).reduce((C, S) => C + S.amount, 0), d = f.filter(
|
|
398
|
+
se(i, { start: W(), end: Ce(W(), 30) })
|
|
399
|
+
).reduce((C, S) => C + S.amount, 0), b = (i.balance || 0) + d - m;
|
|
400
400
|
return {
|
|
401
|
-
account:
|
|
402
|
-
balance:
|
|
403
|
-
id:
|
|
401
|
+
account: i,
|
|
402
|
+
balance: i.balance || 0,
|
|
403
|
+
id: i.guid,
|
|
404
404
|
income: d,
|
|
405
405
|
expenses: m,
|
|
406
|
-
remaining:
|
|
406
|
+
remaining: b
|
|
407
407
|
};
|
|
408
|
-
}), [c,
|
|
408
|
+
}), [c, r, f]);
|
|
409
409
|
return /* @__PURE__ */ o(
|
|
410
|
-
|
|
410
|
+
D,
|
|
411
411
|
{
|
|
412
412
|
sx: {
|
|
413
413
|
width: "100%"
|
|
@@ -422,7 +422,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
422
422
|
children: [
|
|
423
423
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
424
424
|
/* @__PURE__ */ e(
|
|
425
|
-
|
|
425
|
+
u,
|
|
426
426
|
{
|
|
427
427
|
bold: !0,
|
|
428
428
|
sx: {
|
|
@@ -433,18 +433,18 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
435
|
/* @__PURE__ */ e(
|
|
436
|
-
|
|
436
|
+
pe,
|
|
437
437
|
{
|
|
438
438
|
body: t.table_tooltip_body,
|
|
439
439
|
title: t.table_tooltip_title
|
|
440
440
|
}
|
|
441
441
|
)
|
|
442
442
|
] }),
|
|
443
|
-
/* @__PURE__ */ o(
|
|
444
|
-
Q(
|
|
443
|
+
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
|
|
444
|
+
Q(x.start, V.FULL_MONTH_DAY),
|
|
445
445
|
" -",
|
|
446
446
|
" ",
|
|
447
|
-
Q(
|
|
447
|
+
Q(x.end, V.FULL_MONTH_DAY)
|
|
448
448
|
] })
|
|
449
449
|
]
|
|
450
450
|
}
|
|
@@ -453,7 +453,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
453
453
|
at,
|
|
454
454
|
{
|
|
455
455
|
columnHeaderHeight: 48,
|
|
456
|
-
columns:
|
|
456
|
+
columns: g,
|
|
457
457
|
density: "standard",
|
|
458
458
|
disableColumnMenu: !0,
|
|
459
459
|
disableRowSelectionOnClick: !0,
|
|
@@ -479,8 +479,8 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
) : l.map((
|
|
483
|
-
const { name: m, nickname: d, institution_guid:
|
|
482
|
+
) : l.map((i) => {
|
|
483
|
+
const { name: m, nickname: d, institution_guid: b, account_number: C } = i.account, S = d || m;
|
|
484
484
|
return /* @__PURE__ */ e(
|
|
485
485
|
ee,
|
|
486
486
|
{
|
|
@@ -505,17 +505,17 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
505
505
|
xe,
|
|
506
506
|
{
|
|
507
507
|
alt: t.institution_logo,
|
|
508
|
-
institutionGuid:
|
|
508
|
+
institutionGuid: b || "",
|
|
509
509
|
size: 16
|
|
510
510
|
}
|
|
511
511
|
),
|
|
512
|
-
/* @__PURE__ */ e(
|
|
512
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: `${S} ${C ? `*${C}` : ""}` })
|
|
513
513
|
] }),
|
|
514
|
-
/* @__PURE__ */ e(
|
|
514
|
+
/* @__PURE__ */ e(O, { amount: i.balance, bold: !0, variant: "Small" })
|
|
515
515
|
]
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
/* @__PURE__ */ e(
|
|
518
|
+
/* @__PURE__ */ e(v, { sx: { width: "100%" } }),
|
|
519
519
|
/* @__PURE__ */ o(
|
|
520
520
|
s,
|
|
521
521
|
{
|
|
@@ -525,12 +525,12 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
525
525
|
px: 16,
|
|
526
526
|
py: 12,
|
|
527
527
|
children: [
|
|
528
|
-
/* @__PURE__ */ e(
|
|
529
|
-
/* @__PURE__ */ e(
|
|
528
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: t.projected_income }),
|
|
529
|
+
/* @__PURE__ */ e(O, { amount: i.income, bold: !0, symbol: "+", variant: "Small" })
|
|
530
530
|
]
|
|
531
531
|
}
|
|
532
532
|
),
|
|
533
|
-
/* @__PURE__ */ e(
|
|
533
|
+
/* @__PURE__ */ e(v, { sx: { width: "100%" } }),
|
|
534
534
|
/* @__PURE__ */ o(
|
|
535
535
|
s,
|
|
536
536
|
{
|
|
@@ -540,12 +540,12 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
540
540
|
px: 16,
|
|
541
541
|
py: 12,
|
|
542
542
|
children: [
|
|
543
|
-
/* @__PURE__ */ e(
|
|
544
|
-
/* @__PURE__ */ e(
|
|
543
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: t.projected_expenses }),
|
|
544
|
+
/* @__PURE__ */ e(O, { amount: i.expenses, bold: !0, symbol: "-", variant: "Small" })
|
|
545
545
|
]
|
|
546
546
|
}
|
|
547
547
|
),
|
|
548
|
-
/* @__PURE__ */ e(
|
|
548
|
+
/* @__PURE__ */ e(v, { sx: { width: "100%" } }),
|
|
549
549
|
/* @__PURE__ */ e(
|
|
550
550
|
s,
|
|
551
551
|
{
|
|
@@ -557,32 +557,32 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
557
557
|
px: 16,
|
|
558
558
|
py: 12,
|
|
559
559
|
sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
|
|
560
|
-
children: /* @__PURE__ */ e(
|
|
560
|
+
children: /* @__PURE__ */ e(fe, { remaining: i.remaining })
|
|
561
561
|
}
|
|
562
562
|
)
|
|
563
563
|
] }) })
|
|
564
564
|
},
|
|
565
|
-
|
|
565
|
+
i.id
|
|
566
566
|
);
|
|
567
567
|
})
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
|
-
}, At =
|
|
572
|
-
const { cashflow: a } =
|
|
573
|
-
f(
|
|
571
|
+
}, At = T(vt), Et = () => {
|
|
572
|
+
const { cashflow: a } = N(), { isDesktop: n } = he(), { onEvent: t } = Ne(), [r, f] = p.useState(0), x = (c, g) => {
|
|
573
|
+
f(g);
|
|
574
574
|
};
|
|
575
575
|
return p.useEffect(() => {
|
|
576
|
-
t(
|
|
577
|
-
}, [
|
|
576
|
+
t(r === 0 ? "cash_flow_summary" : "cash_flow_details");
|
|
577
|
+
}, [r]), /* @__PURE__ */ o(D, { children: [
|
|
578
578
|
/* @__PURE__ */ o(
|
|
579
579
|
Ze,
|
|
580
580
|
{
|
|
581
581
|
"aria-label": a.cashflow_summary_and_details,
|
|
582
582
|
centered: !0,
|
|
583
|
-
onChange:
|
|
583
|
+
onChange: x,
|
|
584
584
|
textColor: "primary",
|
|
585
|
-
value:
|
|
585
|
+
value: r,
|
|
586
586
|
variant: "fullWidth",
|
|
587
587
|
children: [
|
|
588
588
|
/* @__PURE__ */ e(
|
|
@@ -610,17 +610,17 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
610
610
|
]
|
|
611
611
|
}
|
|
612
612
|
),
|
|
613
|
-
/* @__PURE__ */ e(
|
|
614
|
-
/* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value:
|
|
615
|
-
/* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value:
|
|
613
|
+
/* @__PURE__ */ e(D, { sx: { mb: 32 } }),
|
|
614
|
+
/* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value: r, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(At, {}) }) }),
|
|
615
|
+
/* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value: r, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Dt, {}) }) })
|
|
616
616
|
] });
|
|
617
|
-
}, Tt =
|
|
617
|
+
}, Tt = T(Et), re = ({
|
|
618
618
|
amount: a,
|
|
619
619
|
isMobile: n = !1,
|
|
620
620
|
isTotal: t = !1,
|
|
621
|
-
label:
|
|
621
|
+
label: r,
|
|
622
622
|
symbol: f,
|
|
623
|
-
tooltip:
|
|
623
|
+
tooltip: x
|
|
624
624
|
}) => /* @__PURE__ */ o(
|
|
625
625
|
s,
|
|
626
626
|
{
|
|
@@ -630,93 +630,85 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
630
630
|
padding: n ? "14px 16px" : 0,
|
|
631
631
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
632
632
|
children: [
|
|
633
|
-
!n && /* @__PURE__ */ e(
|
|
633
|
+
!n && /* @__PURE__ */ e(O, { amount: a, component: "h2", variant: "H2" }),
|
|
634
634
|
/* @__PURE__ */ o(s, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
|
|
635
|
-
/* @__PURE__ */ e(
|
|
636
|
-
|
|
635
|
+
/* @__PURE__ */ e(u, { bold: t, variant: "Small", children: r }),
|
|
636
|
+
x
|
|
637
637
|
] }),
|
|
638
|
-
n && /* @__PURE__ */ e(
|
|
638
|
+
n && /* @__PURE__ */ e(O, { amount: a, component: "h2", symbol: f, variant: "Small" })
|
|
639
639
|
]
|
|
640
640
|
}
|
|
641
|
-
), Re = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && (
|
|
642
|
-
const { availableWidth: a } =
|
|
643
|
-
() => f.filter(Re(c,
|
|
644
|
-
[
|
|
645
|
-
),
|
|
646
|
-
() =>
|
|
647
|
-
[
|
|
648
|
-
),
|
|
649
|
-
() => l.reduce((
|
|
641
|
+
), Re = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), Rt = () => {
|
|
642
|
+
const { availableWidth: a } = le(), { cashflow: n } = N(), { income: t, isDataLoaded: r, upcomingExpenses: f, upcomingIncome: x } = U(), { selectedAccountGuids: c } = Y(), { dateRange: g, selectedCashAccounts: l } = K(), [i, m] = p.useState(!1), d = p.useMemo(
|
|
643
|
+
() => f.filter(Re(c, g)),
|
|
644
|
+
[g, c, f]
|
|
645
|
+
), b = p.useMemo(
|
|
646
|
+
() => x.filter(Re(c, g)),
|
|
647
|
+
[g, c, x]
|
|
648
|
+
), C = p.useMemo(
|
|
649
|
+
() => l.reduce((I, L) => I + (L?.balance || 0), 0),
|
|
650
650
|
[l]
|
|
651
|
-
),
|
|
652
|
-
return /* @__PURE__ */ o(s, { sx: { mx:
|
|
651
|
+
), S = d.reduce((I, L) => I + L.amount, 0), R = b.reduce((I, L) => I + L.amount, 0), H = C - S + R, F = r && t.length > 0, h = a < 725;
|
|
652
|
+
return /* @__PURE__ */ o(s, { sx: { mx: h ? 16 : 0, my: h ? 24 : 42 }, children: [
|
|
653
653
|
/* @__PURE__ */ o(
|
|
654
654
|
s,
|
|
655
655
|
{
|
|
656
|
-
border:
|
|
656
|
+
border: h ? "1px solid" : "none",
|
|
657
657
|
borderColor: "border.light",
|
|
658
658
|
borderRadius: 2,
|
|
659
|
-
flexDirection:
|
|
660
|
-
gap:
|
|
659
|
+
flexDirection: h ? "column" : "row",
|
|
660
|
+
gap: h ? 0 : 24,
|
|
661
661
|
justifyContent: "center",
|
|
662
662
|
children: [
|
|
663
663
|
/* @__PURE__ */ e(
|
|
664
|
-
|
|
664
|
+
re,
|
|
665
665
|
{
|
|
666
|
-
amount:
|
|
667
|
-
isMobile:
|
|
668
|
-
label:
|
|
666
|
+
amount: C,
|
|
667
|
+
isMobile: h,
|
|
668
|
+
label: $(n.cash_and_bank, l.length)
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
!
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
{
|
|
677
|
-
onClick: () => d(!0),
|
|
678
|
-
startIcon: /* @__PURE__ */ e(M, { name: "add" }),
|
|
679
|
-
sx: { fontSize: 13 },
|
|
680
|
-
children: n.add_income
|
|
681
|
-
}
|
|
682
|
-
) : /* @__PURE__ */ e(
|
|
683
|
-
ie,
|
|
671
|
+
h && /* @__PURE__ */ e(v, {}),
|
|
672
|
+
F ? /* @__PURE__ */ o(B, { children: [
|
|
673
|
+
!h && /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
674
|
+
/* @__PURE__ */ e(
|
|
675
|
+
re,
|
|
684
676
|
{
|
|
685
|
-
amount:
|
|
686
|
-
isMobile:
|
|
677
|
+
amount: R,
|
|
678
|
+
isMobile: h,
|
|
687
679
|
label: n.to_be_received,
|
|
688
|
-
symbol:
|
|
680
|
+
symbol: h ? "+" : void 0
|
|
689
681
|
}
|
|
690
|
-
)
|
|
682
|
+
)
|
|
691
683
|
] }) : /* @__PURE__ */ e(
|
|
692
|
-
|
|
684
|
+
M,
|
|
693
685
|
{
|
|
694
|
-
onClick: () =>
|
|
695
|
-
startIcon: /* @__PURE__ */ e(
|
|
686
|
+
onClick: () => m(!0),
|
|
687
|
+
startIcon: /* @__PURE__ */ e(G, { name: "add" }),
|
|
696
688
|
sx: { fontSize: 13 },
|
|
697
689
|
children: n.add_income
|
|
698
690
|
}
|
|
699
691
|
),
|
|
700
|
-
|
|
692
|
+
h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
701
693
|
/* @__PURE__ */ e(
|
|
702
|
-
|
|
694
|
+
re,
|
|
703
695
|
{
|
|
704
|
-
amount:
|
|
705
|
-
isMobile:
|
|
706
|
-
label:
|
|
707
|
-
symbol:
|
|
696
|
+
amount: S,
|
|
697
|
+
isMobile: h,
|
|
698
|
+
label: $(n.to_be_paid_out, d.length),
|
|
699
|
+
symbol: h ? "-" : void 0
|
|
708
700
|
}
|
|
709
701
|
),
|
|
710
|
-
|
|
702
|
+
h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
711
703
|
/* @__PURE__ */ e(
|
|
712
|
-
|
|
704
|
+
re,
|
|
713
705
|
{
|
|
714
|
-
amount:
|
|
715
|
-
isMobile:
|
|
716
|
-
isTotal:
|
|
706
|
+
amount: H,
|
|
707
|
+
isMobile: h,
|
|
708
|
+
isTotal: h,
|
|
717
709
|
label: n.remaining_cash,
|
|
718
710
|
tooltip: /* @__PURE__ */ e(
|
|
719
|
-
|
|
711
|
+
pe,
|
|
720
712
|
{
|
|
721
713
|
body: n.remaining_income_tooltip_body,
|
|
722
714
|
title: n.remaining_income_tooltip_title
|
|
@@ -728,98 +720,98 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
728
720
|
}
|
|
729
721
|
),
|
|
730
722
|
/* @__PURE__ */ e(
|
|
731
|
-
|
|
723
|
+
$e,
|
|
732
724
|
{
|
|
733
725
|
ariaLabelClose: n.close_manage_income_aria,
|
|
734
|
-
isOpen:
|
|
735
|
-
onClose: () =>
|
|
726
|
+
isOpen: i,
|
|
727
|
+
onClose: () => m(!1),
|
|
736
728
|
shouldShowHeaderBorders: !1,
|
|
737
729
|
title: n.manage_income,
|
|
738
730
|
children: /* @__PURE__ */ e(it, {})
|
|
739
731
|
}
|
|
740
732
|
)
|
|
741
733
|
] });
|
|
742
|
-
}, Lt =
|
|
743
|
-
const { completeOnboarding: n } =
|
|
734
|
+
}, Lt = T(Rt), Ot = ({ handleNextStep: a }) => {
|
|
735
|
+
const { completeOnboarding: n } = ue(), { cashflow: t } = N(), r = ce();
|
|
744
736
|
return /* @__PURE__ */ o(s, { children: [
|
|
745
|
-
/* @__PURE__ */ e(
|
|
737
|
+
/* @__PURE__ */ e(me, { pb: 12, children: t.welcome_title }),
|
|
746
738
|
/* @__PURE__ */ e(
|
|
747
|
-
|
|
739
|
+
qe,
|
|
748
740
|
{
|
|
749
|
-
color:
|
|
741
|
+
color: r.palette.primary.light,
|
|
750
742
|
pb: 8,
|
|
751
743
|
sx: { wordBreak: "break-word", whiteSpace: "initial" },
|
|
752
744
|
variant: "H3",
|
|
753
745
|
children: t.welcome_sub_title
|
|
754
746
|
}
|
|
755
747
|
),
|
|
756
|
-
/* @__PURE__ */ e(
|
|
748
|
+
/* @__PURE__ */ e(k, { pb: 32, children: t.welcome_description }),
|
|
757
749
|
/* @__PURE__ */ o(s, { direction: "column", mb: 32, spacing: 32, children: [
|
|
758
|
-
/* @__PURE__ */ o(
|
|
750
|
+
/* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
759
751
|
/* @__PURE__ */ e(
|
|
760
|
-
|
|
752
|
+
D,
|
|
761
753
|
{
|
|
762
|
-
bgcolor:
|
|
754
|
+
bgcolor: r.palette.primary.lighter,
|
|
763
755
|
borderRadius: 1,
|
|
764
756
|
component: "span",
|
|
765
757
|
height: 44,
|
|
766
758
|
mr: 24,
|
|
767
759
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
768
760
|
width: 44,
|
|
769
|
-
children: /* @__PURE__ */ e(
|
|
761
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "currency_exchange" })
|
|
770
762
|
}
|
|
771
763
|
),
|
|
772
764
|
t.bullet_one
|
|
773
765
|
] }),
|
|
774
|
-
/* @__PURE__ */ o(
|
|
766
|
+
/* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
775
767
|
/* @__PURE__ */ e(
|
|
776
|
-
|
|
768
|
+
D,
|
|
777
769
|
{
|
|
778
|
-
bgcolor:
|
|
770
|
+
bgcolor: r.palette.primary.lighter,
|
|
779
771
|
borderRadius: 1,
|
|
780
772
|
component: "span",
|
|
781
773
|
height: 44,
|
|
782
774
|
mr: 24,
|
|
783
775
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
784
776
|
width: 44,
|
|
785
|
-
children: /* @__PURE__ */ e(
|
|
777
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "cardiology" })
|
|
786
778
|
}
|
|
787
779
|
),
|
|
788
780
|
t.bullet_two
|
|
789
781
|
] }),
|
|
790
|
-
/* @__PURE__ */ o(
|
|
782
|
+
/* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
791
783
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
784
|
+
D,
|
|
793
785
|
{
|
|
794
|
-
bgcolor:
|
|
786
|
+
bgcolor: r.palette.primary.lighter,
|
|
795
787
|
borderRadius: 1,
|
|
796
788
|
component: "span",
|
|
797
789
|
height: 44,
|
|
798
790
|
mr: 24,
|
|
799
791
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
800
792
|
width: 44,
|
|
801
|
-
children: /* @__PURE__ */ e(
|
|
793
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "flare" })
|
|
802
794
|
}
|
|
803
795
|
),
|
|
804
796
|
t.bullet_three
|
|
805
797
|
] })
|
|
806
798
|
] }),
|
|
807
799
|
/* @__PURE__ */ o(s, { direction: "row", spacing: 16, children: [
|
|
808
|
-
/* @__PURE__ */ e(
|
|
809
|
-
/* @__PURE__ */ e(
|
|
800
|
+
/* @__PURE__ */ e(M, { onClick: a, variant: "contained", children: t.get_started_button }),
|
|
801
|
+
/* @__PURE__ */ e(M, { onClick: n, variant: "outlined", children: t.skip_button })
|
|
810
802
|
] })
|
|
811
803
|
] });
|
|
812
|
-
},
|
|
804
|
+
}, Nt = T(Ot), Le = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", Ge = {
|
|
813
805
|
CASHFLOW_ONBOARDING: `${Le}/cashflow-onboarding.png`,
|
|
814
806
|
CASHFLOW_LOADING_ANIMATION: `${Le}/loading-animation.gif`
|
|
815
807
|
}, kt = () => {
|
|
816
|
-
const { cashflow: a } =
|
|
808
|
+
const { cashflow: a } = N();
|
|
817
809
|
return /* @__PURE__ */ o(p.Fragment, { children: [
|
|
818
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src:
|
|
819
|
-
/* @__PURE__ */ e(
|
|
820
|
-
/* @__PURE__ */ e(
|
|
810
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: Ge.CASHFLOW_LOADING_ANIMATION }) }),
|
|
811
|
+
/* @__PURE__ */ e(me, { pb: 12, children: a.loading_title }),
|
|
812
|
+
/* @__PURE__ */ e(k, { children: a.loading_description })
|
|
821
813
|
] });
|
|
822
|
-
}, Ht =
|
|
814
|
+
}, Ht = T(kt), Ft = ot`
|
|
823
815
|
from {
|
|
824
816
|
transform: rotate(0deg);
|
|
825
817
|
}
|
|
@@ -827,62 +819,62 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
827
819
|
transform: rotate(360deg);
|
|
828
820
|
}
|
|
829
821
|
`, Wt = () => {
|
|
830
|
-
const { addRepeatingTransaction: a, repeatingTransactions: n } =
|
|
831
|
-
() => d.find((
|
|
832
|
-
[
|
|
833
|
-
),
|
|
834
|
-
(
|
|
822
|
+
const { addRepeatingTransaction: a, repeatingTransactions: n } = U(), { cashflow: t, common: r } = N(), { completeOnboarding: f } = ue(), { isDirty: x } = K(), { isMobile: c } = he(), { isCopyLoaded: g, setDisplayedDate: l } = Y(), { filter: i, setFilter: m, transactions: d } = ke(), b = ce(), [C, S] = J(!0), [R, H] = p.useState(ht.EveryMonth), [F, h] = p.useState(1), [I, L] = p.useState(15), [w, P] = J(!1), [q, ae] = J(1), [A, de] = J([]), [ie, X] = J(""), _ = p.useMemo(
|
|
823
|
+
() => d.find((y) => y.guid === ie),
|
|
824
|
+
[ie, d]
|
|
825
|
+
), je = !!n.filter(
|
|
826
|
+
(y) => y.repeating_transaction_type === Ie.Income
|
|
835
827
|
).length, ge = async () => {
|
|
836
828
|
ae(2), l(
|
|
837
829
|
// Beginning of the month, 90 days before today
|
|
838
|
-
dt(
|
|
839
|
-
|
|
840
|
-
), m({ ...
|
|
841
|
-
},
|
|
842
|
-
if (!(
|
|
843
|
-
|
|
844
|
-
for (let
|
|
845
|
-
const
|
|
846
|
-
account_guid:
|
|
847
|
-
amount:
|
|
848
|
-
merchant_guid:
|
|
849
|
-
description:
|
|
830
|
+
dt(Me(W(), 90)),
|
|
831
|
+
W()
|
|
832
|
+
), m({ ...i, custom: we }), ae(3);
|
|
833
|
+
}, ze = async () => {
|
|
834
|
+
if (!(A.length < 1)) {
|
|
835
|
+
P(!0);
|
|
836
|
+
for (let y = 0; y < A.length; y++) {
|
|
837
|
+
const E = A[y], be = De(R, _e(E.date)), Ue = {
|
|
838
|
+
account_guid: E.account_guid,
|
|
839
|
+
amount: E.amount,
|
|
840
|
+
merchant_guid: E.merchant_guid,
|
|
841
|
+
description: E.feed_description || E.description,
|
|
850
842
|
predicted_occurs_on: lt(be, { representation: "date" }),
|
|
851
843
|
recurrence_day: be.getDay(),
|
|
852
|
-
recurrence_type:
|
|
844
|
+
recurrence_type: R,
|
|
853
845
|
repeating_transaction_type: Ie.Income,
|
|
854
|
-
transaction_type:
|
|
846
|
+
transaction_type: E.transaction_type
|
|
855
847
|
};
|
|
856
|
-
await a(
|
|
848
|
+
await a(Ue, E);
|
|
857
849
|
}
|
|
858
850
|
await f();
|
|
859
851
|
}
|
|
860
|
-
},
|
|
861
|
-
return
|
|
862
|
-
|
|
852
|
+
}, Be = !_ && C || !_ && A.length < 1;
|
|
853
|
+
return g ? /* @__PURE__ */ o(
|
|
854
|
+
D,
|
|
863
855
|
{
|
|
864
856
|
sx: {
|
|
865
857
|
display: "flex",
|
|
866
858
|
alignItems: c ? "flex-start" : "center",
|
|
867
|
-
backgroundColor:
|
|
868
|
-
backgroundImage: c ? null : `url(${
|
|
859
|
+
backgroundColor: b.palette.background.paper,
|
|
860
|
+
backgroundImage: c ? null : `url(${Ge.CASHFLOW_ONBOARDING})`,
|
|
869
861
|
backgroundRepeat: "no-repeat",
|
|
870
862
|
backgroundPosition: "left 100px",
|
|
871
863
|
backgroundSize: "35%",
|
|
872
864
|
py: 24
|
|
873
865
|
},
|
|
874
866
|
children: [
|
|
875
|
-
|
|
876
|
-
|
|
867
|
+
q === 1 && /* @__PURE__ */ e(
|
|
868
|
+
D,
|
|
877
869
|
{
|
|
878
870
|
sx: {
|
|
879
871
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
880
872
|
},
|
|
881
|
-
children: /* @__PURE__ */ e(
|
|
873
|
+
children: /* @__PURE__ */ e(Nt, { handleNextStep: ge })
|
|
882
874
|
}
|
|
883
875
|
),
|
|
884
|
-
|
|
885
|
-
|
|
876
|
+
q === 2 && /* @__PURE__ */ e(
|
|
877
|
+
D,
|
|
886
878
|
{
|
|
887
879
|
sx: {
|
|
888
880
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
@@ -890,100 +882,100 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
890
882
|
children: /* @__PURE__ */ e(Ht, {})
|
|
891
883
|
}
|
|
892
884
|
),
|
|
893
|
-
|
|
894
|
-
|
|
885
|
+
q === 3 && /* @__PURE__ */ o(
|
|
886
|
+
D,
|
|
895
887
|
{
|
|
896
888
|
sx: {
|
|
897
889
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
898
890
|
},
|
|
899
891
|
children: [
|
|
900
|
-
/* @__PURE__ */ e(
|
|
901
|
-
/* @__PURE__ */ e(
|
|
902
|
-
|
|
903
|
-
/* @__PURE__ */ e(ee, { children:
|
|
892
|
+
/* @__PURE__ */ e(me, { pb: 12, children: t.add_income_title }),
|
|
893
|
+
/* @__PURE__ */ e(k, { mb: 24, children: t.add_income_description }),
|
|
894
|
+
A.length > 0 && !_ && /* @__PURE__ */ o(B, { children: [
|
|
895
|
+
/* @__PURE__ */ e(ee, { children: A.map((y, E) => /* @__PURE__ */ o(p.Fragment, { children: [
|
|
904
896
|
/* @__PURE__ */ e(mt, { bgcolor: "background.paper", children: pt(
|
|
905
|
-
|
|
897
|
+
z(y.nextDate || y.date)
|
|
906
898
|
) }),
|
|
907
|
-
/* @__PURE__ */ e(ut, { transaction:
|
|
908
|
-
|
|
909
|
-
] },
|
|
899
|
+
/* @__PURE__ */ e(ut, { transaction: y }),
|
|
900
|
+
E !== A.length - 1 && /* @__PURE__ */ e(v, {})
|
|
901
|
+
] }, y.guid)) }),
|
|
910
902
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", children: [
|
|
911
|
-
/* @__PURE__ */ e(
|
|
903
|
+
/* @__PURE__ */ e(v, { sx: { flexGrow: 1 } }),
|
|
912
904
|
/* @__PURE__ */ e(
|
|
913
|
-
|
|
905
|
+
M,
|
|
914
906
|
{
|
|
915
|
-
onClick: () =>
|
|
916
|
-
startIcon: /* @__PURE__ */ e(
|
|
907
|
+
onClick: () => S(!0),
|
|
908
|
+
startIcon: /* @__PURE__ */ e(G, { name: "add", size: 20 }),
|
|
917
909
|
children: t.add_income
|
|
918
910
|
}
|
|
919
911
|
)
|
|
920
912
|
] })
|
|
921
913
|
] }),
|
|
922
|
-
|
|
914
|
+
Be && /* @__PURE__ */ e(
|
|
923
915
|
rt,
|
|
924
916
|
{
|
|
925
917
|
bgcolor: "background.paper",
|
|
926
|
-
onSearch: (
|
|
927
|
-
...
|
|
928
|
-
custom: (
|
|
918
|
+
onSearch: (y) => m({
|
|
919
|
+
...i,
|
|
920
|
+
custom: (E) => y ? st(E, y) : we(E)
|
|
929
921
|
}),
|
|
930
|
-
onSelected: (
|
|
931
|
-
|
|
922
|
+
onSelected: (y) => {
|
|
923
|
+
X(y), S(!1);
|
|
932
924
|
}
|
|
933
925
|
}
|
|
934
926
|
),
|
|
935
|
-
!
|
|
936
|
-
|
|
927
|
+
!je && x && /* @__PURE__ */ e(k, { color: "error", mt: 16, children: t.confirm_error }),
|
|
928
|
+
_ && /* @__PURE__ */ o(B, { children: [
|
|
937
929
|
/* @__PURE__ */ e(
|
|
938
930
|
ct,
|
|
939
931
|
{
|
|
940
932
|
bgcolor: "background.paper",
|
|
941
|
-
firstDay:
|
|
942
|
-
frequency:
|
|
943
|
-
onFirstDayChange:
|
|
944
|
-
onFrequencyChange:
|
|
945
|
-
onSecondDayChange:
|
|
946
|
-
secondDay:
|
|
947
|
-
transaction:
|
|
933
|
+
firstDay: F,
|
|
934
|
+
frequency: R,
|
|
935
|
+
onFirstDayChange: h,
|
|
936
|
+
onFrequencyChange: H,
|
|
937
|
+
onSecondDayChange: L,
|
|
938
|
+
secondDay: I,
|
|
939
|
+
transaction: _
|
|
948
940
|
}
|
|
949
941
|
),
|
|
950
942
|
/* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
951
943
|
/* @__PURE__ */ e(
|
|
952
|
-
|
|
944
|
+
M,
|
|
953
945
|
{
|
|
954
|
-
"aria-disabled": !
|
|
946
|
+
"aria-disabled": !_,
|
|
955
947
|
onClick: () => {
|
|
956
|
-
const
|
|
957
|
-
|
|
958
|
-
...
|
|
959
|
-
nextDate:
|
|
960
|
-
frequency:
|
|
961
|
-
}),
|
|
948
|
+
const y = [...A];
|
|
949
|
+
y.push({
|
|
950
|
+
..._,
|
|
951
|
+
nextDate: De(R, _e(_.date)),
|
|
952
|
+
frequency: R
|
|
953
|
+
}), de(y), X("");
|
|
962
954
|
},
|
|
963
955
|
variant: "contained",
|
|
964
|
-
children:
|
|
956
|
+
children: r.confirm_button
|
|
965
957
|
}
|
|
966
958
|
),
|
|
967
959
|
/* @__PURE__ */ e(
|
|
968
|
-
|
|
960
|
+
M,
|
|
969
961
|
{
|
|
970
962
|
onClick: () => {
|
|
971
|
-
|
|
963
|
+
X(""), S(!0), ge().finally();
|
|
972
964
|
},
|
|
973
965
|
variant: "outlined",
|
|
974
|
-
children:
|
|
966
|
+
children: r.cancel_button
|
|
975
967
|
}
|
|
976
968
|
)
|
|
977
969
|
] })
|
|
978
970
|
] }),
|
|
979
|
-
|
|
971
|
+
A.length > 0 && !_ && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
980
972
|
/* @__PURE__ */ e(
|
|
981
|
-
|
|
973
|
+
M,
|
|
982
974
|
{
|
|
983
|
-
"aria-disabled":
|
|
984
|
-
onClick:
|
|
985
|
-
startIcon:
|
|
986
|
-
|
|
975
|
+
"aria-disabled": A.length < 1 || w,
|
|
976
|
+
onClick: ze,
|
|
977
|
+
startIcon: w ? /* @__PURE__ */ e(
|
|
978
|
+
G,
|
|
987
979
|
{
|
|
988
980
|
name: "progress_activity",
|
|
989
981
|
sx: {
|
|
@@ -995,7 +987,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
995
987
|
children: t.confirm_income_button
|
|
996
988
|
}
|
|
997
989
|
),
|
|
998
|
-
/* @__PURE__ */ e(
|
|
990
|
+
/* @__PURE__ */ e(M, { onClick: f, variant: "outlined", children: t.skip_button })
|
|
999
991
|
] })
|
|
1000
992
|
]
|
|
1001
993
|
}
|
|
@@ -1003,96 +995,98 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1003
995
|
]
|
|
1004
996
|
}
|
|
1005
997
|
) : /* @__PURE__ */ e(te, {});
|
|
1006
|
-
}, $t =
|
|
998
|
+
}, $t = T(Wt), Mt = ({ onBackClick: a, sx: n = {} }) => {
|
|
1007
999
|
const {
|
|
1008
1000
|
selectedAccounts: t,
|
|
1009
|
-
selectedAccountGuids:
|
|
1001
|
+
selectedAccountGuids: r,
|
|
1010
1002
|
setSelectedAccounts: f,
|
|
1011
|
-
shouldDisableNextDate:
|
|
1003
|
+
shouldDisableNextDate: x,
|
|
1012
1004
|
shouldDisablePrevDate: c
|
|
1013
|
-
} = Y(), { onEvent:
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
}, [
|
|
1017
|
-
f(
|
|
1018
|
-
}, [
|
|
1019
|
-
const
|
|
1020
|
-
(
|
|
1005
|
+
} = Y(), { onEvent: g } = Ne(), { clientConfig: l } = Ye(), { visibleCashAccounts: i } = Oe(), { setFilter: m } = ke(), { userProfile: d } = Qe(), { dateRange: b, setSelectedCashAccounts: C } = K(), { loadRepeatingTransactions: S, income: R, isDataLoaded: H, setDateRange: F } = U(), { cashflow: h, recurring: I } = N(), { isCopyLoaded: L, isInitialized: w } = Y(), q = l?.master?.deep_link_params?.view === "manage_income", [ae, A] = p.useState(q);
|
|
1006
|
+
p.useEffect(() => {
|
|
1007
|
+
w && (F(b), S().finally());
|
|
1008
|
+
}, [w]), p.useEffect(() => {
|
|
1009
|
+
f(i);
|
|
1010
|
+
}, [i]), p.useEffect(() => {
|
|
1011
|
+
const ie = i.map((_) => _.guid), X = t.filter(
|
|
1012
|
+
(_) => r.includes(_.guid) && ie.includes(_.guid)
|
|
1021
1013
|
);
|
|
1022
|
-
|
|
1023
|
-
dateRange: { start:
|
|
1024
|
-
accounts:
|
|
1014
|
+
C(X), m({
|
|
1015
|
+
dateRange: { start: Me(W(), 90), end: ft() },
|
|
1016
|
+
accounts: X.map((_) => _.guid)
|
|
1025
1017
|
});
|
|
1026
|
-
}, [
|
|
1027
|
-
|
|
1018
|
+
}, [i, t]);
|
|
1019
|
+
const de = H && !d?.has_completed_cash_flow_onboarding && !R.length;
|
|
1020
|
+
return !L || !w ? /* @__PURE__ */ e(te, {}) : de ? /* @__PURE__ */ e(
|
|
1021
|
+
ve,
|
|
1028
1022
|
{
|
|
1029
|
-
|
|
1023
|
+
onBackClick: a,
|
|
1024
|
+
sx: { height: "100%", overflow: "auto" },
|
|
1025
|
+
title: h.title,
|
|
1026
|
+
children: /* @__PURE__ */ e($t, {})
|
|
1027
|
+
}
|
|
1028
|
+
) : /* @__PURE__ */ o(
|
|
1029
|
+
ve,
|
|
1030
|
+
{
|
|
1031
|
+
accountOptions: i,
|
|
1030
1032
|
actions: [
|
|
1031
1033
|
{
|
|
1032
|
-
label:
|
|
1034
|
+
label: I.action_title,
|
|
1033
1035
|
iconName: "credit_card_gear",
|
|
1034
1036
|
onClick: () => {
|
|
1035
|
-
|
|
1037
|
+
A(!0), g(Ae.CASH_FLOW_CLICK_SETTINGS);
|
|
1036
1038
|
}
|
|
1037
1039
|
}
|
|
1038
1040
|
],
|
|
1039
1041
|
calendarActions: {
|
|
1040
|
-
shouldDisableNext:
|
|
1042
|
+
shouldDisableNext: x,
|
|
1041
1043
|
shouldDisablePrevious: c,
|
|
1042
1044
|
shouldDisablePicker: !0,
|
|
1043
1045
|
onRangeChanged: () => {
|
|
1044
1046
|
}
|
|
1045
1047
|
},
|
|
1046
|
-
dateRange:
|
|
1048
|
+
dateRange: b,
|
|
1047
1049
|
dateRangeVariant: "readonly",
|
|
1048
|
-
onAccountsFilterClick: () =>
|
|
1050
|
+
onAccountsFilterClick: () => g(Ae.CASH_FLOW_CLICK_FILTER),
|
|
1049
1051
|
onBackClick: a,
|
|
1050
1052
|
sx: n,
|
|
1051
|
-
title:
|
|
1053
|
+
title: h.title,
|
|
1052
1054
|
children: [
|
|
1053
1055
|
/* @__PURE__ */ e(Lt, {}),
|
|
1054
1056
|
/* @__PURE__ */ e(Tt, {}),
|
|
1055
1057
|
/* @__PURE__ */ e(
|
|
1056
|
-
|
|
1058
|
+
$e,
|
|
1057
1059
|
{
|
|
1058
|
-
ariaLabelClose:
|
|
1059
|
-
isOpen:
|
|
1060
|
-
onClose: () =>
|
|
1060
|
+
ariaLabelClose: h.close_settings_aria,
|
|
1061
|
+
isOpen: ae,
|
|
1062
|
+
onClose: () => A(!1),
|
|
1061
1063
|
shouldShowHeaderBorders: !1,
|
|
1062
|
-
title:
|
|
1063
|
-
children: /* @__PURE__ */ e(Je, { defaultSelectedTab:
|
|
1064
|
+
title: I.action_title,
|
|
1065
|
+
children: /* @__PURE__ */ e(Je, { defaultSelectedTab: q ? 1 : 0 })
|
|
1064
1066
|
}
|
|
1065
1067
|
)
|
|
1066
1068
|
]
|
|
1067
1069
|
}
|
|
1068
|
-
) : /* @__PURE__ */ e(
|
|
1069
|
-
De,
|
|
1070
|
-
{
|
|
1071
|
-
onBackClick: a,
|
|
1072
|
-
sx: { height: "100%", overflow: "auto" },
|
|
1073
|
-
title: T.title,
|
|
1074
|
-
children: /* @__PURE__ */ e($t, {})
|
|
1075
|
-
}
|
|
1076
1070
|
);
|
|
1077
|
-
}, Fn =
|
|
1071
|
+
}, Fn = T(Mt);
|
|
1078
1072
|
class Wn {
|
|
1079
1073
|
fetchInstance;
|
|
1080
|
-
constructor(n, t,
|
|
1081
|
-
this.fetchInstance = new gt(n, t, void 0,
|
|
1074
|
+
constructor(n, t, r) {
|
|
1075
|
+
this.fetchInstance = new gt(n, t, void 0, r);
|
|
1082
1076
|
}
|
|
1083
|
-
addCashflowEvent = async (n) => this.fetchInstance.post(
|
|
1084
|
-
addCashflowSequence = async (n) => this.fetchInstance.post(
|
|
1085
|
-
getCashflowSequences = async () => this.fetchInstance.get(
|
|
1077
|
+
addCashflowEvent = async (n) => this.fetchInstance.post(j.CASHFLOW_EVENTS, { ...n }).then((t) => t);
|
|
1078
|
+
addCashflowSequence = async (n) => this.fetchInstance.post(j.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
|
|
1079
|
+
getCashflowSequences = async () => this.fetchInstance.get(j.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
|
|
1086
1080
|
getCashflowEventsByDateRange = async (n, t) => this.fetchInstance.get(
|
|
1087
|
-
`${
|
|
1088
|
-
).then((
|
|
1089
|
-
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${
|
|
1081
|
+
`${j.CASHFLOW_EVENTS}/from/${z(n)}/to/${z(t)}`
|
|
1082
|
+
).then((r) => r.cashflow_events);
|
|
1083
|
+
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${j.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
|
|
1090
1084
|
getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
|
|
1091
|
-
`${
|
|
1085
|
+
`${j.CASHFLOW_SEQUENCES}/projected_events/from/${z(
|
|
1092
1086
|
n
|
|
1093
|
-
)}/to/${
|
|
1094
|
-
).then((
|
|
1095
|
-
updateCashflowSequence = async (n) => this.fetchInstance.put(`${
|
|
1087
|
+
)}/to/${z(t)}`
|
|
1088
|
+
).then((r) => r.cashflow_events);
|
|
1089
|
+
updateCashflowSequence = async (n) => this.fetchInstance.put(`${j.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
|
|
1096
1090
|
}
|
|
1097
1091
|
export {
|
|
1098
1092
|
Wn as CashflowApi,
|