@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
@@ -3,21 +3,21 @@ import { observer as m } from "mobx-react-lite";
3
3
  import e from "@mui/material/Stack";
4
4
  import { H3 as _, InstitutionLogo as x, Text as a, H2 as T } from "@mxenabled/mxui";
5
5
  import d from "react";
6
- import { G as N, d as f, m as D, f as w, u as E } from "./hooks-C41HAxM5.mjs";
7
- import { g as I } from "./AccountFields-Cl4KHoSj.mjs";
6
+ import { G as N, d as f, m as D, f as w, u as E } from "./hooks-ZMp65DFz.mjs";
7
+ import { g as I } from "./AccountFields-zCMqet85.mjs";
8
8
  import G from "@mui/material/Card";
9
9
  import v from "@mui/material/CardContent";
10
10
  import O from "@mui/material/CardHeader";
11
- import { L as H } from "./Loader-Ckqi9Rx6.mjs";
12
- import { f as M, a as P } from "./Dialog-CDV0kKxj.mjs";
13
- import { I as L, P as U, S as j } from "./Account-B4CDD-zq.mjs";
14
- import { u as z } from "./useAccountDisplayName-CcIp09Xc.mjs";
15
- import { f as Y } from "./NumberFormatting-DjTD0t3W.mjs";
11
+ import { L as H } from "./Loader-DUaFpDGv.mjs";
12
+ import { f as M, a as P } from "./Dialog-BPTr3qHE.mjs";
13
+ import { I as L, P as U, S as j } from "./Account-CvR2-dSR.mjs";
14
+ import { u as z } from "./useAccountDisplayName-B7iXTNM8.mjs";
15
+ import { f as B } from "./NumberFormatting-DjTD0t3W.mjs";
16
16
  const p = () => {
17
17
  if (!d.useContext(N))
18
18
  throw new Error("useCategoryUiStore() must be used within the GlobalDataContext");
19
19
  return f().uiStore;
20
- }, k = ({ sx: n, ChartComponent: s }) => {
20
+ }, Y = ({ sx: n, ChartComponent: s }) => {
21
21
  const { loadMonthlyCategoryTotals: c } = D(), { isInitialized: o } = w(), { selectedAccount: r } = p(), [l, u] = d.useState(!1);
22
22
  return d.useEffect(() => {
23
23
  o && c([r]).finally(() => {
@@ -44,17 +44,17 @@ const p = () => {
44
44
  ]
45
45
  }
46
46
  );
47
- }, B = m(k), R = ({
47
+ }, k = m(Y), R = ({
48
48
  customDetailsChart: n,
49
49
  ChartComponent: s
50
50
  }) => {
51
- const { institutions: c } = f(), { selectedAccount: o } = p(), { accounts: r } = E(), { firstSubtitle: l, firstValue: u, hasAvailableBalance: b, secondSubtitle: C, secondValue: h } = I(o, r), y = c.find(
52
- (g) => g.guid === o?.institution_guid
51
+ const { institutions: c } = f(), { selectedAccount: o } = p(), { accounts: r } = E(), { firstSubtitle: l, firstValue: u, hasAvailableBalance: C, secondSubtitle: h, secondValue: S } = I(o, r), b = c.find(
52
+ (y) => y.guid === o?.institution_guid
53
53
  ), A = [
54
54
  ...L,
55
55
  ...U,
56
56
  ...j
57
- ].includes(o.account_type), S = z(o);
57
+ ].includes(o.account_type), g = z(o);
58
58
  return /* @__PURE__ */ i(e, { bgcolor: "background.default", p: 24, children: [
59
59
  /* @__PURE__ */ i(e, { gap: 12, children: [
60
60
  /* @__PURE__ */ t(
@@ -65,20 +65,20 @@ const p = () => {
65
65
  size: 64
66
66
  }
67
67
  ),
68
- /* @__PURE__ */ t(a, { variant: "body2", children: y?.name })
68
+ /* @__PURE__ */ t(a, { variant: "Small", children: b?.name })
69
69
  ] }),
70
70
  /* @__PURE__ */ i(e, { gap: 8, mb: 24, mt: 4, children: [
71
- /* @__PURE__ */ t(T, { children: S }),
71
+ /* @__PURE__ */ t(T, { children: g }),
72
72
  /* @__PURE__ */ i(e, { direction: "row", justifyContent: "space-between", children: [
73
- /* @__PURE__ */ t(a, { bold: b, variant: "body1", children: l }),
74
- /* @__PURE__ */ t(a, { bold: !0, variant: "body1", children: Y(u, "0,0.00") })
73
+ /* @__PURE__ */ t(a, { bold: C, variant: "Body", children: l }),
74
+ /* @__PURE__ */ t(a, { bold: !0, variant: "Body", children: B(u, "0,0.00") })
75
75
  ] }),
76
76
  /* @__PURE__ */ i(e, { direction: "row", justifyContent: "space-between", children: [
77
- /* @__PURE__ */ t(a, { variant: "body2", children: C }),
78
- /* @__PURE__ */ t(a, { variant: "body2", children: h })
77
+ /* @__PURE__ */ t(a, { variant: "Small", children: h }),
78
+ /* @__PURE__ */ t(a, { variant: "Small", children: S })
79
79
  ] })
80
80
  ] }),
81
- A && /* @__PURE__ */ t(e, { children: n || /* @__PURE__ */ t(B, { ChartComponent: s }) })
81
+ A && /* @__PURE__ */ t(e, { children: n || /* @__PURE__ */ t(k, { ChartComponent: s }) })
82
82
  ] });
83
83
  }, rt = m(R);
84
84
  export {
@@ -1,10 +1,10 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
- import { Text as y, Icon as p } from "@mxenabled/mxui";
3
- import { F as m, A as d, a as v, P as h, b as F } from "./ConnectDrawer-DVp54lUH.mjs";
4
- import { i as T, u as A, a as D, b as g, c as O } from "./Accounts-CRUehOiy.mjs";
5
- import { f as _, a as N, i as b, b as C } from "./NumberFormatting-DjTD0t3W.mjs";
2
+ import { Icon as p, Text as y } from "@mxenabled/mxui";
3
+ import { F as m, A as d, a as v, P as h, b as F } from "./ConnectDrawer-BkvlItWx.mjs";
4
+ import { i as T, u as A, a as D, b as g, c as O } from "./Accounts-Bzy1_REQ.mjs";
5
+ import { f as _, i as b, a as N, b as S } from "./NumberFormatting-DjTD0t3W.mjs";
6
6
  import { b as i } from "./Localization-2MODESHW.mjs";
7
- import { f as o, a as f } from "./Dialog-CDV0kKxj.mjs";
7
+ import { f as o, a as f } from "./Dialog-BPTr3qHE.mjs";
8
8
  const w = (l, e) => {
9
9
  const r = [
10
10
  {
@@ -87,7 +87,7 @@ const w = (l, e) => {
87
87
  type: m.Date,
88
88
  valueFormatter: (a) => i(
89
89
  e.day_of_every_month,
90
- C(a <= 31 ? a : new Date(a).getDate())
90
+ S(a <= 31 ? a : new Date(a).getDate())
91
91
  )
92
92
  })), g(l) && r.push({
93
93
  label: e.credit_limit,
@@ -103,20 +103,18 @@ const w = (l, e) => {
103
103
  type: m.Currency,
104
104
  valueFormatter: (a) => _(a, "0,0.00")
105
105
  }), r;
106
- }, S = (l, e) => {
106
+ }, C = (l, e) => {
107
107
  let r = "", a = null, t = null, n = null, s = !1;
108
108
  switch (l.account_type) {
109
- // checking or savings
110
109
  case 1:
111
110
  case 2: {
112
111
  l.available_balance ? (r = e.available_balance, a = l.available_balance, t = l.available_balance ? e.current_balance : null, n = _(l.balance, "0,0.00"), s = !0) : (r = e.current_balance, a = l.balance);
113
112
  break;
114
113
  }
115
- // credit cards, loans, investments, etc
116
114
  default:
117
115
  if (r = e.current_balance, a = l.balance, l.minimum_payment && l.payment_due_at) {
118
116
  const c = typeof l.payment_due_at == "number" ? new Date(l.payment_due_at * 1e3) : l.payment_due_at;
119
- t = /* @__PURE__ */ u(y, { component: "strong", variant: "caption", children: i(
117
+ t = /* @__PURE__ */ u(y, { component: "strong", variant: "XSmall", children: i(
120
118
  e.payment_due_on,
121
119
  _(l.minimum_payment, "0,0.00"),
122
120
  o(c, f.FULL_MONTH_DAY)
@@ -131,11 +129,11 @@ const w = (l, e) => {
131
129
  hasAvailableBalance: s
132
130
  };
133
131
  }, x = (l, e) => l.reduce((a, t) => {
134
- const s = S(t, e).firstValue || 0;
132
+ const s = C(t, e).firstValue || 0;
135
133
  return a + s;
136
134
  }, 0);
137
135
  export {
138
136
  x as a,
139
137
  w as b,
140
- S as g
138
+ C as g
141
139
  };
@@ -0,0 +1,90 @@
1
+ import { jsx as e, jsxs as r, Fragment as l } from "react/jsx-runtime";
2
+ import { observer as b } from "mobx-react-lite";
3
+ import I from "@mui/material/Badge";
4
+ import m from "@mui/material/Box";
5
+ import S from "@mui/material/ListItem";
6
+ import v from "@mui/material/ListItemAvatar";
7
+ import _ from "@mui/material/ListItemButton";
8
+ import C from "@mui/material/ListItemText";
9
+ import B from "@mui/material/styles/useTheme";
10
+ import { InstitutionLogo as L, Text as o } from "@mxenabled/mxui";
11
+ import { Error as A } from "@mxenabled/mx-icons";
12
+ import { I as j } from "./IconBacking-B9oC6uL2.mjs";
13
+ import { g as T } from "./AccountFields-zCMqet85.mjs";
14
+ import { u as X } from "./useAccountDisplayName-B7iXTNM8.mjs";
15
+ import { d } from "./ConnectDrawer-BkvlItWx.mjs";
16
+ import { u as $ } from "./hooks-ZMp65DFz.mjs";
17
+ import { f as k } from "./NumberFormatting-DjTD0t3W.mjs";
18
+ const w = {
19
+ gridRow: 1,
20
+ gridColumn: 1,
21
+ zIndex: 2
22
+ }, E = ({ size: t = 20 }) => /* @__PURE__ */ e(j, { size: t, children: /* @__PURE__ */ e(A, { color: "error", filled: !0, sx: { fontSize: t, ...w } }) }), M = ({
23
+ account: t,
24
+ onRowClick: s,
25
+ listItemProps: c,
26
+ shouldShowConnectionStatus: p = !1
27
+ }) => {
28
+ const u = B(), f = X(t), { accounts: i } = $(), { firstSubtitle: h, firstValue: g, secondSubtitle: x, secondValue: y } = T(
29
+ t,
30
+ i
31
+ );
32
+ let n;
33
+ (t.connectionStatus === d.Error || t.connectionStatus === d.RequiresMfa) && (n = /* @__PURE__ */ e(E, { size: 16 }));
34
+ const a = /* @__PURE__ */ r(l, { children: [
35
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(
36
+ I,
37
+ {
38
+ badgeContent: p ? n : void 0,
39
+ sx: {
40
+ "& .MuiBadge-badge": {
41
+ right: -1
42
+ }
43
+ },
44
+ children: /* @__PURE__ */ e(L, { alt: "MX", institutionGuid: t.institution_guid || "" })
45
+ }
46
+ ) }),
47
+ /* @__PURE__ */ e(
48
+ C,
49
+ {
50
+ disableTypography: !0,
51
+ primary: /* @__PURE__ */ r(
52
+ o,
53
+ {
54
+ bold: !0,
55
+ color: t.is_hidden ? u.palette.text.secondary : void 0,
56
+ sx: { whiteSpace: "normal" },
57
+ variant: "Body",
58
+ children: [
59
+ `${f} ${t.account_number ? `*${t.account_number}` : ""}`,
60
+ " ",
61
+ t.is_hidden && !t.is_closed && i.is_hidden,
62
+ t.is_closed && i.is_closed
63
+ ]
64
+ }
65
+ ),
66
+ secondary: /* @__PURE__ */ r(l, { children: [
67
+ /* @__PURE__ */ r(m, { sx: { alignItems: "center", display: "flex", justifyContent: "space-between" }, children: [
68
+ /* @__PURE__ */ e(o, { variant: "XSmall", children: h }),
69
+ /* @__PURE__ */ e(o, { bold: !0, variant: "Small", children: k(g, "0,0.00") })
70
+ ] }),
71
+ /* @__PURE__ */ r(m, { sx: { alignItems: "center", display: "flex", justifyContent: "space-between" }, children: [
72
+ /* @__PURE__ */ e(o, { variant: "XSmall", children: x }),
73
+ /* @__PURE__ */ e(o, { ml: "auto", variant: "XSmall", children: y })
74
+ ] })
75
+ ] })
76
+ }
77
+ )
78
+ ] });
79
+ return /* @__PURE__ */ e(
80
+ S,
81
+ {
82
+ sx: { backgroundColor: "background.paper", color: t.is_closed ? "grey.700" : "" },
83
+ ...c,
84
+ children: s ? /* @__PURE__ */ e(_, { alignItems: "flex-start", onClick: s, sx: { px: 24 }, children: a }) : a
85
+ }
86
+ );
87
+ }, Z = b(M);
88
+ export {
89
+ Z as A
90
+ };
@@ -1,12 +1,11 @@
1
- import { makeAutoObservable as l, runInAction as a } from "mobx";
2
- import { i as A } from "./User-BklmOUSd.mjs";
3
- import { F as g, A as i } from "./Fetch-DecPFeGU.mjs";
4
- import { d as m } from "./Accounts-CRUehOiy.mjs";
5
- import { A as c, j as u } from "./ConnectDrawer-DVp54lUH.mjs";
6
- class d {
1
+ import { makeAutoObservable as _, runInAction as a } from "mobx";
2
+ import { i as f } from "./User-Cnlegl1N.mjs";
3
+ import { F as p, A as i } from "./Fetch-DecPFeGU.mjs";
4
+ import { A as c, h as d, d as h, E as y, i as I, j as b } from "./ConnectDrawer-BkvlItWx.mjs";
5
+ class A {
7
6
  fetchInstance;
8
- constructor(t, e, s) {
9
- this.fetchInstance = new g(t, e, void 0, s);
7
+ constructor(t, e, n) {
8
+ this.fetchInstance = new p(t, e, void 0, n);
10
9
  }
11
10
  createAccount = async (t) => this.fetchInstance.post(i.ACCOUNTS, t).then((e) => e.account).catch((e) => e);
12
11
  deleteAccount = async (t) => this.fetchInstance.delete(`${i.ACCOUNTS}/${t}`).catch((e) => e);
@@ -18,42 +17,35 @@ class d {
18
17
  refreshAllMembers = async () => this.fetchInstance.get(`${i.MEMBERS}/refresh_all`).then((t) => t).catch((t) => t);
19
18
  updateAccount = async (t) => this.fetchInstance.put(`${i.ACCOUNTS}/${t.guid}`, t).then((e) => e.account).catch((e) => e);
20
19
  }
21
- class p {
20
+ class C {
22
21
  isLoading = !1;
23
22
  selectedAccount = {};
24
23
  selectedMember = {};
25
24
  constructor() {
26
- l(this);
25
+ _(this);
27
26
  }
28
27
  setIsLoading = (t) => this.isLoading = t;
29
28
  setSelectedAccount = (t) => this.selectedAccount = t;
30
29
  setSelectedMember = (t) => this.selectedMember = t;
31
30
  }
32
- class E {
31
+ class w {
33
32
  globalStore;
34
- api = new d("/", "");
33
+ api = new A("/", "");
35
34
  accounts = [];
36
- accountsLoaded = !1;
37
35
  institutions = [];
38
- institutionsLoaded = !1;
39
36
  members = [];
40
- membersLoaded = !1;
41
37
  uiStore;
42
38
  constructor(t) {
43
- this.globalStore = t, this.uiStore = new p(), this.api = new d(t.endpoint, t.sessionToken, t.onError), l(this);
39
+ this.globalStore = t, this.uiStore = new C(), this.api = new A(t.endpoint, t.sessionToken, t.onError), _(this);
44
40
  }
45
- loadAccountData = async () => {
46
- await Promise.all([this.loadAccounts(), this.loadMembers(), this.loadInstitutions()]);
41
+ loadAccountData = async ({
42
+ accounts: t,
43
+ institutions: e
44
+ } = {}) => {
45
+ await Promise.all([this.loadAccounts(t), this.loadInstitutions(e)]);
47
46
  };
48
- get isAccountDataLoaded() {
49
- return this.accountsLoaded && this.membersLoaded && this.institutionsLoaded;
50
- }
51
- get detailedAccounts() {
52
- const t = this.globalStore.userStore.userFeatures, e = A(t, "MD_EXCLUDE_EXTERNAL_ACCOUNTS");
53
- return m(this.accounts, this.institutions, this.members, e);
54
- }
55
47
  get cashAccounts() {
56
- return this.detailedAccounts.filter(
48
+ return this.accounts.filter(
57
49
  (t) => t.account_type === c.CASH || t.account_type === c.CHECKING || t.account_type === c.PREPAID || t.account_type === c.SAVINGS || t.account_type === c.CHECKING_LINE_OF_CREDIT
58
50
  );
59
51
  }
@@ -61,10 +53,10 @@ class E {
61
53
  return this.cashAccounts.reduce((t, e) => t + (e?.balance || 0), 0);
62
54
  }
63
55
  get checkingAccounts() {
64
- return this.detailedAccounts.filter((t) => t.account_type === c.CHECKING);
56
+ return this.accounts.filter((t) => t.account_type === c.CHECKING);
65
57
  }
66
58
  get debtAccounts() {
67
- return this.detailedAccounts.filter(
59
+ return this.accounts.filter(
68
60
  (t) => t.account_type === c.CREDIT_CARD || t.account_type === c.LOAN || t.account_type === c.MORTGAGE || t.account_type === c.LINE_OF_CREDIT || t.account_type === c.CHECKING_LINE_OF_CREDIT
69
61
  );
70
62
  }
@@ -75,23 +67,23 @@ class E {
75
67
  c.CREDIT_CARD,
76
68
  c.INVESTMENT
77
69
  ]);
78
- return this.detailedAccounts.filter((e) => t.has(e.account_type));
70
+ return this.accounts.filter((e) => t.has(e.account_type));
79
71
  }
80
72
  get investmentAccounts() {
81
- return this.detailedAccounts.filter(
73
+ return this.accounts.filter(
82
74
  (t) => t.account_type === c.INVESTMENT
83
75
  );
84
76
  }
85
77
  get savingsAccounts() {
86
- return this.detailedAccounts.filter((t) => t.account_type === c.SAVINGS);
78
+ return this.accounts.filter((t) => t.account_type === c.SAVINGS);
87
79
  }
88
80
  get retirementAccounts() {
89
- return this.detailedAccounts.filter(
90
- (t) => t.account_type === c.INVESTMENT || t.account_type === c.SAVINGS || t.account_type === c.CHECKING || t.account_type === c.CASH || t.account_type === c.PROPERTY || t.account_type === c.INSURANCE && (t.account_subtype === u.WHOLE_LIFE || t.account_subtype === u.UNIVERSAL_LIFE || t.account_subtype === u.VARIABLE_UNIVERSAL_LIFE)
81
+ return this.accounts.filter(
82
+ (t) => t.account_type === c.INVESTMENT || t.account_type === c.SAVINGS || t.account_type === c.CHECKING || t.account_type === c.CASH || t.account_type === c.PROPERTY || t.account_type === c.INSURANCE && (t.account_subtype === d.WHOLE_LIFE || t.account_subtype === d.UNIVERSAL_LIFE || t.account_subtype === d.VARIABLE_UNIVERSAL_LIFE)
91
83
  );
92
84
  }
93
85
  get visibleAccounts() {
94
- return this.detailedAccounts.filter((t) => !t.is_hidden);
86
+ return this.accounts.filter((t) => !t.is_hidden);
95
87
  }
96
88
  get visibleCashAccounts() {
97
89
  return this.cashAccounts.filter((t) => !t.is_hidden);
@@ -121,7 +113,7 @@ class E {
121
113
  }
122
114
  get savingsAndCheckingAccountsBalance() {
123
115
  return this.savingsAndCheckingAccounts.reduce(
124
- (e, s) => e + (s?.balance || 0),
116
+ (e, n) => e + (n?.balance || 0),
125
117
  0
126
118
  );
127
119
  }
@@ -130,15 +122,6 @@ class E {
130
122
  (e) => e.account_type === c.SAVINGS || e.account_type === c.CHECKING
131
123
  );
132
124
  }
133
- setAccounts = (t) => {
134
- this.accounts = t, this.accountsLoaded = !0;
135
- };
136
- setMembers = (t) => {
137
- this.members = t, this.membersLoaded = !0;
138
- };
139
- setInstitutions = (t) => {
140
- this.institutions = t, this.institutionsLoaded = !0;
141
- };
142
125
  addAccount = async (t) => {
143
126
  try {
144
127
  const e = await this.api.createAccount(t);
@@ -149,45 +132,77 @@ class E {
149
132
  console.error(`Error occurred while adding an account: ${e}`);
150
133
  }
151
134
  };
152
- loadAccounts = async () => {
135
+ augmentAccounts = (t = this.accounts) => {
136
+ const e = [], n = this.globalStore.userStore.userFeatures, s = f(
137
+ n,
138
+ "MD_EXCLUDE_EXTERNAL_ACCOUNTS"
139
+ );
140
+ for (const o of t) {
141
+ if (s && o.member_is_managed_by_user) continue;
142
+ const r = this.members.find((m) => m.guid === o.member_guid);
143
+ if (!r) continue;
144
+ let u = h.Connected;
145
+ y.includes(r.connection_status) ? u = h.Error : I.includes(r.connection_status) ? u = h.Processing : b.includes(r.connection_status) && (u = h.RequiresMfa);
146
+ const g = [
147
+ o.user_name || o.feed_name || "",
148
+ o.account_number ? `*${o.account_number}` : ""
149
+ ].join(" ").trim();
150
+ e.push({
151
+ ...o,
152
+ connectionStatus: u,
153
+ institutionName: g,
154
+ memberName: r.name
155
+ }), r.connectionStatus = u;
156
+ }
157
+ return e;
158
+ };
159
+ loadAccounts = async (t) => {
160
+ await this.loadMembers();
153
161
  try {
154
- const t = await this.api.getAccounts();
155
- this.setAccounts(t);
156
- } catch (t) {
157
- console.error(`Error occurred while loading accounts: ${t}`);
162
+ const e = t || await this.api.getAccounts();
163
+ a(() => {
164
+ this.accounts = this.sortAccounts(this.augmentAccounts(e));
165
+ });
166
+ } catch (e) {
167
+ console.error(`Error occurred while loading accounts: ${e}`);
158
168
  }
159
169
  };
160
- loadInstitutions = async () => {
170
+ loadInstitutions = async (t) => {
161
171
  try {
162
- const t = await this.api.getInstitutions();
163
- this.setInstitutions(t);
164
- } catch (t) {
165
- console.error(`Error occurred while loading institutions: ${t}`);
172
+ const e = t || await this.api.getInstitutions();
173
+ a(() => {
174
+ this.institutions = e;
175
+ });
176
+ } catch (e) {
177
+ console.error(`Error occurred while loading institutions: ${e}`);
166
178
  }
167
179
  };
168
180
  loadMembers = async () => {
169
181
  try {
170
182
  const t = await this.api.getMembers();
171
- this.setMembers(t);
183
+ a(() => {
184
+ this.members = t;
185
+ });
172
186
  } catch (t) {
173
187
  console.error(`Error occurred while loading members: ${t}`);
174
188
  }
175
189
  };
176
190
  mergeAccounts = async (t) => {
177
191
  try {
178
- const e = await this.api.mergeAccounts(t), s = e[Object.keys(e)[0]];
192
+ const e = await this.api.mergeAccounts(t), n = e[Object.keys(e)[0]];
179
193
  a(() => {
180
- const n = this.accounts.findIndex((r) => r.guid === t[1]);
181
- this.accounts.splice(n, 1);
194
+ const s = this.accounts.findIndex((r) => r.guid === t[1]);
195
+ this.accounts.splice(s, 1);
182
196
  const o = this.accounts.findIndex((r) => r.guid === t[0]);
183
- this.accounts.splice(o, 1, s);
197
+ this.accounts.splice(o, 1, n);
184
198
  });
185
199
  } catch (e) {
186
200
  console.error(`Error occurred while merging accounts: ${e}`);
187
201
  }
188
202
  };
203
+ sortAccounts = (t = this.accounts) => t.sort((e, n) => e.account_type > n.account_type ? 1 : e.account_type < n.account_type ? -1 : (e.name || "") > (n.name || "") ? 1 : (e.name || "") < (n.name || "") ? -1 : 0);
189
204
  refreshAccounts = async () => {
190
- this.uiStore.setIsLoading(!0), await Promise.all([this.loadAccounts(), this.loadInstitutions(), this.loadMembers()]), this.uiStore.setIsLoading(!1);
205
+ this.uiStore.setIsLoading(!0), await Promise.all([this.loadAccounts(), this.loadInstitutions()]), this.uiStore.setIsLoading(!1);
191
206
  };
192
207
  refreshMembers = async () => {
193
208
  try {
@@ -198,37 +213,48 @@ class E {
198
213
  };
199
214
  removeAccount = async (t) => {
200
215
  try {
201
- await this.api.deleteAccount(t);
202
- const e = this.accounts.findIndex((s) => s.guid === t);
203
- this.accounts.splice(e, 1);
216
+ await this.api.deleteAccount(t), a(() => {
217
+ const e = this.accounts.findIndex((n) => n.guid === t);
218
+ this.accounts.splice(e, 1);
219
+ });
204
220
  } catch (e) {
205
221
  console.error(`Error occurred while removing an account: ${e}`);
206
222
  }
207
223
  };
208
224
  updateAccount = async (t) => {
209
225
  try {
210
- const e = await this.api.updateAccount(t), s = this.accounts.findIndex(
211
- (n) => n.guid === e.guid
212
- );
213
- this.accounts.splice(s, 1, e);
226
+ const e = await this.api.updateAccount(t);
227
+ a(() => {
228
+ const n = this.accounts.findIndex(
229
+ (s) => s.guid === e.guid
230
+ );
231
+ this.accounts.splice(n, 1, e), this.accounts = this.augmentAccounts(this.accounts);
232
+ });
214
233
  } catch (e) {
215
234
  console.error(`Error occurred while updating account: ${e}`);
216
235
  }
217
236
  };
218
237
  updateAccountBalance = (t, e) => {
219
- const s = this.accounts.find((n) => n.guid === t);
220
- s && a(() => {
221
- s.balance = (s.balance || 0) + e;
238
+ const n = this.accounts.find((s) => s.guid === t);
239
+ n && a(() => {
240
+ n.balance = (n.balance || 0) + e;
222
241
  });
223
242
  };
224
243
  updateAccountFiltering = async (t, e) => {
225
- for (const s of t) {
226
- const n = this.accounts.find((o) => o.guid === s);
227
- n && (n.is_excluded_from_accounts = e, await this.updateAccount(n));
244
+ for (const n of t) {
245
+ const s = this.accounts.find((o) => o.guid === n);
246
+ if (s) {
247
+ s.is_excluded_from_accounts = e, s.is_excluded_from_budgets = e, s.is_excluded_from_cash_flow = e, s.is_excluded_from_debts = e, s.is_excluded_from_goals = e, s.is_excluded_from_investments = e, s.is_excluded_from_net_worth = e, s.is_excluded_from_spending = e, s.is_excluded_from_transactions = e, s.is_excluded_from_trends = e;
248
+ try {
249
+ this.updateAccount(s);
250
+ } catch (o) {
251
+ console.error(`Failed to update account ${n} (added):`, o);
252
+ }
253
+ }
228
254
  }
229
255
  };
230
256
  }
231
257
  export {
232
- d as A,
233
- E as a
258
+ A,
259
+ w as a
234
260
  };
@@ -0,0 +1,9 @@
1
+ import { A as _ } from "./ConnectDrawer-BkvlItWx.mjs";
2
+ const s = (t) => t && (t.account_type === _.CREDIT_CARD || t.account_type === _.LOAN || t.account_type === _.MORTGAGE || t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CHECKING_LINE_OF_CREDIT), p = (t) => t.is_manual || !t.guid, E = (t) => t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CREDIT_CARD || t.account_type === _.CHECKING_LINE_OF_CREDIT, a = (t) => t.account_type === _.SAVINGS || t.account_type === _.CHECKING || t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CREDIT_CARD || t.account_type === _.LOAN || t.account_type === _.MORTGAGE, y = (t) => t.account_type === _.LOAN || t.account_type === _.MORTGAGE;
3
+ export {
4
+ s as a,
5
+ E as b,
6
+ y as c,
7
+ p as i,
8
+ a as u
9
+ };
@@ -1,58 +1,58 @@
1
- import { i as _ } from "./hooks-C41HAxM5.mjs";
2
- import { b as d } from "./Category-Ccoew_sA.mjs";
1
+ import { i as _ } from "./hooks-ZMp65DFz.mjs";
2
+ import { b as d } from "./Category-CevNQ03n.mjs";
3
3
  import { b as f } from "./Localization-2MODESHW.mjs";
4
4
  import { f as l } from "./NumberFormatting-DjTD0t3W.mjs";
5
5
  const p = (n, e) => n.find((t) => t.guid === e), B = (n, e) => n.find((t) => t.guid === e), T = (n, e) => {
6
- const t = n.find((o) => o.subCategories.find((a) => a.guid === e));
6
+ const t = n.find((r) => r.subCategories.find((a) => a.guid === e));
7
7
  if (t)
8
- return t.subCategories.find((o) => o.guid === e);
8
+ return t.subCategories.find((r) => r.guid === e);
9
9
  }, k = (n, e) => {
10
10
  const t = [];
11
- for (const o of e) {
12
- const a = p(n, o.category_guid);
11
+ for (const r of e) {
12
+ const a = p(n, r.category_guid);
13
13
  if (!a) continue;
14
- const r = a.parent_guid ?? a.guid, s = p(n, r);
14
+ const o = a.parent_guid ?? a.guid, s = p(n, o);
15
15
  if (!s) continue;
16
16
  const u = {
17
- amount: o.total,
17
+ amount: r.total,
18
18
  category: a,
19
19
  guid: a.guid,
20
20
  subCategoryTotals: []
21
- }, i = t.find((g) => g.guid === r);
22
- i ? (i.amount += o.total, i.subCategoryTotals.push(u)) : t.push({
23
- amount: o.total,
21
+ }, i = t.find((g) => g.guid === o);
22
+ i ? (i.amount += r.total, i.subCategoryTotals.push(u)) : t.push({
23
+ amount: r.total,
24
24
  category: s,
25
- guid: r,
25
+ guid: o,
26
26
  subCategoryTotals: [u]
27
27
  });
28
28
  }
29
29
  return t;
30
30
  }, w = (n, e) => {
31
- const t = n.find((o) => o.guid === e);
31
+ const t = n.find((r) => r.guid === e);
32
32
  return t ? t.guid === d.INCOME || t.parent_guid === d.INCOME : !1;
33
33
  }, y = (n, e) => !n && !e ? 0 : !n && e ? 101 : e / n * 100, b = (n, e) => {
34
34
  const t = {
35
35
  background: e.palette.success.main,
36
36
  description: n <= 100 ? e.palette.text.secondary : e.palette.error.main,
37
37
  text: e.palette.common.white,
38
- mercury: e.palette.success.light
38
+ mercury: e.palette.success.lighter
39
39
  };
40
- return n > 100 ? (t.background = e.palette.error.main, t.mercury = e.palette.error.light) : n > 80 && (t.background = e.palette.warning.main, t.text = e.palette.grey[900], t.mercury = e.palette.warning.light), t;
40
+ return n > 100 ? (t.background = e.palette.error.main, t.mercury = e.palette.error.lighter) : n > 80 && (t.background = e.palette.warning.main, t.text = e.palette.grey[900], t.mercury = e.palette.warning.lighter), t;
41
41
  }, G = () => {
42
42
  const { detailedBudgets: n } = _();
43
43
  return n.map((t) => {
44
- const o = t.transaction_total;
45
- return t.amount - o;
46
- }).reduce((t, o) => t + o, 0);
47
- }, I = (n, e, t, o) => {
44
+ const r = t.transaction_total;
45
+ return t.amount - r;
46
+ }).reduce((t, r) => t + r, 0);
47
+ }, I = (n, e, t, r) => {
48
48
  const a = [];
49
- for (const r of n) {
50
- const s = B(e, r.category_guid);
49
+ for (const o of n) {
50
+ const s = B(e, o.category_guid);
51
51
  if (!s) continue;
52
- const u = s.totalAmount, i = y(r.amount, u), g = r.amount - u;
52
+ const u = s.totalAmount, i = y(o.amount, u), g = o.amount - u;
53
53
  a.push({
54
- ...r,
55
- budgetColors: b(i, o),
54
+ ...o,
55
+ budgetColors: b(i, r),
56
56
  category: s,
57
57
  description: f(
58
58
  g < 0 ? t.budget_remaining_over : t.budget_remaining_left,
@@ -63,15 +63,15 @@ const p = (n, e) => n.find((t) => t.guid === e), B = (n, e) => n.find((t) => t.g
63
63
  transaction_total: u
64
64
  });
65
65
  }
66
- for (const r of n) {
67
- const s = T(e, r.category_guid);
66
+ for (const o of n) {
67
+ const s = T(e, o.category_guid);
68
68
  if (!s) continue;
69
69
  const u = s.currentAmount, i = a.find((C) => C.category_guid === s.parent_guid);
70
70
  if (!i) continue;
71
- const g = r.amount - u, c = y(r.amount, u);
71
+ const g = o.amount - u, c = y(o.amount, u);
72
72
  i && i.subBudgets.push({
73
- ...r,
74
- budgetColors: b(c, o),
73
+ ...o,
74
+ budgetColors: b(c, r),
75
75
  category: s,
76
76
  description: f(
77
77
  g < 0 ? t.budget_remaining_over : t.budget_remaining_left,
@@ -84,9 +84,9 @@ const p = (n, e) => n.find((t) => t.guid === e), B = (n, e) => n.find((t) => t.g
84
84
  }
85
85
  return a;
86
86
  }, m = (n, e) => n.find((t) => t.guid === e), S = (n, e, t) => {
87
- const o = m(n, t);
88
- if (o)
89
- return m(o.subBudgets, e);
87
+ const r = m(n, t);
88
+ if (r)
89
+ return m(r.subBudgets, e);
90
90
  };
91
91
  export {
92
92
  S as a,