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