@mx-cartographer/experiences 7.0.17-alpha-debts-missing-sorting-option-ram → 7.0.17-alpha.mm.0
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 +0 -8
- package/dist/{Account-BW3-oYEs.mjs → Account-DY2axAET.mjs} +1 -1
- package/dist/{AccountDetailsContent-BzD6CDIm.mjs → AccountDetailsContent-Jsg4ZDC1.mjs} +8 -8
- package/dist/{AccountDetailsHeader-Eb3WvBGm.mjs → AccountDetailsHeader-EU_2u2Iq.mjs} +5 -5
- package/dist/{AccountFields-CIz-r3gP.mjs → AccountFields-CSUS7pGn.mjs} +2 -2
- package/dist/{AccountListItem-B-ZjJ4Gp.mjs → AccountListItem-CMYZQg8M.mjs} +3 -3
- package/dist/{AccountStore-BaMynkQT.mjs → AccountStore-CIX2RAmG.mjs} +26 -26
- package/dist/{Accounts-CA-nqAjT.mjs → Accounts-xi9RGRIU.mjs} +1 -1
- package/dist/{BeatApi-DLu87ijw.mjs → BeatApi-D0WcLW3O.mjs} +3 -3
- package/dist/{BeatStore-By4aGoRM.mjs → BeatStore-y6WVs07e.mjs} +17 -17
- package/dist/{BudgetUtil-CeSLAcsl.mjs → BudgetUtil-DmWvHV7C.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-BJ9jlCyt.mjs → CategorySelectorDrawer-BHqOpBNr.mjs} +1 -1
- package/dist/{CategoryStore-BOyzQjQp.mjs → CategoryStore-BfYppD3g.mjs} +4 -4
- package/dist/{ConnectDrawer-phFH6OHt.mjs → ConnectDrawer-CU5dEdrU.mjs} +1 -1
- package/dist/{ConnectionsDrawer-ihxkAi1P.mjs → ConnectionsDrawer-BUJuQrgF.mjs} +2 -2
- package/dist/{CurrencyInput-bEx2Mbd0.mjs → CurrencyInput-BtrNBP3z.mjs} +1 -1
- package/dist/{DebtsStore-VkyMADzd.mjs → DebtsStore-BL_0pQEd.mjs} +15 -18
- package/dist/{ExportCsvAction-CbMfQ2Wa.mjs → ExportCsvAction-CUGnEaHw.mjs} +3 -3
- package/dist/{Fetch-CkFKy79O.mjs → Fetch-CJ9cgjgV.mjs} +9 -8
- package/dist/{FinstrongStore-mkALvztw.mjs → FinstrongStore-rC2F4Tq3.mjs} +4 -4
- package/dist/{GoalStore-eSOkI6uE.mjs → GoalStore-CFx47exL.mjs} +6 -6
- package/dist/{Help-KAAMEubC.mjs → Help-CCuoAZT3.mjs} +1 -1
- package/dist/{LineChart-BWWmmJxV.mjs → LineChart-D5uLCys4.mjs} +1 -1
- package/dist/{ListItemAction-DNZZ5fSa.mjs → ListItemAction-Cwadpg85.mjs} +1 -1
- package/dist/{ManageIncome-DcKHpJ9V.mjs → ManageIncome-B91zIeYo.mjs} +4 -4
- package/dist/MerchantStore-h96aTml7.mjs +37 -0
- package/dist/{MicroWidgetContainer-Dxz8uBN9.mjs → MicroWidgetContainer-DwTAjSdX.mjs} +1 -1
- package/dist/{MiniWidgetContainer-CTyjmE1h.mjs → MiniWidgetContainer-CxggrnHk.mjs} +1 -1
- package/dist/{NetWorthStore-B6xF9eGH.mjs → NetWorthStore-CYYTpP9O.mjs} +2 -2
- package/dist/{NotificationSettings-aZFVTc8B.mjs → NotificationSettings-BEFyqBTj.mjs} +2 -2
- package/dist/{NotificationStore-DHtSGySy.mjs → NotificationStore-DpV9hXSE.mjs} +8 -4
- package/dist/{OriginalBalanceAction-DepsKiJz.mjs → OriginalBalanceAction-DDMRgIBU.mjs} +3 -3
- package/dist/{RecurringSettings-C9r4s1Cz.mjs → RecurringSettings-CGGFhlhh.mjs} +3 -3
- package/dist/{RecurringTransactionsStore-D62XJtdL.mjs → RecurringTransactionsStore-CXhnipfd.mjs} +20 -16
- package/dist/{SettingsStore-B4gi6oOw.mjs → SettingsStore-CLLqNa_S.mjs} +33 -29
- package/dist/{TransactionApi-DbbcjI2L.mjs → TransactionApi-C0HMGDBV.mjs} +29 -29
- package/dist/{TransactionDetails-bja6hKJk.mjs → TransactionDetails-Bc0iW26I.mjs} +5 -5
- package/dist/{TransactionStore-0tLtBEIC.mjs → TransactionStore-Va_jug-g.mjs} +29 -25
- package/dist/{TrendsStore-WrHxzdbQ.mjs → TrendsStore-DmuQennN.mjs} +1 -1
- package/dist/{User-Dq9Qj764.mjs → User-B9T_314z.mjs} +1 -1
- package/dist/{ViewMoreMicroCard-BPEzFZRG.mjs → ViewMoreMicroCard-61VqFx4x.mjs} +5 -2
- package/dist/{WidgetContainer-CdBs9WOZ.mjs → WidgetContainer-CTrp2veH.mjs} +2 -2
- package/dist/accounts/api/AccountApi.d.ts +2 -2
- package/dist/accounts/index.es.js +12 -12
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/api/BudgetsApi.d.ts +2 -2
- package/dist/budgets/index.es.js +209 -209
- package/dist/cashflow/api/CashflowApi.d.ts +3 -2
- package/dist/cashflow/index.es.js +10 -10
- package/dist/categories/index.es.js +2 -2
- package/dist/common/api/AnalyticsApi.d.ts +2 -2
- package/dist/common/api/AppDataApi.d.ts +2 -2
- package/dist/common/api/BeatApi.d.ts +2 -2
- package/dist/common/api/CategoryApi.d.ts +2 -3
- package/dist/common/api/GlobalCopyApi.d.ts +2 -1
- package/dist/common/api/LocalizedCopyApi.d.ts +2 -1
- package/dist/common/api/NotificationApi.d.ts +2 -2
- package/dist/common/api/ScheduledPaymentsApi.d.ts +3 -2
- package/dist/common/api/UserApi.d.ts +2 -2
- package/dist/common/context/GlobalDataProvider.d.ts +3 -2
- package/dist/common/context/hooks.d.ts +4 -1
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +321 -315
- package/dist/common/stores/GlobalStore.d.ts +2 -1
- package/dist/common/types/Handlers.d.ts +2 -0
- package/dist/common/types/index.d.ts +1 -0
- package/dist/common/types/localization/DebtsCopy.d.ts +0 -1
- package/dist/common/utils/Fetch.d.ts +3 -1
- package/dist/dashboard/index.es.js +2 -2
- package/dist/debts/constants/index.d.ts +4 -7
- package/dist/debts/index.es.js +459 -526
- package/dist/debts/store/DebtsUiStore.d.ts +3 -3
- package/dist/debts/utils/DebtsWidget.d.ts +2 -2
- package/dist/debts/utils/SnowballCard.d.ts +2 -2
- package/dist/debts/utils/shared.d.ts +2 -11
- package/dist/{exportTransactionsToCSV-BDlt8u0n.mjs → exportTransactionsToCSV-ct1RkLbj.mjs} +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +2 -1
- package/dist/finstrong/index.es.js +7 -7
- package/dist/goals/api/GoalApi.d.ts +3 -2
- package/dist/goals/index.es.js +11 -11
- package/dist/help/api/HelpApi.d.ts +2 -2
- package/dist/help/index.es.js +3 -3
- package/dist/hooks-DcS6DyRl.mjs +74 -0
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/api/HoldingApi.d.ts +3 -2
- package/dist/investments/index.es.js +3 -3
- package/dist/merchants/api/MerchantApi.d.ts +2 -1
- package/dist/merchants/index.es.js +2 -2
- package/dist/microinsights/context/InsightsMicroWidgetDataProvider.d.ts +2 -1
- package/dist/microinsights/context/hooks.d.ts +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +7 -7
- package/dist/notifications/index.es.js +5 -5
- package/dist/recurringtransactions/api/RepeatingTransactionsApi.d.ts +2 -2
- package/dist/recurringtransactions/index.es.js +10 -10
- package/dist/settings/api/SettingsApi.d.ts +3 -2
- package/dist/settings/index.es.js +7 -7
- package/dist/spending/index.es.js +4 -4
- package/dist/transactions/api/TransactionApi.d.ts +3 -2
- package/dist/transactions/index.es.js +14 -14
- package/dist/trends/index.es.js +10 -10
- package/dist/{useCombineEvents-DaDBSR_1.mjs → useCombineEvents-Dbjzfwvo.mjs} +29 -29
- package/package.json +1 -1
- package/dist/MerchantStore-DVH-QOf0.mjs +0 -37
- package/dist/hooks-DkUqN6JE.mjs +0 -71
package/dist/debts/index.es.js
CHANGED
|
@@ -1,167 +1,105 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as L } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import y from "react";
|
|
3
3
|
import { observer as S } from "mobx-react-lite";
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as j, Card as
|
|
6
|
-
import { Text as
|
|
7
|
-
import { intervalToDuration as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { D as M, M as Ee, I as Ie } from "../DebtsStore-VkyMADzd.mjs";
|
|
12
|
-
import { a as Nr } from "../DebtsStore-VkyMADzd.mjs";
|
|
13
|
-
import { f as P, a as Be } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
4
|
+
import f from "@mui/material/Stack";
|
|
5
|
+
import { useTheme as j, Card as me, Stack as _, Box as O } from "@mui/material";
|
|
6
|
+
import { Text as i, H3 as we, InstitutionLogo as Ce, Icon as ee } from "@mxenabled/mxui";
|
|
7
|
+
import { intervalToDuration as Se, formatDuration as De } from "date-fns";
|
|
8
|
+
import { D as $ } from "../DebtsStore-BL_0pQEd.mjs";
|
|
9
|
+
import { a as Sr } from "../DebtsStore-BL_0pQEd.mjs";
|
|
10
|
+
import { f as B, a as ve } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
14
11
|
import { f as K, D as U } from "../Dialog-CWW597AF.mjs";
|
|
15
|
-
import { G as
|
|
12
|
+
import { G as Te, x as q, u as C, j as z, e as M, c as Z, a as Ae } from "../hooks-DcS6DyRl.mjs";
|
|
16
13
|
import { u as X } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
14
|
import { D as te } from "../Drawer-kEE73B87.mjs";
|
|
18
|
-
import { b as
|
|
19
|
-
import { A as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { LineChart as
|
|
15
|
+
import { b as T } from "../Localization-2MODESHW.mjs";
|
|
16
|
+
import { A as Ee, u as Ie } from "../AccountDetailsHeader-EU_2u2Iq.mjs";
|
|
17
|
+
import Be from "@mui/material/Card";
|
|
18
|
+
import Me from "@mui/material/CardContent";
|
|
19
|
+
import ke from "@mui/material/CardHeader";
|
|
20
|
+
import { LineChart as Pe } from "@mui/x-charts";
|
|
24
21
|
import re from "@mui/material/Box";
|
|
25
|
-
import { useTheme as
|
|
26
|
-
import { A as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
22
|
+
import { useTheme as Ne } from "@mui/material/styles";
|
|
23
|
+
import { A as v, W as Re } from "../WidgetContainer-CTrp2veH.mjs";
|
|
24
|
+
import le from "@mui/material/Tab";
|
|
25
|
+
import $e from "@mui/material/Tabs";
|
|
26
|
+
import he from "@mui/material/List";
|
|
30
27
|
import W from "@mui/material/Divider";
|
|
31
|
-
import { M as
|
|
32
|
-
import
|
|
33
|
-
import { L as J } from "../ListItemAction-
|
|
34
|
-
import { C as ae } from "../CurrencyInput-
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { Error as
|
|
39
|
-
import { T as
|
|
40
|
-
import { DataGridPro as
|
|
28
|
+
import { M as Le, I as He, O as Fe } from "../OriginalBalanceAction-DDMRgIBU.mjs";
|
|
29
|
+
import Oe from "@mui/material/TextField";
|
|
30
|
+
import { L as J } from "../ListItemAction-Cwadpg85.mjs";
|
|
31
|
+
import { C as ae } from "../CurrencyInput-BtrNBP3z.mjs";
|
|
32
|
+
import se from "@mui/material/Alert";
|
|
33
|
+
import ce from "@mui/material/AlertTitle";
|
|
34
|
+
import de from "@mui/material/Paper";
|
|
35
|
+
import { Error as We, CheckCircle as ue } from "@mxenabled/mx-icons";
|
|
36
|
+
import { T as pe } from "../TabContentContainer-j01JYR_7.mjs";
|
|
37
|
+
import { DataGridPro as Ge } from "@mui/x-data-grid-pro";
|
|
41
38
|
import { H as G } from "../HeaderCell-DjuifqHJ.mjs";
|
|
42
|
-
import { f as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import { L as
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const r = o / (Ee * Ie);
|
|
51
|
-
return Math.ceil(
|
|
52
|
-
r === 0 ? a / n : -Math.log(1 - r * a / n) / Math.log(1 + r)
|
|
53
|
-
);
|
|
54
|
-
}, et = (a, o, n, r, t) => {
|
|
55
|
-
const i = [];
|
|
56
|
-
if (n === 0) {
|
|
57
|
-
for (let p = 0; p < a; p++) {
|
|
58
|
-
const d = o - r * (p + 1), h = o - r * p, m = d >= 0 ? r : h;
|
|
59
|
-
i.push({
|
|
60
|
-
balance: d >= 0 ? d : 0,
|
|
61
|
-
interest: n,
|
|
62
|
-
payment: m,
|
|
63
|
-
principal: m,
|
|
64
|
-
timestamp: ce(
|
|
65
|
-
le(
|
|
66
|
-
se(t),
|
|
67
|
-
// convert seconds → Date
|
|
68
|
-
p + 1
|
|
69
|
-
// add (index + 1) months
|
|
70
|
-
)
|
|
71
|
-
)
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return i;
|
|
75
|
-
}
|
|
76
|
-
const c = n / 1200;
|
|
77
|
-
for (let p = 0; p < a; p++) {
|
|
78
|
-
const d = ce(le(se(t), p + 1)), h = Math.pow(1 + c, p), m = o * h - r * ((h - 1) / c), y = Math.pow(1 + c, p + 1), f = o * y - r * ((y - 1) / c), D = r + Math.min(f, 0), E = m * c;
|
|
79
|
-
i.push({
|
|
80
|
-
balance: Math.max(0, f),
|
|
81
|
-
interest: E,
|
|
82
|
-
payment: D,
|
|
83
|
-
principal: D - E,
|
|
84
|
-
timestamp: d
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return i;
|
|
88
|
-
}, tt = (a) => (a[a.length - 1] || {}).timestamp, rt = (a) => {
|
|
89
|
-
const { monthly_payment: o, interest_rate: n, balance: r, payment_due_date: t } = a, i = Qe(r, n ?? 0, o ?? 0), c = et(
|
|
90
|
-
i,
|
|
91
|
-
r,
|
|
92
|
-
n ?? 0,
|
|
93
|
-
o ?? 0,
|
|
94
|
-
t
|
|
95
|
-
), p = tt(c);
|
|
96
|
-
return {
|
|
97
|
-
...a,
|
|
98
|
-
minimumFinalPayment: p,
|
|
99
|
-
minimumPayments: c
|
|
100
|
-
};
|
|
101
|
-
}, xe = (a, o) => {
|
|
102
|
-
const [n, r] = a.reduce(
|
|
103
|
-
([t, i], c) => (c.is_paid_off || c.is_impossible ? i.push({ ...c, minimumPayments: [] }) : t.push(rt(c)), [t, i]),
|
|
104
|
-
[[], []]
|
|
105
|
-
);
|
|
39
|
+
import { f as je } from "../ConnectDrawer-CU5dEdrU.mjs";
|
|
40
|
+
import be from "@mui/material/Button";
|
|
41
|
+
import ze from "@mui/material/IconButton";
|
|
42
|
+
import Xe from "@mui/material/ListItem";
|
|
43
|
+
import Ve from "@mui/material/Popover";
|
|
44
|
+
import { L as Ye } from "../Loader-DUaFpDGv.mjs";
|
|
45
|
+
const _e = (a, o) => {
|
|
46
|
+
const n = a.filter((t) => !t.is_paid_off && !t.is_impossible), r = a.filter((t) => t.is_paid_off || t.is_impossible);
|
|
106
47
|
switch (o) {
|
|
107
|
-
case
|
|
108
|
-
n.sort((t,
|
|
109
|
-
break;
|
|
110
|
-
case M.HIGHEST_INTEREST:
|
|
111
|
-
n.sort((t, i) => (i.interest_rate ?? 0) - (t.interest_rate ?? 0));
|
|
48
|
+
case $.HIGHEST_INTEREST:
|
|
49
|
+
n.sort((t, l) => (l.interest_rate ?? 0) - (t.interest_rate ?? 0));
|
|
112
50
|
break;
|
|
113
|
-
case
|
|
114
|
-
n.sort((t,
|
|
51
|
+
case $.LOWEST_BALANCE:
|
|
52
|
+
n.sort((t, l) => t.balance - l.balance);
|
|
115
53
|
break;
|
|
116
|
-
case
|
|
117
|
-
n.sort((t,
|
|
54
|
+
case $.HIGHEST_BALANCE:
|
|
55
|
+
n.sort((t, l) => l.balance - t.balance);
|
|
118
56
|
break;
|
|
119
57
|
default:
|
|
120
|
-
n.sort((t,
|
|
58
|
+
n.sort((t, l) => t.balance - l.balance);
|
|
121
59
|
}
|
|
122
60
|
a.splice(0, a.length, ...n, ...r);
|
|
123
61
|
};
|
|
124
|
-
function
|
|
125
|
-
const r = a.map((
|
|
126
|
-
(
|
|
62
|
+
function Ke(a, o, n = 0) {
|
|
63
|
+
const r = a.map((p) => ({ ...p })).filter(
|
|
64
|
+
(p) => p.interest_rate !== void 0 && p.monthly_payment !== void 0 && !p.is_paid_off
|
|
127
65
|
);
|
|
128
|
-
|
|
129
|
-
let t = 0,
|
|
130
|
-
const
|
|
131
|
-
for (; r.some((
|
|
132
|
-
let
|
|
133
|
-
for (const [
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
let u =
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
|
|
66
|
+
_e(r, o);
|
|
67
|
+
let t = 0, l = 0;
|
|
68
|
+
const d = /* @__PURE__ */ new Date(), m = /* @__PURE__ */ new Date();
|
|
69
|
+
for (; r.some((p) => p.balance >= 0.01 && !p.is_impossible); ) {
|
|
70
|
+
let p = !1;
|
|
71
|
+
for (const [g, x] of r.entries()) {
|
|
72
|
+
if (x.balance <= 0.01 || x.is_impossible) continue;
|
|
73
|
+
const k = (x.interest_rate ?? 0) / 100 / 12, D = x.balance * k;
|
|
74
|
+
let u = x.monthly_payment ?? 0;
|
|
75
|
+
g === 0 && n && (u += n), x.balance += D;
|
|
76
|
+
const A = Math.min(x.balance, u + l);
|
|
77
|
+
if (A <= D) {
|
|
78
|
+
x.is_impossible = !0;
|
|
141
79
|
continue;
|
|
142
80
|
}
|
|
143
|
-
|
|
81
|
+
x.balance -= A, x.balance = x.balance < 0.01 ? 0 : x.balance, t += D, x.balance <= 0 && (l += u), A > 0 && (p = !0);
|
|
144
82
|
}
|
|
145
|
-
|
|
83
|
+
p && m.setMonth(m.getMonth() + 1);
|
|
146
84
|
}
|
|
147
|
-
const
|
|
85
|
+
const c = r.some((p) => p.is_impossible && p.balance > 0), h = Se({ start: d, end: m });
|
|
148
86
|
return {
|
|
149
|
-
payoffSavings:
|
|
150
|
-
payoffDate:
|
|
151
|
-
payoffDuration:
|
|
87
|
+
payoffSavings: c ? "N/A" : B(t, "0,0.00"),
|
|
88
|
+
payoffDate: c ? "Never" : K(m, U.MONTH_YEAR),
|
|
89
|
+
payoffDuration: c ? "Stagnant" : De(h, { format: ["years", "months"] }) || "0 months"
|
|
152
90
|
};
|
|
153
91
|
}
|
|
154
92
|
const R = () => {
|
|
155
|
-
if (!
|
|
93
|
+
if (!y.useContext(Te))
|
|
156
94
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
157
95
|
return q().uiStore;
|
|
158
|
-
},
|
|
159
|
-
const r = j(), { isMobile: t } = X(), { debts:
|
|
160
|
-
const
|
|
161
|
-
return
|
|
162
|
-
}, [a,
|
|
96
|
+
}, Ue = ({ debts: a, onClickCta: o, sx: n }) => {
|
|
97
|
+
const r = j(), { isMobile: t } = X(), { debts: l } = C(), { selectedDebtPriority: d } = R(), { monthlyCashFlowProfile: m } = z(), { payoffDate: c, payoffSavings: h, payoffDuration: p } = y.useMemo(() => {
|
|
98
|
+
const g = m?.extra_payment ?? 0;
|
|
99
|
+
return Ke(a, d, g);
|
|
100
|
+
}, [a, d, m]);
|
|
163
101
|
return /* @__PURE__ */ e(
|
|
164
|
-
|
|
102
|
+
me,
|
|
165
103
|
{
|
|
166
104
|
sx: {
|
|
167
105
|
boxShadow: r.shadows[2],
|
|
@@ -180,35 +118,35 @@ const R = () => {
|
|
|
180
118
|
pb: "8px"
|
|
181
119
|
},
|
|
182
120
|
children: [
|
|
183
|
-
/* @__PURE__ */ e(
|
|
184
|
-
/* @__PURE__ */ e(
|
|
121
|
+
/* @__PURE__ */ e(i, { variant: "XSmall", children: l.snowball_card_date_description }),
|
|
122
|
+
/* @__PURE__ */ e(i, { bold: !0, color: r.palette.primary.main, variant: "Small", children: c })
|
|
185
123
|
]
|
|
186
124
|
}
|
|
187
125
|
),
|
|
188
126
|
/* @__PURE__ */ s(_, { gap: t ? "4px" : "0", children: [
|
|
189
|
-
/* @__PURE__ */ e(
|
|
190
|
-
/* @__PURE__ */ e(
|
|
127
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Small", children: h }),
|
|
128
|
+
/* @__PURE__ */ e(i, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: l.snowball_card_amount_description })
|
|
191
129
|
] }),
|
|
192
130
|
/* @__PURE__ */ s(_, { gap: t ? "4px" : "0", children: [
|
|
193
|
-
/* @__PURE__ */ e(
|
|
194
|
-
/* @__PURE__ */ e(
|
|
131
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Small", children: p }),
|
|
132
|
+
/* @__PURE__ */ e(i, { variant: "XSmall", children: l.snowball_card_duration_description })
|
|
195
133
|
] }),
|
|
196
134
|
/* @__PURE__ */ e(
|
|
197
|
-
|
|
135
|
+
i,
|
|
198
136
|
{
|
|
199
137
|
bold: !0,
|
|
200
138
|
color: r.palette.primary.main,
|
|
201
139
|
onClick: o,
|
|
202
140
|
sx: { cursor: "pointer" },
|
|
203
141
|
variant: "Small",
|
|
204
|
-
children:
|
|
142
|
+
children: l.snowball_card_cta
|
|
205
143
|
}
|
|
206
144
|
)
|
|
207
145
|
] })
|
|
208
146
|
}
|
|
209
147
|
);
|
|
210
|
-
},
|
|
211
|
-
const r = j(), { debts: t } = C(), [
|
|
148
|
+
}, qe = S(Ue), Ze = ({ isOpen: a, onClose: o, sx: n }) => {
|
|
149
|
+
const r = j(), { debts: t } = C(), [l, d] = y.useState(!1);
|
|
212
150
|
return /* @__PURE__ */ e(
|
|
213
151
|
te,
|
|
214
152
|
{
|
|
@@ -220,39 +158,39 @@ const R = () => {
|
|
|
220
158
|
children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
|
|
221
159
|
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
222
160
|
/* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
|
|
223
|
-
/* @__PURE__ */ e(
|
|
224
|
-
/* @__PURE__ */ e(
|
|
225
|
-
/* @__PURE__ */ e(
|
|
226
|
-
/* @__PURE__ */ e(
|
|
161
|
+
/* @__PURE__ */ e(i, { mb: 12, variant: "H3", children: t.snowball_drawer_subtitle }),
|
|
162
|
+
/* @__PURE__ */ e(i, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_amount_description }),
|
|
163
|
+
/* @__PURE__ */ e(i, { variant: "H1", children: t.snowball_drawer_savings }),
|
|
164
|
+
/* @__PURE__ */ e(i, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
|
|
227
165
|
] }),
|
|
228
|
-
/* @__PURE__ */ s(
|
|
229
|
-
/* @__PURE__ */ e(
|
|
166
|
+
/* @__PURE__ */ s(me, { sx: { display: "grid", py: 16, px: 24 }, children: [
|
|
167
|
+
/* @__PURE__ */ e(i, { mb: 4, variant: "H3", children: t.snowball_drawer_question }),
|
|
230
168
|
/* @__PURE__ */ e(
|
|
231
|
-
|
|
169
|
+
i,
|
|
232
170
|
{
|
|
233
171
|
color: r.palette.secondary.main,
|
|
234
172
|
mb: 8,
|
|
235
|
-
sx: { whiteSpace:
|
|
173
|
+
sx: { whiteSpace: l ? "normal" : "nowrap" },
|
|
236
174
|
variant: "ParagraphSmall",
|
|
237
175
|
children: t.snowball_drawer_answer
|
|
238
176
|
}
|
|
239
177
|
),
|
|
240
178
|
/* @__PURE__ */ e(
|
|
241
|
-
|
|
179
|
+
i,
|
|
242
180
|
{
|
|
243
181
|
bold: !0,
|
|
244
182
|
color: r.palette.primary.main,
|
|
245
|
-
onClick: () =>
|
|
183
|
+
onClick: () => d(!l),
|
|
246
184
|
sx: { cursor: "pointer" },
|
|
247
185
|
variant: "Small",
|
|
248
|
-
children:
|
|
186
|
+
children: l ? t.snowball_drawer_less : t.snowball_drawer_more
|
|
249
187
|
}
|
|
250
188
|
)
|
|
251
189
|
] })
|
|
252
190
|
] }),
|
|
253
191
|
/* @__PURE__ */ s(_, { children: [
|
|
254
192
|
/* @__PURE__ */ e(
|
|
255
|
-
|
|
193
|
+
i,
|
|
256
194
|
{
|
|
257
195
|
color: r.palette.secondary.main,
|
|
258
196
|
px: 24,
|
|
@@ -262,8 +200,8 @@ const R = () => {
|
|
|
262
200
|
}
|
|
263
201
|
),
|
|
264
202
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
265
|
-
/* @__PURE__ */ e(
|
|
266
|
-
/* @__PURE__ */ e(
|
|
203
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: T(t.snowball_drawer_month_header, 1) }),
|
|
204
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
267
205
|
] }),
|
|
268
206
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
269
207
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -280,7 +218,7 @@ const R = () => {
|
|
|
280
218
|
backgroundColor: r.palette.success.main,
|
|
281
219
|
marginRight: 12
|
|
282
220
|
},
|
|
283
|
-
children: /* @__PURE__ */ e(
|
|
221
|
+
children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "Small", children: "✓" })
|
|
284
222
|
}
|
|
285
223
|
),
|
|
286
224
|
/* @__PURE__ */ s(
|
|
@@ -295,20 +233,20 @@ const R = () => {
|
|
|
295
233
|
},
|
|
296
234
|
children: [
|
|
297
235
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
298
|
-
/* @__PURE__ */ e(
|
|
299
|
-
/* @__PURE__ */ s(
|
|
300
|
-
|
|
236
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: T(t.snowball_drawer_debt_label, "A") }),
|
|
237
|
+
/* @__PURE__ */ s(i, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
238
|
+
T(
|
|
301
239
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
302
240
|
"$100"
|
|
303
241
|
),
|
|
304
|
-
/* @__PURE__ */ e("strong", { children:
|
|
242
|
+
/* @__PURE__ */ e("strong", { children: T(t.snowball_drawer_debt_label, "B") }),
|
|
305
243
|
t.snowball_drawer_rollover_explainer_pt2
|
|
306
244
|
] })
|
|
307
245
|
] }),
|
|
308
246
|
/* @__PURE__ */ s(_, { children: [
|
|
309
|
-
/* @__PURE__ */ e(
|
|
247
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: "$100.00" }),
|
|
310
248
|
/* @__PURE__ */ e(
|
|
311
|
-
|
|
249
|
+
i,
|
|
312
250
|
{
|
|
313
251
|
bold: !0,
|
|
314
252
|
color: r.palette.success.main,
|
|
@@ -346,8 +284,8 @@ const R = () => {
|
|
|
346
284
|
pr: 24
|
|
347
285
|
},
|
|
348
286
|
children: [
|
|
349
|
-
/* @__PURE__ */ e(
|
|
350
|
-
/* @__PURE__ */ e(
|
|
287
|
+
/* @__PURE__ */ e(i, { flexGrow: 1, variant: "Body", children: T(t.snowball_drawer_debt_label, "B") }),
|
|
288
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: "$400.00" })
|
|
351
289
|
]
|
|
352
290
|
}
|
|
353
291
|
)
|
|
@@ -366,8 +304,8 @@ const R = () => {
|
|
|
366
304
|
}
|
|
367
305
|
),
|
|
368
306
|
/* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
|
|
369
|
-
/* @__PURE__ */ e(
|
|
370
|
-
/* @__PURE__ */ e(
|
|
307
|
+
/* @__PURE__ */ e(i, { flexGrow: 1, variant: "Body", children: T(t.snowball_drawer_debt_label, "C") }),
|
|
308
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: "$1,000.00" })
|
|
371
309
|
] })
|
|
372
310
|
] }),
|
|
373
311
|
/* @__PURE__ */ s(
|
|
@@ -382,15 +320,15 @@ const R = () => {
|
|
|
382
320
|
borderBottom: `1px solid ${r.palette.border.light}`
|
|
383
321
|
},
|
|
384
322
|
children: [
|
|
385
|
-
/* @__PURE__ */ e(
|
|
386
|
-
/* @__PURE__ */ e(
|
|
323
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: t.snowball_drawer_total_label }),
|
|
324
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: "$1,500.00" })
|
|
387
325
|
]
|
|
388
326
|
}
|
|
389
327
|
)
|
|
390
328
|
] }),
|
|
391
329
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
392
|
-
/* @__PURE__ */ e(
|
|
393
|
-
/* @__PURE__ */ e(
|
|
330
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: T(t.snowball_drawer_month_header, 2) }),
|
|
331
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
394
332
|
] }),
|
|
395
333
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
396
334
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -407,7 +345,7 @@ const R = () => {
|
|
|
407
345
|
backgroundColor: r.palette.success.main,
|
|
408
346
|
marginRight: 12
|
|
409
347
|
},
|
|
410
|
-
children: /* @__PURE__ */ e(
|
|
348
|
+
children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "Small", children: "✓" })
|
|
411
349
|
}
|
|
412
350
|
),
|
|
413
351
|
/* @__PURE__ */ s(
|
|
@@ -422,20 +360,20 @@ const R = () => {
|
|
|
422
360
|
},
|
|
423
361
|
children: [
|
|
424
362
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
425
|
-
/* @__PURE__ */ e(
|
|
426
|
-
/* @__PURE__ */ s(
|
|
427
|
-
|
|
363
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: T(t.snowball_drawer_debt_label, "B") }),
|
|
364
|
+
/* @__PURE__ */ s(i, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
365
|
+
T(
|
|
428
366
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
429
367
|
"$500"
|
|
430
368
|
),
|
|
431
|
-
/* @__PURE__ */ e("strong", { children:
|
|
369
|
+
/* @__PURE__ */ e("strong", { children: T(t.snowball_drawer_debt_label, "C") }),
|
|
432
370
|
t.snowball_drawer_rollover_explainer_pt2
|
|
433
371
|
] })
|
|
434
372
|
] }),
|
|
435
373
|
/* @__PURE__ */ s(_, { children: [
|
|
436
|
-
/* @__PURE__ */ e(
|
|
374
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: "$500.00" }),
|
|
437
375
|
/* @__PURE__ */ e(
|
|
438
|
-
|
|
376
|
+
i,
|
|
439
377
|
{
|
|
440
378
|
bold: !0,
|
|
441
379
|
color: r.palette.success.main,
|
|
@@ -472,8 +410,8 @@ const R = () => {
|
|
|
472
410
|
pr: 24
|
|
473
411
|
},
|
|
474
412
|
children: [
|
|
475
|
-
/* @__PURE__ */ e(
|
|
476
|
-
/* @__PURE__ */ e(
|
|
413
|
+
/* @__PURE__ */ e(i, { flexGrow: 1, variant: "Body", children: T(t.snowball_drawer_debt_label, "C") }),
|
|
414
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: "$1,000.00" })
|
|
477
415
|
]
|
|
478
416
|
}
|
|
479
417
|
)
|
|
@@ -490,15 +428,15 @@ const R = () => {
|
|
|
490
428
|
borderBottom: `1px solid ${r.palette.border.light}`
|
|
491
429
|
},
|
|
492
430
|
children: [
|
|
493
|
-
/* @__PURE__ */ e(
|
|
494
|
-
/* @__PURE__ */ e(
|
|
431
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: t.snowball_drawer_total_label }),
|
|
432
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: "$1,500.00" })
|
|
495
433
|
]
|
|
496
434
|
}
|
|
497
435
|
)
|
|
498
436
|
] }),
|
|
499
437
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
500
|
-
/* @__PURE__ */ e(
|
|
501
|
-
/* @__PURE__ */ e(
|
|
438
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: T(t.snowball_drawer_month_header, 3) }),
|
|
439
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
502
440
|
] }),
|
|
503
441
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
504
442
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -515,7 +453,7 @@ const R = () => {
|
|
|
515
453
|
backgroundColor: r.palette.success.main,
|
|
516
454
|
marginRight: 12
|
|
517
455
|
},
|
|
518
|
-
children: /* @__PURE__ */ e(
|
|
456
|
+
children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "Small", children: "✓" })
|
|
519
457
|
}
|
|
520
458
|
),
|
|
521
459
|
/* @__PURE__ */ s(
|
|
@@ -529,11 +467,11 @@ const R = () => {
|
|
|
529
467
|
pr: 24
|
|
530
468
|
},
|
|
531
469
|
children: [
|
|
532
|
-
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(
|
|
470
|
+
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(i, { variant: "Body", children: T(t.snowball_drawer_debt_label, "C") }) }),
|
|
533
471
|
/* @__PURE__ */ s(_, { children: [
|
|
534
|
-
/* @__PURE__ */ e(
|
|
472
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: "$1,500.00" }),
|
|
535
473
|
/* @__PURE__ */ e(
|
|
536
|
-
|
|
474
|
+
i,
|
|
537
475
|
{
|
|
538
476
|
bold: !0,
|
|
539
477
|
color: r.palette.success.main,
|
|
@@ -559,8 +497,8 @@ const R = () => {
|
|
|
559
497
|
borderBottom: `1px solid ${r.palette.border.light}`
|
|
560
498
|
},
|
|
561
499
|
children: [
|
|
562
|
-
/* @__PURE__ */ e(
|
|
563
|
-
/* @__PURE__ */ e(
|
|
500
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: t.snowball_drawer_total_label }),
|
|
501
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: "$1,500.00" })
|
|
564
502
|
]
|
|
565
503
|
}
|
|
566
504
|
)
|
|
@@ -569,50 +507,50 @@ const R = () => {
|
|
|
569
507
|
] })
|
|
570
508
|
}
|
|
571
509
|
);
|
|
572
|
-
},
|
|
573
|
-
function
|
|
574
|
-
const [n, r, t] = a.replace(/^#/, "").match(/.{1,2}/g).map((
|
|
510
|
+
}, Je = S(Ze), Qe = "#FF7B08";
|
|
511
|
+
function et(a, o) {
|
|
512
|
+
const [n, r, t] = a.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), l = [
|
|
575
513
|
Math.max(0, Math.min(255, Math.round(n * o))),
|
|
576
514
|
Math.max(0, Math.min(255, Math.round(r * o))),
|
|
577
515
|
Math.max(0, Math.min(255, Math.round(t * o)))
|
|
578
516
|
];
|
|
579
|
-
return `rgb(${
|
|
517
|
+
return `rgb(${l[0]}, ${l[1]}, ${l[2]})`;
|
|
580
518
|
}
|
|
581
|
-
const
|
|
519
|
+
const ye = ({
|
|
582
520
|
sx: a,
|
|
583
521
|
height: o = 500,
|
|
584
522
|
width: n,
|
|
585
523
|
debts: r,
|
|
586
524
|
hoveredDebtGuid: t,
|
|
587
|
-
onClickArea:
|
|
588
|
-
onHoverArea:
|
|
525
|
+
onClickArea: l,
|
|
526
|
+
onHoverArea: d
|
|
589
527
|
}) => {
|
|
590
|
-
const
|
|
528
|
+
const m = Ne(), { onEvent: c } = M(), h = r.filter((b) => !b.is_impossible), p = [
|
|
591
529
|
...new Set(
|
|
592
530
|
h.flatMap((b) => b.dataset.map((w) => new Date(w.x).getTime()))
|
|
593
531
|
)
|
|
594
|
-
].sort((b, w) => b - w).map((b) => new Date(b)),
|
|
532
|
+
].sort((b, w) => b - w).map((b) => new Date(b)), g = h.map((b) => {
|
|
595
533
|
const w = new Map(b.dataset.map((N) => [new Date(N.x).getTime(), N.y]));
|
|
596
|
-
let
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
return
|
|
534
|
+
let I = w.get(p[0].getTime()) ?? 0;
|
|
535
|
+
const P = p.map((N) => {
|
|
536
|
+
const H = w.get(N.getTime()) ?? I;
|
|
537
|
+
return I = H, { x: N, y: H };
|
|
600
538
|
});
|
|
601
|
-
return { ...b, dataset:
|
|
602
|
-
}),
|
|
539
|
+
return { ...b, dataset: P };
|
|
540
|
+
}), x = g.reduce(
|
|
603
541
|
(b, w) => b + (w.dataset[0]?.y ?? 0),
|
|
604
542
|
0
|
|
605
|
-
),
|
|
606
|
-
const
|
|
607
|
-
return { x: b, y:
|
|
608
|
-
}),
|
|
609
|
-
const
|
|
543
|
+
), E = p.map((b, w) => {
|
|
544
|
+
const I = w / (p.length - 1), P = x * (1 - I);
|
|
545
|
+
return { x: b, y: P };
|
|
546
|
+
}), k = Math.ceil(x / 100) * 100, D = p, u = g.map((b, w) => {
|
|
547
|
+
const I = 1 - w / g.length * 0.5, P = et(Qe, I);
|
|
610
548
|
return {
|
|
611
549
|
id: `debt-${w}`,
|
|
612
550
|
guid: b.guid,
|
|
613
551
|
label: b.name,
|
|
614
552
|
data: b.dataset.map((N) => N.y),
|
|
615
|
-
color:
|
|
553
|
+
color: P,
|
|
616
554
|
curve: "linear",
|
|
617
555
|
type: "line",
|
|
618
556
|
area: !0,
|
|
@@ -623,15 +561,15 @@ const ge = ({
|
|
|
623
561
|
u.push({
|
|
624
562
|
id: "payoff-line",
|
|
625
563
|
label: "Payoff Line",
|
|
626
|
-
data:
|
|
627
|
-
color:
|
|
564
|
+
data: E.map((b) => b.y),
|
|
565
|
+
color: m.palette.grey[700],
|
|
628
566
|
curve: "linear",
|
|
629
567
|
type: "line",
|
|
630
568
|
stack: void 0,
|
|
631
569
|
showMark: !1,
|
|
632
570
|
disableHighlight: !0
|
|
633
571
|
});
|
|
634
|
-
const
|
|
572
|
+
const A = (b) => u.findIndex((w) => w?.guid === b);
|
|
635
573
|
return /* @__PURE__ */ e(
|
|
636
574
|
re,
|
|
637
575
|
{
|
|
@@ -648,19 +586,19 @@ const ge = ({
|
|
|
648
586
|
}
|
|
649
587
|
},
|
|
650
588
|
children: /* @__PURE__ */ e(
|
|
651
|
-
|
|
589
|
+
Pe,
|
|
652
590
|
{
|
|
653
591
|
axisHighlight: { x: "none" },
|
|
654
592
|
disableLineItemHighlight: !0,
|
|
655
593
|
height: o,
|
|
656
594
|
onAreaClick: (b, w) => {
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
|
|
595
|
+
l?.();
|
|
596
|
+
const I = u.find((P) => P.id === w.seriesId);
|
|
597
|
+
c(v.DEBTS_CLICK_CHART_AREA, { account_guid: I?.guid });
|
|
660
598
|
},
|
|
661
599
|
onHighlightChange: (b) => {
|
|
662
|
-
const w = u.find((
|
|
663
|
-
|
|
600
|
+
const w = u.find((I) => I.id === b?.seriesId)?.guid;
|
|
601
|
+
d?.(w ?? "");
|
|
664
602
|
},
|
|
665
603
|
series: u,
|
|
666
604
|
skipAnimation: !0,
|
|
@@ -686,10 +624,10 @@ const ge = ({
|
|
|
686
624
|
strokeDasharray: "10 5",
|
|
687
625
|
strokeWidth: 1
|
|
688
626
|
},
|
|
689
|
-
[`& .MuiLineElement-series-debt-${
|
|
627
|
+
[`& .MuiLineElement-series-debt-${A(t ?? "0")}`]: {
|
|
690
628
|
opacity: 1
|
|
691
629
|
},
|
|
692
|
-
[`& .MuiAreaElement-series-debt-${
|
|
630
|
+
[`& .MuiAreaElement-series-debt-${A(t ?? "0")}`]: {
|
|
693
631
|
opacity: 1
|
|
694
632
|
},
|
|
695
633
|
...a
|
|
@@ -698,9 +636,9 @@ const ge = ({
|
|
|
698
636
|
width: n,
|
|
699
637
|
xAxis: [
|
|
700
638
|
{
|
|
701
|
-
data:
|
|
639
|
+
data: D,
|
|
702
640
|
scaleType: "time",
|
|
703
|
-
min:
|
|
641
|
+
min: p[0],
|
|
704
642
|
disableTicks: !0,
|
|
705
643
|
valueFormatter: (b) => K(b, U.MONTH_SHORT_YEAR)
|
|
706
644
|
}
|
|
@@ -708,20 +646,20 @@ const ge = ({
|
|
|
708
646
|
yAxis: [
|
|
709
647
|
{
|
|
710
648
|
min: 0,
|
|
711
|
-
max:
|
|
649
|
+
max: k,
|
|
712
650
|
disableTicks: !0,
|
|
713
|
-
valueFormatter: (b) =>
|
|
651
|
+
valueFormatter: (b) => B(b, "0a")
|
|
714
652
|
}
|
|
715
653
|
]
|
|
716
654
|
}
|
|
717
655
|
)
|
|
718
656
|
}
|
|
719
657
|
);
|
|
720
|
-
},
|
|
658
|
+
}, tt = () => {
|
|
721
659
|
const a = j(), { debts: o } = C(), { selectedDebtChartData: n } = R();
|
|
722
660
|
return /* @__PURE__ */ s(L, { children: [
|
|
723
661
|
/* @__PURE__ */ s(
|
|
724
|
-
|
|
662
|
+
Be,
|
|
725
663
|
{
|
|
726
664
|
sx: {
|
|
727
665
|
"& .MuiCardContent-root:last-child": {
|
|
@@ -729,13 +667,13 @@ const ge = ({
|
|
|
729
667
|
}
|
|
730
668
|
},
|
|
731
669
|
children: [
|
|
732
|
-
/* @__PURE__ */ e(
|
|
733
|
-
/* @__PURE__ */ e(
|
|
670
|
+
/* @__PURE__ */ e(ke, { sx: { pb: 0 }, title: /* @__PURE__ */ e(we, { sx: { pb: 4 }, children: o.details_chart_title }) }),
|
|
671
|
+
/* @__PURE__ */ e(Me, { sx: { p: 0 }, children: /* @__PURE__ */ e(ye, { debts: [n], height: 250 }) })
|
|
734
672
|
]
|
|
735
673
|
}
|
|
736
674
|
),
|
|
737
675
|
/* @__PURE__ */ e(
|
|
738
|
-
|
|
676
|
+
i,
|
|
739
677
|
{
|
|
740
678
|
color: a.palette.text.secondary,
|
|
741
679
|
sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
|
|
@@ -744,24 +682,24 @@ const ge = ({
|
|
|
744
682
|
}
|
|
745
683
|
)
|
|
746
684
|
] });
|
|
747
|
-
},
|
|
748
|
-
const a = j(), { onEvent: o } =
|
|
749
|
-
return
|
|
750
|
-
|
|
685
|
+
}, rt = S(tt), at = () => {
|
|
686
|
+
const a = j(), { onEvent: o } = M(), { debts: n } = C(), { selectedDebtChartData: r, showCompleted: t, showError: l } = R();
|
|
687
|
+
return y.useEffect(() => o(v.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(he, { children: l || t ? /* @__PURE__ */ e(
|
|
688
|
+
i,
|
|
751
689
|
{
|
|
752
690
|
color: a.palette.secondary.main,
|
|
753
691
|
component: "div",
|
|
754
692
|
sx: { p: 32, textAlign: "center", whiteSpace: "normal" },
|
|
755
693
|
variant: "Small",
|
|
756
|
-
children:
|
|
694
|
+
children: l ? n.schedule_error_message : n.schedule_complete_message
|
|
757
695
|
}
|
|
758
696
|
) : /* @__PURE__ */ s(L, { children: [
|
|
759
|
-
/* @__PURE__ */ s(
|
|
760
|
-
/* @__PURE__ */ e(
|
|
761
|
-
/* @__PURE__ */ e(
|
|
697
|
+
/* @__PURE__ */ s(f, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
698
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: n.schedule_month_heading }),
|
|
699
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "XSmall", children: n.schedule_amount_heading })
|
|
762
700
|
] }),
|
|
763
|
-
r.dataset.slice(1).map(({ x:
|
|
764
|
-
|
|
701
|
+
r.dataset.slice(1).map(({ x: d, y: m, payment: c }) => /* @__PURE__ */ e(f, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(f, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
702
|
+
f,
|
|
765
703
|
{
|
|
766
704
|
sx: {
|
|
767
705
|
borderBottom: `1px solid ${a.palette.border.light}`,
|
|
@@ -771,28 +709,28 @@ const ge = ({
|
|
|
771
709
|
pr: 24
|
|
772
710
|
},
|
|
773
711
|
children: [
|
|
774
|
-
/* @__PURE__ */ s(
|
|
775
|
-
/* @__PURE__ */ e(
|
|
776
|
-
/* @__PURE__ */ e(
|
|
712
|
+
/* @__PURE__ */ s(f, { flexGrow: 1, children: [
|
|
713
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: K(d, U.MONTH_YEAR) }),
|
|
714
|
+
/* @__PURE__ */ e(i, { color: a.palette.secondary.main, variant: "XSmall", children: n.schedule_month_label })
|
|
777
715
|
] }),
|
|
778
|
-
/* @__PURE__ */ s(
|
|
779
|
-
/* @__PURE__ */ e(
|
|
716
|
+
/* @__PURE__ */ s(f, { children: [
|
|
717
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "Body", children: B(m, "0,0.00") }),
|
|
780
718
|
/* @__PURE__ */ e(
|
|
781
|
-
|
|
719
|
+
i,
|
|
782
720
|
{
|
|
783
721
|
bold: !0,
|
|
784
722
|
color: a.palette.success.main,
|
|
785
723
|
textAlign: "end",
|
|
786
724
|
variant: "Tiny",
|
|
787
|
-
children: `+${
|
|
725
|
+
children: `+${B(c, "0,0")}`
|
|
788
726
|
}
|
|
789
727
|
)
|
|
790
728
|
] })
|
|
791
729
|
]
|
|
792
730
|
}
|
|
793
|
-
) }) }, String(
|
|
794
|
-
/* @__PURE__ */ e(
|
|
795
|
-
|
|
731
|
+
) }) }, String(d))),
|
|
732
|
+
/* @__PURE__ */ e(f, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
733
|
+
f,
|
|
796
734
|
{
|
|
797
735
|
sx: {
|
|
798
736
|
alignItems: "center",
|
|
@@ -802,135 +740,135 @@ const ge = ({
|
|
|
802
740
|
px: 24
|
|
803
741
|
},
|
|
804
742
|
children: [
|
|
805
|
-
/* @__PURE__ */ e(
|
|
806
|
-
/* @__PURE__ */ e(
|
|
743
|
+
/* @__PURE__ */ e(i, { flexGrow: 1, variant: "Body", children: n.schedule_payoff_label }),
|
|
744
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: "-" })
|
|
807
745
|
]
|
|
808
746
|
}
|
|
809
747
|
) })
|
|
810
748
|
] }) });
|
|
811
|
-
},
|
|
812
|
-
const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } =
|
|
813
|
-
await n({ ...a.account, interest_rate: t }), a.interest_rate = t, r(
|
|
814
|
-
},
|
|
749
|
+
}, ot = S(at), nt = S(({ debt: a }) => {
|
|
750
|
+
const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } = M(), [t, l] = y.useState(a.interest_rate ?? 0), d = t < 0, m = async () => {
|
|
751
|
+
await n({ ...a.account, interest_rate: t }), a.interest_rate = t, r(v.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
|
752
|
+
}, c = () => {
|
|
815
753
|
setTimeout(() => {
|
|
816
|
-
|
|
754
|
+
l(a.interest_rate ?? 0);
|
|
817
755
|
}, 250);
|
|
818
756
|
};
|
|
819
757
|
return /* @__PURE__ */ e(
|
|
820
758
|
J,
|
|
821
759
|
{
|
|
822
|
-
isSaveDisabled:
|
|
760
|
+
isSaveDisabled: d,
|
|
823
761
|
label: `${o.details_interest_rate} (%)`,
|
|
824
|
-
onCancel:
|
|
825
|
-
onSave:
|
|
762
|
+
onCancel: c,
|
|
763
|
+
onSave: m,
|
|
826
764
|
primaryText: o.details_interest_rate,
|
|
827
|
-
secondaryText:
|
|
765
|
+
secondaryText: ve(Number(a.interest_rate) / 100),
|
|
828
766
|
zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
|
|
829
767
|
children: /* @__PURE__ */ e(
|
|
830
|
-
|
|
768
|
+
Oe,
|
|
831
769
|
{
|
|
832
|
-
error:
|
|
770
|
+
error: d,
|
|
833
771
|
fullWidth: !0,
|
|
834
|
-
onChange: (h) =>
|
|
772
|
+
onChange: (h) => l(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
|
|
835
773
|
type: "number",
|
|
836
774
|
value: t
|
|
837
775
|
}
|
|
838
776
|
)
|
|
839
777
|
}
|
|
840
778
|
);
|
|
841
|
-
}),
|
|
842
|
-
const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } =
|
|
843
|
-
await n({ ...a.account, minimum_payment: t }), a.monthly_payment = t, r(
|
|
844
|
-
},
|
|
779
|
+
}), it = S(({ debt: a }) => {
|
|
780
|
+
const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } = M(), [t, l] = y.useState(a.monthly_payment ?? 0), d = t < 0 || t > 9999999999e-2, m = async () => {
|
|
781
|
+
await n({ ...a.account, minimum_payment: t }), a.monthly_payment = t, r(v.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
|
782
|
+
}, c = () => {
|
|
845
783
|
setTimeout(() => {
|
|
846
|
-
|
|
784
|
+
l(a.monthly_payment ?? 0);
|
|
847
785
|
}, 250);
|
|
848
786
|
};
|
|
849
787
|
return /* @__PURE__ */ e(
|
|
850
788
|
J,
|
|
851
789
|
{
|
|
852
|
-
isSaveDisabled:
|
|
790
|
+
isSaveDisabled: d,
|
|
853
791
|
label: o.details_monthly_payment,
|
|
854
|
-
onCancel:
|
|
855
|
-
onSave:
|
|
792
|
+
onCancel: c,
|
|
793
|
+
onSave: m,
|
|
856
794
|
primaryText: o.details_monthly_payment,
|
|
857
|
-
secondaryText:
|
|
795
|
+
secondaryText: B(a.monthly_payment, "0,0"),
|
|
858
796
|
zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
|
|
859
797
|
children: /* @__PURE__ */ e(
|
|
860
798
|
ae,
|
|
861
799
|
{
|
|
862
800
|
amount: t,
|
|
863
801
|
autoFocus: !0,
|
|
864
|
-
error:
|
|
802
|
+
error: d,
|
|
865
803
|
fullWidth: !0,
|
|
866
804
|
minAmount: 0,
|
|
867
|
-
setAmount: (h) =>
|
|
805
|
+
setAmount: (h) => l(isNaN(Number(h)) ? t : Number(h)),
|
|
868
806
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
869
807
|
}
|
|
870
808
|
)
|
|
871
809
|
}
|
|
872
810
|
);
|
|
873
|
-
}),
|
|
874
|
-
const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } =
|
|
875
|
-
await n({ ...a.account, original_balance: t }), a.original_balance = t, r(
|
|
876
|
-
},
|
|
811
|
+
}), lt = S(({ debt: a }) => {
|
|
812
|
+
const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } = M(), [t, l] = y.useState(a.original_balance ?? 0), d = t < 0 || t > 9999999999e-2, m = async () => {
|
|
813
|
+
await n({ ...a.account, original_balance: t }), a.original_balance = t, r(v.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
|
814
|
+
}, c = () => {
|
|
877
815
|
setTimeout(() => {
|
|
878
|
-
|
|
816
|
+
l(a.original_balance ?? 0);
|
|
879
817
|
}, 250);
|
|
880
818
|
};
|
|
881
819
|
return /* @__PURE__ */ e(
|
|
882
820
|
J,
|
|
883
821
|
{
|
|
884
|
-
isSaveDisabled:
|
|
822
|
+
isSaveDisabled: d,
|
|
885
823
|
label: o.details_original_balance,
|
|
886
|
-
onCancel:
|
|
887
|
-
onSave:
|
|
824
|
+
onCancel: c,
|
|
825
|
+
onSave: m,
|
|
888
826
|
primaryText: o.details_original_balance,
|
|
889
|
-
secondaryText:
|
|
827
|
+
secondaryText: B(a.original_balance, "0,0"),
|
|
890
828
|
zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
|
|
891
829
|
children: /* @__PURE__ */ e(
|
|
892
830
|
ae,
|
|
893
831
|
{
|
|
894
832
|
amount: t,
|
|
895
833
|
autoFocus: !0,
|
|
896
|
-
error:
|
|
834
|
+
error: d,
|
|
897
835
|
fullWidth: !0,
|
|
898
836
|
minAmount: 0,
|
|
899
|
-
setAmount: (h) =>
|
|
837
|
+
setAmount: (h) => l(isNaN(Number(h)) ? t : Number(h)),
|
|
900
838
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
901
839
|
}
|
|
902
840
|
)
|
|
903
841
|
}
|
|
904
842
|
);
|
|
905
|
-
}),
|
|
906
|
-
const { onEvent: a } =
|
|
907
|
-
return
|
|
843
|
+
}), st = () => {
|
|
844
|
+
const { onEvent: a } = M(), { selectedDebtChartData: o } = R();
|
|
845
|
+
return y.useEffect(() => a(v.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(f, { bgcolor: "background.paper", children: [
|
|
908
846
|
o?.goal && /* @__PURE__ */ s(L, { children: [
|
|
909
|
-
/* @__PURE__ */ e(
|
|
847
|
+
/* @__PURE__ */ e(Le, { goal: o.goal }),
|
|
910
848
|
/* @__PURE__ */ e(W, {}),
|
|
911
|
-
/* @__PURE__ */ e(
|
|
849
|
+
/* @__PURE__ */ e(He, { goal: o.goal }),
|
|
912
850
|
/* @__PURE__ */ e(W, {}),
|
|
913
|
-
/* @__PURE__ */ e(
|
|
851
|
+
/* @__PURE__ */ e(Fe, { goal: o.goal }),
|
|
914
852
|
/* @__PURE__ */ e(W, {})
|
|
915
853
|
] }),
|
|
916
854
|
!o?.goal && o?.account && /* @__PURE__ */ s(L, { children: [
|
|
917
|
-
/* @__PURE__ */ e(
|
|
855
|
+
/* @__PURE__ */ e(it, { debt: o }),
|
|
918
856
|
/* @__PURE__ */ e(W, {}),
|
|
919
|
-
/* @__PURE__ */ e(
|
|
857
|
+
/* @__PURE__ */ e(nt, { debt: o }),
|
|
920
858
|
/* @__PURE__ */ e(W, {}),
|
|
921
|
-
/* @__PURE__ */ e(
|
|
859
|
+
/* @__PURE__ */ e(lt, { debt: o }),
|
|
922
860
|
/* @__PURE__ */ e(W, {})
|
|
923
861
|
] })
|
|
924
862
|
] });
|
|
925
|
-
},
|
|
863
|
+
}, ct = S(st), dt = ({ setTabValue: a, sx: o }) => {
|
|
926
864
|
const { debts: n } = C(), { showError: r, showCompleted: t } = R();
|
|
927
|
-
return
|
|
865
|
+
return y.useEffect(() => {
|
|
928
866
|
r && a(1);
|
|
929
|
-
}, [r]), !r && !t ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ s(
|
|
930
|
-
/* @__PURE__ */ e(
|
|
931
|
-
|
|
867
|
+
}, [r]), !r && !t ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ s(f, { gap: 16, children: [
|
|
868
|
+
/* @__PURE__ */ e(de, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
869
|
+
se,
|
|
932
870
|
{
|
|
933
|
-
icon: r ? /* @__PURE__ */ e(
|
|
871
|
+
icon: r ? /* @__PURE__ */ e(We, { filled: !0 }) : /* @__PURE__ */ e(ue, { color: "success", filled: !0 }),
|
|
934
872
|
severity: "error",
|
|
935
873
|
sx: {
|
|
936
874
|
alignItems: "start",
|
|
@@ -943,13 +881,13 @@ const ge = ({
|
|
|
943
881
|
}
|
|
944
882
|
},
|
|
945
883
|
children: [
|
|
946
|
-
/* @__PURE__ */ e(
|
|
947
|
-
/* @__PURE__ */ e(
|
|
884
|
+
/* @__PURE__ */ e(ce, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r ? n.status_error_title : n.status_complete_title }),
|
|
885
|
+
/* @__PURE__ */ e(i, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r ? n.status_error_description : n.status_complete_description })
|
|
948
886
|
]
|
|
949
887
|
}
|
|
950
888
|
) }),
|
|
951
|
-
r && /* @__PURE__ */ e(
|
|
952
|
-
|
|
889
|
+
r && /* @__PURE__ */ e(de, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
890
|
+
se,
|
|
953
891
|
{
|
|
954
892
|
icon: /* @__PURE__ */ e(L, {}),
|
|
955
893
|
severity: "error",
|
|
@@ -961,28 +899,28 @@ const ge = ({
|
|
|
961
899
|
}
|
|
962
900
|
},
|
|
963
901
|
children: [
|
|
964
|
-
/* @__PURE__ */ e(
|
|
965
|
-
/* @__PURE__ */ e(
|
|
902
|
+
/* @__PURE__ */ e(ce, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: n.status_info_title }),
|
|
903
|
+
/* @__PURE__ */ e(i, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: n.status_info_description })
|
|
966
904
|
]
|
|
967
905
|
}
|
|
968
906
|
) })
|
|
969
907
|
] });
|
|
970
|
-
},
|
|
971
|
-
const { debts: a } = C(), { showError: o, showCompleted: n } = R(), [r, t] =
|
|
908
|
+
}, pt = S(dt), mt = () => {
|
|
909
|
+
const { debts: a } = C(), { showError: o, showCompleted: n } = R(), [r, t] = y.useState(0);
|
|
972
910
|
return /* @__PURE__ */ s(L, { children: [
|
|
973
|
-
(o || n) && /* @__PURE__ */ e(
|
|
911
|
+
(o || n) && /* @__PURE__ */ e(pt, { setTabValue: t, sx: { mt: -24 } }),
|
|
974
912
|
/* @__PURE__ */ s(
|
|
975
|
-
|
|
913
|
+
$e,
|
|
976
914
|
{
|
|
977
915
|
"aria-label": a.details_tabs_aria_label,
|
|
978
916
|
centered: !0,
|
|
979
|
-
onChange: (
|
|
917
|
+
onChange: (l, d) => t(d),
|
|
980
918
|
textColor: "primary",
|
|
981
919
|
value: r,
|
|
982
920
|
variant: "fullWidth",
|
|
983
921
|
children: [
|
|
984
922
|
/* @__PURE__ */ e(
|
|
985
|
-
|
|
923
|
+
le,
|
|
986
924
|
{
|
|
987
925
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
988
926
|
id: "debt-schedule-tab-0",
|
|
@@ -990,7 +928,7 @@ const ge = ({
|
|
|
990
928
|
}
|
|
991
929
|
),
|
|
992
930
|
/* @__PURE__ */ e(
|
|
993
|
-
|
|
931
|
+
le,
|
|
994
932
|
{
|
|
995
933
|
"aria-controls": "debt-details-tabpanel-1",
|
|
996
934
|
id: "debt-details-tab-1",
|
|
@@ -1000,11 +938,11 @@ const ge = ({
|
|
|
1000
938
|
]
|
|
1001
939
|
}
|
|
1002
940
|
),
|
|
1003
|
-
/* @__PURE__ */ e(
|
|
1004
|
-
/* @__PURE__ */ e(
|
|
941
|
+
/* @__PURE__ */ e(pe, { index: 0, name: "debt-schedule", value: r, children: /* @__PURE__ */ e(ot, {}) }),
|
|
942
|
+
/* @__PURE__ */ e(pe, { index: 1, name: "debt-details", value: r, children: /* @__PURE__ */ e(ct, {}) })
|
|
1005
943
|
] });
|
|
1006
|
-
},
|
|
1007
|
-
const { debts: r } = C(), { showError: t, showCompleted:
|
|
944
|
+
}, ht = S(mt), ut = ({ isOpen: a, onClose: o, sx: n }) => {
|
|
945
|
+
const { debts: r } = C(), { showError: t, showCompleted: l } = R(), d = t || l ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(rt, {});
|
|
1008
946
|
return /* @__PURE__ */ e(
|
|
1009
947
|
te,
|
|
1010
948
|
{
|
|
@@ -1013,67 +951,67 @@ const ge = ({
|
|
|
1013
951
|
onClose: o,
|
|
1014
952
|
sx: { ...n },
|
|
1015
953
|
title: r.details_title,
|
|
1016
|
-
children: /* @__PURE__ */ s(
|
|
1017
|
-
/* @__PURE__ */ e(
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
954
|
+
children: /* @__PURE__ */ s(f, { bgcolor: "background.default", children: [
|
|
955
|
+
/* @__PURE__ */ e(Ee, { customDetailsChart: d }),
|
|
956
|
+
/* @__PURE__ */ e(ht, {})
|
|
1019
957
|
] })
|
|
1020
958
|
}
|
|
1021
959
|
);
|
|
1022
|
-
},
|
|
1023
|
-
const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: n } = z(), { onEvent: r } =
|
|
1024
|
-
o && (await n({ ...o, extra_payment: t }), o.extra_payment = t, r(
|
|
960
|
+
}, bt = S(() => {
|
|
961
|
+
const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: n } = z(), { onEvent: r } = M(), [t, l] = y.useState(o?.extra_payment ?? 0), d = t < 0 || t > 9999999999e-2, m = async () => {
|
|
962
|
+
o && (await n({ ...o, extra_payment: t }), o.extra_payment = t, r(v.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1025
963
|
user_guid: o?.user_guid
|
|
1026
964
|
}));
|
|
1027
|
-
},
|
|
965
|
+
}, c = () => {
|
|
1028
966
|
setTimeout(() => {
|
|
1029
|
-
|
|
967
|
+
l(o?.extra_payment ?? 0);
|
|
1030
968
|
}, 250);
|
|
1031
969
|
};
|
|
1032
970
|
return /* @__PURE__ */ e(
|
|
1033
971
|
J,
|
|
1034
972
|
{
|
|
1035
|
-
isSaveDisabled:
|
|
973
|
+
isSaveDisabled: d,
|
|
1036
974
|
label: a.paydown_drawer_extra_payment,
|
|
1037
|
-
onCancel:
|
|
1038
|
-
onSave:
|
|
975
|
+
onCancel: c,
|
|
976
|
+
onSave: m,
|
|
1039
977
|
primaryText: a.paydown_drawer_extra_payment,
|
|
1040
|
-
secondaryText:
|
|
978
|
+
secondaryText: B(o?.extra_payment, "0,0"),
|
|
1041
979
|
zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1042
980
|
children: /* @__PURE__ */ e(
|
|
1043
981
|
ae,
|
|
1044
982
|
{
|
|
1045
983
|
amount: t,
|
|
1046
984
|
autoFocus: !0,
|
|
1047
|
-
error:
|
|
985
|
+
error: d,
|
|
1048
986
|
fullWidth: !0,
|
|
1049
987
|
minAmount: 0,
|
|
1050
|
-
setAmount: (h) =>
|
|
988
|
+
setAmount: (h) => l(isNaN(Number(h)) ? t : Number(h)),
|
|
1051
989
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
1052
990
|
}
|
|
1053
991
|
)
|
|
1054
992
|
}
|
|
1055
993
|
);
|
|
1056
|
-
}),
|
|
994
|
+
}), _t = () => {
|
|
1057
995
|
const { debts: a } = C(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: n } = z(), r = o + Number(n?.extra_payment);
|
|
1058
|
-
return /* @__PURE__ */ s(
|
|
1059
|
-
/* @__PURE__ */ s(
|
|
1060
|
-
/* @__PURE__ */ s(
|
|
1061
|
-
/* @__PURE__ */ e(
|
|
1062
|
-
/* @__PURE__ */ e(
|
|
1063
|
-
/* @__PURE__ */ e(
|
|
996
|
+
return /* @__PURE__ */ s(f, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
997
|
+
/* @__PURE__ */ s(f, { p: 24, children: [
|
|
998
|
+
/* @__PURE__ */ s(f, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
999
|
+
/* @__PURE__ */ e(i, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
|
|
1000
|
+
/* @__PURE__ */ e(i, { bold: !0, variant: "H1", children: B(o, "0,0") }),
|
|
1001
|
+
/* @__PURE__ */ e(i, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
|
|
1064
1002
|
] }),
|
|
1065
|
-
/* @__PURE__ */ s(
|
|
1066
|
-
/* @__PURE__ */ e(
|
|
1067
|
-
/* @__PURE__ */ e(
|
|
1003
|
+
/* @__PURE__ */ s(f, { children: [
|
|
1004
|
+
/* @__PURE__ */ e(i, { variant: "H3", children: a.paydown_drawer_subtitle }),
|
|
1005
|
+
/* @__PURE__ */ e(i, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1068
1006
|
] })
|
|
1069
1007
|
] }),
|
|
1070
|
-
/* @__PURE__ */ e(
|
|
1071
|
-
/* @__PURE__ */ e(
|
|
1072
|
-
/* @__PURE__ */ e(
|
|
1073
|
-
/* @__PURE__ */ e(
|
|
1008
|
+
/* @__PURE__ */ e(f, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(bt, {}) }),
|
|
1009
|
+
/* @__PURE__ */ e(f, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(f, { gap: 4, children: [
|
|
1010
|
+
/* @__PURE__ */ e(i, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
|
1011
|
+
/* @__PURE__ */ e(i, { bold: !0, textAlign: "right", variant: "Body", children: B(r, "0,0") })
|
|
1074
1012
|
] }) })
|
|
1075
1013
|
] });
|
|
1076
|
-
},
|
|
1014
|
+
}, yt = S(_t), ft = ({ isOpen: a, onClose: o, sx: n }) => {
|
|
1077
1015
|
const { debts: r } = C();
|
|
1078
1016
|
return /* @__PURE__ */ e(
|
|
1079
1017
|
te,
|
|
@@ -1083,11 +1021,11 @@ const ge = ({
|
|
|
1083
1021
|
onClose: o,
|
|
1084
1022
|
sx: { ...n },
|
|
1085
1023
|
title: r.paydown_drawer_title,
|
|
1086
|
-
children: /* @__PURE__ */ e(
|
|
1024
|
+
children: /* @__PURE__ */ e(yt, {})
|
|
1087
1025
|
}
|
|
1088
1026
|
);
|
|
1089
1027
|
};
|
|
1090
|
-
function
|
|
1028
|
+
function gt(a, o) {
|
|
1091
1029
|
const n = (r) => {
|
|
1092
1030
|
if (typeof r == "number") return r;
|
|
1093
1031
|
if (r === "!" || r === "✓") return 1 / 0;
|
|
@@ -1095,17 +1033,17 @@ function Et(a, o) {
|
|
|
1095
1033
|
};
|
|
1096
1034
|
return n(a) - n(o);
|
|
1097
1035
|
}
|
|
1098
|
-
function
|
|
1036
|
+
function xt(a) {
|
|
1099
1037
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1100
1038
|
}
|
|
1101
|
-
const
|
|
1039
|
+
const wt = (a) => {
|
|
1102
1040
|
const o = {
|
|
1103
1041
|
text: "#121417",
|
|
1104
1042
|
background: "#FFB252"
|
|
1105
1043
|
};
|
|
1106
1044
|
return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
|
|
1107
|
-
},
|
|
1108
|
-
const o = String(a.formattedValue), n =
|
|
1045
|
+
}, Ct = (a) => {
|
|
1046
|
+
const o = String(a.formattedValue), n = wt(o);
|
|
1109
1047
|
return /* @__PURE__ */ e(
|
|
1110
1048
|
re,
|
|
1111
1049
|
{
|
|
@@ -1120,80 +1058,80 @@ const Bt = (a) => {
|
|
|
1120
1058
|
backgroundColor: n.background,
|
|
1121
1059
|
marginLeft: "10px"
|
|
1122
1060
|
},
|
|
1123
|
-
children: /* @__PURE__ */ e(
|
|
1061
|
+
children: /* @__PURE__ */ e(i, { color: n.text, fontWeight: 700, variant: "Small", children: o })
|
|
1124
1062
|
}
|
|
1125
1063
|
);
|
|
1126
|
-
},
|
|
1127
|
-
const o = a.row.account, n =
|
|
1128
|
-
return /* @__PURE__ */ s(
|
|
1064
|
+
}, St = (a) => {
|
|
1065
|
+
const o = a.row.account, n = je[o.account_type];
|
|
1066
|
+
return /* @__PURE__ */ s(f, { alignItems: "center", flexDirection: "row", children: [
|
|
1129
1067
|
/* @__PURE__ */ e(
|
|
1130
|
-
|
|
1068
|
+
Ce,
|
|
1131
1069
|
{
|
|
1132
1070
|
alt: `${o.institutionName}`,
|
|
1133
1071
|
institutionGuid: o.institution_guid || ""
|
|
1134
1072
|
}
|
|
1135
1073
|
),
|
|
1136
|
-
/* @__PURE__ */ s(
|
|
1137
|
-
/* @__PURE__ */ e(
|
|
1138
|
-
/* @__PURE__ */ e(
|
|
1074
|
+
/* @__PURE__ */ s(f, { ml: 12, children: [
|
|
1075
|
+
/* @__PURE__ */ e(i, { variant: "Small", children: o.name }),
|
|
1076
|
+
/* @__PURE__ */ e(i, { variant: "XSmall", children: n })
|
|
1139
1077
|
] })
|
|
1140
1078
|
] });
|
|
1141
|
-
},
|
|
1079
|
+
}, Dt = ({
|
|
1142
1080
|
sx: a = {},
|
|
1143
1081
|
debts: o,
|
|
1144
1082
|
hoveredDebtGuid: n,
|
|
1145
1083
|
onHoverRow: r,
|
|
1146
1084
|
onClickRow: t
|
|
1147
1085
|
}) => {
|
|
1148
|
-
const
|
|
1086
|
+
const l = j(), { onEvent: d } = M(), { isMobile: m } = X(), { debts: c } = C(), [h, p] = y.useState([
|
|
1149
1087
|
{ field: "priority", sort: "asc" }
|
|
1150
|
-
]),
|
|
1088
|
+
]), g = [
|
|
1151
1089
|
{
|
|
1152
1090
|
field: "priority",
|
|
1153
|
-
headerName:
|
|
1091
|
+
headerName: c.table_column_priority,
|
|
1154
1092
|
renderHeader: G,
|
|
1155
|
-
renderCell:
|
|
1156
|
-
sortComparator:
|
|
1093
|
+
renderCell: Ct,
|
|
1094
|
+
sortComparator: gt,
|
|
1157
1095
|
sortable: !0,
|
|
1158
1096
|
hideSortIcons: !0,
|
|
1159
1097
|
type: "custom",
|
|
1160
1098
|
align: "left",
|
|
1161
1099
|
headerAlign: "left",
|
|
1162
|
-
minWidth:
|
|
1163
|
-
flex:
|
|
1100
|
+
minWidth: m ? 67 : 72,
|
|
1101
|
+
flex: m ? 0.2 : 0.4
|
|
1164
1102
|
},
|
|
1165
1103
|
{
|
|
1166
1104
|
field: "account",
|
|
1167
|
-
headerName:
|
|
1105
|
+
headerName: c.table_column_account,
|
|
1168
1106
|
renderHeader: G,
|
|
1169
|
-
renderCell:
|
|
1107
|
+
renderCell: St,
|
|
1170
1108
|
sortable: !1,
|
|
1171
1109
|
type: "custom",
|
|
1172
1110
|
align: "left",
|
|
1173
1111
|
headerAlign: "left",
|
|
1174
|
-
minWidth:
|
|
1112
|
+
minWidth: m ? 180 : 225,
|
|
1175
1113
|
flex: 1
|
|
1176
1114
|
},
|
|
1177
1115
|
{
|
|
1178
1116
|
field: "balance",
|
|
1179
|
-
headerName:
|
|
1117
|
+
headerName: c.table_column_balance,
|
|
1180
1118
|
renderHeader: G,
|
|
1181
|
-
valueFormatter: (u) =>
|
|
1119
|
+
valueFormatter: (u) => B(u, "0,0"),
|
|
1182
1120
|
sortable: !0,
|
|
1183
|
-
hideSortIcons:
|
|
1121
|
+
hideSortIcons: m,
|
|
1184
1122
|
type: "number",
|
|
1185
|
-
align:
|
|
1186
|
-
headerAlign:
|
|
1187
|
-
minWidth:
|
|
1188
|
-
flex:
|
|
1123
|
+
align: m ? "right" : "left",
|
|
1124
|
+
headerAlign: m ? "right" : "left",
|
|
1125
|
+
minWidth: m ? 70 : 122,
|
|
1126
|
+
flex: m ? 0.4 : 0.6
|
|
1189
1127
|
},
|
|
1190
1128
|
{
|
|
1191
1129
|
field: "interest_rate",
|
|
1192
|
-
headerName:
|
|
1130
|
+
headerName: c.table_column_interest_rate,
|
|
1193
1131
|
renderHeader: G,
|
|
1194
1132
|
valueFormatter: (u) => isNaN(u) ? "---" : `${Number(u).toFixed(2)}%`,
|
|
1195
1133
|
sortable: !0,
|
|
1196
|
-
hideSortIcons:
|
|
1134
|
+
hideSortIcons: m,
|
|
1197
1135
|
type: "number",
|
|
1198
1136
|
align: "left",
|
|
1199
1137
|
headerAlign: "left",
|
|
@@ -1202,11 +1140,11 @@ const Bt = (a) => {
|
|
|
1202
1140
|
},
|
|
1203
1141
|
{
|
|
1204
1142
|
field: "projected_payoff_date",
|
|
1205
|
-
headerName:
|
|
1143
|
+
headerName: c.table_column_payoff_date,
|
|
1206
1144
|
renderHeader: G,
|
|
1207
1145
|
valueFormatter: (u) => u ? K(u, U.MONTH_SHORT_YEAR) : "---",
|
|
1208
1146
|
sortable: !0,
|
|
1209
|
-
hideSortIcons:
|
|
1147
|
+
hideSortIcons: m,
|
|
1210
1148
|
type: "number",
|
|
1211
1149
|
align: "left",
|
|
1212
1150
|
headerAlign: "left",
|
|
@@ -1215,19 +1153,19 @@ const Bt = (a) => {
|
|
|
1215
1153
|
},
|
|
1216
1154
|
{
|
|
1217
1155
|
field: "monthly_payment",
|
|
1218
|
-
headerName:
|
|
1156
|
+
headerName: c.table_column_amount_due,
|
|
1219
1157
|
renderHeader: G,
|
|
1220
|
-
valueFormatter: (u) => typeof u == "number" ?
|
|
1158
|
+
valueFormatter: (u) => typeof u == "number" ? B(u, "0,0") : "---",
|
|
1221
1159
|
sortable: !0,
|
|
1222
|
-
hideSortIcons:
|
|
1160
|
+
hideSortIcons: m,
|
|
1223
1161
|
type: "number",
|
|
1224
1162
|
align: "left",
|
|
1225
1163
|
headerAlign: "left",
|
|
1226
1164
|
minWidth: 122,
|
|
1227
1165
|
flex: 0.6
|
|
1228
1166
|
}
|
|
1229
|
-
],
|
|
1230
|
-
...
|
|
1167
|
+
], x = [
|
|
1168
|
+
...g.slice(0, 3),
|
|
1231
1169
|
{
|
|
1232
1170
|
field: "chevron",
|
|
1233
1171
|
headerName: "",
|
|
@@ -1240,14 +1178,14 @@ const Bt = (a) => {
|
|
|
1240
1178
|
headerAlign: "right",
|
|
1241
1179
|
width: 20
|
|
1242
1180
|
}
|
|
1243
|
-
],
|
|
1181
|
+
], E = y.useMemo(() => o.map((u, A) => ({
|
|
1244
1182
|
...u,
|
|
1245
|
-
id:
|
|
1246
|
-
priority:
|
|
1247
|
-
})), [o]),
|
|
1183
|
+
id: A,
|
|
1184
|
+
priority: xt(u)
|
|
1185
|
+
})), [o]), k = (u) => {
|
|
1248
1186
|
const Y = u.target.closest("[data-id]")?.getAttribute("data-id"), b = o[Number(Y)];
|
|
1249
1187
|
r?.(b?.guid ?? "");
|
|
1250
|
-
},
|
|
1188
|
+
}, D = (u) => E.find((A) => A.guid === u)?.id;
|
|
1251
1189
|
return /* @__PURE__ */ e(
|
|
1252
1190
|
re,
|
|
1253
1191
|
{
|
|
@@ -1260,32 +1198,32 @@ const Bt = (a) => {
|
|
|
1260
1198
|
...a
|
|
1261
1199
|
},
|
|
1262
1200
|
children: /* @__PURE__ */ e(
|
|
1263
|
-
|
|
1201
|
+
Ge,
|
|
1264
1202
|
{
|
|
1265
|
-
columns:
|
|
1203
|
+
columns: m ? x : g,
|
|
1266
1204
|
disableColumnFilter: !0,
|
|
1267
1205
|
disableColumnMenu: !0,
|
|
1268
1206
|
hideFooter: !0,
|
|
1269
1207
|
initialState: { sorting: { sortModel: h } },
|
|
1270
1208
|
onRowClick: (u) => {
|
|
1271
|
-
t(),
|
|
1209
|
+
t(), d(v.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
|
|
1272
1210
|
},
|
|
1273
1211
|
onSortModelChange: (u) => {
|
|
1274
|
-
|
|
1212
|
+
p(u), d(v.DEBTS_CLICK_TABLE_SORT);
|
|
1275
1213
|
},
|
|
1276
|
-
rows:
|
|
1214
|
+
rows: E,
|
|
1277
1215
|
slotProps: {
|
|
1278
1216
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1279
1217
|
row: {
|
|
1280
|
-
onMouseEnter:
|
|
1218
|
+
onMouseEnter: k,
|
|
1281
1219
|
onMouseLeave: () => r?.("")
|
|
1282
1220
|
}
|
|
1283
1221
|
},
|
|
1284
1222
|
sortModel: h,
|
|
1285
1223
|
sortingOrder: ["asc", "desc"],
|
|
1286
1224
|
sx: {
|
|
1287
|
-
[`& .MuiDataGrid-row[data-id="${
|
|
1288
|
-
backgroundColor:
|
|
1225
|
+
[`& .MuiDataGrid-row[data-id="${D(n)}"]`]: {
|
|
1226
|
+
backgroundColor: l.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1289
1227
|
filter: "brightness(98%)"
|
|
1290
1228
|
}
|
|
1291
1229
|
}
|
|
@@ -1293,54 +1231,50 @@ const Bt = (a) => {
|
|
|
1293
1231
|
)
|
|
1294
1232
|
}
|
|
1295
1233
|
);
|
|
1296
|
-
},
|
|
1297
|
-
const { isDesktop: r, isTablet: t } = X(),
|
|
1234
|
+
}, vt = ({ buttonText: a, isOpen: o, onClick: n }) => {
|
|
1235
|
+
const { isDesktop: r, isTablet: t } = X(), l = o ? "unfold_less" : "unfold_more";
|
|
1298
1236
|
return r || t ? /* @__PURE__ */ e(
|
|
1299
|
-
|
|
1237
|
+
be,
|
|
1300
1238
|
{
|
|
1301
1239
|
"aria-controls": "prioritize-debts",
|
|
1302
1240
|
"aria-describedby": "prioritize-debts",
|
|
1303
1241
|
"aria-haspopup": !0,
|
|
1304
1242
|
"aria-label": "prioritize-debts",
|
|
1305
1243
|
onClick: n,
|
|
1306
|
-
startIcon: /* @__PURE__ */ e(ee, { name:
|
|
1244
|
+
startIcon: /* @__PURE__ */ e(ee, { name: l }),
|
|
1307
1245
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1308
1246
|
children: a
|
|
1309
1247
|
}
|
|
1310
1248
|
) : /* @__PURE__ */ e(
|
|
1311
|
-
|
|
1249
|
+
ze,
|
|
1312
1250
|
{
|
|
1313
1251
|
"aria-controls": "prioritize-debts",
|
|
1314
1252
|
"aria-describedby": "prioritize-debts",
|
|
1315
1253
|
"aria-haspopup": !0,
|
|
1316
1254
|
"aria-label": "prioritize-debts",
|
|
1317
1255
|
onClick: n,
|
|
1318
|
-
children: /* @__PURE__ */ e(ee, { name:
|
|
1256
|
+
children: /* @__PURE__ */ e(ee, { name: l })
|
|
1319
1257
|
}
|
|
1320
1258
|
);
|
|
1321
|
-
},
|
|
1322
|
-
const { onEvent: n } =
|
|
1323
|
-
{
|
|
1324
|
-
priority: M.FASTEST_PAYOFF_FIRST,
|
|
1325
|
-
text: r.priority_sort_fastest_payoff
|
|
1326
|
-
},
|
|
1259
|
+
}, Tt = S(({ buttonEl: a, onClose: o }) => {
|
|
1260
|
+
const { onEvent: n } = M(), { debts: r } = C(), { selectedDebtPriority: t, setSelectedDebtPriority: l } = R(), d = !!a, m = [
|
|
1327
1261
|
{
|
|
1328
|
-
priority:
|
|
1262
|
+
priority: $.HIGHEST_INTEREST,
|
|
1329
1263
|
text: r.priority_sort_highest_interest
|
|
1330
1264
|
},
|
|
1331
1265
|
{
|
|
1332
|
-
priority:
|
|
1266
|
+
priority: $.LOWEST_BALANCE,
|
|
1333
1267
|
text: r.priority_sort_lowest_balance
|
|
1334
1268
|
},
|
|
1335
1269
|
{
|
|
1336
|
-
priority:
|
|
1270
|
+
priority: $.HIGHEST_BALANCE,
|
|
1337
1271
|
text: r.priority_sort_highest_balance
|
|
1338
1272
|
}
|
|
1339
|
-
],
|
|
1340
|
-
|
|
1273
|
+
], c = (h) => {
|
|
1274
|
+
l(h), n(v.DEBTS_CLICK_PRIORITY, { debts_priority: h });
|
|
1341
1275
|
};
|
|
1342
1276
|
return /* @__PURE__ */ e(
|
|
1343
|
-
|
|
1277
|
+
Ve,
|
|
1344
1278
|
{
|
|
1345
1279
|
anchorEl: a,
|
|
1346
1280
|
anchorOrigin: {
|
|
@@ -1349,15 +1283,15 @@ const Bt = (a) => {
|
|
|
1349
1283
|
},
|
|
1350
1284
|
id: "prioritize-debts",
|
|
1351
1285
|
onClose: o,
|
|
1352
|
-
open:
|
|
1286
|
+
open: d,
|
|
1353
1287
|
transformOrigin: {
|
|
1354
1288
|
vertical: "top",
|
|
1355
1289
|
horizontal: "left"
|
|
1356
1290
|
},
|
|
1357
|
-
children: /* @__PURE__ */ e(
|
|
1358
|
-
|
|
1291
|
+
children: /* @__PURE__ */ e(he, { children: m.map(({ priority: h, text: p }) => /* @__PURE__ */ s(
|
|
1292
|
+
Xe,
|
|
1359
1293
|
{
|
|
1360
|
-
onClick: () =>
|
|
1294
|
+
onClick: () => c(h),
|
|
1361
1295
|
sx: {
|
|
1362
1296
|
bgcolor: t === h ? "primary.main" : void 0,
|
|
1363
1297
|
color: t === h ? "#fff" : void 0,
|
|
@@ -1373,70 +1307,69 @@ const Bt = (a) => {
|
|
|
1373
1307
|
}
|
|
1374
1308
|
},
|
|
1375
1309
|
children: [
|
|
1376
|
-
/* @__PURE__ */ e(
|
|
1377
|
-
t === h && /* @__PURE__ */ e(
|
|
1310
|
+
/* @__PURE__ */ e(i, { color: "inherit", variant: "Small", children: p }),
|
|
1311
|
+
t === h && /* @__PURE__ */ e(ue, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1378
1312
|
]
|
|
1379
1313
|
},
|
|
1380
1314
|
h
|
|
1381
1315
|
)) })
|
|
1382
1316
|
}
|
|
1383
1317
|
);
|
|
1384
|
-
}),
|
|
1385
|
-
const { onEvent: a } =
|
|
1386
|
-
t(h.currentTarget), a(
|
|
1387
|
-
},
|
|
1318
|
+
}), At = S(() => {
|
|
1319
|
+
const { onEvent: a } = M(), { debts: o } = C(), { selectedDebtPriority: n } = R(), [r, t] = y.useState(null), l = (h) => {
|
|
1320
|
+
t(h.currentTarget), a(v.DEBTS_CLICK_PRIORITIZE);
|
|
1321
|
+
}, d = () => {
|
|
1388
1322
|
t(null);
|
|
1389
|
-
},
|
|
1390
|
-
[
|
|
1391
|
-
[
|
|
1392
|
-
[
|
|
1393
|
-
[M.LOWEST_BALANCE]: o.priority_sort_lowest_balance
|
|
1323
|
+
}, m = !!r, c = y.useMemo(() => ({
|
|
1324
|
+
[$.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
|
|
1325
|
+
[$.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
|
|
1326
|
+
[$.LOWEST_BALANCE]: o.priority_sort_lowest_balance
|
|
1394
1327
|
})[n] ?? o.priority_sort_lowest_balance, [n]);
|
|
1395
1328
|
return /* @__PURE__ */ s(_, { children: [
|
|
1396
|
-
/* @__PURE__ */ e(
|
|
1397
|
-
/* @__PURE__ */ e(
|
|
1329
|
+
/* @__PURE__ */ e(vt, { buttonText: c, isOpen: m, onClick: l }),
|
|
1330
|
+
/* @__PURE__ */ e(Tt, { buttonEl: r, onClose: d })
|
|
1398
1331
|
] });
|
|
1399
|
-
}),
|
|
1400
|
-
const r = a.map((
|
|
1401
|
-
|
|
1402
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1403
|
-
let
|
|
1404
|
-
for (const
|
|
1405
|
-
|
|
1406
|
-
...
|
|
1332
|
+
}), Et = (a, o, n = 0) => {
|
|
1333
|
+
const r = a.map((c) => ({ ...c }));
|
|
1334
|
+
_e(r, o);
|
|
1335
|
+
const t = /* @__PURE__ */ new Date(), l = [];
|
|
1336
|
+
let d = 0, m = 1;
|
|
1337
|
+
for (const c of r)
|
|
1338
|
+
l.push({
|
|
1339
|
+
...c,
|
|
1407
1340
|
// Start with the initial balance
|
|
1408
|
-
dataset: [{ x: new Date(t), y:
|
|
1341
|
+
dataset: [{ x: new Date(t), y: c.balance }]
|
|
1409
1342
|
});
|
|
1410
|
-
for (; r.some((
|
|
1411
|
-
let
|
|
1412
|
-
for (const [h,
|
|
1413
|
-
if (
|
|
1414
|
-
const
|
|
1415
|
-
let
|
|
1416
|
-
h === 0 && (
|
|
1417
|
-
const u = Math.min(
|
|
1418
|
-
if (u <=
|
|
1419
|
-
|
|
1343
|
+
for (; r.some((c) => c.balance >= 0.01 && !c.is_impossible); ) {
|
|
1344
|
+
let c = !1;
|
|
1345
|
+
for (const [h, p] of r.entries()) {
|
|
1346
|
+
if (p.balance <= 0.01) continue;
|
|
1347
|
+
const g = l[h].dataset, E = (p.interest_rate ?? 0) / 100 / 12, k = p.balance * E;
|
|
1348
|
+
let D = p.monthly_payment ?? 0;
|
|
1349
|
+
h === 0 && (D += n), p.balance += k;
|
|
1350
|
+
const u = Math.min(p.balance, D + d);
|
|
1351
|
+
if (u <= k) {
|
|
1352
|
+
p.is_impossible = !0, l[h].is_impossible = !0, l[h].priority = void 0, g.push({ x: new Date(t), y: p.balance });
|
|
1420
1353
|
continue;
|
|
1421
1354
|
}
|
|
1422
|
-
|
|
1355
|
+
p.balance -= u, p.balance = p.balance < 0.01 ? 0 : p.balance, g.push({
|
|
1423
1356
|
x: new Date(t),
|
|
1424
|
-
y: Math.max(0,
|
|
1357
|
+
y: Math.max(0, p.balance),
|
|
1425
1358
|
payment: u,
|
|
1426
|
-
extra:
|
|
1427
|
-
}),
|
|
1359
|
+
extra: d
|
|
1360
|
+
}), p.balance <= 0 && (d += D, l[h].projected_payoff_date = new Date(t)), u > 0 && (c = !0);
|
|
1428
1361
|
}
|
|
1429
|
-
|
|
1362
|
+
c && t.setMonth(t.getMonth() + 1);
|
|
1430
1363
|
}
|
|
1431
|
-
return
|
|
1432
|
-
(
|
|
1433
|
-
}),
|
|
1434
|
-
|
|
1435
|
-
}),
|
|
1436
|
-
},
|
|
1437
|
-
const { debts: o } = C(), { isDesktop: n } = X(), { totalMonthlyPayments: r } = q(), { monthlyCashFlowProfile: t } = z(),
|
|
1364
|
+
return l.forEach((c) => {
|
|
1365
|
+
(c.interest_rate === void 0 || c.interest_rate === void 0) && (c.projected_payoff_date = void 0);
|
|
1366
|
+
}), l.forEach((c) => {
|
|
1367
|
+
c.priority = !c.is_paid_off && !c.is_impossible ? m++ : void 0;
|
|
1368
|
+
}), l;
|
|
1369
|
+
}, It = S(({ onClick: a }) => {
|
|
1370
|
+
const { debts: o } = C(), { isDesktop: n } = X(), { totalMonthlyPayments: r } = q(), { monthlyCashFlowProfile: t } = z(), l = r + Number(t?.extra_payment), d = n ? o.paydown_button_long : o.paydown_button_short;
|
|
1438
1371
|
return /* @__PURE__ */ e(
|
|
1439
|
-
|
|
1372
|
+
be,
|
|
1440
1373
|
{
|
|
1441
1374
|
"aria-controls": "extra-paydown",
|
|
1442
1375
|
"aria-describedby": "extra-paydown",
|
|
@@ -1444,100 +1377,100 @@ const Bt = (a) => {
|
|
|
1444
1377
|
"aria-label": "extra-paydown",
|
|
1445
1378
|
onClick: a,
|
|
1446
1379
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
|
1447
|
-
children:
|
|
1380
|
+
children: T(d, B(l, "0,0"))
|
|
1448
1381
|
}
|
|
1449
1382
|
);
|
|
1450
|
-
}),
|
|
1451
|
-
const [n, r] =
|
|
1452
|
-
const
|
|
1453
|
-
return
|
|
1454
|
-
}, [N, V,
|
|
1455
|
-
|
|
1456
|
-
u(b),
|
|
1457
|
-
}, []),
|
|
1383
|
+
}), Bt = ({ onBackClick: a, sx: o }) => {
|
|
1384
|
+
const [n, r] = y.useState(!1), [t, l] = y.useState(!1), [d, m] = y.useState(!1), [c, h] = y.useState(""), { isDesktop: p, isMobile: g } = X(), { debts: x } = C(), { onEvent: E } = M(), { isCopyLoaded: k, isInitialized: D, setSelectedAccounts: u } = Ae(), { setSelectedAccount: A } = Ie(), { selectedDebtPriority: V, setSelectedDebtChartData: Y } = R(), { visibleDebtAccounts: b } = Z(), { goalsLoaded: w, loadGoals: I, monthlyCashFlowProfile: P } = z(), { debts: N } = q(), H = y.useMemo(() => {
|
|
1385
|
+
const F = P?.extra_payment ?? 0;
|
|
1386
|
+
return Et(N, V, F);
|
|
1387
|
+
}, [N, V, P]);
|
|
1388
|
+
y.useEffect(() => {
|
|
1389
|
+
u(b), E(v.DEBTS_VIEW);
|
|
1390
|
+
}, []), y.useEffect(() => {
|
|
1458
1391
|
u(b);
|
|
1459
|
-
}, [b]),
|
|
1460
|
-
|
|
1461
|
-
}, [
|
|
1462
|
-
const oe = (
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
},
|
|
1466
|
-
|
|
1467
|
-
},
|
|
1468
|
-
|
|
1392
|
+
}, [b]), y.useEffect(() => {
|
|
1393
|
+
D && I().finally();
|
|
1394
|
+
}, [D]);
|
|
1395
|
+
const oe = (F) => h(F), ne = () => {
|
|
1396
|
+
const F = b.find((Q) => Q.guid === c), ie = H.find((Q) => Q.guid === c);
|
|
1397
|
+
F && A(F), ie && Y(ie), r(!0);
|
|
1398
|
+
}, fe = () => E(v.DEBTS_CLICK_FILTER), ge = () => {
|
|
1399
|
+
m(!0), E(v.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1400
|
+
}, xe = () => {
|
|
1401
|
+
l(!0), E(v.DEBTS_CLICK_PAYDOWN);
|
|
1469
1402
|
};
|
|
1470
|
-
return !w || !
|
|
1471
|
-
|
|
1403
|
+
return !w || !k || !D ? /* @__PURE__ */ e(Ye, {}) : /* @__PURE__ */ s(
|
|
1404
|
+
Re,
|
|
1472
1405
|
{
|
|
1473
1406
|
accountOptions: b,
|
|
1474
1407
|
actions: [
|
|
1475
|
-
/* @__PURE__ */ e(
|
|
1476
|
-
/* @__PURE__ */ e(
|
|
1408
|
+
/* @__PURE__ */ e(At, {}, "prioritize-debts"),
|
|
1409
|
+
/* @__PURE__ */ e(It, { onClick: xe }, "extra-paydown")
|
|
1477
1410
|
],
|
|
1478
|
-
onAccountsFilterClick:
|
|
1411
|
+
onAccountsFilterClick: fe,
|
|
1479
1412
|
onBackClick: a,
|
|
1480
1413
|
sx: o,
|
|
1481
|
-
title:
|
|
1414
|
+
title: x.title,
|
|
1482
1415
|
children: [
|
|
1483
|
-
/* @__PURE__ */ s(
|
|
1416
|
+
/* @__PURE__ */ s(f, { sx: { px: p ? "48px" : "24px" }, children: [
|
|
1484
1417
|
/* @__PURE__ */ s(
|
|
1485
|
-
|
|
1418
|
+
f,
|
|
1486
1419
|
{
|
|
1487
1420
|
sx: {
|
|
1488
|
-
alignItems:
|
|
1489
|
-
flexDirection:
|
|
1490
|
-
mx:
|
|
1421
|
+
alignItems: g ? "flex-start" : "flex-end",
|
|
1422
|
+
flexDirection: g ? "column" : "row",
|
|
1423
|
+
mx: g ? "-12px" : 0
|
|
1491
1424
|
},
|
|
1492
1425
|
children: [
|
|
1493
1426
|
/* @__PURE__ */ e(
|
|
1494
|
-
|
|
1427
|
+
ye,
|
|
1495
1428
|
{
|
|
1496
|
-
debts:
|
|
1497
|
-
height:
|
|
1498
|
-
hoveredDebtGuid:
|
|
1429
|
+
debts: H,
|
|
1430
|
+
height: g ? 250 : void 0,
|
|
1431
|
+
hoveredDebtGuid: c,
|
|
1499
1432
|
onClickArea: ne,
|
|
1500
1433
|
onHoverArea: oe,
|
|
1501
|
-
sx: { mr:
|
|
1434
|
+
sx: { mr: g ? "4px" : "-48px" }
|
|
1502
1435
|
}
|
|
1503
1436
|
),
|
|
1504
1437
|
/* @__PURE__ */ e(
|
|
1505
|
-
|
|
1438
|
+
qe,
|
|
1506
1439
|
{
|
|
1507
|
-
debts:
|
|
1508
|
-
onClickCta:
|
|
1509
|
-
sx: { mb:
|
|
1440
|
+
debts: H,
|
|
1441
|
+
onClickCta: ge,
|
|
1442
|
+
sx: { mb: g ? "0px" : "64px" }
|
|
1510
1443
|
}
|
|
1511
1444
|
)
|
|
1512
1445
|
]
|
|
1513
1446
|
}
|
|
1514
1447
|
),
|
|
1515
|
-
/* @__PURE__ */ e(
|
|
1516
|
-
|
|
1448
|
+
/* @__PURE__ */ e(f, { sx: { mx: g ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1449
|
+
Dt,
|
|
1517
1450
|
{
|
|
1518
|
-
debts:
|
|
1519
|
-
hoveredDebtGuid:
|
|
1451
|
+
debts: H,
|
|
1452
|
+
hoveredDebtGuid: c,
|
|
1520
1453
|
onClickRow: ne,
|
|
1521
1454
|
onHoverRow: oe
|
|
1522
1455
|
}
|
|
1523
1456
|
) })
|
|
1524
1457
|
] }),
|
|
1525
1458
|
/* @__PURE__ */ e(
|
|
1526
|
-
|
|
1459
|
+
Je,
|
|
1527
1460
|
{
|
|
1528
|
-
isOpen:
|
|
1529
|
-
onClose: () =>
|
|
1461
|
+
isOpen: d,
|
|
1462
|
+
onClose: () => m(!1)
|
|
1530
1463
|
}
|
|
1531
1464
|
),
|
|
1532
|
-
/* @__PURE__ */ e(
|
|
1533
|
-
/* @__PURE__ */ e(
|
|
1465
|
+
/* @__PURE__ */ e(ut, { isOpen: n, onClose: () => r(!1) }),
|
|
1466
|
+
/* @__PURE__ */ e(ft, { isOpen: t, onClose: () => l(!1) })
|
|
1534
1467
|
]
|
|
1535
1468
|
}
|
|
1536
1469
|
);
|
|
1537
|
-
},
|
|
1470
|
+
}, xr = S(Bt);
|
|
1538
1471
|
export {
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1472
|
+
ye as DebtsChart,
|
|
1473
|
+
Sr as DebtsStore,
|
|
1474
|
+
Dt as DebtsTable,
|
|
1475
|
+
xr as DebtsWidget
|
|
1543
1476
|
};
|