@mx-cartographer/experiences 9.0.2 → 9.1.0-alpha.bb1
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/Analytics-BKzTPees.mjs +61 -0
- package/dist/GlobalCopyApi-BeXzaDH9.mjs +487 -0
- package/dist/HeaderCell-EhCUSjvj.mjs +10 -0
- package/dist/Loader-BlVzRtUd.mjs +73 -0
- package/dist/MiniWidgetContainer-COwnjfy7.mjs +110 -0
- package/dist/OriginalBalanceAction-sbiqaxok.mjs +110 -0
- package/dist/SpendingLegend-D15ixlQ1.mjs +222 -0
- package/dist/accounts/index.es.js +12 -1598
- package/dist/accounts-DkyAiLpg.mjs +15632 -0
- package/dist/analytics/index.es.js +155 -139
- package/dist/budgets/index.es.js +1317 -1266
- package/dist/cashflow/index.es.js +1047 -942
- package/dist/categories/index.es.js +4 -4
- package/dist/common/index.es.js +101 -310
- package/dist/core/index.es.js +80 -104
- package/dist/core-BexP5oiV.mjs +4047 -0
- package/dist/dashboard/index.es.js +185 -141
- package/dist/debts/index.es.js +1384 -1272
- package/dist/finstrong/index.es.js +3366 -3471
- package/dist/goals/index.es.js +1103 -984
- package/dist/help/index.es.js +3 -25
- package/dist/help-CctDYrAH.mjs +2308 -0
- package/dist/insights/index.es.js +93 -4843
- package/dist/investments/index.es.js +1533 -1522
- package/dist/merchants/index.es.js +75 -64
- package/dist/microinsights/index.es.js +15 -824
- package/dist/microinsights-CRf3ChsJ.mjs +1814 -0
- package/dist/networth/index.es.js +550 -503
- package/dist/notifications/index.es.js +169 -161
- package/dist/recurringtransactions/index.es.js +10 -962
- package/dist/recurringtransactions-gbJ_NA8u.mjs +1564 -0
- package/dist/settings/index.es.js +13 -880
- package/dist/settings-ZMHe439l.mjs +1526 -0
- package/dist/spending/index.es.js +400 -456
- package/dist/transactions/index.es.js +10 -603
- package/dist/trends/index.es.js +1268 -1407
- package/package.json +28 -28
- package/dist/Account-BaJmiJAG.mjs +0 -118
- package/dist/Account-BxHMlV9R.mjs +0 -30
- package/dist/AccountDetailsHeader-DIysk_4w.mjs +0 -95
- package/dist/AccountDisplayName-CO7z3v99.mjs +0 -11
- package/dist/AccountFields-mwJ8NXsX.mjs +0 -141
- package/dist/AccountListItem-BDXHs4tV.mjs +0 -94
- package/dist/AccountUtils-T5_Odvos.mjs +0 -27
- package/dist/Accounts-CseLC3lL.mjs +0 -5
- package/dist/Analytics-CkYXKvco.mjs +0 -53
- package/dist/Analytics-CzGzz_sE.mjs +0 -136
- package/dist/ApiEndpoints-DXwIYNUV.mjs +0 -49
- package/dist/BudgetUtil-Bg2AQJpQ.mjs +0 -74
- package/dist/Category-DEKZGLYe.mjs +0 -301
- package/dist/CategorySelectorDrawer-8soGrhB8.mjs +0 -430
- package/dist/Connect-Dk6GZEsA.mjs +0 -39
- package/dist/ConnectCard-CCep7Zqe.mjs +0 -54
- package/dist/ConnectDrawer-Cnjr3Ddg.mjs +0 -58
- package/dist/ConnectionsDrawer-CtfPXk0M.mjs +0 -54
- package/dist/CurrencyDialog-DumQCTPO.mjs +0 -373
- package/dist/CurrencyInput-adTIRtL3.mjs +0 -87
- package/dist/CurrencyText-CCbE6MmF.mjs +0 -20
- package/dist/DateFormats-HudZ3Bjs.mjs +0 -64
- package/dist/DateUtil-Bhq59ZVg.mjs +0 -58
- package/dist/DebtUtils-DD3186U-.mjs +0 -153
- package/dist/Dialog-Bvd2n8hz.mjs +0 -66
- package/dist/Donut-SzzfZDHF.mjs +0 -88
- package/dist/Drawer-BXqqBMxg.mjs +0 -174
- package/dist/EmbeddedCard-DPwJjqMH.mjs +0 -856
- package/dist/EmptyState-CJUDc3kD.mjs +0 -84
- package/dist/Error-Dogaw2jO.mjs +0 -84
- package/dist/ErrorBoundary-CsdOcnJ9.mjs +0 -23
- package/dist/ExportCsvAction-Bw02ZJEj.mjs +0 -24
- package/dist/GlobalAccountFilter-7Cg2-9A5.mjs +0 -237
- package/dist/GlobalCopyApi-wcnDUzMV.mjs +0 -128
- package/dist/GoalsUtil-C9EnLWvC.mjs +0 -107
- package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
- package/dist/Help-CkQTjORd.mjs +0 -299
- package/dist/Help-DJ8PrVHX.mjs +0 -3209
- package/dist/IconBacking-DgT8DCeh.mjs +0 -39
- package/dist/InformationTooltip-4su8bn1e.mjs +0 -41
- package/dist/InvestmentUtil-BItV7uEs.mjs +0 -134
- package/dist/LineChart-CejWS_rh.mjs +0 -612
- package/dist/ListItemAction-CzZ8s39Z.mjs +0 -69
- package/dist/ListItemRow-kH1rn8Xu.mjs +0 -67
- package/dist/ListItemWrapper-B5r-YQQ_.mjs +0 -42
- package/dist/Loader-CxeBwuPG.mjs +0 -21
- package/dist/Localization-DnoVyBNK.mjs +0 -38
- package/dist/ManageIncome-D1yBODQi.mjs +0 -595
- package/dist/MicroWidgetContainer-CfKdQfhi.mjs +0 -45
- package/dist/MiniWidgetContainer-BdPiUU-u.mjs +0 -66
- package/dist/NetWorthUtils-DilGN1nW.mjs +0 -95
- package/dist/Notification-DTNYSd8P.mjs +0 -7
- package/dist/NotificationSettings-B4JA5IKE.mjs +0 -677
- package/dist/NotificationUtils-BRGFTePr.mjs +0 -23
- package/dist/NumberFormatting--XMeeBfr.mjs +0 -49
- package/dist/OriginalBalanceAction-BybTXDtO.mjs +0 -114
- package/dist/RecurringSettings-D2xbNb67.mjs +0 -88
- package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +0 -253
- package/dist/ResponsiveButton-CC9F_Ezk.mjs +0 -45
- package/dist/SearchBox-Cpgu_gdO.mjs +0 -50
- package/dist/Select-BFt-HD-L.mjs +0 -55
- package/dist/SelectionBox-B4xELRgp.mjs +0 -48
- package/dist/SingleSegmentDonut-7Uy6VEld.mjs +0 -69
- package/dist/Sizes-DISGrlUg.mjs +0 -6
- package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
- package/dist/SpendingData-PKlh8caU.mjs +0 -53
- package/dist/SpendingLegend-5Ct_FZ8o.mjs +0 -193
- package/dist/StatusBar-CPfSXe80.mjs +0 -30
- package/dist/TabContentContainer-CnMXkVqr.mjs +0 -21
- package/dist/ToggleListItem-Dl1lXNwj.mjs +0 -91
- package/dist/TransactionDetails-DctXr07p.mjs +0 -1714
- package/dist/TransactionUtils-BphBJBbU.mjs +0 -234
- package/dist/TrendsUtil-D9z3kIj_.mjs +0 -69
- package/dist/UserStore-CRpKQjpP.mjs +0 -3002
- package/dist/ViewMoreMicroCard-BD_MNc2z.mjs +0 -1295
- package/dist/WidgetContainer-CmbU4CBH.mjs +0 -482
- package/dist/hooks-BaO_gOI6.mjs +0 -77
- package/dist/useAccountDisplayName-CFa_MrS6.mjs +0 -15
- package/dist/useAriaLive-MkYebyUR.mjs +0 -35
- package/dist/useDimensions-CeDR9V8N.mjs +0 -36
- package/dist/useInsightsEnabled-DaNLPmUU.mjs +0 -11
- package/dist/useScreenSize-mWpmnh5w.mjs +0 -36
- package/dist/useWidgetLoadTimer-CJb-RELP.mjs +0 -19
package/dist/goals/index.es.js
CHANGED
|
@@ -1,1090 +1,1209 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as B } from "../GlobalCopyApi-BeXzaDH9.mjs";
|
|
2
|
+
import { A as me, Dt as r, Et as U, J as S, M as Pe, Pt as ye, Tt as le, j as je, ln as ue, un as _e } from "../core-BexP5oiV.mjs";
|
|
3
|
+
import { An as Fe, Bn as Te, Gn as $e, Mn as Ce, Xn as He, _r as ve, gr as Ue, kn as Z, lr as q, mr as pe, qn as Ye, sr as $, ur as Ze, yr as qe } from "../accounts-DkyAiLpg.mjs";
|
|
4
|
+
import { n as Re } from "../Analytics-BKzTPees.mjs";
|
|
5
|
+
import { O as xe, d as Ee, g as N, h as he, i as be, n as j, p as R, t as Se } from "../Loader-BlVzRtUd.mjs";
|
|
6
|
+
import { n as Je, r as Xe, t as Qe } from "../OriginalBalanceAction-sbiqaxok.mjs";
|
|
2
7
|
import T from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
8
|
+
import { observer as K } from "mobx-react-lite";
|
|
9
|
+
import g from "@mui/material/Stack";
|
|
10
|
+
import { H2 as Ie, H3 as de, Icon as et, InstitutionLogo as Q, P as Y, Text as C } from "@mxenabled/mxui";
|
|
11
|
+
import ge from "@mui/material/Button";
|
|
12
|
+
import { AddBox as Ge, ArrowUpwardAlt as tt, CheckCircle as nt, ChevronRight as z, ExpandLess as at, ExpandMore as it, Icon as fe, NoteStack as Ne, Payments as ke, Person as we, Trophy as ot } from "@mxenabled/mx-icons";
|
|
13
|
+
import { Fragment as F, jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
14
|
+
import { useTheme as rt } from "@mui/material/styles";
|
|
15
|
+
import st from "@mui/material/Box";
|
|
7
16
|
import re from "@mui/material/Tab";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import { Text as C, H3 as le, P as Y, Icon as $e, InstitutionLogo as X, H2 as Te } from "@mxenabled/mxui";
|
|
12
|
-
import me from "@mui/material/Button";
|
|
13
|
-
import Ce from "@mui/material/Card";
|
|
14
|
-
import Re from "@mui/material/CardActionArea";
|
|
15
|
-
import xe from "@mui/material/CardContent";
|
|
16
|
-
import ge from "@mui/material/Grid";
|
|
17
|
-
import te from "@mui/material/Avatar";
|
|
18
|
-
import He from "@mui/material/CardHeader";
|
|
19
|
-
import { Payments as Ee, NoteStack as Se, Person as ve, ArrowUpwardAlt as Ue, CheckCircle as Ye, ChevronRight as z, Icon as ye, ExpandLess as Ze, ExpandMore as qe, AddBox as Ie, Trophy as Je } from "@mxenabled/mx-icons";
|
|
20
|
-
import { g as ue, T as r, G as de, a as Qe, M as U, b as Xe } from "../GoalsUtil-C9EnLWvC.mjs";
|
|
21
|
-
import { u as x, k as N, b as _e, a as pe, d as j, C as Ge, g as Ne } from "../hooks-BaO_gOI6.mjs";
|
|
22
|
-
import { u as he } from "../useScreenSize-mWpmnh5w.mjs";
|
|
23
|
-
import { S as et } from "../StatusBar-CPfSXe80.mjs";
|
|
24
|
-
import v from "@mui/material/Divider";
|
|
25
|
-
import O from "@mui/material/List";
|
|
26
|
-
import { L as Z } from "../ListItemAction-CzZ8s39Z.mjs";
|
|
27
|
-
import { C as ke } from "../CurrencyInput-adTIRtL3.mjs";
|
|
17
|
+
import ct from "@mui/material/Tabs";
|
|
18
|
+
import lt from "@mui/material/IconButton";
|
|
19
|
+
import { getUnixTime as dt } from "date-fns/getUnixTime";
|
|
28
20
|
import { fromUnixTime as ee } from "date-fns/fromUnixTime";
|
|
29
|
-
import
|
|
21
|
+
import Ke from "@mui/material/Card";
|
|
22
|
+
import De from "@mui/material/CardContent";
|
|
23
|
+
import mt from "@mui/material/CardHeader";
|
|
24
|
+
import E from "@mui/material/Divider";
|
|
25
|
+
import ut from "@mui/material/Checkbox";
|
|
26
|
+
import O from "@mui/material/List";
|
|
30
27
|
import k from "@mui/material/ListItem";
|
|
31
|
-
import P from "@mui/material/ListItemAvatar";
|
|
32
28
|
import L from "@mui/material/ListItemButton";
|
|
29
|
+
import _t from "@mui/material/ListItemIcon";
|
|
33
30
|
import w from "@mui/material/ListItemText";
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import {
|
|
46
|
-
import { isValid as dt } from "date-fns/isValid";
|
|
47
|
-
import { AdapterDateFns as mt } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
48
|
-
import { DatePicker as ut } from "@mui/x-date-pickers";
|
|
49
|
-
import { LocalizationProvider as _t } from "@mui/x-date-pickers/LocalizationProvider";
|
|
50
|
-
import { D as pt } from "../Dialog-Bvd2n8hz.mjs";
|
|
51
|
-
import { u as Me } from "../useWidgetLoadTimer-CJb-RELP.mjs";
|
|
52
|
-
import { A as $ } from "../Analytics-CzGzz_sE.mjs";
|
|
53
|
-
import { L as Le } from "../Loader-CxeBwuPG.mjs";
|
|
54
|
-
import { W as ht } from "../WidgetContainer-CmbU4CBH.mjs";
|
|
55
|
-
import { E as bt } from "../EmptyState-CJUDc3kD.mjs";
|
|
56
|
-
import ft from "@mui/material/Box";
|
|
57
|
-
import { useTheme as gt } from "@mui/material/styles";
|
|
58
|
-
import { S as yt } from "../SingleSegmentDonut-7Uy6VEld.mjs";
|
|
59
|
-
import { M as At } from "../MicroWidgetContainer-CfKdQfhi.mjs";
|
|
31
|
+
import Me from "@mui/material/TextField";
|
|
32
|
+
import te from "@mui/material/Avatar";
|
|
33
|
+
import P from "@mui/material/ListItemAvatar";
|
|
34
|
+
import { AdapterDateFns as pt } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
35
|
+
import ht from "@mui/material/Alert";
|
|
36
|
+
import bt from "@mui/material/Snackbar";
|
|
37
|
+
import gt from "@mui/material/Collapse";
|
|
38
|
+
import Ae from "@mui/material/Grid";
|
|
39
|
+
import { DatePicker as yt } from "@mui/x-date-pickers";
|
|
40
|
+
import { LocalizationProvider as ft } from "@mui/x-date-pickers/LocalizationProvider";
|
|
41
|
+
import Le from "@mui/material/CardActionArea";
|
|
42
|
+
import { isValid as At } from "date-fns/isValid";
|
|
60
43
|
function se({ title: t, subtitle: n }) {
|
|
61
|
-
return /* @__PURE__ */ c(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(C, {
|
|
45
|
+
bold: !0,
|
|
46
|
+
variant: "body1",
|
|
47
|
+
children: t
|
|
48
|
+
}), /* @__PURE__ */ e(C, {
|
|
49
|
+
sx: { fontWeight: 400 },
|
|
50
|
+
variant: "body1",
|
|
51
|
+
children: n
|
|
52
|
+
})] });
|
|
65
53
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
54
|
+
var Tt = (t, n) => n ? S(t, t < 1e3 ? "0" : "0.00a").replace(/(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g, "$1$2$3") : S(t, "0,0.00"), Oe = K(({ goal: t, isInDrawer: n = !1, onClick: u }) => {
|
|
55
|
+
const { goals: d } = R(), { isMobile: _, isTablet: o } = pe(), m = _ || o, { backgroundColor: p, color: s, percentage: h, percentageText: i, projectedText: a } = me(d, t), b = t.track_type === r.DEBT_TRACK ? t.initial_amount : t.amount, l = [{
|
|
56
|
+
color: p,
|
|
57
|
+
percentage: `${h}`
|
|
58
|
+
}];
|
|
59
|
+
let f = /* @__PURE__ */ e(ke, {});
|
|
60
|
+
return t.track_type === r.DEBT_TRACK ? f = /* @__PURE__ */ e(Ne, {}) : t.track_type === r.RETIREMENT_TRACK && (f = /* @__PURE__ */ e(we, {})), /* @__PURE__ */ e(Ke, {
|
|
61
|
+
elevation: 2,
|
|
62
|
+
sx: { "&:focus-within": {
|
|
63
|
+
outline: "2px solid",
|
|
64
|
+
outlineColor: "primary.main"
|
|
65
|
+
} },
|
|
66
|
+
children: /* @__PURE__ */ c(Le, {
|
|
67
|
+
disabled: !u,
|
|
68
|
+
onClick: u,
|
|
69
|
+
children: [/* @__PURE__ */ e(mt, {
|
|
70
|
+
avatar: /* @__PURE__ */ e(te, {
|
|
71
|
+
sx: {
|
|
72
|
+
bgcolor: p,
|
|
73
|
+
color: s,
|
|
74
|
+
height: 48,
|
|
75
|
+
width: 48
|
|
76
|
+
},
|
|
77
|
+
variant: "rounded",
|
|
78
|
+
children: f
|
|
79
|
+
}),
|
|
80
|
+
subheader: /* @__PURE__ */ e(C, {
|
|
81
|
+
sx: {
|
|
82
|
+
fontWeight: 700,
|
|
83
|
+
fontSize: n || m ? "18px" : "23px",
|
|
84
|
+
lineHeight: n || m ? "24px" : "32px"
|
|
85
|
+
},
|
|
86
|
+
children: `${S(t.current_amount, m ? "0,0" : "0,0.00")} / ${Tt(b, m)}`
|
|
87
|
+
}),
|
|
88
88
|
sx: {
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
outlineColor: "primary.main"
|
|
92
|
-
}
|
|
89
|
+
alignItems: "flex-start",
|
|
90
|
+
"& .MuiCardHeader-content": { minWidth: 0 }
|
|
93
91
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children: o })
|
|
134
|
-
] })
|
|
135
|
-
] }) })
|
|
136
|
-
] })
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
), Ct = D(({ trackType: t }) => {
|
|
141
|
-
const { goals: n } = x(), { setAlert: u, monthlyCashFlowProfile: d, updateMonthlyCashFlowProfile: _ } = N(), i = T.useMemo(() => {
|
|
142
|
-
let a = 0;
|
|
143
|
-
return t === r.SAVINGS_TRACK ? a = d?.amount_allocated_for_savings_goals || 0 : t === r.DEBT_TRACK ? a = d?.amount_allocated_for_debt_goals || 0 : t === r.RETIREMENT_TRACK && (a = d?.amount_allocated_for_retirement_goals || 0), a;
|
|
92
|
+
title: /* @__PURE__ */ e(C, {
|
|
93
|
+
color: "text.secondary",
|
|
94
|
+
fontWeight: 400,
|
|
95
|
+
sx: {
|
|
96
|
+
fontSize: "15px",
|
|
97
|
+
lineHeight: "20px"
|
|
98
|
+
},
|
|
99
|
+
variant: "h4",
|
|
100
|
+
children: t.name
|
|
101
|
+
})
|
|
102
|
+
}), /* @__PURE__ */ e(De, {
|
|
103
|
+
sx: { pt: 0 },
|
|
104
|
+
children: /* @__PURE__ */ c(g, {
|
|
105
|
+
gap: 6,
|
|
106
|
+
children: [/* @__PURE__ */ e(qe, {
|
|
107
|
+
data: l,
|
|
108
|
+
height: 24
|
|
109
|
+
}), /* @__PURE__ */ c(g, {
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
direction: "row",
|
|
112
|
+
justifyContent: "space-between",
|
|
113
|
+
children: [/* @__PURE__ */ e(C, {
|
|
114
|
+
color: "text.secondary",
|
|
115
|
+
variant: "caption",
|
|
116
|
+
children: i
|
|
117
|
+
}), t.projected_to_complete_at && /* @__PURE__ */ e(C, {
|
|
118
|
+
color: "text.secondary",
|
|
119
|
+
variant: "caption",
|
|
120
|
+
children: a
|
|
121
|
+
})]
|
|
122
|
+
})]
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}), Ct = K(({ trackType: t }) => {
|
|
128
|
+
const { goals: n } = R(), { setAlert: u, monthlyCashFlowProfile: d, updateMonthlyCashFlowProfile: _ } = N(), o = T.useMemo(() => {
|
|
129
|
+
let i = 0;
|
|
130
|
+
return t === r.SAVINGS_TRACK ? i = d?.amount_allocated_for_savings_goals || 0 : t === r.DEBT_TRACK ? i = d?.amount_allocated_for_debt_goals || 0 : t === r.RETIREMENT_TRACK && (i = d?.amount_allocated_for_retirement_goals || 0), i;
|
|
144
131
|
}, [d]);
|
|
145
132
|
T.useEffect(() => {
|
|
146
|
-
p(
|
|
147
|
-
}, [
|
|
148
|
-
const [m, p] = T.useState(
|
|
133
|
+
p(o);
|
|
134
|
+
}, [o]);
|
|
135
|
+
const [m, p] = T.useState(o), s = m < 0 || m > 99999999, h = async () => {
|
|
149
136
|
if (d) {
|
|
150
|
-
const
|
|
151
|
-
t === r.SAVINGS_TRACK ?
|
|
137
|
+
const i = { ...d };
|
|
138
|
+
t === r.SAVINGS_TRACK ? i.amount_allocated_for_savings_goals = m : t === r.DEBT_TRACK ? i.amount_allocated_for_debt_goals = m : t === r.RETIREMENT_TRACK && (i.amount_allocated_for_retirement_goals = m), await _(i), u(n.alert_contribution_updated);
|
|
152
139
|
}
|
|
153
140
|
};
|
|
154
|
-
return /* @__PURE__ */ e(
|
|
155
|
-
|
|
156
|
-
{
|
|
141
|
+
return /* @__PURE__ */ e(g, {
|
|
142
|
+
bgcolor: "background.paper",
|
|
143
|
+
children: /* @__PURE__ */ e(Z, {
|
|
157
144
|
isSaveDisabled: !m || isNaN(m),
|
|
158
145
|
label: n.contribution_label,
|
|
159
|
-
onCancel: () => p(
|
|
146
|
+
onCancel: () => p(o),
|
|
160
147
|
onSave: h,
|
|
161
148
|
primaryText: n.contribution_label,
|
|
162
|
-
secondaryText:
|
|
163
|
-
children: /* @__PURE__ */ e(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
149
|
+
secondaryText: S(o, "0,0.00"),
|
|
150
|
+
children: /* @__PURE__ */ e(Te, {
|
|
151
|
+
amount: m,
|
|
152
|
+
autoFocus: !0,
|
|
153
|
+
error: s,
|
|
154
|
+
fullWidth: !0,
|
|
155
|
+
minAmount: 0,
|
|
156
|
+
setAmount: (i) => p(isNaN(Number(i)) ? m : Number(i)),
|
|
157
|
+
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
}), vt = ({ goal: t, index: n, onUpClick: u }) => {
|
|
162
|
+
const { goals: d } = R(), { percentage: _ } = me(d, t), o = t.goal_type === le.KEEP_BALANCE_BELOW || t.has_been_spent ? d.goal_completed : B(d.goal_percentage_reached, `${_ * 100}`);
|
|
163
|
+
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
|
|
164
|
+
disableRipple: !0,
|
|
165
|
+
sx: {
|
|
166
|
+
":hover": { backgroundColor: "unset" },
|
|
167
|
+
cursor: "default"
|
|
168
|
+
},
|
|
169
|
+
children: [t.track_type !== r.RETIREMENT_TRACK && /* @__PURE__ */ e(P, {
|
|
170
|
+
sx: {
|
|
171
|
+
alignItems: "center",
|
|
172
|
+
display: "flex",
|
|
173
|
+
justifyContent: "center",
|
|
174
|
+
".MuiAvatar-root": {
|
|
175
|
+
height: "16px",
|
|
176
|
+
width: "16px"
|
|
173
177
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
178
|
+
},
|
|
179
|
+
children: t.track_type === r.SAVINGS_TRACK ? /* @__PURE__ */ e(lt, {
|
|
180
|
+
onClick: () => u?.(t),
|
|
181
|
+
children: /* @__PURE__ */ e(tt, {
|
|
182
|
+
color: "primary",
|
|
183
|
+
size: 24
|
|
184
|
+
})
|
|
185
|
+
}) : /* @__PURE__ */ e(te, {
|
|
186
|
+
sx: {
|
|
187
|
+
bgcolor: "text.primary",
|
|
188
|
+
height: "16px",
|
|
189
|
+
width: "16px"
|
|
190
|
+
},
|
|
191
|
+
children: /* @__PURE__ */ e(C, {
|
|
192
|
+
bold: !0,
|
|
193
|
+
variant: "caption",
|
|
194
|
+
children: n + 1
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
}), /* @__PURE__ */ e(w, {
|
|
198
|
+
slotProps: { primary: { variant: "body1" } },
|
|
199
|
+
children: /* @__PURE__ */ c(g, {
|
|
200
|
+
alignItems: "center",
|
|
201
|
+
direction: "row",
|
|
202
|
+
justifyContent: "space-between",
|
|
203
|
+
children: [/* @__PURE__ */ c(g, {
|
|
204
|
+
sx: { maxWidth: "70%" },
|
|
205
|
+
children: [/* @__PURE__ */ e(C, {
|
|
206
|
+
bold: !0,
|
|
207
|
+
variant: "body1",
|
|
208
|
+
children: t.name
|
|
209
|
+
}), /* @__PURE__ */ e(C, {
|
|
210
|
+
variant: "caption",
|
|
211
|
+
children: t.is_complete ? o : B(d.goal_projection, _e(ee(t.projected_to_complete_at || 0), ue.MONTH_SHORT_YEAR))
|
|
212
|
+
})]
|
|
213
|
+
}), /* @__PURE__ */ e(C, {
|
|
214
|
+
bold: !0,
|
|
215
|
+
variant: "body1",
|
|
216
|
+
children: S(t.amount, "0,0.00")
|
|
217
|
+
})]
|
|
218
|
+
})
|
|
219
|
+
})]
|
|
220
|
+
}) });
|
|
221
|
+
}, Rt = ({ goal: t }) => {
|
|
222
|
+
const { goals: n } = R();
|
|
223
|
+
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
|
|
224
|
+
disableRipple: !0,
|
|
225
|
+
sx: {
|
|
226
|
+
":hover": { backgroundColor: "unset" },
|
|
227
|
+
cursor: "default"
|
|
228
|
+
},
|
|
229
|
+
children: [/* @__PURE__ */ e(P, {
|
|
230
|
+
sx: {
|
|
231
|
+
alignItems: "center",
|
|
232
|
+
display: "flex",
|
|
233
|
+
justifyContent: "center"
|
|
234
|
+
},
|
|
235
|
+
children: /* @__PURE__ */ e(nt, {
|
|
236
|
+
color: "success",
|
|
237
|
+
filled: !0,
|
|
238
|
+
size: 20
|
|
239
|
+
})
|
|
240
|
+
}), /* @__PURE__ */ e(w, {
|
|
241
|
+
slotProps: { primary: { variant: "body1" } },
|
|
242
|
+
children: /* @__PURE__ */ c(g, {
|
|
243
|
+
alignItems: "center",
|
|
244
|
+
direction: "row",
|
|
245
|
+
justifyContent: "space-between",
|
|
246
|
+
children: [/* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(C, {
|
|
247
|
+
bold: !0,
|
|
248
|
+
variant: "body1",
|
|
249
|
+
children: t.name
|
|
250
|
+
}), /* @__PURE__ */ e(C, {
|
|
251
|
+
variant: "caption",
|
|
252
|
+
children: B(n.completed_label, _e(ee(t.completed_at || 0), ue.MONTH_SHORT_YEAR))
|
|
253
|
+
})] }), /* @__PURE__ */ e(C, {
|
|
254
|
+
bold: !0,
|
|
255
|
+
variant: "body1",
|
|
256
|
+
children: S(t.amount, "0,0.00")
|
|
257
|
+
})]
|
|
258
|
+
})
|
|
259
|
+
})]
|
|
260
|
+
}) }, t.guid);
|
|
261
|
+
}, xt = ({ trackType: t }) => {
|
|
262
|
+
const { goals: n, common: u } = R(), { loadGoals: d, orderedGoals: _, reorderGoals: o } = N(), m = _.filter((y) => y.track_type === t), p = m.filter((y) => y.track_type === r.SAVINGS_TRACK && !y.has_been_spent || y.track_type !== r.SAVINGS_TRACK && !y.is_complete), s = m.filter((y) => y.track_type === r.SAVINGS_TRACK && y.has_been_spent || y.track_type !== r.SAVINGS_TRACK && y.is_complete), [h, i] = T.useState(!1);
|
|
263
|
+
let a = n.manage_saving_goals, b = n.manage_saving_drawer_title, l = n.manage_saving_title, f = n.manage_saving_description;
|
|
264
|
+
t === r.DEBT_TRACK ? (a = n.manage_debt_goals, b = n.manage_debt_drawer_title, l = n.manage_debt_title, f = n.manage_debt_description) : t === r.RETIREMENT_TRACK && (a = n.manage_retirement_goals, b = n.manage_retirement_drawer_title, l = n.manage_retirement_title, f = n.manage_retirement_description);
|
|
265
|
+
const x = async (y) => {
|
|
266
|
+
const A = [...p], v = A.findIndex((D) => D.guid === y.guid);
|
|
267
|
+
let G = v - 1;
|
|
268
|
+
G < 0 && (G = A.length - 1), A.splice(G, 0, A.splice(v, 1)[0]);
|
|
269
|
+
for (let D = 0; D < A.length; D++) A[D].position = D + 1;
|
|
270
|
+
await o(A), await d();
|
|
253
271
|
};
|
|
254
|
-
return /* @__PURE__ */ c(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
272
|
+
return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(ge, {
|
|
273
|
+
endIcon: /* @__PURE__ */ e(z, {}),
|
|
274
|
+
onClick: () => i(!0),
|
|
275
|
+
children: a
|
|
276
|
+
}), /* @__PURE__ */ e(q, {
|
|
277
|
+
ariaLabelClose: u.close_aria,
|
|
278
|
+
isOpen: h,
|
|
279
|
+
onClose: () => i(!1),
|
|
280
|
+
title: b,
|
|
281
|
+
children: /* @__PURE__ */ c(g, { children: [
|
|
282
|
+
/* @__PURE__ */ c(g, {
|
|
283
|
+
m: 24,
|
|
284
|
+
children: [/* @__PURE__ */ e(de, { children: l }), /* @__PURE__ */ e(Y, {
|
|
285
|
+
color: "text.secondary",
|
|
286
|
+
variant: "subtitle2",
|
|
287
|
+
children: f
|
|
288
|
+
})]
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ e(Ct, { trackType: t }),
|
|
291
|
+
/* @__PURE__ */ e(C, {
|
|
292
|
+
bold: !0,
|
|
293
|
+
sx: {
|
|
294
|
+
mb: 4,
|
|
295
|
+
mx: 24,
|
|
296
|
+
mt: 12
|
|
297
|
+
},
|
|
298
|
+
variant: "caption",
|
|
299
|
+
children: n.goal_priority
|
|
300
|
+
}),
|
|
301
|
+
/* @__PURE__ */ e(O, {
|
|
302
|
+
sx: { bgcolor: "background.paper" },
|
|
303
|
+
children: p.map((y, A) => {
|
|
304
|
+
const v = A >= p.length - 1;
|
|
305
|
+
return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(vt, {
|
|
306
|
+
goal: y,
|
|
307
|
+
index: A,
|
|
308
|
+
onUpClick: x
|
|
309
|
+
}), /* @__PURE__ */ e(E, { variant: v ? "fullWidth" : "inset" })] }, `ongoing-${y.guid}`);
|
|
310
|
+
})
|
|
311
|
+
}),
|
|
312
|
+
t !== r.RETIREMENT_TRACK && s.length > 0 && /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(C, {
|
|
313
|
+
bold: !0,
|
|
314
|
+
sx: {
|
|
315
|
+
mb: 4,
|
|
316
|
+
mx: 24,
|
|
317
|
+
mt: 12
|
|
318
|
+
},
|
|
319
|
+
variant: "caption",
|
|
320
|
+
children: n.complete_title
|
|
321
|
+
}), /* @__PURE__ */ e(O, {
|
|
322
|
+
sx: { bgcolor: "background.paper" },
|
|
323
|
+
children: s.map((y, A) => {
|
|
324
|
+
const v = A > p.length - 1;
|
|
325
|
+
return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(Rt, { goal: y }), /* @__PURE__ */ e(E, { variant: v ? "fullWidth" : "inset" })] }, `complete-${y.guid}`);
|
|
326
|
+
})
|
|
327
|
+
})] })
|
|
328
|
+
] })
|
|
329
|
+
})] });
|
|
330
|
+
}, ce = K(({ trackType: t, onAddGoals: n }) => {
|
|
331
|
+
const { isMobile: u } = pe(), { goals: d } = R(), { selectedAccountGuids: _ } = he(), { orderedGoals: o, setSelectedGoal: m } = N(), p = o.filter((a) => a.track_type === t && (a.track_type !== r.RETIREMENT_TRACK && _.includes(a.account_guid) || a.track_type === r.RETIREMENT_TRACK)), s = p.filter((a) => a.track_type === r.SAVINGS_TRACK && !a.has_been_spent || a.track_type !== r.SAVINGS_TRACK && !a.is_complete), h = p.filter((a) => a.track_type === r.SAVINGS_TRACK && a.has_been_spent || a.track_type !== r.SAVINGS_TRACK && a.is_complete), i = t === r.DEBT_TRACK ? d.zero_state_complete_debt : d.zero_state_complete_savings;
|
|
332
|
+
return /* @__PURE__ */ c(g, {
|
|
333
|
+
mt: 16,
|
|
334
|
+
mx: u ? 24 : 0,
|
|
335
|
+
children: [
|
|
336
|
+
/* @__PURE__ */ c(g, {
|
|
337
|
+
alignItems: "center",
|
|
338
|
+
direction: "row",
|
|
339
|
+
justifyContent: "space-between",
|
|
340
|
+
mb: 8,
|
|
341
|
+
children: [/* @__PURE__ */ e(de, {
|
|
342
|
+
color: "text.secondary",
|
|
343
|
+
variant: "body2",
|
|
344
|
+
children: d.ongoing_title
|
|
345
|
+
}), /* @__PURE__ */ e(xt, { trackType: t })]
|
|
346
|
+
}),
|
|
347
|
+
s.length > 0 ? /* @__PURE__ */ e(Ae, {
|
|
348
|
+
container: !0,
|
|
349
|
+
spacing: 24,
|
|
350
|
+
children: s.map((a, b, l) => /* @__PURE__ */ e(Ae, {
|
|
351
|
+
size: u || b === 0 && l.length !== 2 ? 12 : 6,
|
|
352
|
+
children: /* @__PURE__ */ e(Oe, {
|
|
353
|
+
goal: a,
|
|
354
|
+
onClick: () => m(a)
|
|
355
|
+
}, a.guid)
|
|
356
|
+
}, b))
|
|
357
|
+
}) : /* @__PURE__ */ c(g, {
|
|
310
358
|
alignItems: "center",
|
|
311
359
|
bgcolor: "background.default",
|
|
312
360
|
borderRadius: 2,
|
|
313
361
|
height: 166,
|
|
314
362
|
justifyContent: "center",
|
|
315
363
|
py: 18,
|
|
364
|
+
children: [/* @__PURE__ */ e(Y, {
|
|
365
|
+
sx: (a) => ({
|
|
366
|
+
color: "text.secondary",
|
|
367
|
+
[a.breakpoints.down("sm")]: { px: 10 },
|
|
368
|
+
width: { sm: 381 }
|
|
369
|
+
}),
|
|
370
|
+
variant: "body2",
|
|
371
|
+
children: Pe(t, d)
|
|
372
|
+
}), /* @__PURE__ */ e(ge, {
|
|
373
|
+
onClick: n,
|
|
374
|
+
sx: {
|
|
375
|
+
mt: 16,
|
|
376
|
+
width: { sm: 224 }
|
|
377
|
+
},
|
|
378
|
+
variant: "contained",
|
|
379
|
+
children: d.add_goals_button
|
|
380
|
+
})]
|
|
381
|
+
}),
|
|
382
|
+
t !== r.RETIREMENT_TRACK && /* @__PURE__ */ c(g, {
|
|
383
|
+
gap: 16,
|
|
384
|
+
mt: 48,
|
|
316
385
|
children: [
|
|
317
|
-
/* @__PURE__ */ e(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
386
|
+
/* @__PURE__ */ e(de, {
|
|
387
|
+
color: "text.secondary",
|
|
388
|
+
variant: "body2",
|
|
389
|
+
children: d.complete_title
|
|
390
|
+
}),
|
|
391
|
+
h.length === 0 && /* @__PURE__ */ e(g, {
|
|
392
|
+
alignItems: "center",
|
|
393
|
+
bgcolor: "background.default",
|
|
394
|
+
borderRadius: 2,
|
|
395
|
+
py: 18,
|
|
396
|
+
children: /* @__PURE__ */ e(Y, {
|
|
397
|
+
sx: (a) => ({
|
|
321
398
|
color: "text.secondary",
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
},
|
|
325
|
-
width: { sm: 381 }
|
|
399
|
+
width: { sm: 393 },
|
|
400
|
+
[a.breakpoints.down("sm")]: { px: 10 }
|
|
326
401
|
}),
|
|
327
402
|
variant: "body2",
|
|
328
|
-
children:
|
|
329
|
-
}
|
|
330
|
-
),
|
|
331
|
-
/* @__PURE__ */ e(me, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: d.add_goals_button })
|
|
332
|
-
]
|
|
333
|
-
}
|
|
334
|
-
),
|
|
335
|
-
t !== r.RETIREMENT_TRACK && /* @__PURE__ */ c(f, { gap: 16, mt: 48, children: [
|
|
336
|
-
/* @__PURE__ */ e(le, { color: "text.secondary", variant: "body2", children: d.complete_title }),
|
|
337
|
-
h.length === 0 && /* @__PURE__ */ e(f, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
338
|
-
Y,
|
|
339
|
-
{
|
|
340
|
-
sx: (o) => ({
|
|
341
|
-
color: "text.secondary",
|
|
342
|
-
width: { sm: 393 },
|
|
343
|
-
[o.breakpoints.down("sm")]: {
|
|
344
|
-
px: 10
|
|
345
|
-
}
|
|
403
|
+
children: i
|
|
404
|
+
})
|
|
346
405
|
}),
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
406
|
+
h.map((a) => /* @__PURE__ */ e(Ke, {
|
|
407
|
+
elevation: 2,
|
|
408
|
+
children: /* @__PURE__ */ e(Le, {
|
|
409
|
+
onClick: () => m(a),
|
|
410
|
+
children: /* @__PURE__ */ e(De, {
|
|
411
|
+
sx: { ":last-child": { pb: 16 } },
|
|
412
|
+
children: /* @__PURE__ */ c(g, {
|
|
413
|
+
alignItems: "center",
|
|
414
|
+
direction: "row",
|
|
415
|
+
justifyContent: "space-between",
|
|
416
|
+
children: [/* @__PURE__ */ c(g, {
|
|
417
|
+
alignItems: "center",
|
|
418
|
+
direction: "row",
|
|
419
|
+
gap: 6,
|
|
420
|
+
children: [/* @__PURE__ */ e(et, {
|
|
421
|
+
color: "success",
|
|
422
|
+
fill: !0,
|
|
423
|
+
name: "check_circle",
|
|
424
|
+
size: 20
|
|
425
|
+
}), /* @__PURE__ */ e(C, {
|
|
426
|
+
color: "text.secondary",
|
|
427
|
+
variant: "body1",
|
|
428
|
+
children: a.name
|
|
429
|
+
})]
|
|
430
|
+
}), /* @__PURE__ */ e(C, {
|
|
431
|
+
bold: !0,
|
|
432
|
+
variant: "body1",
|
|
433
|
+
children: S(a.amount, "0,0.00")
|
|
434
|
+
})]
|
|
435
|
+
})
|
|
436
|
+
})
|
|
437
|
+
})
|
|
438
|
+
}, a.guid))
|
|
439
|
+
]
|
|
440
|
+
})
|
|
441
|
+
]
|
|
442
|
+
});
|
|
443
|
+
}), Et = ({ goalType: t, onClick: n }) => {
|
|
444
|
+
const { goals: u } = R(), { bgcolor: d, icon: _, label: o, description: m, subTypes: p, type: s } = t, [h, i] = T.useState(!1), a = p.length > 0;
|
|
445
|
+
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ c(O, {
|
|
446
|
+
sx: { bgcolor: "background.paper" },
|
|
447
|
+
children: [
|
|
448
|
+
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
|
|
449
|
+
onClick: a ? () => i(!h) : () => n(s === r.RETIREMENT_TRACK ? u.retirement : "", s === r.RETIREMENT_TRACK ? U.RETIREMENT : U.OTHER, s),
|
|
371
450
|
children: [
|
|
372
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(te, {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
451
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(te, {
|
|
452
|
+
sx: { bgcolor: d },
|
|
453
|
+
variant: "rounded",
|
|
454
|
+
children: /* @__PURE__ */ e(fe, {
|
|
455
|
+
name: _,
|
|
456
|
+
sx: { color: "grey.900" }
|
|
457
|
+
})
|
|
458
|
+
}) }),
|
|
459
|
+
/* @__PURE__ */ e(w, {
|
|
460
|
+
primary: o,
|
|
461
|
+
secondary: m,
|
|
462
|
+
sx: { mr: 24 }
|
|
463
|
+
}),
|
|
464
|
+
!a && /* @__PURE__ */ e(z, {}),
|
|
465
|
+
a && (h ? /* @__PURE__ */ e(at, {}) : /* @__PURE__ */ e(it, {}))
|
|
376
466
|
]
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
})
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
467
|
+
}) }),
|
|
468
|
+
/* @__PURE__ */ e(E, { variant: "inset" }),
|
|
469
|
+
a && /* @__PURE__ */ e(gt, {
|
|
470
|
+
in: h,
|
|
471
|
+
children: /* @__PURE__ */ e(O, {
|
|
472
|
+
sx: { bgcolor: "background.default" },
|
|
473
|
+
children: p.map((b, l) => /* @__PURE__ */ e(k, {
|
|
474
|
+
sx: { pl: 48 },
|
|
475
|
+
children: /* @__PURE__ */ c(L, {
|
|
476
|
+
onClick: () => n(b.label, b.metaType, s),
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ e(_t, {
|
|
479
|
+
sx: { mr: 8 },
|
|
480
|
+
children: /* @__PURE__ */ e(fe, { name: b.icon })
|
|
481
|
+
}),
|
|
482
|
+
/* @__PURE__ */ e(w, {
|
|
483
|
+
primary: b.label,
|
|
484
|
+
slotProps: { primary: { variant: "body1" } }
|
|
485
|
+
}),
|
|
486
|
+
/* @__PURE__ */ e(z, {})
|
|
487
|
+
]
|
|
488
|
+
})
|
|
489
|
+
}, l))
|
|
490
|
+
})
|
|
491
|
+
})
|
|
492
|
+
]
|
|
493
|
+
}) });
|
|
494
|
+
}, Be = ({ accounts: t, isOpen: n, onClose: u, onSave: d, title: _ }) => {
|
|
495
|
+
const { goals: o, common: m } = R(), { config: p } = be(), [s, h] = T.useState([]), i = (a) => {
|
|
496
|
+
const b = s.findIndex((f) => f.guid === a.guid), l = [...s];
|
|
497
|
+
b >= 0 ? l.splice(b, 1) : l.push(a), h(l);
|
|
402
498
|
};
|
|
403
|
-
return /* @__PURE__ */ c(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
children: [
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
/* @__PURE__ */ e(v, { variant: b < t.length - 1 ? "inset" : "fullWidth" })
|
|
435
|
-
] }, o.guid))
|
|
436
|
-
] }),
|
|
437
|
-
p.show_connections_widget_in_master && /* @__PURE__ */ e(
|
|
438
|
-
De,
|
|
439
|
-
{
|
|
440
|
-
description: i.connect_description,
|
|
441
|
-
label: i.connect_button,
|
|
442
|
-
title: i.connect_title
|
|
443
|
-
}
|
|
444
|
-
)
|
|
445
|
-
]
|
|
446
|
-
}
|
|
447
|
-
);
|
|
448
|
-
}, vt = ({ onClose: t }) => {
|
|
449
|
-
const { goals: n } = x(), { addGoal: u, debtGoals: d, setAlert: _, setSelectedGoal: i } = N(), { config: m } = pe(), { visibleDebtAccounts: p } = j(), [s, h] = T.useState(!1), a = Xe(n), o = (l, y, E) => {
|
|
450
|
-
E === r.DEBT_TRACK ? h(!0) : i({
|
|
499
|
+
return /* @__PURE__ */ c(q, {
|
|
500
|
+
ariaLabelClose: m.close_aria,
|
|
501
|
+
isOpen: n,
|
|
502
|
+
onClose: u,
|
|
503
|
+
onPrimaryAction: () => d(s),
|
|
504
|
+
title: _,
|
|
505
|
+
children: [/* @__PURE__ */ c(O, {
|
|
506
|
+
sx: { bgcolor: "background.white" },
|
|
507
|
+
children: [/* @__PURE__ */ e(E, { variant: "fullWidth" }), t.map((a, b) => /* @__PURE__ */ c(T.Fragment, { children: [/* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
|
|
508
|
+
onClick: () => i(a),
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
|
|
511
|
+
alt: a?.name || "",
|
|
512
|
+
institutionGuid: a?.institution_guid || ""
|
|
513
|
+
}) }),
|
|
514
|
+
/* @__PURE__ */ e(w, {
|
|
515
|
+
primary: ve(a, { allowNickname: p?.show_account_nicknames_in_master }),
|
|
516
|
+
secondary: S(a.balance || 0, "0,0.00")
|
|
517
|
+
}),
|
|
518
|
+
/* @__PURE__ */ e(ut, { checked: s.some((l) => l.guid === a.guid) })
|
|
519
|
+
]
|
|
520
|
+
}) }), /* @__PURE__ */ e(E, { variant: b < t.length - 1 ? "inset" : "fullWidth" })] }, a.guid))]
|
|
521
|
+
}), p.show_connections_widget_in_master && /* @__PURE__ */ e(Ce, {
|
|
522
|
+
description: o.connect_description,
|
|
523
|
+
label: o.connect_button,
|
|
524
|
+
title: o.connect_title
|
|
525
|
+
})]
|
|
526
|
+
});
|
|
527
|
+
}, St = ({ onClose: t }) => {
|
|
528
|
+
const { goals: n } = R(), { addGoal: u, debtGoals: d, setAlert: _, setSelectedGoal: o } = N(), { config: m } = be(), { visibleDebtAccounts: p } = j(), [s, h] = T.useState(!1), i = je(n), a = (l, f, x) => {
|
|
529
|
+
x === r.DEBT_TRACK ? h(!0) : o({
|
|
451
530
|
amount: 0,
|
|
452
531
|
current_amount: 0,
|
|
453
|
-
goal_type:
|
|
532
|
+
goal_type: le.SAVE_AMOUNT,
|
|
454
533
|
initial_amount: 0,
|
|
455
|
-
meta_type:
|
|
534
|
+
meta_type: f,
|
|
456
535
|
name: l,
|
|
457
|
-
track_type:
|
|
536
|
+
track_type: x
|
|
458
537
|
});
|
|
459
538
|
}, b = async (l) => {
|
|
460
|
-
for (const
|
|
461
|
-
let
|
|
462
|
-
|
|
463
|
-
account_guid:
|
|
539
|
+
for (const f of l) {
|
|
540
|
+
let x = U.CREDIT_CARD;
|
|
541
|
+
f.account_type === ye.LOAN ? x = U.LOANS : f.account_type === ye.LINE_OF_CREDIT && (x = U.LINE_OF_CREDIT), await u({
|
|
542
|
+
account_guid: f.guid,
|
|
464
543
|
amount: 0,
|
|
465
544
|
current_amount: 0,
|
|
466
|
-
goal_type:
|
|
467
|
-
initial_amount:
|
|
468
|
-
interest_rate:
|
|
469
|
-
meta_type:
|
|
470
|
-
monthly_payment:
|
|
471
|
-
name:
|
|
472
|
-
allowNickname: m?.show_account_nicknames_in_master
|
|
473
|
-
}),
|
|
545
|
+
goal_type: le.KEEP_BALANCE_BELOW,
|
|
546
|
+
initial_amount: f.balance || 0,
|
|
547
|
+
interest_rate: f.interest_rate || 0,
|
|
548
|
+
meta_type: x,
|
|
549
|
+
monthly_payment: f.minimum_payment || 0,
|
|
550
|
+
name: ve(f, { allowNickname: m?.show_account_nicknames_in_master }),
|
|
474
551
|
track_type: r.DEBT_TRACK
|
|
475
552
|
}), _(n.alert_goal_added);
|
|
476
553
|
}
|
|
477
554
|
h(!1), t?.(r.DEBT_TRACK);
|
|
478
555
|
};
|
|
479
|
-
return /* @__PURE__ */ c(
|
|
480
|
-
|
|
481
|
-
/* @__PURE__ */ e(
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
] });
|
|
556
|
+
return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(O, {
|
|
557
|
+
sx: { bgcolor: "background.paper" },
|
|
558
|
+
children: i.map((l, f) => /* @__PURE__ */ e(Et, {
|
|
559
|
+
goalType: l,
|
|
560
|
+
onClick: a
|
|
561
|
+
}, f))
|
|
562
|
+
}), /* @__PURE__ */ e(Be, {
|
|
563
|
+
accounts: p.filter((l) => !d.find((f) => f.account_guid === l.guid)),
|
|
564
|
+
isOpen: s,
|
|
565
|
+
onClose: () => h(!1),
|
|
566
|
+
onSave: b,
|
|
567
|
+
title: n.select_debt_accounts_title
|
|
568
|
+
})] });
|
|
492
569
|
}, We = ({ account: t }) => {
|
|
493
|
-
const n =
|
|
494
|
-
return /* @__PURE__ */ c(k, {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
/* @__PURE__ */ e(
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
t.amount = m, s ? d(l) : (t.track_type !== r.RETIREMENT_TRACK ? await _(l) : await
|
|
570
|
+
const n = Ue(t);
|
|
571
|
+
return /* @__PURE__ */ c(k, {
|
|
572
|
+
sx: {
|
|
573
|
+
bgcolor: "background.paper",
|
|
574
|
+
p: 24
|
|
575
|
+
},
|
|
576
|
+
children: [/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
|
|
577
|
+
alt: t.name || "",
|
|
578
|
+
institutionGuid: t.institution_guid || ""
|
|
579
|
+
}) }), /* @__PURE__ */ e(w, {
|
|
580
|
+
primary: n,
|
|
581
|
+
secondary: S(t.balance || 0, "0,0.00")
|
|
582
|
+
})]
|
|
583
|
+
});
|
|
584
|
+
}, It = K(({ goal: t }) => {
|
|
585
|
+
const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateGoal: _, updateRetirementGoal: o } = N(), [m, p] = T.useState(t.amount), s = !t.guid, h = m < 0 || m > 9999999999e-2, i = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, a = async () => {
|
|
586
|
+
const l = {
|
|
587
|
+
...t,
|
|
588
|
+
amount: m
|
|
589
|
+
};
|
|
590
|
+
t.amount = m, s ? d(l) : (t.track_type !== r.RETIREMENT_TRACK ? await _(l) : await o(l), u(n.alert_goal_updated_amount));
|
|
514
591
|
}, b = () => {
|
|
515
592
|
setTimeout(() => {
|
|
516
593
|
p(t.amount);
|
|
517
594
|
}, 250);
|
|
518
595
|
};
|
|
519
|
-
return /* @__PURE__ */ e(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
setAmount: (l) => p(isNaN(Number(l)) ? m : Number(l)),
|
|
539
|
-
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
540
|
-
}
|
|
541
|
-
)
|
|
542
|
-
}
|
|
543
|
-
);
|
|
596
|
+
return /* @__PURE__ */ e(Z, {
|
|
597
|
+
isDisabled: i,
|
|
598
|
+
isSaveDisabled: h,
|
|
599
|
+
label: n.details_amount_to_save,
|
|
600
|
+
onCancel: b,
|
|
601
|
+
onSave: a,
|
|
602
|
+
primaryText: n.details_amount_to_save,
|
|
603
|
+
secondaryText: S(t.amount, "0,0"),
|
|
604
|
+
zeroStateText: s && t.amount === 0 ? n.add_amount : void 0,
|
|
605
|
+
children: /* @__PURE__ */ e(Te, {
|
|
606
|
+
amount: m,
|
|
607
|
+
autoFocus: !0,
|
|
608
|
+
error: h,
|
|
609
|
+
fullWidth: !0,
|
|
610
|
+
minAmount: 0,
|
|
611
|
+
setAmount: (l) => p(isNaN(Number(l)) ? m : Number(l)),
|
|
612
|
+
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
613
|
+
})
|
|
614
|
+
});
|
|
544
615
|
}), Gt = ({ goal: t }) => {
|
|
545
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts: u } = j(), { accounts: d, goals: _ } =
|
|
546
|
-
const
|
|
547
|
-
|
|
616
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: u } = j(), { accounts: d, goals: _ } = R(), { config: o } = be(), { setAlert: m, setSelectedGoal: p, updateGoal: s } = N(), h = !t.guid, [i, a] = T.useState(!1), b = async ({ balance: l, guid: f }) => {
|
|
617
|
+
const x = {
|
|
618
|
+
...t,
|
|
619
|
+
account_guid: f,
|
|
620
|
+
current_amount: l || 0
|
|
621
|
+
};
|
|
622
|
+
h ? p(x) : (await s(x), m(_.alert_account_changed)), a(!1);
|
|
548
623
|
};
|
|
549
|
-
return /* @__PURE__ */ c(
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
/* @__PURE__ */ e(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
624
|
+
return /* @__PURE__ */ c(g, { children: [h && !t.account_guid ? /* @__PURE__ */ e(k, {
|
|
625
|
+
disableGutters: !0,
|
|
626
|
+
disablePadding: !0,
|
|
627
|
+
sx: { bgcolor: "background.paper" },
|
|
628
|
+
children: /* @__PURE__ */ c(L, {
|
|
629
|
+
onClick: () => a(!0),
|
|
630
|
+
children: [/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(g, {
|
|
631
|
+
alignItems: "center",
|
|
632
|
+
color: "primary.main",
|
|
633
|
+
direction: "row",
|
|
634
|
+
gap: 8,
|
|
635
|
+
children: [/* @__PURE__ */ e(Ge, { filled: !0 }), _.details_add_account]
|
|
636
|
+
}) }), /* @__PURE__ */ e(z, { color: "primary" })]
|
|
637
|
+
})
|
|
638
|
+
}) : /* @__PURE__ */ c(g, {
|
|
639
|
+
sx: {
|
|
640
|
+
gap: 8,
|
|
641
|
+
my: 24,
|
|
642
|
+
mx: 24
|
|
643
|
+
},
|
|
644
|
+
children: [/* @__PURE__ */ e(ge, {
|
|
645
|
+
onClick: () => a(!0),
|
|
646
|
+
variant: "text",
|
|
647
|
+
children: _.details_change_account
|
|
648
|
+
}), /* @__PURE__ */ e(C, {
|
|
649
|
+
color: "text.secondary",
|
|
650
|
+
sx: { textAlign: "center" },
|
|
651
|
+
variant: "subtitle1",
|
|
652
|
+
children: B(_.details_change_account_description, t.name)
|
|
653
|
+
})]
|
|
654
|
+
}), /* @__PURE__ */ e(q, {
|
|
655
|
+
isOpen: i,
|
|
656
|
+
onClose: () => a(!1),
|
|
657
|
+
title: _.details_change_account,
|
|
658
|
+
children: /* @__PURE__ */ c(g, { children: [
|
|
659
|
+
n.length > 0 && /* @__PURE__ */ e(C, {
|
|
660
|
+
bold: !0,
|
|
661
|
+
sx: {
|
|
662
|
+
mb: 4,
|
|
663
|
+
ml: 24,
|
|
664
|
+
mt: 12
|
|
665
|
+
},
|
|
666
|
+
variant: "caption",
|
|
667
|
+
children: d.account_types[1]
|
|
668
|
+
}),
|
|
669
|
+
/* @__PURE__ */ e(O, {
|
|
670
|
+
sx: { bgcolor: "background.paper" },
|
|
671
|
+
children: n.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
|
|
672
|
+
onClick: () => b(l),
|
|
673
|
+
children: [
|
|
674
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
|
|
675
|
+
alt: l?.name || "",
|
|
676
|
+
institutionGuid: l?.institution_guid || ""
|
|
677
|
+
}) }),
|
|
678
|
+
/* @__PURE__ */ e(w, {
|
|
679
|
+
primary: l?.name || l?.feed_name,
|
|
680
|
+
secondary: S(l?.balance || 0, "0,0.00")
|
|
681
|
+
}),
|
|
682
|
+
/* @__PURE__ */ e(z, {})
|
|
683
|
+
]
|
|
684
|
+
}) }, l.guid))
|
|
685
|
+
}),
|
|
686
|
+
u.length > 0 && /* @__PURE__ */ e(C, {
|
|
687
|
+
bold: !0,
|
|
688
|
+
sx: {
|
|
689
|
+
mb: 4,
|
|
690
|
+
ml: 24,
|
|
691
|
+
mt: 12
|
|
692
|
+
},
|
|
693
|
+
variant: "caption",
|
|
694
|
+
children: d.account_types[2]
|
|
695
|
+
}),
|
|
696
|
+
/* @__PURE__ */ e(O, {
|
|
697
|
+
sx: { bgcolor: "background.paper" },
|
|
698
|
+
children: u.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
|
|
699
|
+
onClick: () => b(l),
|
|
700
|
+
children: [
|
|
701
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
|
|
702
|
+
alt: l?.name || "",
|
|
703
|
+
institutionGuid: l?.institution_guid || ""
|
|
704
|
+
}) }),
|
|
705
|
+
/* @__PURE__ */ e(w, {
|
|
706
|
+
primary: l?.name || l?.feed_name,
|
|
707
|
+
secondary: S(l?.balance || 0, "0,0.00")
|
|
708
|
+
}),
|
|
709
|
+
/* @__PURE__ */ e(z, {})
|
|
710
|
+
]
|
|
711
|
+
}) }, l.guid))
|
|
712
|
+
}),
|
|
713
|
+
o.show_connections_widget_in_master && /* @__PURE__ */ e(Ce, {
|
|
714
|
+
description: _.connect_description,
|
|
715
|
+
label: _.connect_button,
|
|
716
|
+
title: _.connect_title
|
|
717
|
+
})
|
|
718
|
+
] })
|
|
719
|
+
})] });
|
|
720
|
+
}, Nt = K(({ goal: t }) => {
|
|
721
|
+
const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateGoal: _ } = N(), [o, m] = T.useState(t.name), p = !t.guid, s = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, h = async () => {
|
|
722
|
+
const a = {
|
|
723
|
+
...t,
|
|
724
|
+
name: o
|
|
725
|
+
};
|
|
726
|
+
t.name = o, p ? d(a) : (await _(a), u(n.alert_goal_updated_name));
|
|
727
|
+
}, i = () => {
|
|
612
728
|
setTimeout(() => {
|
|
613
729
|
m(t.name);
|
|
614
730
|
}, 250);
|
|
615
731
|
};
|
|
616
|
-
return /* @__PURE__ */ e(
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
732
|
+
return /* @__PURE__ */ e(Z, {
|
|
733
|
+
isDisabled: s,
|
|
734
|
+
isSaveDisabled: !o,
|
|
735
|
+
label: n.details_goal_name,
|
|
736
|
+
onCancel: i,
|
|
737
|
+
onSave: h,
|
|
738
|
+
primaryText: n.details_goal_name,
|
|
739
|
+
secondaryText: t.name,
|
|
740
|
+
children: /* @__PURE__ */ e(Me, {
|
|
741
|
+
error: !o,
|
|
742
|
+
fullWidth: !0,
|
|
621
743
|
label: n.details_goal_name,
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
children: /* @__PURE__ */ e(
|
|
627
|
-
Ke,
|
|
628
|
-
{
|
|
629
|
-
error: !i,
|
|
630
|
-
fullWidth: !0,
|
|
631
|
-
label: n.details_goal_name,
|
|
632
|
-
onChange: (o) => m(o.target.value),
|
|
633
|
-
value: i
|
|
634
|
-
}
|
|
635
|
-
)
|
|
636
|
-
}
|
|
637
|
-
);
|
|
744
|
+
onChange: (a) => m(a.target.value),
|
|
745
|
+
value: o
|
|
746
|
+
})
|
|
747
|
+
});
|
|
638
748
|
}), kt = ({ goal: t }) => {
|
|
639
|
-
const { goals: n } =
|
|
640
|
-
if (!isNaN(
|
|
641
|
-
const
|
|
642
|
-
|
|
749
|
+
const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateRetirementGoal: _ } = N(), [o, m] = T.useState(t.retirement_age || 65), p = !t.guid, s = async () => {
|
|
750
|
+
if (!isNaN(o)) {
|
|
751
|
+
const a = {
|
|
752
|
+
...t,
|
|
753
|
+
retirement_age: o
|
|
754
|
+
};
|
|
755
|
+
t.retirement_age = o, p ? d(a) : (await _(a), u(n.alert_goal_updated_retirement_age));
|
|
643
756
|
}
|
|
644
757
|
}, h = () => {
|
|
645
758
|
setTimeout(() => {
|
|
646
759
|
m(t.retirement_age || 65);
|
|
647
760
|
}, 250);
|
|
648
|
-
},
|
|
649
|
-
return /* @__PURE__ */ e(
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
761
|
+
}, i = !o || isNaN(o) || o < 20 || o >= 100;
|
|
762
|
+
return /* @__PURE__ */ e(Z, {
|
|
763
|
+
isDisabled: t.is_complete,
|
|
764
|
+
isSaveDisabled: i,
|
|
765
|
+
label: n.details_retirement_age,
|
|
766
|
+
onCancel: h,
|
|
767
|
+
onSave: s,
|
|
768
|
+
primaryText: n.details_retirement_age,
|
|
769
|
+
secondaryText: `${t.retirement_age}`,
|
|
770
|
+
zeroStateText: p && !t.retirement_age ? n.add_age : void 0,
|
|
771
|
+
children: /* @__PURE__ */ e(Me, {
|
|
772
|
+
error: i,
|
|
773
|
+
fullWidth: !0,
|
|
654
774
|
label: n.details_retirement_age,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
label: n.details_retirement_age,
|
|
666
|
-
onChange: (o) => m(Number(o.target.value)),
|
|
667
|
-
value: isNaN(i) ? "" : i
|
|
668
|
-
}
|
|
669
|
-
)
|
|
670
|
-
}
|
|
671
|
-
);
|
|
672
|
-
}, wt = D(({ goal: t }) => {
|
|
673
|
-
const { goals: n } = x(), { user: u, updateUser: d } = Ge(), { setAlert: _ } = N(), [i, m] = T.useState(ee(u.birthday ?? 0)), [p, s] = T.useState(null), h = t.is_complete, a = async () => {
|
|
674
|
-
i && dt(i) && (await d({ ...u, birthday: lt(i) }), _(n.alert_goal_updated_birthday));
|
|
775
|
+
onChange: (a) => m(Number(a.target.value)),
|
|
776
|
+
value: isNaN(o) ? "" : o
|
|
777
|
+
})
|
|
778
|
+
});
|
|
779
|
+
}, wt = K(({ goal: t }) => {
|
|
780
|
+
const { goals: n } = R(), { user: u, updateUser: d } = xe(), { setAlert: _ } = N(), [o, m] = T.useState(ee(u.birthday ?? 0)), [p, s] = T.useState(null), h = t.is_complete, i = async () => {
|
|
781
|
+
o && At(o) && (await d({
|
|
782
|
+
...u,
|
|
783
|
+
birthday: dt(o)
|
|
784
|
+
}), _(n.alert_goal_updated_birthday));
|
|
675
785
|
};
|
|
676
|
-
return /* @__PURE__ */ e(
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
children: /* @__PURE__ */ e(
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
const { goals: n } = x(), { visibleRetirementAccounts: u } = j(), {
|
|
700
|
-
addRetirementGoalAccount: d,
|
|
701
|
-
newRetirementGoalAccounts: _,
|
|
702
|
-
retirementGoalAccounts: i,
|
|
703
|
-
selectedGoal: m,
|
|
704
|
-
setAlert: p,
|
|
705
|
-
setNewRetirementGoalAccounts: s,
|
|
706
|
-
setSelectedGoal: h
|
|
707
|
-
} = N(), [a, o] = T.useState(!1), b = !t.guid, l = u.filter(
|
|
708
|
-
(g) => b ? _.find((A) => A.account_guid === g.guid) : i.find((A) => A.account_guid === g.guid)
|
|
709
|
-
), y = u.filter(
|
|
710
|
-
(g) => !i.find((A) => A.account_guid === g.guid)
|
|
711
|
-
), E = async (g) => {
|
|
712
|
-
const A = g.map((R) => ({
|
|
713
|
-
account_guid: R.guid,
|
|
786
|
+
return /* @__PURE__ */ e(Z, {
|
|
787
|
+
isDisabled: h,
|
|
788
|
+
isSaveDisabled: !!p,
|
|
789
|
+
label: n.details_birthday,
|
|
790
|
+
onSave: i,
|
|
791
|
+
primaryText: n.details_birthday,
|
|
792
|
+
secondaryText: `${_e(ee(u.birthday ?? 0), ue.MONTH_DAY_YEAR)}`,
|
|
793
|
+
zeroStateText: !t.guid && !u.birthday ? n.add_birthday : void 0,
|
|
794
|
+
children: /* @__PURE__ */ e(ft, {
|
|
795
|
+
dateAdapter: pt,
|
|
796
|
+
children: /* @__PURE__ */ e(yt, {
|
|
797
|
+
label: n.details_birthday,
|
|
798
|
+
onChange: m,
|
|
799
|
+
onError: (a) => s(a),
|
|
800
|
+
sx: { width: "100%" },
|
|
801
|
+
value: o
|
|
802
|
+
})
|
|
803
|
+
})
|
|
804
|
+
});
|
|
805
|
+
}), Kt = ({ goal: t }) => {
|
|
806
|
+
const { goals: n } = R(), { visibleRetirementAccounts: u } = j(), { addRetirementGoalAccount: d, newRetirementGoalAccounts: _, retirementGoalAccounts: o, selectedGoal: m, setAlert: p, setNewRetirementGoalAccounts: s, setSelectedGoal: h } = N(), [i, a] = T.useState(!1), b = !t.guid, l = u.filter((y) => b ? _.find((A) => A.account_guid === y.guid) : o.find((A) => A.account_guid === y.guid)), f = u.filter((y) => !o.find((A) => A.account_guid === y.guid)), x = async (y) => {
|
|
807
|
+
const A = y.map((v) => ({
|
|
808
|
+
account_guid: v.guid,
|
|
714
809
|
retirement_goal_guid: t.guid
|
|
715
810
|
}));
|
|
716
|
-
if (b)
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
for (const R of A)
|
|
720
|
-
await d(R), p(n.alert_account_added);
|
|
811
|
+
if (b) s(A);
|
|
812
|
+
else for (const v of A)
|
|
813
|
+
await d(v), p(n.alert_account_added);
|
|
721
814
|
h({
|
|
722
815
|
...m,
|
|
723
|
-
current_amount:
|
|
724
|
-
}),
|
|
816
|
+
current_amount: y.reduce((v, G) => v + (G.balance || 0), 0)
|
|
817
|
+
}), a(!1);
|
|
725
818
|
};
|
|
726
|
-
return /* @__PURE__ */ c(
|
|
727
|
-
l.map((
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
819
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
820
|
+
l.map((y) => /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(We, { account: y }), /* @__PURE__ */ e(E, {})] }, y.guid)),
|
|
821
|
+
/* @__PURE__ */ e(k, {
|
|
822
|
+
disableGutters: !0,
|
|
823
|
+
disablePadding: !0,
|
|
824
|
+
sx: { bgcolor: "background.paper" },
|
|
825
|
+
children: /* @__PURE__ */ c(L, {
|
|
826
|
+
onClick: () => a(!0),
|
|
827
|
+
children: [/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(g, {
|
|
828
|
+
alignItems: "center",
|
|
829
|
+
color: "primary.main",
|
|
830
|
+
direction: "row",
|
|
831
|
+
gap: 8,
|
|
832
|
+
children: [/* @__PURE__ */ e(Ge, { filled: !0 }), n.details_add_account]
|
|
833
|
+
}) }), /* @__PURE__ */ e(z, { color: "primary" })]
|
|
834
|
+
})
|
|
835
|
+
}),
|
|
836
|
+
/* @__PURE__ */ e(Be, {
|
|
837
|
+
accounts: f,
|
|
838
|
+
isOpen: i,
|
|
839
|
+
onClose: () => a(!1),
|
|
840
|
+
onSave: x,
|
|
841
|
+
title: n.add_select_accounts
|
|
842
|
+
})
|
|
748
843
|
] });
|
|
749
|
-
},
|
|
750
|
-
const { goals: n } =
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
/* @__PURE__ */ e(
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
844
|
+
}, Dt = K(({ goal: t }) => {
|
|
845
|
+
const { goals: n } = R(), { visibleAccounts: u } = j(), d = T.useMemo(() => u.find((m) => m.guid === t.account_guid), [u, t]), _ = t.track_type;
|
|
846
|
+
let o = n.details_save_title;
|
|
847
|
+
return t.track_type === r.DEBT_TRACK ? o = n.details_debt_title : t.track_type === r.RETIREMENT_TRACK && (o = n.details_retirement_title), /* @__PURE__ */ c(g, { children: [
|
|
848
|
+
/* @__PURE__ */ c(g, {
|
|
849
|
+
mx: 24,
|
|
850
|
+
children: [
|
|
851
|
+
/* @__PURE__ */ e(C, {
|
|
852
|
+
color: "text.secondary",
|
|
853
|
+
sx: {
|
|
854
|
+
mb: 4,
|
|
855
|
+
mt: 24
|
|
856
|
+
},
|
|
857
|
+
variant: "caption",
|
|
858
|
+
children: o
|
|
859
|
+
}),
|
|
860
|
+
/* @__PURE__ */ e(Oe, {
|
|
861
|
+
goal: t,
|
|
862
|
+
isInDrawer: !0
|
|
863
|
+
}),
|
|
864
|
+
/* @__PURE__ */ e(C, {
|
|
865
|
+
color: "text.secondary",
|
|
866
|
+
sx: {
|
|
867
|
+
mb: 4,
|
|
868
|
+
mt: 24
|
|
869
|
+
},
|
|
870
|
+
variant: "caption",
|
|
871
|
+
children: n.details_title
|
|
872
|
+
})
|
|
873
|
+
]
|
|
874
|
+
}),
|
|
875
|
+
/* @__PURE__ */ c(O, {
|
|
876
|
+
sx: { bgcolor: "background.paper" },
|
|
877
|
+
children: [
|
|
878
|
+
_ !== r.RETIREMENT_TRACK ? /* @__PURE__ */ e(Nt, { goal: t }) : /* @__PURE__ */ e(k, {
|
|
879
|
+
sx: { px: 24 },
|
|
880
|
+
children: /* @__PURE__ */ e(w, {
|
|
881
|
+
primary: /* @__PURE__ */ c(g, {
|
|
882
|
+
alignItems: "center",
|
|
883
|
+
direction: "row",
|
|
884
|
+
justifyContent: "space-between",
|
|
885
|
+
children: [/* @__PURE__ */ e(C, {
|
|
886
|
+
variant: "body1",
|
|
887
|
+
children: n.details_goal_name
|
|
888
|
+
}), /* @__PURE__ */ e(C, {
|
|
889
|
+
bold: !0,
|
|
890
|
+
color: "text.primary",
|
|
891
|
+
sx: { mr: 4 },
|
|
892
|
+
variant: "body1",
|
|
893
|
+
children: n.retirement
|
|
894
|
+
})]
|
|
895
|
+
}),
|
|
896
|
+
slotProps: { primary: { variant: "body1" } }
|
|
897
|
+
})
|
|
898
|
+
}),
|
|
899
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
900
|
+
(_ === r.SAVINGS_TRACK || _ === r.RETIREMENT_TRACK) && /* @__PURE__ */ c(F, { children: [/* @__PURE__ */ e(It, { goal: t }), /* @__PURE__ */ e(E, { sx: { ml: _ === r.RETIREMENT_TRACK ? 24 : 0 } })] }),
|
|
901
|
+
t.track_type === r.DEBT_TRACK && /* @__PURE__ */ c(F, { children: [
|
|
902
|
+
/* @__PURE__ */ e(Je, { goal: t }),
|
|
903
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
904
|
+
/* @__PURE__ */ e(Xe, { goal: t }),
|
|
905
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
906
|
+
/* @__PURE__ */ e(Qe, { goal: t }),
|
|
907
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
908
|
+
] }),
|
|
909
|
+
t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [
|
|
910
|
+
/* @__PURE__ */ e(kt, { goal: t }),
|
|
911
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
912
|
+
/* @__PURE__ */ e(wt, { goal: t }),
|
|
913
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
914
|
+
] })
|
|
915
|
+
]
|
|
916
|
+
}),
|
|
917
|
+
/* @__PURE__ */ e(C, {
|
|
918
|
+
color: "text.secondary",
|
|
919
|
+
sx: {
|
|
920
|
+
mb: 4,
|
|
921
|
+
ml: 24,
|
|
922
|
+
mt: 12
|
|
923
|
+
},
|
|
924
|
+
variant: "caption",
|
|
925
|
+
children: t.track_type === r.RETIREMENT_TRACK ? n.details_accounts : n.details_account
|
|
926
|
+
}),
|
|
927
|
+
t.track_type !== r.RETIREMENT_TRACK && d && /* @__PURE__ */ c(F, { children: [/* @__PURE__ */ e(We, { account: d }), /* @__PURE__ */ e(E, {})] }),
|
|
928
|
+
t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [/* @__PURE__ */ e(Kt, { goal: t }), /* @__PURE__ */ e(E, {})] }),
|
|
801
929
|
t.track_type === r.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(Gt, { goal: t })
|
|
802
930
|
] });
|
|
803
|
-
}), Mt =
|
|
804
|
-
const { visibleRetirementAccounts: n } = j(), { goals: u, common: d } = x(), {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
let W = d.delete_button, H = () => g(!0);
|
|
825
|
-
A ? (H = () => ne(), W = d.save_button) : R && (H = () => ae(), W = u.mark_as_complete_button);
|
|
931
|
+
}), Mt = K(({ onClose: t }) => {
|
|
932
|
+
const { visibleRetirementAccounts: n } = j(), { goals: u, common: d } = R(), { addGoal: _, addRetirementGoal: o, deleteGoal: m, deleteRetirementGoal: p, newRetirementGoalAccounts: s, retirementGoalAccounts: h, selectedGoal: i, setAlert: a, setSelectedGoal: b, updateGoal: l } = N(), { user: f } = xe(), [x, y] = T.useState(!1), A = !i?.guid, v = i?.track_type === r.SAVINGS_TRACK && i.is_complete && !i.has_been_spent, G = T.useMemo(() => {
|
|
933
|
+
const I = A ? s : h;
|
|
934
|
+
return n.filter((V) => I.some((M) => M.account_guid === V.guid));
|
|
935
|
+
}, [
|
|
936
|
+
A,
|
|
937
|
+
n,
|
|
938
|
+
s,
|
|
939
|
+
h
|
|
940
|
+
]), D = T.useMemo(() => {
|
|
941
|
+
if (!i) return !1;
|
|
942
|
+
if (!A && !v) return !0;
|
|
943
|
+
const { account_guid: I, track_type: V, name: M, amount: J, retirement_age: oe } = i;
|
|
944
|
+
return V === r.SAVINGS_TRACK ? I ? !!M && !!J : !1 : V === r.RETIREMENT_TRACK ? G.length ? !!M && !!J && !!oe && !!f.birthday : !1 : !0;
|
|
945
|
+
}, [
|
|
946
|
+
i,
|
|
947
|
+
G,
|
|
948
|
+
f.birthday
|
|
949
|
+
]);
|
|
950
|
+
let W = d.delete_button, H = () => y(!0);
|
|
951
|
+
A ? (H = () => ne(), W = d.save_button) : v && (H = () => ie(), W = u.mark_as_complete_button);
|
|
826
952
|
const ne = async () => {
|
|
827
|
-
if (
|
|
828
|
-
const
|
|
829
|
-
|
|
953
|
+
if (i) {
|
|
954
|
+
const I = i.track_type;
|
|
955
|
+
I !== r.RETIREMENT_TRACK ? await _(i) : I === r.RETIREMENT_TRACK && await o({
|
|
956
|
+
...i,
|
|
957
|
+
target_amount: i.amount
|
|
958
|
+
}), a(u.alert_goal_added), b(void 0), I && t?.(I);
|
|
830
959
|
}
|
|
831
|
-
}, oe = async () => {
|
|
832
|
-
a && (a.track_type !== r.RETIREMENT_TRACK ? await m(a.guid) : a.track_type === r.RETIREMENT_TRACK && await p(a), o(u.alert_goal_deleted), b(void 0));
|
|
833
960
|
}, ae = async () => {
|
|
834
|
-
|
|
835
|
-
|
|
961
|
+
i && (i.track_type !== r.RETIREMENT_TRACK ? await m(i.guid) : i.track_type === r.RETIREMENT_TRACK && await p(i), a(u.alert_goal_deleted), b(void 0));
|
|
962
|
+
}, ie = async () => {
|
|
963
|
+
await l({
|
|
964
|
+
...i,
|
|
836
965
|
has_been_spent: !0
|
|
837
|
-
};
|
|
838
|
-
await l(S), o(u.alert_goal_completed), b(void 0);
|
|
966
|
+
}), a(u.alert_goal_completed), b(void 0);
|
|
839
967
|
};
|
|
840
|
-
return /* @__PURE__ */ c(
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
}), Fn = D(({ onBackClick: t, onMenuClick: n, sx: u }) => {
|
|
872
|
-
const { onEvent: d } = Ne(), { isMobile: _ } = he(), { isAccountDataLoaded: i, loadAccountData: m } = j(), { isInitialized: p } = _e(), { goals: s, common: h } = x(), {
|
|
873
|
-
alert: a,
|
|
874
|
-
allGoals: o,
|
|
875
|
-
goals: b,
|
|
876
|
-
isAllGoalDataLoaded: l,
|
|
877
|
-
loadGoalData: y,
|
|
878
|
-
monthlyCashFlowProfile: E,
|
|
879
|
-
setAlert: g,
|
|
880
|
-
retirmentGoals: A
|
|
881
|
-
} = N(), [R, G] = T.useState(0), [K, W] = T.useState(!1), H = E?.amount_allocated_for_savings_goals || 0, ne = E?.amount_allocated_for_debt_goals || 0, oe = E?.amount_allocated_for_retirement_goals || 0;
|
|
882
|
-
Me({
|
|
968
|
+
return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(q, {
|
|
969
|
+
ariaLabelClose: d.close_aria,
|
|
970
|
+
hasSecondaryAction: A,
|
|
971
|
+
isOpen: !!i,
|
|
972
|
+
isPrimaryDisabled: !D,
|
|
973
|
+
onClose: () => b(void 0),
|
|
974
|
+
onPrimaryAction: H,
|
|
975
|
+
primaryColor: A || v ? "primary" : "error",
|
|
976
|
+
primaryText: W,
|
|
977
|
+
secondaryColor: "primary",
|
|
978
|
+
title: u.goal_details,
|
|
979
|
+
children: i && /* @__PURE__ */ e(Dt, { goal: i })
|
|
980
|
+
}), /* @__PURE__ */ e(Ze, {
|
|
981
|
+
copy: {
|
|
982
|
+
close_aria: d.close_aria,
|
|
983
|
+
title: u.delete_goal
|
|
984
|
+
},
|
|
985
|
+
isOpen: x,
|
|
986
|
+
maxWidth: "xs",
|
|
987
|
+
onClose: () => y(!1),
|
|
988
|
+
onPrimaryAction: ae,
|
|
989
|
+
primaryColor: "error",
|
|
990
|
+
primaryText: d.delete_button,
|
|
991
|
+
children: /* @__PURE__ */ e(C, {
|
|
992
|
+
variant: "subtitle1",
|
|
993
|
+
children: B(u.delete_description, i?.name || "")
|
|
994
|
+
})
|
|
995
|
+
})] });
|
|
996
|
+
}), Sn = K(({ onBackClick: t, onMenuClick: n, sx: u }) => {
|
|
997
|
+
const { onEvent: d } = Ee(), { isMobile: _ } = pe(), { isAccountDataLoaded: o, loadAccountData: m } = j(), { isInitialized: p } = he(), { goals: s, common: h } = R(), { alert: i, allGoals: a, goals: b, isAllGoalDataLoaded: l, loadGoalData: f, monthlyCashFlowProfile: x, setAlert: y, retirmentGoals: A } = N(), [v, G] = T.useState(0), [D, W] = T.useState(!1), H = x?.amount_allocated_for_savings_goals || 0, ne = x?.amount_allocated_for_debt_goals || 0, ae = x?.amount_allocated_for_retirement_goals || 0;
|
|
998
|
+
Re({
|
|
883
999
|
widgetName: "GoalsWidget",
|
|
884
1000
|
isLoaded: l
|
|
885
1001
|
}), T.useEffect(() => {
|
|
886
|
-
|
|
1002
|
+
o || m().finally(), d($.GOALS_VIEW);
|
|
887
1003
|
}, []), T.useEffect(() => {
|
|
888
|
-
p &&
|
|
1004
|
+
p && f().finally();
|
|
889
1005
|
}, [p]);
|
|
890
|
-
const
|
|
1006
|
+
const ie = () => {
|
|
891
1007
|
d($.GOALS_CLICK_FILTER);
|
|
892
|
-
},
|
|
1008
|
+
}, I = () => {
|
|
893
1009
|
W(!0), d($.GOALS_CLICK_ADD);
|
|
894
|
-
}, V = (
|
|
895
|
-
W(!1),
|
|
896
|
-
}, M = T.useMemo(
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
const J = B(
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
label: /* @__PURE__ */ e(se, { subtitle: Ve, title: s.tab_retirement_title })
|
|
957
|
-
}
|
|
958
|
-
)
|
|
959
|
-
]
|
|
960
|
-
}
|
|
961
|
-
),
|
|
962
|
-
M ? /* @__PURE__ */ e(
|
|
963
|
-
bt,
|
|
964
|
-
{
|
|
965
|
-
header: s.create_goals_header,
|
|
966
|
-
icon: "trophy",
|
|
967
|
-
onClick: S,
|
|
968
|
-
primaryButton: s.add_goals_button,
|
|
969
|
-
subText: s.empty_state_subheader,
|
|
970
|
-
sx: {
|
|
971
|
-
width: { sm: 432 },
|
|
972
|
-
".buttons-footer": {
|
|
973
|
-
width: 139
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
) : /* @__PURE__ */ c(F, { children: [
|
|
978
|
-
R === 0 && /* @__PURE__ */ e(ce, { onAddGoals: S, trackType: r.SAVINGS_TRACK }),
|
|
979
|
-
R === 1 && /* @__PURE__ */ e(ce, { onAddGoals: S, trackType: r.DEBT_TRACK }),
|
|
980
|
-
R === 2 && /* @__PURE__ */ e(ce, { onAddGoals: S, trackType: r.RETIREMENT_TRACK })
|
|
981
|
-
] })
|
|
982
|
-
] }),
|
|
983
|
-
/* @__PURE__ */ e(Mt, { onClose: V }),
|
|
984
|
-
/* @__PURE__ */ e(
|
|
985
|
-
q,
|
|
986
|
-
{
|
|
987
|
-
ariaLabelClose: h.close_aria,
|
|
988
|
-
isOpen: K,
|
|
989
|
-
onClose: () => W(!1),
|
|
990
|
-
title: s.add_goal_title,
|
|
991
|
-
children: /* @__PURE__ */ e(vt, { onClose: V })
|
|
1010
|
+
}, V = (X) => {
|
|
1011
|
+
W(!1), X === r.SAVINGS_TRACK ? G(0) : X === r.DEBT_TRACK ? G(1) : X === r.RETIREMENT_TRACK && G(2);
|
|
1012
|
+
}, M = T.useMemo(() => l && a.length === 0, [
|
|
1013
|
+
b,
|
|
1014
|
+
l,
|
|
1015
|
+
A
|
|
1016
|
+
]);
|
|
1017
|
+
if (!p || !l) return /* @__PURE__ */ e(Se, {});
|
|
1018
|
+
const J = B(_ ? s.tab_subtitle_mobile : s.tab_subtitle, S(H, "0,0")), oe = B(_ ? s.tab_subtitle_mobile : s.tab_subtitle, S(ne, "0,0")), Ve = B(_ ? s.tab_subtitle_mobile : s.tab_subtitle, S(ae, "0,0"));
|
|
1019
|
+
return /* @__PURE__ */ c($e, {
|
|
1020
|
+
actions: [{
|
|
1021
|
+
iconName: "add",
|
|
1022
|
+
label: s.add_title,
|
|
1023
|
+
onClick: I
|
|
1024
|
+
}],
|
|
1025
|
+
onAccountsFilterClick: ie,
|
|
1026
|
+
onBackClick: t,
|
|
1027
|
+
onMenuClick: n,
|
|
1028
|
+
sx: u,
|
|
1029
|
+
title: s.title,
|
|
1030
|
+
children: [
|
|
1031
|
+
/* @__PURE__ */ c(g, {
|
|
1032
|
+
mx: _ ? 0 : 48,
|
|
1033
|
+
my: 24,
|
|
1034
|
+
children: [/* @__PURE__ */ c(ct, {
|
|
1035
|
+
onChange: (X, ze) => G(ze),
|
|
1036
|
+
sx: { bgcolor: "background.paper" },
|
|
1037
|
+
textColor: "primary",
|
|
1038
|
+
value: M ? !1 : v,
|
|
1039
|
+
variant: "fullWidth",
|
|
1040
|
+
children: [
|
|
1041
|
+
/* @__PURE__ */ e(re, {
|
|
1042
|
+
disabled: M,
|
|
1043
|
+
label: /* @__PURE__ */ e(se, {
|
|
1044
|
+
subtitle: J,
|
|
1045
|
+
title: s.tab_saving_title
|
|
1046
|
+
})
|
|
1047
|
+
}),
|
|
1048
|
+
/* @__PURE__ */ e(re, {
|
|
1049
|
+
disabled: M,
|
|
1050
|
+
label: /* @__PURE__ */ e(se, {
|
|
1051
|
+
subtitle: oe,
|
|
1052
|
+
title: s.tab_debt_title
|
|
1053
|
+
})
|
|
1054
|
+
}),
|
|
1055
|
+
/* @__PURE__ */ e(re, {
|
|
1056
|
+
disabled: M,
|
|
1057
|
+
label: /* @__PURE__ */ e(se, {
|
|
1058
|
+
subtitle: Ve,
|
|
1059
|
+
title: s.tab_retirement_title
|
|
1060
|
+
})
|
|
1061
|
+
})
|
|
1062
|
+
]
|
|
1063
|
+
}), M ? /* @__PURE__ */ e(Fe, {
|
|
1064
|
+
header: s.create_goals_header,
|
|
1065
|
+
icon: "trophy",
|
|
1066
|
+
onClick: I,
|
|
1067
|
+
primaryButton: s.add_goals_button,
|
|
1068
|
+
subText: s.empty_state_subheader,
|
|
1069
|
+
sx: {
|
|
1070
|
+
width: { sm: 432 },
|
|
1071
|
+
".buttons-footer": { width: 139 }
|
|
992
1072
|
}
|
|
993
|
-
),
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
/* @__PURE__ */ e(
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1073
|
+
}) : /* @__PURE__ */ c(F, { children: [
|
|
1074
|
+
v === 0 && /* @__PURE__ */ e(ce, {
|
|
1075
|
+
onAddGoals: I,
|
|
1076
|
+
trackType: r.SAVINGS_TRACK
|
|
1077
|
+
}),
|
|
1078
|
+
v === 1 && /* @__PURE__ */ e(ce, {
|
|
1079
|
+
onAddGoals: I,
|
|
1080
|
+
trackType: r.DEBT_TRACK
|
|
1081
|
+
}),
|
|
1082
|
+
v === 2 && /* @__PURE__ */ e(ce, {
|
|
1083
|
+
onAddGoals: I,
|
|
1084
|
+
trackType: r.RETIREMENT_TRACK
|
|
1085
|
+
})
|
|
1086
|
+
] })]
|
|
1087
|
+
}),
|
|
1088
|
+
/* @__PURE__ */ e(Mt, { onClose: V }),
|
|
1089
|
+
/* @__PURE__ */ e(q, {
|
|
1090
|
+
ariaLabelClose: h.close_aria,
|
|
1091
|
+
isOpen: D,
|
|
1092
|
+
onClose: () => W(!1),
|
|
1093
|
+
title: s.add_goal_title,
|
|
1094
|
+
children: /* @__PURE__ */ e(St, { onClose: V })
|
|
1095
|
+
}),
|
|
1096
|
+
/* @__PURE__ */ e(bt, {
|
|
1097
|
+
onClose: () => y(""),
|
|
1098
|
+
open: !!i,
|
|
1099
|
+
children: /* @__PURE__ */ e(ht, {
|
|
1100
|
+
onClose: () => y(""),
|
|
1101
|
+
severity: "success",
|
|
1102
|
+
variant: "filled",
|
|
1103
|
+
children: i
|
|
1104
|
+
})
|
|
1105
|
+
})
|
|
1106
|
+
]
|
|
1107
|
+
});
|
|
1108
|
+
}), Lt = K(({ goal: t }) => {
|
|
1109
|
+
const { goals: n } = R(), u = rt(), { backgroundColor: d, color: _, percentage: o, projectedText: m } = me(n, t), p = Math.round(o * 100);
|
|
1110
|
+
let s = /* @__PURE__ */ e(ke, {});
|
|
1111
|
+
return t.track_type === r.DEBT_TRACK ? s = /* @__PURE__ */ e(Ne, {}) : t.track_type === r.RETIREMENT_TRACK && (s = /* @__PURE__ */ e(we, {})), /* @__PURE__ */ c(g, {
|
|
1112
|
+
alignItems: "center",
|
|
1113
|
+
direction: "row",
|
|
1114
|
+
spacing: 12,
|
|
1115
|
+
sx: { py: 12 },
|
|
1116
|
+
children: [
|
|
1117
|
+
/* @__PURE__ */ e(te, {
|
|
1118
|
+
sx: {
|
|
1119
|
+
bgcolor: d,
|
|
1120
|
+
color: _,
|
|
1121
|
+
height: 32,
|
|
1122
|
+
width: 32
|
|
1123
|
+
},
|
|
1124
|
+
variant: "rounded",
|
|
1125
|
+
children: s
|
|
1126
|
+
}),
|
|
1127
|
+
/* @__PURE__ */ c(st, {
|
|
1128
|
+
sx: { width: "100%" },
|
|
1129
|
+
children: [/* @__PURE__ */ e(Ie, {
|
|
1130
|
+
fontSize: 15,
|
|
1131
|
+
fontWeight: 600,
|
|
1132
|
+
variant: "body1",
|
|
1133
|
+
children: t.name
|
|
1134
|
+
}), t.projected_to_complete_at && /* @__PURE__ */ e(C, {
|
|
1135
|
+
color: "text.secondary",
|
|
1136
|
+
variant: "caption",
|
|
1137
|
+
children: m
|
|
1138
|
+
})]
|
|
1139
|
+
}),
|
|
1140
|
+
/* @__PURE__ */ e(He, {
|
|
1015
1141
|
backgroundStrokeColor: u.palette.neutral.light,
|
|
1016
1142
|
color: u.palette.primary.main,
|
|
1017
1143
|
percent: p,
|
|
1018
1144
|
size: 40,
|
|
1019
1145
|
strokeWidth: 3,
|
|
1020
|
-
children: /* @__PURE__ */ e(Y, {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
})
|
|
1025
|
-
|
|
1026
|
-
{
|
|
1027
|
-
sx: {
|
|
1028
|
-
alignItems: "center",
|
|
1029
|
-
alignSelf: "center",
|
|
1030
|
-
px: 24,
|
|
1031
|
-
...u
|
|
1032
|
-
},
|
|
1033
|
-
children: [
|
|
1034
|
-
/* @__PURE__ */ e(Je, { size: 32 }),
|
|
1035
|
-
/* @__PURE__ */ e(Te, { fontSize: 15, fontWeight: 600, children: t }),
|
|
1036
|
-
/* @__PURE__ */ e(
|
|
1037
|
-
Y,
|
|
1038
|
-
{
|
|
1039
|
-
color: "text.secondary",
|
|
1040
|
-
sx: { fontWeight: 400, maxWidth: { sm: 424 }, textAlign: "center" },
|
|
1041
|
-
variant: "subtitle2",
|
|
1042
|
-
children: n
|
|
1043
|
-
}
|
|
1044
|
-
)
|
|
1146
|
+
children: /* @__PURE__ */ e(Y, {
|
|
1147
|
+
fontWeight: 700,
|
|
1148
|
+
variant: "caption",
|
|
1149
|
+
children: `${p}%`
|
|
1150
|
+
})
|
|
1151
|
+
})
|
|
1045
1152
|
]
|
|
1046
|
-
}
|
|
1047
|
-
),
|
|
1048
|
-
|
|
1049
|
-
|
|
1153
|
+
});
|
|
1154
|
+
}), Ot = ({ header: t, subText: n, sx: u }) => /* @__PURE__ */ c(g, {
|
|
1155
|
+
sx: {
|
|
1156
|
+
alignItems: "center",
|
|
1157
|
+
alignSelf: "center",
|
|
1158
|
+
px: 24,
|
|
1159
|
+
...u
|
|
1160
|
+
},
|
|
1161
|
+
children: [
|
|
1162
|
+
/* @__PURE__ */ e(ot, { size: 32 }),
|
|
1163
|
+
/* @__PURE__ */ e(Ie, {
|
|
1164
|
+
fontSize: 15,
|
|
1165
|
+
fontWeight: 600,
|
|
1166
|
+
children: t
|
|
1167
|
+
}),
|
|
1168
|
+
/* @__PURE__ */ e(Y, {
|
|
1169
|
+
color: "text.secondary",
|
|
1170
|
+
sx: {
|
|
1171
|
+
fontWeight: 400,
|
|
1172
|
+
maxWidth: { sm: 424 },
|
|
1173
|
+
textAlign: "center"
|
|
1174
|
+
},
|
|
1175
|
+
variant: "subtitle2",
|
|
1176
|
+
children: n
|
|
1177
|
+
})
|
|
1178
|
+
]
|
|
1179
|
+
}), In = K(({ onCTAClick: t }) => {
|
|
1180
|
+
const { isAccountDataLoaded: n, loadAccountData: u, visibleAccounts: d } = j(), { onEvent: _ } = Ee(), { goals: o } = R(), { isInitialized: m } = he(), { ongoingGoalsForMicroWidget: p, isAllGoalDataLoaded: s, loadGoalData: h } = N();
|
|
1181
|
+
Re({
|
|
1050
1182
|
widgetName: "GoalsMicroWidget",
|
|
1051
1183
|
isLoaded: s
|
|
1052
1184
|
}), T.useEffect(() => {
|
|
1053
1185
|
n || u().finally();
|
|
1054
1186
|
}, []), T.useEffect(() => {
|
|
1055
|
-
m && (h().finally(), _($.GOALS_LOAD_WIDGET, {
|
|
1056
|
-
state: d?.length ? "default" : "zeroState"
|
|
1057
|
-
}));
|
|
1187
|
+
m && (h().finally(), _($.GOALS_LOAD_WIDGET, { state: d?.length ? "default" : "zeroState" }));
|
|
1058
1188
|
}, [m]);
|
|
1059
|
-
const
|
|
1060
|
-
(
|
|
1061
|
-
[p, s]
|
|
1062
|
-
), o = () => {
|
|
1063
|
-
_(
|
|
1064
|
-
a ? $.GOALS_CLICK_GET_STARTED : $.GOALS_CLICK_VIEW_DETAILS
|
|
1065
|
-
), t();
|
|
1189
|
+
const i = T.useMemo(() => s && p.length === 0, [p, s]), a = () => {
|
|
1190
|
+
_(i ? $.GOALS_CLICK_GET_STARTED : $.GOALS_CLICK_VIEW_DETAILS), t();
|
|
1066
1191
|
};
|
|
1067
|
-
return !m || !s ? /* @__PURE__ */ e(
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
) : /* @__PURE__ */ e(f, { sx: { justifyContent: "space-between" }, children: p.map((b, l) => /* @__PURE__ */ c(T.Fragment, { children: [
|
|
1081
|
-
/* @__PURE__ */ e(Lt, { goal: b }),
|
|
1082
|
-
l !== p.length - 1 && /* @__PURE__ */ e(v, {})
|
|
1083
|
-
] }, b.guid)) })
|
|
1084
|
-
}
|
|
1085
|
-
);
|
|
1192
|
+
return !m || !s ? /* @__PURE__ */ e(Se, {}) : /* @__PURE__ */ e(Ye, {
|
|
1193
|
+
className: "mx-goals-microwidget",
|
|
1194
|
+
ctaLabel: i ? o.get_started : o.view_details,
|
|
1195
|
+
onCTAClick: a,
|
|
1196
|
+
title: o.title,
|
|
1197
|
+
children: i ? /* @__PURE__ */ e(Ot, {
|
|
1198
|
+
header: o.create_goals_header,
|
|
1199
|
+
subText: o.micro_zero_state_description
|
|
1200
|
+
}) : /* @__PURE__ */ e(g, {
|
|
1201
|
+
sx: { justifyContent: "space-between" },
|
|
1202
|
+
children: p.map((b, l) => /* @__PURE__ */ c(T.Fragment, { children: [/* @__PURE__ */ e(Lt, { goal: b }), l !== p.length - 1 && /* @__PURE__ */ e(E, {})] }, b.guid))
|
|
1203
|
+
})
|
|
1204
|
+
});
|
|
1086
1205
|
});
|
|
1087
1206
|
export {
|
|
1088
|
-
|
|
1089
|
-
|
|
1207
|
+
In as GoalsMicroWidget,
|
|
1208
|
+
Sn as GoalsWidget
|
|
1090
1209
|
};
|