@mx-cartographer/experiences 7.4.8-alpha.mm0 → 7.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{Account-BrOTlmeK.mjs → Account-01wOyrH1.mjs} +1 -1
- package/dist/{AccountDetailsContent-B7FqH05C.mjs → AccountDetailsContent-COMjOzwr.mjs} +8 -8
- package/dist/{AccountDetailsHeader-C8MxsxhN.mjs → AccountDetailsHeader-Cbi5G6fJ.mjs} +4 -4
- package/dist/{AccountFields-BQZ-o6Kj.mjs → AccountFields-Cd_nOWmf.mjs} +2 -2
- package/dist/{AccountListItem-aIE9WWTO.mjs → AccountListItem-DxY4cCF1.mjs} +4 -4
- package/dist/{AccountStore-DqO84Aer.mjs → AccountStore-C1zMBzHq.mjs} +2 -2
- package/dist/{Accounts-DC_A4UCa.mjs → Accounts-D7QljYas.mjs} +1 -1
- package/dist/{BudgetUtil-BmZXkL0C.mjs → BudgetUtil-Df2nII9u.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-SUgfE5GN.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +1 -1
- package/dist/{ConnectDrawer-KL8t1qSC.mjs → ConnectDrawer-CuUj16NH.mjs} +1 -1
- package/dist/{ConnectionsDrawer-DaK5uIL5.mjs → ConnectionsDrawer-Bz4uwdFE.mjs} +2 -2
- package/dist/{CurrencyInput-itK0R3wV.mjs → CurrencyInput-BFKcs-_K.mjs} +1 -1
- package/dist/{DebtsStore-DVPZbv2C.mjs → DebtsStore-Bu8rRRSL.mjs} +1 -1
- package/dist/{ExportCsvAction-Cglo8Mca.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
- package/dist/{GoalStore-o4rrjGSJ.mjs → GoalStore-CrNhjvNc.mjs} +2 -2
- package/dist/{Help-BjLMsuMS.mjs → Help-BnPXM_N2.mjs} +1 -1
- package/dist/{LineChart-BQRxZF3p.mjs → LineChart-bc1D9xBE.mjs} +1 -1
- package/dist/{ListItemAction-BxTkF6Tz.mjs → ListItemAction-uobBrm_a.mjs} +1 -1
- package/dist/{ManageIncome-rcnDYsBJ.mjs → ManageIncome-A69EUO5u.mjs} +75 -75
- package/dist/{MicroWidgetContainer-B2hO9rOG.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
- package/dist/{MiniWidgetContainer-98-hKFqm.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
- package/dist/{NetWorthStore-DG2X69jG.mjs → NetWorthStore-CpL_kqvx.mjs} +2 -2
- package/dist/{NotificationSettings-C7FYNM7I.mjs → NotificationSettings-CNmJWVeI.mjs} +248 -250
- package/dist/{OriginalBalanceAction-C6jdS4ws.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +3 -3
- package/dist/{RecurringSettings-C81H1l38.mjs → RecurringSettings-B0uObPlD.mjs} +3 -3
- package/dist/{SpendingLegend-DqZxN_BZ.mjs → SpendingLegend-Bf-wbJvb.mjs} +2 -2
- package/dist/{TransactionDetails-BA_E5nQ-.mjs → TransactionDetails-COH0OKNG.mjs} +5 -5
- package/dist/{TransactionStore-PRlwE-TF.mjs → TransactionStore-Dz-G8Wd0.mjs} +2 -2
- package/dist/{User-Cnlegl1N.mjs → User-wXzDI4M8.mjs} +1 -1
- package/dist/{ViewMoreMicroCard-DfPXJzbv.mjs → ViewMoreMicroCard-C0832BMe.mjs} +101 -105
- package/dist/{WidgetContainer-CaPjoWeE.mjs → WidgetContainer-6dsjtOVg.mjs} +2 -2
- package/dist/accounts/index.es.js +140 -148
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +478 -483
- package/dist/cashflow/index.es.js +362 -367
- package/dist/categories/index.es.js +1 -1
- package/dist/common/hooks/index.d.ts +0 -1
- package/dist/common/index.es.js +33 -35
- package/dist/dashboard/index.es.js +88 -90
- package/dist/debts/index.es.js +342 -346
- package/dist/{exportTransactionsToCSV-DuAaI5XA.mjs → exportTransactionsToCSV-Cz2t0lmA.mjs} +1 -1
- package/dist/finstrong/index.es.js +350 -352
- package/dist/goals/index.es.js +511 -518
- package/dist/help/index.es.js +9 -13
- package/dist/{hooks-ZMp65DFz.mjs → hooks-C41HAxM5.mjs} +11 -11
- package/dist/investments/index.es.js +393 -395
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +240 -245
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +285 -293
- package/dist/settings/index.es.js +249 -252
- package/dist/spending/index.es.js +126 -138
- package/dist/transactions/index.es.js +73 -77
- package/dist/trends/index.es.js +588 -601
- package/dist/{useAccountDisplayName-Cjx8YmKK.mjs → useAccountDisplayName-CMMlIOXF.mjs} +2 -2
- package/dist/{useInsightsEnabled-B7dxpDrX.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
- package/package.json +1 -1
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +0 -6
- package/dist/useWidgetLoadTimer-C1NBkyLd.mjs +0 -23
package/dist/debts/index.es.js
CHANGED
|
@@ -2,69 +2,68 @@ import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
|
|
|
2
2
|
import g from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
4
|
import w from "@mui/material/Stack";
|
|
5
|
-
import { useTheme as X, Card as
|
|
6
|
-
import { Text as l, H3 as
|
|
7
|
-
import { intervalToDuration as
|
|
8
|
-
import { addMonths as
|
|
9
|
-
import { fromUnixTime as
|
|
10
|
-
import { getUnixTime as
|
|
11
|
-
import { D as P, M as
|
|
12
|
-
import { a as Lr } from "../DebtsStore-
|
|
13
|
-
import { f as k, a as
|
|
14
|
-
import { f as
|
|
15
|
-
import { G as
|
|
5
|
+
import { useTheme as X, Card as _e, Stack as _, Box as W } from "@mui/material";
|
|
6
|
+
import { Text as l, H3 as De, InstitutionLogo as Te, Icon as te } from "@mxenabled/mxui";
|
|
7
|
+
import { intervalToDuration as Ae, formatDuration as Ee } from "date-fns";
|
|
8
|
+
import { addMonths as se } from "date-fns/addMonths";
|
|
9
|
+
import { fromUnixTime as ce } from "date-fns/fromUnixTime";
|
|
10
|
+
import { getUnixTime as de } from "date-fns/getUnixTime";
|
|
11
|
+
import { D as P, M as Ie, I as Be } from "../DebtsStore-Bu8rRRSL.mjs";
|
|
12
|
+
import { a as Lr } from "../DebtsStore-Bu8rRRSL.mjs";
|
|
13
|
+
import { f as k, a as Me } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
14
|
+
import { f as U, a as q } from "../Dialog-BPTr3qHE.mjs";
|
|
15
|
+
import { G as Pe, x as Z, u as S, l as V, g as F, d as J, n as ke, b as Ne } from "../hooks-C41HAxM5.mjs";
|
|
16
16
|
import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
|
-
import { D as
|
|
18
|
-
import { b as
|
|
19
|
-
import { A as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { LineChart as
|
|
24
|
-
import
|
|
25
|
-
import { useTheme as
|
|
26
|
-
import { A as T, W as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import { M as
|
|
32
|
-
import
|
|
33
|
-
import { L as
|
|
34
|
-
import { C as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { Error as
|
|
39
|
-
import { T as
|
|
40
|
-
import { DataGridPro as
|
|
41
|
-
import { H as
|
|
42
|
-
import { f as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import {
|
|
48
|
-
|
|
49
|
-
const et = (a, n = 0, r = 0) => {
|
|
17
|
+
import { D as re } from "../Drawer-BEtCk82g.mjs";
|
|
18
|
+
import { b as I } from "../Localization-2MODESHW.mjs";
|
|
19
|
+
import { A as Fe, u as Re } from "../AccountDetailsHeader-Cbi5G6fJ.mjs";
|
|
20
|
+
import Le from "@mui/material/Card";
|
|
21
|
+
import $e from "@mui/material/CardContent";
|
|
22
|
+
import He from "@mui/material/CardHeader";
|
|
23
|
+
import { LineChart as Oe } from "@mui/x-charts";
|
|
24
|
+
import ae from "@mui/material/Box";
|
|
25
|
+
import { useTheme as We } from "@mui/material/styles";
|
|
26
|
+
import { A as T, W as Ge } from "../WidgetContainer-6dsjtOVg.mjs";
|
|
27
|
+
import pe from "@mui/material/Tab";
|
|
28
|
+
import je from "@mui/material/Tabs";
|
|
29
|
+
import ye from "@mui/material/List";
|
|
30
|
+
import G from "@mui/material/Divider";
|
|
31
|
+
import { M as ze, I as Xe, O as Ve } from "../OriginalBalanceAction-DK8_LkPz.mjs";
|
|
32
|
+
import Ye from "@mui/material/TextField";
|
|
33
|
+
import { L as Q } from "../ListItemAction-uobBrm_a.mjs";
|
|
34
|
+
import { C as ne } from "../CurrencyInput-BFKcs-_K.mjs";
|
|
35
|
+
import me from "@mui/material/Alert";
|
|
36
|
+
import he from "@mui/material/AlertTitle";
|
|
37
|
+
import ue from "@mui/material/Paper";
|
|
38
|
+
import { Error as Ke, CheckCircle as fe } from "@mxenabled/mx-icons";
|
|
39
|
+
import { T as be } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
|
+
import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
|
|
41
|
+
import { H as j } from "../HeaderCell-DjuifqHJ.mjs";
|
|
42
|
+
import { f as qe } from "../ConnectDrawer-CuUj16NH.mjs";
|
|
43
|
+
import xe from "@mui/material/Button";
|
|
44
|
+
import Ze from "@mui/material/IconButton";
|
|
45
|
+
import Je from "@mui/material/ListItem";
|
|
46
|
+
import Qe from "@mui/material/Popover";
|
|
47
|
+
import { L as et } from "../Loader-DUaFpDGv.mjs";
|
|
48
|
+
const tt = (a, n = 0, r = 0) => {
|
|
50
49
|
if (r === 0) return 0;
|
|
51
|
-
const t = n / (
|
|
50
|
+
const t = n / (Ie * Be);
|
|
52
51
|
return Math.ceil(
|
|
53
52
|
t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
|
|
54
53
|
);
|
|
55
|
-
},
|
|
54
|
+
}, rt = (a, n, r, t, o) => {
|
|
56
55
|
const i = [];
|
|
57
56
|
if (r === 0) {
|
|
58
57
|
for (let c = 0; c < a; c++) {
|
|
59
|
-
const d = n - t * (c + 1), m = n - t * c,
|
|
58
|
+
const d = n - t * (c + 1), m = n - t * c, u = d >= 0 ? t : m;
|
|
60
59
|
i.push({
|
|
61
60
|
balance: d >= 0 ? d : 0,
|
|
62
61
|
interest: r,
|
|
63
|
-
payment:
|
|
64
|
-
principal:
|
|
65
|
-
timestamp:
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
payment: u,
|
|
63
|
+
principal: u,
|
|
64
|
+
timestamp: de(
|
|
65
|
+
se(
|
|
66
|
+
ce(o),
|
|
68
67
|
// convert seconds → Date
|
|
69
68
|
c + 1
|
|
70
69
|
// add (index + 1) months
|
|
@@ -76,32 +75,32 @@ const et = (a, n = 0, r = 0) => {
|
|
|
76
75
|
}
|
|
77
76
|
const p = r / 1200;
|
|
78
77
|
for (let c = 0; c < a; c++) {
|
|
79
|
-
const d =
|
|
78
|
+
const d = de(se(ce(o), c + 1)), m = Math.pow(1 + p, c), u = n * m - t * ((m - 1) / p), x = Math.pow(1 + p, c + 1), h = n * x - t * ((x - 1) / p), v = t + Math.min(h, 0), B = u * p;
|
|
80
79
|
i.push({
|
|
81
|
-
balance: Math.max(0,
|
|
82
|
-
interest:
|
|
80
|
+
balance: Math.max(0, h),
|
|
81
|
+
interest: B,
|
|
83
82
|
payment: v,
|
|
84
|
-
principal: v -
|
|
83
|
+
principal: v - B,
|
|
85
84
|
timestamp: d
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
87
|
return i;
|
|
89
|
-
},
|
|
90
|
-
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i =
|
|
88
|
+
}, at = (a) => (a[a.length - 1] || {}).timestamp, nt = (a) => {
|
|
89
|
+
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = tt(t, r ?? 0, n ?? 0), p = rt(
|
|
91
90
|
i,
|
|
92
91
|
t,
|
|
93
92
|
r ?? 0,
|
|
94
93
|
n ?? 0,
|
|
95
94
|
o
|
|
96
|
-
), c =
|
|
95
|
+
), c = at(p);
|
|
97
96
|
return {
|
|
98
97
|
...a,
|
|
99
98
|
minimumFinalPayment: c,
|
|
100
99
|
minimumPayments: p
|
|
101
100
|
};
|
|
102
|
-
},
|
|
101
|
+
}, ge = (a, n) => {
|
|
103
102
|
const [r, t] = a.reduce(
|
|
104
|
-
([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(
|
|
103
|
+
([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(nt(p)), [o, i]),
|
|
105
104
|
[[], []]
|
|
106
105
|
);
|
|
107
106
|
switch (n) {
|
|
@@ -122,47 +121,47 @@ const et = (a, n = 0, r = 0) => {
|
|
|
122
121
|
}
|
|
123
122
|
a.splice(0, a.length, ...r, ...t);
|
|
124
123
|
};
|
|
125
|
-
function
|
|
126
|
-
const t = a.map((
|
|
127
|
-
(
|
|
124
|
+
function ot(a, n, r = 0) {
|
|
125
|
+
const t = a.map((u) => ({ ...u })).filter(
|
|
126
|
+
(u) => u.interest_rate !== void 0 && u.monthly_payment !== void 0 && !u.is_paid_off
|
|
128
127
|
);
|
|
129
|
-
|
|
128
|
+
ge(t, n);
|
|
130
129
|
let o = 0, i = 0;
|
|
131
130
|
const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
|
|
132
|
-
for (; t.some((
|
|
133
|
-
let
|
|
134
|
-
for (const [
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
let C =
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
|
|
131
|
+
for (; t.some((u) => u.balance >= 0.01 && !u.is_impossible); ) {
|
|
132
|
+
let u = !1;
|
|
133
|
+
for (const [x, h] of t.entries()) {
|
|
134
|
+
if (h.balance <= 0.01 || h.is_impossible) continue;
|
|
135
|
+
const B = (h.interest_rate ?? 0) / 100 / 12, N = h.balance * B;
|
|
136
|
+
let C = h.monthly_payment ?? 0;
|
|
137
|
+
x === 0 && r && (C += r), h.balance += N;
|
|
138
|
+
const A = Math.min(h.balance, C + i);
|
|
139
|
+
if (A <= N) {
|
|
140
|
+
h.is_impossible = !0;
|
|
142
141
|
continue;
|
|
143
142
|
}
|
|
144
|
-
|
|
143
|
+
h.balance -= A, h.balance = h.balance < 0.01 ? 0 : h.balance, o += N, h.balance <= 0 && (i += C), A > 0 && (u = !0);
|
|
145
144
|
}
|
|
146
|
-
|
|
145
|
+
u && c.setMonth(c.getMonth() + 1);
|
|
147
146
|
}
|
|
148
|
-
const d = t.some((
|
|
147
|
+
const d = t.some((u) => u.is_impossible && u.balance > 0), m = Ae({ start: p, end: c });
|
|
149
148
|
return {
|
|
150
149
|
payoffSavings: d ? "N/A" : k(o, "0,0.00"),
|
|
151
|
-
payoffDate: d ? "Never" :
|
|
152
|
-
payoffDuration: d ? "Stagnant" :
|
|
150
|
+
payoffDate: d ? "Never" : U(c, q.MONTH_YEAR),
|
|
151
|
+
payoffDuration: d ? "Stagnant" : Ee(m, { format: ["years", "months"] }) || "0 months"
|
|
153
152
|
};
|
|
154
153
|
}
|
|
155
|
-
const
|
|
156
|
-
if (!g.useContext(
|
|
154
|
+
const L = () => {
|
|
155
|
+
if (!g.useContext(Pe))
|
|
157
156
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
158
|
-
return
|
|
159
|
-
},
|
|
160
|
-
const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } =
|
|
161
|
-
const
|
|
162
|
-
return
|
|
157
|
+
return Z().uiStore;
|
|
158
|
+
}, it = ({ debts: a, onClickCta: n, sx: r }) => {
|
|
159
|
+
const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = L(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: u } = g.useMemo(() => {
|
|
160
|
+
const x = c?.extra_payment ?? 0;
|
|
161
|
+
return ot(a, p, x);
|
|
163
162
|
}, [a, p, c]);
|
|
164
163
|
return /* @__PURE__ */ e(
|
|
165
|
-
|
|
164
|
+
_e,
|
|
166
165
|
{
|
|
167
166
|
sx: {
|
|
168
167
|
boxShadow: t.shadows[2],
|
|
@@ -191,7 +190,7 @@ const $ = () => {
|
|
|
191
190
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
|
192
191
|
] }),
|
|
193
192
|
/* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
|
|
194
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children:
|
|
193
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: u }),
|
|
195
194
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
|
196
195
|
] }),
|
|
197
196
|
/* @__PURE__ */ e(
|
|
@@ -208,10 +207,10 @@ const $ = () => {
|
|
|
208
207
|
] })
|
|
209
208
|
}
|
|
210
209
|
);
|
|
211
|
-
},
|
|
210
|
+
}, lt = D(it), st = ({ isOpen: a, onClose: n }) => {
|
|
212
211
|
const r = X(), { debts: t } = S(), [o, i] = g.useState(!1);
|
|
213
212
|
return /* @__PURE__ */ e(
|
|
214
|
-
|
|
213
|
+
re,
|
|
215
214
|
{
|
|
216
215
|
ariaLabelClose: "",
|
|
217
216
|
isOpen: a,
|
|
@@ -225,7 +224,7 @@ const $ = () => {
|
|
|
225
224
|
/* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
|
|
226
225
|
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
|
|
227
226
|
] }),
|
|
228
|
-
/* @__PURE__ */ s(
|
|
227
|
+
/* @__PURE__ */ s(_e, { sx: { display: "grid", py: 16, px: 24 }, children: [
|
|
229
228
|
/* @__PURE__ */ e(l, { mb: 4, variant: "H3", children: t.snowball_drawer_question }),
|
|
230
229
|
/* @__PURE__ */ e(
|
|
231
230
|
l,
|
|
@@ -262,13 +261,13 @@ const $ = () => {
|
|
|
262
261
|
}
|
|
263
262
|
),
|
|
264
263
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
265
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
264
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 1) }),
|
|
266
265
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
267
266
|
] }),
|
|
268
267
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
269
268
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
270
269
|
/* @__PURE__ */ e(
|
|
271
|
-
|
|
270
|
+
W,
|
|
272
271
|
{
|
|
273
272
|
sx: {
|
|
274
273
|
display: "flex",
|
|
@@ -295,13 +294,13 @@ const $ = () => {
|
|
|
295
294
|
},
|
|
296
295
|
children: [
|
|
297
296
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
298
|
-
/* @__PURE__ */ e(l, { variant: "Body", children:
|
|
297
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "A") }),
|
|
299
298
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
300
|
-
|
|
299
|
+
I(
|
|
301
300
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
302
301
|
"$100"
|
|
303
302
|
),
|
|
304
|
-
/* @__PURE__ */ e("strong", { children:
|
|
303
|
+
/* @__PURE__ */ e("strong", { children: I(t.snowball_drawer_debt_label, "B") }),
|
|
305
304
|
t.snowball_drawer_rollover_explainer_pt2
|
|
306
305
|
] })
|
|
307
306
|
] }),
|
|
@@ -324,7 +323,7 @@ const $ = () => {
|
|
|
324
323
|
] }),
|
|
325
324
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
326
325
|
/* @__PURE__ */ e(
|
|
327
|
-
|
|
326
|
+
W,
|
|
328
327
|
{
|
|
329
328
|
sx: {
|
|
330
329
|
width: 20,
|
|
@@ -346,7 +345,7 @@ const $ = () => {
|
|
|
346
345
|
pr: 24
|
|
347
346
|
},
|
|
348
347
|
children: [
|
|
349
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
348
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
|
|
350
349
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$400.00" })
|
|
351
350
|
]
|
|
352
351
|
}
|
|
@@ -354,7 +353,7 @@ const $ = () => {
|
|
|
354
353
|
] }),
|
|
355
354
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
|
|
356
355
|
/* @__PURE__ */ e(
|
|
357
|
-
|
|
356
|
+
W,
|
|
358
357
|
{
|
|
359
358
|
sx: {
|
|
360
359
|
width: 20,
|
|
@@ -366,7 +365,7 @@ const $ = () => {
|
|
|
366
365
|
}
|
|
367
366
|
),
|
|
368
367
|
/* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
|
|
369
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
368
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
|
|
370
369
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
371
370
|
] })
|
|
372
371
|
] }),
|
|
@@ -389,13 +388,13 @@ const $ = () => {
|
|
|
389
388
|
)
|
|
390
389
|
] }),
|
|
391
390
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
392
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
391
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 2) }),
|
|
393
392
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
394
393
|
] }),
|
|
395
394
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
396
395
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
397
396
|
/* @__PURE__ */ e(
|
|
398
|
-
|
|
397
|
+
W,
|
|
399
398
|
{
|
|
400
399
|
sx: {
|
|
401
400
|
display: "flex",
|
|
@@ -422,13 +421,13 @@ const $ = () => {
|
|
|
422
421
|
},
|
|
423
422
|
children: [
|
|
424
423
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
425
|
-
/* @__PURE__ */ e(l, { variant: "Body", children:
|
|
424
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
|
|
426
425
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
427
|
-
|
|
426
|
+
I(
|
|
428
427
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
429
428
|
"$500"
|
|
430
429
|
),
|
|
431
|
-
/* @__PURE__ */ e("strong", { children:
|
|
430
|
+
/* @__PURE__ */ e("strong", { children: I(t.snowball_drawer_debt_label, "C") }),
|
|
432
431
|
t.snowball_drawer_rollover_explainer_pt2
|
|
433
432
|
] })
|
|
434
433
|
] }),
|
|
@@ -451,7 +450,7 @@ const $ = () => {
|
|
|
451
450
|
] }),
|
|
452
451
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
453
452
|
/* @__PURE__ */ e(
|
|
454
|
-
|
|
453
|
+
W,
|
|
455
454
|
{
|
|
456
455
|
sx: {
|
|
457
456
|
width: 20,
|
|
@@ -472,7 +471,7 @@ const $ = () => {
|
|
|
472
471
|
pr: 24
|
|
473
472
|
},
|
|
474
473
|
children: [
|
|
475
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
474
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
|
|
476
475
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
477
476
|
]
|
|
478
477
|
}
|
|
@@ -497,13 +496,13 @@ const $ = () => {
|
|
|
497
496
|
)
|
|
498
497
|
] }),
|
|
499
498
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
500
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
499
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 3) }),
|
|
501
500
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
502
501
|
] }),
|
|
503
502
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
504
503
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
505
504
|
/* @__PURE__ */ e(
|
|
506
|
-
|
|
505
|
+
W,
|
|
507
506
|
{
|
|
508
507
|
sx: {
|
|
509
508
|
display: "flex",
|
|
@@ -529,7 +528,7 @@ const $ = () => {
|
|
|
529
528
|
pr: 24
|
|
530
529
|
},
|
|
531
530
|
children: [
|
|
532
|
-
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children:
|
|
531
|
+
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }) }),
|
|
533
532
|
/* @__PURE__ */ s(_, { children: [
|
|
534
533
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
|
|
535
534
|
/* @__PURE__ */ e(
|
|
@@ -569,8 +568,8 @@ const $ = () => {
|
|
|
569
568
|
] })
|
|
570
569
|
}
|
|
571
570
|
);
|
|
572
|
-
},
|
|
573
|
-
function
|
|
571
|
+
}, ct = D(st), dt = "#FF7B08";
|
|
572
|
+
function pt(a, n) {
|
|
574
573
|
const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
|
|
575
574
|
Math.max(0, Math.min(255, Math.round(r * n))),
|
|
576
575
|
Math.max(0, Math.min(255, Math.round(t * n))),
|
|
@@ -578,7 +577,7 @@ function dt(a, n) {
|
|
|
578
577
|
];
|
|
579
578
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
580
579
|
}
|
|
581
|
-
const
|
|
580
|
+
const we = ({
|
|
582
581
|
sx: a,
|
|
583
582
|
height: n = 500,
|
|
584
583
|
width: r,
|
|
@@ -587,32 +586,32 @@ const ge = ({
|
|
|
587
586
|
onClickArea: i,
|
|
588
587
|
onHoverArea: p
|
|
589
588
|
}) => {
|
|
590
|
-
const c =
|
|
589
|
+
const c = We(), { onEvent: d } = F(), m = t.filter((b) => !b.is_impossible), u = [
|
|
591
590
|
...new Set(
|
|
592
|
-
m.flatMap((
|
|
591
|
+
m.flatMap((b) => b.dataset.map((f) => new Date(f.x).getTime()))
|
|
593
592
|
)
|
|
594
|
-
].sort((
|
|
595
|
-
const
|
|
596
|
-
let
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
return
|
|
593
|
+
].sort((b, f) => b - f).map((b) => new Date(b)), x = m.map((b) => {
|
|
594
|
+
const f = new Map(b.dataset.map((R) => [new Date(R.x).getTime(), R.y]));
|
|
595
|
+
let E = f.get(u[0].getTime()) ?? 0;
|
|
596
|
+
const $ = u.map((R) => {
|
|
597
|
+
const z = f.get(R.getTime()) ?? E;
|
|
598
|
+
return E = z, { x: R, y: z };
|
|
600
599
|
});
|
|
601
|
-
return { ...
|
|
602
|
-
}),
|
|
603
|
-
(
|
|
600
|
+
return { ...b, dataset: $ };
|
|
601
|
+
}), h = x.reduce(
|
|
602
|
+
(b, f) => b + (f.dataset[0]?.y ?? 0),
|
|
604
603
|
0
|
|
605
|
-
), v =
|
|
606
|
-
const
|
|
607
|
-
return { x:
|
|
608
|
-
}),
|
|
609
|
-
const
|
|
604
|
+
), v = u.map((b, f) => {
|
|
605
|
+
const E = f / (u.length - 1), $ = h * (1 - E);
|
|
606
|
+
return { x: b, y: $ };
|
|
607
|
+
}), B = Math.ceil(h / 100) * 100, N = u, C = x.map((b, f) => {
|
|
608
|
+
const E = 1 - f / x.length * 0.5, $ = pt(dt, E);
|
|
610
609
|
return {
|
|
611
|
-
id: `debt-${
|
|
612
|
-
guid:
|
|
613
|
-
label:
|
|
614
|
-
data:
|
|
615
|
-
color:
|
|
610
|
+
id: `debt-${f}`,
|
|
611
|
+
guid: b.guid,
|
|
612
|
+
label: b.name,
|
|
613
|
+
data: b.dataset.map((R) => R.y),
|
|
614
|
+
color: $,
|
|
616
615
|
curve: "linear",
|
|
617
616
|
type: "line",
|
|
618
617
|
area: !0,
|
|
@@ -623,7 +622,7 @@ const ge = ({
|
|
|
623
622
|
C.push({
|
|
624
623
|
id: "payoff-line",
|
|
625
624
|
label: "Payoff Line",
|
|
626
|
-
data: v.map((
|
|
625
|
+
data: v.map((b) => b.y),
|
|
627
626
|
color: c.palette.grey[700],
|
|
628
627
|
curve: "linear",
|
|
629
628
|
type: "line",
|
|
@@ -631,9 +630,9 @@ const ge = ({
|
|
|
631
630
|
showMark: !1,
|
|
632
631
|
disableHighlight: !0
|
|
633
632
|
});
|
|
634
|
-
const
|
|
633
|
+
const A = (b) => C.findIndex((f) => f?.guid === b);
|
|
635
634
|
return /* @__PURE__ */ e(
|
|
636
|
-
|
|
635
|
+
ae,
|
|
637
636
|
{
|
|
638
637
|
sx: {
|
|
639
638
|
width: "100%",
|
|
@@ -648,19 +647,19 @@ const ge = ({
|
|
|
648
647
|
}
|
|
649
648
|
},
|
|
650
649
|
children: /* @__PURE__ */ e(
|
|
651
|
-
|
|
650
|
+
Oe,
|
|
652
651
|
{
|
|
653
652
|
axisHighlight: { x: "none" },
|
|
654
653
|
disableLineItemHighlight: !0,
|
|
655
654
|
height: n,
|
|
656
|
-
onAreaClick: (
|
|
655
|
+
onAreaClick: (b, f) => {
|
|
657
656
|
i?.();
|
|
658
|
-
const
|
|
659
|
-
d(T.DEBTS_CLICK_CHART_AREA, { account_guid:
|
|
657
|
+
const E = C.find(($) => $.id === f.seriesId);
|
|
658
|
+
d(T.DEBTS_CLICK_CHART_AREA, { account_guid: E?.guid });
|
|
660
659
|
},
|
|
661
|
-
onHighlightChange: (
|
|
662
|
-
const
|
|
663
|
-
p?.(
|
|
660
|
+
onHighlightChange: (b) => {
|
|
661
|
+
const f = C.find((E) => E.id === b?.seriesId)?.guid;
|
|
662
|
+
p?.(f ?? "");
|
|
664
663
|
},
|
|
665
664
|
series: C,
|
|
666
665
|
skipAnimation: !0,
|
|
@@ -686,10 +685,10 @@ const ge = ({
|
|
|
686
685
|
strokeDasharray: "10 5",
|
|
687
686
|
strokeWidth: 1
|
|
688
687
|
},
|
|
689
|
-
[`& .MuiLineElement-series-debt-${
|
|
688
|
+
[`& .MuiLineElement-series-debt-${A(o ?? "0")}`]: {
|
|
690
689
|
opacity: 1
|
|
691
690
|
},
|
|
692
|
-
[`& .MuiAreaElement-series-debt-${
|
|
691
|
+
[`& .MuiAreaElement-series-debt-${A(o ?? "0")}`]: {
|
|
693
692
|
opacity: 1
|
|
694
693
|
},
|
|
695
694
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
@@ -701,30 +700,30 @@ const ge = ({
|
|
|
701
700
|
width: r,
|
|
702
701
|
xAxis: [
|
|
703
702
|
{
|
|
704
|
-
data:
|
|
703
|
+
data: N,
|
|
705
704
|
scaleType: "time",
|
|
706
|
-
min:
|
|
705
|
+
min: u[0],
|
|
707
706
|
disableTicks: !0,
|
|
708
|
-
valueFormatter: (
|
|
707
|
+
valueFormatter: (b) => U(b, q.MONTH_SHORT_YEAR)
|
|
709
708
|
}
|
|
710
709
|
],
|
|
711
710
|
yAxis: [
|
|
712
711
|
{
|
|
713
712
|
min: 0,
|
|
714
|
-
max:
|
|
713
|
+
max: B,
|
|
715
714
|
disableTicks: !0,
|
|
716
|
-
valueFormatter: (
|
|
715
|
+
valueFormatter: (b) => k(b, "0a")
|
|
717
716
|
}
|
|
718
717
|
]
|
|
719
718
|
}
|
|
720
719
|
)
|
|
721
720
|
}
|
|
722
721
|
);
|
|
723
|
-
},
|
|
724
|
-
const a = X(), { debts: n } = S(), { selectedDebtChartData: r } =
|
|
722
|
+
}, mt = () => {
|
|
723
|
+
const a = X(), { debts: n } = S(), { selectedDebtChartData: r } = L();
|
|
725
724
|
return /* @__PURE__ */ s(H, { children: [
|
|
726
725
|
/* @__PURE__ */ s(
|
|
727
|
-
|
|
726
|
+
Le,
|
|
728
727
|
{
|
|
729
728
|
sx: {
|
|
730
729
|
"& .MuiCardContent-root:last-child": {
|
|
@@ -732,8 +731,8 @@ const ge = ({
|
|
|
732
731
|
}
|
|
733
732
|
},
|
|
734
733
|
children: [
|
|
735
|
-
/* @__PURE__ */ e(
|
|
736
|
-
/* @__PURE__ */ e(
|
|
734
|
+
/* @__PURE__ */ e(He, { sx: { pb: 0 }, title: /* @__PURE__ */ e(De, { sx: { pb: 4 }, children: n.details_chart_title }) }),
|
|
735
|
+
/* @__PURE__ */ e($e, { sx: { p: 0 }, children: /* @__PURE__ */ e(we, { debts: [r], height: 250 }) })
|
|
737
736
|
]
|
|
738
737
|
}
|
|
739
738
|
),
|
|
@@ -747,9 +746,9 @@ const ge = ({
|
|
|
747
746
|
}
|
|
748
747
|
)
|
|
749
748
|
] });
|
|
750
|
-
},
|
|
751
|
-
const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } =
|
|
752
|
-
return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(
|
|
749
|
+
}, ht = D(mt), ut = () => {
|
|
750
|
+
const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } = L();
|
|
751
|
+
return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(ye, { children: i || o ? /* @__PURE__ */ e(
|
|
753
752
|
l,
|
|
754
753
|
{
|
|
755
754
|
color: a.palette.secondary.main,
|
|
@@ -775,7 +774,7 @@ const ge = ({
|
|
|
775
774
|
},
|
|
776
775
|
children: [
|
|
777
776
|
/* @__PURE__ */ s(w, { flexGrow: 1, children: [
|
|
778
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children:
|
|
777
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(p, q.MONTH_YEAR) }),
|
|
779
778
|
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
|
780
779
|
] }),
|
|
781
780
|
/* @__PURE__ */ s(w, { children: [
|
|
@@ -811,8 +810,8 @@ const ge = ({
|
|
|
811
810
|
}
|
|
812
811
|
) })
|
|
813
812
|
] }) });
|
|
814
|
-
},
|
|
815
|
-
const { debts: n } = S(), { updateAccount: r } =
|
|
813
|
+
}, bt = D(ut), _t = D(({ debt: a }) => {
|
|
814
|
+
const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
|
|
816
815
|
await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
|
817
816
|
}, d = () => {
|
|
818
817
|
setTimeout(() => {
|
|
@@ -820,17 +819,17 @@ const ge = ({
|
|
|
820
819
|
}, 250);
|
|
821
820
|
};
|
|
822
821
|
return /* @__PURE__ */ e(
|
|
823
|
-
|
|
822
|
+
Q,
|
|
824
823
|
{
|
|
825
824
|
isSaveDisabled: p,
|
|
826
825
|
label: `${n.details_interest_rate} (%)`,
|
|
827
826
|
onCancel: d,
|
|
828
827
|
onSave: c,
|
|
829
828
|
primaryText: n.details_interest_rate,
|
|
830
|
-
secondaryText:
|
|
829
|
+
secondaryText: Me(Number(a.interest_rate) / 100),
|
|
831
830
|
zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
|
|
832
831
|
children: /* @__PURE__ */ e(
|
|
833
|
-
|
|
832
|
+
Ye,
|
|
834
833
|
{
|
|
835
834
|
error: p,
|
|
836
835
|
fullWidth: !0,
|
|
@@ -841,8 +840,8 @@ const ge = ({
|
|
|
841
840
|
)
|
|
842
841
|
}
|
|
843
842
|
);
|
|
844
|
-
}),
|
|
845
|
-
const { debts: n } = S(), { updateAccount: r } =
|
|
843
|
+
}), yt = D(({ debt: a }) => {
|
|
844
|
+
const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
846
845
|
await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
|
847
846
|
}, d = () => {
|
|
848
847
|
setTimeout(() => {
|
|
@@ -850,7 +849,7 @@ const ge = ({
|
|
|
850
849
|
}, 250);
|
|
851
850
|
};
|
|
852
851
|
return /* @__PURE__ */ e(
|
|
853
|
-
|
|
852
|
+
Q,
|
|
854
853
|
{
|
|
855
854
|
isSaveDisabled: p,
|
|
856
855
|
label: n.details_monthly_payment,
|
|
@@ -860,7 +859,7 @@ const ge = ({
|
|
|
860
859
|
secondaryText: k(a.monthly_payment, "0,0"),
|
|
861
860
|
zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
|
|
862
861
|
children: /* @__PURE__ */ e(
|
|
863
|
-
|
|
862
|
+
ne,
|
|
864
863
|
{
|
|
865
864
|
amount: o,
|
|
866
865
|
autoFocus: !0,
|
|
@@ -873,8 +872,8 @@ const ge = ({
|
|
|
873
872
|
)
|
|
874
873
|
}
|
|
875
874
|
);
|
|
876
|
-
}),
|
|
877
|
-
const { debts: n } = S(), { updateAccount: r } =
|
|
875
|
+
}), ft = D(({ debt: a }) => {
|
|
876
|
+
const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
878
877
|
await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
|
879
878
|
}, d = () => {
|
|
880
879
|
setTimeout(() => {
|
|
@@ -882,7 +881,7 @@ const ge = ({
|
|
|
882
881
|
}, 250);
|
|
883
882
|
};
|
|
884
883
|
return /* @__PURE__ */ e(
|
|
885
|
-
|
|
884
|
+
Q,
|
|
886
885
|
{
|
|
887
886
|
isSaveDisabled: p,
|
|
888
887
|
label: n.details_original_balance,
|
|
@@ -892,7 +891,7 @@ const ge = ({
|
|
|
892
891
|
secondaryText: k(a.original_balance, "0,0"),
|
|
893
892
|
zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
|
|
894
893
|
children: /* @__PURE__ */ e(
|
|
895
|
-
|
|
894
|
+
ne,
|
|
896
895
|
{
|
|
897
896
|
amount: o,
|
|
898
897
|
autoFocus: !0,
|
|
@@ -905,35 +904,35 @@ const ge = ({
|
|
|
905
904
|
)
|
|
906
905
|
}
|
|
907
906
|
);
|
|
908
|
-
}),
|
|
909
|
-
const { onEvent: a } = F(), { selectedDebtChartData: n } =
|
|
907
|
+
}), xt = () => {
|
|
908
|
+
const { onEvent: a } = F(), { selectedDebtChartData: n } = L();
|
|
910
909
|
return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
|
|
911
910
|
n?.goal && /* @__PURE__ */ s(H, { children: [
|
|
912
|
-
/* @__PURE__ */ e(Ge, { goal: n.goal }),
|
|
913
|
-
/* @__PURE__ */ e(j, {}),
|
|
914
|
-
/* @__PURE__ */ e(je, { goal: n.goal }),
|
|
915
|
-
/* @__PURE__ */ e(j, {}),
|
|
916
911
|
/* @__PURE__ */ e(ze, { goal: n.goal }),
|
|
917
|
-
/* @__PURE__ */ e(
|
|
912
|
+
/* @__PURE__ */ e(G, {}),
|
|
913
|
+
/* @__PURE__ */ e(Xe, { goal: n.goal }),
|
|
914
|
+
/* @__PURE__ */ e(G, {}),
|
|
915
|
+
/* @__PURE__ */ e(Ve, { goal: n.goal }),
|
|
916
|
+
/* @__PURE__ */ e(G, {})
|
|
918
917
|
] }),
|
|
919
918
|
!n?.goal && n?.account && /* @__PURE__ */ s(H, { children: [
|
|
920
|
-
/* @__PURE__ */ e(_t, { debt: n }),
|
|
921
|
-
/* @__PURE__ */ e(j, {}),
|
|
922
|
-
/* @__PURE__ */ e(bt, { debt: n }),
|
|
923
|
-
/* @__PURE__ */ e(j, {}),
|
|
924
919
|
/* @__PURE__ */ e(yt, { debt: n }),
|
|
925
|
-
/* @__PURE__ */ e(
|
|
920
|
+
/* @__PURE__ */ e(G, {}),
|
|
921
|
+
/* @__PURE__ */ e(_t, { debt: n }),
|
|
922
|
+
/* @__PURE__ */ e(G, {}),
|
|
923
|
+
/* @__PURE__ */ e(ft, { debt: n }),
|
|
924
|
+
/* @__PURE__ */ e(G, {})
|
|
926
925
|
] })
|
|
927
926
|
] });
|
|
928
|
-
},
|
|
929
|
-
const { debts: r } = S(), { showError: t, showCompleted: o } =
|
|
927
|
+
}, gt = D(xt), wt = ({ setTabValue: a, sx: n }) => {
|
|
928
|
+
const { debts: r } = S(), { showError: t, showCompleted: o } = L();
|
|
930
929
|
return g.useEffect(() => {
|
|
931
930
|
t && a(1);
|
|
932
931
|
}, [t]), !t && !o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
|
|
933
|
-
/* @__PURE__ */ e(
|
|
934
|
-
|
|
932
|
+
/* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
933
|
+
me,
|
|
935
934
|
{
|
|
936
|
-
icon: t ? /* @__PURE__ */ e(
|
|
935
|
+
icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(fe, { color: "success", filled: !0 }),
|
|
937
936
|
severity: "error",
|
|
938
937
|
sx: {
|
|
939
938
|
alignItems: "start",
|
|
@@ -946,13 +945,13 @@ const ge = ({
|
|
|
946
945
|
}
|
|
947
946
|
},
|
|
948
947
|
children: [
|
|
949
|
-
/* @__PURE__ */ e(
|
|
948
|
+
/* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
|
|
950
949
|
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
|
|
951
950
|
]
|
|
952
951
|
}
|
|
953
952
|
) }),
|
|
954
|
-
t && /* @__PURE__ */ e(
|
|
955
|
-
|
|
953
|
+
t && /* @__PURE__ */ e(ue, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
954
|
+
me,
|
|
956
955
|
{
|
|
957
956
|
icon: /* @__PURE__ */ e(H, {}),
|
|
958
957
|
severity: "error",
|
|
@@ -964,18 +963,18 @@ const ge = ({
|
|
|
964
963
|
}
|
|
965
964
|
},
|
|
966
965
|
children: [
|
|
967
|
-
/* @__PURE__ */ e(
|
|
966
|
+
/* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
|
|
968
967
|
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
|
|
969
968
|
]
|
|
970
969
|
}
|
|
971
970
|
) })
|
|
972
971
|
] });
|
|
973
|
-
},
|
|
974
|
-
const { debts: a } = S(), { showError: n, showCompleted: r } =
|
|
972
|
+
}, Ct = D(wt), St = () => {
|
|
973
|
+
const { debts: a } = S(), { showError: n, showCompleted: r } = L(), [t, o] = g.useState(0);
|
|
975
974
|
return /* @__PURE__ */ s(H, { children: [
|
|
976
|
-
(n || r) && /* @__PURE__ */ e(
|
|
975
|
+
(n || r) && /* @__PURE__ */ e(Ct, { setTabValue: o, sx: { mt: -24 } }),
|
|
977
976
|
/* @__PURE__ */ s(
|
|
978
|
-
|
|
977
|
+
je,
|
|
979
978
|
{
|
|
980
979
|
"aria-label": a.details_tabs_aria_label,
|
|
981
980
|
centered: !0,
|
|
@@ -985,7 +984,7 @@ const ge = ({
|
|
|
985
984
|
variant: "fullWidth",
|
|
986
985
|
children: [
|
|
987
986
|
/* @__PURE__ */ e(
|
|
988
|
-
|
|
987
|
+
pe,
|
|
989
988
|
{
|
|
990
989
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
991
990
|
id: "debt-schedule-tab-0",
|
|
@@ -993,7 +992,7 @@ const ge = ({
|
|
|
993
992
|
}
|
|
994
993
|
),
|
|
995
994
|
/* @__PURE__ */ e(
|
|
996
|
-
|
|
995
|
+
pe,
|
|
997
996
|
{
|
|
998
997
|
"aria-controls": "debt-details-tabpanel-1",
|
|
999
998
|
id: "debt-details-tab-1",
|
|
@@ -1003,25 +1002,25 @@ const ge = ({
|
|
|
1003
1002
|
]
|
|
1004
1003
|
}
|
|
1005
1004
|
),
|
|
1006
|
-
/* @__PURE__ */ e(
|
|
1007
|
-
/* @__PURE__ */ e(
|
|
1005
|
+
/* @__PURE__ */ e(be, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(bt, {}) }),
|
|
1006
|
+
/* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
|
|
1008
1007
|
] });
|
|
1009
|
-
},
|
|
1010
|
-
const { debts: r } = S(), { showError: t, showCompleted: o } =
|
|
1008
|
+
}, vt = D(St), Dt = ({ isOpen: a, onClose: n }) => {
|
|
1009
|
+
const { debts: r } = S(), { showError: t, showCompleted: o } = L(), i = t || o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(ht, {});
|
|
1011
1010
|
return /* @__PURE__ */ e(
|
|
1012
|
-
|
|
1011
|
+
re,
|
|
1013
1012
|
{
|
|
1014
1013
|
ariaLabelClose: r.details_close_aria,
|
|
1015
1014
|
isOpen: a,
|
|
1016
1015
|
onClose: n,
|
|
1017
1016
|
title: r.details_title,
|
|
1018
1017
|
children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1020
|
-
/* @__PURE__ */ e(
|
|
1018
|
+
/* @__PURE__ */ e(Fe, { customDetailsChart: i }),
|
|
1019
|
+
/* @__PURE__ */ e(vt, {})
|
|
1021
1020
|
] })
|
|
1022
1021
|
}
|
|
1023
1022
|
);
|
|
1024
|
-
},
|
|
1023
|
+
}, Tt = D(() => {
|
|
1025
1024
|
const { debts: a } = S(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [o, i] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
1026
1025
|
n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1027
1026
|
user_guid: n?.user_guid
|
|
@@ -1032,7 +1031,7 @@ const ge = ({
|
|
|
1032
1031
|
}, 250);
|
|
1033
1032
|
};
|
|
1034
1033
|
return /* @__PURE__ */ e(
|
|
1035
|
-
|
|
1034
|
+
Q,
|
|
1036
1035
|
{
|
|
1037
1036
|
isSaveDisabled: p,
|
|
1038
1037
|
label: a.paydown_drawer_extra_payment,
|
|
@@ -1042,7 +1041,7 @@ const ge = ({
|
|
|
1042
1041
|
secondaryText: k(n?.extra_payment, "0,0"),
|
|
1043
1042
|
zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1044
1043
|
children: /* @__PURE__ */ e(
|
|
1045
|
-
|
|
1044
|
+
ne,
|
|
1046
1045
|
{
|
|
1047
1046
|
amount: o,
|
|
1048
1047
|
autoFocus: !0,
|
|
@@ -1055,8 +1054,8 @@ const ge = ({
|
|
|
1055
1054
|
)
|
|
1056
1055
|
}
|
|
1057
1056
|
);
|
|
1058
|
-
}),
|
|
1059
|
-
const { debts: a } = S(), { totalMonthlyPayments: n } =
|
|
1057
|
+
}), At = () => {
|
|
1058
|
+
const { debts: a } = S(), { totalMonthlyPayments: n } = Z(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
|
|
1060
1059
|
return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1061
1060
|
/* @__PURE__ */ s(w, { p: 24, children: [
|
|
1062
1061
|
/* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
@@ -1069,26 +1068,26 @@ const ge = ({
|
|
|
1069
1068
|
/* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1070
1069
|
] })
|
|
1071
1070
|
] }),
|
|
1072
|
-
/* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
|
|
1071
|
+
/* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Tt, {}) }),
|
|
1073
1072
|
/* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { gap: 4, children: [
|
|
1074
1073
|
/* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
|
1075
1074
|
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
|
|
1076
1075
|
] }) })
|
|
1077
1076
|
] });
|
|
1078
|
-
},
|
|
1077
|
+
}, Et = D(At), It = ({ isOpen: a, onClose: n }) => {
|
|
1079
1078
|
const { debts: r } = S();
|
|
1080
1079
|
return /* @__PURE__ */ e(
|
|
1081
|
-
|
|
1080
|
+
re,
|
|
1082
1081
|
{
|
|
1083
1082
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1084
1083
|
isOpen: a,
|
|
1085
1084
|
onClose: n,
|
|
1086
1085
|
title: r.paydown_drawer_title,
|
|
1087
|
-
children: /* @__PURE__ */ e(
|
|
1086
|
+
children: /* @__PURE__ */ e(Et, {})
|
|
1088
1087
|
}
|
|
1089
1088
|
);
|
|
1090
1089
|
};
|
|
1091
|
-
function
|
|
1090
|
+
function Bt(a, n) {
|
|
1092
1091
|
const r = (t) => {
|
|
1093
1092
|
if (typeof t == "number") return t;
|
|
1094
1093
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
@@ -1096,19 +1095,19 @@ function It(a, n) {
|
|
|
1096
1095
|
};
|
|
1097
1096
|
return r(a) - r(n);
|
|
1098
1097
|
}
|
|
1099
|
-
function
|
|
1098
|
+
function Mt(a) {
|
|
1100
1099
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1101
1100
|
}
|
|
1102
|
-
const
|
|
1101
|
+
const Pt = (a) => {
|
|
1103
1102
|
const n = {
|
|
1104
1103
|
text: "#121417",
|
|
1105
1104
|
background: "#FFB252"
|
|
1106
1105
|
};
|
|
1107
1106
|
return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
|
|
1108
|
-
},
|
|
1109
|
-
const n = String(a.formattedValue), r =
|
|
1107
|
+
}, kt = (a) => {
|
|
1108
|
+
const n = String(a.formattedValue), r = Pt(n);
|
|
1110
1109
|
return /* @__PURE__ */ e(
|
|
1111
|
-
|
|
1110
|
+
ae,
|
|
1112
1111
|
{
|
|
1113
1112
|
sx: {
|
|
1114
1113
|
display: "flex",
|
|
@@ -1124,11 +1123,11 @@ const Mt = (a) => {
|
|
|
1124
1123
|
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
|
|
1125
1124
|
}
|
|
1126
1125
|
);
|
|
1127
|
-
},
|
|
1128
|
-
const n = a.row.account, r =
|
|
1126
|
+
}, Nt = (a) => {
|
|
1127
|
+
const n = a.row.account, r = qe[n.account_type];
|
|
1129
1128
|
return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
|
|
1130
1129
|
/* @__PURE__ */ e(
|
|
1131
|
-
|
|
1130
|
+
Te,
|
|
1132
1131
|
{
|
|
1133
1132
|
alt: `${n.institutionName}`,
|
|
1134
1133
|
institutionGuid: n.institution_guid || ""
|
|
@@ -1139,22 +1138,22 @@ const Mt = (a) => {
|
|
|
1139
1138
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1140
1139
|
] })
|
|
1141
1140
|
] });
|
|
1142
|
-
},
|
|
1141
|
+
}, Ft = ({
|
|
1143
1142
|
sx: a = {},
|
|
1144
1143
|
debts: n,
|
|
1145
1144
|
hoveredDebtGuid: r,
|
|
1146
1145
|
onHoverRow: t,
|
|
1147
1146
|
onClickRow: o
|
|
1148
1147
|
}) => {
|
|
1149
|
-
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m,
|
|
1148
|
+
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, u] = g.useState([
|
|
1150
1149
|
{ field: "priority", sort: "asc" }
|
|
1151
|
-
]),
|
|
1150
|
+
]), x = [
|
|
1152
1151
|
{
|
|
1153
1152
|
field: "priority",
|
|
1154
1153
|
headerName: d.table_column_priority,
|
|
1155
|
-
renderHeader:
|
|
1156
|
-
renderCell:
|
|
1157
|
-
sortComparator:
|
|
1154
|
+
renderHeader: j,
|
|
1155
|
+
renderCell: kt,
|
|
1156
|
+
sortComparator: Bt,
|
|
1158
1157
|
sortable: !0,
|
|
1159
1158
|
hideSortIcons: !0,
|
|
1160
1159
|
type: "custom",
|
|
@@ -1166,8 +1165,8 @@ const Mt = (a) => {
|
|
|
1166
1165
|
{
|
|
1167
1166
|
field: "account",
|
|
1168
1167
|
headerName: d.table_column_account,
|
|
1169
|
-
renderHeader:
|
|
1170
|
-
renderCell:
|
|
1168
|
+
renderHeader: j,
|
|
1169
|
+
renderCell: Nt,
|
|
1171
1170
|
sortable: !1,
|
|
1172
1171
|
type: "custom",
|
|
1173
1172
|
align: "left",
|
|
@@ -1178,7 +1177,7 @@ const Mt = (a) => {
|
|
|
1178
1177
|
{
|
|
1179
1178
|
field: "balance",
|
|
1180
1179
|
headerName: d.table_column_balance,
|
|
1181
|
-
renderHeader:
|
|
1180
|
+
renderHeader: j,
|
|
1182
1181
|
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: k(y.value, "0,0") }),
|
|
1183
1182
|
sortable: !0,
|
|
1184
1183
|
hideSortIcons: c,
|
|
@@ -1191,7 +1190,7 @@ const Mt = (a) => {
|
|
|
1191
1190
|
{
|
|
1192
1191
|
field: "interest_rate",
|
|
1193
1192
|
headerName: d.table_column_interest_rate,
|
|
1194
|
-
renderHeader:
|
|
1193
|
+
renderHeader: j,
|
|
1195
1194
|
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
|
|
1196
1195
|
sortable: !0,
|
|
1197
1196
|
hideSortIcons: c,
|
|
@@ -1204,8 +1203,8 @@ const Mt = (a) => {
|
|
|
1204
1203
|
{
|
|
1205
1204
|
field: "projected_payoff_date",
|
|
1206
1205
|
headerName: d.table_column_payoff_date,
|
|
1207
|
-
renderHeader:
|
|
1208
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ?
|
|
1206
|
+
renderHeader: j,
|
|
1207
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? U(y.value, q.MONTH_SHORT_YEAR) : "---" }),
|
|
1209
1208
|
sortable: !0,
|
|
1210
1209
|
hideSortIcons: c,
|
|
1211
1210
|
type: "number",
|
|
@@ -1217,7 +1216,7 @@ const Mt = (a) => {
|
|
|
1217
1216
|
{
|
|
1218
1217
|
field: "monthly_payment",
|
|
1219
1218
|
headerName: d.table_column_amount_due,
|
|
1220
|
-
renderHeader:
|
|
1219
|
+
renderHeader: j,
|
|
1221
1220
|
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? k(y.value, "0,0") : "---" }),
|
|
1222
1221
|
sortable: !0,
|
|
1223
1222
|
hideSortIcons: c,
|
|
@@ -1227,13 +1226,13 @@ const Mt = (a) => {
|
|
|
1227
1226
|
minWidth: 122,
|
|
1228
1227
|
flex: 0.6
|
|
1229
1228
|
}
|
|
1230
|
-
],
|
|
1231
|
-
...
|
|
1229
|
+
], h = [
|
|
1230
|
+
...x.slice(0, 3),
|
|
1232
1231
|
{
|
|
1233
1232
|
field: "chevron",
|
|
1234
1233
|
headerName: "",
|
|
1235
1234
|
renderHeader: void 0,
|
|
1236
|
-
renderCell: () => /* @__PURE__ */ e(
|
|
1235
|
+
renderCell: () => /* @__PURE__ */ e(te, { name: "chevron_right'" }),
|
|
1237
1236
|
sortable: !0,
|
|
1238
1237
|
hideSortIcons: !0,
|
|
1239
1238
|
type: "custom",
|
|
@@ -1241,20 +1240,20 @@ const Mt = (a) => {
|
|
|
1241
1240
|
headerAlign: "right",
|
|
1242
1241
|
width: 20
|
|
1243
1242
|
}
|
|
1244
|
-
], v = g.useMemo(() => n.map((y,
|
|
1243
|
+
], v = g.useMemo(() => n.map((y, M) => ({
|
|
1245
1244
|
...y,
|
|
1246
|
-
id:
|
|
1247
|
-
priority:
|
|
1248
|
-
})), [n]),
|
|
1249
|
-
const
|
|
1250
|
-
t?.(
|
|
1251
|
-
},
|
|
1252
|
-
c ||
|
|
1245
|
+
id: M,
|
|
1246
|
+
priority: Mt(y)
|
|
1247
|
+
})), [n]), B = (y) => {
|
|
1248
|
+
const f = y.target.closest("[data-id]")?.getAttribute("data-id"), E = n[Number(f)];
|
|
1249
|
+
t?.(E?.guid ?? "");
|
|
1250
|
+
}, N = (y) => {
|
|
1251
|
+
c || B(y);
|
|
1253
1252
|
}, C = (y) => {
|
|
1254
|
-
c &&
|
|
1255
|
-
},
|
|
1253
|
+
c && B(y);
|
|
1254
|
+
}, A = (y) => v.find((M) => M.guid === y)?.id;
|
|
1256
1255
|
return /* @__PURE__ */ e(
|
|
1257
|
-
|
|
1256
|
+
ae,
|
|
1258
1257
|
{
|
|
1259
1258
|
sx: {
|
|
1260
1259
|
height: "100dvh",
|
|
@@ -1265,9 +1264,9 @@ const Mt = (a) => {
|
|
|
1265
1264
|
...a
|
|
1266
1265
|
},
|
|
1267
1266
|
children: /* @__PURE__ */ e(
|
|
1268
|
-
|
|
1267
|
+
Ue,
|
|
1269
1268
|
{
|
|
1270
|
-
columns: c ?
|
|
1269
|
+
columns: c ? h : x,
|
|
1271
1270
|
disableColumnFilter: !0,
|
|
1272
1271
|
disableColumnMenu: !0,
|
|
1273
1272
|
hideFooter: !0,
|
|
@@ -1276,13 +1275,13 @@ const Mt = (a) => {
|
|
|
1276
1275
|
o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1277
1276
|
},
|
|
1278
1277
|
onSortModelChange: (y) => {
|
|
1279
|
-
|
|
1278
|
+
u(y), p(T.DEBTS_CLICK_TABLE_SORT);
|
|
1280
1279
|
},
|
|
1281
1280
|
rows: v,
|
|
1282
1281
|
slotProps: {
|
|
1283
1282
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1284
1283
|
row: {
|
|
1285
|
-
onMouseEnter:
|
|
1284
|
+
onMouseEnter: N,
|
|
1286
1285
|
onMouseLeave: () => !c && t?.(""),
|
|
1287
1286
|
onTouchStart: C,
|
|
1288
1287
|
onClick: c ? C : void 0
|
|
@@ -1291,7 +1290,7 @@ const Mt = (a) => {
|
|
|
1291
1290
|
sortModel: m,
|
|
1292
1291
|
sortingOrder: ["asc", "desc"],
|
|
1293
1292
|
sx: {
|
|
1294
|
-
[`& .MuiDataGrid-row[data-id="${
|
|
1293
|
+
[`& .MuiDataGrid-row[data-id="${A(r)}"]`]: {
|
|
1295
1294
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1296
1295
|
filter: "brightness(98%)"
|
|
1297
1296
|
}
|
|
@@ -1300,33 +1299,33 @@ const Mt = (a) => {
|
|
|
1300
1299
|
)
|
|
1301
1300
|
}
|
|
1302
1301
|
);
|
|
1303
|
-
},
|
|
1302
|
+
}, Rt = ({ buttonText: a, isOpen: n, onClick: r }) => {
|
|
1304
1303
|
const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
|
|
1305
1304
|
return t || o ? /* @__PURE__ */ e(
|
|
1306
|
-
|
|
1305
|
+
xe,
|
|
1307
1306
|
{
|
|
1308
1307
|
"aria-controls": "prioritize-debts",
|
|
1309
1308
|
"aria-describedby": "prioritize-debts",
|
|
1310
1309
|
"aria-haspopup": !0,
|
|
1311
1310
|
"aria-label": "prioritize-debts",
|
|
1312
1311
|
onClick: r,
|
|
1313
|
-
startIcon: /* @__PURE__ */ e(
|
|
1312
|
+
startIcon: /* @__PURE__ */ e(te, { name: i }),
|
|
1314
1313
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1315
1314
|
children: a
|
|
1316
1315
|
}
|
|
1317
1316
|
) : /* @__PURE__ */ e(
|
|
1318
|
-
|
|
1317
|
+
Ze,
|
|
1319
1318
|
{
|
|
1320
1319
|
"aria-controls": "prioritize-debts",
|
|
1321
1320
|
"aria-describedby": "prioritize-debts",
|
|
1322
1321
|
"aria-haspopup": !0,
|
|
1323
1322
|
"aria-label": "prioritize-debts",
|
|
1324
1323
|
onClick: r,
|
|
1325
|
-
children: /* @__PURE__ */ e(
|
|
1324
|
+
children: /* @__PURE__ */ e(te, { name: i })
|
|
1326
1325
|
}
|
|
1327
1326
|
);
|
|
1328
|
-
},
|
|
1329
|
-
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } =
|
|
1327
|
+
}, Lt = D(({ buttonEl: a, onClose: n }) => {
|
|
1328
|
+
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = L(), p = !!a, c = [
|
|
1330
1329
|
{
|
|
1331
1330
|
priority: P.FASTEST_PAYOFF_FIRST,
|
|
1332
1331
|
text: t.priority_sort_fastest_payoff
|
|
@@ -1347,7 +1346,7 @@ const Mt = (a) => {
|
|
|
1347
1346
|
i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
|
|
1348
1347
|
};
|
|
1349
1348
|
return /* @__PURE__ */ e(
|
|
1350
|
-
|
|
1349
|
+
Qe,
|
|
1351
1350
|
{
|
|
1352
1351
|
anchorEl: a,
|
|
1353
1352
|
anchorOrigin: {
|
|
@@ -1361,8 +1360,8 @@ const Mt = (a) => {
|
|
|
1361
1360
|
vertical: "top",
|
|
1362
1361
|
horizontal: "left"
|
|
1363
1362
|
},
|
|
1364
|
-
children: /* @__PURE__ */ e(
|
|
1365
|
-
|
|
1363
|
+
children: /* @__PURE__ */ e(ye, { children: c.map(({ priority: m, text: u }) => /* @__PURE__ */ s(
|
|
1364
|
+
Je,
|
|
1366
1365
|
{
|
|
1367
1366
|
onClick: () => d(m),
|
|
1368
1367
|
sx: {
|
|
@@ -1380,16 +1379,16 @@ const Mt = (a) => {
|
|
|
1380
1379
|
}
|
|
1381
1380
|
},
|
|
1382
1381
|
children: [
|
|
1383
|
-
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children:
|
|
1384
|
-
o === m && /* @__PURE__ */ e(
|
|
1382
|
+
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: u }),
|
|
1383
|
+
o === m && /* @__PURE__ */ e(fe, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1385
1384
|
]
|
|
1386
1385
|
},
|
|
1387
1386
|
m
|
|
1388
1387
|
)) })
|
|
1389
1388
|
}
|
|
1390
1389
|
);
|
|
1391
|
-
}),
|
|
1392
|
-
const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } =
|
|
1390
|
+
}), $t = D(() => {
|
|
1391
|
+
const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } = L(), [t, o] = g.useState(null), i = (m) => {
|
|
1393
1392
|
o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
|
1394
1393
|
}, p = () => {
|
|
1395
1394
|
o(null);
|
|
@@ -1400,12 +1399,12 @@ const Mt = (a) => {
|
|
|
1400
1399
|
[P.LOWEST_BALANCE]: n.priority_sort_lowest_balance
|
|
1401
1400
|
})[r] ?? n.priority_sort_lowest_balance, [r]);
|
|
1402
1401
|
return /* @__PURE__ */ s(_, { children: [
|
|
1403
|
-
/* @__PURE__ */ e(
|
|
1404
|
-
/* @__PURE__ */ e(
|
|
1402
|
+
/* @__PURE__ */ e(Rt, { buttonText: d, isOpen: c, onClick: i }),
|
|
1403
|
+
/* @__PURE__ */ e(Lt, { buttonEl: t, onClose: p })
|
|
1405
1404
|
] });
|
|
1406
|
-
}),
|
|
1405
|
+
}), Ht = (a, n, r = 0) => {
|
|
1407
1406
|
const t = a.map((d) => ({ ...d }));
|
|
1408
|
-
|
|
1407
|
+
ge(t, n);
|
|
1409
1408
|
const o = /* @__PURE__ */ new Date(), i = [];
|
|
1410
1409
|
let p = 0, c = 1;
|
|
1411
1410
|
for (const d of t)
|
|
@@ -1415,23 +1414,23 @@ const Mt = (a) => {
|
|
|
1415
1414
|
dataset: [{ x: new Date(o), y: d.balance }]
|
|
1416
1415
|
});
|
|
1417
1416
|
for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
|
|
1418
|
-
let d = !1, m = !1,
|
|
1419
|
-
for (const [
|
|
1420
|
-
if (
|
|
1421
|
-
const v = i[
|
|
1422
|
-
let y =
|
|
1423
|
-
!
|
|
1424
|
-
const
|
|
1425
|
-
if (
|
|
1426
|
-
|
|
1417
|
+
let d = !1, m = !1, u = !1;
|
|
1418
|
+
for (const [x, h] of t.entries()) {
|
|
1419
|
+
if (h.balance <= 0.01) continue;
|
|
1420
|
+
const v = i[x].dataset, N = (h.interest_rate ?? 0) / 100 / 12, C = h.balance * N, A = h.monthly_payment ?? 0;
|
|
1421
|
+
let y = A, M = 0;
|
|
1422
|
+
!u && r > 0 && (y += r, u = !0), !m && p > 0 && (M = p, m = !0), h.balance += C;
|
|
1423
|
+
const b = Math.min(h.balance, y + M);
|
|
1424
|
+
if (b <= C) {
|
|
1425
|
+
h.is_impossible = !0, i[x].is_impossible = !0, i[x].priority = void 0, v.push({ x: new Date(o), y: h.balance });
|
|
1427
1426
|
continue;
|
|
1428
1427
|
}
|
|
1429
|
-
|
|
1428
|
+
h.balance -= b, h.balance = h.balance < 0.01 ? 0 : h.balance, v.push({
|
|
1430
1429
|
x: new Date(o),
|
|
1431
|
-
y: Math.max(0,
|
|
1432
|
-
payment:
|
|
1433
|
-
extra:
|
|
1434
|
-
}),
|
|
1430
|
+
y: Math.max(0, h.balance),
|
|
1431
|
+
payment: b,
|
|
1432
|
+
extra: M
|
|
1433
|
+
}), h.balance <= 0 && (p += A, i[x].projected_payoff_date = new Date(o)), b > 0 && (d = !0);
|
|
1435
1434
|
}
|
|
1436
1435
|
d && o.setMonth(o.getMonth() + 1);
|
|
1437
1436
|
}
|
|
@@ -1440,10 +1439,10 @@ const Mt = (a) => {
|
|
|
1440
1439
|
}), i.forEach((d) => {
|
|
1441
1440
|
d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
|
|
1442
1441
|
}), i;
|
|
1443
|
-
},
|
|
1444
|
-
const { debts: n } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } =
|
|
1442
|
+
}, Ot = D(({ onClick: a }) => {
|
|
1443
|
+
const { debts: n } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = Z(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
|
|
1445
1444
|
return /* @__PURE__ */ e(
|
|
1446
|
-
|
|
1445
|
+
xe,
|
|
1447
1446
|
{
|
|
1448
1447
|
"aria-controls": "extra-paydown",
|
|
1449
1448
|
"aria-describedby": "extra-paydown",
|
|
@@ -1451,105 +1450,102 @@ const Mt = (a) => {
|
|
|
1451
1450
|
"aria-label": "extra-paydown",
|
|
1452
1451
|
onClick: a,
|
|
1453
1452
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
|
1454
|
-
children:
|
|
1453
|
+
children: I(p, k(i, "0,0"))
|
|
1455
1454
|
}
|
|
1456
1455
|
);
|
|
1457
|
-
}),
|
|
1458
|
-
const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop:
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
});
|
|
1463
|
-
const O = g.useMemo(() => {
|
|
1464
|
-
const W = R?.extra_payment ?? 0;
|
|
1465
|
-
return $t(L, y, W);
|
|
1466
|
-
}, [L, y, R]);
|
|
1456
|
+
}), Wt = ({ onBackClick: a, sx: n }) => {
|
|
1457
|
+
const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop: u, isMobile: x } = Y(), { debts: h } = S(), { onEvent: v } = F(), { onLoad: B } = ke(), { isCopyLoaded: N, isInitialized: C, setSelectedAccounts: A } = Ne(), { setSelectedAccount: y } = Re(), { selectedDebtPriority: M, setSelectedDebtChartData: b } = L(), { visibleDebtAccounts: f } = J(), { goalsLoaded: E, loadGoals: $, monthlyCashFlowProfile: R } = V(), { debts: z } = Z(), K = g.useMemo(() => {
|
|
1458
|
+
const O = R?.extra_payment ?? 0;
|
|
1459
|
+
return Ht(z, M, O);
|
|
1460
|
+
}, [z, M, R]);
|
|
1467
1461
|
g.useEffect(() => {
|
|
1468
|
-
|
|
1462
|
+
A(f), v(T.DEBTS_VIEW);
|
|
1469
1463
|
}, []), g.useEffect(() => {
|
|
1470
|
-
|
|
1471
|
-
}, [
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1464
|
+
A(f);
|
|
1465
|
+
}, [f]), g.useEffect(() => {
|
|
1466
|
+
C && $().finally(() => {
|
|
1467
|
+
B?.("DebtsWidget");
|
|
1468
|
+
});
|
|
1469
|
+
}, [C]);
|
|
1470
|
+
const oe = (O) => m(O), ie = () => {
|
|
1471
|
+
const O = f.find((ee) => ee.guid === d), le = K.find((ee) => ee.guid === d);
|
|
1472
|
+
O && y(O), le && b(le), t(!0);
|
|
1473
|
+
}, Ce = () => v(T.DEBTS_CLICK_FILTER), Se = () => {
|
|
1478
1474
|
c(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1479
|
-
},
|
|
1475
|
+
}, ve = () => {
|
|
1480
1476
|
i(!0), v(T.DEBTS_CLICK_PAYDOWN);
|
|
1481
1477
|
};
|
|
1482
|
-
return !
|
|
1483
|
-
|
|
1478
|
+
return !E || !N || !C ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
|
|
1479
|
+
Ge,
|
|
1484
1480
|
{
|
|
1485
|
-
accountOptions:
|
|
1481
|
+
accountOptions: f,
|
|
1486
1482
|
actions: [
|
|
1487
|
-
/* @__PURE__ */ e(
|
|
1488
|
-
/* @__PURE__ */ e(
|
|
1483
|
+
/* @__PURE__ */ e($t, {}, "prioritize-debts"),
|
|
1484
|
+
/* @__PURE__ */ e(Ot, { onClick: ve }, "extra-paydown")
|
|
1489
1485
|
],
|
|
1490
|
-
onAccountsFilterClick:
|
|
1486
|
+
onAccountsFilterClick: Ce,
|
|
1491
1487
|
onBackClick: a,
|
|
1492
1488
|
sx: n,
|
|
1493
|
-
title:
|
|
1489
|
+
title: h.title,
|
|
1494
1490
|
children: [
|
|
1495
|
-
/* @__PURE__ */ s(w, { sx: { px:
|
|
1491
|
+
/* @__PURE__ */ s(w, { sx: { px: u ? "48px" : "24px" }, children: [
|
|
1496
1492
|
/* @__PURE__ */ s(
|
|
1497
1493
|
w,
|
|
1498
1494
|
{
|
|
1499
1495
|
sx: {
|
|
1500
|
-
alignItems:
|
|
1501
|
-
flexDirection:
|
|
1502
|
-
mx:
|
|
1496
|
+
alignItems: x ? "flex-start" : "flex-end",
|
|
1497
|
+
flexDirection: x ? "column" : "row",
|
|
1498
|
+
mx: x ? "-12px" : 0
|
|
1503
1499
|
},
|
|
1504
1500
|
children: [
|
|
1505
1501
|
/* @__PURE__ */ e(
|
|
1506
|
-
|
|
1502
|
+
we,
|
|
1507
1503
|
{
|
|
1508
|
-
debts:
|
|
1509
|
-
height:
|
|
1504
|
+
debts: K,
|
|
1505
|
+
height: x ? 250 : void 0,
|
|
1510
1506
|
hoveredDebtGuid: d,
|
|
1511
|
-
onClickArea:
|
|
1512
|
-
onHoverArea:
|
|
1513
|
-
sx: { mr:
|
|
1507
|
+
onClickArea: ie,
|
|
1508
|
+
onHoverArea: oe,
|
|
1509
|
+
sx: { mr: x ? "4px" : "-48px" }
|
|
1514
1510
|
}
|
|
1515
1511
|
),
|
|
1516
1512
|
/* @__PURE__ */ e(
|
|
1517
|
-
|
|
1513
|
+
lt,
|
|
1518
1514
|
{
|
|
1519
|
-
debts:
|
|
1520
|
-
onClickCta:
|
|
1521
|
-
sx: { mb:
|
|
1515
|
+
debts: K,
|
|
1516
|
+
onClickCta: Se,
|
|
1517
|
+
sx: { mb: x ? "0px" : "64px" }
|
|
1522
1518
|
}
|
|
1523
1519
|
)
|
|
1524
1520
|
]
|
|
1525
1521
|
}
|
|
1526
1522
|
),
|
|
1527
|
-
/* @__PURE__ */ e(w, { sx: { mx:
|
|
1528
|
-
|
|
1523
|
+
/* @__PURE__ */ e(w, { sx: { mx: x ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1524
|
+
Ft,
|
|
1529
1525
|
{
|
|
1530
|
-
debts:
|
|
1526
|
+
debts: K,
|
|
1531
1527
|
hoveredDebtGuid: d,
|
|
1532
|
-
onClickRow:
|
|
1533
|
-
onHoverRow:
|
|
1528
|
+
onClickRow: ie,
|
|
1529
|
+
onHoverRow: oe
|
|
1534
1530
|
}
|
|
1535
1531
|
) })
|
|
1536
1532
|
] }),
|
|
1537
1533
|
/* @__PURE__ */ e(
|
|
1538
|
-
|
|
1534
|
+
ct,
|
|
1539
1535
|
{
|
|
1540
1536
|
isOpen: p,
|
|
1541
1537
|
onClose: () => c(!1)
|
|
1542
1538
|
}
|
|
1543
1539
|
),
|
|
1544
|
-
/* @__PURE__ */ e(
|
|
1545
|
-
/* @__PURE__ */ e(
|
|
1540
|
+
/* @__PURE__ */ e(Dt, { isOpen: r, onClose: () => t(!1) }),
|
|
1541
|
+
/* @__PURE__ */ e(It, { isOpen: o, onClose: () => i(!1) })
|
|
1546
1542
|
]
|
|
1547
1543
|
}
|
|
1548
1544
|
);
|
|
1549
|
-
}, Nr = D(
|
|
1545
|
+
}, Nr = D(Wt);
|
|
1550
1546
|
export {
|
|
1551
|
-
|
|
1547
|
+
we as DebtsChart,
|
|
1552
1548
|
Lr as DebtsStore,
|
|
1553
|
-
|
|
1549
|
+
Ft as DebtsTable,
|
|
1554
1550
|
Nr as DebtsWidget
|
|
1555
1551
|
};
|