@mx-cartographer/experiences 7.0.22 → 7.0.23-alpha.al1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/goals/index.es.js +493 -494
- package/dist/trends/index.es.js +276 -277
- package/package.json +1 -1
package/dist/goals/index.es.js
CHANGED
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { c as
|
|
1
|
+
import { g as fe, T as m, a as Oe, M as J, C as ye, b as Le, G as pe } from "../GoalStore-eSOkI6uE.mjs";
|
|
2
|
+
import { c as Hn, d as Xn } from "../GoalStore-eSOkI6uE.mjs";
|
|
3
3
|
import { jsxs as i, jsx as e, Fragment as U } from "react/jsx-runtime";
|
|
4
4
|
import y from "react";
|
|
5
5
|
import { observer as D } from "mobx-react-lite";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import We from "@mui/material/Alert";
|
|
7
|
+
import Ve from "@mui/material/Snackbar";
|
|
8
8
|
import g from "@mui/material/Stack";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { Text as A, H2 as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { Payments as
|
|
20
|
-
import { u as T, j as E, c as
|
|
21
|
-
import { u as
|
|
9
|
+
import le from "@mui/material/Tab";
|
|
10
|
+
import Pe from "@mui/material/Tabs";
|
|
11
|
+
import { Text as A, H2 as me, P as W, H3 as je, Icon as Fe, InstitutionLogo as ne } from "@mxenabled/mxui";
|
|
12
|
+
import ue from "@mui/material/Button";
|
|
13
|
+
import Ae from "@mui/material/Card";
|
|
14
|
+
import Te from "@mui/material/CardActionArea";
|
|
15
|
+
import Ce from "@mui/material/CardContent";
|
|
16
|
+
import he from "@mui/material/Unstable_Grid2";
|
|
17
|
+
import oe from "@mui/material/Avatar";
|
|
18
|
+
import ze from "@mui/material/CardHeader";
|
|
19
|
+
import { Payments as Se, NoteStack as Re, Person as ve, ChevronRight as M, DragHandle as He, CheckCircle as Xe, Icon as be, ExpandLess as $e, ExpandMore as Ue, AddBox as xe, Trophy as Ye } from "@mxenabled/mx-icons";
|
|
20
|
+
import { u as T, j as E, c as P, o as Ee, e as Ie, a as Ge } from "../hooks-DkUqN6JE.mjs";
|
|
21
|
+
import { u as _e } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
22
22
|
import { f as x } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
23
|
-
import { S as
|
|
24
|
-
import
|
|
23
|
+
import { S as Ze } from "../StatusBar-BK_uYHAB.mjs";
|
|
24
|
+
import R from "@mui/material/Divider";
|
|
25
25
|
import B from "@mui/material/List";
|
|
26
|
-
import { L as
|
|
27
|
-
import { C as
|
|
28
|
-
import { fromUnixTime as
|
|
26
|
+
import { L as ee } from "../ListItemAction-DNZZ5fSa.mjs";
|
|
27
|
+
import { C as Ne } from "../CurrencyInput-bEx2Mbd0.mjs";
|
|
28
|
+
import { fromUnixTime as Q } from "date-fns/fromUnixTime";
|
|
29
29
|
import N from "@mui/material/ListItem";
|
|
30
30
|
import k from "@mui/material/ListItemButton";
|
|
31
31
|
import w from "@mui/material/ListItemText";
|
|
32
|
-
import { DataGridPro as
|
|
33
|
-
import { D as
|
|
34
|
-
import { b as
|
|
35
|
-
import { f as
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import { A as
|
|
41
|
-
import { u as
|
|
42
|
-
import { A as
|
|
43
|
-
import
|
|
44
|
-
import { M as
|
|
45
|
-
import { getUnixTime as
|
|
46
|
-
import { isValid as
|
|
47
|
-
import { AdapterDateFns as
|
|
48
|
-
import { DatePicker as
|
|
49
|
-
import { LocalizationProvider as
|
|
50
|
-
import { E as
|
|
51
|
-
import { A as Y, W as
|
|
52
|
-
import { L as
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import { S as
|
|
57
|
-
import { M as
|
|
58
|
-
function
|
|
32
|
+
import { DataGridPro as qe } from "@mui/x-data-grid-pro";
|
|
33
|
+
import { D as j } from "../Drawer-kEE73B87.mjs";
|
|
34
|
+
import { b as O } from "../Localization-2MODESHW.mjs";
|
|
35
|
+
import { f as ae, D as re, a as Je } from "../Dialog-CWW597AF.mjs";
|
|
36
|
+
import V from "@mui/material/ListItemAvatar";
|
|
37
|
+
import Qe from "@mui/material/Collapse";
|
|
38
|
+
import et from "@mui/material/ListItemIcon";
|
|
39
|
+
import tt from "@mui/material/Checkbox";
|
|
40
|
+
import { A as ge } from "../ConnectDrawer-phFH6OHt.mjs";
|
|
41
|
+
import { u as nt, A as ot } from "../AccountDetailsHeader-Eb3WvBGm.mjs";
|
|
42
|
+
import { A as at } from "../AccountDetailsContent-UxSEMBo_.mjs";
|
|
43
|
+
import ke from "@mui/material/TextField";
|
|
44
|
+
import { M as rt, I as it, O as st } from "../OriginalBalanceAction-DepsKiJz.mjs";
|
|
45
|
+
import { getUnixTime as lt } from "date-fns/getUnixTime";
|
|
46
|
+
import { isValid as ct } from "date-fns/isValid";
|
|
47
|
+
import { AdapterDateFns as dt } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
48
|
+
import { DatePicker as mt } from "@mui/x-date-pickers";
|
|
49
|
+
import { LocalizationProvider as ut } from "@mui/x-date-pickers/LocalizationProvider";
|
|
50
|
+
import { E as _t } from "../EmptyState-C0lr9E5T.mjs";
|
|
51
|
+
import { A as Y, W as pt } from "../WidgetContainer-CdBs9WOZ.mjs";
|
|
52
|
+
import { L as we } from "../Loader-DUaFpDGv.mjs";
|
|
53
|
+
import ht from "@mui/material/Stack/Stack";
|
|
54
|
+
import bt from "@mui/material/Box";
|
|
55
|
+
import gt from "@mui/material/styles/useTheme";
|
|
56
|
+
import { S as ft } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
57
|
+
import { M as yt } from "../MicroWidgetContainer-Dxz8uBN9.mjs";
|
|
58
|
+
function ce({ title: t, subtitle: n }) {
|
|
59
59
|
return /* @__PURE__ */ i(g, { children: [
|
|
60
60
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t }),
|
|
61
61
|
/* @__PURE__ */ e(A, { sx: { fontWeight: 400 }, variant: "Body", children: n })
|
|
62
62
|
] });
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const At = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
65
65
|
/(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g,
|
|
66
66
|
"$1$2$3"
|
|
67
|
-
) : x(t, "0,0.00"),
|
|
68
|
-
({ goal: t, isInDrawer: n = !1, onClick:
|
|
69
|
-
const { goals:
|
|
70
|
-
backgroundColor:
|
|
71
|
-
color:
|
|
72
|
-
percentage:
|
|
67
|
+
) : x(t, "0,0.00"), De = D(
|
|
68
|
+
({ goal: t, isInDrawer: n = !1, onClick: d }) => {
|
|
69
|
+
const { goals: s } = T(), { isMobile: _, isTablet: a } = _e(), u = _ || a, {
|
|
70
|
+
backgroundColor: b,
|
|
71
|
+
color: l,
|
|
72
|
+
percentage: h,
|
|
73
73
|
percentageText: o,
|
|
74
|
-
projectedText:
|
|
75
|
-
} =
|
|
74
|
+
projectedText: p
|
|
75
|
+
} = fe(s, t), r = t.track_type === m.DEBT_TRACK ? t.initial_amount : t.amount, c = [
|
|
76
76
|
{
|
|
77
|
-
color:
|
|
78
|
-
percentage: `${
|
|
77
|
+
color: b,
|
|
78
|
+
percentage: `${h}`
|
|
79
79
|
}
|
|
80
80
|
];
|
|
81
|
-
let f = /* @__PURE__ */ e(
|
|
82
|
-
return t.track_type ===
|
|
81
|
+
let f = /* @__PURE__ */ e(Se, {});
|
|
82
|
+
return t.track_type === m.DEBT_TRACK ? f = /* @__PURE__ */ e(Re, {}) : t.track_type === m.RETIREMENT_TRACK && (f = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ e(Ae, { elevation: 2, children: /* @__PURE__ */ i(Te, { disabled: !d, onClick: d, children: [
|
|
83
83
|
/* @__PURE__ */ e(
|
|
84
|
-
|
|
84
|
+
ze,
|
|
85
85
|
{
|
|
86
|
-
avatar: /* @__PURE__ */ e(
|
|
87
|
-
subheader: /* @__PURE__ */ e(A, { variant: n || u ? "H3" : "H2", children: `${x(t.current_amount, u ? "0,0" : "0,0.00")} / ${
|
|
86
|
+
avatar: /* @__PURE__ */ e(oe, { sx: { bgcolor: b, color: l, height: 48, width: 48 }, variant: "rounded", children: f }),
|
|
87
|
+
subheader: /* @__PURE__ */ e(A, { variant: n || u ? "H3" : "H2", children: `${x(t.current_amount, u ? "0,0" : "0,0.00")} / ${At(
|
|
88
88
|
r,
|
|
89
89
|
u
|
|
90
90
|
)}` }),
|
|
91
|
-
title: /* @__PURE__ */ e(
|
|
91
|
+
title: /* @__PURE__ */ e(me, { color: "text.secondary", fontWeight: 400, variant: "Body", children: t.name })
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
/* @__PURE__ */ e(
|
|
94
|
+
/* @__PURE__ */ e(Ce, { sx: { pt: 0 }, children: /* @__PURE__ */ i(g, { gap: 6, children: [
|
|
95
|
+
/* @__PURE__ */ e(Ze, { data: c, height: 24 }),
|
|
96
96
|
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
97
97
|
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: o }),
|
|
98
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children:
|
|
98
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: p })
|
|
99
99
|
] })
|
|
100
100
|
] }) })
|
|
101
101
|
] }) });
|
|
102
102
|
}
|
|
103
|
-
),
|
|
104
|
-
const { goals: n } = T(), { setAlert:
|
|
105
|
-
let
|
|
106
|
-
return t ===
|
|
107
|
-
}, [
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
t ===
|
|
103
|
+
), Tt = D(({ trackType: t }) => {
|
|
104
|
+
const { goals: n } = T(), { setAlert: d, monthlyCashFlowProfile: s, updateMonthlyCashFlowProfile: _ } = E(), a = y.useMemo(() => {
|
|
105
|
+
let h = 0;
|
|
106
|
+
return t === m.SAVINGS_TRACK ? h = s?.amount_allocated_for_savings_goals || 0 : t === m.DEBT_TRACK ? h = s?.amount_allocated_for_debt_goals || 0 : t === m.RETIREMENT_TRACK && (h = s?.amount_allocated_for_retirement_goals || 0), h;
|
|
107
|
+
}, [s]), [u, b] = y.useState(a), l = async () => {
|
|
108
|
+
if (s) {
|
|
109
|
+
const h = { ...s };
|
|
110
|
+
t === m.SAVINGS_TRACK ? h.amount_allocated_for_savings_goals = u : t === m.DEBT_TRACK ? h.amount_allocated_for_debt_goals = u : t === m.RETIREMENT_TRACK && (h.amount_allocated_for_retirement_goals = u), await _(h), d(n.alert_contribution_updated);
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
return /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
|
114
|
-
|
|
114
|
+
ee,
|
|
115
115
|
{
|
|
116
116
|
isSaveDisabled: !u || isNaN(u),
|
|
117
117
|
label: n.contribution_label,
|
|
118
|
-
onCancel: () =>
|
|
119
|
-
onSave:
|
|
118
|
+
onCancel: () => b(a),
|
|
119
|
+
onSave: l,
|
|
120
120
|
primaryText: n.contribution_label,
|
|
121
121
|
secondaryText: x(a, "0,0.00"),
|
|
122
122
|
children: /* @__PURE__ */ e(
|
|
123
|
-
|
|
123
|
+
Ne,
|
|
124
124
|
{
|
|
125
125
|
amount: u,
|
|
126
126
|
autoFocus: !0,
|
|
127
127
|
error: !u || isNaN(u),
|
|
128
128
|
fullWidth: !0,
|
|
129
129
|
minAmount: 0,
|
|
130
|
-
setAmount: (
|
|
130
|
+
setAmount: (h) => b(isNaN(Number(h)) ? u : Number(h)),
|
|
131
131
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
132
132
|
}
|
|
133
133
|
)
|
|
134
134
|
}
|
|
135
135
|
) });
|
|
136
|
-
}),
|
|
137
|
-
const { goals: n, common:
|
|
136
|
+
}), Ct = ({ goals: t }) => {
|
|
137
|
+
const { goals: n, common: d } = T(), { reorderGoals: s, setAlert: _ } = E(), [a, u] = y.useState(!1), [b, l] = y.useState(t.map((c) => ({ ...c })));
|
|
138
138
|
y.useEffect(() => {
|
|
139
|
-
a &&
|
|
139
|
+
a && l(t.map((c) => ({ ...c })));
|
|
140
140
|
}, [a]);
|
|
141
|
-
const
|
|
141
|
+
const h = [
|
|
142
142
|
{
|
|
143
143
|
field: "name",
|
|
144
144
|
flex: 1,
|
|
145
|
-
renderCell: (
|
|
146
|
-
const f =
|
|
145
|
+
renderCell: (c) => {
|
|
146
|
+
const f = c.row;
|
|
147
147
|
return /* @__PURE__ */ i(g, { children: [
|
|
148
148
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: f.name }),
|
|
149
|
-
/* @__PURE__ */ e(A, { variant: "XSmall", children:
|
|
149
|
+
/* @__PURE__ */ e(A, { variant: "XSmall", children: O(
|
|
150
150
|
n.goal_projection,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
ae(
|
|
152
|
+
Q(f.projected_to_complete_at || 0),
|
|
153
|
+
re.MONTH_SHORT_YEAR
|
|
154
154
|
)
|
|
155
155
|
) })
|
|
156
156
|
] });
|
|
@@ -161,25 +161,25 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
161
161
|
align: "right",
|
|
162
162
|
field: "amount",
|
|
163
163
|
minWidth: 140,
|
|
164
|
-
renderCell: (
|
|
165
|
-
const f =
|
|
164
|
+
renderCell: (c) => {
|
|
165
|
+
const f = c.row;
|
|
166
166
|
return /* @__PURE__ */ e(A, { bold: !0, sx: { mr: 12 }, variant: "Body", children: x(f.amount, "0,0.00") });
|
|
167
167
|
},
|
|
168
168
|
sortable: !1
|
|
169
169
|
}
|
|
170
|
-
], o =
|
|
171
|
-
id:
|
|
170
|
+
], o = b.map((c) => ({
|
|
171
|
+
id: c.guid,
|
|
172
172
|
isHovering: !1,
|
|
173
|
-
__reorder__:
|
|
174
|
-
...
|
|
175
|
-
})),
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
for (let C = 0; C <
|
|
179
|
-
|
|
180
|
-
|
|
173
|
+
__reorder__: c.name,
|
|
174
|
+
...c
|
|
175
|
+
})), p = ({ oldIndex: c, targetIndex: f }) => {
|
|
176
|
+
const v = [...b];
|
|
177
|
+
v.splice(f, 0, v.splice(c, 1)[0]);
|
|
178
|
+
for (let C = 0; C < v.length; C += 1)
|
|
179
|
+
v[C].position = C + 1;
|
|
180
|
+
l(v);
|
|
181
181
|
}, r = async () => {
|
|
182
|
-
await
|
|
182
|
+
await s(b), _(n.alert_goals_reordered), u(!1);
|
|
183
183
|
};
|
|
184
184
|
return /* @__PURE__ */ i(g, { children: [
|
|
185
185
|
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(k, { onClick: () => u(!0), children: /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(
|
|
@@ -196,28 +196,28 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
196
196
|
}
|
|
197
197
|
) }) }) }),
|
|
198
198
|
/* @__PURE__ */ e(
|
|
199
|
-
|
|
199
|
+
j,
|
|
200
200
|
{
|
|
201
|
-
ariaLabelClose:
|
|
201
|
+
ariaLabelClose: d.close_aria,
|
|
202
202
|
isOpen: a,
|
|
203
203
|
onClose: () => u(!1),
|
|
204
204
|
onPrimaryAction: r,
|
|
205
205
|
title: n.reorder_goals_title,
|
|
206
206
|
children: /* @__PURE__ */ i(g, { children: [
|
|
207
|
-
/* @__PURE__ */ e(
|
|
207
|
+
/* @__PURE__ */ e(W, { sx: { my: 12, mx: 24 }, children: n.reorder_goals_description }),
|
|
208
208
|
/* @__PURE__ */ e(
|
|
209
|
-
|
|
209
|
+
qe,
|
|
210
210
|
{
|
|
211
211
|
columnHeaderHeight: 0,
|
|
212
|
-
columns:
|
|
212
|
+
columns: h,
|
|
213
213
|
disableColumnFilter: !0,
|
|
214
214
|
disableColumnMenu: !0,
|
|
215
215
|
hideFooter: !0,
|
|
216
|
-
onRowOrderChange:
|
|
216
|
+
onRowOrderChange: p,
|
|
217
217
|
rowReordering: !0,
|
|
218
218
|
rows: o,
|
|
219
219
|
slots: {
|
|
220
|
-
rowReorderIcon: () => /* @__PURE__ */ e(
|
|
220
|
+
rowReorderIcon: () => /* @__PURE__ */ e(He, { sx: { ml: 12 } })
|
|
221
221
|
//TODO: Add to mx-icons
|
|
222
222
|
},
|
|
223
223
|
sx: {
|
|
@@ -231,11 +231,11 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
231
231
|
}
|
|
232
232
|
)
|
|
233
233
|
] });
|
|
234
|
-
},
|
|
235
|
-
const { goals:
|
|
234
|
+
}, St = ({ goal: t, index: n }) => {
|
|
235
|
+
const { goals: d } = T();
|
|
236
236
|
return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { children: [
|
|
237
|
-
t.track_type !==
|
|
238
|
-
|
|
237
|
+
t.track_type !== m.RETIREMENT_TRACK && /* @__PURE__ */ e(
|
|
238
|
+
V,
|
|
239
239
|
{
|
|
240
240
|
sx: {
|
|
241
241
|
alignItems: "center",
|
|
@@ -243,110 +243,110 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
243
243
|
justifyContent: "center",
|
|
244
244
|
".MuiAvatar-root": { height: "16px", width: "16px" }
|
|
245
245
|
},
|
|
246
|
-
children: /* @__PURE__ */ e(
|
|
246
|
+
children: /* @__PURE__ */ e(oe, { sx: { bgcolor: "text.primary", height: "16px", width: "16px" }, children: /* @__PURE__ */ e(A, { bold: !0, variant: "XSmall", children: n + 1 }) })
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
249
|
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
250
250
|
/* @__PURE__ */ i(g, { children: [
|
|
251
251
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t.name }),
|
|
252
|
-
/* @__PURE__ */ e(A, { variant: "XSmall", children:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
/* @__PURE__ */ e(A, { variant: "XSmall", children: O(
|
|
253
|
+
d.goal_projection,
|
|
254
|
+
ae(
|
|
255
|
+
Q(t.projected_to_complete_at || 0),
|
|
256
|
+
re.MONTH_SHORT_YEAR
|
|
257
257
|
)
|
|
258
258
|
) })
|
|
259
259
|
] }),
|
|
260
260
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: x(t.amount, "0,0.00") })
|
|
261
261
|
] }) })
|
|
262
262
|
] }) });
|
|
263
|
-
},
|
|
263
|
+
}, Rt = ({ goal: t }) => {
|
|
264
264
|
const { goals: n } = T();
|
|
265
265
|
return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { children: [
|
|
266
|
-
/* @__PURE__ */ e(
|
|
266
|
+
/* @__PURE__ */ e(V, { sx: { alignItems: "center", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e(Xe, { color: "success", filled: !0, size: 20 }) }),
|
|
267
267
|
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
268
268
|
/* @__PURE__ */ i(g, { children: [
|
|
269
269
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t.name }),
|
|
270
|
-
/* @__PURE__ */ e(A, { variant: "XSmall", children:
|
|
270
|
+
/* @__PURE__ */ e(A, { variant: "XSmall", children: O(
|
|
271
271
|
n.completed_label,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
ae(
|
|
273
|
+
Q(t.completed_at || 0),
|
|
274
|
+
re.MONTH_SHORT_YEAR
|
|
275
275
|
)
|
|
276
276
|
) })
|
|
277
277
|
] }),
|
|
278
278
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: x(t.amount, "0,0.00") })
|
|
279
279
|
] }) })
|
|
280
280
|
] }) }, t.guid);
|
|
281
|
-
},
|
|
282
|
-
const { goals: n, common:
|
|
283
|
-
(
|
|
281
|
+
}, vt = ({ trackType: t }) => {
|
|
282
|
+
const { goals: n, common: d } = T(), { orderedGoals: s } = E(), _ = s.filter((c) => c.track_type === t), a = _.filter(
|
|
283
|
+
(c) => c.track_type === m.SAVINGS_TRACK && !c.has_been_spent || c.track_type !== m.SAVINGS_TRACK && !c.is_complete
|
|
284
284
|
), u = _.filter(
|
|
285
|
-
(
|
|
286
|
-
), [
|
|
287
|
-
let
|
|
288
|
-
return t ===
|
|
289
|
-
/* @__PURE__ */ e(
|
|
285
|
+
(c) => c.track_type === m.SAVINGS_TRACK && c.has_been_spent || c.track_type !== m.SAVINGS_TRACK && c.is_complete
|
|
286
|
+
), [b, l] = y.useState(!1);
|
|
287
|
+
let h = n.manage_saving_goals, o = n.manage_saving_drawer_title, p = n.manage_saving_title, r = n.manage_saving_description;
|
|
288
|
+
return t === m.DEBT_TRACK ? (h = n.manage_debt_goals, o = n.manage_debt_drawer_title, p = n.manage_debt_title, r = n.manage_debt_description) : t === m.RETIREMENT_TRACK && (h = n.manage_retirement_goals, o = n.manage_retirement_drawer_title, p = n.manage_retirement_title, r = n.manage_retirement_description), /* @__PURE__ */ i(g, { children: [
|
|
289
|
+
/* @__PURE__ */ e(ue, { endIcon: /* @__PURE__ */ e(M, {}), onClick: () => l(!0), children: h }),
|
|
290
290
|
/* @__PURE__ */ e(
|
|
291
|
-
|
|
291
|
+
j,
|
|
292
292
|
{
|
|
293
|
-
ariaLabelClose:
|
|
294
|
-
isOpen:
|
|
295
|
-
onClose: () =>
|
|
293
|
+
ariaLabelClose: d.close_aria,
|
|
294
|
+
isOpen: b,
|
|
295
|
+
onClose: () => l(!1),
|
|
296
296
|
title: o,
|
|
297
297
|
children: /* @__PURE__ */ i(g, { children: [
|
|
298
298
|
/* @__PURE__ */ i(g, { m: 24, children: [
|
|
299
|
-
/* @__PURE__ */ e(
|
|
300
|
-
/* @__PURE__ */ e(
|
|
299
|
+
/* @__PURE__ */ e(je, { children: p }),
|
|
300
|
+
/* @__PURE__ */ e(W, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: r })
|
|
301
301
|
] }),
|
|
302
|
-
/* @__PURE__ */ e(
|
|
302
|
+
/* @__PURE__ */ e(Tt, { trackType: t }),
|
|
303
303
|
/* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.goal_priority }),
|
|
304
304
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
305
|
-
a.map((
|
|
306
|
-
const
|
|
305
|
+
a.map((c, f) => {
|
|
306
|
+
const v = f >= a.length - 1;
|
|
307
307
|
return /* @__PURE__ */ i(g, { children: [
|
|
308
|
-
/* @__PURE__ */ e(
|
|
308
|
+
/* @__PURE__ */ e(St, { goal: c, index: f }),
|
|
309
309
|
/* @__PURE__ */ e(
|
|
310
|
-
|
|
310
|
+
R,
|
|
311
311
|
{
|
|
312
|
-
variant:
|
|
312
|
+
variant: v && t === m.RETIREMENT_TRACK ? "fullWidth" : "inset"
|
|
313
313
|
}
|
|
314
314
|
)
|
|
315
|
-
] }, `ongoing-${
|
|
315
|
+
] }, `ongoing-${c.guid}`);
|
|
316
316
|
}),
|
|
317
|
-
t !==
|
|
318
|
-
/* @__PURE__ */ e(
|
|
319
|
-
/* @__PURE__ */ e(
|
|
317
|
+
t !== m.RETIREMENT_TRACK && /* @__PURE__ */ i(g, { children: [
|
|
318
|
+
/* @__PURE__ */ e(Ct, { goals: a }),
|
|
319
|
+
/* @__PURE__ */ e(R, {})
|
|
320
320
|
] })
|
|
321
321
|
] }),
|
|
322
|
-
t !==
|
|
322
|
+
t !== m.RETIREMENT_TRACK && u.length > 0 && /* @__PURE__ */ i(g, { children: [
|
|
323
323
|
/* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.complete_title }),
|
|
324
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: u.map((
|
|
325
|
-
const
|
|
324
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: u.map((c, f) => {
|
|
325
|
+
const v = f > a.length - 1;
|
|
326
326
|
return /* @__PURE__ */ i(g, { children: [
|
|
327
|
-
/* @__PURE__ */ e(
|
|
328
|
-
/* @__PURE__ */ e(
|
|
329
|
-
] }, `complete-${
|
|
327
|
+
/* @__PURE__ */ e(Rt, { goal: c }),
|
|
328
|
+
/* @__PURE__ */ e(R, { variant: v ? "fullWidth" : "inset" })
|
|
329
|
+
] }, `complete-${c.guid}`);
|
|
330
330
|
}) })
|
|
331
331
|
] })
|
|
332
332
|
] })
|
|
333
333
|
}
|
|
334
334
|
)
|
|
335
335
|
] });
|
|
336
|
-
},
|
|
337
|
-
const { isMobile:
|
|
338
|
-
(o) => o.track_type ===
|
|
339
|
-
),
|
|
340
|
-
(o) => o.track_type ===
|
|
341
|
-
),
|
|
342
|
-
return /* @__PURE__ */ i(g, { mt: 16, mx:
|
|
336
|
+
}, de = D(({ trackType: t, onAddGoals: n }) => {
|
|
337
|
+
const { isMobile: d } = _e(), { goals: s } = T(), { orderedGoals: _, setSelectedGoal: a } = E(), u = _.filter((o) => o.track_type === t), b = u.filter(
|
|
338
|
+
(o) => o.track_type === m.SAVINGS_TRACK && !o.has_been_spent || o.track_type !== m.SAVINGS_TRACK && !o.is_complete
|
|
339
|
+
), l = u.filter(
|
|
340
|
+
(o) => o.track_type === m.SAVINGS_TRACK && o.has_been_spent || o.track_type !== m.SAVINGS_TRACK && o.is_complete
|
|
341
|
+
), h = t === m.DEBT_TRACK ? s.zero_state_complete_debt : s.zero_state_complete_savings;
|
|
342
|
+
return /* @__PURE__ */ i(g, { mt: 16, mx: d ? 24 : 0, children: [
|
|
343
343
|
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
|
|
344
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
345
|
-
/* @__PURE__ */ e(
|
|
344
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: s.ongoing_title }),
|
|
345
|
+
/* @__PURE__ */ e(vt, { trackType: t })
|
|
346
346
|
] }),
|
|
347
|
-
|
|
347
|
+
b.length > 0 ? /* @__PURE__ */ e(he, { container: !0, spacing: 24, children: b.map((o, p, r) => (
|
|
348
348
|
// Goal should be full width in mobile or if it's the first goal (unless there are 2)
|
|
349
|
-
/* @__PURE__ */ e(
|
|
349
|
+
/* @__PURE__ */ e(he, { xs: d || p === 0 && r.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(De, { goal: o, onClick: () => a(o) }, o.guid) }, p)
|
|
350
350
|
)) }) : /* @__PURE__ */ i(
|
|
351
351
|
g,
|
|
352
352
|
{
|
|
@@ -358,7 +358,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
358
358
|
py: 18,
|
|
359
359
|
children: [
|
|
360
360
|
/* @__PURE__ */ e(
|
|
361
|
-
|
|
361
|
+
W,
|
|
362
362
|
{
|
|
363
363
|
sx: (o) => ({
|
|
364
364
|
color: "text.secondary",
|
|
@@ -368,17 +368,17 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
368
368
|
width: { sm: 381 }
|
|
369
369
|
}),
|
|
370
370
|
variant: "Small",
|
|
371
|
-
children:
|
|
371
|
+
children: Oe(t, s)
|
|
372
372
|
}
|
|
373
373
|
),
|
|
374
|
-
/* @__PURE__ */ e(
|
|
374
|
+
/* @__PURE__ */ e(ue, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: s.add_goals_button })
|
|
375
375
|
]
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
t !==
|
|
379
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
380
|
-
|
|
381
|
-
|
|
378
|
+
t !== m.RETIREMENT_TRACK && /* @__PURE__ */ i(g, { gap: 16, mt: 48, children: [
|
|
379
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: s.complete_title }),
|
|
380
|
+
l.length === 0 && /* @__PURE__ */ e(g, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
381
|
+
W,
|
|
382
382
|
{
|
|
383
383
|
sx: (o) => ({
|
|
384
384
|
color: "text.secondary",
|
|
@@ -388,40 +388,40 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
388
388
|
}
|
|
389
389
|
}),
|
|
390
390
|
variant: "Small",
|
|
391
|
-
children:
|
|
391
|
+
children: h
|
|
392
392
|
}
|
|
393
393
|
) }),
|
|
394
|
-
|
|
394
|
+
l.map((o) => /* @__PURE__ */ e(Ae, { elevation: 2, children: /* @__PURE__ */ e(Te, { onClick: () => a(o), children: /* @__PURE__ */ e(Ce, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
395
395
|
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
396
|
-
/* @__PURE__ */ e(
|
|
396
|
+
/* @__PURE__ */ e(Fe, { color: "success", fill: !0, name: "check_circle", size: 20 }),
|
|
397
397
|
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Body", children: o.name })
|
|
398
398
|
] }),
|
|
399
399
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: x(o.amount, "0,0.00") })
|
|
400
400
|
] }) }) }) }, o.guid))
|
|
401
401
|
] })
|
|
402
402
|
] });
|
|
403
|
-
}),
|
|
404
|
-
const { goals:
|
|
403
|
+
}), xt = ({ goalType: t, onClick: n }) => {
|
|
404
|
+
const { goals: d } = T(), { bgcolor: s, icon: _, label: a, description: u, subTypes: b, type: l } = t, [h, o] = y.useState(!1), p = b.length > 0;
|
|
405
405
|
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
406
406
|
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(
|
|
407
407
|
k,
|
|
408
408
|
{
|
|
409
|
-
onClick:
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
onClick: p ? () => o(!h) : () => n(
|
|
410
|
+
l === m.RETIREMENT_TRACK ? d.retirement : "",
|
|
411
|
+
l === m.RETIREMENT_TRACK ? J.RETIREMENT : J.OTHER,
|
|
412
|
+
l
|
|
413
413
|
),
|
|
414
414
|
children: [
|
|
415
|
-
/* @__PURE__ */ e(
|
|
415
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(oe, { sx: { bgcolor: s }, variant: "rounded", children: /* @__PURE__ */ e(be, { name: _, sx: { color: "grey.900" } }) }) }),
|
|
416
416
|
/* @__PURE__ */ e(w, { primary: a, secondary: u, sx: { mr: 24 } }),
|
|
417
|
-
!
|
|
418
|
-
|
|
417
|
+
!p && /* @__PURE__ */ e(M, {}),
|
|
418
|
+
p && (h ? /* @__PURE__ */ e($e, {}) : /* @__PURE__ */ e(Ue, {}))
|
|
419
419
|
]
|
|
420
420
|
}
|
|
421
421
|
) }),
|
|
422
|
-
/* @__PURE__ */ e(
|
|
423
|
-
|
|
424
|
-
/* @__PURE__ */ e(
|
|
422
|
+
/* @__PURE__ */ e(R, { variant: "inset" }),
|
|
423
|
+
p && /* @__PURE__ */ e(Qe, { in: h, children: /* @__PURE__ */ e(B, { sx: { bgcolor: "background.default" }, children: b.map((r, c) => /* @__PURE__ */ e(N, { sx: { pl: 48 }, children: /* @__PURE__ */ i(k, { onClick: () => n(r.label, r.metaType, l), children: [
|
|
424
|
+
/* @__PURE__ */ e(et, { sx: { mr: 8 }, children: /* @__PURE__ */ e(be, { name: r.icon }) }),
|
|
425
425
|
/* @__PURE__ */ e(
|
|
426
426
|
w,
|
|
427
427
|
{
|
|
@@ -430,35 +430,35 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
430
430
|
}
|
|
431
431
|
),
|
|
432
432
|
/* @__PURE__ */ e(M, {})
|
|
433
|
-
] }) },
|
|
433
|
+
] }) }, c)) }) })
|
|
434
434
|
] }) });
|
|
435
|
-
},
|
|
435
|
+
}, Ke = ({
|
|
436
436
|
accounts: t,
|
|
437
437
|
isOpen: n,
|
|
438
|
-
onClose:
|
|
439
|
-
onSave:
|
|
438
|
+
onClose: d,
|
|
439
|
+
onSave: s,
|
|
440
440
|
title: _
|
|
441
441
|
}) => {
|
|
442
|
-
const { goals: a, common: u } = T(), [
|
|
443
|
-
const
|
|
444
|
-
|
|
442
|
+
const { goals: a, common: u } = T(), [b, l] = y.useState([]), h = (o) => {
|
|
443
|
+
const p = b.findIndex((c) => c.guid === o.guid), r = [...b];
|
|
444
|
+
p >= 0 ? r.splice(p, 1) : r.push(o), l(r);
|
|
445
445
|
};
|
|
446
446
|
return /* @__PURE__ */ i(
|
|
447
|
-
|
|
447
|
+
j,
|
|
448
448
|
{
|
|
449
449
|
ariaLabelClose: u.close_aria,
|
|
450
450
|
isOpen: n,
|
|
451
|
-
onClose:
|
|
452
|
-
onPrimaryAction: () =>
|
|
451
|
+
onClose: d,
|
|
452
|
+
onPrimaryAction: () => s(b),
|
|
453
453
|
title: _,
|
|
454
454
|
children: [
|
|
455
|
-
/* @__PURE__ */ e(
|
|
455
|
+
/* @__PURE__ */ e(W, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: a.select_debt_accounts_description }),
|
|
456
456
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.white" }, children: [
|
|
457
|
-
/* @__PURE__ */ e(
|
|
458
|
-
t.map((o,
|
|
459
|
-
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
460
|
-
/* @__PURE__ */ e(
|
|
461
|
-
|
|
457
|
+
/* @__PURE__ */ e(R, { variant: "fullWidth" }),
|
|
458
|
+
t.map((o, p) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
459
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => h(o), children: [
|
|
460
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
461
|
+
ne,
|
|
462
462
|
{
|
|
463
463
|
alt: o?.name || "",
|
|
464
464
|
institutionGuid: o?.institution_guid || ""
|
|
@@ -471,13 +471,13 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
471
471
|
secondary: x(o.balance || 0, "0,0.00")
|
|
472
472
|
}
|
|
473
473
|
),
|
|
474
|
-
/* @__PURE__ */ e(
|
|
474
|
+
/* @__PURE__ */ e(tt, { checked: b.some((r) => r.guid === o.guid) })
|
|
475
475
|
] }) }),
|
|
476
|
-
/* @__PURE__ */ e(
|
|
476
|
+
/* @__PURE__ */ e(R, { variant: p < t.length - 1 ? "inset" : "fullWidth" })
|
|
477
477
|
] }, o.guid))
|
|
478
478
|
] }),
|
|
479
479
|
/* @__PURE__ */ e(
|
|
480
|
-
|
|
480
|
+
ye,
|
|
481
481
|
{
|
|
482
482
|
description: a.connect_description,
|
|
483
483
|
label: a.connect_button,
|
|
@@ -487,56 +487,56 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
487
487
|
]
|
|
488
488
|
}
|
|
489
489
|
);
|
|
490
|
-
},
|
|
491
|
-
const { goals: n } = T(), { addGoal:
|
|
492
|
-
f ===
|
|
490
|
+
}, Et = ({ onClose: t }) => {
|
|
491
|
+
const { goals: n } = T(), { addGoal: d, debtGoals: s, setAlert: _, setSelectedGoal: a } = E(), { visibleDebtAccounts: u } = P(), [b, l] = y.useState(!1), h = Le(n), o = (r, c, f) => {
|
|
492
|
+
f === m.DEBT_TRACK ? l(!0) : a({
|
|
493
493
|
amount: 0,
|
|
494
494
|
current_amount: 0,
|
|
495
|
-
goal_type:
|
|
495
|
+
goal_type: pe.SAVE_AMOUNT,
|
|
496
496
|
initial_amount: 0,
|
|
497
|
-
meta_type:
|
|
497
|
+
meta_type: c,
|
|
498
498
|
name: r,
|
|
499
499
|
track_type: f
|
|
500
500
|
});
|
|
501
|
-
},
|
|
502
|
-
for (const
|
|
503
|
-
let f =
|
|
504
|
-
|
|
505
|
-
account_guid:
|
|
501
|
+
}, p = async (r) => {
|
|
502
|
+
for (const c of r) {
|
|
503
|
+
let f = J.CREDIT_CARD;
|
|
504
|
+
c.account_type === ge.LOAN ? f = J.LOANS : c.account_type === ge.LINE_OF_CREDIT && (f = J.LINE_OF_CREDIT), await d({
|
|
505
|
+
account_guid: c.guid,
|
|
506
506
|
amount: 0,
|
|
507
507
|
current_amount: 0,
|
|
508
|
-
goal_type:
|
|
509
|
-
initial_amount:
|
|
510
|
-
interest_rate:
|
|
508
|
+
goal_type: pe.KEEP_BALANCE_BELOW,
|
|
509
|
+
initial_amount: c.balance || 0,
|
|
510
|
+
interest_rate: c.interest_rate || 0,
|
|
511
511
|
meta_type: f,
|
|
512
|
-
monthly_payment:
|
|
513
|
-
name:
|
|
514
|
-
track_type:
|
|
512
|
+
monthly_payment: c.minimum_payment || 0,
|
|
513
|
+
name: c.name || c.feed_name || "",
|
|
514
|
+
track_type: m.DEBT_TRACK
|
|
515
515
|
}), _(n.alert_goal_added);
|
|
516
516
|
}
|
|
517
|
-
|
|
517
|
+
l(!1), t?.(m.DEBT_TRACK);
|
|
518
518
|
};
|
|
519
519
|
return /* @__PURE__ */ i(g, { children: [
|
|
520
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children:
|
|
520
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: h.map((r, c) => /* @__PURE__ */ e(xt, { goalType: r, onClick: o }, c)) }),
|
|
521
521
|
/* @__PURE__ */ e(
|
|
522
|
-
|
|
522
|
+
Ke,
|
|
523
523
|
{
|
|
524
|
-
accounts: u.filter((r) => !
|
|
525
|
-
isOpen:
|
|
526
|
-
onClose: () =>
|
|
527
|
-
onSave:
|
|
524
|
+
accounts: u.filter((r) => !s.find((c) => c.account_guid === r.guid)),
|
|
525
|
+
isOpen: b,
|
|
526
|
+
onClose: () => l(!1),
|
|
527
|
+
onSave: p,
|
|
528
528
|
title: n.select_debt_accounts_title
|
|
529
529
|
}
|
|
530
530
|
)
|
|
531
531
|
] });
|
|
532
|
-
},
|
|
533
|
-
const { accounts: n } = T(), { setSelectedAccount:
|
|
532
|
+
}, Me = ({ account: t }) => {
|
|
533
|
+
const { accounts: n } = T(), { setSelectedAccount: d } = nt(), [s, _] = y.useState(!1);
|
|
534
534
|
return /* @__PURE__ */ i(N, { sx: { bgcolor: "background.paper" }, children: [
|
|
535
535
|
/* @__PURE__ */ i(k, { onClick: () => {
|
|
536
|
-
|
|
536
|
+
d(t), _(!0);
|
|
537
537
|
}, children: [
|
|
538
|
-
/* @__PURE__ */ e(
|
|
539
|
-
|
|
538
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
539
|
+
ne,
|
|
540
540
|
{
|
|
541
541
|
alt: t.name || "",
|
|
542
542
|
institutionGuid: t.institution_guid || ""
|
|
@@ -551,37 +551,37 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
551
551
|
),
|
|
552
552
|
/* @__PURE__ */ e(M, {})
|
|
553
553
|
] }),
|
|
554
|
-
/* @__PURE__ */ e(
|
|
555
|
-
/* @__PURE__ */ e(
|
|
556
|
-
/* @__PURE__ */ e(
|
|
554
|
+
/* @__PURE__ */ e(j, { isOpen: s, onClose: () => _(!1), title: n.account_details, children: /* @__PURE__ */ i(g, { children: [
|
|
555
|
+
/* @__PURE__ */ e(ot, {}),
|
|
556
|
+
/* @__PURE__ */ e(at, {})
|
|
557
557
|
] }) })
|
|
558
558
|
] });
|
|
559
|
-
},
|
|
560
|
-
const { goals: n } = T(), { setAlert:
|
|
559
|
+
}, It = D(({ goal: t }) => {
|
|
560
|
+
const { goals: n } = T(), { setAlert: d, setSelectedGoal: s, updateGoal: _ } = E(), [a, u] = y.useState(t.amount), b = !t.guid, l = a < 0 || a > 9999999999e-2, h = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, o = async () => {
|
|
561
561
|
const r = { ...t, amount: a };
|
|
562
|
-
t.amount = a,
|
|
563
|
-
},
|
|
562
|
+
t.amount = a, b ? s(r) : (await _(r), d(n.alert_goal_updated_amount));
|
|
563
|
+
}, p = () => {
|
|
564
564
|
setTimeout(() => {
|
|
565
565
|
u(t.amount);
|
|
566
566
|
}, 250);
|
|
567
567
|
};
|
|
568
568
|
return /* @__PURE__ */ e(
|
|
569
|
-
|
|
569
|
+
ee,
|
|
570
570
|
{
|
|
571
|
-
isDisabled:
|
|
572
|
-
isSaveDisabled:
|
|
571
|
+
isDisabled: h,
|
|
572
|
+
isSaveDisabled: l,
|
|
573
573
|
label: n.details_amount_to_save,
|
|
574
|
-
onCancel:
|
|
574
|
+
onCancel: p,
|
|
575
575
|
onSave: o,
|
|
576
576
|
primaryText: n.details_amount_to_save,
|
|
577
577
|
secondaryText: x(t.amount, "0,0"),
|
|
578
|
-
zeroStateText:
|
|
578
|
+
zeroStateText: b && t.amount === 0 ? n.add_amount : void 0,
|
|
579
579
|
children: /* @__PURE__ */ e(
|
|
580
|
-
|
|
580
|
+
Ne,
|
|
581
581
|
{
|
|
582
582
|
amount: a,
|
|
583
583
|
autoFocus: !0,
|
|
584
|
-
error:
|
|
584
|
+
error: l,
|
|
585
585
|
fullWidth: !0,
|
|
586
586
|
minAmount: 0,
|
|
587
587
|
setAmount: (r) => u(isNaN(Number(r)) ? a : Number(r)),
|
|
@@ -590,35 +590,35 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
590
590
|
)
|
|
591
591
|
}
|
|
592
592
|
);
|
|
593
|
-
}),
|
|
594
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts:
|
|
595
|
-
const f = { ...t, account_guid:
|
|
596
|
-
|
|
593
|
+
}), Gt = ({ goal: t }) => {
|
|
594
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: d } = P(), { accounts: s, goals: _ } = T(), { setAlert: a, setSelectedGoal: u, updateGoal: b } = E(), l = !t.guid, [h, o] = y.useState(!1), p = async ({ balance: r, guid: c }) => {
|
|
595
|
+
const f = { ...t, account_guid: c, current_amount: r || 0 };
|
|
596
|
+
l ? u(f) : (await b(f), a(_.alert_account_changed)), o(!1);
|
|
597
597
|
};
|
|
598
598
|
return /* @__PURE__ */ i(g, { children: [
|
|
599
|
-
|
|
599
|
+
l && !t.account_guid ? /* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => o(!0), children: [
|
|
600
600
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
601
|
-
/* @__PURE__ */ e(
|
|
601
|
+
/* @__PURE__ */ e(xe, { filled: !0 }),
|
|
602
602
|
_.details_add_account
|
|
603
603
|
] }) }),
|
|
604
604
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
605
605
|
] }) }) : /* @__PURE__ */ i(g, { sx: { gap: 8, my: 24, mx: 24 }, children: [
|
|
606
|
-
/* @__PURE__ */ e(
|
|
606
|
+
/* @__PURE__ */ e(ue, { onClick: () => o(!0), variant: "text", children: _.details_change_account }),
|
|
607
607
|
/* @__PURE__ */ e(
|
|
608
608
|
A,
|
|
609
609
|
{
|
|
610
610
|
color: "text.secondary",
|
|
611
611
|
sx: { textAlign: "center", whiteSpace: "wrap" },
|
|
612
612
|
variant: "Paragraph",
|
|
613
|
-
children:
|
|
613
|
+
children: O(_.details_change_account_description, t.name)
|
|
614
614
|
}
|
|
615
615
|
)
|
|
616
616
|
] }),
|
|
617
|
-
/* @__PURE__ */ e(
|
|
618
|
-
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children:
|
|
619
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: n.map((r) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
620
|
-
/* @__PURE__ */ e(
|
|
621
|
-
|
|
617
|
+
/* @__PURE__ */ e(j, { isOpen: h, onClose: () => o(!1), title: _.details_change_account, children: /* @__PURE__ */ i(g, { children: [
|
|
618
|
+
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: s.account_types[1] }),
|
|
619
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: n.map((r) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => p(r), children: [
|
|
620
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
621
|
+
ne,
|
|
622
622
|
{
|
|
623
623
|
alt: r?.name || "",
|
|
624
624
|
institutionGuid: r?.institution_guid || ""
|
|
@@ -633,10 +633,10 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
633
633
|
),
|
|
634
634
|
/* @__PURE__ */ e(M, {})
|
|
635
635
|
] }) }, r.guid)) }),
|
|
636
|
-
|
|
637
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children:
|
|
638
|
-
/* @__PURE__ */ e(
|
|
639
|
-
|
|
636
|
+
d.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: s.account_types[2] }),
|
|
637
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: d.map((r) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => p(r), children: [
|
|
638
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
639
|
+
ne,
|
|
640
640
|
{
|
|
641
641
|
alt: r?.name || "",
|
|
642
642
|
institutionGuid: r?.institution_guid || ""
|
|
@@ -652,7 +652,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
652
652
|
/* @__PURE__ */ e(M, {})
|
|
653
653
|
] }) }, r.guid)) }),
|
|
654
654
|
/* @__PURE__ */ e(
|
|
655
|
-
|
|
655
|
+
ye,
|
|
656
656
|
{
|
|
657
657
|
description: _.connect_description,
|
|
658
658
|
label: _.connect_button,
|
|
@@ -661,413 +661,412 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
661
661
|
)
|
|
662
662
|
] }) })
|
|
663
663
|
] });
|
|
664
|
-
},
|
|
665
|
-
const { goals: n } = T(), { setAlert:
|
|
666
|
-
const
|
|
667
|
-
t.name = a,
|
|
664
|
+
}, Nt = D(({ goal: t }) => {
|
|
665
|
+
const { goals: n } = T(), { setAlert: d, setSelectedGoal: s, updateGoal: _ } = E(), [a, u] = y.useState(t.name), b = !t.guid, l = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, h = async () => {
|
|
666
|
+
const p = { ...t, name: a };
|
|
667
|
+
t.name = a, b ? s(p) : (await _(p), d(n.alert_goal_updated_name));
|
|
668
668
|
}, o = () => {
|
|
669
669
|
setTimeout(() => {
|
|
670
670
|
u(t.name);
|
|
671
671
|
}, 250);
|
|
672
672
|
};
|
|
673
673
|
return /* @__PURE__ */ e(
|
|
674
|
-
|
|
674
|
+
ee,
|
|
675
675
|
{
|
|
676
|
-
isDisabled:
|
|
676
|
+
isDisabled: l,
|
|
677
677
|
isSaveDisabled: !a,
|
|
678
678
|
label: n.details_goal_name,
|
|
679
679
|
onCancel: o,
|
|
680
|
-
onSave:
|
|
680
|
+
onSave: h,
|
|
681
681
|
primaryText: n.details_goal_name,
|
|
682
682
|
secondaryText: t.name,
|
|
683
683
|
children: /* @__PURE__ */ e(
|
|
684
|
-
|
|
684
|
+
ke,
|
|
685
685
|
{
|
|
686
686
|
error: !a,
|
|
687
687
|
fullWidth: !0,
|
|
688
688
|
label: n.details_goal_name,
|
|
689
|
-
onChange: (
|
|
689
|
+
onChange: (p) => u(p.target.value),
|
|
690
690
|
value: a
|
|
691
691
|
}
|
|
692
692
|
)
|
|
693
693
|
}
|
|
694
694
|
);
|
|
695
|
-
}),
|
|
696
|
-
const { goals: n } = T(), { setAlert:
|
|
695
|
+
}), kt = ({ goal: t }) => {
|
|
696
|
+
const { goals: n } = T(), { setAlert: d, setSelectedGoal: s, updateGoal: _ } = E(), [a, u] = y.useState(t.retirement_age || 65), b = !t.guid, l = async () => {
|
|
697
697
|
if (!isNaN(a)) {
|
|
698
|
-
const
|
|
699
|
-
t.retirement_age = a,
|
|
698
|
+
const p = { ...t, retirement_age: a };
|
|
699
|
+
t.retirement_age = a, b ? s(p) : (await _(p), d(n.alert_goal_updated_retirement_age));
|
|
700
700
|
}
|
|
701
|
-
},
|
|
701
|
+
}, h = () => {
|
|
702
702
|
setTimeout(() => {
|
|
703
703
|
u(t.retirement_age || 65);
|
|
704
704
|
}, 250);
|
|
705
705
|
}, o = !a || isNaN(a) || a < 20 || a >= 100;
|
|
706
706
|
return /* @__PURE__ */ e(
|
|
707
|
-
|
|
707
|
+
ee,
|
|
708
708
|
{
|
|
709
709
|
isDisabled: t.is_complete,
|
|
710
710
|
isSaveDisabled: o,
|
|
711
711
|
label: n.details_retirement_age,
|
|
712
|
-
onCancel:
|
|
713
|
-
onSave:
|
|
712
|
+
onCancel: h,
|
|
713
|
+
onSave: l,
|
|
714
714
|
primaryText: n.details_retirement_age,
|
|
715
715
|
secondaryText: `${t.retirement_age}`,
|
|
716
|
-
zeroStateText:
|
|
716
|
+
zeroStateText: b && !t.retirement_age ? n.add_age : void 0,
|
|
717
717
|
children: /* @__PURE__ */ e(
|
|
718
|
-
|
|
718
|
+
ke,
|
|
719
719
|
{
|
|
720
720
|
error: o,
|
|
721
721
|
fullWidth: !0,
|
|
722
722
|
label: n.details_retirement_age,
|
|
723
|
-
onChange: (
|
|
723
|
+
onChange: (p) => u(Number(p.target.value)),
|
|
724
724
|
value: isNaN(a) ? "" : a
|
|
725
725
|
}
|
|
726
726
|
)
|
|
727
727
|
}
|
|
728
728
|
);
|
|
729
|
-
},
|
|
730
|
-
const { goals: n } = T(), { user:
|
|
731
|
-
a &&
|
|
729
|
+
}, wt = D(({ goal: t }) => {
|
|
730
|
+
const { goals: n } = T(), { user: d, updateUser: s } = Ee(), { setAlert: _ } = E(), [a, u] = y.useState(Q(d.birthday ?? 0)), [b, l] = y.useState(null), h = t.is_complete, o = async () => {
|
|
731
|
+
a && ct(a) && (await s({ ...d, birthday: lt(a) }), _(n.alert_goal_updated_birthday));
|
|
732
732
|
};
|
|
733
733
|
return /* @__PURE__ */ e(
|
|
734
|
-
|
|
734
|
+
ee,
|
|
735
735
|
{
|
|
736
|
-
isDisabled:
|
|
737
|
-
isSaveDisabled: !!
|
|
736
|
+
isDisabled: h,
|
|
737
|
+
isSaveDisabled: !!b,
|
|
738
738
|
label: n.details_birthday,
|
|
739
739
|
onSave: o,
|
|
740
740
|
primaryText: n.details_birthday,
|
|
741
|
-
secondaryText: `${
|
|
742
|
-
zeroStateText: !t.guid && !
|
|
743
|
-
children: /* @__PURE__ */ e(
|
|
744
|
-
|
|
741
|
+
secondaryText: `${ae(Q(d.birthday ?? 0), re.MONTH_DAY_YEAR)}`,
|
|
742
|
+
zeroStateText: !t.guid && !d.birthday ? n.add_birthday : void 0,
|
|
743
|
+
children: /* @__PURE__ */ e(ut, { dateAdapter: dt, children: /* @__PURE__ */ e(
|
|
744
|
+
mt,
|
|
745
745
|
{
|
|
746
746
|
label: n.details_birthday,
|
|
747
747
|
onChange: u,
|
|
748
|
-
onError: (
|
|
748
|
+
onError: (p) => l(p),
|
|
749
749
|
sx: { width: "100%" },
|
|
750
750
|
value: a
|
|
751
751
|
}
|
|
752
752
|
) })
|
|
753
753
|
}
|
|
754
754
|
);
|
|
755
|
-
}),
|
|
756
|
-
const { goals: n } = T(), { visibleInvestmentAccounts:
|
|
757
|
-
addRetirementGoalAccount:
|
|
755
|
+
}), Dt = ({ goal: t }) => {
|
|
756
|
+
const { goals: n } = T(), { visibleInvestmentAccounts: d } = P(), {
|
|
757
|
+
addRetirementGoalAccount: s,
|
|
758
758
|
newRetirementGoalAccounts: _,
|
|
759
759
|
retirementGoalAccounts: a,
|
|
760
760
|
selectedGoal: u,
|
|
761
|
-
setAlert:
|
|
762
|
-
setNewRetirementGoalAccounts:
|
|
763
|
-
setSelectedGoal:
|
|
764
|
-
} = E(), [o,
|
|
765
|
-
(C) => r ? _.find((
|
|
766
|
-
), f =
|
|
767
|
-
(C) => !a.find((
|
|
768
|
-
),
|
|
769
|
-
const
|
|
761
|
+
setAlert: b,
|
|
762
|
+
setNewRetirementGoalAccounts: l,
|
|
763
|
+
setSelectedGoal: h
|
|
764
|
+
} = E(), [o, p] = y.useState(!1), r = !t.guid, c = d.filter(
|
|
765
|
+
(C) => r ? _.find((S) => S.account_guid === C.guid) : a.find((S) => S.account_guid === C.guid)
|
|
766
|
+
), f = d.filter(
|
|
767
|
+
(C) => !a.find((S) => S.account_guid === C.guid)
|
|
768
|
+
), v = async (C) => {
|
|
769
|
+
const S = C.map((I) => ({
|
|
770
770
|
account_guid: I.guid,
|
|
771
771
|
retirement_goal_guid: t.guid
|
|
772
772
|
}));
|
|
773
773
|
if (r)
|
|
774
|
-
|
|
774
|
+
l(S);
|
|
775
775
|
else
|
|
776
|
-
for (const I of
|
|
777
|
-
await
|
|
778
|
-
|
|
776
|
+
for (const I of S)
|
|
777
|
+
await s(I), b(n.alert_account_added);
|
|
778
|
+
h({
|
|
779
779
|
...u,
|
|
780
|
-
current_amount: C.reduce((I,
|
|
781
|
-
}),
|
|
780
|
+
current_amount: C.reduce((I, F) => I + (F.balance || 0), 0)
|
|
781
|
+
}), p(!1);
|
|
782
782
|
};
|
|
783
783
|
return /* @__PURE__ */ i(g, { children: [
|
|
784
|
-
|
|
785
|
-
/* @__PURE__ */ e(
|
|
786
|
-
/* @__PURE__ */ e(
|
|
784
|
+
c.map((C) => /* @__PURE__ */ i(g, { children: [
|
|
785
|
+
/* @__PURE__ */ e(Me, { account: C }),
|
|
786
|
+
/* @__PURE__ */ e(R, {})
|
|
787
787
|
] }, C.guid)),
|
|
788
|
-
/* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
788
|
+
/* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => p(!0), children: [
|
|
789
789
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
790
|
-
/* @__PURE__ */ e(
|
|
790
|
+
/* @__PURE__ */ e(xe, { filled: !0 }),
|
|
791
791
|
n.details_add_account
|
|
792
792
|
] }) }),
|
|
793
793
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
794
794
|
] }) }),
|
|
795
795
|
/* @__PURE__ */ e(
|
|
796
|
-
|
|
796
|
+
Ke,
|
|
797
797
|
{
|
|
798
798
|
accounts: f,
|
|
799
799
|
isOpen: o,
|
|
800
|
-
onClose: () =>
|
|
801
|
-
onSave:
|
|
800
|
+
onClose: () => p(!1),
|
|
801
|
+
onSave: v,
|
|
802
802
|
title: n.add_select_accounts
|
|
803
803
|
}
|
|
804
804
|
)
|
|
805
805
|
] });
|
|
806
|
-
},
|
|
807
|
-
const { goals: n } = T(), { visibleAccounts:
|
|
808
|
-
() =>
|
|
809
|
-
[
|
|
806
|
+
}, Kt = D(({ goal: t }) => {
|
|
807
|
+
const { goals: n } = T(), { visibleAccounts: d } = P(), s = y.useMemo(
|
|
808
|
+
() => d.find((u) => u.guid === t.account_guid),
|
|
809
|
+
[d, t]
|
|
810
810
|
), _ = t.track_type;
|
|
811
811
|
let a = n.details_save_title;
|
|
812
|
-
return t.track_type ===
|
|
812
|
+
return t.track_type === m.DEBT_TRACK ? a = n.details_debt_title : t.track_type === m.RETIREMENT_TRACK && (a = n.details_retirement_title), /* @__PURE__ */ i(g, { children: [
|
|
813
813
|
/* @__PURE__ */ i(g, { mx: 24, children: [
|
|
814
814
|
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: a }),
|
|
815
|
-
/* @__PURE__ */ e(
|
|
815
|
+
/* @__PURE__ */ e(De, { goal: t, isInDrawer: !0 }),
|
|
816
816
|
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: n.details_title })
|
|
817
817
|
] }),
|
|
818
818
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
819
|
-
/* @__PURE__ */ e(
|
|
820
|
-
/* @__PURE__ */ e(
|
|
821
|
-
(_ ===
|
|
822
|
-
/* @__PURE__ */ e(
|
|
823
|
-
/* @__PURE__ */ e(
|
|
819
|
+
/* @__PURE__ */ e(Nt, { goal: t }),
|
|
820
|
+
/* @__PURE__ */ e(R, { sx: { ml: 24 } }),
|
|
821
|
+
(_ === m.SAVINGS_TRACK || _ === m.RETIREMENT_TRACK) && /* @__PURE__ */ i(U, { children: [
|
|
822
|
+
/* @__PURE__ */ e(It, { goal: t }),
|
|
823
|
+
/* @__PURE__ */ e(R, { sx: { ml: _ === m.RETIREMENT_TRACK ? 24 : 0 } })
|
|
824
824
|
] }),
|
|
825
|
-
t.track_type ===
|
|
826
|
-
/* @__PURE__ */ e(
|
|
827
|
-
/* @__PURE__ */ e(
|
|
828
|
-
/* @__PURE__ */ e(
|
|
829
|
-
/* @__PURE__ */ e(
|
|
830
|
-
/* @__PURE__ */ e(
|
|
831
|
-
/* @__PURE__ */ e(
|
|
825
|
+
t.track_type === m.DEBT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
826
|
+
/* @__PURE__ */ e(rt, { goal: t }),
|
|
827
|
+
/* @__PURE__ */ e(R, { sx: { ml: 24 } }),
|
|
828
|
+
/* @__PURE__ */ e(it, { goal: t }),
|
|
829
|
+
/* @__PURE__ */ e(R, { sx: { ml: 24 } }),
|
|
830
|
+
/* @__PURE__ */ e(st, { goal: t }),
|
|
831
|
+
/* @__PURE__ */ e(R, { variant: "fullWidth" })
|
|
832
832
|
] }),
|
|
833
|
-
t.track_type ===
|
|
834
|
-
/* @__PURE__ */ e(
|
|
835
|
-
/* @__PURE__ */ e(
|
|
836
|
-
/* @__PURE__ */ e(
|
|
837
|
-
/* @__PURE__ */ e(
|
|
833
|
+
t.track_type === m.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
834
|
+
/* @__PURE__ */ e(kt, { goal: t }),
|
|
835
|
+
/* @__PURE__ */ e(R, { sx: { ml: 24 } }),
|
|
836
|
+
/* @__PURE__ */ e(wt, { goal: t }),
|
|
837
|
+
/* @__PURE__ */ e(R, { variant: "fullWidth" })
|
|
838
838
|
] })
|
|
839
839
|
] }),
|
|
840
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type ===
|
|
841
|
-
t.track_type !==
|
|
842
|
-
/* @__PURE__ */ e(
|
|
843
|
-
/* @__PURE__ */ e(
|
|
840
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type === m.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
|
|
841
|
+
t.track_type !== m.RETIREMENT_TRACK && s && /* @__PURE__ */ i(U, { children: [
|
|
842
|
+
/* @__PURE__ */ e(Me, { account: s }),
|
|
843
|
+
/* @__PURE__ */ e(R, {})
|
|
844
844
|
] }),
|
|
845
|
-
t.track_type ===
|
|
846
|
-
/* @__PURE__ */ e(
|
|
847
|
-
/* @__PURE__ */ e(
|
|
845
|
+
t.track_type === m.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
846
|
+
/* @__PURE__ */ e(Dt, { goal: t }),
|
|
847
|
+
/* @__PURE__ */ e(R, {})
|
|
848
848
|
] }),
|
|
849
|
-
t.track_type ===
|
|
849
|
+
t.track_type === m.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(Gt, { goal: t })
|
|
850
850
|
] });
|
|
851
|
-
}),
|
|
852
|
-
const { visibleInvestmentAccounts: n } =
|
|
851
|
+
}), Mt = D(({ onClose: t }) => {
|
|
852
|
+
const { visibleInvestmentAccounts: n } = P(), { goals: d, common: s } = T(), {
|
|
853
853
|
addGoal: _,
|
|
854
854
|
addRetirementGoal: a,
|
|
855
855
|
deleteGoal: u,
|
|
856
|
-
deleteRetirementGoal:
|
|
857
|
-
newRetirementGoalAccounts:
|
|
858
|
-
retirementGoalAccounts:
|
|
856
|
+
deleteRetirementGoal: b,
|
|
857
|
+
newRetirementGoalAccounts: l,
|
|
858
|
+
retirementGoalAccounts: h,
|
|
859
859
|
selectedGoal: o,
|
|
860
|
-
setAlert:
|
|
860
|
+
setAlert: p,
|
|
861
861
|
setSelectedGoal: r,
|
|
862
|
-
updateGoal:
|
|
863
|
-
} = E(), { user: f } =
|
|
864
|
-
const G =
|
|
865
|
-
return n.filter((
|
|
866
|
-
}, [
|
|
862
|
+
updateGoal: c
|
|
863
|
+
} = E(), { user: f } = Ee(), [v, C] = y.useState(!1), S = !o?.guid, I = o?.track_type === m.SAVINGS_TRACK && o.is_complete && !o.has_been_spent, F = y.useMemo(() => {
|
|
864
|
+
const G = S ? l : h;
|
|
865
|
+
return n.filter((X) => G.some((K) => K.account_guid === X.guid));
|
|
866
|
+
}, [S, n, l, h]), Z = y.useMemo(() => {
|
|
867
867
|
if (!o) return !1;
|
|
868
|
-
const { account_guid: G, track_type:
|
|
869
|
-
return
|
|
870
|
-
}, [o,
|
|
871
|
-
let
|
|
872
|
-
|
|
873
|
-
const
|
|
868
|
+
const { account_guid: G, track_type: X, name: K, amount: q, retirement_age: L } = o;
|
|
869
|
+
return X === m.SAVINGS_TRACK ? G ? !!K && !!q : !1 : X === m.RETIREMENT_TRACK ? F.length ? !!K && !!q && !!L && !!f.birthday : !1 : !0;
|
|
870
|
+
}, [o, F, f.birthday]);
|
|
871
|
+
let z = s.delete_button, H = () => C(!0);
|
|
872
|
+
S ? (H = () => te(), z = s.save_button) : I && (H = () => se(), z = d.mark_as_complete_button);
|
|
873
|
+
const te = async () => {
|
|
874
874
|
if (o) {
|
|
875
875
|
const G = o.track_type;
|
|
876
|
-
G !==
|
|
876
|
+
G !== m.RETIREMENT_TRACK ? await _(o) : G === m.RETIREMENT_TRACK && await a({ ...o, target_amount: o.amount }), p(d.alert_goal_added), r(void 0), G && t?.(G);
|
|
877
877
|
}
|
|
878
|
-
},
|
|
879
|
-
o && (o.track_type !==
|
|
880
|
-
},
|
|
878
|
+
}, ie = async () => {
|
|
879
|
+
o && (o.track_type !== m.RETIREMENT_TRACK ? await u(o.guid) : o.track_type === m.RETIREMENT_TRACK && await b(o), p(d.alert_goal_deleted), r(void 0));
|
|
880
|
+
}, se = async () => {
|
|
881
881
|
const G = {
|
|
882
882
|
...o,
|
|
883
883
|
has_been_spent: !0
|
|
884
884
|
};
|
|
885
|
-
await
|
|
885
|
+
await c(G), p(d.alert_goal_completed), r(void 0);
|
|
886
886
|
};
|
|
887
887
|
return /* @__PURE__ */ i(g, { children: [
|
|
888
888
|
/* @__PURE__ */ e(
|
|
889
|
-
|
|
889
|
+
j,
|
|
890
890
|
{
|
|
891
|
-
ariaLabelClose:
|
|
892
|
-
hasSecondaryAction:
|
|
891
|
+
ariaLabelClose: s.close_aria,
|
|
892
|
+
hasSecondaryAction: S,
|
|
893
893
|
isOpen: !!o,
|
|
894
|
-
isPrimaryDisabled: !
|
|
894
|
+
isPrimaryDisabled: !Z,
|
|
895
895
|
onClose: () => r(void 0),
|
|
896
|
-
onPrimaryAction:
|
|
897
|
-
primaryColor:
|
|
898
|
-
primaryText:
|
|
896
|
+
onPrimaryAction: H,
|
|
897
|
+
primaryColor: S || I ? "primary" : "error",
|
|
898
|
+
primaryText: z,
|
|
899
899
|
secondaryColor: "primary",
|
|
900
|
-
title:
|
|
901
|
-
children: o && /* @__PURE__ */ e(
|
|
900
|
+
title: d.goal_details,
|
|
901
|
+
children: o && /* @__PURE__ */ e(Kt, { goal: o })
|
|
902
902
|
}
|
|
903
903
|
),
|
|
904
904
|
/* @__PURE__ */ e(
|
|
905
|
-
|
|
905
|
+
Je,
|
|
906
906
|
{
|
|
907
|
-
copy: { close_aria:
|
|
908
|
-
isOpen:
|
|
907
|
+
copy: { close_aria: s.close_aria, title: d.delete_goal },
|
|
908
|
+
isOpen: v,
|
|
909
909
|
maxWidth: "xs",
|
|
910
910
|
onClose: () => C(!1),
|
|
911
|
-
onPrimaryAction:
|
|
911
|
+
onPrimaryAction: ie,
|
|
912
912
|
primaryColor: "error",
|
|
913
|
-
primaryText:
|
|
914
|
-
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children:
|
|
913
|
+
primaryText: s.delete_button,
|
|
914
|
+
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: O(d.delete_description, o?.name || "") })
|
|
915
915
|
}
|
|
916
916
|
)
|
|
917
917
|
] });
|
|
918
|
-
}),
|
|
919
|
-
const { onEvent:
|
|
920
|
-
|
|
918
|
+
}), Pn = D(({ onBackClick: t, sx: n }) => {
|
|
919
|
+
const { onEvent: d } = Ie(), { isMobile: s } = _e(), { visibleAccounts: _ } = P(), { isCopyLoaded: a, isInitialized: u, setSelectedAccounts: b } = Ge(), { goals: l, common: h } = T(), { alert: o, goals: p, goalsLoaded: r, loadGoals: c, monthlyCashFlowProfile: f, setAlert: v, retirmentGoals: C } = E(), [S, I] = y.useState(0), [F, Z] = y.useState(!1), z = f?.amount_allocated_for_savings_goals || 0, H = f?.amount_allocated_for_debt_goals || 0, te = f?.amount_allocated_for_retirement_goals || 0, ie = a ? O(
|
|
920
|
+
s ? l.tab_subtitle_mobile : l.tab_subtitle,
|
|
921
921
|
x(z, "0,0")
|
|
922
|
-
) : "",
|
|
923
|
-
|
|
924
|
-
x(
|
|
925
|
-
) : "",
|
|
926
|
-
|
|
922
|
+
) : "", se = a ? O(
|
|
923
|
+
s ? l.tab_subtitle_mobile : l.tab_subtitle,
|
|
924
|
+
x(H, "0,0")
|
|
925
|
+
) : "", G = a ? O(
|
|
926
|
+
s ? l.tab_subtitle_mobile : l.tab_subtitle,
|
|
927
927
|
x(te, "0,0")
|
|
928
928
|
) : "";
|
|
929
929
|
y.useEffect(() => {
|
|
930
|
-
b(
|
|
930
|
+
b(_), d(Y.GOALS_VIEW);
|
|
931
931
|
}, []), y.useEffect(() => {
|
|
932
|
-
|
|
933
|
-
}, [
|
|
932
|
+
u && c().finally();
|
|
933
|
+
}, [u, z, H, te]);
|
|
934
934
|
const X = () => {
|
|
935
|
-
|
|
936
|
-
},
|
|
937
|
-
|
|
938
|
-
},
|
|
939
|
-
|
|
940
|
-
},
|
|
941
|
-
() =>
|
|
942
|
-
[
|
|
943
|
-
)
|
|
944
|
-
return !
|
|
945
|
-
|
|
935
|
+
d(Y.GOALS_CLICK_FILTER);
|
|
936
|
+
}, K = () => {
|
|
937
|
+
Z(!0), d(Y.GOALS_CLICK_ADD);
|
|
938
|
+
}, q = ($) => {
|
|
939
|
+
Z(!1), $ === m.SAVINGS_TRACK ? I(0) : $ === m.DEBT_TRACK ? I(1) : $ === m.RETIREMENT_TRACK && I(2);
|
|
940
|
+
}, L = y.useMemo(
|
|
941
|
+
() => r && (p.length === 0 || p.every(({ track_type: $ }) => !$) && C.length === 0),
|
|
942
|
+
[p, r, C]
|
|
943
|
+
);
|
|
944
|
+
return !r || !a || !u ? /* @__PURE__ */ e(we, {}) : /* @__PURE__ */ i(
|
|
945
|
+
pt,
|
|
946
946
|
{
|
|
947
|
-
accountOptions:
|
|
947
|
+
accountOptions: _,
|
|
948
948
|
actions: [
|
|
949
949
|
{
|
|
950
950
|
iconName: "add",
|
|
951
|
-
label:
|
|
952
|
-
onClick:
|
|
951
|
+
label: l.add_title,
|
|
952
|
+
onClick: K
|
|
953
953
|
}
|
|
954
954
|
],
|
|
955
955
|
onAccountsFilterClick: X,
|
|
956
956
|
onBackClick: t,
|
|
957
957
|
sx: n,
|
|
958
|
-
title:
|
|
958
|
+
title: l.title,
|
|
959
959
|
children: [
|
|
960
|
-
/* @__PURE__ */ i(g, { mx:
|
|
960
|
+
/* @__PURE__ */ i(g, { mx: s ? 0 : 48, my: 24, children: [
|
|
961
961
|
/* @__PURE__ */ i(
|
|
962
|
-
|
|
962
|
+
Pe,
|
|
963
963
|
{
|
|
964
|
-
onChange: ($,
|
|
964
|
+
onChange: ($, Be) => I(Be),
|
|
965
965
|
sx: { bgcolor: "background.paper" },
|
|
966
966
|
textColor: "primary",
|
|
967
|
-
value:
|
|
967
|
+
value: L ? !1 : S,
|
|
968
968
|
variant: "fullWidth",
|
|
969
969
|
children: [
|
|
970
970
|
/* @__PURE__ */ e(
|
|
971
|
-
|
|
971
|
+
le,
|
|
972
972
|
{
|
|
973
|
-
disabled:
|
|
974
|
-
label: /* @__PURE__ */ e(
|
|
973
|
+
disabled: L,
|
|
974
|
+
label: /* @__PURE__ */ e(ce, { subtitle: ie, title: l.tab_saving_title })
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
977
|
/* @__PURE__ */ e(
|
|
978
|
-
|
|
978
|
+
le,
|
|
979
979
|
{
|
|
980
|
-
disabled:
|
|
981
|
-
label: /* @__PURE__ */ e(
|
|
980
|
+
disabled: L,
|
|
981
|
+
label: /* @__PURE__ */ e(ce, { subtitle: se, title: l.tab_debt_title })
|
|
982
982
|
}
|
|
983
983
|
),
|
|
984
984
|
/* @__PURE__ */ e(
|
|
985
|
-
|
|
985
|
+
le,
|
|
986
986
|
{
|
|
987
|
-
disabled:
|
|
988
|
-
label: /* @__PURE__ */ e(
|
|
987
|
+
disabled: L,
|
|
988
|
+
label: /* @__PURE__ */ e(ce, { subtitle: G, title: l.tab_retirement_title })
|
|
989
989
|
}
|
|
990
990
|
)
|
|
991
991
|
]
|
|
992
992
|
}
|
|
993
993
|
),
|
|
994
|
-
|
|
995
|
-
|
|
994
|
+
L ? /* @__PURE__ */ e(
|
|
995
|
+
_t,
|
|
996
996
|
{
|
|
997
|
-
header:
|
|
997
|
+
header: l.create_goals_header,
|
|
998
998
|
icon: "trophy",
|
|
999
|
-
onClick:
|
|
1000
|
-
primaryButton:
|
|
1001
|
-
subText:
|
|
999
|
+
onClick: K,
|
|
1000
|
+
primaryButton: l.add_goals_button,
|
|
1001
|
+
subText: l.empty_state_subheader,
|
|
1002
1002
|
sx: {
|
|
1003
1003
|
width: { sm: 432 },
|
|
1004
1004
|
".buttons-footer": {
|
|
1005
1005
|
width: 139
|
|
1006
1006
|
}
|
|
1007
|
-
}
|
|
1008
|
-
variant: Oe
|
|
1007
|
+
}
|
|
1009
1008
|
}
|
|
1010
1009
|
) : /* @__PURE__ */ i(U, { children: [
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1010
|
+
S === 0 && /* @__PURE__ */ e(de, { onAddGoals: K, trackType: m.SAVINGS_TRACK }),
|
|
1011
|
+
S === 1 && /* @__PURE__ */ e(de, { onAddGoals: K, trackType: m.DEBT_TRACK }),
|
|
1012
|
+
S === 2 && /* @__PURE__ */ e(de, { onAddGoals: K, trackType: m.RETIREMENT_TRACK })
|
|
1014
1013
|
] })
|
|
1015
1014
|
] }),
|
|
1016
|
-
/* @__PURE__ */ e(
|
|
1015
|
+
/* @__PURE__ */ e(Mt, { onClose: q }),
|
|
1017
1016
|
/* @__PURE__ */ e(
|
|
1018
|
-
|
|
1017
|
+
j,
|
|
1019
1018
|
{
|
|
1020
|
-
ariaLabelClose:
|
|
1021
|
-
isOpen:
|
|
1022
|
-
onClose: () =>
|
|
1023
|
-
title:
|
|
1024
|
-
children: /* @__PURE__ */ e(
|
|
1019
|
+
ariaLabelClose: h.close_aria,
|
|
1020
|
+
isOpen: F,
|
|
1021
|
+
onClose: () => Z(!1),
|
|
1022
|
+
title: l.add_goal_title,
|
|
1023
|
+
children: /* @__PURE__ */ e(Et, { onClose: q })
|
|
1025
1024
|
}
|
|
1026
1025
|
),
|
|
1027
|
-
/* @__PURE__ */ e(
|
|
1026
|
+
/* @__PURE__ */ e(Ve, { onClose: () => v(""), open: !!o, children: /* @__PURE__ */ e(We, { onClose: () => v(""), severity: "success", variant: "filled", children: o }) })
|
|
1028
1027
|
]
|
|
1029
1028
|
}
|
|
1030
1029
|
);
|
|
1031
|
-
}),
|
|
1032
|
-
const { goals: n } = T(),
|
|
1033
|
-
backgroundColor:
|
|
1030
|
+
}), Bt = D(({ goal: t }) => {
|
|
1031
|
+
const { goals: n } = T(), d = gt(), {
|
|
1032
|
+
backgroundColor: s,
|
|
1034
1033
|
color: _,
|
|
1035
1034
|
percentage: a,
|
|
1036
1035
|
projectedText: u
|
|
1037
|
-
} =
|
|
1038
|
-
let
|
|
1039
|
-
return t.track_type ===
|
|
1040
|
-
/* @__PURE__ */ e(
|
|
1041
|
-
/* @__PURE__ */ i(
|
|
1042
|
-
/* @__PURE__ */ e(
|
|
1036
|
+
} = fe(n, t), b = Math.round(a * 100);
|
|
1037
|
+
let l = /* @__PURE__ */ e(Se, {});
|
|
1038
|
+
return t.track_type === m.DEBT_TRACK ? l = /* @__PURE__ */ e(Re, {}) : t.track_type === m.RETIREMENT_TRACK && (l = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
|
|
1039
|
+
/* @__PURE__ */ e(oe, { sx: { bgcolor: s, color: _, height: 32, width: 32 }, variant: "rounded", children: l }),
|
|
1040
|
+
/* @__PURE__ */ i(bt, { sx: { width: "100%" }, children: [
|
|
1041
|
+
/* @__PURE__ */ e(me, { fontSize: 15, fontWeight: 600, variant: "body1", children: t.name }),
|
|
1043
1042
|
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: u })
|
|
1044
1043
|
] }),
|
|
1045
1044
|
/* @__PURE__ */ e(
|
|
1046
|
-
|
|
1045
|
+
ft,
|
|
1047
1046
|
{
|
|
1048
|
-
backgroundStrokeColor:
|
|
1049
|
-
color:
|
|
1050
|
-
percent:
|
|
1047
|
+
backgroundStrokeColor: d.palette.border.lighter,
|
|
1048
|
+
color: d.palette.primary.main,
|
|
1049
|
+
percent: b,
|
|
1051
1050
|
size: 40,
|
|
1052
1051
|
strokeWidth: 3,
|
|
1053
|
-
children: /* @__PURE__ */ e(
|
|
1052
|
+
children: /* @__PURE__ */ e(W, { fontWeight: 700, variant: "caption", children: `${b}%` })
|
|
1054
1053
|
}
|
|
1055
1054
|
)
|
|
1056
1055
|
] });
|
|
1057
|
-
}),
|
|
1056
|
+
}), Ot = ({ header: t, subText: n, sx: d }) => /* @__PURE__ */ i(
|
|
1058
1057
|
g,
|
|
1059
1058
|
{
|
|
1060
1059
|
sx: {
|
|
1061
1060
|
alignItems: "center",
|
|
1062
1061
|
alignSelf: "center",
|
|
1063
1062
|
px: 24,
|
|
1064
|
-
...
|
|
1063
|
+
...d
|
|
1065
1064
|
},
|
|
1066
1065
|
children: [
|
|
1067
|
-
/* @__PURE__ */ e(
|
|
1068
|
-
/* @__PURE__ */ e(
|
|
1066
|
+
/* @__PURE__ */ e(Ye, { size: 32 }),
|
|
1067
|
+
/* @__PURE__ */ e(me, { fontSize: 15, fontWeight: 600, children: t }),
|
|
1069
1068
|
/* @__PURE__ */ e(
|
|
1070
|
-
|
|
1069
|
+
W,
|
|
1071
1070
|
{
|
|
1072
1071
|
color: "text.secondary",
|
|
1073
1072
|
sx: { fontWeight: 400, maxWidth: { sm: 424 }, textAlign: "center" },
|
|
@@ -1077,46 +1076,46 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1077
1076
|
)
|
|
1078
1077
|
]
|
|
1079
1078
|
}
|
|
1080
|
-
),
|
|
1081
|
-
const { visibleAccounts: n } =
|
|
1079
|
+
), jn = D(({ onCTAClick: t }) => {
|
|
1080
|
+
const { visibleAccounts: n } = P(), { onEvent: d } = Ie(), { goals: s } = T(), { isInitialized: _, setSelectedAccounts: a, isCopyLoaded: u } = Ge(), { ongoingGoalsForMicroWidget: b, loadGoals: l, goalsLoaded: h } = E();
|
|
1082
1081
|
y.useEffect(() => {
|
|
1083
1082
|
a(n);
|
|
1084
1083
|
}, []), y.useEffect(() => {
|
|
1085
|
-
_ && (
|
|
1084
|
+
_ && (l().finally(), d(Y.GOALS_LOAD_WIDGET, {
|
|
1086
1085
|
state: n?.length ? "default" : "zeroState"
|
|
1087
1086
|
}));
|
|
1088
1087
|
}, [_]);
|
|
1089
1088
|
const o = y.useMemo(
|
|
1090
|
-
() =>
|
|
1091
|
-
[
|
|
1092
|
-
),
|
|
1093
|
-
|
|
1089
|
+
() => h && b.length === 0,
|
|
1090
|
+
[b, h]
|
|
1091
|
+
), p = () => {
|
|
1092
|
+
d(
|
|
1094
1093
|
o ? Y.GOALS_CLICK_GET_STARTED : Y.GOALS_CLICK_VIEW_DETAILS
|
|
1095
1094
|
), t();
|
|
1096
1095
|
};
|
|
1097
|
-
return !
|
|
1098
|
-
|
|
1096
|
+
return !h || !u || !_ ? /* @__PURE__ */ e(we, {}) : /* @__PURE__ */ e(
|
|
1097
|
+
yt,
|
|
1099
1098
|
{
|
|
1100
1099
|
className: "mx-goals-microwidget",
|
|
1101
|
-
ctaLabel: o ?
|
|
1102
|
-
onCTAClick:
|
|
1103
|
-
title:
|
|
1100
|
+
ctaLabel: o ? s.get_started : s.view_details,
|
|
1101
|
+
onCTAClick: p,
|
|
1102
|
+
title: s.title,
|
|
1104
1103
|
children: o ? /* @__PURE__ */ e(
|
|
1105
|
-
|
|
1104
|
+
Ot,
|
|
1106
1105
|
{
|
|
1107
|
-
header:
|
|
1108
|
-
subText:
|
|
1106
|
+
header: s.create_goals_header,
|
|
1107
|
+
subText: s.micro_zero_state_description
|
|
1109
1108
|
}
|
|
1110
|
-
) : /* @__PURE__ */ e(
|
|
1111
|
-
/* @__PURE__ */ e(
|
|
1112
|
-
|
|
1109
|
+
) : /* @__PURE__ */ e(ht, { sx: { justifyContent: "space-between" }, children: b.map((r, c) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
1110
|
+
/* @__PURE__ */ e(Bt, { goal: r }),
|
|
1111
|
+
c !== b.length - 1 && /* @__PURE__ */ e(R, {})
|
|
1113
1112
|
] }, r.guid)) })
|
|
1114
1113
|
}
|
|
1115
1114
|
);
|
|
1116
1115
|
});
|
|
1117
1116
|
export {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1117
|
+
Hn as GoalApi,
|
|
1118
|
+
Xn as GoalStore,
|
|
1119
|
+
jn as GoalsMicroWidget,
|
|
1120
|
+
Pn as GoalsWidget
|
|
1122
1121
|
};
|