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