@mx-cartographer/experiences 7.8.2-alpha.bb6 → 7.8.2-alpha.mm0

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