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