@mx-cartographer/experiences 7.0.62 → 7.0.63-alpha.mm0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cashflow/index.es.js +401 -401
- package/package.json +1 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
2
|
-
import f, { useState as
|
|
1
|
+
import { jsxs as o, Fragment as U, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import f, { useState as J } from "react";
|
|
3
3
|
import { observer as T } from "mobx-react-lite";
|
|
4
4
|
import { addMonths as qe } from "date-fns/addMonths";
|
|
5
5
|
import { startOfToday as F } from "date-fns/startOfToday";
|
|
6
6
|
import I from "@mui/material/Box";
|
|
7
|
-
import
|
|
7
|
+
import v from "@mui/material/Divider";
|
|
8
8
|
import s from "@mui/material/Stack";
|
|
9
|
-
import
|
|
10
|
-
import { Text as u, P as
|
|
11
|
-
import { G as Ye, t as
|
|
9
|
+
import se from "@mui/material/styles/useTheme";
|
|
10
|
+
import { Text as u, P as O, Icon as G, InstitutionLogo as xe, H1 as de, H2 as Xe } from "@mxenabled/mxui";
|
|
11
|
+
import { G as Ye, t as me, u as L, p as ce, d as Ne, b as X, j as P, g as Oe, o as ke, h as He, a as Qe } from "../hooks-CE2TKk4a.mjs";
|
|
12
12
|
import { C as R } from "../CurrencyText-YUhH2caW.mjs";
|
|
13
|
-
import { u as
|
|
14
|
-
import { L as
|
|
15
|
-
import { I as
|
|
16
|
-
import { C as
|
|
17
|
-
import { b as
|
|
18
|
-
import { M as
|
|
19
|
-
import { E as
|
|
20
|
-
import { R as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { getUnixTime as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { A as
|
|
13
|
+
import { u as ue } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
14
|
+
import { L as te } from "../Loader-DUaFpDGv.mjs";
|
|
15
|
+
import { I as he } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
16
|
+
import { C as Gn } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
17
|
+
import { b as $ } from "../Localization-2MODESHW.mjs";
|
|
18
|
+
import { M as Ve } from "../MiniWidgetContainer-DTQdRK-3.mjs";
|
|
19
|
+
import { E as Ke } from "../EmptyState-DA_lfRBv.mjs";
|
|
20
|
+
import { R as Je } from "../RecurringSettings-B486z99o.mjs";
|
|
21
|
+
import Ze from "@mui/material/Tabs";
|
|
22
|
+
import ye from "@mui/material/Tab";
|
|
23
|
+
import { getUnixTime as B } from "date-fns/getUnixTime";
|
|
24
|
+
import ee from "@mui/material/List";
|
|
25
|
+
import ne from "@mui/material/ListItem";
|
|
26
|
+
import { A as et } from "../AccountListItem-BAdwVscV.mjs";
|
|
27
27
|
import { f as Y, D as Q } from "../Dialog-CWW597AF.mjs";
|
|
28
|
-
import
|
|
29
|
-
import { f as
|
|
30
|
-
import { isAfter as
|
|
31
|
-
import { isBefore as
|
|
32
|
-
import { isToday as
|
|
33
|
-
import { addDays as
|
|
34
|
-
import { alpha as
|
|
35
|
-
import { DataGridPro as
|
|
36
|
-
import { T as
|
|
37
|
-
import
|
|
38
|
-
import { M as
|
|
39
|
-
import { D as
|
|
40
|
-
import { formatISO as
|
|
28
|
+
import tt from "@mui/material/ListSubheader";
|
|
29
|
+
import { f as Z } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
30
|
+
import { isAfter as Fe } from "date-fns/isAfter";
|
|
31
|
+
import { isBefore as We } from "date-fns/isBefore";
|
|
32
|
+
import { isToday as $e } from "date-fns/isToday";
|
|
33
|
+
import { addDays as Ce } from "date-fns/addDays";
|
|
34
|
+
import { alpha as nt, keyframes as ot } from "@mui/material/styles";
|
|
35
|
+
import { DataGridPro as at } from "@mui/x-data-grid-pro";
|
|
36
|
+
import { T as Se } from "../TabContentContainer-j01JYR_7.mjs";
|
|
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-BX7dzGF8.mjs";
|
|
39
|
+
import { D as Me } from "../Drawer-kEE73B87.mjs";
|
|
40
|
+
import { formatISO as lt } from "date-fns/formatISO";
|
|
41
41
|
import { fromUnixTime as _e } from "date-fns/fromUnixTime";
|
|
42
|
-
import { startOfMonth as
|
|
43
|
-
import { subDays as
|
|
44
|
-
import { S as
|
|
45
|
-
import { F as
|
|
46
|
-
import { h as
|
|
47
|
-
import { endOfToday as
|
|
48
|
-
import { W as De, A as
|
|
49
|
-
import { F as
|
|
42
|
+
import { startOfMonth as dt } from "date-fns/startOfMonth";
|
|
43
|
+
import { subDays as Ge } from "date-fns/subDays";
|
|
44
|
+
import { S as mt, b as ut } from "../TransactionDetails-DAp_CPCP.mjs";
|
|
45
|
+
import { F as ht, R as Ie, e as ve } from "../RecurringTransactions-DTUx9VN1.mjs";
|
|
46
|
+
import { h as pt } from "../DateUtil-BcuH7ErC.mjs";
|
|
47
|
+
import { endOfToday as ft } from "date-fns/endOfToday";
|
|
48
|
+
import { W as De, A as Ae } from "../WidgetContainer-B8MRJ5Y1.mjs";
|
|
49
|
+
import { F as gt, A as z } from "../Fetch-87LIQbEA.mjs";
|
|
50
50
|
const V = () => {
|
|
51
51
|
if (!f.useContext(Ye))
|
|
52
52
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
53
|
-
return
|
|
54
|
-
},
|
|
53
|
+
return me().uiStore;
|
|
54
|
+
}, bt = ({ remaining: a }) => {
|
|
55
55
|
const { cashflow: n } = L();
|
|
56
|
-
return /* @__PURE__ */ o(
|
|
56
|
+
return /* @__PURE__ */ o(U, { children: [
|
|
57
57
|
/* @__PURE__ */ e(
|
|
58
58
|
I,
|
|
59
59
|
{
|
|
@@ -68,35 +68,35 @@ const V = () => {
|
|
|
68
68
|
/* @__PURE__ */ e(u, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
69
69
|
/* @__PURE__ */ e(R, { amount: a, bold: !0, sx: { fontSize: 12 } })
|
|
70
70
|
] });
|
|
71
|
-
},
|
|
72
|
-
const a =
|
|
73
|
-
daysUntilNextIncome:
|
|
74
|
-
expensesTilNextIncome:
|
|
75
|
-
selectedCashAccounts:
|
|
71
|
+
}, pe = T(bt), xt = () => {
|
|
72
|
+
const a = se(), { availableWidth: n } = ce(), { isMobile: t } = ue(), { visibleCashAccounts: r, visibleCashBalance: p } = Ne(), { selectedAccounts: g, selectedAccountGuids: c, setSelectedAccounts: y } = X(), { cashflow: l } = L(), {
|
|
73
|
+
daysUntilNextIncome: i,
|
|
74
|
+
expensesTilNextIncome: d,
|
|
75
|
+
selectedCashAccounts: m,
|
|
76
76
|
setNextIncome: b,
|
|
77
77
|
setSelectedCashAccounts: C,
|
|
78
78
|
setUpcomingExpenses: S
|
|
79
|
-
} = V(), { isDataLoaded:
|
|
79
|
+
} = V(), { isDataLoaded: N, nextIncomeRecurrence: h, upcomingExpenses: w } = P();
|
|
80
80
|
f.useEffect(() => {
|
|
81
|
-
y(
|
|
82
|
-
}, [
|
|
81
|
+
y(r);
|
|
82
|
+
}, [r]), f.useEffect(() => {
|
|
83
83
|
C(
|
|
84
|
-
|
|
84
|
+
r.filter((_) => c.includes(_.guid))
|
|
85
85
|
);
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
const
|
|
90
|
-
() =>
|
|
91
|
-
[
|
|
92
|
-
),
|
|
93
|
-
() =>
|
|
94
|
-
[
|
|
95
|
-
),
|
|
96
|
-
() =>
|
|
97
|
-
[
|
|
86
|
+
}, [r, g]), f.useEffect(() => {
|
|
87
|
+
h && b(h), S(w);
|
|
88
|
+
}, [h, w]);
|
|
89
|
+
const D = f.useMemo(
|
|
90
|
+
() => r.filter((_) => c.includes(_.guid)).reduce((_, j) => _ + (j?.balance || 0), 0),
|
|
91
|
+
[c, w]
|
|
92
|
+
), k = f.useMemo(
|
|
93
|
+
() => d.filter((_) => c.includes(_.accountGuid || "")).reduce((_, j) => _ + j.amount, 0),
|
|
94
|
+
[c, d]
|
|
95
|
+
), K = f.useMemo(
|
|
96
|
+
() => D - k,
|
|
97
|
+
[D, k]
|
|
98
98
|
);
|
|
99
|
-
return
|
|
99
|
+
return N ? /* @__PURE__ */ e(I, { 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 V = () => {
|
|
|
106
106
|
px: 24,
|
|
107
107
|
children: [
|
|
108
108
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
109
|
-
/* @__PURE__ */ e(R, { amount:
|
|
110
|
-
/* @__PURE__ */ e(
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
/* @__PURE__ */ e(R, { amount: D, variant: "H2" }),
|
|
110
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: $(
|
|
111
|
+
l.total_cash_accounts,
|
|
112
|
+
m.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(R, { amount:
|
|
118
|
-
/* @__PURE__ */ e(
|
|
117
|
+
/* @__PURE__ */ e(R, { amount: k, variant: "H2" }),
|
|
118
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: $(l.expenses_due, d.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(R, { amount:
|
|
122
|
+
/* @__PURE__ */ e(R, { amount: K, variant: "H2" }),
|
|
123
123
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
124
|
-
/* @__PURE__ */ e(
|
|
125
|
-
/* @__PURE__ */ e(
|
|
124
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: l.available_to_spend }),
|
|
125
|
+
/* @__PURE__ */ e(he, { 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(u, { variant: "H2", children:
|
|
130
|
-
/* @__PURE__ */ e(
|
|
128
|
+
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(U, { children: [
|
|
129
|
+
/* @__PURE__ */ e(u, { variant: "H2", children: $(l.days, i) }),
|
|
130
|
+
/* @__PURE__ */ e(O, { 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(u, { variant: "Small", children:
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: $(
|
|
137
|
+
l.total_cash_accounts,
|
|
138
|
+
m.length
|
|
139
139
|
) }),
|
|
140
|
-
/* @__PURE__ */ e(R, { amount:
|
|
140
|
+
/* @__PURE__ */ e(R, { amount: p, 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(u, { variant: "Small", children:
|
|
145
|
-
/* @__PURE__ */ e(R, { amount:
|
|
144
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: $(l.expenses_due, d.length) }),
|
|
145
|
+
/* @__PURE__ */ e(R, { amount: k, bold: !0, symbol: "-", variant: "XSmall" })
|
|
146
146
|
] }),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
147
|
+
/* @__PURE__ */ e(v, {}),
|
|
148
148
|
/* @__PURE__ */ e(
|
|
149
149
|
s,
|
|
150
150
|
{
|
|
@@ -156,52 +156,52 @@ const V = () => {
|
|
|
156
156
|
justifyContent: "space-between",
|
|
157
157
|
px: 16,
|
|
158
158
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
159
|
-
children: /* @__PURE__ */ e(
|
|
159
|
+
children: /* @__PURE__ */ e(pe, { remaining: K })
|
|
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(u, { variant: "Small", children:
|
|
165
|
-
/* @__PURE__ */ e(u, { bold: !0, variant: "XSmall", children:
|
|
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
|
-
] }) }) : /* @__PURE__ */ e(
|
|
168
|
-
},
|
|
167
|
+
] }) }) : /* @__PURE__ */ e(te, { height: t ? 210 : 120 });
|
|
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 } = L(), { isCopyLoaded: p, isInitialized: g } = X(), { loadRepeatingTransactions: c, income: y, isDataLoaded: l, setDateRange: i } = P();
|
|
174
174
|
f.useEffect(() => {
|
|
175
|
-
g && (
|
|
175
|
+
g && (i({ start: F(), end: qe(F(), 1) }), c().finally());
|
|
176
176
|
}, [g]);
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
|
|
177
|
+
const d = l && !y.length;
|
|
178
|
+
return p ? /* @__PURE__ */ o(
|
|
179
|
+
Ve,
|
|
180
180
|
{
|
|
181
181
|
className: "mx-exp-cashflow-miniwidget",
|
|
182
182
|
onPrimaryCtaClick: a,
|
|
183
|
-
primaryCtaLabel:
|
|
184
|
-
subTitle:
|
|
183
|
+
primaryCtaLabel: r.primary_cta,
|
|
184
|
+
subTitle: d || !l ? void 0 : r.sub_title,
|
|
185
185
|
sx: t,
|
|
186
|
-
title:
|
|
186
|
+
title: r.title,
|
|
187
187
|
children: [
|
|
188
|
-
!
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
!l && /* @__PURE__ */ e(te, {}),
|
|
189
|
+
l && (d ? /* @__PURE__ */ e(
|
|
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
|
-
) : /* @__PURE__ */ e(
|
|
199
|
+
) : /* @__PURE__ */ e(yt, {}))
|
|
200
200
|
]
|
|
201
201
|
}
|
|
202
|
-
) : /* @__PURE__ */ e(
|
|
203
|
-
},
|
|
204
|
-
|
|
202
|
+
) : /* @__PURE__ */ e(te, {});
|
|
203
|
+
}, Hn = T(Ct), St = ({ remaining: a }) => /* @__PURE__ */ e(
|
|
204
|
+
ne,
|
|
205
205
|
{
|
|
206
206
|
sx: {
|
|
207
207
|
alignItems: "center",
|
|
@@ -213,12 +213,12 @@ const V = () => {
|
|
|
213
213
|
borderBottomRightRadius: "3px",
|
|
214
214
|
minHeight: "auto"
|
|
215
215
|
},
|
|
216
|
-
children: /* @__PURE__ */ e(
|
|
216
|
+
children: /* @__PURE__ */ e(pe, { remaining: a })
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
|
-
var
|
|
220
|
-
const
|
|
221
|
-
/* @__PURE__ */ o(
|
|
219
|
+
var oe = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(oe || {});
|
|
220
|
+
const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
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
223
|
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.MONTH) }),
|
|
224
224
|
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.DAY) })
|
|
@@ -233,12 +233,12 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
233
233
|
}
|
|
234
234
|
)
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ e(
|
|
237
|
-
] }), Ee = T(
|
|
236
|
+
/* @__PURE__ */ e(v, {})
|
|
237
|
+
] }), Ee = T(wt), _t = ({ total: a, type: n }) => {
|
|
238
238
|
const { cashflow: t } = L();
|
|
239
|
-
return /* @__PURE__ */ o(
|
|
239
|
+
return /* @__PURE__ */ o(U, { children: [
|
|
240
240
|
/* @__PURE__ */ o(
|
|
241
|
-
|
|
241
|
+
tt,
|
|
242
242
|
{
|
|
243
243
|
sx: {
|
|
244
244
|
alignItems: "center",
|
|
@@ -250,40 +250,40 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
250
250
|
px: 24
|
|
251
251
|
},
|
|
252
252
|
children: [
|
|
253
|
-
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 12 }, children: n ===
|
|
253
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 12 }, children: n === oe.EXPENSE ? t.expenses : t.income }),
|
|
254
254
|
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
255
|
-
n ===
|
|
256
|
-
|
|
255
|
+
n === oe.EXPENSE ? "-" : "+",
|
|
256
|
+
Z(a, "0,0.00")
|
|
257
257
|
] })
|
|
258
258
|
]
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
|
-
/* @__PURE__ */ e(
|
|
261
|
+
/* @__PURE__ */ e(v, {})
|
|
262
262
|
] });
|
|
263
|
-
},
|
|
264
|
-
const { availableWidth: a } =
|
|
263
|
+
}, Te = T(_t), re = (a, n) => (t) => t.accountGuid === a.guid && ($e(t.expectedDate) || Fe(t.expectedDate, n.start)) && We(t.expectedDate, n.end), It = () => {
|
|
264
|
+
const { availableWidth: a } = ce(), { cashflow: n } = L(), { upcomingExpenses: t, upcomingIncome: r } = P(), { dateRange: p, selectedCashAccounts: g } = V();
|
|
265
265
|
return /* @__PURE__ */ o(s, { children: [
|
|
266
266
|
/* @__PURE__ */ o(s, { direction: a < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
267
267
|
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
268
268
|
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
269
|
-
Y(
|
|
269
|
+
Y(p.start, Q.FULL_MONTH_DAY),
|
|
270
270
|
" -",
|
|
271
271
|
" ",
|
|
272
|
-
Y(
|
|
272
|
+
Y(p.end, Q.FULL_MONTH_DAY)
|
|
273
273
|
] })
|
|
274
274
|
] }),
|
|
275
|
-
/* @__PURE__ */ e(s, { children: g.map((
|
|
276
|
-
const y =
|
|
277
|
-
|
|
278
|
-
),
|
|
279
|
-
(
|
|
275
|
+
/* @__PURE__ */ e(s, { children: g.map((c) => {
|
|
276
|
+
const y = r.filter(re(c, p)).sort((m, b) => B(m.expectedDate) - B(b.expectedDate)), l = t.filter(
|
|
277
|
+
re(c, p)
|
|
278
|
+
), i = y.reduce(
|
|
279
|
+
(m, b) => m + b.amount,
|
|
280
280
|
0
|
|
281
|
-
),
|
|
282
|
-
(
|
|
281
|
+
), d = l.reduce(
|
|
282
|
+
(m, b) => m + b.amount,
|
|
283
283
|
0
|
|
284
284
|
);
|
|
285
285
|
return /* @__PURE__ */ o(
|
|
286
|
-
|
|
286
|
+
ee,
|
|
287
287
|
{
|
|
288
288
|
sx: {
|
|
289
289
|
border: "1px solid",
|
|
@@ -293,9 +293,9 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
293
293
|
},
|
|
294
294
|
children: [
|
|
295
295
|
/* @__PURE__ */ e(
|
|
296
|
-
|
|
296
|
+
et,
|
|
297
297
|
{
|
|
298
|
-
account:
|
|
298
|
+
account: c,
|
|
299
299
|
listItemProps: {
|
|
300
300
|
disableGutters: !1,
|
|
301
301
|
disablePadding: !1,
|
|
@@ -303,49 +303,49 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
),
|
|
306
|
-
/* @__PURE__ */ e(
|
|
307
|
-
y.length > 0 && /* @__PURE__ */ e(
|
|
308
|
-
|
|
306
|
+
/* @__PURE__ */ e(v, {}),
|
|
307
|
+
y.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
308
|
+
ee,
|
|
309
309
|
{
|
|
310
|
-
subheader: /* @__PURE__ */ e(
|
|
310
|
+
subheader: /* @__PURE__ */ e(Te, { total: i, type: oe.INCOME }),
|
|
311
311
|
sx: { width: "100%" },
|
|
312
|
-
children: y.map((
|
|
312
|
+
children: y.map((m) => /* @__PURE__ */ e(Ee, { recurrence: m }, m.repeatingTransactionGuid))
|
|
313
313
|
}
|
|
314
314
|
) }),
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
l.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
316
|
+
ee,
|
|
317
317
|
{
|
|
318
|
-
subheader: /* @__PURE__ */ e(
|
|
318
|
+
subheader: /* @__PURE__ */ e(Te, { total: d, type: oe.EXPENSE }),
|
|
319
319
|
sx: { width: "100%" },
|
|
320
|
-
children:
|
|
320
|
+
children: l.map((m) => /* @__PURE__ */ e(Ee, { recurrence: m }, m.repeatingTransactionGuid))
|
|
321
321
|
}
|
|
322
322
|
) }),
|
|
323
323
|
/* @__PURE__ */ e(
|
|
324
|
-
|
|
324
|
+
St,
|
|
325
325
|
{
|
|
326
|
-
remaining: (
|
|
326
|
+
remaining: (c.available_balance || c.balance || 0) + i - d
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
]
|
|
330
330
|
},
|
|
331
|
-
|
|
331
|
+
c.guid
|
|
332
332
|
);
|
|
333
333
|
}) })
|
|
334
334
|
] });
|
|
335
|
-
},
|
|
336
|
-
const { availableWidth: a } =
|
|
335
|
+
}, vt = T(It), Dt = () => {
|
|
336
|
+
const { availableWidth: a } = ce(), n = se(), { cashflow: t } = L(), { upcomingExpenses: r, upcomingIncome: p } = P(), { dateRange: g, selectedCashAccounts: c } = V(), y = [
|
|
337
337
|
{
|
|
338
338
|
field: "account",
|
|
339
339
|
flex: 1.5,
|
|
340
340
|
headerName: t.accounts,
|
|
341
|
-
renderCell: ({ value: { name:
|
|
342
|
-
const C =
|
|
341
|
+
renderCell: ({ value: { name: i, nickname: d, institution_guid: m, account_number: b } }) => {
|
|
342
|
+
const C = d || i;
|
|
343
343
|
return /* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
344
344
|
/* @__PURE__ */ e(
|
|
345
|
-
|
|
345
|
+
xe,
|
|
346
346
|
{
|
|
347
347
|
alt: t.institution_logo,
|
|
348
|
-
institutionGuid:
|
|
348
|
+
institutionGuid: m || "",
|
|
349
349
|
size: 16
|
|
350
350
|
}
|
|
351
351
|
),
|
|
@@ -358,54 +358,54 @@ const St = ({ 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
|
|
382
|
+
renderCell: (i) => {
|
|
383
|
+
const d = i.row.balance + i.row.income - i.row.expenses;
|
|
384
384
|
return /* @__PURE__ */ e(
|
|
385
385
|
u,
|
|
386
386
|
{
|
|
387
|
-
color: Math.sign(
|
|
387
|
+
color: Math.sign(d) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
388
388
|
variant: "Small",
|
|
389
|
-
children:
|
|
389
|
+
children: Z(d, "0,0.00")
|
|
390
390
|
}
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
],
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
).reduce((C, S) => C + S.amount, 0),
|
|
398
|
-
|
|
399
|
-
).reduce((C, S) => C + S.amount, 0), b = (
|
|
394
|
+
], l = f.useMemo(() => c.map((i) => {
|
|
395
|
+
const d = r.filter(
|
|
396
|
+
re(i, { start: F(), end: Ce(F(), 30) })
|
|
397
|
+
).reduce((C, S) => C + S.amount, 0), m = p.filter(
|
|
398
|
+
re(i, { start: F(), end: Ce(F(), 30) })
|
|
399
|
+
).reduce((C, S) => C + S.amount, 0), b = (i.balance || 0) + m - d;
|
|
400
400
|
return {
|
|
401
|
-
account:
|
|
402
|
-
balance:
|
|
403
|
-
id:
|
|
404
|
-
income:
|
|
405
|
-
expenses:
|
|
401
|
+
account: i,
|
|
402
|
+
balance: i.balance || 0,
|
|
403
|
+
id: i.guid,
|
|
404
|
+
income: m,
|
|
405
|
+
expenses: d,
|
|
406
406
|
remaining: b
|
|
407
407
|
};
|
|
408
|
-
}), [
|
|
408
|
+
}), [c, r, p]);
|
|
409
409
|
return /* @__PURE__ */ o(
|
|
410
410
|
I,
|
|
411
411
|
{
|
|
@@ -433,7 +433,7 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
435
|
/* @__PURE__ */ e(
|
|
436
|
-
|
|
436
|
+
he,
|
|
437
437
|
{
|
|
438
438
|
body: t.table_tooltip_body,
|
|
439
439
|
title: t.table_tooltip_title
|
|
@@ -450,7 +450,7 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
452
|
a > 650 ? /* @__PURE__ */ e(
|
|
453
|
-
|
|
453
|
+
at,
|
|
454
454
|
{
|
|
455
455
|
columnHeaderHeight: 48,
|
|
456
456
|
columns: y,
|
|
@@ -459,7 +459,7 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
459
459
|
disableRowSelectionOnClick: !0,
|
|
460
460
|
hideFooter: !0,
|
|
461
461
|
rowHeight: 48,
|
|
462
|
-
rows:
|
|
462
|
+
rows: l,
|
|
463
463
|
sx: {
|
|
464
464
|
border: "1px solid",
|
|
465
465
|
borderColor: "border.light",
|
|
@@ -467,7 +467,7 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
467
467
|
"& .MuiDataGrid-columnHeader .MuiIconButton-root": {
|
|
468
468
|
color: n.palette.primary.main,
|
|
469
469
|
"&:hover": {
|
|
470
|
-
backgroundColor:
|
|
470
|
+
backgroundColor: nt(n.palette.primary.main, 0.1)
|
|
471
471
|
}
|
|
472
472
|
},
|
|
473
473
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
@@ -479,10 +479,10 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
) :
|
|
483
|
-
const { name:
|
|
482
|
+
) : l.map((i) => {
|
|
483
|
+
const { name: d, nickname: m, institution_guid: b, account_number: C } = i.account, S = m || d;
|
|
484
484
|
return /* @__PURE__ */ e(
|
|
485
|
-
|
|
485
|
+
ee,
|
|
486
486
|
{
|
|
487
487
|
sx: {
|
|
488
488
|
border: "1px solid",
|
|
@@ -490,7 +490,7 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
490
490
|
borderRadius: 1,
|
|
491
491
|
marginBottom: 24
|
|
492
492
|
},
|
|
493
|
-
children: /* @__PURE__ */ e(
|
|
493
|
+
children: /* @__PURE__ */ e(ne, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ o(s, { width: "100%", children: [
|
|
494
494
|
/* @__PURE__ */ o(
|
|
495
495
|
s,
|
|
496
496
|
{
|
|
@@ -502,7 +502,7 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
502
502
|
children: [
|
|
503
503
|
/* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 8, width: "50%", children: [
|
|
504
504
|
/* @__PURE__ */ e(
|
|
505
|
-
|
|
505
|
+
xe,
|
|
506
506
|
{
|
|
507
507
|
alt: t.institution_logo,
|
|
508
508
|
institutionGuid: b || "",
|
|
@@ -511,11 +511,11 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
511
511
|
),
|
|
512
512
|
/* @__PURE__ */ e(u, { variant: "Small", children: `${S} ${C ? `*${C}` : ""}` })
|
|
513
513
|
] }),
|
|
514
|
-
/* @__PURE__ */ e(R, { amount:
|
|
514
|
+
/* @__PURE__ */ e(R, { 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
|
{
|
|
@@ -526,11 +526,11 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
526
526
|
py: 12,
|
|
527
527
|
children: [
|
|
528
528
|
/* @__PURE__ */ e(u, { variant: "Small", children: t.projected_income }),
|
|
529
|
-
/* @__PURE__ */ e(R, { amount:
|
|
529
|
+
/* @__PURE__ */ e(R, { 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
|
{
|
|
@@ -541,11 +541,11 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
541
541
|
py: 12,
|
|
542
542
|
children: [
|
|
543
543
|
/* @__PURE__ */ e(u, { variant: "Small", children: t.projected_expenses }),
|
|
544
|
-
/* @__PURE__ */ e(R, { amount:
|
|
544
|
+
/* @__PURE__ */ e(R, { 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,36 +557,36 @@ const St = ({ 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(pe, { 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
|
-
},
|
|
572
|
-
const { cashflow: a } = L(), { isDesktop: n } =
|
|
573
|
-
|
|
571
|
+
}, At = T(Dt), Et = () => {
|
|
572
|
+
const { cashflow: a } = L(), { isDesktop: n } = ue(), { onEvent: t } = Oe(), [r, p] = f.useState(0), g = (c, y) => {
|
|
573
|
+
p(y);
|
|
574
574
|
};
|
|
575
575
|
return f.useEffect(() => {
|
|
576
|
-
t(
|
|
577
|
-
}, [
|
|
576
|
+
t(r === 0 ? "cash_flow_summary" : "cash_flow_details");
|
|
577
|
+
}, [r]), /* @__PURE__ */ o(I, { children: [
|
|
578
578
|
/* @__PURE__ */ o(
|
|
579
|
-
|
|
579
|
+
Ze,
|
|
580
580
|
{
|
|
581
581
|
"aria-label": a.cashflow_summary_and_details,
|
|
582
582
|
centered: !0,
|
|
583
583
|
onChange: g,
|
|
584
584
|
textColor: "primary",
|
|
585
|
-
value:
|
|
585
|
+
value: r,
|
|
586
586
|
variant: "fullWidth",
|
|
587
587
|
children: [
|
|
588
588
|
/* @__PURE__ */ e(
|
|
589
|
-
|
|
589
|
+
ye,
|
|
590
590
|
{
|
|
591
591
|
"aria-controls": "cashflow-tabpanel-0",
|
|
592
592
|
id: "cashflow-tab-0",
|
|
@@ -597,7 +597,7 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
597
597
|
}
|
|
598
598
|
),
|
|
599
599
|
/* @__PURE__ */ e(
|
|
600
|
-
|
|
600
|
+
ye,
|
|
601
601
|
{
|
|
602
602
|
"aria-controls": "cashflow-tabpanel-1",
|
|
603
603
|
id: "cashflow-tab-1",
|
|
@@ -611,15 +611,15 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
611
611
|
}
|
|
612
612
|
),
|
|
613
613
|
/* @__PURE__ */ e(I, { sx: { mb: 32 } }),
|
|
614
|
-
/* @__PURE__ */ e(
|
|
615
|
-
/* @__PURE__ */ e(
|
|
614
|
+
/* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value: r, children: /* @__PURE__ */ e(I, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(At, {}) }) }),
|
|
615
|
+
/* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value: r, children: /* @__PURE__ */ e(I, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(vt, {}) }) })
|
|
616
616
|
] });
|
|
617
|
-
},
|
|
617
|
+
}, Tt = T(Et), ie = ({
|
|
618
618
|
amount: a,
|
|
619
619
|
isMobile: n = !1,
|
|
620
620
|
isTotal: t = !1,
|
|
621
|
-
label:
|
|
622
|
-
symbol:
|
|
621
|
+
label: r,
|
|
622
|
+
symbol: p,
|
|
623
623
|
tooltip: g
|
|
624
624
|
}) => /* @__PURE__ */ o(
|
|
625
625
|
s,
|
|
@@ -632,83 +632,83 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
632
632
|
children: [
|
|
633
633
|
!n && /* @__PURE__ */ e(R, { 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(u, { bold: t, variant: "Small", children:
|
|
635
|
+
/* @__PURE__ */ e(u, { bold: t, variant: "Small", children: r }),
|
|
636
636
|
g
|
|
637
637
|
] }),
|
|
638
|
-
n && /* @__PURE__ */ e(R, { amount: a, component: "h2", symbol:
|
|
638
|
+
n && /* @__PURE__ */ e(R, { amount: a, component: "h2", symbol: p, variant: "Small" })
|
|
639
639
|
]
|
|
640
640
|
}
|
|
641
|
-
),
|
|
642
|
-
const { availableWidth: a } =
|
|
643
|
-
() => t.filter(
|
|
644
|
-
[g,
|
|
645
|
-
),
|
|
646
|
-
() =>
|
|
647
|
-
[g,
|
|
641
|
+
), Re = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && ($e(t.expectedDate) || Fe(t.expectedDate, n.start)) && We(t.expectedDate, n.end), Rt = () => {
|
|
642
|
+
const { availableWidth: a } = ce(), { cashflow: n } = L(), { upcomingExpenses: t, upcomingIncome: r } = P(), { selectedAccountGuids: p } = X(), { dateRange: g, selectedCashAccounts: c } = V(), { userProfile: y } = ke(), [l, i] = f.useState(!1), d = f.useMemo(
|
|
643
|
+
() => t.filter(Re(p, g)),
|
|
644
|
+
[g, p, t]
|
|
645
|
+
), m = f.useMemo(
|
|
646
|
+
() => r.filter(Re(p, g)),
|
|
647
|
+
[g, p, r]
|
|
648
648
|
), b = f.useMemo(
|
|
649
|
-
() =>
|
|
650
|
-
[
|
|
651
|
-
), C =
|
|
652
|
-
return /* @__PURE__ */ o(s, { sx: { mx:
|
|
649
|
+
() => c.reduce((w, D) => w + (D?.balance || 0), 0),
|
|
650
|
+
[c]
|
|
651
|
+
), C = d.reduce((w, D) => w + D.amount, 0), S = m.reduce((w, D) => w + D.amount, 0), N = b - C + S, 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
|
+
ie,
|
|
665
665
|
{
|
|
666
666
|
amount: b,
|
|
667
|
-
isMobile:
|
|
668
|
-
label:
|
|
667
|
+
isMobile: h,
|
|
668
|
+
label: $(n.cash_and_bank, c.length)
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
|
-
|
|
672
|
-
y?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(
|
|
673
|
-
!
|
|
671
|
+
h && /* @__PURE__ */ e(v, {}),
|
|
672
|
+
y?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(U, { children: [
|
|
673
|
+
!h && /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
674
674
|
/* @__PURE__ */ e(
|
|
675
|
-
|
|
675
|
+
ie,
|
|
676
676
|
{
|
|
677
677
|
amount: S,
|
|
678
|
-
isMobile:
|
|
678
|
+
isMobile: h,
|
|
679
679
|
label: n.to_be_received,
|
|
680
|
-
symbol:
|
|
680
|
+
symbol: h ? "+" : void 0
|
|
681
681
|
}
|
|
682
682
|
)
|
|
683
683
|
] }) : /* @__PURE__ */ e(
|
|
684
|
-
|
|
684
|
+
M,
|
|
685
685
|
{
|
|
686
|
-
onClick: () =>
|
|
687
|
-
startIcon: /* @__PURE__ */ e(
|
|
686
|
+
onClick: () => i(!0),
|
|
687
|
+
startIcon: /* @__PURE__ */ e(G, { name: "add" }),
|
|
688
688
|
sx: { fontSize: 13 },
|
|
689
689
|
children: n.add_income
|
|
690
690
|
}
|
|
691
691
|
),
|
|
692
|
-
|
|
692
|
+
h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
693
693
|
/* @__PURE__ */ e(
|
|
694
|
-
|
|
694
|
+
ie,
|
|
695
695
|
{
|
|
696
696
|
amount: C,
|
|
697
|
-
isMobile:
|
|
698
|
-
label:
|
|
699
|
-
symbol:
|
|
697
|
+
isMobile: h,
|
|
698
|
+
label: $(n.to_be_paid_out, d.length),
|
|
699
|
+
symbol: h ? "-" : void 0
|
|
700
700
|
}
|
|
701
701
|
),
|
|
702
|
-
|
|
702
|
+
h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
703
703
|
/* @__PURE__ */ e(
|
|
704
|
-
|
|
704
|
+
ie,
|
|
705
705
|
{
|
|
706
|
-
amount:
|
|
707
|
-
isMobile:
|
|
708
|
-
isTotal:
|
|
706
|
+
amount: N,
|
|
707
|
+
isMobile: h,
|
|
708
|
+
isTotal: h,
|
|
709
709
|
label: n.remaining_cash,
|
|
710
710
|
tooltip: /* @__PURE__ */ e(
|
|
711
|
-
|
|
711
|
+
he,
|
|
712
712
|
{
|
|
713
713
|
body: n.remaining_income_tooltip_body,
|
|
714
714
|
title: n.remaining_income_tooltip_title
|
|
@@ -720,266 +720,266 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
720
720
|
}
|
|
721
721
|
),
|
|
722
722
|
/* @__PURE__ */ e(
|
|
723
|
-
|
|
723
|
+
Me,
|
|
724
724
|
{
|
|
725
725
|
ariaLabelClose: n.close_manage_income_aria,
|
|
726
|
-
isOpen:
|
|
727
|
-
onClose: () =>
|
|
726
|
+
isOpen: l,
|
|
727
|
+
onClose: () => i(!1),
|
|
728
728
|
shouldShowHeaderBorders: !1,
|
|
729
729
|
title: n.manage_income,
|
|
730
|
-
children: /* @__PURE__ */ e(
|
|
730
|
+
children: /* @__PURE__ */ e(it, {})
|
|
731
731
|
}
|
|
732
732
|
)
|
|
733
733
|
] });
|
|
734
|
-
},
|
|
735
|
-
const { completeOnboarding: n } =
|
|
734
|
+
}, Lt = T(Rt), Nt = ({ handleNextStep: a }) => {
|
|
735
|
+
const { completeOnboarding: n } = me(), { cashflow: t } = L(), r = se();
|
|
736
736
|
return /* @__PURE__ */ o(s, { children: [
|
|
737
|
-
/* @__PURE__ */ e(
|
|
737
|
+
/* @__PURE__ */ e(de, { pb: 12, children: t.welcome_title }),
|
|
738
738
|
/* @__PURE__ */ e(
|
|
739
739
|
Xe,
|
|
740
740
|
{
|
|
741
|
-
color:
|
|
741
|
+
color: r.palette.primary.light,
|
|
742
742
|
pb: 8,
|
|
743
743
|
sx: { wordBreak: "break-word", whiteSpace: "initial" },
|
|
744
744
|
variant: "H3",
|
|
745
745
|
children: t.welcome_sub_title
|
|
746
746
|
}
|
|
747
747
|
),
|
|
748
|
-
/* @__PURE__ */ e(
|
|
748
|
+
/* @__PURE__ */ e(O, { pb: 32, children: t.welcome_description }),
|
|
749
749
|
/* @__PURE__ */ o(s, { direction: "column", mb: 32, spacing: 32, children: [
|
|
750
|
-
/* @__PURE__ */ o(
|
|
750
|
+
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
751
751
|
/* @__PURE__ */ e(
|
|
752
752
|
I,
|
|
753
753
|
{
|
|
754
|
-
bgcolor:
|
|
754
|
+
bgcolor: r.palette.primary.lighter,
|
|
755
755
|
borderRadius: 1,
|
|
756
756
|
component: "span",
|
|
757
757
|
height: 44,
|
|
758
758
|
mr: 24,
|
|
759
759
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
760
760
|
width: 44,
|
|
761
|
-
children: /* @__PURE__ */ e(
|
|
761
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "currency_exchange" })
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
764
|
t.bullet_one
|
|
765
765
|
] }),
|
|
766
|
-
/* @__PURE__ */ o(
|
|
766
|
+
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
767
767
|
/* @__PURE__ */ e(
|
|
768
768
|
I,
|
|
769
769
|
{
|
|
770
|
-
bgcolor:
|
|
770
|
+
bgcolor: r.palette.primary.lighter,
|
|
771
771
|
borderRadius: 1,
|
|
772
772
|
component: "span",
|
|
773
773
|
height: 44,
|
|
774
774
|
mr: 24,
|
|
775
775
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
776
776
|
width: 44,
|
|
777
|
-
children: /* @__PURE__ */ e(
|
|
777
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "cardiology" })
|
|
778
778
|
}
|
|
779
779
|
),
|
|
780
780
|
t.bullet_two
|
|
781
781
|
] }),
|
|
782
|
-
/* @__PURE__ */ o(
|
|
782
|
+
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
783
783
|
/* @__PURE__ */ e(
|
|
784
784
|
I,
|
|
785
785
|
{
|
|
786
|
-
bgcolor:
|
|
786
|
+
bgcolor: r.palette.primary.lighter,
|
|
787
787
|
borderRadius: 1,
|
|
788
788
|
component: "span",
|
|
789
789
|
height: 44,
|
|
790
790
|
mr: 24,
|
|
791
791
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
792
792
|
width: 44,
|
|
793
|
-
children: /* @__PURE__ */ e(
|
|
793
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "flare" })
|
|
794
794
|
}
|
|
795
795
|
),
|
|
796
796
|
t.bullet_three
|
|
797
797
|
] })
|
|
798
798
|
] }),
|
|
799
799
|
/* @__PURE__ */ o(s, { direction: "row", spacing: 16, children: [
|
|
800
|
-
/* @__PURE__ */ e(
|
|
801
|
-
/* @__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 })
|
|
802
802
|
] })
|
|
803
803
|
] });
|
|
804
|
-
},
|
|
805
|
-
CASHFLOW_ONBOARDING: `${
|
|
806
|
-
CASHFLOW_LOADING_ANIMATION: `${
|
|
807
|
-
},
|
|
804
|
+
}, Ot = T(Nt), Le = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", je = {
|
|
805
|
+
CASHFLOW_ONBOARDING: `${Le}/cashflow-onboarding.png`,
|
|
806
|
+
CASHFLOW_LOADING_ANIMATION: `${Le}/loading-animation.gif`
|
|
807
|
+
}, kt = () => {
|
|
808
808
|
const { cashflow: a } = L();
|
|
809
809
|
return /* @__PURE__ */ o(f.Fragment, { children: [
|
|
810
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src:
|
|
811
|
-
/* @__PURE__ */ e(
|
|
812
|
-
/* @__PURE__ */ e(
|
|
810
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: je.CASHFLOW_LOADING_ANIMATION }) }),
|
|
811
|
+
/* @__PURE__ */ e(de, { pb: 12, children: a.loading_title }),
|
|
812
|
+
/* @__PURE__ */ e(O, { children: a.loading_description })
|
|
813
813
|
] });
|
|
814
|
-
},
|
|
814
|
+
}, Ht = T(kt), Ft = ot`
|
|
815
815
|
from {
|
|
816
816
|
transform: rotate(0deg);
|
|
817
817
|
}
|
|
818
818
|
to {
|
|
819
819
|
transform: rotate(360deg);
|
|
820
820
|
}
|
|
821
|
-
`,
|
|
822
|
-
const { addRepeatingTransaction: a, repeatingTransactions: n } =
|
|
823
|
-
() =>
|
|
824
|
-
[
|
|
821
|
+
`, Wt = () => {
|
|
822
|
+
const { addRepeatingTransaction: a, repeatingTransactions: n } = P(), { cashflow: t, common: r } = L(), { completeOnboarding: p } = me(), { isDirty: g } = V(), { isMobile: c } = ue(), { isCopyLoaded: y, setDisplayedDate: l } = X(), { filter: i, setFilter: d, transactions: m } = He(), b = se(), [C, S] = J(!0), [N, h] = f.useState(ht.EveryMonth), [w, D] = f.useState(1), [k, K] = f.useState(15), [_, j] = J(!1), [q, ae] = J(1), [A, W] = J([]), [fe, le] = J(""), H = f.useMemo(
|
|
823
|
+
() => m.find((x) => x.guid === fe),
|
|
824
|
+
[fe, m]
|
|
825
825
|
), ze = !!n.filter(
|
|
826
|
-
(x) => x.repeating_transaction_type ===
|
|
827
|
-
).length,
|
|
828
|
-
|
|
826
|
+
(x) => x.repeating_transaction_type === Ie.Income
|
|
827
|
+
).length, ge = async () => {
|
|
828
|
+
ae(2), l(
|
|
829
829
|
// Beginning of the month, 90 days before today
|
|
830
|
-
|
|
830
|
+
dt(Ge(F(), 90)),
|
|
831
831
|
F()
|
|
832
|
-
),
|
|
832
|
+
), d({ ...i, custom: we }), ae(3);
|
|
833
833
|
}, Be = async () => {
|
|
834
|
-
if (!(
|
|
835
|
-
|
|
836
|
-
for (let x = 0; x <
|
|
837
|
-
const
|
|
838
|
-
account_guid:
|
|
839
|
-
amount:
|
|
840
|
-
merchant_guid:
|
|
841
|
-
description:
|
|
842
|
-
predicted_occurs_on:
|
|
843
|
-
recurrence_day:
|
|
844
|
-
recurrence_type:
|
|
845
|
-
repeating_transaction_type:
|
|
846
|
-
transaction_type:
|
|
834
|
+
if (!(A.length < 1)) {
|
|
835
|
+
j(!0);
|
|
836
|
+
for (let x = 0; x < A.length; x++) {
|
|
837
|
+
const E = A[x], be = ve(N, _e(E.date)), Pe = {
|
|
838
|
+
account_guid: E.account_guid,
|
|
839
|
+
amount: E.amount,
|
|
840
|
+
merchant_guid: E.merchant_guid,
|
|
841
|
+
description: E.feed_description || E.description,
|
|
842
|
+
predicted_occurs_on: lt(be, { representation: "date" }),
|
|
843
|
+
recurrence_day: be.getDay(),
|
|
844
|
+
recurrence_type: N,
|
|
845
|
+
repeating_transaction_type: Ie.Income,
|
|
846
|
+
transaction_type: E.transaction_type
|
|
847
847
|
};
|
|
848
|
-
await a(Pe,
|
|
848
|
+
await a(Pe, E);
|
|
849
849
|
}
|
|
850
|
-
await
|
|
850
|
+
await p();
|
|
851
851
|
}
|
|
852
|
-
}, Ue = !H && C || !H &&
|
|
852
|
+
}, Ue = !H && C || !H && A.length < 1;
|
|
853
853
|
return y ? /* @__PURE__ */ o(
|
|
854
854
|
I,
|
|
855
855
|
{
|
|
856
856
|
sx: {
|
|
857
857
|
display: "flex",
|
|
858
|
-
alignItems:
|
|
858
|
+
alignItems: c ? "flex-start" : "center",
|
|
859
859
|
backgroundColor: b.palette.background.paper,
|
|
860
|
-
backgroundImage:
|
|
860
|
+
backgroundImage: c ? null : `url(${je.CASHFLOW_ONBOARDING})`,
|
|
861
861
|
backgroundRepeat: "no-repeat",
|
|
862
862
|
backgroundPosition: "left 100px",
|
|
863
863
|
backgroundSize: "35%",
|
|
864
864
|
py: 24
|
|
865
865
|
},
|
|
866
866
|
children: [
|
|
867
|
-
|
|
867
|
+
q === 1 && /* @__PURE__ */ e(
|
|
868
868
|
I,
|
|
869
869
|
{
|
|
870
870
|
sx: {
|
|
871
|
-
...
|
|
871
|
+
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
872
872
|
},
|
|
873
|
-
children: /* @__PURE__ */ e(
|
|
873
|
+
children: /* @__PURE__ */ e(Ot, { handleNextStep: ge })
|
|
874
874
|
}
|
|
875
875
|
),
|
|
876
|
-
|
|
876
|
+
q === 2 && /* @__PURE__ */ e(
|
|
877
877
|
I,
|
|
878
878
|
{
|
|
879
879
|
sx: {
|
|
880
|
-
...
|
|
880
|
+
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
881
881
|
},
|
|
882
|
-
children: /* @__PURE__ */ e(
|
|
882
|
+
children: /* @__PURE__ */ e(Ht, {})
|
|
883
883
|
}
|
|
884
884
|
),
|
|
885
|
-
|
|
885
|
+
q === 3 && /* @__PURE__ */ o(
|
|
886
886
|
I,
|
|
887
887
|
{
|
|
888
888
|
sx: {
|
|
889
|
-
...
|
|
889
|
+
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
890
890
|
},
|
|
891
891
|
children: [
|
|
892
|
-
/* @__PURE__ */ e(
|
|
893
|
-
/* @__PURE__ */ e(
|
|
894
|
-
|
|
895
|
-
/* @__PURE__ */ e(
|
|
896
|
-
/* @__PURE__ */ e(
|
|
897
|
-
|
|
892
|
+
/* @__PURE__ */ e(de, { pb: 12, children: t.add_income_title }),
|
|
893
|
+
/* @__PURE__ */ e(O, { mb: 24, children: t.add_income_description }),
|
|
894
|
+
A.length > 0 && !H && /* @__PURE__ */ o(U, { children: [
|
|
895
|
+
/* @__PURE__ */ e(ee, { children: A.map((x, E) => /* @__PURE__ */ o(f.Fragment, { children: [
|
|
896
|
+
/* @__PURE__ */ e(mt, { bgcolor: "background.paper", children: pt(
|
|
897
|
+
B(x.nextDate || x.date)
|
|
898
898
|
) }),
|
|
899
|
-
/* @__PURE__ */ e(
|
|
900
|
-
|
|
899
|
+
/* @__PURE__ */ e(ut, { transaction: x }),
|
|
900
|
+
E !== A.length - 1 && /* @__PURE__ */ e(v, {})
|
|
901
901
|
] }, x.guid)) }),
|
|
902
902
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", children: [
|
|
903
|
-
/* @__PURE__ */ e(
|
|
903
|
+
/* @__PURE__ */ e(v, { sx: { flexGrow: 1 } }),
|
|
904
904
|
/* @__PURE__ */ e(
|
|
905
|
-
|
|
905
|
+
M,
|
|
906
906
|
{
|
|
907
907
|
onClick: () => S(!0),
|
|
908
|
-
startIcon: /* @__PURE__ */ e(
|
|
908
|
+
startIcon: /* @__PURE__ */ e(G, { name: "add", size: 20 }),
|
|
909
909
|
children: t.add_income
|
|
910
910
|
}
|
|
911
911
|
)
|
|
912
912
|
] })
|
|
913
913
|
] }),
|
|
914
914
|
Ue && /* @__PURE__ */ e(
|
|
915
|
-
|
|
915
|
+
rt,
|
|
916
916
|
{
|
|
917
917
|
bgcolor: "background.paper",
|
|
918
|
-
onSearch: (x) =>
|
|
919
|
-
...
|
|
920
|
-
custom: (
|
|
918
|
+
onSearch: (x) => d({
|
|
919
|
+
...i,
|
|
920
|
+
custom: (E) => x ? st(E, x) : we(E)
|
|
921
921
|
}),
|
|
922
922
|
onSelected: (x) => {
|
|
923
|
-
|
|
923
|
+
le(x), S(!1);
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
),
|
|
927
|
-
!ze && g && /* @__PURE__ */ e(
|
|
928
|
-
H && /* @__PURE__ */ o(
|
|
927
|
+
!ze && g && /* @__PURE__ */ e(O, { color: "error", mt: 16, children: t.confirm_error }),
|
|
928
|
+
H && /* @__PURE__ */ o(U, { children: [
|
|
929
929
|
/* @__PURE__ */ e(
|
|
930
|
-
|
|
930
|
+
ct,
|
|
931
931
|
{
|
|
932
932
|
bgcolor: "background.paper",
|
|
933
|
-
firstDay:
|
|
934
|
-
frequency:
|
|
935
|
-
onFirstDayChange:
|
|
936
|
-
onFrequencyChange:
|
|
937
|
-
onSecondDayChange:
|
|
938
|
-
secondDay:
|
|
933
|
+
firstDay: w,
|
|
934
|
+
frequency: N,
|
|
935
|
+
onFirstDayChange: D,
|
|
936
|
+
onFrequencyChange: h,
|
|
937
|
+
onSecondDayChange: K,
|
|
938
|
+
secondDay: k,
|
|
939
939
|
transaction: H
|
|
940
940
|
}
|
|
941
941
|
),
|
|
942
942
|
/* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
943
943
|
/* @__PURE__ */ e(
|
|
944
|
-
|
|
944
|
+
M,
|
|
945
945
|
{
|
|
946
946
|
"aria-disabled": !H,
|
|
947
947
|
onClick: () => {
|
|
948
|
-
const x = [...
|
|
948
|
+
const x = [...A];
|
|
949
949
|
x.push({
|
|
950
950
|
...H,
|
|
951
|
-
nextDate:
|
|
952
|
-
frequency:
|
|
953
|
-
}),
|
|
951
|
+
nextDate: ve(N, _e(H.date)),
|
|
952
|
+
frequency: N
|
|
953
|
+
}), W(x), le("");
|
|
954
954
|
},
|
|
955
955
|
variant: "contained",
|
|
956
|
-
children:
|
|
956
|
+
children: r.confirm_button
|
|
957
957
|
}
|
|
958
958
|
),
|
|
959
959
|
/* @__PURE__ */ e(
|
|
960
|
-
|
|
960
|
+
M,
|
|
961
961
|
{
|
|
962
962
|
onClick: () => {
|
|
963
|
-
|
|
963
|
+
le(""), S(!0), ge().finally();
|
|
964
964
|
},
|
|
965
965
|
variant: "outlined",
|
|
966
|
-
children:
|
|
966
|
+
children: r.cancel_button
|
|
967
967
|
}
|
|
968
968
|
)
|
|
969
969
|
] })
|
|
970
970
|
] }),
|
|
971
|
-
|
|
971
|
+
A.length > 0 && !H && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
972
972
|
/* @__PURE__ */ e(
|
|
973
|
-
|
|
973
|
+
M,
|
|
974
974
|
{
|
|
975
|
-
"aria-disabled":
|
|
975
|
+
"aria-disabled": A.length < 1 || _,
|
|
976
976
|
onClick: Be,
|
|
977
|
-
startIcon:
|
|
978
|
-
|
|
977
|
+
startIcon: _ ? /* @__PURE__ */ e(
|
|
978
|
+
G,
|
|
979
979
|
{
|
|
980
980
|
name: "progress_activity",
|
|
981
981
|
sx: {
|
|
982
|
-
animation: `${
|
|
982
|
+
animation: `${Ft} 2s linear infinite`
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
985
|
) : null,
|
|
@@ -987,72 +987,72 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
987
987
|
children: t.confirm_income_button
|
|
988
988
|
}
|
|
989
989
|
),
|
|
990
|
-
/* @__PURE__ */ e(
|
|
990
|
+
/* @__PURE__ */ e(M, { onClick: p, variant: "outlined", children: t.skip_button })
|
|
991
991
|
] })
|
|
992
992
|
]
|
|
993
993
|
}
|
|
994
994
|
)
|
|
995
995
|
]
|
|
996
996
|
}
|
|
997
|
-
) : /* @__PURE__ */ e(
|
|
998
|
-
},
|
|
997
|
+
) : /* @__PURE__ */ e(te, {});
|
|
998
|
+
}, $t = T(Wt), Mt = ({ onBackClick: a, sx: n = {} }) => {
|
|
999
999
|
const {
|
|
1000
1000
|
selectedAccounts: t,
|
|
1001
|
-
selectedAccountGuids:
|
|
1002
|
-
setSelectedAccounts:
|
|
1001
|
+
selectedAccountGuids: r,
|
|
1002
|
+
setSelectedAccounts: p,
|
|
1003
1003
|
shouldDisableNextDate: g,
|
|
1004
|
-
shouldDisablePrevDate:
|
|
1005
|
-
} = X(), { onEvent: y } =
|
|
1004
|
+
shouldDisablePrevDate: c
|
|
1005
|
+
} = X(), { onEvent: y } = Oe(), { clientConfig: l } = Qe(), { visibleCashAccounts: i } = Ne(), { setFilter: d } = He(), { userProfile: m } = ke(), { dateRange: b, setSelectedCashAccounts: C } = V(), { loadRepeatingTransactions: S, setDateRange: N } = P(), { cashflow: h, recurring: w } = L(), { isCopyLoaded: D, isInitialized: k } = X(), _ = l?.master?.deep_link_params?.view === "manage_income", [j, q] = f.useState(!0);
|
|
1006
1006
|
return f.useEffect(() => {
|
|
1007
|
-
|
|
1008
|
-
}, [
|
|
1009
|
-
|
|
1010
|
-
}, [
|
|
1011
|
-
const
|
|
1012
|
-
(
|
|
1007
|
+
k && (N(b), S().finally());
|
|
1008
|
+
}, [k]), f.useEffect(() => {
|
|
1009
|
+
p(i);
|
|
1010
|
+
}, [i]), f.useEffect(() => {
|
|
1011
|
+
const ae = i.map((W) => W.guid), A = t.filter(
|
|
1012
|
+
(W) => r.includes(W.guid) && ae.includes(W.guid)
|
|
1013
1013
|
);
|
|
1014
|
-
|
|
1015
|
-
dateRange: { start:
|
|
1016
|
-
accounts:
|
|
1014
|
+
C(A), d({
|
|
1015
|
+
dateRange: { start: Ge(F(), 90), end: ft() },
|
|
1016
|
+
accounts: A.map((W) => W.guid)
|
|
1017
1017
|
});
|
|
1018
|
-
}, [
|
|
1018
|
+
}, [i, t]), !D || !k ? /* @__PURE__ */ e(te, {}) : m?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(
|
|
1019
1019
|
De,
|
|
1020
1020
|
{
|
|
1021
|
-
accountOptions:
|
|
1021
|
+
accountOptions: i,
|
|
1022
1022
|
actions: [
|
|
1023
1023
|
{
|
|
1024
|
-
label:
|
|
1024
|
+
label: w.action_title,
|
|
1025
1025
|
iconName: "credit_card_gear",
|
|
1026
1026
|
onClick: () => {
|
|
1027
|
-
|
|
1027
|
+
q(!0), y(Ae.CASH_FLOW_CLICK_SETTINGS);
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
1030
|
],
|
|
1031
1031
|
calendarActions: {
|
|
1032
1032
|
shouldDisableNext: g,
|
|
1033
|
-
shouldDisablePrevious:
|
|
1033
|
+
shouldDisablePrevious: c,
|
|
1034
1034
|
shouldDisablePicker: !0,
|
|
1035
1035
|
onRangeChanged: () => {
|
|
1036
1036
|
}
|
|
1037
1037
|
},
|
|
1038
|
-
dateRange:
|
|
1038
|
+
dateRange: b,
|
|
1039
1039
|
dateRangeVariant: "readonly",
|
|
1040
|
-
onAccountsFilterClick: () => y(
|
|
1040
|
+
onAccountsFilterClick: () => y(Ae.CASH_FLOW_CLICK_FILTER),
|
|
1041
1041
|
onBackClick: a,
|
|
1042
1042
|
sx: n,
|
|
1043
|
-
title:
|
|
1043
|
+
title: h.title,
|
|
1044
1044
|
children: [
|
|
1045
|
-
/* @__PURE__ */ e(
|
|
1046
|
-
/* @__PURE__ */ e(
|
|
1045
|
+
/* @__PURE__ */ e(Lt, {}),
|
|
1046
|
+
/* @__PURE__ */ e(Tt, {}),
|
|
1047
1047
|
/* @__PURE__ */ e(
|
|
1048
|
-
|
|
1048
|
+
Me,
|
|
1049
1049
|
{
|
|
1050
|
-
ariaLabelClose:
|
|
1051
|
-
isOpen:
|
|
1052
|
-
onClose: () =>
|
|
1050
|
+
ariaLabelClose: h.close_settings_aria,
|
|
1051
|
+
isOpen: j,
|
|
1052
|
+
onClose: () => q(!1),
|
|
1053
1053
|
shouldShowHeaderBorders: !1,
|
|
1054
|
-
title:
|
|
1055
|
-
children: /* @__PURE__ */ e(
|
|
1054
|
+
title: w.action_title,
|
|
1055
|
+
children: /* @__PURE__ */ e(Je, { defaultSelectedTab: _ ? 1 : 0 })
|
|
1056
1056
|
}
|
|
1057
1057
|
)
|
|
1058
1058
|
]
|
|
@@ -1062,34 +1062,34 @@ const St = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1062
1062
|
{
|
|
1063
1063
|
onBackClick: a,
|
|
1064
1064
|
sx: { height: "100%", overflow: "auto" },
|
|
1065
|
-
title:
|
|
1066
|
-
children: /* @__PURE__ */ e(
|
|
1065
|
+
title: h.title,
|
|
1066
|
+
children: /* @__PURE__ */ e($t, {})
|
|
1067
1067
|
}
|
|
1068
1068
|
);
|
|
1069
|
-
},
|
|
1070
|
-
class
|
|
1069
|
+
}, Fn = T(Mt);
|
|
1070
|
+
class Wn {
|
|
1071
1071
|
fetchInstance;
|
|
1072
|
-
constructor(n, t,
|
|
1073
|
-
this.fetchInstance = new
|
|
1072
|
+
constructor(n, t, r) {
|
|
1073
|
+
this.fetchInstance = new gt(n, t, void 0, r);
|
|
1074
1074
|
}
|
|
1075
|
-
addCashflowEvent = async (n) => this.fetchInstance.post(
|
|
1076
|
-
addCashflowSequence = async (n) => this.fetchInstance.post(
|
|
1077
|
-
getCashflowSequences = async () => this.fetchInstance.get(
|
|
1075
|
+
addCashflowEvent = async (n) => this.fetchInstance.post(z.CASHFLOW_EVENTS, { ...n }).then((t) => t);
|
|
1076
|
+
addCashflowSequence = async (n) => this.fetchInstance.post(z.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
|
|
1077
|
+
getCashflowSequences = async () => this.fetchInstance.get(z.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
|
|
1078
1078
|
getCashflowEventsByDateRange = async (n, t) => this.fetchInstance.get(
|
|
1079
|
-
`${
|
|
1080
|
-
).then((
|
|
1081
|
-
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${
|
|
1079
|
+
`${z.CASHFLOW_EVENTS}/from/${B(n)}/to/${B(t)}`
|
|
1080
|
+
).then((r) => r.cashflow_events);
|
|
1081
|
+
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${z.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
|
|
1082
1082
|
getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
|
|
1083
|
-
`${
|
|
1083
|
+
`${z.CASHFLOW_SEQUENCES}/projected_events/from/${B(
|
|
1084
1084
|
n
|
|
1085
|
-
)}/to/${
|
|
1086
|
-
).then((
|
|
1087
|
-
updateCashflowSequence = async (n) => this.fetchInstance.put(`${
|
|
1085
|
+
)}/to/${B(t)}`
|
|
1086
|
+
).then((r) => r.cashflow_events);
|
|
1087
|
+
updateCashflowSequence = async (n) => this.fetchInstance.put(`${z.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
|
|
1088
1088
|
}
|
|
1089
1089
|
export {
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1090
|
+
Wn as CashflowApi,
|
|
1091
|
+
Hn as CashflowMiniWidget,
|
|
1092
|
+
$t as CashflowOnboarding,
|
|
1093
|
+
Gn as CashflowStore,
|
|
1094
|
+
Fn as CashflowWidget
|
|
1095
1095
|
};
|