@mx-cartographer/experiences 7.0.44-alpha.mega1 → 7.0.44

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