@mx-cartographer/experiences 7.4.5-alpha.mega1 → 7.4.5-alpha.saba-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cashflow/index.es.js +1 -1
- package/dist/goals/index.es.js +240 -240
- package/package.json +1 -1
package/dist/goals/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as _e, T as
|
|
1
|
+
import { g as _e, T as u, G as ue, a as Pe, M as q, C as Te, b as Ve } from "../GoalStore-CrNhjvNc.mjs";
|
|
2
2
|
import { c as qn, d as Jn } from "../GoalStore-CrNhjvNc.mjs";
|
|
3
3
|
import { jsxs as i, jsx as e, Fragment as U } from "react/jsx-runtime";
|
|
4
4
|
import y from "react";
|
|
@@ -10,15 +10,15 @@ import ce from "@mui/material/Tab";
|
|
|
10
10
|
import ze from "@mui/material/Tabs";
|
|
11
11
|
import { Text as A, H2 as pe, P, H3 as He, Icon as $e, InstitutionLogo as oe } from "@mxenabled/mxui";
|
|
12
12
|
import he from "@mui/material/Button";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import Ce from "@mui/material/Card";
|
|
14
|
+
import Se from "@mui/material/CardActionArea";
|
|
15
|
+
import Re from "@mui/material/CardContent";
|
|
16
|
+
import fe from "@mui/material/Unstable_Grid2";
|
|
17
17
|
import ae from "@mui/material/Avatar";
|
|
18
18
|
import Xe from "@mui/material/CardHeader";
|
|
19
|
-
import { Payments as
|
|
20
|
-
import { u as C, l as I, a as
|
|
21
|
-
import { u as
|
|
19
|
+
import { Payments as Ee, NoteStack as xe, Person as ve, ChevronRight as M, DragHandle as Ue, CheckCircle as Ye, Icon as ye, ExpandLess as Ze, ExpandMore as qe, AddBox as Ie, Trophy as Je } from "@mxenabled/mx-icons";
|
|
20
|
+
import { u as C, l as I, b as ge, a as Ge, d as j, p as Ne, g as ke, n as Qe } from "../hooks-C41HAxM5.mjs";
|
|
21
|
+
import { u as be } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
22
22
|
import { f as x } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
23
23
|
import { S as et } from "../StatusBar-BK_uYHAB.mjs";
|
|
24
24
|
import E from "@mui/material/Divider";
|
|
@@ -34,7 +34,7 @@ import { D as F } from "../Drawer-BEtCk82g.mjs";
|
|
|
34
34
|
import { b as L } from "../Localization-2MODESHW.mjs";
|
|
35
35
|
import { f as re, a as ie, D as nt } from "../Dialog-BPTr3qHE.mjs";
|
|
36
36
|
import V from "@mui/material/ListItemAvatar";
|
|
37
|
-
import { g as De, A as
|
|
37
|
+
import { g as De, A as Ae } from "../ConnectDrawer-CuUj16NH.mjs";
|
|
38
38
|
import ot from "@mui/material/Collapse";
|
|
39
39
|
import at from "@mui/material/ListItemIcon";
|
|
40
40
|
import rt from "@mui/material/Checkbox";
|
|
@@ -67,54 +67,54 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
67
67
|
"$1$2$3"
|
|
68
68
|
) : x(t, "0,0.00"), Le = D(
|
|
69
69
|
({ goal: t, isInDrawer: n = !1, onClick: s }) => {
|
|
70
|
-
const { goals:
|
|
70
|
+
const { goals: c } = C(), { isMobile: p, isTablet: a } = be(), _ = p || a, {
|
|
71
71
|
backgroundColor: h,
|
|
72
72
|
color: g,
|
|
73
73
|
percentage: r,
|
|
74
|
-
percentageText:
|
|
75
|
-
projectedText:
|
|
76
|
-
} = _e(
|
|
74
|
+
percentageText: m,
|
|
75
|
+
projectedText: o
|
|
76
|
+
} = _e(c, t), d = t.track_type === u.DEBT_TRACK ? t.initial_amount : t.amount, l = [
|
|
77
77
|
{
|
|
78
78
|
color: h,
|
|
79
79
|
percentage: `${r}`
|
|
80
80
|
}
|
|
81
81
|
];
|
|
82
|
-
let f = /* @__PURE__ */ e(
|
|
83
|
-
return t.track_type ===
|
|
82
|
+
let f = /* @__PURE__ */ e(Ee, {});
|
|
83
|
+
return t.track_type === u.DEBT_TRACK ? f = /* @__PURE__ */ e(xe, {}) : t.track_type === u.RETIREMENT_TRACK && (f = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ e(Ce, { elevation: 2, children: /* @__PURE__ */ i(Se, { disabled: !s, onClick: s, children: [
|
|
84
84
|
/* @__PURE__ */ e(
|
|
85
85
|
Xe,
|
|
86
86
|
{
|
|
87
87
|
avatar: /* @__PURE__ */ e(ae, { sx: { bgcolor: h, color: g, height: 48, width: 48 }, variant: "rounded", children: f }),
|
|
88
|
-
subheader: /* @__PURE__ */ e(A, { variant: n ||
|
|
88
|
+
subheader: /* @__PURE__ */ e(A, { variant: n || _ ? "H3" : "H2", children: `${x(t.current_amount, _ ? "0,0" : "0,0.00")} / ${Et(
|
|
89
89
|
d,
|
|
90
|
-
|
|
90
|
+
_
|
|
91
91
|
)}` }),
|
|
92
92
|
title: /* @__PURE__ */ e(pe, { color: "text.secondary", fontWeight: 400, variant: "Body", children: t.name })
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
/* @__PURE__ */ e(
|
|
96
|
-
/* @__PURE__ */ e(et, { data:
|
|
95
|
+
/* @__PURE__ */ e(Re, { sx: { pt: 0 }, children: /* @__PURE__ */ i(b, { gap: 6, children: [
|
|
96
|
+
/* @__PURE__ */ e(et, { data: l, height: 24 }),
|
|
97
97
|
/* @__PURE__ */ i(b, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
98
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children:
|
|
99
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children:
|
|
98
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: m }),
|
|
99
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: o })
|
|
100
100
|
] })
|
|
101
101
|
] }) })
|
|
102
102
|
] }) });
|
|
103
103
|
}
|
|
104
104
|
), xt = D(({ trackType: t }) => {
|
|
105
|
-
const { goals: n } = C(), { setAlert: s, monthlyCashFlowProfile:
|
|
105
|
+
const { goals: n } = C(), { setAlert: s, monthlyCashFlowProfile: c, updateMonthlyCashFlowProfile: p } = I(), a = y.useMemo(() => {
|
|
106
106
|
let r = 0;
|
|
107
|
-
return t ===
|
|
108
|
-
}, [
|
|
109
|
-
if (
|
|
110
|
-
const r = { ...
|
|
111
|
-
t ===
|
|
107
|
+
return t === u.SAVINGS_TRACK ? r = c?.amount_allocated_for_savings_goals || 0 : t === u.DEBT_TRACK ? r = c?.amount_allocated_for_debt_goals || 0 : t === u.RETIREMENT_TRACK && (r = c?.amount_allocated_for_retirement_goals || 0), r;
|
|
108
|
+
}, [c]), [_, h] = y.useState(a), g = async () => {
|
|
109
|
+
if (c) {
|
|
110
|
+
const r = { ...c };
|
|
111
|
+
t === u.SAVINGS_TRACK ? r.amount_allocated_for_savings_goals = _ : t === u.DEBT_TRACK ? r.amount_allocated_for_debt_goals = _ : t === u.RETIREMENT_TRACK && (r.amount_allocated_for_retirement_goals = _), await p(r), s(n.alert_contribution_updated);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
return /* @__PURE__ */ e(b, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
|
115
115
|
Q,
|
|
116
116
|
{
|
|
117
|
-
isSaveDisabled: !
|
|
117
|
+
isSaveDisabled: !_ || isNaN(_),
|
|
118
118
|
label: n.contribution_label,
|
|
119
119
|
onCancel: () => h(a),
|
|
120
120
|
onSave: g,
|
|
@@ -123,28 +123,28 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
123
123
|
children: /* @__PURE__ */ e(
|
|
124
124
|
we,
|
|
125
125
|
{
|
|
126
|
-
amount:
|
|
126
|
+
amount: _,
|
|
127
127
|
autoFocus: !0,
|
|
128
|
-
error: !
|
|
128
|
+
error: !_ || isNaN(_),
|
|
129
129
|
fullWidth: !0,
|
|
130
130
|
minAmount: 0,
|
|
131
|
-
setAmount: (r) => h(isNaN(Number(r)) ?
|
|
131
|
+
setAmount: (r) => h(isNaN(Number(r)) ? _ : Number(r)),
|
|
132
132
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
}
|
|
136
136
|
) });
|
|
137
137
|
}), vt = ({ goals: t }) => {
|
|
138
|
-
const { goals: n, common: s } = C(), { reorderGoals:
|
|
138
|
+
const { goals: n, common: s } = C(), { reorderGoals: c, setAlert: p } = I(), [a, _] = y.useState(!1), [h, g] = y.useState(t.map((l) => ({ ...l })));
|
|
139
139
|
y.useEffect(() => {
|
|
140
|
-
a && g(t.map((
|
|
140
|
+
a && g(t.map((l) => ({ ...l })));
|
|
141
141
|
}, [a]);
|
|
142
142
|
const r = [
|
|
143
143
|
{
|
|
144
144
|
field: "name",
|
|
145
145
|
flex: 1,
|
|
146
|
-
renderCell: (
|
|
147
|
-
const f =
|
|
146
|
+
renderCell: (l) => {
|
|
147
|
+
const f = l.row;
|
|
148
148
|
return /* @__PURE__ */ i(b, { children: [
|
|
149
149
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: f.name }),
|
|
150
150
|
/* @__PURE__ */ e(A, { variant: "XSmall", children: L(
|
|
@@ -162,28 +162,28 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
162
162
|
align: "right",
|
|
163
163
|
field: "amount",
|
|
164
164
|
minWidth: 140,
|
|
165
|
-
renderCell: (
|
|
166
|
-
const f =
|
|
165
|
+
renderCell: (l) => {
|
|
166
|
+
const f = l.row;
|
|
167
167
|
return /* @__PURE__ */ e(A, { bold: !0, sx: { mr: 12 }, variant: "Body", children: x(f.amount, "0,0.00") });
|
|
168
168
|
},
|
|
169
169
|
sortable: !1
|
|
170
170
|
}
|
|
171
|
-
],
|
|
172
|
-
id:
|
|
171
|
+
], m = h.map((l) => ({
|
|
172
|
+
id: l.guid,
|
|
173
173
|
isHovering: !1,
|
|
174
|
-
__reorder__:
|
|
175
|
-
...
|
|
176
|
-
})),
|
|
174
|
+
__reorder__: l.name,
|
|
175
|
+
...l
|
|
176
|
+
})), o = ({ oldIndex: l, targetIndex: f }) => {
|
|
177
177
|
const T = [...h];
|
|
178
|
-
T.splice(f, 0, T.splice(
|
|
178
|
+
T.splice(f, 0, T.splice(l, 1)[0]);
|
|
179
179
|
for (let S = 0; S < T.length; S += 1)
|
|
180
180
|
T[S].position = S + 1;
|
|
181
181
|
g(T);
|
|
182
182
|
}, d = async () => {
|
|
183
|
-
await
|
|
183
|
+
await c(h), p(n.alert_goals_reordered), _(!1);
|
|
184
184
|
};
|
|
185
185
|
return /* @__PURE__ */ i(b, { children: [
|
|
186
|
-
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(k, { onClick: () =>
|
|
186
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(k, { onClick: () => _(!0), children: /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(
|
|
187
187
|
b,
|
|
188
188
|
{
|
|
189
189
|
alignItems: "center",
|
|
@@ -201,7 +201,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
201
201
|
{
|
|
202
202
|
ariaLabelClose: s.close_aria,
|
|
203
203
|
isOpen: a,
|
|
204
|
-
onClose: () =>
|
|
204
|
+
onClose: () => _(!1),
|
|
205
205
|
onPrimaryAction: d,
|
|
206
206
|
title: n.reorder_goals_title,
|
|
207
207
|
children: /* @__PURE__ */ i(b, { children: [
|
|
@@ -214,9 +214,9 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
214
214
|
disableColumnFilter: !0,
|
|
215
215
|
disableColumnMenu: !0,
|
|
216
216
|
hideFooter: !0,
|
|
217
|
-
onRowOrderChange:
|
|
217
|
+
onRowOrderChange: o,
|
|
218
218
|
rowReordering: !0,
|
|
219
|
-
rows:
|
|
219
|
+
rows: m,
|
|
220
220
|
slots: {
|
|
221
221
|
rowReorderIcon: () => /* @__PURE__ */ e(Ue, { sx: { ml: 12 } })
|
|
222
222
|
//TODO: Add to mx-icons
|
|
@@ -233,9 +233,9 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
233
233
|
)
|
|
234
234
|
] });
|
|
235
235
|
}, It = ({ goal: t, index: n }) => {
|
|
236
|
-
const { goals: s } = C(), { percentage:
|
|
236
|
+
const { goals: s } = C(), { percentage: c } = _e(s, t), p = t.goal_type === ue.KEEP_BALANCE_BELOW || t.has_been_spent ? s.goal_completed : L(s.goal_percentage_reached, `${c * 100}`);
|
|
237
237
|
return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { children: [
|
|
238
|
-
t.track_type !==
|
|
238
|
+
t.track_type !== u.RETIREMENT_TRACK && /* @__PURE__ */ e(
|
|
239
239
|
V,
|
|
240
240
|
{
|
|
241
241
|
sx: {
|
|
@@ -280,13 +280,13 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
280
280
|
] }) })
|
|
281
281
|
] }) }, t.guid);
|
|
282
282
|
}, Nt = ({ trackType: t }) => {
|
|
283
|
-
const { goals: n, common: s } = C(), { orderedGoals:
|
|
284
|
-
(
|
|
285
|
-
),
|
|
286
|
-
(
|
|
283
|
+
const { goals: n, common: s } = C(), { orderedGoals: c } = I(), p = c.filter((l) => l.track_type === t), a = p.filter(
|
|
284
|
+
(l) => l.track_type === u.SAVINGS_TRACK && !l.has_been_spent || l.track_type !== u.SAVINGS_TRACK && !l.is_complete
|
|
285
|
+
), _ = p.filter(
|
|
286
|
+
(l) => l.track_type === u.SAVINGS_TRACK && l.has_been_spent || l.track_type !== u.SAVINGS_TRACK && l.is_complete
|
|
287
287
|
), [h, g] = y.useState(!1);
|
|
288
|
-
let r = n.manage_saving_goals,
|
|
289
|
-
return t ===
|
|
288
|
+
let r = n.manage_saving_goals, m = n.manage_saving_drawer_title, o = n.manage_saving_title, d = n.manage_saving_description;
|
|
289
|
+
return t === u.DEBT_TRACK ? (r = n.manage_debt_goals, m = n.manage_debt_drawer_title, o = n.manage_debt_title, d = n.manage_debt_description) : t === u.RETIREMENT_TRACK && (r = n.manage_retirement_goals, m = n.manage_retirement_drawer_title, o = n.manage_retirement_title, d = n.manage_retirement_description), /* @__PURE__ */ i(b, { children: [
|
|
290
290
|
/* @__PURE__ */ e(he, { endIcon: /* @__PURE__ */ e(M, {}), onClick: () => g(!0), children: r }),
|
|
291
291
|
/* @__PURE__ */ e(
|
|
292
292
|
F,
|
|
@@ -294,40 +294,40 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
294
294
|
ariaLabelClose: s.close_aria,
|
|
295
295
|
isOpen: h,
|
|
296
296
|
onClose: () => g(!1),
|
|
297
|
-
title:
|
|
297
|
+
title: m,
|
|
298
298
|
children: /* @__PURE__ */ i(b, { children: [
|
|
299
299
|
/* @__PURE__ */ i(b, { m: 24, children: [
|
|
300
|
-
/* @__PURE__ */ e(He, { children:
|
|
300
|
+
/* @__PURE__ */ e(He, { children: o }),
|
|
301
301
|
/* @__PURE__ */ e(P, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: d })
|
|
302
302
|
] }),
|
|
303
303
|
/* @__PURE__ */ e(xt, { trackType: t }),
|
|
304
304
|
/* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.goal_priority }),
|
|
305
305
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
306
|
-
a.map((
|
|
306
|
+
a.map((l, f) => {
|
|
307
307
|
const T = f >= a.length - 1;
|
|
308
308
|
return /* @__PURE__ */ i(b, { children: [
|
|
309
|
-
/* @__PURE__ */ e(It, { goal:
|
|
309
|
+
/* @__PURE__ */ e(It, { goal: l, index: f }),
|
|
310
310
|
/* @__PURE__ */ e(
|
|
311
311
|
E,
|
|
312
312
|
{
|
|
313
|
-
variant: T && t ===
|
|
313
|
+
variant: T && t === u.RETIREMENT_TRACK ? "fullWidth" : "inset"
|
|
314
314
|
}
|
|
315
315
|
)
|
|
316
|
-
] }, `ongoing-${
|
|
316
|
+
] }, `ongoing-${l.guid}`);
|
|
317
317
|
}),
|
|
318
|
-
t !==
|
|
318
|
+
t !== u.RETIREMENT_TRACK && /* @__PURE__ */ i(b, { children: [
|
|
319
319
|
/* @__PURE__ */ e(vt, { goals: a }),
|
|
320
320
|
/* @__PURE__ */ e(E, {})
|
|
321
321
|
] })
|
|
322
322
|
] }),
|
|
323
|
-
t !==
|
|
323
|
+
t !== u.RETIREMENT_TRACK && _.length > 0 && /* @__PURE__ */ i(b, { children: [
|
|
324
324
|
/* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.complete_title }),
|
|
325
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children:
|
|
325
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: _.map((l, f) => {
|
|
326
326
|
const T = f > a.length - 1;
|
|
327
327
|
return /* @__PURE__ */ i(b, { children: [
|
|
328
|
-
/* @__PURE__ */ e(Gt, { goal:
|
|
328
|
+
/* @__PURE__ */ e(Gt, { goal: l }),
|
|
329
329
|
/* @__PURE__ */ e(E, { variant: T ? "fullWidth" : "inset" })
|
|
330
|
-
] }, `complete-${
|
|
330
|
+
] }, `complete-${l.guid}`);
|
|
331
331
|
}) })
|
|
332
332
|
] })
|
|
333
333
|
] })
|
|
@@ -335,19 +335,19 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
335
335
|
)
|
|
336
336
|
] });
|
|
337
337
|
}, me = D(({ trackType: t, onAddGoals: n }) => {
|
|
338
|
-
const { isMobile: s } =
|
|
339
|
-
(o) => o.track_type ===
|
|
340
|
-
),
|
|
341
|
-
(o) => o.track_type ===
|
|
342
|
-
),
|
|
338
|
+
const { isMobile: s } = be(), { goals: c } = C(), { selectedAccountGuids: p } = ge(), { orderedGoals: a, setSelectedGoal: _ } = I(), h = a.filter((o) => o.track_type === t && p.includes(o.account_guid)), g = h.filter(
|
|
339
|
+
(o) => o.track_type === u.SAVINGS_TRACK && !o.has_been_spent || o.track_type !== u.SAVINGS_TRACK && !o.is_complete
|
|
340
|
+
), r = h.filter(
|
|
341
|
+
(o) => o.track_type === u.SAVINGS_TRACK && o.has_been_spent || o.track_type !== u.SAVINGS_TRACK && o.is_complete
|
|
342
|
+
), m = t === u.DEBT_TRACK ? c.zero_state_complete_debt : c.zero_state_complete_savings;
|
|
343
343
|
return /* @__PURE__ */ i(b, { mt: 16, mx: s ? 24 : 0, children: [
|
|
344
344
|
/* @__PURE__ */ i(b, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
|
|
345
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
345
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: c.ongoing_title }),
|
|
346
346
|
/* @__PURE__ */ e(Nt, { trackType: t })
|
|
347
347
|
] }),
|
|
348
|
-
|
|
348
|
+
g.length > 0 ? /* @__PURE__ */ e(fe, { container: !0, spacing: 24, children: g.map((o, d, l) => (
|
|
349
349
|
// Goal should be full width in mobile or if it's the first goal (unless there are 2)
|
|
350
|
-
/* @__PURE__ */ e(
|
|
350
|
+
/* @__PURE__ */ e(fe, { xs: s || d === 0 && l.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Le, { goal: o, onClick: () => _(o) }, o.guid) }, d)
|
|
351
351
|
)) }) : /* @__PURE__ */ i(
|
|
352
352
|
b,
|
|
353
353
|
{
|
|
@@ -369,16 +369,16 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
369
369
|
width: { sm: 381 }
|
|
370
370
|
}),
|
|
371
371
|
variant: "Small",
|
|
372
|
-
children: Pe(t,
|
|
372
|
+
children: Pe(t, c)
|
|
373
373
|
}
|
|
374
374
|
),
|
|
375
|
-
/* @__PURE__ */ e(he, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children:
|
|
375
|
+
/* @__PURE__ */ e(he, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: c.add_goals_button })
|
|
376
376
|
]
|
|
377
377
|
}
|
|
378
378
|
),
|
|
379
|
-
t !==
|
|
380
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
381
|
-
|
|
379
|
+
t !== u.RETIREMENT_TRACK && /* @__PURE__ */ i(b, { gap: 16, mt: 48, children: [
|
|
380
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: c.complete_title }),
|
|
381
|
+
r.length === 0 && /* @__PURE__ */ e(b, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
382
382
|
P,
|
|
383
383
|
{
|
|
384
384
|
sx: (o) => ({
|
|
@@ -389,10 +389,10 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
389
389
|
}
|
|
390
390
|
}),
|
|
391
391
|
variant: "Small",
|
|
392
|
-
children:
|
|
392
|
+
children: m
|
|
393
393
|
}
|
|
394
394
|
) }),
|
|
395
|
-
|
|
395
|
+
r.map((o) => /* @__PURE__ */ e(Ce, { elevation: 2, children: /* @__PURE__ */ e(Se, { onClick: () => _(o), children: /* @__PURE__ */ e(Re, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ i(b, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
396
396
|
/* @__PURE__ */ i(b, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
397
397
|
/* @__PURE__ */ e($e, { color: "success", fill: !0, name: "check_circle", size: 20 }),
|
|
398
398
|
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Body", children: o.name })
|
|
@@ -402,27 +402,27 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
402
402
|
] })
|
|
403
403
|
] });
|
|
404
404
|
}), kt = ({ goalType: t, onClick: n }) => {
|
|
405
|
-
const { goals: s } = C(), { bgcolor:
|
|
405
|
+
const { goals: s } = C(), { bgcolor: c, icon: p, label: a, description: _, subTypes: h, type: g } = t, [r, m] = y.useState(!1), o = h.length > 0;
|
|
406
406
|
return /* @__PURE__ */ e(b, { children: /* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
407
407
|
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(
|
|
408
408
|
k,
|
|
409
409
|
{
|
|
410
|
-
onClick:
|
|
411
|
-
g ===
|
|
412
|
-
g ===
|
|
410
|
+
onClick: o ? () => m(!r) : () => n(
|
|
411
|
+
g === u.RETIREMENT_TRACK ? s.retirement : "",
|
|
412
|
+
g === u.RETIREMENT_TRACK ? q.RETIREMENT : q.OTHER,
|
|
413
413
|
g
|
|
414
414
|
),
|
|
415
415
|
children: [
|
|
416
|
-
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
417
|
-
/* @__PURE__ */ e(w, { primary: a, secondary:
|
|
418
|
-
!
|
|
419
|
-
|
|
416
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor: c }, variant: "rounded", children: /* @__PURE__ */ e(ye, { name: p, sx: { color: "grey.900" } }) }) }),
|
|
417
|
+
/* @__PURE__ */ e(w, { primary: a, secondary: _, sx: { mr: 24 } }),
|
|
418
|
+
!o && /* @__PURE__ */ e(M, {}),
|
|
419
|
+
o && (r ? /* @__PURE__ */ e(Ze, {}) : /* @__PURE__ */ e(qe, {}))
|
|
420
420
|
]
|
|
421
421
|
}
|
|
422
422
|
) }),
|
|
423
423
|
/* @__PURE__ */ e(E, { variant: "inset" }),
|
|
424
|
-
|
|
425
|
-
/* @__PURE__ */ e(at, { sx: { mr: 8 }, children: /* @__PURE__ */ e(
|
|
424
|
+
o && /* @__PURE__ */ e(ot, { in: r, children: /* @__PURE__ */ e(B, { sx: { bgcolor: "background.default" }, children: h.map((d, l) => /* @__PURE__ */ e(N, { sx: { pl: 48 }, children: /* @__PURE__ */ i(k, { onClick: () => n(d.label, d.metaType, g), children: [
|
|
425
|
+
/* @__PURE__ */ e(at, { sx: { mr: 8 }, children: /* @__PURE__ */ e(ye, { name: d.icon }) }),
|
|
426
426
|
/* @__PURE__ */ e(
|
|
427
427
|
w,
|
|
428
428
|
{
|
|
@@ -431,56 +431,56 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
431
431
|
}
|
|
432
432
|
),
|
|
433
433
|
/* @__PURE__ */ e(M, {})
|
|
434
|
-
] }) },
|
|
434
|
+
] }) }, l)) }) })
|
|
435
435
|
] }) });
|
|
436
436
|
}, Be = ({
|
|
437
437
|
accounts: t,
|
|
438
438
|
isOpen: n,
|
|
439
439
|
onClose: s,
|
|
440
|
-
onSave:
|
|
440
|
+
onSave: c,
|
|
441
441
|
title: p
|
|
442
442
|
}) => {
|
|
443
|
-
const { goals: a, common:
|
|
444
|
-
const d = g.findIndex((f) => f.guid ===
|
|
445
|
-
d >= 0 ?
|
|
443
|
+
const { goals: a, common: _ } = C(), { config: h } = Ge(), [g, r] = y.useState([]), m = (o) => {
|
|
444
|
+
const d = g.findIndex((f) => f.guid === o.guid), l = [...g];
|
|
445
|
+
d >= 0 ? l.splice(d, 1) : l.push(o), r(l);
|
|
446
446
|
};
|
|
447
447
|
return /* @__PURE__ */ i(
|
|
448
448
|
F,
|
|
449
449
|
{
|
|
450
|
-
ariaLabelClose:
|
|
450
|
+
ariaLabelClose: _.close_aria,
|
|
451
451
|
isOpen: n,
|
|
452
452
|
onClose: s,
|
|
453
|
-
onPrimaryAction: () =>
|
|
453
|
+
onPrimaryAction: () => c(g),
|
|
454
454
|
title: p,
|
|
455
455
|
children: [
|
|
456
456
|
/* @__PURE__ */ e(P, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: a.select_debt_accounts_description }),
|
|
457
457
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.white" }, children: [
|
|
458
458
|
/* @__PURE__ */ e(E, { variant: "fullWidth" }),
|
|
459
|
-
t.map((
|
|
460
|
-
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => o
|
|
459
|
+
t.map((o, d) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
460
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => m(o), children: [
|
|
461
461
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
462
462
|
oe,
|
|
463
463
|
{
|
|
464
|
-
alt:
|
|
465
|
-
institutionGuid:
|
|
464
|
+
alt: o?.name || "",
|
|
465
|
+
institutionGuid: o?.institution_guid || ""
|
|
466
466
|
}
|
|
467
467
|
) }),
|
|
468
468
|
/* @__PURE__ */ e(
|
|
469
469
|
w,
|
|
470
470
|
{
|
|
471
|
-
primary: De(
|
|
471
|
+
primary: De(o, {
|
|
472
472
|
allowNickname: h?.show_account_nicknames_in_master
|
|
473
473
|
}),
|
|
474
|
-
secondary: x(
|
|
474
|
+
secondary: x(o.balance || 0, "0,0.00")
|
|
475
475
|
}
|
|
476
476
|
),
|
|
477
|
-
/* @__PURE__ */ e(rt, { checked: g.some((
|
|
477
|
+
/* @__PURE__ */ e(rt, { checked: g.some((l) => l.guid === o.guid) })
|
|
478
478
|
] }) }),
|
|
479
479
|
/* @__PURE__ */ e(E, { variant: d < t.length - 1 ? "inset" : "fullWidth" })
|
|
480
|
-
] },
|
|
480
|
+
] }, o.guid))
|
|
481
481
|
] }),
|
|
482
482
|
/* @__PURE__ */ e(
|
|
483
|
-
|
|
483
|
+
Te,
|
|
484
484
|
{
|
|
485
485
|
description: a.connect_description,
|
|
486
486
|
label: a.connect_button,
|
|
@@ -491,20 +491,20 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
491
491
|
}
|
|
492
492
|
);
|
|
493
493
|
}, wt = ({ onClose: t }) => {
|
|
494
|
-
const { goals: n } = C(), { addGoal: s, debtGoals:
|
|
495
|
-
T ===
|
|
494
|
+
const { goals: n } = C(), { addGoal: s, debtGoals: c, setAlert: p, setSelectedGoal: a } = I(), { config: _ } = Ge(), { visibleDebtAccounts: h } = j(), [g, r] = y.useState(!1), m = Ve(n), o = (l, f, T) => {
|
|
495
|
+
T === u.DEBT_TRACK ? r(!0) : a({
|
|
496
496
|
amount: 0,
|
|
497
497
|
current_amount: 0,
|
|
498
498
|
goal_type: ue.SAVE_AMOUNT,
|
|
499
499
|
initial_amount: 0,
|
|
500
500
|
meta_type: f,
|
|
501
|
-
name:
|
|
501
|
+
name: l,
|
|
502
502
|
track_type: T
|
|
503
503
|
});
|
|
504
|
-
}, d = async (
|
|
505
|
-
for (const f of
|
|
504
|
+
}, d = async (l) => {
|
|
505
|
+
for (const f of l) {
|
|
506
506
|
let T = q.CREDIT_CARD;
|
|
507
|
-
f.account_type ===
|
|
507
|
+
f.account_type === Ae.LOAN ? T = q.LOANS : f.account_type === Ae.LINE_OF_CREDIT && (T = q.LINE_OF_CREDIT), await s({
|
|
508
508
|
account_guid: f.guid,
|
|
509
509
|
amount: 0,
|
|
510
510
|
current_amount: 0,
|
|
@@ -514,19 +514,19 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
514
514
|
meta_type: T,
|
|
515
515
|
monthly_payment: f.minimum_payment || 0,
|
|
516
516
|
name: De(f, {
|
|
517
|
-
allowNickname:
|
|
517
|
+
allowNickname: _?.show_account_nicknames_in_master
|
|
518
518
|
}),
|
|
519
|
-
track_type:
|
|
519
|
+
track_type: u.DEBT_TRACK
|
|
520
520
|
}), p(n.alert_goal_added);
|
|
521
521
|
}
|
|
522
|
-
r(!1), t?.(
|
|
522
|
+
r(!1), t?.(u.DEBT_TRACK);
|
|
523
523
|
};
|
|
524
524
|
return /* @__PURE__ */ i(b, { children: [
|
|
525
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children:
|
|
525
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: m.map((l, f) => /* @__PURE__ */ e(kt, { goalType: l, onClick: o }, f)) }),
|
|
526
526
|
/* @__PURE__ */ e(
|
|
527
527
|
Be,
|
|
528
528
|
{
|
|
529
|
-
accounts: h.filter((
|
|
529
|
+
accounts: h.filter((l) => !c.find((f) => f.account_guid === l.guid)),
|
|
530
530
|
isOpen: g,
|
|
531
531
|
onClose: () => r(!1),
|
|
532
532
|
onSave: d,
|
|
@@ -535,10 +535,10 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
535
535
|
)
|
|
536
536
|
] });
|
|
537
537
|
}, Oe = ({ account: t }) => {
|
|
538
|
-
const { accounts: n } = C(), s = ct(t), { setSelectedAccount:
|
|
538
|
+
const { accounts: n } = C(), s = ct(t), { setSelectedAccount: c } = it(), [p, a] = y.useState(!1);
|
|
539
539
|
return /* @__PURE__ */ i(N, { sx: { bgcolor: "background.paper" }, children: [
|
|
540
540
|
/* @__PURE__ */ i(k, { onClick: () => {
|
|
541
|
-
|
|
541
|
+
c(t), a(!0);
|
|
542
542
|
}, children: [
|
|
543
543
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
544
544
|
oe,
|
|
@@ -562,12 +562,12 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
562
562
|
] }) })
|
|
563
563
|
] });
|
|
564
564
|
}, Dt = D(({ goal: t }) => {
|
|
565
|
-
const { goals: n } = C(), { setAlert: s, setSelectedGoal:
|
|
565
|
+
const { goals: n } = C(), { setAlert: s, setSelectedGoal: c, updateGoal: p } = I(), [a, _] = y.useState(t.amount), h = !t.guid, g = a < 0 || a > 9999999999e-2, r = t.track_type === u.SAVINGS_TRACK && t.has_been_spent || t.track_type !== u.SAVINGS_TRACK && t.is_complete, m = async () => {
|
|
566
566
|
const d = { ...t, amount: a };
|
|
567
|
-
t.amount = a, h ?
|
|
568
|
-
},
|
|
567
|
+
t.amount = a, h ? c(d) : (await p(d), s(n.alert_goal_updated_amount));
|
|
568
|
+
}, o = () => {
|
|
569
569
|
setTimeout(() => {
|
|
570
|
-
|
|
570
|
+
_(t.amount);
|
|
571
571
|
}, 250);
|
|
572
572
|
};
|
|
573
573
|
return /* @__PURE__ */ e(
|
|
@@ -576,8 +576,8 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
576
576
|
isDisabled: r,
|
|
577
577
|
isSaveDisabled: g,
|
|
578
578
|
label: n.details_amount_to_save,
|
|
579
|
-
onCancel:
|
|
580
|
-
onSave:
|
|
579
|
+
onCancel: o,
|
|
580
|
+
onSave: m,
|
|
581
581
|
primaryText: n.details_amount_to_save,
|
|
582
582
|
secondaryText: x(t.amount, "0,0"),
|
|
583
583
|
zeroStateText: h && t.amount === 0 ? n.add_amount : void 0,
|
|
@@ -589,26 +589,26 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
589
589
|
error: g,
|
|
590
590
|
fullWidth: !0,
|
|
591
591
|
minAmount: 0,
|
|
592
|
-
setAmount: (d) =>
|
|
592
|
+
setAmount: (d) => _(isNaN(Number(d)) ? a : Number(d)),
|
|
593
593
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
594
594
|
}
|
|
595
595
|
)
|
|
596
596
|
}
|
|
597
597
|
);
|
|
598
598
|
}), Kt = ({ goal: t }) => {
|
|
599
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts: s } = j(), { accounts:
|
|
600
|
-
const f = { ...t, account_guid:
|
|
601
|
-
g ?
|
|
599
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: s } = j(), { accounts: c, goals: p } = C(), { setAlert: a, setSelectedGoal: _, updateGoal: h } = I(), g = !t.guid, [r, m] = y.useState(!1), o = async ({ balance: d, guid: l }) => {
|
|
600
|
+
const f = { ...t, account_guid: l, current_amount: d || 0 };
|
|
601
|
+
g ? _(f) : (await h(f), a(p.alert_account_changed)), m(!1);
|
|
602
602
|
};
|
|
603
603
|
return /* @__PURE__ */ i(b, { children: [
|
|
604
|
-
g && !t.account_guid ? /* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
604
|
+
g && !t.account_guid ? /* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => m(!0), children: [
|
|
605
605
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(b, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
606
|
-
/* @__PURE__ */ e(
|
|
606
|
+
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
607
607
|
p.details_add_account
|
|
608
608
|
] }) }),
|
|
609
609
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
610
610
|
] }) }) : /* @__PURE__ */ i(b, { sx: { gap: 8, my: 24, mx: 24 }, children: [
|
|
611
|
-
/* @__PURE__ */ e(he, { onClick: () =>
|
|
611
|
+
/* @__PURE__ */ e(he, { onClick: () => m(!0), variant: "text", children: p.details_change_account }),
|
|
612
612
|
/* @__PURE__ */ e(
|
|
613
613
|
A,
|
|
614
614
|
{
|
|
@@ -619,9 +619,9 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
619
619
|
}
|
|
620
620
|
)
|
|
621
621
|
] }),
|
|
622
|
-
/* @__PURE__ */ e(F, { isOpen: r, onClose: () =>
|
|
623
|
-
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children:
|
|
624
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: n.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
622
|
+
/* @__PURE__ */ e(F, { isOpen: r, onClose: () => m(!1), title: p.details_change_account, children: /* @__PURE__ */ i(b, { children: [
|
|
623
|
+
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: c.account_types[1] }),
|
|
624
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: n.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => o(d), children: [
|
|
625
625
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
626
626
|
oe,
|
|
627
627
|
{
|
|
@@ -638,8 +638,8 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
638
638
|
),
|
|
639
639
|
/* @__PURE__ */ e(M, {})
|
|
640
640
|
] }) }, d.guid)) }),
|
|
641
|
-
s.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children:
|
|
642
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: s.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
641
|
+
s.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: c.account_types[2] }),
|
|
642
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: s.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => o(d), children: [
|
|
643
643
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
644
644
|
oe,
|
|
645
645
|
{
|
|
@@ -657,7 +657,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
657
657
|
/* @__PURE__ */ e(M, {})
|
|
658
658
|
] }) }, d.guid)) }),
|
|
659
659
|
/* @__PURE__ */ e(
|
|
660
|
-
|
|
660
|
+
Te,
|
|
661
661
|
{
|
|
662
662
|
description: p.connect_description,
|
|
663
663
|
label: p.connect_button,
|
|
@@ -667,12 +667,12 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
667
667
|
] }) })
|
|
668
668
|
] });
|
|
669
669
|
}, Mt = D(({ goal: t }) => {
|
|
670
|
-
const { goals: n } = C(), { setAlert: s, setSelectedGoal:
|
|
671
|
-
const
|
|
672
|
-
t.name = a, h ?
|
|
673
|
-
},
|
|
670
|
+
const { goals: n } = C(), { setAlert: s, setSelectedGoal: c, updateGoal: p } = I(), [a, _] = y.useState(t.name), h = !t.guid, g = t.track_type === u.SAVINGS_TRACK && t.has_been_spent || t.track_type !== u.SAVINGS_TRACK && t.is_complete, r = async () => {
|
|
671
|
+
const o = { ...t, name: a };
|
|
672
|
+
t.name = a, h ? c(o) : (await p(o), s(n.alert_goal_updated_name));
|
|
673
|
+
}, m = () => {
|
|
674
674
|
setTimeout(() => {
|
|
675
|
-
|
|
675
|
+
_(t.name);
|
|
676
676
|
}, 250);
|
|
677
677
|
};
|
|
678
678
|
return /* @__PURE__ */ e(
|
|
@@ -681,7 +681,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
681
681
|
isDisabled: g,
|
|
682
682
|
isSaveDisabled: !a,
|
|
683
683
|
label: n.details_goal_name,
|
|
684
|
-
onCancel:
|
|
684
|
+
onCancel: m,
|
|
685
685
|
onSave: r,
|
|
686
686
|
primaryText: n.details_goal_name,
|
|
687
687
|
secondaryText: t.name,
|
|
@@ -691,28 +691,28 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
691
691
|
error: !a,
|
|
692
692
|
fullWidth: !0,
|
|
693
693
|
label: n.details_goal_name,
|
|
694
|
-
onChange: (
|
|
694
|
+
onChange: (o) => _(o.target.value),
|
|
695
695
|
value: a
|
|
696
696
|
}
|
|
697
697
|
)
|
|
698
698
|
}
|
|
699
699
|
);
|
|
700
700
|
}), Lt = ({ goal: t }) => {
|
|
701
|
-
const { goals: n } = C(), { setAlert: s, setSelectedGoal:
|
|
701
|
+
const { goals: n } = C(), { setAlert: s, setSelectedGoal: c, updateGoal: p } = I(), [a, _] = y.useState(t.retirement_age || 65), h = !t.guid, g = async () => {
|
|
702
702
|
if (!isNaN(a)) {
|
|
703
|
-
const
|
|
704
|
-
t.retirement_age = a, h ?
|
|
703
|
+
const o = { ...t, retirement_age: a };
|
|
704
|
+
t.retirement_age = a, h ? c(o) : (await p(o), s(n.alert_goal_updated_retirement_age));
|
|
705
705
|
}
|
|
706
706
|
}, r = () => {
|
|
707
707
|
setTimeout(() => {
|
|
708
|
-
|
|
708
|
+
_(t.retirement_age || 65);
|
|
709
709
|
}, 250);
|
|
710
|
-
},
|
|
710
|
+
}, m = !a || isNaN(a) || a < 20 || a >= 100;
|
|
711
711
|
return /* @__PURE__ */ e(
|
|
712
712
|
Q,
|
|
713
713
|
{
|
|
714
714
|
isDisabled: t.is_complete,
|
|
715
|
-
isSaveDisabled:
|
|
715
|
+
isSaveDisabled: m,
|
|
716
716
|
label: n.details_retirement_age,
|
|
717
717
|
onCancel: r,
|
|
718
718
|
onSave: g,
|
|
@@ -722,18 +722,18 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
722
722
|
children: /* @__PURE__ */ e(
|
|
723
723
|
Ke,
|
|
724
724
|
{
|
|
725
|
-
error:
|
|
725
|
+
error: m,
|
|
726
726
|
fullWidth: !0,
|
|
727
727
|
label: n.details_retirement_age,
|
|
728
|
-
onChange: (
|
|
728
|
+
onChange: (o) => _(Number(o.target.value)),
|
|
729
729
|
value: isNaN(a) ? "" : a
|
|
730
730
|
}
|
|
731
731
|
)
|
|
732
732
|
}
|
|
733
733
|
);
|
|
734
734
|
}, Bt = D(({ goal: t }) => {
|
|
735
|
-
const { goals: n } = C(), { user: s, updateUser:
|
|
736
|
-
a && pt(a) && (await
|
|
735
|
+
const { goals: n } = C(), { user: s, updateUser: c } = Ne(), { setAlert: p } = I(), [a, _] = y.useState(J(s.birthday ?? 0)), [h, g] = y.useState(null), r = t.is_complete, m = async () => {
|
|
736
|
+
a && pt(a) && (await c({ ...s, birthday: _t(a) }), p(n.alert_goal_updated_birthday));
|
|
737
737
|
};
|
|
738
738
|
return /* @__PURE__ */ e(
|
|
739
739
|
Q,
|
|
@@ -741,7 +741,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
741
741
|
isDisabled: r,
|
|
742
742
|
isSaveDisabled: !!h,
|
|
743
743
|
label: n.details_birthday,
|
|
744
|
-
onSave:
|
|
744
|
+
onSave: m,
|
|
745
745
|
primaryText: n.details_birthday,
|
|
746
746
|
secondaryText: `${re(J(s.birthday ?? 0), ie.MONTH_DAY_YEAR)}`,
|
|
747
747
|
zeroStateText: !t.guid && !s.birthday ? n.add_birthday : void 0,
|
|
@@ -749,8 +749,8 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
749
749
|
gt,
|
|
750
750
|
{
|
|
751
751
|
label: n.details_birthday,
|
|
752
|
-
onChange:
|
|
753
|
-
onError: (
|
|
752
|
+
onChange: _,
|
|
753
|
+
onError: (o) => g(o),
|
|
754
754
|
sx: { width: "100%" },
|
|
755
755
|
value: a
|
|
756
756
|
}
|
|
@@ -759,14 +759,14 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
759
759
|
);
|
|
760
760
|
}), Ot = ({ goal: t }) => {
|
|
761
761
|
const { goals: n } = C(), { visibleRetirementAccounts: s } = j(), {
|
|
762
|
-
addRetirementGoalAccount:
|
|
762
|
+
addRetirementGoalAccount: c,
|
|
763
763
|
newRetirementGoalAccounts: p,
|
|
764
764
|
retirementGoalAccounts: a,
|
|
765
|
-
selectedGoal:
|
|
765
|
+
selectedGoal: _,
|
|
766
766
|
setAlert: h,
|
|
767
767
|
setNewRetirementGoalAccounts: g,
|
|
768
768
|
setSelectedGoal: r
|
|
769
|
-
} = I(), [
|
|
769
|
+
} = I(), [m, o] = y.useState(!1), d = !t.guid, l = s.filter(
|
|
770
770
|
(S) => d ? p.find((R) => R.account_guid === S.guid) : a.find((R) => R.account_guid === S.guid)
|
|
771
771
|
), f = s.filter(
|
|
772
772
|
(S) => !a.find((R) => R.account_guid === S.guid)
|
|
@@ -779,20 +779,20 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
779
779
|
g(R);
|
|
780
780
|
else
|
|
781
781
|
for (const v of R)
|
|
782
|
-
await
|
|
782
|
+
await c(v), h(n.alert_account_added);
|
|
783
783
|
r({
|
|
784
|
-
...
|
|
784
|
+
..._,
|
|
785
785
|
current_amount: S.reduce((v, K) => v + (K.balance || 0), 0)
|
|
786
|
-
}),
|
|
786
|
+
}), o(!1);
|
|
787
787
|
};
|
|
788
788
|
return /* @__PURE__ */ i(b, { children: [
|
|
789
|
-
|
|
789
|
+
l.map((S) => /* @__PURE__ */ i(b, { children: [
|
|
790
790
|
/* @__PURE__ */ e(Oe, { account: S }),
|
|
791
791
|
/* @__PURE__ */ e(E, {})
|
|
792
792
|
] }, S.guid)),
|
|
793
|
-
/* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
793
|
+
/* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => o(!0), children: [
|
|
794
794
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(b, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
795
|
-
/* @__PURE__ */ e(
|
|
795
|
+
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
796
796
|
n.details_add_account
|
|
797
797
|
] }) }),
|
|
798
798
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
@@ -801,20 +801,20 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
801
801
|
Be,
|
|
802
802
|
{
|
|
803
803
|
accounts: f,
|
|
804
|
-
isOpen:
|
|
805
|
-
onClose: () =>
|
|
804
|
+
isOpen: m,
|
|
805
|
+
onClose: () => o(!1),
|
|
806
806
|
onSave: T,
|
|
807
807
|
title: n.add_select_accounts
|
|
808
808
|
}
|
|
809
809
|
)
|
|
810
810
|
] });
|
|
811
811
|
}, Wt = D(({ goal: t }) => {
|
|
812
|
-
const { goals: n } = C(), { visibleAccounts: s } = j(),
|
|
813
|
-
() => s.find((
|
|
812
|
+
const { goals: n } = C(), { visibleAccounts: s } = j(), c = y.useMemo(
|
|
813
|
+
() => s.find((_) => _.guid === t.account_guid),
|
|
814
814
|
[s, t]
|
|
815
815
|
), p = t.track_type;
|
|
816
816
|
let a = n.details_save_title;
|
|
817
|
-
return t.track_type ===
|
|
817
|
+
return t.track_type === u.DEBT_TRACK ? a = n.details_debt_title : t.track_type === u.RETIREMENT_TRACK && (a = n.details_retirement_title), /* @__PURE__ */ i(b, { children: [
|
|
818
818
|
/* @__PURE__ */ i(b, { mx: 24, children: [
|
|
819
819
|
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: a }),
|
|
820
820
|
/* @__PURE__ */ e(Le, { goal: t, isInDrawer: !0 }),
|
|
@@ -823,11 +823,11 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
823
823
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
824
824
|
/* @__PURE__ */ e(Mt, { goal: t }),
|
|
825
825
|
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
826
|
-
(p ===
|
|
826
|
+
(p === u.SAVINGS_TRACK || p === u.RETIREMENT_TRACK) && /* @__PURE__ */ i(U, { children: [
|
|
827
827
|
/* @__PURE__ */ e(Dt, { goal: t }),
|
|
828
|
-
/* @__PURE__ */ e(E, { sx: { ml: p ===
|
|
828
|
+
/* @__PURE__ */ e(E, { sx: { ml: p === u.RETIREMENT_TRACK ? 24 : 0 } })
|
|
829
829
|
] }),
|
|
830
|
-
t.track_type ===
|
|
830
|
+
t.track_type === u.DEBT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
831
831
|
/* @__PURE__ */ e(dt, { goal: t }),
|
|
832
832
|
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
833
833
|
/* @__PURE__ */ e(mt, { goal: t }),
|
|
@@ -835,68 +835,68 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
835
835
|
/* @__PURE__ */ e(ut, { goal: t }),
|
|
836
836
|
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
837
837
|
] }),
|
|
838
|
-
t.track_type ===
|
|
838
|
+
t.track_type === u.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
839
839
|
/* @__PURE__ */ e(Lt, { goal: t }),
|
|
840
840
|
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
841
841
|
/* @__PURE__ */ e(Bt, { goal: t }),
|
|
842
842
|
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
843
843
|
] })
|
|
844
844
|
] }),
|
|
845
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type ===
|
|
846
|
-
t.track_type !==
|
|
847
|
-
/* @__PURE__ */ e(Oe, { account:
|
|
845
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type === u.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
|
|
846
|
+
t.track_type !== u.RETIREMENT_TRACK && c && /* @__PURE__ */ i(U, { children: [
|
|
847
|
+
/* @__PURE__ */ e(Oe, { account: c }),
|
|
848
848
|
/* @__PURE__ */ e(E, {})
|
|
849
849
|
] }),
|
|
850
|
-
t.track_type ===
|
|
850
|
+
t.track_type === u.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
851
851
|
/* @__PURE__ */ e(Ot, { goal: t }),
|
|
852
852
|
/* @__PURE__ */ e(E, {})
|
|
853
853
|
] }),
|
|
854
|
-
t.track_type ===
|
|
854
|
+
t.track_type === u.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(Kt, { goal: t })
|
|
855
855
|
] });
|
|
856
856
|
}), Pt = D(({ onClose: t }) => {
|
|
857
|
-
const { visibleRetirementAccounts: n } = j(), { goals: s, common:
|
|
857
|
+
const { visibleRetirementAccounts: n } = j(), { goals: s, common: c } = C(), {
|
|
858
858
|
addGoal: p,
|
|
859
859
|
addRetirementGoal: a,
|
|
860
|
-
deleteGoal:
|
|
860
|
+
deleteGoal: _,
|
|
861
861
|
deleteRetirementGoal: h,
|
|
862
862
|
newRetirementGoalAccounts: g,
|
|
863
863
|
retirementGoalAccounts: r,
|
|
864
|
-
selectedGoal:
|
|
865
|
-
setAlert:
|
|
864
|
+
selectedGoal: m,
|
|
865
|
+
setAlert: o,
|
|
866
866
|
setSelectedGoal: d,
|
|
867
|
-
updateGoal:
|
|
868
|
-
} = I(), { user: f } =
|
|
867
|
+
updateGoal: l
|
|
868
|
+
} = I(), { user: f } = Ne(), [T, S] = y.useState(!1), R = !m?.guid, v = m?.track_type === u.SAVINGS_TRACK && m.is_complete && !m.has_been_spent, K = y.useMemo(() => {
|
|
869
869
|
const G = R ? g : r;
|
|
870
870
|
return n.filter((H) => G.some(($) => $.account_guid === H.guid));
|
|
871
871
|
}, [R, n, g, r]), se = y.useMemo(() => {
|
|
872
|
-
if (!
|
|
872
|
+
if (!m) return !1;
|
|
873
873
|
if (!R && !v) return !0;
|
|
874
|
-
const { account_guid: G, track_type: H, name: $, amount: O, retirement_age: ne } =
|
|
875
|
-
return H ===
|
|
876
|
-
}, [
|
|
877
|
-
let W =
|
|
878
|
-
R ? (z = () => ee(), W =
|
|
874
|
+
const { account_guid: G, track_type: H, name: $, amount: O, retirement_age: ne } = m;
|
|
875
|
+
return H === u.SAVINGS_TRACK ? G ? !!$ && !!O : !1 : H === u.RETIREMENT_TRACK ? K.length ? !!$ && !!O && !!ne && !!f.birthday : !1 : !0;
|
|
876
|
+
}, [m, K, f.birthday]);
|
|
877
|
+
let W = c.delete_button, z = () => S(!0);
|
|
878
|
+
R ? (z = () => ee(), W = c.save_button) : v && (z = () => le(), W = s.mark_as_complete_button);
|
|
879
879
|
const ee = async () => {
|
|
880
|
-
if (
|
|
881
|
-
const G =
|
|
882
|
-
G !==
|
|
880
|
+
if (m) {
|
|
881
|
+
const G = m.track_type;
|
|
882
|
+
G !== u.RETIREMENT_TRACK ? await p(m) : G === u.RETIREMENT_TRACK && await a({ ...m, target_amount: m.amount }), o(s.alert_goal_added), d(void 0), G && t?.(G);
|
|
883
883
|
}
|
|
884
884
|
}, te = async () => {
|
|
885
|
-
|
|
885
|
+
m && (m.track_type !== u.RETIREMENT_TRACK ? await _(m.guid) : m.track_type === u.RETIREMENT_TRACK && await h(m), o(s.alert_goal_deleted), d(void 0));
|
|
886
886
|
}, le = async () => {
|
|
887
887
|
const G = {
|
|
888
|
-
...
|
|
888
|
+
...m,
|
|
889
889
|
has_been_spent: !0
|
|
890
890
|
};
|
|
891
|
-
await
|
|
891
|
+
await l(G), o(s.alert_goal_completed), d(void 0);
|
|
892
892
|
};
|
|
893
893
|
return /* @__PURE__ */ i(b, { children: [
|
|
894
894
|
/* @__PURE__ */ e(
|
|
895
895
|
F,
|
|
896
896
|
{
|
|
897
|
-
ariaLabelClose:
|
|
897
|
+
ariaLabelClose: c.close_aria,
|
|
898
898
|
hasSecondaryAction: R,
|
|
899
|
-
isOpen: !!
|
|
899
|
+
isOpen: !!m,
|
|
900
900
|
isPrimaryDisabled: !se,
|
|
901
901
|
onClose: () => d(void 0),
|
|
902
902
|
onPrimaryAction: z,
|
|
@@ -904,39 +904,39 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
904
904
|
primaryText: W,
|
|
905
905
|
secondaryColor: "primary",
|
|
906
906
|
title: s.goal_details,
|
|
907
|
-
children:
|
|
907
|
+
children: m && /* @__PURE__ */ e(Wt, { goal: m })
|
|
908
908
|
}
|
|
909
909
|
),
|
|
910
910
|
/* @__PURE__ */ e(
|
|
911
911
|
nt,
|
|
912
912
|
{
|
|
913
|
-
copy: { close_aria:
|
|
913
|
+
copy: { close_aria: c.close_aria, title: s.delete_goal },
|
|
914
914
|
isOpen: T,
|
|
915
915
|
maxWidth: "xs",
|
|
916
916
|
onClose: () => S(!1),
|
|
917
917
|
onPrimaryAction: te,
|
|
918
918
|
primaryColor: "error",
|
|
919
|
-
primaryText:
|
|
920
|
-
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: L(s.delete_description,
|
|
919
|
+
primaryText: c.delete_button,
|
|
920
|
+
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: L(s.delete_description, m?.name || "") })
|
|
921
921
|
}
|
|
922
922
|
)
|
|
923
923
|
] });
|
|
924
924
|
}), Xn = D(({ onBackClick: t, sx: n }) => {
|
|
925
|
-
const { onEvent: s } =
|
|
925
|
+
const { onEvent: s } = ke(), { onLoad: c } = Qe(), { isMobile: p } = be(), { visibleAccounts: a } = j(), { isCopyLoaded: _, isInitialized: h, setSelectedAccounts: g } = ge(), { goals: r, common: m } = C(), { alert: o, goals: d, goalsLoaded: l, loadGoals: f, monthlyCashFlowProfile: T, setAlert: S, retirmentGoals: R } = I(), [v, K] = y.useState(0), [se, W] = y.useState(!1), z = T?.amount_allocated_for_savings_goals || 0, ee = T?.amount_allocated_for_debt_goals || 0, te = T?.amount_allocated_for_retirement_goals || 0, le = _ ? L(
|
|
926
926
|
p ? r.tab_subtitle_mobile : r.tab_subtitle,
|
|
927
927
|
x(z, "0,0")
|
|
928
|
-
) : "", G =
|
|
928
|
+
) : "", G = _ ? L(
|
|
929
929
|
p ? r.tab_subtitle_mobile : r.tab_subtitle,
|
|
930
930
|
x(ee, "0,0")
|
|
931
|
-
) : "", H =
|
|
931
|
+
) : "", H = _ ? L(
|
|
932
932
|
p ? r.tab_subtitle_mobile : r.tab_subtitle,
|
|
933
933
|
x(te, "0,0")
|
|
934
934
|
) : "";
|
|
935
935
|
y.useEffect(() => {
|
|
936
936
|
g(a), s(Y.GOALS_VIEW);
|
|
937
|
-
}, []), y.useEffect(() => {
|
|
937
|
+
}, [a]), y.useEffect(() => {
|
|
938
938
|
h && f().finally(() => {
|
|
939
|
-
|
|
939
|
+
c?.("GoalsWidget");
|
|
940
940
|
});
|
|
941
941
|
}, [h, z, ee, te]);
|
|
942
942
|
const $ = () => {
|
|
@@ -944,12 +944,12 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
944
944
|
}, O = () => {
|
|
945
945
|
W(!0), s(Y.GOALS_CLICK_ADD);
|
|
946
946
|
}, ne = (X) => {
|
|
947
|
-
W(!1), X ===
|
|
947
|
+
W(!1), X === u.SAVINGS_TRACK ? K(0) : X === u.DEBT_TRACK ? K(1) : X === u.RETIREMENT_TRACK && K(2);
|
|
948
948
|
}, Z = y.useMemo(
|
|
949
|
-
() =>
|
|
950
|
-
[d,
|
|
949
|
+
() => l && (d.length === 0 || d.every(({ track_type: X }) => !X) && R.length === 0),
|
|
950
|
+
[d, l, R]
|
|
951
951
|
);
|
|
952
|
-
return !
|
|
952
|
+
return !l || !_ || !h ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ i(
|
|
953
953
|
ft,
|
|
954
954
|
{
|
|
955
955
|
accountOptions: a,
|
|
@@ -1015,39 +1015,39 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
) : /* @__PURE__ */ i(U, { children: [
|
|
1018
|
-
v === 0 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1019
|
-
v === 1 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1020
|
-
v === 2 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1018
|
+
v === 0 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: u.SAVINGS_TRACK }),
|
|
1019
|
+
v === 1 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: u.DEBT_TRACK }),
|
|
1020
|
+
v === 2 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: u.RETIREMENT_TRACK })
|
|
1021
1021
|
] })
|
|
1022
1022
|
] }),
|
|
1023
1023
|
/* @__PURE__ */ e(Pt, { onClose: ne }),
|
|
1024
1024
|
/* @__PURE__ */ e(
|
|
1025
1025
|
F,
|
|
1026
1026
|
{
|
|
1027
|
-
ariaLabelClose:
|
|
1027
|
+
ariaLabelClose: m.close_aria,
|
|
1028
1028
|
isOpen: se,
|
|
1029
1029
|
onClose: () => W(!1),
|
|
1030
1030
|
title: r.add_goal_title,
|
|
1031
1031
|
children: /* @__PURE__ */ e(wt, { onClose: ne })
|
|
1032
1032
|
}
|
|
1033
1033
|
),
|
|
1034
|
-
/* @__PURE__ */ e(Fe, { onClose: () => S(""), open: !!
|
|
1034
|
+
/* @__PURE__ */ e(Fe, { onClose: () => S(""), open: !!o, children: /* @__PURE__ */ e(je, { onClose: () => S(""), severity: "success", variant: "filled", children: o }) })
|
|
1035
1035
|
]
|
|
1036
1036
|
}
|
|
1037
1037
|
);
|
|
1038
1038
|
}), Vt = D(({ goal: t }) => {
|
|
1039
1039
|
const { goals: n } = C(), s = Ct(), {
|
|
1040
|
-
backgroundColor:
|
|
1040
|
+
backgroundColor: c,
|
|
1041
1041
|
color: p,
|
|
1042
1042
|
percentage: a,
|
|
1043
|
-
projectedText:
|
|
1043
|
+
projectedText: _
|
|
1044
1044
|
} = _e(n, t), h = Math.round(a * 100);
|
|
1045
|
-
let g = /* @__PURE__ */ e(
|
|
1046
|
-
return t.track_type ===
|
|
1047
|
-
/* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
1045
|
+
let g = /* @__PURE__ */ e(Ee, {});
|
|
1046
|
+
return t.track_type === u.DEBT_TRACK ? g = /* @__PURE__ */ e(xe, {}) : t.track_type === u.RETIREMENT_TRACK && (g = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ i(b, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
|
|
1047
|
+
/* @__PURE__ */ e(ae, { sx: { bgcolor: c, color: p, height: 32, width: 32 }, variant: "rounded", children: g }),
|
|
1048
1048
|
/* @__PURE__ */ i(Tt, { sx: { width: "100%" }, children: [
|
|
1049
1049
|
/* @__PURE__ */ e(pe, { fontSize: 15, fontWeight: 600, variant: "body1", children: t.name }),
|
|
1050
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children:
|
|
1050
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: _ })
|
|
1051
1051
|
] }),
|
|
1052
1052
|
/* @__PURE__ */ e(
|
|
1053
1053
|
St,
|
|
@@ -1085,7 +1085,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1085
1085
|
]
|
|
1086
1086
|
}
|
|
1087
1087
|
), Un = D(({ onCTAClick: t }) => {
|
|
1088
|
-
const { visibleAccounts: n } = j(), { onEvent: s } =
|
|
1088
|
+
const { visibleAccounts: n } = j(), { onEvent: s } = ke(), { goals: c } = C(), { isInitialized: p, setSelectedAccounts: a, isCopyLoaded: _ } = ge(), { ongoingGoalsForMicroWidget: h, loadGoals: g, goalsLoaded: r } = I();
|
|
1089
1089
|
y.useEffect(() => {
|
|
1090
1090
|
a(n);
|
|
1091
1091
|
}, []), y.useEffect(() => {
|
|
@@ -1093,30 +1093,30 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1093
1093
|
state: n?.length ? "default" : "zeroState"
|
|
1094
1094
|
}));
|
|
1095
1095
|
}, [p]);
|
|
1096
|
-
const
|
|
1096
|
+
const m = y.useMemo(
|
|
1097
1097
|
() => r && h.length === 0,
|
|
1098
1098
|
[h, r]
|
|
1099
|
-
),
|
|
1099
|
+
), o = () => {
|
|
1100
1100
|
s(
|
|
1101
|
-
|
|
1101
|
+
m ? Y.GOALS_CLICK_GET_STARTED : Y.GOALS_CLICK_VIEW_DETAILS
|
|
1102
1102
|
), t();
|
|
1103
1103
|
};
|
|
1104
|
-
return !r || !
|
|
1104
|
+
return !r || !_ || !p ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ e(
|
|
1105
1105
|
Rt,
|
|
1106
1106
|
{
|
|
1107
1107
|
className: "mx-goals-microwidget",
|
|
1108
|
-
ctaLabel:
|
|
1109
|
-
onCTAClick:
|
|
1110
|
-
title:
|
|
1111
|
-
children:
|
|
1108
|
+
ctaLabel: m ? c.get_started : c.view_details,
|
|
1109
|
+
onCTAClick: o,
|
|
1110
|
+
title: c.title,
|
|
1111
|
+
children: m ? /* @__PURE__ */ e(
|
|
1112
1112
|
jt,
|
|
1113
1113
|
{
|
|
1114
|
-
header:
|
|
1115
|
-
subText:
|
|
1114
|
+
header: c.create_goals_header,
|
|
1115
|
+
subText: c.micro_zero_state_description
|
|
1116
1116
|
}
|
|
1117
|
-
) : /* @__PURE__ */ e(At, { sx: { justifyContent: "space-between" }, children: h.map((d,
|
|
1117
|
+
) : /* @__PURE__ */ e(At, { sx: { justifyContent: "space-between" }, children: h.map((d, l) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
1118
1118
|
/* @__PURE__ */ e(Vt, { goal: d }),
|
|
1119
|
-
|
|
1119
|
+
l !== h.length - 1 && /* @__PURE__ */ e(E, {})
|
|
1120
1120
|
] }, d.guid)) })
|
|
1121
1121
|
}
|
|
1122
1122
|
);
|