@mx-cartographer/experiences 7.2.16 → 7.2.17

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.
@@ -1,69 +1,69 @@
1
1
  import { jsx as e, jsxs as s, Fragment as $ } from "react/jsx-runtime";
2
- import x from "react";
2
+ import g from "react";
3
3
  import { observer as D } from "mobx-react-lite";
4
- import g from "@mui/material/Stack";
5
- import { useTheme as X, Card as be, Stack as y, Box as G } from "@mui/material";
6
- import { Text as l, H3 as ve, InstitutionLogo as De, Icon as ee } from "@mxenabled/mxui";
7
- import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
8
- import { addMonths as le } from "date-fns/addMonths";
9
- import { fromUnixTime as se } from "date-fns/fromUnixTime";
10
- import { getUnixTime as ce } from "date-fns/getUnixTime";
11
- import { D as B, M as Ee, I as Ie } from "../DebtsStore-BD_XwsI7.mjs";
12
- import { a as Fr } from "../DebtsStore-BD_XwsI7.mjs";
13
- import { f as M, a as Be } from "../NumberFormatting-Buh7u8Oi.mjs";
14
- import { f as K, D as U } from "../Dialog-CWW597AF.mjs";
15
- import { G as Me, y as q, u as C, l as V, g as k, d as Z, b as Pe } from "../hooks-D6XlXHf4.mjs";
4
+ import w from "@mui/material/Stack";
5
+ import { useTheme as X, Card as _e, Stack as y, 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 I, M as Ie, I as Be } from "../DebtsStore-BD_XwsI7.mjs";
12
+ import { a as Lr } from "../DebtsStore-BD_XwsI7.mjs";
13
+ import { f as B, a as Me } from "../NumberFormatting-Buh7u8Oi.mjs";
14
+ import { f as U, D as q } from "../Dialog-CWW597AF.mjs";
15
+ import { G as Pe, y as Z, u as C, l as V, g as k, d as J, n as ke, b as Ne } from "../hooks-D6XlXHf4.mjs";
16
16
  import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
17
- import { D as te } from "../Drawer-kEE73B87.mjs";
17
+ import { D as re } from "../Drawer-kEE73B87.mjs";
18
18
  import { b as A } from "../Localization-2MODESHW.mjs";
19
- import { A as ke, u as Ne } from "../AccountDetailsHeader-Df1JkzYi.mjs";
20
- import Fe from "@mui/material/Card";
21
- import Re from "@mui/material/CardContent";
22
- import Le from "@mui/material/CardHeader";
23
- import { LineChart as $e } from "@mui/x-charts";
24
- import re from "@mui/material/Box";
25
- import { useTheme as He } from "@mui/material/styles";
26
- import { A as T, W as Oe } from "../WidgetContainer-EbrN1oIo.mjs";
27
- import de from "@mui/material/Tab";
28
- import We from "@mui/material/Tabs";
29
- import _e from "@mui/material/List";
30
- import j from "@mui/material/Divider";
31
- import { M as Ge, I as je, O as ze } from "../OriginalBalanceAction-CWuVvRq9.mjs";
32
- import Xe from "@mui/material/TextField";
33
- import { L as J } from "../ListItemAction-DHa3KJPs.mjs";
34
- import { C as ae } from "../CurrencyInput-DUsQbkXb.mjs";
35
- import pe from "@mui/material/Alert";
36
- import me from "@mui/material/AlertTitle";
37
- import he from "@mui/material/Paper";
38
- import { Error as Ve, CheckCircle as ye } from "@mxenabled/mx-icons";
39
- import { T as ue } from "../TabContentContainer-j01JYR_7.mjs";
40
- import { DataGridPro as Ye } from "@mui/x-data-grid-pro";
41
- import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
42
- import { f as Ke } from "../ConnectDrawer-Bw5s6Dw1.mjs";
43
- import fe from "@mui/material/Button";
44
- import Ue from "@mui/material/IconButton";
45
- import qe from "@mui/material/ListItem";
46
- import Ze from "@mui/material/Popover";
47
- import { L as Je } from "../Loader-DUaFpDGv.mjs";
48
- const Qe = (a, n = 0, r = 0) => {
19
+ import { A as Fe, u as Re } from "../AccountDetailsHeader-Df1JkzYi.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-EbrN1oIo.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-CWuVvRq9.mjs";
32
+ import Ye from "@mui/material/TextField";
33
+ import { L as Q } from "../ListItemAction-DHa3KJPs.mjs";
34
+ import { C as ne } from "../CurrencyInput-DUsQbkXb.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-Bw5s6Dw1.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) => {
49
49
  if (r === 0) return 0;
50
- const t = n / (Ee * Ie);
50
+ const t = n / (Ie * Be);
51
51
  return Math.ceil(
52
52
  t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
53
53
  );
54
- }, et = (a, n, r, t, o) => {
54
+ }, rt = (a, n, r, t, o) => {
55
55
  const i = [];
56
56
  if (r === 0) {
57
57
  for (let d = 0; d < a; d++) {
58
- const c = n - t * (d + 1), m = n - t * d, b = c >= 0 ? t : m;
58
+ const c = n - t * (d + 1), m = n - t * d, _ = c >= 0 ? t : m;
59
59
  i.push({
60
60
  balance: c >= 0 ? c : 0,
61
61
  interest: r,
62
- payment: b,
63
- principal: b,
64
- timestamp: ce(
65
- le(
66
- se(o),
62
+ payment: _,
63
+ principal: _,
64
+ timestamp: de(
65
+ se(
66
+ ce(o),
67
67
  // convert seconds → Date
68
68
  d + 1
69
69
  // add (index + 1) months
@@ -75,45 +75,45 @@ const Qe = (a, n = 0, r = 0) => {
75
75
  }
76
76
  const p = r / 1200;
77
77
  for (let d = 0; d < a; d++) {
78
- const c = ce(le(se(o), d + 1)), m = Math.pow(1 + p, d), b = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, d + 1), u = n * f - t * ((f - 1) / p), S = t + Math.min(u, 0), P = b * p;
78
+ const c = de(se(ce(o), d + 1)), m = Math.pow(1 + p, d), _ = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, d + 1), h = n * f - t * ((f - 1) / p), v = t + Math.min(h, 0), M = _ * p;
79
79
  i.push({
80
- balance: Math.max(0, u),
81
- interest: P,
82
- payment: S,
83
- principal: S - P,
80
+ balance: Math.max(0, h),
81
+ interest: M,
82
+ payment: v,
83
+ principal: v - M,
84
84
  timestamp: c
85
85
  });
86
86
  }
87
87
  return i;
88
- }, tt = (a) => (a[a.length - 1] || {}).timestamp, rt = (a) => {
89
- const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = Qe(t, r ?? 0, n ?? 0), p = et(
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(
90
90
  i,
91
91
  t,
92
92
  r ?? 0,
93
93
  n ?? 0,
94
94
  o
95
- ), d = tt(p);
95
+ ), d = at(p);
96
96
  return {
97
97
  ...a,
98
98
  minimumFinalPayment: d,
99
99
  minimumPayments: p
100
100
  };
101
- }, xe = (a, n) => {
101
+ }, ge = (a, n) => {
102
102
  const [r, t] = a.reduce(
103
- ([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(rt(p)), [o, i]),
103
+ ([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(nt(p)), [o, i]),
104
104
  [[], []]
105
105
  );
106
106
  switch (n) {
107
- case B.FASTEST_PAYOFF_FIRST:
107
+ case I.FASTEST_PAYOFF_FIRST:
108
108
  r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
109
109
  break;
110
- case B.HIGHEST_INTEREST:
110
+ case I.HIGHEST_INTEREST:
111
111
  r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
112
112
  break;
113
- case B.LOWEST_BALANCE:
113
+ case I.LOWEST_BALANCE:
114
114
  r.sort((o, i) => o.balance - i.balance);
115
115
  break;
116
- case B.HIGHEST_BALANCE:
116
+ case I.HIGHEST_BALANCE:
117
117
  r.sort((o, i) => i.balance - o.balance);
118
118
  break;
119
119
  default:
@@ -121,47 +121,47 @@ const Qe = (a, n = 0, r = 0) => {
121
121
  }
122
122
  a.splice(0, a.length, ...r, ...t);
123
123
  };
124
- function at(a, n, r = 0) {
125
- const t = a.map((b) => ({ ...b })).filter(
126
- (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
124
+ function ot(a, n, r = 0) {
125
+ const t = a.map((_) => ({ ..._ })).filter(
126
+ (_) => _.interest_rate !== void 0 && _.monthly_payment !== void 0 && !_.is_paid_off
127
127
  );
128
- xe(t, n);
128
+ ge(t, n);
129
129
  let o = 0, i = 0;
130
130
  const p = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
131
- for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
132
- let b = !1;
133
- for (const [f, u] of t.entries()) {
134
- if (u.balance <= 0.01 || u.is_impossible) continue;
135
- const P = (u.interest_rate ?? 0) / 100 / 12, E = u.balance * P;
136
- let _ = u.monthly_payment ?? 0;
137
- f === 0 && r && (_ += r), u.balance += E;
138
- const v = Math.min(u.balance, _ + i);
139
- if (v <= E) {
140
- u.is_impossible = !0;
131
+ for (; t.some((_) => _.balance >= 0.01 && !_.is_impossible); ) {
132
+ let _ = !1;
133
+ for (const [f, h] of t.entries()) {
134
+ if (h.balance <= 0.01 || h.is_impossible) continue;
135
+ const M = (h.interest_rate ?? 0) / 100 / 12, P = h.balance * M;
136
+ let u = h.monthly_payment ?? 0;
137
+ f === 0 && r && (u += r), h.balance += P;
138
+ const S = Math.min(h.balance, u + i);
139
+ if (S <= P) {
140
+ h.is_impossible = !0;
141
141
  continue;
142
142
  }
143
- u.balance -= v, u.balance = u.balance < 0.01 ? 0 : u.balance, o += E, u.balance <= 0 && (i += _), v > 0 && (b = !0);
143
+ h.balance -= S, h.balance = h.balance < 0.01 ? 0 : h.balance, o += P, h.balance <= 0 && (i += u), S > 0 && (_ = !0);
144
144
  }
145
- b && d.setMonth(d.getMonth() + 1);
145
+ _ && d.setMonth(d.getMonth() + 1);
146
146
  }
147
- const c = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: d });
147
+ const c = t.some((_) => _.is_impossible && _.balance > 0), m = Ae({ start: p, end: d });
148
148
  return {
149
- payoffSavings: c ? "N/A" : M(o, "0,0.00"),
150
- payoffDate: c ? "Never" : K(d, U.MONTH_YEAR),
151
- payoffDuration: c ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
149
+ payoffSavings: c ? "N/A" : B(o, "0,0.00"),
150
+ payoffDate: c ? "Never" : U(d, q.MONTH_YEAR),
151
+ payoffDuration: c ? "Stagnant" : Ee(m, { format: ["years", "months"] }) || "0 months"
152
152
  };
153
153
  }
154
- const R = () => {
155
- if (!x.useContext(Me))
154
+ const F = () => {
155
+ if (!g.useContext(Pe))
156
156
  throw new Error("useCateUiStore() must be used within the GlobalDataContext");
157
- return q().uiStore;
158
- }, nt = ({ debts: a, onClickCta: n, sx: r }) => {
159
- const t = X(), { isMobile: o } = Y(), { debts: i } = C(), { selectedDebtPriority: p } = R(), { monthlyCashFlowProfile: d } = V(), { payoffDate: c, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
157
+ return Z().uiStore;
158
+ }, it = ({ debts: a, onClickCta: n, sx: r }) => {
159
+ const t = X(), { isMobile: o } = Y(), { debts: i } = C(), { selectedDebtPriority: p } = F(), { monthlyCashFlowProfile: d } = V(), { payoffDate: c, payoffSavings: m, payoffDuration: _ } = g.useMemo(() => {
160
160
  const f = d?.extra_payment ?? 0;
161
- return at(a, p, f);
161
+ return ot(a, p, f);
162
162
  }, [a, p, d]);
163
163
  return /* @__PURE__ */ e(
164
- be,
164
+ _e,
165
165
  {
166
166
  sx: {
167
167
  boxShadow: t.shadows[2],
@@ -190,7 +190,7 @@ const R = () => {
190
190
  /* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
191
191
  ] }),
192
192
  /* @__PURE__ */ s(y, { gap: o ? "4px" : "0", children: [
193
- /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
193
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: _ }),
194
194
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
195
195
  ] }),
196
196
  /* @__PURE__ */ e(
@@ -207,10 +207,10 @@ const R = () => {
207
207
  ] })
208
208
  }
209
209
  );
210
- }, ot = D(nt), it = ({ isOpen: a, onClose: n }) => {
211
- const r = X(), { debts: t } = C(), [o, i] = x.useState(!1);
210
+ }, lt = D(it), st = ({ isOpen: a, onClose: n }) => {
211
+ const r = X(), { debts: t } = C(), [o, i] = g.useState(!1);
212
212
  return /* @__PURE__ */ e(
213
- te,
213
+ re,
214
214
  {
215
215
  ariaLabelClose: "",
216
216
  isOpen: a,
@@ -224,7 +224,7 @@ const R = () => {
224
224
  /* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
225
225
  /* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
226
226
  ] }),
227
- /* @__PURE__ */ s(be, { sx: { display: "grid", py: 16, px: 24 }, children: [
227
+ /* @__PURE__ */ s(_e, { sx: { display: "grid", py: 16, px: 24 }, children: [
228
228
  /* @__PURE__ */ e(l, { mb: 4, variant: "H3", children: t.snowball_drawer_question }),
229
229
  /* @__PURE__ */ e(
230
230
  l,
@@ -267,7 +267,7 @@ const R = () => {
267
267
  /* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
268
268
  /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
269
269
  /* @__PURE__ */ e(
270
- G,
270
+ W,
271
271
  {
272
272
  sx: {
273
273
  display: "flex",
@@ -323,7 +323,7 @@ const R = () => {
323
323
  ] }),
324
324
  /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
325
325
  /* @__PURE__ */ e(
326
- G,
326
+ W,
327
327
  {
328
328
  sx: {
329
329
  width: 20,
@@ -353,7 +353,7 @@ const R = () => {
353
353
  ] }),
354
354
  /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
355
355
  /* @__PURE__ */ e(
356
- G,
356
+ W,
357
357
  {
358
358
  sx: {
359
359
  width: 20,
@@ -394,7 +394,7 @@ const R = () => {
394
394
  /* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
395
395
  /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
396
396
  /* @__PURE__ */ e(
397
- G,
397
+ W,
398
398
  {
399
399
  sx: {
400
400
  display: "flex",
@@ -450,7 +450,7 @@ const R = () => {
450
450
  ] }),
451
451
  /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
452
452
  /* @__PURE__ */ e(
453
- G,
453
+ W,
454
454
  {
455
455
  sx: {
456
456
  width: 20,
@@ -502,7 +502,7 @@ const R = () => {
502
502
  /* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
503
503
  /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
504
504
  /* @__PURE__ */ e(
505
- G,
505
+ W,
506
506
  {
507
507
  sx: {
508
508
  display: "flex",
@@ -568,8 +568,8 @@ const R = () => {
568
568
  ] })
569
569
  }
570
570
  );
571
- }, lt = D(it), st = "#FF7B08";
572
- function ct(a, n) {
571
+ }, ct = D(st), dt = "#FF7B08";
572
+ function pt(a, n) {
573
573
  const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
574
574
  Math.max(0, Math.min(255, Math.round(r * n))),
575
575
  Math.max(0, Math.min(255, Math.round(t * n))),
@@ -577,7 +577,7 @@ function ct(a, n) {
577
577
  ];
578
578
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
579
579
  }
580
- const ge = ({
580
+ const we = ({
581
581
  sx: a,
582
582
  height: n = 500,
583
583
  width: r,
@@ -586,32 +586,32 @@ const ge = ({
586
586
  onClickArea: i,
587
587
  onHoverArea: p
588
588
  }) => {
589
- const d = He(), { onEvent: c } = k(), m = t.filter((h) => !h.is_impossible), b = [
589
+ const d = We(), { onEvent: c } = k(), m = t.filter((b) => !b.is_impossible), _ = [
590
590
  ...new Set(
591
- m.flatMap((h) => h.dataset.map((w) => new Date(w.x).getTime()))
591
+ m.flatMap((b) => b.dataset.map((x) => new Date(x.x).getTime()))
592
592
  )
593
- ].sort((h, w) => h - w).map((h) => new Date(h)), f = m.map((h) => {
594
- const w = new Map(h.dataset.map((F) => [new Date(F.x).getTime(), F.y]));
595
- let I = w.get(b[0].getTime()) ?? 0;
596
- const N = b.map((F) => {
597
- const O = w.get(F.getTime()) ?? I;
598
- return I = O, { x: F, y: O };
593
+ ].sort((b, x) => b - x).map((b) => new Date(b)), f = m.map((b) => {
594
+ const x = new Map(b.dataset.map((N) => [new Date(N.x).getTime(), N.y]));
595
+ let E = x.get(_[0].getTime()) ?? 0;
596
+ const L = _.map((N) => {
597
+ const z = x.get(N.getTime()) ?? E;
598
+ return E = z, { x: N, y: z };
599
599
  });
600
- return { ...h, dataset: N };
601
- }), u = f.reduce(
602
- (h, w) => h + (w.dataset[0]?.y ?? 0),
600
+ return { ...b, dataset: L };
601
+ }), h = f.reduce(
602
+ (b, x) => b + (x.dataset[0]?.y ?? 0),
603
603
  0
604
- ), S = b.map((h, w) => {
605
- const I = w / (b.length - 1), N = u * (1 - I);
606
- return { x: h, y: N };
607
- }), P = Math.ceil(u / 100) * 100, E = b, _ = f.map((h, w) => {
608
- const I = 1 - w / f.length * 0.5, N = ct(st, I);
604
+ ), v = _.map((b, x) => {
605
+ const E = x / (_.length - 1), L = h * (1 - E);
606
+ return { x: b, y: L };
607
+ }), M = Math.ceil(h / 100) * 100, P = _, u = f.map((b, x) => {
608
+ const E = 1 - x / f.length * 0.5, L = pt(dt, E);
609
609
  return {
610
- id: `debt-${w}`,
611
- guid: h.guid,
612
- label: h.name,
613
- data: h.dataset.map((F) => F.y),
614
- color: N,
610
+ id: `debt-${x}`,
611
+ guid: b.guid,
612
+ label: b.name,
613
+ data: b.dataset.map((N) => N.y),
614
+ color: L,
615
615
  curve: "linear",
616
616
  type: "line",
617
617
  area: !0,
@@ -619,10 +619,10 @@ const ge = ({
619
619
  showMark: !1
620
620
  };
621
621
  });
622
- _.push({
622
+ u.push({
623
623
  id: "payoff-line",
624
624
  label: "Payoff Line",
625
- data: S.map((h) => h.y),
625
+ data: v.map((b) => b.y),
626
626
  color: d.palette.grey[700],
627
627
  curve: "linear",
628
628
  type: "line",
@@ -630,9 +630,9 @@ const ge = ({
630
630
  showMark: !1,
631
631
  disableHighlight: !0
632
632
  });
633
- const v = (h) => _.findIndex((w) => w?.guid === h);
633
+ const S = (b) => u.findIndex((x) => x?.guid === b);
634
634
  return /* @__PURE__ */ e(
635
- re,
635
+ ae,
636
636
  {
637
637
  sx: {
638
638
  width: "100%",
@@ -647,21 +647,21 @@ const ge = ({
647
647
  }
648
648
  },
649
649
  children: /* @__PURE__ */ e(
650
- $e,
650
+ Oe,
651
651
  {
652
652
  axisHighlight: { x: "none" },
653
653
  disableLineItemHighlight: !0,
654
654
  height: n,
655
- onAreaClick: (h, w) => {
655
+ onAreaClick: (b, x) => {
656
656
  i?.();
657
- const I = _.find((N) => N.id === w.seriesId);
658
- c(T.DEBTS_CLICK_CHART_AREA, { account_guid: I?.guid });
657
+ const E = u.find((L) => L.id === x.seriesId);
658
+ c(T.DEBTS_CLICK_CHART_AREA, { account_guid: E?.guid });
659
659
  },
660
- onHighlightChange: (h) => {
661
- const w = _.find((I) => I.id === h?.seriesId)?.guid;
662
- p?.(w ?? "");
660
+ onHighlightChange: (b) => {
661
+ const x = u.find((E) => E.id === b?.seriesId)?.guid;
662
+ p?.(x ?? "");
663
663
  },
664
- series: _,
664
+ series: u,
665
665
  skipAnimation: !0,
666
666
  slotProps: {
667
667
  legend: {
@@ -685,10 +685,10 @@ const ge = ({
685
685
  strokeDasharray: "10 5",
686
686
  strokeWidth: 1
687
687
  },
688
- [`& .MuiLineElement-series-debt-${v(o ?? "0")}`]: {
688
+ [`& .MuiLineElement-series-debt-${S(o ?? "0")}`]: {
689
689
  opacity: 1
690
690
  },
691
- [`& .MuiAreaElement-series-debt-${v(o ?? "0")}`]: {
691
+ [`& .MuiAreaElement-series-debt-${S(o ?? "0")}`]: {
692
692
  opacity: 1
693
693
  },
694
694
  "& .MuiChartsAxis-tickLabel > tspan": {
@@ -700,30 +700,30 @@ const ge = ({
700
700
  width: r,
701
701
  xAxis: [
702
702
  {
703
- data: E,
703
+ data: P,
704
704
  scaleType: "time",
705
- min: b[0],
705
+ min: _[0],
706
706
  disableTicks: !0,
707
- valueFormatter: (h) => K(h, U.MONTH_SHORT_YEAR)
707
+ valueFormatter: (b) => U(b, q.MONTH_SHORT_YEAR)
708
708
  }
709
709
  ],
710
710
  yAxis: [
711
711
  {
712
712
  min: 0,
713
- max: P,
713
+ max: M,
714
714
  disableTicks: !0,
715
- valueFormatter: (h) => M(h, "0a")
715
+ valueFormatter: (b) => B(b, "0a")
716
716
  }
717
717
  ]
718
718
  }
719
719
  )
720
720
  }
721
721
  );
722
- }, dt = () => {
723
- const a = X(), { debts: n } = C(), { selectedDebtChartData: r } = R();
722
+ }, mt = () => {
723
+ const a = X(), { debts: n } = C(), { selectedDebtChartData: r } = F();
724
724
  return /* @__PURE__ */ s($, { children: [
725
725
  /* @__PURE__ */ s(
726
- Fe,
726
+ Le,
727
727
  {
728
728
  sx: {
729
729
  "& .MuiCardContent-root:last-child": {
@@ -731,8 +731,8 @@ const ge = ({
731
731
  }
732
732
  },
733
733
  children: [
734
- /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: n.details_chart_title }) }),
735
- /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(ge, { debts: [r], height: 250 }) })
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 }) })
736
736
  ]
737
737
  }
738
738
  ),
@@ -746,9 +746,9 @@ const ge = ({
746
746
  }
747
747
  )
748
748
  ] });
749
- }, pt = D(dt), mt = () => {
750
- const a = X(), { onEvent: n } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: o, showError: i } = R();
751
- return x.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || o ? /* @__PURE__ */ e(
749
+ }, ht = D(mt), ut = () => {
750
+ const a = X(), { onEvent: n } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: o, showError: i } = F();
751
+ return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(ye, { children: i || o ? /* @__PURE__ */ e(
752
752
  l,
753
753
  {
754
754
  color: a.palette.secondary.main,
@@ -758,12 +758,12 @@ const ge = ({
758
758
  children: i ? r.schedule_error_message : r.schedule_complete_message
759
759
  }
760
760
  ) : /* @__PURE__ */ s($, { children: [
761
- /* @__PURE__ */ s(g, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
761
+ /* @__PURE__ */ s(w, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
762
762
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
763
763
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
764
764
  ] }),
765
- t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(g, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(g, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
766
- g,
765
+ t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(w, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
766
+ w,
767
767
  {
768
768
  sx: {
769
769
  borderBottom: `1px solid ${a.palette.border.light}`,
@@ -773,12 +773,12 @@ const ge = ({
773
773
  pr: 24
774
774
  },
775
775
  children: [
776
- /* @__PURE__ */ s(g, { flexGrow: 1, children: [
777
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(p, U.MONTH_YEAR) }),
776
+ /* @__PURE__ */ s(w, { flexGrow: 1, children: [
777
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(p, q.MONTH_YEAR) }),
778
778
  /* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
779
779
  ] }),
780
- /* @__PURE__ */ s(g, { children: [
781
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: M(d, "0,0.00") }),
780
+ /* @__PURE__ */ s(w, { children: [
781
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: B(d, "0,0.00") }),
782
782
  /* @__PURE__ */ e(
783
783
  l,
784
784
  {
@@ -786,15 +786,15 @@ const ge = ({
786
786
  color: a.palette.success.main,
787
787
  textAlign: "end",
788
788
  variant: "Tiny",
789
- children: `+${M(c, "0,0")}`
789
+ children: `+${B(c, "0,0")}`
790
790
  }
791
791
  )
792
792
  ] })
793
793
  ]
794
794
  }
795
795
  ) }) }, String(p))),
796
- /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
797
- g,
796
+ /* @__PURE__ */ e(w, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
797
+ w,
798
798
  {
799
799
  sx: {
800
800
  alignItems: "center",
@@ -810,8 +810,8 @@ const ge = ({
810
810
  }
811
811
  ) })
812
812
  ] }) });
813
- }, ht = D(mt), ut = D(({ debt: a }) => {
814
- const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.interest_rate ?? 0), p = o < 0, d = async () => {
813
+ }, bt = D(ut), _t = D(({ debt: a }) => {
814
+ const { debts: n } = C(), { updateAccount: r } = J(), { onEvent: t } = k(), [o, i] = g.useState(a.interest_rate ?? 0), p = o < 0, d = async () => {
815
815
  await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
816
816
  }, c = () => {
817
817
  setTimeout(() => {
@@ -819,17 +819,17 @@ const ge = ({
819
819
  }, 250);
820
820
  };
821
821
  return /* @__PURE__ */ e(
822
- J,
822
+ Q,
823
823
  {
824
824
  isSaveDisabled: p,
825
825
  label: `${n.details_interest_rate} (%)`,
826
826
  onCancel: c,
827
827
  onSave: d,
828
828
  primaryText: n.details_interest_rate,
829
- secondaryText: Be(Number(a.interest_rate) / 100),
829
+ secondaryText: Me(Number(a.interest_rate) / 100),
830
830
  zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
831
831
  children: /* @__PURE__ */ e(
832
- Xe,
832
+ Ye,
833
833
  {
834
834
  error: p,
835
835
  fullWidth: !0,
@@ -840,8 +840,8 @@ const ge = ({
840
840
  )
841
841
  }
842
842
  );
843
- }), bt = D(({ debt: a }) => {
844
- const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
843
+ }), yt = D(({ debt: a }) => {
844
+ const { debts: n } = C(), { updateAccount: r } = J(), { onEvent: t } = k(), [o, i] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
845
845
  await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
846
846
  }, c = () => {
847
847
  setTimeout(() => {
@@ -849,17 +849,17 @@ const ge = ({
849
849
  }, 250);
850
850
  };
851
851
  return /* @__PURE__ */ e(
852
- J,
852
+ Q,
853
853
  {
854
854
  isSaveDisabled: p,
855
855
  label: n.details_monthly_payment,
856
856
  onCancel: c,
857
857
  onSave: d,
858
858
  primaryText: n.details_monthly_payment,
859
- secondaryText: M(a.monthly_payment, "0,0"),
859
+ secondaryText: B(a.monthly_payment, "0,0"),
860
860
  zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
861
861
  children: /* @__PURE__ */ e(
862
- ae,
862
+ ne,
863
863
  {
864
864
  amount: o,
865
865
  autoFocus: !0,
@@ -872,8 +872,8 @@ const ge = ({
872
872
  )
873
873
  }
874
874
  );
875
- }), _t = D(({ debt: a }) => {
876
- const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
875
+ }), ft = D(({ debt: a }) => {
876
+ const { debts: n } = C(), { updateAccount: r } = J(), { onEvent: t } = k(), [o, i] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
877
877
  await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
878
878
  }, c = () => {
879
879
  setTimeout(() => {
@@ -881,17 +881,17 @@ const ge = ({
881
881
  }, 250);
882
882
  };
883
883
  return /* @__PURE__ */ e(
884
- J,
884
+ Q,
885
885
  {
886
886
  isSaveDisabled: p,
887
887
  label: n.details_original_balance,
888
888
  onCancel: c,
889
889
  onSave: d,
890
890
  primaryText: n.details_original_balance,
891
- secondaryText: M(a.original_balance, "0,0"),
891
+ secondaryText: B(a.original_balance, "0,0"),
892
892
  zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
893
893
  children: /* @__PURE__ */ e(
894
- ae,
894
+ ne,
895
895
  {
896
896
  amount: o,
897
897
  autoFocus: !0,
@@ -904,35 +904,35 @@ const ge = ({
904
904
  )
905
905
  }
906
906
  );
907
- }), yt = () => {
908
- const { onEvent: a } = k(), { selectedDebtChartData: n } = R();
909
- return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(g, { bgcolor: "background.paper", children: [
907
+ }), xt = () => {
908
+ const { onEvent: a } = k(), { selectedDebtChartData: n } = F();
909
+ return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
910
910
  n?.goal && /* @__PURE__ */ s($, { children: [
911
- /* @__PURE__ */ e(Ge, { goal: n.goal }),
912
- /* @__PURE__ */ e(j, {}),
913
- /* @__PURE__ */ e(je, { goal: n.goal }),
914
- /* @__PURE__ */ e(j, {}),
915
911
  /* @__PURE__ */ e(ze, { goal: n.goal }),
916
- /* @__PURE__ */ e(j, {})
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, {})
917
917
  ] }),
918
918
  !n?.goal && n?.account && /* @__PURE__ */ s($, { children: [
919
- /* @__PURE__ */ e(bt, { debt: n }),
920
- /* @__PURE__ */ e(j, {}),
921
- /* @__PURE__ */ e(ut, { debt: n }),
922
- /* @__PURE__ */ e(j, {}),
919
+ /* @__PURE__ */ e(yt, { debt: n }),
920
+ /* @__PURE__ */ e(G, {}),
923
921
  /* @__PURE__ */ e(_t, { debt: n }),
924
- /* @__PURE__ */ e(j, {})
922
+ /* @__PURE__ */ e(G, {}),
923
+ /* @__PURE__ */ e(ft, { debt: n }),
924
+ /* @__PURE__ */ e(G, {})
925
925
  ] })
926
926
  ] });
927
- }, ft = D(yt), xt = ({ setTabValue: a, sx: n }) => {
928
- const { debts: r } = C(), { showError: t, showCompleted: o } = R();
929
- return x.useEffect(() => {
927
+ }, gt = D(xt), wt = ({ setTabValue: a, sx: n }) => {
928
+ const { debts: r } = C(), { showError: t, showCompleted: o } = F();
929
+ return g.useEffect(() => {
930
930
  t && a(1);
931
- }, [t]), !t && !o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(g, { gap: 16, children: [
932
- /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
933
- pe,
931
+ }, [t]), !t && !o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
932
+ /* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
933
+ me,
934
934
  {
935
- icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
935
+ icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(fe, { color: "success", filled: !0 }),
936
936
  severity: "error",
937
937
  sx: {
938
938
  alignItems: "start",
@@ -945,13 +945,13 @@ const ge = ({
945
945
  }
946
946
  },
947
947
  children: [
948
- /* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
948
+ /* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
949
949
  /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
950
950
  ]
951
951
  }
952
952
  ) }),
953
- t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
954
- pe,
953
+ t && /* @__PURE__ */ e(ue, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
954
+ me,
955
955
  {
956
956
  icon: /* @__PURE__ */ e($, {}),
957
957
  severity: "error",
@@ -963,18 +963,18 @@ const ge = ({
963
963
  }
964
964
  },
965
965
  children: [
966
- /* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
966
+ /* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
967
967
  /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
968
968
  ]
969
969
  }
970
970
  ) })
971
971
  ] });
972
- }, gt = D(xt), wt = () => {
973
- const { debts: a } = C(), { showError: n, showCompleted: r } = R(), [t, o] = x.useState(0);
972
+ }, Ct = D(wt), St = () => {
973
+ const { debts: a } = C(), { showError: n, showCompleted: r } = F(), [t, o] = g.useState(0);
974
974
  return /* @__PURE__ */ s($, { children: [
975
- (n || r) && /* @__PURE__ */ e(gt, { setTabValue: o, sx: { mt: -24 } }),
975
+ (n || r) && /* @__PURE__ */ e(Ct, { setTabValue: o, sx: { mt: -24 } }),
976
976
  /* @__PURE__ */ s(
977
- We,
977
+ je,
978
978
  {
979
979
  "aria-label": a.details_tabs_aria_label,
980
980
  centered: !0,
@@ -984,7 +984,7 @@ const ge = ({
984
984
  variant: "fullWidth",
985
985
  children: [
986
986
  /* @__PURE__ */ e(
987
- de,
987
+ pe,
988
988
  {
989
989
  "aria-controls": "debt-schedule-tabpanel-0",
990
990
  id: "debt-schedule-tab-0",
@@ -992,7 +992,7 @@ const ge = ({
992
992
  }
993
993
  ),
994
994
  /* @__PURE__ */ e(
995
- de,
995
+ pe,
996
996
  {
997
997
  "aria-controls": "debt-details-tabpanel-1",
998
998
  id: "debt-details-tab-1",
@@ -1002,26 +1002,26 @@ const ge = ({
1002
1002
  ]
1003
1003
  }
1004
1004
  ),
1005
- /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ht, {}) }),
1006
- /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(ft, {}) })
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, {}) })
1007
1007
  ] });
1008
- }, Ct = D(wt), St = ({ isOpen: a, onClose: n }) => {
1009
- const { debts: r } = C(), { showError: t, showCompleted: o } = R(), i = t || o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(pt, {});
1008
+ }, vt = D(St), Dt = ({ isOpen: a, onClose: n }) => {
1009
+ const { debts: r } = C(), { showError: t, showCompleted: o } = F(), i = t || o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(ht, {});
1010
1010
  return /* @__PURE__ */ e(
1011
- te,
1011
+ re,
1012
1012
  {
1013
1013
  ariaLabelClose: r.details_close_aria,
1014
1014
  isOpen: a,
1015
1015
  onClose: n,
1016
1016
  title: r.details_title,
1017
- children: /* @__PURE__ */ s(g, { bgcolor: "background.default", children: [
1018
- /* @__PURE__ */ e(ke, { customDetailsChart: i }),
1019
- /* @__PURE__ */ e(Ct, {})
1017
+ children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
1018
+ /* @__PURE__ */ e(Fe, { customDetailsChart: i }),
1019
+ /* @__PURE__ */ e(vt, {})
1020
1020
  ] })
1021
1021
  }
1022
1022
  );
1023
- }, vt = D(() => {
1024
- const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = k(), [o, i] = x.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
1023
+ }, Tt = D(() => {
1024
+ const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = k(), [o, i] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
1025
1025
  n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1026
1026
  user_guid: n?.user_guid
1027
1027
  }));
@@ -1031,17 +1031,17 @@ const ge = ({
1031
1031
  }, 250);
1032
1032
  };
1033
1033
  return /* @__PURE__ */ e(
1034
- J,
1034
+ Q,
1035
1035
  {
1036
1036
  isSaveDisabled: p,
1037
1037
  label: a.paydown_drawer_extra_payment,
1038
1038
  onCancel: c,
1039
1039
  onSave: d,
1040
1040
  primaryText: a.paydown_drawer_extra_payment,
1041
- secondaryText: M(n?.extra_payment, "0,0"),
1041
+ secondaryText: B(n?.extra_payment, "0,0"),
1042
1042
  zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1043
1043
  children: /* @__PURE__ */ e(
1044
- ae,
1044
+ ne,
1045
1045
  {
1046
1046
  amount: o,
1047
1047
  autoFocus: !0,
@@ -1054,40 +1054,40 @@ const ge = ({
1054
1054
  )
1055
1055
  }
1056
1056
  );
1057
- }), Dt = () => {
1058
- const { debts: a } = C(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
1059
- return /* @__PURE__ */ s(g, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1060
- /* @__PURE__ */ s(g, { p: 24, children: [
1061
- /* @__PURE__ */ s(g, { alignItems: "center", gap: 4, mb: 24, children: [
1057
+ }), At = () => {
1058
+ const { debts: a } = C(), { totalMonthlyPayments: n } = Z(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
1059
+ return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1060
+ /* @__PURE__ */ s(w, { p: 24, children: [
1061
+ /* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
1062
1062
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1063
- /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: M(n, "0,0") }),
1063
+ /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: B(n, "0,0") }),
1064
1064
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1065
1065
  ] }),
1066
- /* @__PURE__ */ s(g, { children: [
1066
+ /* @__PURE__ */ s(w, { children: [
1067
1067
  /* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
1068
1068
  /* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
1069
1069
  ] })
1070
1070
  ] }),
1071
- /* @__PURE__ */ e(g, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(vt, {}) }),
1072
- /* @__PURE__ */ e(g, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(g, { gap: 4, children: [
1071
+ /* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Tt, {}) }),
1072
+ /* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { gap: 4, children: [
1073
1073
  /* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
1074
- /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: M(t, "0,0") })
1074
+ /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: B(t, "0,0") })
1075
1075
  ] }) })
1076
1076
  ] });
1077
- }, Tt = D(Dt), At = ({ isOpen: a, onClose: n }) => {
1077
+ }, Et = D(At), It = ({ isOpen: a, onClose: n }) => {
1078
1078
  const { debts: r } = C();
1079
1079
  return /* @__PURE__ */ e(
1080
- te,
1080
+ re,
1081
1081
  {
1082
1082
  ariaLabelClose: r.paydown_drawer_close_aria,
1083
1083
  isOpen: a,
1084
1084
  onClose: n,
1085
1085
  title: r.paydown_drawer_title,
1086
- children: /* @__PURE__ */ e(Tt, {})
1086
+ children: /* @__PURE__ */ e(Et, {})
1087
1087
  }
1088
1088
  );
1089
1089
  };
1090
- function Et(a, n) {
1090
+ function Bt(a, n) {
1091
1091
  const r = (t) => {
1092
1092
  if (typeof t == "number") return t;
1093
1093
  if (t === "!" || t === "✓") return 1 / 0;
@@ -1095,19 +1095,19 @@ function Et(a, n) {
1095
1095
  };
1096
1096
  return r(a) - r(n);
1097
1097
  }
1098
- function It(a) {
1098
+ function Mt(a) {
1099
1099
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1100
1100
  }
1101
- const Bt = (a) => {
1101
+ const Pt = (a) => {
1102
1102
  const n = {
1103
1103
  text: "#121417",
1104
1104
  background: "#FFB252"
1105
1105
  };
1106
1106
  return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1107
- }, Mt = (a) => {
1108
- const n = String(a.formattedValue), r = Bt(n);
1107
+ }, kt = (a) => {
1108
+ const n = String(a.formattedValue), r = Pt(n);
1109
1109
  return /* @__PURE__ */ e(
1110
- re,
1110
+ ae,
1111
1111
  {
1112
1112
  sx: {
1113
1113
  display: "flex",
@@ -1123,37 +1123,37 @@ const Bt = (a) => {
1123
1123
  children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
1124
1124
  }
1125
1125
  );
1126
- }, Pt = (a) => {
1127
- const n = a.row.account, r = Ke[n.account_type];
1128
- return /* @__PURE__ */ s(g, { alignItems: "center", flexDirection: "row", children: [
1126
+ }, Nt = (a) => {
1127
+ const n = a.row.account, r = qe[n.account_type];
1128
+ return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
1129
1129
  /* @__PURE__ */ e(
1130
- De,
1130
+ Te,
1131
1131
  {
1132
1132
  alt: `${n.institutionName}`,
1133
1133
  institutionGuid: n.institution_guid || ""
1134
1134
  }
1135
1135
  ),
1136
- /* @__PURE__ */ s(g, { ml: 12, children: [
1136
+ /* @__PURE__ */ s(w, { ml: 12, children: [
1137
1137
  /* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
1138
1138
  /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1139
1139
  ] })
1140
1140
  ] });
1141
- }, kt = ({
1141
+ }, Ft = ({
1142
1142
  sx: a = {},
1143
1143
  debts: n,
1144
1144
  hoveredDebtGuid: r,
1145
1145
  onHoverRow: t,
1146
1146
  onClickRow: o
1147
1147
  }) => {
1148
- const i = X(), { onEvent: p } = k(), { isMobile: d } = Y(), { debts: c } = C(), [m, b] = x.useState([
1148
+ const i = X(), { onEvent: p } = k(), { isMobile: d } = Y(), { debts: c } = C(), [m, _] = g.useState([
1149
1149
  { field: "priority", sort: "asc" }
1150
1150
  ]), f = [
1151
1151
  {
1152
1152
  field: "priority",
1153
1153
  headerName: c.table_column_priority,
1154
- renderHeader: z,
1155
- renderCell: Mt,
1156
- sortComparator: Et,
1154
+ renderHeader: j,
1155
+ renderCell: kt,
1156
+ sortComparator: Bt,
1157
1157
  sortable: !0,
1158
1158
  hideSortIcons: !0,
1159
1159
  type: "custom",
@@ -1165,8 +1165,8 @@ const Bt = (a) => {
1165
1165
  {
1166
1166
  field: "account",
1167
1167
  headerName: c.table_column_account,
1168
- renderHeader: z,
1169
- renderCell: Pt,
1168
+ renderHeader: j,
1169
+ renderCell: Nt,
1170
1170
  sortable: !1,
1171
1171
  type: "custom",
1172
1172
  align: "left",
@@ -1177,8 +1177,8 @@ const Bt = (a) => {
1177
1177
  {
1178
1178
  field: "balance",
1179
1179
  headerName: c.table_column_balance,
1180
- renderHeader: z,
1181
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: M(_.value, "0,0") }),
1180
+ renderHeader: j,
1181
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: B(u.value, "0,0") }),
1182
1182
  sortable: !0,
1183
1183
  hideSortIcons: d,
1184
1184
  type: "number",
@@ -1190,8 +1190,8 @@ const Bt = (a) => {
1190
1190
  {
1191
1191
  field: "interest_rate",
1192
1192
  headerName: c.table_column_interest_rate,
1193
- renderHeader: z,
1194
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(_.value) ? "---" : `${Number(_.value).toFixed(2)}%` }),
1193
+ renderHeader: j,
1194
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(u.value) ? "---" : `${Number(u.value).toFixed(2)}%` }),
1195
1195
  sortable: !0,
1196
1196
  hideSortIcons: d,
1197
1197
  type: "number",
@@ -1203,8 +1203,8 @@ const Bt = (a) => {
1203
1203
  {
1204
1204
  field: "projected_payoff_date",
1205
1205
  headerName: c.table_column_payoff_date,
1206
- renderHeader: z,
1207
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: _.value ? K(_.value, U.MONTH_SHORT_YEAR) : "---" }),
1206
+ renderHeader: j,
1207
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: u.value ? U(u.value, q.MONTH_SHORT_YEAR) : "---" }),
1208
1208
  sortable: !0,
1209
1209
  hideSortIcons: d,
1210
1210
  type: "number",
@@ -1216,8 +1216,8 @@ const Bt = (a) => {
1216
1216
  {
1217
1217
  field: "monthly_payment",
1218
1218
  headerName: c.table_column_amount_due,
1219
- renderHeader: z,
1220
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof _.value == "number" ? M(_.value, "0,0") : "---" }),
1219
+ renderHeader: j,
1220
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof u.value == "number" ? B(u.value, "0,0") : "---" }),
1221
1221
  sortable: !0,
1222
1222
  hideSortIcons: d,
1223
1223
  type: "number",
@@ -1226,13 +1226,13 @@ const Bt = (a) => {
1226
1226
  minWidth: 122,
1227
1227
  flex: 0.6
1228
1228
  }
1229
- ], u = [
1229
+ ], h = [
1230
1230
  ...f.slice(0, 3),
1231
1231
  {
1232
1232
  field: "chevron",
1233
1233
  headerName: "",
1234
1234
  renderHeader: void 0,
1235
- renderCell: () => /* @__PURE__ */ e(ee, { name: "chevron_right'" }),
1235
+ renderCell: () => /* @__PURE__ */ e(te, { name: "chevron_right'" }),
1236
1236
  sortable: !0,
1237
1237
  hideSortIcons: !0,
1238
1238
  type: "custom",
@@ -1240,16 +1240,16 @@ const Bt = (a) => {
1240
1240
  headerAlign: "right",
1241
1241
  width: 20
1242
1242
  }
1243
- ], S = x.useMemo(() => n.map((_, v) => ({
1244
- ..._,
1245
- id: v,
1246
- priority: It(_)
1247
- })), [n]), P = (_) => {
1248
- const L = _.target.closest("[data-id]")?.getAttribute("data-id"), h = n[Number(L)];
1249
- t?.(h?.guid ?? "");
1250
- }, E = (_) => S.find((v) => v.guid === _)?.id;
1243
+ ], v = g.useMemo(() => n.map((u, S) => ({
1244
+ ...u,
1245
+ id: S,
1246
+ priority: Mt(u)
1247
+ })), [n]), M = (u) => {
1248
+ const R = u.target.closest("[data-id]")?.getAttribute("data-id"), b = n[Number(R)];
1249
+ t?.(b?.guid ?? "");
1250
+ }, P = (u) => v.find((S) => S.guid === u)?.id;
1251
1251
  return /* @__PURE__ */ e(
1252
- re,
1252
+ ae,
1253
1253
  {
1254
1254
  sx: {
1255
1255
  height: "100dvh",
@@ -1260,31 +1260,31 @@ const Bt = (a) => {
1260
1260
  ...a
1261
1261
  },
1262
1262
  children: /* @__PURE__ */ e(
1263
- Ye,
1263
+ Ue,
1264
1264
  {
1265
- columns: d ? u : f,
1265
+ columns: d ? h : f,
1266
1266
  disableColumnFilter: !0,
1267
1267
  disableColumnMenu: !0,
1268
1268
  hideFooter: !0,
1269
1269
  initialState: { sorting: { sortModel: m } },
1270
- onRowClick: (_) => {
1271
- o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: _.row.guid });
1270
+ onRowClick: (u) => {
1271
+ o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
1272
1272
  },
1273
- onSortModelChange: (_) => {
1274
- b(_), p(T.DEBTS_CLICK_TABLE_SORT);
1273
+ onSortModelChange: (u) => {
1274
+ _(u), p(T.DEBTS_CLICK_TABLE_SORT);
1275
1275
  },
1276
- rows: S,
1276
+ rows: v,
1277
1277
  slotProps: {
1278
1278
  baseIconButton: { color: "secondary", sx: { ml: 8 } },
1279
1279
  row: {
1280
- onMouseEnter: P,
1280
+ onMouseEnter: M,
1281
1281
  onMouseLeave: () => t?.("")
1282
1282
  }
1283
1283
  },
1284
1284
  sortModel: m,
1285
1285
  sortingOrder: ["asc", "desc"],
1286
1286
  sx: {
1287
- [`& .MuiDataGrid-row[data-id="${E(r)}"]`]: {
1287
+ [`& .MuiDataGrid-row[data-id="${P(r)}"]`]: {
1288
1288
  backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1289
1289
  filter: "brightness(98%)"
1290
1290
  }
@@ -1293,54 +1293,54 @@ const Bt = (a) => {
1293
1293
  )
1294
1294
  }
1295
1295
  );
1296
- }, Nt = ({ buttonText: a, isOpen: n, onClick: r }) => {
1296
+ }, Rt = ({ buttonText: a, isOpen: n, onClick: r }) => {
1297
1297
  const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
1298
1298
  return t || o ? /* @__PURE__ */ e(
1299
- fe,
1299
+ xe,
1300
1300
  {
1301
1301
  "aria-controls": "prioritize-debts",
1302
1302
  "aria-describedby": "prioritize-debts",
1303
1303
  "aria-haspopup": !0,
1304
1304
  "aria-label": "prioritize-debts",
1305
1305
  onClick: r,
1306
- startIcon: /* @__PURE__ */ e(ee, { name: i }),
1306
+ startIcon: /* @__PURE__ */ e(te, { name: i }),
1307
1307
  sx: { justifyContent: "start", minWidth: 214, mx: 4 },
1308
1308
  children: a
1309
1309
  }
1310
1310
  ) : /* @__PURE__ */ e(
1311
- Ue,
1311
+ Ze,
1312
1312
  {
1313
1313
  "aria-controls": "prioritize-debts",
1314
1314
  "aria-describedby": "prioritize-debts",
1315
1315
  "aria-haspopup": !0,
1316
1316
  "aria-label": "prioritize-debts",
1317
1317
  onClick: r,
1318
- children: /* @__PURE__ */ e(ee, { name: i })
1318
+ children: /* @__PURE__ */ e(te, { name: i })
1319
1319
  }
1320
1320
  );
1321
- }, Ft = D(({ buttonEl: a, onClose: n }) => {
1322
- const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = R(), p = !!a, d = [
1321
+ }, Lt = D(({ buttonEl: a, onClose: n }) => {
1322
+ const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = F(), p = !!a, d = [
1323
1323
  {
1324
- priority: B.FASTEST_PAYOFF_FIRST,
1324
+ priority: I.FASTEST_PAYOFF_FIRST,
1325
1325
  text: t.priority_sort_fastest_payoff
1326
1326
  },
1327
1327
  {
1328
- priority: B.HIGHEST_INTEREST,
1328
+ priority: I.HIGHEST_INTEREST,
1329
1329
  text: t.priority_sort_highest_interest
1330
1330
  },
1331
1331
  {
1332
- priority: B.LOWEST_BALANCE,
1332
+ priority: I.LOWEST_BALANCE,
1333
1333
  text: t.priority_sort_lowest_balance
1334
1334
  },
1335
1335
  {
1336
- priority: B.HIGHEST_BALANCE,
1336
+ priority: I.HIGHEST_BALANCE,
1337
1337
  text: t.priority_sort_highest_balance
1338
1338
  }
1339
1339
  ], c = (m) => {
1340
1340
  i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
1341
1341
  };
1342
1342
  return /* @__PURE__ */ e(
1343
- Ze,
1343
+ Qe,
1344
1344
  {
1345
1345
  anchorEl: a,
1346
1346
  anchorOrigin: {
@@ -1354,8 +1354,8 @@ const Bt = (a) => {
1354
1354
  vertical: "top",
1355
1355
  horizontal: "left"
1356
1356
  },
1357
- children: /* @__PURE__ */ e(_e, { children: d.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
1358
- qe,
1357
+ children: /* @__PURE__ */ e(ye, { children: d.map(({ priority: m, text: _ }) => /* @__PURE__ */ s(
1358
+ Je,
1359
1359
  {
1360
1360
  onClick: () => c(m),
1361
1361
  sx: {
@@ -1373,32 +1373,32 @@ const Bt = (a) => {
1373
1373
  }
1374
1374
  },
1375
1375
  children: [
1376
- /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
1377
- o === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1376
+ /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: _ }),
1377
+ o === m && /* @__PURE__ */ e(fe, { color: "inherit", filled: !0, fontSize: "small" })
1378
1378
  ]
1379
1379
  },
1380
1380
  m
1381
1381
  )) })
1382
1382
  }
1383
1383
  );
1384
- }), Rt = D(() => {
1385
- const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } = R(), [t, o] = x.useState(null), i = (m) => {
1384
+ }), $t = D(() => {
1385
+ const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } = F(), [t, o] = g.useState(null), i = (m) => {
1386
1386
  o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1387
1387
  }, p = () => {
1388
1388
  o(null);
1389
- }, d = !!t, c = x.useMemo(() => ({
1390
- [B.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
1391
- [B.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
1392
- [B.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
1393
- [B.LOWEST_BALANCE]: n.priority_sort_lowest_balance
1389
+ }, d = !!t, c = g.useMemo(() => ({
1390
+ [I.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
1391
+ [I.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
1392
+ [I.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
1393
+ [I.LOWEST_BALANCE]: n.priority_sort_lowest_balance
1394
1394
  })[r] ?? n.priority_sort_lowest_balance, [r]);
1395
1395
  return /* @__PURE__ */ s(y, { children: [
1396
- /* @__PURE__ */ e(Nt, { buttonText: c, isOpen: d, onClick: i }),
1397
- /* @__PURE__ */ e(Ft, { buttonEl: t, onClose: p })
1396
+ /* @__PURE__ */ e(Rt, { buttonText: c, isOpen: d, onClick: i }),
1397
+ /* @__PURE__ */ e(Lt, { buttonEl: t, onClose: p })
1398
1398
  ] });
1399
- }), Lt = (a, n, r = 0) => {
1399
+ }), Ht = (a, n, r = 0) => {
1400
1400
  const t = a.map((c) => ({ ...c }));
1401
- xe(t, n);
1401
+ ge(t, n);
1402
1402
  const o = /* @__PURE__ */ new Date(), i = [];
1403
1403
  let p = 0, d = 1;
1404
1404
  for (const c of t)
@@ -1408,23 +1408,23 @@ const Bt = (a) => {
1408
1408
  dataset: [{ x: new Date(o), y: c.balance }]
1409
1409
  });
1410
1410
  for (; t.some((c) => c.balance >= 0.01 && !c.is_impossible); ) {
1411
- let c = !1, m = !1, b = !1;
1412
- for (const [f, u] of t.entries()) {
1413
- if (u.balance <= 0.01) continue;
1414
- const S = i[f].dataset, E = (u.interest_rate ?? 0) / 100 / 12, _ = u.balance * E, v = u.monthly_payment ?? 0;
1415
- let H = v, L = 0;
1416
- !b && r > 0 && (H += r, b = !0), !m && p > 0 && (L = p, m = !0), u.balance += _;
1417
- const h = Math.min(u.balance, H + L);
1418
- if (h <= _) {
1419
- u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, S.push({ x: new Date(o), y: u.balance });
1411
+ let c = !1, m = !1, _ = !1;
1412
+ for (const [f, h] of t.entries()) {
1413
+ if (h.balance <= 0.01) continue;
1414
+ const v = i[f].dataset, P = (h.interest_rate ?? 0) / 100 / 12, u = h.balance * P, S = h.monthly_payment ?? 0;
1415
+ let H = S, R = 0;
1416
+ !_ && r > 0 && (H += r, _ = !0), !m && p > 0 && (R = p, m = !0), h.balance += u;
1417
+ const b = Math.min(h.balance, H + R);
1418
+ if (b <= u) {
1419
+ h.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(o), y: h.balance });
1420
1420
  continue;
1421
1421
  }
1422
- u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, S.push({
1422
+ h.balance -= b, h.balance = h.balance < 0.01 ? 0 : h.balance, v.push({
1423
1423
  x: new Date(o),
1424
- y: Math.max(0, u.balance),
1425
- payment: h,
1426
- extra: L
1427
- }), u.balance <= 0 && (p += v, i[f].projected_payoff_date = new Date(o)), h > 0 && (c = !0);
1424
+ y: Math.max(0, h.balance),
1425
+ payment: b,
1426
+ extra: R
1427
+ }), h.balance <= 0 && (p += S, i[f].projected_payoff_date = new Date(o)), b > 0 && (c = !0);
1428
1428
  }
1429
1429
  c && o.setMonth(o.getMonth() + 1);
1430
1430
  }
@@ -1433,10 +1433,10 @@ const Bt = (a) => {
1433
1433
  }), i.forEach((c) => {
1434
1434
  c.priority = !c.is_paid_off && !c.is_impossible ? d++ : void 0;
1435
1435
  }), i;
1436
- }, $t = D(({ onClick: a }) => {
1437
- const { debts: n } = C(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
1436
+ }, Ot = D(({ onClick: a }) => {
1437
+ const { debts: n } = C(), { 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;
1438
1438
  return /* @__PURE__ */ e(
1439
- fe,
1439
+ xe,
1440
1440
  {
1441
1441
  "aria-controls": "extra-paydown",
1442
1442
  "aria-describedby": "extra-paydown",
@@ -1444,45 +1444,47 @@ const Bt = (a) => {
1444
1444
  "aria-label": "extra-paydown",
1445
1445
  onClick: a,
1446
1446
  sx: { justifyContent: "start", minWidth: 100, mx: 4 },
1447
- children: A(p, M(i, "0,0"))
1447
+ children: A(p, B(i, "0,0"))
1448
1448
  }
1449
1449
  );
1450
- }), Ht = ({ onBackClick: a, sx: n }) => {
1451
- const [r, t] = x.useState(!1), [o, i] = x.useState(!1), [p, d] = x.useState(!1), [c, m] = x.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = C(), { onEvent: S } = k(), { isCopyLoaded: P, isInitialized: E, setSelectedAccounts: _ } = Pe(), { setSelectedAccount: v } = Ne(), { selectedDebtPriority: H, setSelectedDebtChartData: L } = R(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: w, loadGoals: I, monthlyCashFlowProfile: N } = V(), { debts: F } = q(), O = x.useMemo(() => {
1452
- const W = N?.extra_payment ?? 0;
1453
- return Lt(F, H, W);
1454
- }, [F, H, N]);
1455
- x.useEffect(() => {
1456
- _(h), S(T.DEBTS_VIEW);
1457
- }, []), x.useEffect(() => {
1458
- _(h);
1459
- }, [h]), x.useEffect(() => {
1460
- E && I().finally();
1461
- }, [E]);
1462
- const ne = (W) => m(W), oe = () => {
1463
- const W = h.find((Q) => Q.guid === c), ie = O.find((Q) => Q.guid === c);
1464
- W && v(W), ie && L(ie), t(!0);
1465
- }, we = () => S(T.DEBTS_CLICK_FILTER), Ce = () => {
1466
- d(!0), S(T.DEBTS_CLICK_SNOWBALL_CTA);
1467
- }, Se = () => {
1468
- i(!0), S(T.DEBTS_CLICK_PAYDOWN);
1450
+ }), Wt = ({ onBackClick: a, sx: n }) => {
1451
+ const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, d] = g.useState(!1), [c, m] = g.useState(""), { isDesktop: _, isMobile: f } = Y(), { debts: h } = C(), { onEvent: v } = k(), { onLoad: M } = ke(), { isCopyLoaded: P, isInitialized: u, setSelectedAccounts: S } = Ne(), { setSelectedAccount: H } = Re(), { selectedDebtPriority: R, setSelectedDebtChartData: b } = F(), { visibleDebtAccounts: x } = J(), { goalsLoaded: E, loadGoals: L, monthlyCashFlowProfile: N } = V(), { debts: z } = Z(), K = g.useMemo(() => {
1452
+ const O = N?.extra_payment ?? 0;
1453
+ return Ht(z, R, O);
1454
+ }, [z, R, N]);
1455
+ g.useEffect(() => {
1456
+ S(x), v(T.DEBTS_VIEW);
1457
+ }, []), g.useEffect(() => {
1458
+ S(x);
1459
+ }, [x]), g.useEffect(() => {
1460
+ u && L().finally(() => {
1461
+ M?.("DebtsWidget");
1462
+ });
1463
+ }, [u]);
1464
+ const oe = (O) => m(O), ie = () => {
1465
+ const O = x.find((ee) => ee.guid === c), le = K.find((ee) => ee.guid === c);
1466
+ O && H(O), le && b(le), t(!0);
1467
+ }, Ce = () => v(T.DEBTS_CLICK_FILTER), Se = () => {
1468
+ d(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
1469
+ }, ve = () => {
1470
+ i(!0), v(T.DEBTS_CLICK_PAYDOWN);
1469
1471
  };
1470
- return !w || !P || !E ? /* @__PURE__ */ e(Je, {}) : /* @__PURE__ */ s(
1471
- Oe,
1472
+ return !E || !P || !u ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
1473
+ Ge,
1472
1474
  {
1473
- accountOptions: h,
1475
+ accountOptions: x,
1474
1476
  actions: [
1475
- /* @__PURE__ */ e(Rt, {}, "prioritize-debts"),
1476
- /* @__PURE__ */ e($t, { onClick: Se }, "extra-paydown")
1477
+ /* @__PURE__ */ e($t, {}, "prioritize-debts"),
1478
+ /* @__PURE__ */ e(Ot, { onClick: ve }, "extra-paydown")
1477
1479
  ],
1478
- onAccountsFilterClick: we,
1480
+ onAccountsFilterClick: Ce,
1479
1481
  onBackClick: a,
1480
1482
  sx: n,
1481
- title: u.title,
1483
+ title: h.title,
1482
1484
  children: [
1483
- /* @__PURE__ */ s(g, { sx: { px: b ? "48px" : "24px" }, children: [
1485
+ /* @__PURE__ */ s(w, { sx: { px: _ ? "48px" : "24px" }, children: [
1484
1486
  /* @__PURE__ */ s(
1485
- g,
1487
+ w,
1486
1488
  {
1487
1489
  sx: {
1488
1490
  alignItems: f ? "flex-start" : "flex-end",
@@ -1491,53 +1493,53 @@ const Bt = (a) => {
1491
1493
  },
1492
1494
  children: [
1493
1495
  /* @__PURE__ */ e(
1494
- ge,
1496
+ we,
1495
1497
  {
1496
- debts: O,
1498
+ debts: K,
1497
1499
  height: f ? 250 : void 0,
1498
1500
  hoveredDebtGuid: c,
1499
- onClickArea: oe,
1500
- onHoverArea: ne,
1501
+ onClickArea: ie,
1502
+ onHoverArea: oe,
1501
1503
  sx: { mr: f ? "4px" : "-48px" }
1502
1504
  }
1503
1505
  ),
1504
1506
  /* @__PURE__ */ e(
1505
- ot,
1507
+ lt,
1506
1508
  {
1507
- debts: O,
1508
- onClickCta: Ce,
1509
+ debts: K,
1510
+ onClickCta: Se,
1509
1511
  sx: { mb: f ? "0px" : "64px" }
1510
1512
  }
1511
1513
  )
1512
1514
  ]
1513
1515
  }
1514
1516
  ),
1515
- /* @__PURE__ */ e(g, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1516
- kt,
1517
+ /* @__PURE__ */ e(w, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1518
+ Ft,
1517
1519
  {
1518
- debts: O,
1520
+ debts: K,
1519
1521
  hoveredDebtGuid: c,
1520
- onClickRow: oe,
1521
- onHoverRow: ne
1522
+ onClickRow: ie,
1523
+ onHoverRow: oe
1522
1524
  }
1523
1525
  ) })
1524
1526
  ] }),
1525
1527
  /* @__PURE__ */ e(
1526
- lt,
1528
+ ct,
1527
1529
  {
1528
1530
  isOpen: p,
1529
1531
  onClose: () => d(!1)
1530
1532
  }
1531
1533
  ),
1532
- /* @__PURE__ */ e(St, { isOpen: r, onClose: () => t(!1) }),
1533
- /* @__PURE__ */ e(At, { isOpen: o, onClose: () => i(!1) })
1534
+ /* @__PURE__ */ e(Dt, { isOpen: r, onClose: () => t(!1) }),
1535
+ /* @__PURE__ */ e(It, { isOpen: o, onClose: () => i(!1) })
1534
1536
  ]
1535
1537
  }
1536
1538
  );
1537
- }, Pr = D(Ht);
1539
+ }, Nr = D(Wt);
1538
1540
  export {
1539
- ge as DebtsChart,
1540
- Fr as DebtsStore,
1541
- kt as DebtsTable,
1542
- Pr as DebtsWidget
1541
+ we as DebtsChart,
1542
+ Lr as DebtsStore,
1543
+ Ft as DebtsTable,
1544
+ Nr as DebtsWidget
1543
1545
  };