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