@mx-cartographer/experiences 7.0.7 → 7.0.8-alpha.al0
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 +231 -229
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as U, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import p, { useState as K } from "react";
|
|
3
3
|
import { observer as R } from "mobx-react-lite";
|
|
4
4
|
import { addMonths as qe } from "date-fns/addMonths";
|
|
5
5
|
import { startOfToday as $ } from "date-fns/startOfToday";
|
|
6
|
-
import
|
|
6
|
+
import v from "@mui/material/Box";
|
|
7
7
|
import H from "@mui/material/Button";
|
|
8
|
-
import
|
|
8
|
+
import E from "@mui/material/Divider";
|
|
9
9
|
import r from "@mui/material/Stack";
|
|
10
10
|
import ie from "@mui/material/styles/useTheme";
|
|
11
|
-
import { Text as
|
|
12
|
-
import { G as Ye, t as le, u as
|
|
13
|
-
import { C as
|
|
11
|
+
import { Text as f, P as O, Icon as F, InstitutionLogo as xe, H1 as ce, H2 as Xe } from "@mxenabled/mxui";
|
|
12
|
+
import { G as Ye, t as le, u as L, p as ae, c as Le, a as X, o as de, h as P, e as Oe, f as ke } from "../hooks-02T565vf.mjs";
|
|
13
|
+
import { C as N } from "../CurrencyText-YUhH2caW.mjs";
|
|
14
14
|
import { u as me } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
15
15
|
import { L as re } from "../Loader-Dp1P2gNw.mjs";
|
|
16
16
|
import { I as ue } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
@@ -44,17 +44,17 @@ import { S as lt, b as dt } from "../TransactionDetails-BSfXqkpH.mjs";
|
|
|
44
44
|
import { F as mt, R as Ie, e as De } from "../RepeatingTransaction-BW4J-jeJ.mjs";
|
|
45
45
|
import { h as ut } from "../DateUtil-BcuH7ErC.mjs";
|
|
46
46
|
import { endOfToday as ht } from "date-fns/endOfToday";
|
|
47
|
-
import { W as ve, A as
|
|
47
|
+
import { W as ve, A as Ee } from "../WidgetContainer-BG-fdDOf.mjs";
|
|
48
48
|
import { F as pt, A as z } from "../Fetch-CkFKy79O.mjs";
|
|
49
49
|
const V = () => {
|
|
50
|
-
if (!
|
|
50
|
+
if (!p.useContext(Ye))
|
|
51
51
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
52
52
|
return le().uiStore;
|
|
53
53
|
}, ft = ({ remaining: i }) => {
|
|
54
|
-
const { cashflow: n } =
|
|
54
|
+
const { cashflow: n } = L();
|
|
55
55
|
return /* @__PURE__ */ o(U, { children: [
|
|
56
56
|
/* @__PURE__ */ e(
|
|
57
|
-
|
|
57
|
+
v,
|
|
58
58
|
{
|
|
59
59
|
sx: {
|
|
60
60
|
borderRadius: "1px",
|
|
@@ -64,36 +64,38 @@ const V = () => {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
/* @__PURE__ */ e(
|
|
67
|
+
/* @__PURE__ */ e(f, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
68
|
+
/* @__PURE__ */ e(N, { amount: i, bold: !0, sx: { fontSize: 12 } })
|
|
69
69
|
] });
|
|
70
70
|
}, he = R(ft), gt = ({ onAddIncomeClick: i }) => {
|
|
71
|
-
const n = ie(), { availableWidth: t } = ae(), { isMobile: s } = me(), { visibleCashAccounts:
|
|
71
|
+
const n = ie(), { availableWidth: t } = ae(), { isMobile: s } = me(), { visibleCashAccounts: d, visibleCashBalance: g } = Le(), { selectedAccountGuids: c } = X(), { cashflow: m } = L(), { userProfile: C } = de(), {
|
|
72
72
|
daysUntilNextIncome: a,
|
|
73
|
-
expensesTilNextIncome:
|
|
74
|
-
selectedCashAccounts:
|
|
73
|
+
expensesTilNextIncome: u,
|
|
74
|
+
selectedCashAccounts: l,
|
|
75
75
|
setNextIncome: b,
|
|
76
|
-
setSelectedCashAccounts:
|
|
77
|
-
setUpcomingExpenses:
|
|
78
|
-
} = V(), { isDataLoaded: A, nextIncomeRecurrence:
|
|
79
|
-
|
|
80
|
-
_(
|
|
81
|
-
|
|
76
|
+
setSelectedCashAccounts: w,
|
|
77
|
+
setUpcomingExpenses: S
|
|
78
|
+
} = V(), { isDataLoaded: A, nextIncomeRecurrence: h, upcomingExpenses: I } = P();
|
|
79
|
+
p.useEffect(() => {
|
|
80
|
+
d && d.forEach((_) => console.log("cash account: ", _.guid)), c && c.forEach((_) => console.log("selectedAccount: ", _)), w(
|
|
81
|
+
d.filter((_) => c.includes(_.guid))
|
|
82
82
|
);
|
|
83
|
-
}, [
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
}, [d, c]), p.useEffect(() => {
|
|
84
|
+
console.log("upcoming exp: ", I), console.log("next income recurr: ", h), h && b(h), S(I);
|
|
85
|
+
}, [h, I]), p.useEffect(() => {
|
|
86
|
+
console.log("expensesTilNextIncome:", u), console.log("selectedCashAccounts:", l), console.log("daysUntilNextIncome:", a);
|
|
87
|
+
}, [u, l, a]);
|
|
88
|
+
const y = p.useMemo(
|
|
89
|
+
() => d.filter((_) => c.includes(_.guid)).reduce((_, D) => _ + (D?.balance || 0), 0),
|
|
90
|
+
[c, I]
|
|
91
|
+
), M = p.useMemo(
|
|
92
|
+
() => u.filter((_) => c.includes(_.accountGuid || "")).reduce((_, D) => _ + D.amount, 0),
|
|
93
|
+
[c, u]
|
|
94
|
+
), G = p.useMemo(
|
|
95
|
+
() => y - M,
|
|
96
|
+
[y, M]
|
|
95
97
|
), j = C?.has_completed_cash_flow_onboarding && !!i;
|
|
96
|
-
return A ? /* @__PURE__ */ e(
|
|
98
|
+
return A ? /* @__PURE__ */ e(v, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: t > 610 ? /* @__PURE__ */ o(
|
|
97
99
|
r,
|
|
98
100
|
{
|
|
99
101
|
border: `1px solid ${n.palette.border.light}`,
|
|
@@ -103,53 +105,53 @@ const V = () => {
|
|
|
103
105
|
px: 24,
|
|
104
106
|
children: [
|
|
105
107
|
/* @__PURE__ */ o(r, { pb: 14, pt: 12, children: [
|
|
106
|
-
/* @__PURE__ */ e(
|
|
107
|
-
/* @__PURE__ */ e(
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
/* @__PURE__ */ e(N, { amount: y, variant: "H2" }),
|
|
109
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: q(
|
|
110
|
+
m.total_cash_accounts,
|
|
111
|
+
l.length
|
|
110
112
|
) })
|
|
111
113
|
] }),
|
|
112
114
|
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(F, { name: "remove" }) }),
|
|
113
115
|
/* @__PURE__ */ o(r, { pb: 14, pt: 12, children: [
|
|
114
|
-
/* @__PURE__ */ e(
|
|
115
|
-
/* @__PURE__ */ e(
|
|
116
|
+
/* @__PURE__ */ e(N, { amount: M, variant: "H2" }),
|
|
117
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: q(m.expenses_due, u.length) })
|
|
116
118
|
] }),
|
|
117
119
|
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(F, { name: "equal" }) }),
|
|
118
120
|
/* @__PURE__ */ o(r, { pb: 14, pr: 24, pt: 12, children: [
|
|
119
|
-
/* @__PURE__ */ e(
|
|
121
|
+
/* @__PURE__ */ e(N, { amount: G, variant: "H2" }),
|
|
120
122
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
121
|
-
/* @__PURE__ */ e(
|
|
122
|
-
/* @__PURE__ */ e(ue, { body:
|
|
123
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: m.available_to_spend }),
|
|
124
|
+
/* @__PURE__ */ e(ue, { body: m.tooltip_body, title: m.tooltip_title })
|
|
123
125
|
] })
|
|
124
126
|
] }),
|
|
125
127
|
/* @__PURE__ */ e(r, { borderLeft: `1px solid ${n.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: j ? /* @__PURE__ */ o(U, { children: [
|
|
126
|
-
/* @__PURE__ */ e(
|
|
127
|
-
/* @__PURE__ */ e(
|
|
128
|
+
/* @__PURE__ */ e(f, { variant: "H2", children: q(m.days, a) }),
|
|
129
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: m.next_paycheck })
|
|
128
130
|
] }) : /* @__PURE__ */ e(
|
|
129
131
|
H,
|
|
130
132
|
{
|
|
131
133
|
onClick: i,
|
|
132
134
|
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
133
135
|
sx: { fontSize: 13, lineHeight: "initial" },
|
|
134
|
-
children:
|
|
136
|
+
children: m.add_income
|
|
135
137
|
}
|
|
136
138
|
) })
|
|
137
139
|
]
|
|
138
140
|
}
|
|
139
141
|
) : /* @__PURE__ */ o(r, { border: `1px solid ${n.palette.border.light}`, borderRadius: 1, children: [
|
|
140
142
|
/* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
141
|
-
/* @__PURE__ */ e(
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
/* @__PURE__ */ e(f, { variant: "Small", children: q(
|
|
144
|
+
m.total_cash_accounts,
|
|
145
|
+
l.length
|
|
144
146
|
) }),
|
|
145
|
-
/* @__PURE__ */ e(
|
|
147
|
+
/* @__PURE__ */ e(N, { amount: g, bold: !0, variant: "XSmall" })
|
|
146
148
|
] }),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(E, {}),
|
|
148
150
|
/* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
149
|
-
/* @__PURE__ */ e(
|
|
150
|
-
/* @__PURE__ */ e(
|
|
151
|
+
/* @__PURE__ */ e(f, { variant: "Small", children: q(m.expenses_due, u.length) }),
|
|
152
|
+
/* @__PURE__ */ e(N, { amount: M, bold: !0, symbol: "-", variant: "XSmall" })
|
|
151
153
|
] }),
|
|
152
|
-
/* @__PURE__ */ e(
|
|
154
|
+
/* @__PURE__ */ e(E, {}),
|
|
153
155
|
/* @__PURE__ */ e(
|
|
154
156
|
r,
|
|
155
157
|
{
|
|
@@ -164,10 +166,10 @@ const V = () => {
|
|
|
164
166
|
children: /* @__PURE__ */ e(he, { remaining: G })
|
|
165
167
|
}
|
|
166
168
|
),
|
|
167
|
-
/* @__PURE__ */ e(
|
|
169
|
+
/* @__PURE__ */ e(E, {}),
|
|
168
170
|
j ? /* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
169
|
-
/* @__PURE__ */ e(
|
|
170
|
-
/* @__PURE__ */ e(
|
|
171
|
+
/* @__PURE__ */ e(f, { variant: "Small", children: m.next_paycheck }),
|
|
172
|
+
/* @__PURE__ */ e(f, { bold: !0, variant: "XSmall", children: q(m.days, a) })
|
|
171
173
|
] }) : /* @__PURE__ */ o(
|
|
172
174
|
r,
|
|
173
175
|
{
|
|
@@ -178,14 +180,14 @@ const V = () => {
|
|
|
178
180
|
pr: 2,
|
|
179
181
|
py: 2,
|
|
180
182
|
children: [
|
|
181
|
-
/* @__PURE__ */ e(
|
|
183
|
+
/* @__PURE__ */ e(f, { variant: "Small", children: m.next_paycheck }),
|
|
182
184
|
/* @__PURE__ */ e(
|
|
183
185
|
H,
|
|
184
186
|
{
|
|
185
187
|
onClick: i,
|
|
186
188
|
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
187
189
|
sx: { fontSize: 13 },
|
|
188
|
-
children:
|
|
190
|
+
children: m.add_income
|
|
189
191
|
}
|
|
190
192
|
)
|
|
191
193
|
]
|
|
@@ -193,10 +195,10 @@ const V = () => {
|
|
|
193
195
|
)
|
|
194
196
|
] }) }) : /* @__PURE__ */ e(re, { height: s ? 210 : 120 });
|
|
195
197
|
}, bt = R(gt), xt = ({ onPrimaryCtaClick: i, sx: n = {} }) => {
|
|
196
|
-
const { cashflow: t } =
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
}, [
|
|
198
|
+
const { cashflow: t } = L(), { isCopyLoaded: s, isInitialized: d } = X(), { loadRepeatingTransactions: g, setDateRange: c } = P();
|
|
199
|
+
return p.useEffect(() => {
|
|
200
|
+
d && (c({ start: $(), end: qe($(), 1) }), g().finally());
|
|
201
|
+
}, [d]), s ? /* @__PURE__ */ e(
|
|
200
202
|
Qe,
|
|
201
203
|
{
|
|
202
204
|
className: "mx-exp-cashflow-miniwidget",
|
|
@@ -208,7 +210,7 @@ const V = () => {
|
|
|
208
210
|
children: /* @__PURE__ */ e(bt, { onAddIncomeClick: i })
|
|
209
211
|
}
|
|
210
212
|
) : /* @__PURE__ */ e(re, {});
|
|
211
|
-
},
|
|
213
|
+
}, Ln = R(xt), Ct = ({ remaining: i }) => /* @__PURE__ */ e(
|
|
212
214
|
ee,
|
|
213
215
|
{
|
|
214
216
|
sx: {
|
|
@@ -228,12 +230,12 @@ var te = /* @__PURE__ */ ((i) => (i.EXPENSE = "expense", i.INCOME = "income", i)
|
|
|
228
230
|
const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
229
231
|
/* @__PURE__ */ o(ee, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
230
232
|
/* @__PURE__ */ o(r, { alignItems: "center", height: 32, width: 32, children: [
|
|
231
|
-
/* @__PURE__ */ e(
|
|
232
|
-
/* @__PURE__ */ e(
|
|
233
|
+
/* @__PURE__ */ e(f, { bold: !0, sx: { fontSize: 11 }, children: Y(i.expectedDate, Q.MONTH) }),
|
|
234
|
+
/* @__PURE__ */ e(f, { bold: !0, sx: { fontSize: 11 }, children: Y(i.expectedDate, Q.DAY) })
|
|
233
235
|
] }),
|
|
234
|
-
/* @__PURE__ */ e(
|
|
236
|
+
/* @__PURE__ */ e(f, { sx: { flexGrow: 1, fontSize: 13 }, children: i.name }),
|
|
235
237
|
/* @__PURE__ */ e(
|
|
236
|
-
|
|
238
|
+
N,
|
|
237
239
|
{
|
|
238
240
|
amount: i.amount,
|
|
239
241
|
bold: !0,
|
|
@@ -241,9 +243,9 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
241
243
|
}
|
|
242
244
|
)
|
|
243
245
|
] }),
|
|
244
|
-
/* @__PURE__ */ e(
|
|
245
|
-
] }),
|
|
246
|
-
const { cashflow: t } =
|
|
246
|
+
/* @__PURE__ */ e(E, {})
|
|
247
|
+
] }), Ae = R(_t), wt = ({ total: i, type: n }) => {
|
|
248
|
+
const { cashflow: t } = L();
|
|
247
249
|
return /* @__PURE__ */ o(U, { children: [
|
|
248
250
|
/* @__PURE__ */ o(
|
|
249
251
|
Ze,
|
|
@@ -258,36 +260,36 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
258
260
|
px: 24
|
|
259
261
|
},
|
|
260
262
|
children: [
|
|
261
|
-
/* @__PURE__ */ e(
|
|
262
|
-
/* @__PURE__ */ o(
|
|
263
|
+
/* @__PURE__ */ e(f, { bold: !0, sx: { fontSize: 12 }, children: n === te.EXPENSE ? t.expenses : t.income }),
|
|
264
|
+
/* @__PURE__ */ o(f, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
263
265
|
n === te.EXPENSE ? "-" : "+",
|
|
264
266
|
J(i, "0,0.00")
|
|
265
267
|
] })
|
|
266
268
|
]
|
|
267
269
|
}
|
|
268
270
|
),
|
|
269
|
-
/* @__PURE__ */ e(
|
|
271
|
+
/* @__PURE__ */ e(E, {})
|
|
270
272
|
] });
|
|
271
273
|
}, Te = R(wt), oe = (i, n) => (t) => t.accountGuid === i.guid && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), St = () => {
|
|
272
|
-
const { availableWidth: i } = ae(), { cashflow: n } =
|
|
274
|
+
const { availableWidth: i } = ae(), { cashflow: n } = L(), { upcomingExpenses: t, upcomingIncome: s } = P(), { dateRange: d, selectedCashAccounts: g } = V();
|
|
273
275
|
return /* @__PURE__ */ o(r, { children: [
|
|
274
276
|
/* @__PURE__ */ o(r, { direction: i < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
275
|
-
/* @__PURE__ */ e(
|
|
276
|
-
/* @__PURE__ */ o(
|
|
277
|
-
Y(
|
|
277
|
+
/* @__PURE__ */ e(f, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
278
|
+
/* @__PURE__ */ o(f, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
279
|
+
Y(d.start, Q.FULL_MONTH_DAY),
|
|
278
280
|
" -",
|
|
279
281
|
" ",
|
|
280
|
-
Y(
|
|
282
|
+
Y(d.end, Q.FULL_MONTH_DAY)
|
|
281
283
|
] })
|
|
282
284
|
] }),
|
|
283
285
|
/* @__PURE__ */ e(r, { children: g.map((c) => {
|
|
284
|
-
const
|
|
285
|
-
oe(c,
|
|
286
|
-
), a =
|
|
287
|
-
(
|
|
286
|
+
const m = s.filter(oe(c, d)).sort((l, b) => B(l.expectedDate) - B(b.expectedDate)), C = t.filter(
|
|
287
|
+
oe(c, d)
|
|
288
|
+
), a = m.reduce(
|
|
289
|
+
(l, b) => l + b.amount,
|
|
288
290
|
0
|
|
289
|
-
),
|
|
290
|
-
(
|
|
291
|
+
), u = C.reduce(
|
|
292
|
+
(l, b) => l + b.amount,
|
|
291
293
|
0
|
|
292
294
|
);
|
|
293
295
|
return /* @__PURE__ */ o(
|
|
@@ -311,27 +313,27 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
311
313
|
}
|
|
312
314
|
}
|
|
313
315
|
),
|
|
314
|
-
/* @__PURE__ */ e(
|
|
315
|
-
|
|
316
|
+
/* @__PURE__ */ e(E, {}),
|
|
317
|
+
m.length > 0 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(
|
|
316
318
|
Z,
|
|
317
319
|
{
|
|
318
320
|
subheader: /* @__PURE__ */ e(Te, { total: a, type: te.INCOME }),
|
|
319
321
|
sx: { width: "100%" },
|
|
320
|
-
children:
|
|
322
|
+
children: m.map((l) => /* @__PURE__ */ e(Ae, { recurrence: l }, l.repeatingTransactionGuid))
|
|
321
323
|
}
|
|
322
324
|
) }),
|
|
323
325
|
C.length > 0 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(
|
|
324
326
|
Z,
|
|
325
327
|
{
|
|
326
|
-
subheader: /* @__PURE__ */ e(Te, { total:
|
|
328
|
+
subheader: /* @__PURE__ */ e(Te, { total: u, type: te.EXPENSE }),
|
|
327
329
|
sx: { width: "100%" },
|
|
328
|
-
children: C.map((
|
|
330
|
+
children: C.map((l) => /* @__PURE__ */ e(Ae, { recurrence: l }, l.repeatingTransactionGuid))
|
|
329
331
|
}
|
|
330
332
|
) }),
|
|
331
333
|
/* @__PURE__ */ e(
|
|
332
334
|
Ct,
|
|
333
335
|
{
|
|
334
|
-
remaining: (c.available_balance || c.balance || 0) + a -
|
|
336
|
+
remaining: (c.available_balance || c.balance || 0) + a - u
|
|
335
337
|
}
|
|
336
338
|
)
|
|
337
339
|
]
|
|
@@ -341,23 +343,23 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
341
343
|
}) })
|
|
342
344
|
] });
|
|
343
345
|
}, yt = R(St), It = () => {
|
|
344
|
-
const { availableWidth: i } = ae(), n = ie(), { cashflow: t } =
|
|
346
|
+
const { availableWidth: i } = ae(), n = ie(), { cashflow: t } = L(), { upcomingExpenses: s, upcomingIncome: d } = P(), { dateRange: g, selectedCashAccounts: c } = V(), m = [
|
|
345
347
|
{
|
|
346
348
|
field: "account",
|
|
347
349
|
flex: 1.5,
|
|
348
350
|
headerName: t.accounts,
|
|
349
|
-
renderCell: ({ value: { name: a, nickname:
|
|
350
|
-
const
|
|
351
|
+
renderCell: ({ value: { name: a, nickname: u, institution_guid: l, account_number: b } }) => {
|
|
352
|
+
const w = u || a;
|
|
351
353
|
return /* @__PURE__ */ o(r, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
352
354
|
/* @__PURE__ */ e(
|
|
353
355
|
xe,
|
|
354
356
|
{
|
|
355
357
|
alt: t.institution_logo,
|
|
356
|
-
institutionGuid:
|
|
358
|
+
institutionGuid: l || "",
|
|
357
359
|
size: 16
|
|
358
360
|
}
|
|
359
361
|
),
|
|
360
|
-
`${
|
|
362
|
+
`${w} ${b ? `*${b}` : ""}`
|
|
361
363
|
] });
|
|
362
364
|
}
|
|
363
365
|
},
|
|
@@ -388,34 +390,34 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
388
390
|
headerName: t.remaining,
|
|
389
391
|
type: "number",
|
|
390
392
|
renderCell: (a) => {
|
|
391
|
-
const
|
|
393
|
+
const u = a.row.balance + a.row.income - a.row.expenses;
|
|
392
394
|
return /* @__PURE__ */ e(
|
|
393
|
-
|
|
395
|
+
f,
|
|
394
396
|
{
|
|
395
|
-
color: Math.sign(
|
|
397
|
+
color: Math.sign(u) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
396
398
|
variant: "Small",
|
|
397
|
-
children: J(
|
|
399
|
+
children: J(u, "0,0.00")
|
|
398
400
|
}
|
|
399
401
|
);
|
|
400
402
|
}
|
|
401
403
|
}
|
|
402
|
-
], C =
|
|
403
|
-
const
|
|
404
|
+
], C = p.useMemo(() => c.map((a) => {
|
|
405
|
+
const u = s.filter(
|
|
404
406
|
oe(a, { start: $(), end: _e($(), 30) })
|
|
405
|
-
).reduce((
|
|
407
|
+
).reduce((w, S) => w + S.amount, 0), l = d.filter(
|
|
406
408
|
oe(a, { start: $(), end: _e($(), 30) })
|
|
407
|
-
).reduce((
|
|
409
|
+
).reduce((w, S) => w + S.amount, 0), b = (a.balance || 0) + l - u;
|
|
408
410
|
return {
|
|
409
411
|
account: a,
|
|
410
412
|
balance: a.balance || 0,
|
|
411
413
|
id: a.guid,
|
|
412
|
-
income:
|
|
413
|
-
expenses:
|
|
414
|
+
income: l,
|
|
415
|
+
expenses: u,
|
|
414
416
|
remaining: b
|
|
415
417
|
};
|
|
416
|
-
}), [c, s,
|
|
418
|
+
}), [c, s, d]);
|
|
417
419
|
return /* @__PURE__ */ o(
|
|
418
|
-
|
|
420
|
+
v,
|
|
419
421
|
{
|
|
420
422
|
sx: {
|
|
421
423
|
width: "100%"
|
|
@@ -430,7 +432,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
430
432
|
children: [
|
|
431
433
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
432
434
|
/* @__PURE__ */ e(
|
|
433
|
-
|
|
435
|
+
f,
|
|
434
436
|
{
|
|
435
437
|
bold: !0,
|
|
436
438
|
sx: {
|
|
@@ -448,7 +450,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
448
450
|
}
|
|
449
451
|
)
|
|
450
452
|
] }),
|
|
451
|
-
/* @__PURE__ */ o(
|
|
453
|
+
/* @__PURE__ */ o(f, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
|
|
452
454
|
Y(g.start, Q.FULL_MONTH_DAY),
|
|
453
455
|
" -",
|
|
454
456
|
" ",
|
|
@@ -461,7 +463,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
461
463
|
nt,
|
|
462
464
|
{
|
|
463
465
|
columnHeaderHeight: 48,
|
|
464
|
-
columns:
|
|
466
|
+
columns: m,
|
|
465
467
|
density: "standard",
|
|
466
468
|
disableColumnMenu: !0,
|
|
467
469
|
disableRowSelectionOnClick: !0,
|
|
@@ -484,7 +486,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
484
486
|
}
|
|
485
487
|
}
|
|
486
488
|
) : C.map((a) => {
|
|
487
|
-
const { name:
|
|
489
|
+
const { name: u, nickname: l, institution_guid: b, account_number: w } = a.account, S = l || u;
|
|
488
490
|
return /* @__PURE__ */ e(
|
|
489
491
|
Z,
|
|
490
492
|
{
|
|
@@ -513,13 +515,13 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
513
515
|
size: 16
|
|
514
516
|
}
|
|
515
517
|
),
|
|
516
|
-
/* @__PURE__ */ e(
|
|
518
|
+
/* @__PURE__ */ e(f, { variant: "Small", children: `${S} ${w ? `*${w}` : ""}` })
|
|
517
519
|
] }),
|
|
518
|
-
/* @__PURE__ */ e(
|
|
520
|
+
/* @__PURE__ */ e(N, { amount: a.balance, bold: !0, variant: "Small" })
|
|
519
521
|
]
|
|
520
522
|
}
|
|
521
523
|
),
|
|
522
|
-
/* @__PURE__ */ e(
|
|
524
|
+
/* @__PURE__ */ e(E, { sx: { width: "100%" } }),
|
|
523
525
|
/* @__PURE__ */ o(
|
|
524
526
|
r,
|
|
525
527
|
{
|
|
@@ -529,12 +531,12 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
529
531
|
px: 16,
|
|
530
532
|
py: 12,
|
|
531
533
|
children: [
|
|
532
|
-
/* @__PURE__ */ e(
|
|
533
|
-
/* @__PURE__ */ e(
|
|
534
|
+
/* @__PURE__ */ e(f, { variant: "Small", children: t.projected_income }),
|
|
535
|
+
/* @__PURE__ */ e(N, { amount: a.income, bold: !0, symbol: "+", variant: "Small" })
|
|
534
536
|
]
|
|
535
537
|
}
|
|
536
538
|
),
|
|
537
|
-
/* @__PURE__ */ e(
|
|
539
|
+
/* @__PURE__ */ e(E, { sx: { width: "100%" } }),
|
|
538
540
|
/* @__PURE__ */ o(
|
|
539
541
|
r,
|
|
540
542
|
{
|
|
@@ -544,12 +546,12 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
544
546
|
px: 16,
|
|
545
547
|
py: 12,
|
|
546
548
|
children: [
|
|
547
|
-
/* @__PURE__ */ e(
|
|
548
|
-
/* @__PURE__ */ e(
|
|
549
|
+
/* @__PURE__ */ e(f, { variant: "Small", children: t.projected_expenses }),
|
|
550
|
+
/* @__PURE__ */ e(N, { amount: a.expenses, bold: !0, symbol: "-", variant: "Small" })
|
|
549
551
|
]
|
|
550
552
|
}
|
|
551
553
|
),
|
|
552
|
-
/* @__PURE__ */ e(
|
|
554
|
+
/* @__PURE__ */ e(E, { sx: { width: "100%" } }),
|
|
553
555
|
/* @__PURE__ */ e(
|
|
554
556
|
r,
|
|
555
557
|
{
|
|
@@ -573,12 +575,12 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
573
575
|
}
|
|
574
576
|
);
|
|
575
577
|
}, Dt = R(It), vt = () => {
|
|
576
|
-
const { cashflow: i } =
|
|
577
|
-
m
|
|
578
|
+
const { cashflow: i } = L(), { isDesktop: n } = me(), { onEvent: t } = Oe(), [s, d] = p.useState(0), g = (c, m) => {
|
|
579
|
+
d(m);
|
|
578
580
|
};
|
|
579
|
-
return
|
|
581
|
+
return p.useEffect(() => {
|
|
580
582
|
t(s === 0 ? "cash_flow_summary" : "cash_flow_details");
|
|
581
|
-
}, [s]), /* @__PURE__ */ o(
|
|
583
|
+
}, [s]), /* @__PURE__ */ o(v, { children: [
|
|
582
584
|
/* @__PURE__ */ o(
|
|
583
585
|
Ke,
|
|
584
586
|
{
|
|
@@ -614,16 +616,16 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
614
616
|
]
|
|
615
617
|
}
|
|
616
618
|
),
|
|
617
|
-
/* @__PURE__ */ e(
|
|
618
|
-
/* @__PURE__ */ e(we, { index: 0, name: "cashflow", value: s, children: /* @__PURE__ */ e(
|
|
619
|
-
/* @__PURE__ */ e(we, { index: 1, name: "cashflow", value: s, children: /* @__PURE__ */ e(
|
|
619
|
+
/* @__PURE__ */ e(v, { sx: { mb: 32 } }),
|
|
620
|
+
/* @__PURE__ */ e(we, { index: 0, name: "cashflow", value: s, children: /* @__PURE__ */ e(v, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Dt, {}) }) }),
|
|
621
|
+
/* @__PURE__ */ e(we, { index: 1, name: "cashflow", value: s, children: /* @__PURE__ */ e(v, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(yt, {}) }) })
|
|
620
622
|
] });
|
|
621
|
-
},
|
|
623
|
+
}, Et = R(vt), ne = ({
|
|
622
624
|
amount: i,
|
|
623
625
|
isMobile: n = !1,
|
|
624
626
|
isTotal: t = !1,
|
|
625
627
|
label: s,
|
|
626
|
-
symbol:
|
|
628
|
+
symbol: d,
|
|
627
629
|
tooltip: g
|
|
628
630
|
}) => /* @__PURE__ */ o(
|
|
629
631
|
r,
|
|
@@ -634,54 +636,54 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
634
636
|
padding: n ? "14px 16px" : 0,
|
|
635
637
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
636
638
|
children: [
|
|
637
|
-
!n && /* @__PURE__ */ e(
|
|
639
|
+
!n && /* @__PURE__ */ e(N, { amount: i, component: "h2", variant: "H2" }),
|
|
638
640
|
/* @__PURE__ */ o(r, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
|
|
639
|
-
/* @__PURE__ */ e(
|
|
641
|
+
/* @__PURE__ */ e(f, { bold: t, variant: "Small", children: s }),
|
|
640
642
|
g
|
|
641
643
|
] }),
|
|
642
|
-
n && /* @__PURE__ */ e(
|
|
644
|
+
n && /* @__PURE__ */ e(N, { amount: i, component: "h2", symbol: d, variant: "Small" })
|
|
643
645
|
]
|
|
644
646
|
}
|
|
645
|
-
), Re = (i, n) => (t) => t.accountGuid && i.includes(t.accountGuid) && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end),
|
|
646
|
-
const { availableWidth: i } = ae(), { cashflow: n } =
|
|
647
|
-
() => t.filter(Re(
|
|
648
|
-
[g,
|
|
649
|
-
),
|
|
650
|
-
() => s.filter(Re(
|
|
651
|
-
[g,
|
|
652
|
-
), b =
|
|
653
|
-
() => c.reduce((
|
|
647
|
+
), Re = (i, n) => (t) => t.accountGuid && i.includes(t.accountGuid) && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), At = () => {
|
|
648
|
+
const { availableWidth: i } = ae(), { cashflow: n } = L(), { upcomingExpenses: t, upcomingIncome: s } = P(), { selectedAccountGuids: d } = X(), { dateRange: g, selectedCashAccounts: c } = V(), { userProfile: m } = de(), [C, a] = p.useState(!1), u = p.useMemo(
|
|
649
|
+
() => t.filter(Re(d, g)),
|
|
650
|
+
[g, d, t]
|
|
651
|
+
), l = p.useMemo(
|
|
652
|
+
() => s.filter(Re(d, g)),
|
|
653
|
+
[g, d, s]
|
|
654
|
+
), b = p.useMemo(
|
|
655
|
+
() => c.reduce((I, y) => I + (y?.balance || 0), 0),
|
|
654
656
|
[c]
|
|
655
|
-
),
|
|
656
|
-
return /* @__PURE__ */ o(r, { sx: { mx:
|
|
657
|
+
), w = u.reduce((I, y) => I + y.amount, 0), S = l.reduce((I, y) => I + y.amount, 0), A = b - w + S, h = i < 725;
|
|
658
|
+
return /* @__PURE__ */ o(r, { sx: { mx: h ? 16 : 0, my: h ? 24 : 42 }, children: [
|
|
657
659
|
/* @__PURE__ */ o(
|
|
658
660
|
r,
|
|
659
661
|
{
|
|
660
|
-
border:
|
|
662
|
+
border: h ? "1px solid" : "none",
|
|
661
663
|
borderColor: "border.light",
|
|
662
664
|
borderRadius: 2,
|
|
663
|
-
flexDirection:
|
|
664
|
-
gap:
|
|
665
|
+
flexDirection: h ? "column" : "row",
|
|
666
|
+
gap: h ? 0 : 24,
|
|
665
667
|
justifyContent: "center",
|
|
666
668
|
children: [
|
|
667
669
|
/* @__PURE__ */ e(
|
|
668
670
|
ne,
|
|
669
671
|
{
|
|
670
672
|
amount: b,
|
|
671
|
-
isMobile:
|
|
673
|
+
isMobile: h,
|
|
672
674
|
label: n.cash_and_bank
|
|
673
675
|
}
|
|
674
676
|
),
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
!
|
|
677
|
+
h && /* @__PURE__ */ e(E, {}),
|
|
678
|
+
m?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(U, { children: [
|
|
679
|
+
!h && /* @__PURE__ */ e(f, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
678
680
|
/* @__PURE__ */ e(
|
|
679
681
|
ne,
|
|
680
682
|
{
|
|
681
|
-
amount:
|
|
682
|
-
isMobile:
|
|
683
|
+
amount: S,
|
|
684
|
+
isMobile: h,
|
|
683
685
|
label: n.to_be_received,
|
|
684
|
-
symbol:
|
|
686
|
+
symbol: h ? "+" : void 0
|
|
685
687
|
}
|
|
686
688
|
)
|
|
687
689
|
] }) : /* @__PURE__ */ e(
|
|
@@ -693,23 +695,23 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
693
695
|
children: n.add_income
|
|
694
696
|
}
|
|
695
697
|
),
|
|
696
|
-
|
|
698
|
+
h ? /* @__PURE__ */ e(E, {}) : /* @__PURE__ */ e(f, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
697
699
|
/* @__PURE__ */ e(
|
|
698
700
|
ne,
|
|
699
701
|
{
|
|
700
|
-
amount:
|
|
701
|
-
isMobile:
|
|
702
|
+
amount: w,
|
|
703
|
+
isMobile: h,
|
|
702
704
|
label: n.to_be_paid_out,
|
|
703
|
-
symbol:
|
|
705
|
+
symbol: h ? "-" : void 0
|
|
704
706
|
}
|
|
705
707
|
),
|
|
706
|
-
|
|
708
|
+
h ? /* @__PURE__ */ e(E, {}) : /* @__PURE__ */ e(f, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
707
709
|
/* @__PURE__ */ e(
|
|
708
710
|
ne,
|
|
709
711
|
{
|
|
710
712
|
amount: A,
|
|
711
|
-
isMobile:
|
|
712
|
-
isTotal:
|
|
713
|
+
isMobile: h,
|
|
714
|
+
isTotal: h,
|
|
713
715
|
label: n.remaining_cash,
|
|
714
716
|
tooltip: /* @__PURE__ */ e(
|
|
715
717
|
ue,
|
|
@@ -735,8 +737,8 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
735
737
|
}
|
|
736
738
|
)
|
|
737
739
|
] });
|
|
738
|
-
}, Tt = R(
|
|
739
|
-
const { completeOnboarding: n } = le(), { cashflow: t } =
|
|
740
|
+
}, Tt = R(At), Rt = ({ handleNextStep: i }) => {
|
|
741
|
+
const { completeOnboarding: n } = le(), { cashflow: t } = L(), s = ie();
|
|
740
742
|
return /* @__PURE__ */ o(r, { children: [
|
|
741
743
|
/* @__PURE__ */ e(ce, { pb: 12, children: t.welcome_title }),
|
|
742
744
|
/* @__PURE__ */ e(
|
|
@@ -749,11 +751,11 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
749
751
|
children: t.welcome_sub_title
|
|
750
752
|
}
|
|
751
753
|
),
|
|
752
|
-
/* @__PURE__ */ e(
|
|
754
|
+
/* @__PURE__ */ e(O, { pb: 32, children: t.welcome_description }),
|
|
753
755
|
/* @__PURE__ */ o(r, { direction: "column", mb: 32, spacing: 32, children: [
|
|
754
|
-
/* @__PURE__ */ o(
|
|
756
|
+
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
755
757
|
/* @__PURE__ */ e(
|
|
756
|
-
|
|
758
|
+
v,
|
|
757
759
|
{
|
|
758
760
|
bgcolor: s.palette.primary.lighter,
|
|
759
761
|
borderRadius: 1,
|
|
@@ -767,9 +769,9 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
767
769
|
),
|
|
768
770
|
t.bullet_one
|
|
769
771
|
] }),
|
|
770
|
-
/* @__PURE__ */ o(
|
|
772
|
+
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
771
773
|
/* @__PURE__ */ e(
|
|
772
|
-
|
|
774
|
+
v,
|
|
773
775
|
{
|
|
774
776
|
bgcolor: s.palette.primary.lighter,
|
|
775
777
|
borderRadius: 1,
|
|
@@ -783,9 +785,9 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
783
785
|
),
|
|
784
786
|
t.bullet_two
|
|
785
787
|
] }),
|
|
786
|
-
/* @__PURE__ */ o(
|
|
788
|
+
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
787
789
|
/* @__PURE__ */ e(
|
|
788
|
-
|
|
790
|
+
v,
|
|
789
791
|
{
|
|
790
792
|
bgcolor: s.palette.primary.lighter,
|
|
791
793
|
borderRadius: 1,
|
|
@@ -805,17 +807,17 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
805
807
|
/* @__PURE__ */ e(H, { onClick: n, variant: "outlined", children: t.skip_button })
|
|
806
808
|
] })
|
|
807
809
|
] });
|
|
808
|
-
},
|
|
809
|
-
CASHFLOW_ONBOARDING: `${
|
|
810
|
-
CASHFLOW_LOADING_ANIMATION: `${
|
|
811
|
-
},
|
|
812
|
-
const { cashflow: i } =
|
|
813
|
-
return /* @__PURE__ */ o(
|
|
810
|
+
}, Nt = R(Rt), Ne = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", Ge = {
|
|
811
|
+
CASHFLOW_ONBOARDING: `${Ne}/cashflow-onboarding.png`,
|
|
812
|
+
CASHFLOW_LOADING_ANIMATION: `${Ne}/loading-animation.gif`
|
|
813
|
+
}, Lt = () => {
|
|
814
|
+
const { cashflow: i } = L();
|
|
815
|
+
return /* @__PURE__ */ o(p.Fragment, { children: [
|
|
814
816
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: Ge.CASHFLOW_LOADING_ANIMATION }) }),
|
|
815
817
|
/* @__PURE__ */ e(ce, { pb: 12, children: i.loading_title }),
|
|
816
|
-
/* @__PURE__ */ e(
|
|
818
|
+
/* @__PURE__ */ e(O, { children: i.loading_description })
|
|
817
819
|
] });
|
|
818
|
-
},
|
|
820
|
+
}, Ot = R(Lt), kt = tt`
|
|
819
821
|
from {
|
|
820
822
|
transform: rotate(0deg);
|
|
821
823
|
}
|
|
@@ -823,9 +825,9 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
823
825
|
transform: rotate(360deg);
|
|
824
826
|
}
|
|
825
827
|
`, Ht = () => {
|
|
826
|
-
const { addRepeatingTransaction: i, repeatingTransactions: n } = P(), { cashflow: t, common: s } =
|
|
827
|
-
() =>
|
|
828
|
-
[fe,
|
|
828
|
+
const { addRepeatingTransaction: i, repeatingTransactions: n } = P(), { cashflow: t, common: s } = L(), { completeOnboarding: d } = le(), { isDirty: g } = V(), { isMobile: c } = me(), { isCopyLoaded: m, setDisplayedDate: C } = X(), { filter: a, setFilter: u, transactions: l } = ke(), b = ie(), [w, S] = K(!0), [A, h] = p.useState(mt.EveryMonth), [I, y] = p.useState(1), [M, G] = p.useState(15), [j, _] = K(!1), [D, pe] = K(1), [k, je] = K([]), [fe, se] = K(""), W = p.useMemo(
|
|
829
|
+
() => l.find((x) => x.guid === fe),
|
|
830
|
+
[fe, l]
|
|
829
831
|
), ze = !!n.filter(
|
|
830
832
|
(x) => x.repeating_transaction_type === Ie.Income
|
|
831
833
|
).length, ge = async () => {
|
|
@@ -833,10 +835,10 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
833
835
|
// Beginning of the month, 90 days before today
|
|
834
836
|
ct(Me($(), 90)),
|
|
835
837
|
$()
|
|
836
|
-
),
|
|
838
|
+
), u({ ...a, custom: Se }), pe(3);
|
|
837
839
|
}, Be = async () => {
|
|
838
840
|
if (!(k.length < 1)) {
|
|
839
|
-
|
|
841
|
+
_(!0);
|
|
840
842
|
for (let x = 0; x < k.length; x++) {
|
|
841
843
|
const T = k[x], be = De(A, ye(T.date)), Pe = {
|
|
842
844
|
account_guid: T.account_guid,
|
|
@@ -851,11 +853,11 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
851
853
|
};
|
|
852
854
|
await i(Pe, T);
|
|
853
855
|
}
|
|
854
|
-
await
|
|
856
|
+
await d();
|
|
855
857
|
}
|
|
856
|
-
}, Ue = !W &&
|
|
857
|
-
return
|
|
858
|
-
|
|
858
|
+
}, Ue = !W && w || !W && k.length < 1;
|
|
859
|
+
return m ? /* @__PURE__ */ o(
|
|
860
|
+
v,
|
|
859
861
|
{
|
|
860
862
|
sx: {
|
|
861
863
|
display: "flex",
|
|
@@ -868,47 +870,47 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
868
870
|
py: 24
|
|
869
871
|
},
|
|
870
872
|
children: [
|
|
871
|
-
|
|
872
|
-
|
|
873
|
+
D === 1 && /* @__PURE__ */ e(
|
|
874
|
+
v,
|
|
873
875
|
{
|
|
874
876
|
sx: {
|
|
875
877
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
876
878
|
},
|
|
877
|
-
children: /* @__PURE__ */ e(
|
|
879
|
+
children: /* @__PURE__ */ e(Nt, { handleNextStep: ge })
|
|
878
880
|
}
|
|
879
881
|
),
|
|
880
|
-
|
|
881
|
-
|
|
882
|
+
D === 2 && /* @__PURE__ */ e(
|
|
883
|
+
v,
|
|
882
884
|
{
|
|
883
885
|
sx: {
|
|
884
886
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
885
887
|
},
|
|
886
|
-
children: /* @__PURE__ */ e(
|
|
888
|
+
children: /* @__PURE__ */ e(Ot, {})
|
|
887
889
|
}
|
|
888
890
|
),
|
|
889
|
-
|
|
890
|
-
|
|
891
|
+
D === 3 && /* @__PURE__ */ o(
|
|
892
|
+
v,
|
|
891
893
|
{
|
|
892
894
|
sx: {
|
|
893
895
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
894
896
|
},
|
|
895
897
|
children: [
|
|
896
898
|
/* @__PURE__ */ e(ce, { pb: 12, children: t.add_income_title }),
|
|
897
|
-
/* @__PURE__ */ e(
|
|
899
|
+
/* @__PURE__ */ e(O, { mb: 24, children: t.add_income_description }),
|
|
898
900
|
k.length > 0 && !W && /* @__PURE__ */ o(U, { children: [
|
|
899
|
-
/* @__PURE__ */ e(Z, { children: k.map((x, T) => /* @__PURE__ */ o(
|
|
901
|
+
/* @__PURE__ */ e(Z, { children: k.map((x, T) => /* @__PURE__ */ o(p.Fragment, { children: [
|
|
900
902
|
/* @__PURE__ */ e(lt, { bgcolor: "background.paper", children: ut(
|
|
901
903
|
B(x.nextDate || x.date)
|
|
902
904
|
) }),
|
|
903
905
|
/* @__PURE__ */ e(dt, { transaction: x }),
|
|
904
|
-
T !== k.length - 1 && /* @__PURE__ */ e(
|
|
906
|
+
T !== k.length - 1 && /* @__PURE__ */ e(E, {})
|
|
905
907
|
] }, x.guid)) }),
|
|
906
908
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", children: [
|
|
907
|
-
/* @__PURE__ */ e(
|
|
909
|
+
/* @__PURE__ */ e(E, { sx: { flexGrow: 1 } }),
|
|
908
910
|
/* @__PURE__ */ e(
|
|
909
911
|
H,
|
|
910
912
|
{
|
|
911
|
-
onClick: () =>
|
|
913
|
+
onClick: () => S(!0),
|
|
912
914
|
startIcon: /* @__PURE__ */ e(F, { name: "add", size: 20 }),
|
|
913
915
|
children: t.add_income
|
|
914
916
|
}
|
|
@@ -919,25 +921,25 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
919
921
|
it,
|
|
920
922
|
{
|
|
921
923
|
bgcolor: "background.paper",
|
|
922
|
-
onSearch: (x) =>
|
|
924
|
+
onSearch: (x) => u({
|
|
923
925
|
...a,
|
|
924
926
|
custom: (T) => x ? at(T, x) : Se(T)
|
|
925
927
|
}),
|
|
926
928
|
onSelected: (x) => {
|
|
927
|
-
se(x),
|
|
929
|
+
se(x), S(!1);
|
|
928
930
|
}
|
|
929
931
|
}
|
|
930
932
|
),
|
|
931
|
-
!ze && g && /* @__PURE__ */ e(
|
|
933
|
+
!ze && g && /* @__PURE__ */ e(O, { color: "error", mt: 16, children: t.confirm_error }),
|
|
932
934
|
W && /* @__PURE__ */ o(U, { children: [
|
|
933
935
|
/* @__PURE__ */ e(
|
|
934
936
|
rt,
|
|
935
937
|
{
|
|
936
938
|
bgcolor: "background.paper",
|
|
937
|
-
firstDay:
|
|
939
|
+
firstDay: I,
|
|
938
940
|
frequency: A,
|
|
939
|
-
onFirstDayChange:
|
|
940
|
-
onFrequencyChange:
|
|
941
|
+
onFirstDayChange: y,
|
|
942
|
+
onFrequencyChange: h,
|
|
941
943
|
onSecondDayChange: G,
|
|
942
944
|
secondDay: M,
|
|
943
945
|
transaction: W
|
|
@@ -964,7 +966,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
964
966
|
H,
|
|
965
967
|
{
|
|
966
968
|
onClick: () => {
|
|
967
|
-
se(""),
|
|
969
|
+
se(""), S(!0), ge().finally();
|
|
968
970
|
},
|
|
969
971
|
variant: "outlined",
|
|
970
972
|
children: s.cancel_button
|
|
@@ -991,7 +993,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
991
993
|
children: t.confirm_income_button
|
|
992
994
|
}
|
|
993
995
|
),
|
|
994
|
-
/* @__PURE__ */ e(H, { onClick:
|
|
996
|
+
/* @__PURE__ */ e(H, { onClick: d, variant: "outlined", children: t.skip_button })
|
|
995
997
|
] })
|
|
996
998
|
]
|
|
997
999
|
}
|
|
@@ -1003,32 +1005,32 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
1003
1005
|
const {
|
|
1004
1006
|
selectedAccounts: t,
|
|
1005
1007
|
selectedAccountGuids: s,
|
|
1006
|
-
setSelectedAccounts:
|
|
1008
|
+
setSelectedAccounts: d,
|
|
1007
1009
|
shouldDisableNextDate: g,
|
|
1008
1010
|
shouldDisablePrevDate: c
|
|
1009
|
-
} = X(), { onEvent:
|
|
1010
|
-
return
|
|
1011
|
-
|
|
1012
|
-
}, [
|
|
1013
|
-
|
|
1014
|
-
}, [C]),
|
|
1015
|
-
const j = C.map((
|
|
1016
|
-
(
|
|
1011
|
+
} = X(), { onEvent: m } = Oe(), { visibleCashAccounts: C } = Le(), { setFilter: a } = ke(), { userProfile: u } = de(), { dateRange: l, setSelectedCashAccounts: b } = V(), { loadRepeatingTransactions: w, setDateRange: S } = P(), { cashflow: A, recurring: h } = L(), { isCopyLoaded: I, isInitialized: y } = X(), [M, G] = p.useState(!1);
|
|
1012
|
+
return p.useEffect(() => {
|
|
1013
|
+
y && (S(l), w().finally());
|
|
1014
|
+
}, [y]), p.useEffect(() => {
|
|
1015
|
+
d(C);
|
|
1016
|
+
}, [C]), p.useEffect(() => {
|
|
1017
|
+
const j = C.map((D) => D.guid), _ = t.filter(
|
|
1018
|
+
(D) => s.includes(D.guid) && j.includes(D.guid)
|
|
1017
1019
|
);
|
|
1018
|
-
b(
|
|
1020
|
+
b(_), a({
|
|
1019
1021
|
dateRange: { start: Me($(), 90), end: ht() },
|
|
1020
|
-
accounts:
|
|
1022
|
+
accounts: _.map((D) => D.guid)
|
|
1021
1023
|
});
|
|
1022
|
-
}, [C, t]), !
|
|
1024
|
+
}, [C, t]), !I || !y ? /* @__PURE__ */ e(re, {}) : u?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(
|
|
1023
1025
|
ve,
|
|
1024
1026
|
{
|
|
1025
1027
|
accountOptions: C,
|
|
1026
1028
|
actions: [
|
|
1027
1029
|
{
|
|
1028
|
-
label:
|
|
1030
|
+
label: h.action_title,
|
|
1029
1031
|
iconName: "credit_card",
|
|
1030
1032
|
onClick: () => {
|
|
1031
|
-
G(!0),
|
|
1033
|
+
G(!0), m(Ee.CASH_FLOW_CLICK_SETTINGS);
|
|
1032
1034
|
}
|
|
1033
1035
|
}
|
|
1034
1036
|
],
|
|
@@ -1039,15 +1041,15 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
1039
1041
|
onRangeChanged: () => {
|
|
1040
1042
|
}
|
|
1041
1043
|
},
|
|
1042
|
-
dateRange:
|
|
1044
|
+
dateRange: l,
|
|
1043
1045
|
dateRangeVariant: "readonly",
|
|
1044
|
-
onAccountsFilterClick: () =>
|
|
1046
|
+
onAccountsFilterClick: () => m(Ee.CASH_FLOW_CLICK_FILTER),
|
|
1045
1047
|
onBackClick: i,
|
|
1046
1048
|
sx: n,
|
|
1047
1049
|
title: A.title,
|
|
1048
1050
|
children: [
|
|
1049
1051
|
/* @__PURE__ */ e(Tt, {}),
|
|
1050
|
-
/* @__PURE__ */ e(
|
|
1052
|
+
/* @__PURE__ */ e(Et, {}),
|
|
1051
1053
|
/* @__PURE__ */ e(
|
|
1052
1054
|
$e,
|
|
1053
1055
|
{
|
|
@@ -1055,7 +1057,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
1055
1057
|
isOpen: M,
|
|
1056
1058
|
onClose: () => G(!1),
|
|
1057
1059
|
shouldShowHeaderBorders: !1,
|
|
1058
|
-
title:
|
|
1060
|
+
title: h.action_title,
|
|
1059
1061
|
children: /* @__PURE__ */ e(Ve, {})
|
|
1060
1062
|
}
|
|
1061
1063
|
)
|
|
@@ -1070,7 +1072,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
|
1070
1072
|
children: /* @__PURE__ */ e(Ft, {})
|
|
1071
1073
|
}
|
|
1072
1074
|
);
|
|
1073
|
-
},
|
|
1075
|
+
}, On = R(Wt);
|
|
1074
1076
|
class kn {
|
|
1075
1077
|
fetchInstance;
|
|
1076
1078
|
constructor(n, t) {
|
|
@@ -1092,8 +1094,8 @@ class kn {
|
|
|
1092
1094
|
}
|
|
1093
1095
|
export {
|
|
1094
1096
|
kn as CashflowApi,
|
|
1095
|
-
|
|
1097
|
+
Ln as CashflowMiniWidget,
|
|
1096
1098
|
Ft as CashflowOnboarding,
|
|
1097
1099
|
Wn as CashflowStore,
|
|
1098
|
-
|
|
1100
|
+
On as CashflowWidget
|
|
1099
1101
|
};
|