@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.mega1

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