@mx-cartographer/experiences 7.7.2 → 7.8.0-alpha-ram-goal-bug

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 (92) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/Account-BiB1F8lL.mjs +118 -0
  3. package/dist/{Account-BfkKlfsW.mjs → Account-DuOz1a27.mjs} +1 -1
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/{AccountDetailsHeader-DqYIuhOs.mjs → AccountDetailsHeader-Cf2TUJnM.mjs} +4 -4
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-yP8QdgPd.mjs → AccountFields-UdOvbQ5H.mjs} +7 -6
  8. package/dist/{AccountListItem-DMbu9ehd.mjs → AccountListItem-BPVxmNT_.mjs} +7 -7
  9. package/dist/AccountStore-BbPWe2C9.mjs +244 -0
  10. package/dist/Accounts-M-LTzStv.mjs +27 -0
  11. package/dist/{CategoryStore-Cnw9yUys.mjs → CategoryStore-BYICdb9m.mjs} +73 -73
  12. package/dist/CategoryUtil-meuejJqP.mjs +80 -0
  13. package/dist/{ConnectionsDrawer-BqR6FWJO.mjs → ConnectionsDrawer-BDpVTTSe.mjs} +1 -1
  14. package/dist/{DebtsStore-DuSdXM1k.mjs → DebtsStore-BIbOVCPe.mjs} +12 -12
  15. package/dist/{ExportCsvAction-HK5CeZWR.mjs → ExportCsvAction-CDuzTva1.mjs} +2 -2
  16. package/dist/GlobalAccountFilter-DQCPNc95.mjs +316 -0
  17. package/dist/GoalStore-B4LVt_kH.mjs +422 -0
  18. package/dist/{ManageIncome-BrTrlplL.mjs → ManageIncome-CL3hv8i9.mjs} +44 -44
  19. package/dist/NetWorthStore-yV43kJro.mjs +168 -0
  20. package/dist/{NotificationSettings-D4Vh3z8I.mjs → NotificationSettings-SPg3pwbX.mjs} +171 -169
  21. package/dist/{NotificationStore-CDX_kqHa.mjs → NotificationStore-Ck2KdNmT.mjs} +22 -14
  22. package/dist/{RecurringSettings-D2V6l77l.mjs → RecurringSettings-Bmnnpb48.mjs} +16 -16
  23. package/dist/{RecurringTransactionsStore-Caf1cq4v.mjs → RecurringTransactionsStore-BQBEJOPP.mjs} +91 -81
  24. package/dist/{RecurringTransactions-Bf4lX0Cn.mjs → RepeatingTransaction-miZVnk_A.mjs} +4 -4
  25. package/dist/{SettingsStore-krIRNwHK.mjs → SettingsStore-BHpuyujx.mjs} +1 -1
  26. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  27. package/dist/{SpendingLegend-gTCJLLkV.mjs → SpendingLegend-CD60HCYS.mjs} +33 -33
  28. package/dist/{TransactionDetails-7MHOshKQ.mjs → TransactionDetails-BDhz3DLT.mjs} +2 -2
  29. package/dist/TransactionStore-BSp5bOKg.mjs +705 -0
  30. package/dist/{User-LJpEwPtn.mjs → User-B0LnmiKO.mjs} +21 -20
  31. package/dist/WidgetContainer-BbPS3Yxz.mjs +555 -0
  32. package/dist/accounts/index.es.js +421 -391
  33. package/dist/accounts/stores/AccountStore.d.ts +30 -23
  34. package/dist/accounts/utils/Accounts.d.ts +2 -1
  35. package/dist/budgets/index.es.js +546 -540
  36. package/dist/budgets/store/BudgetsStore.d.ts +1 -0
  37. package/dist/cashflow/index.es.js +444 -457
  38. package/dist/categories/index.es.js +1 -1
  39. package/dist/categories/stores/CategoryStore.d.ts +10 -5
  40. package/dist/categories/util/CategoryUtil.d.ts +3 -2
  41. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  42. package/dist/common/components/SkeletonLoader.d.ts +7 -0
  43. package/dist/common/components/WidgetContainer.d.ts +7 -6
  44. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  45. package/dist/common/components/index.d.ts +2 -2
  46. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  47. package/dist/common/index.es.js +459 -445
  48. package/dist/common/stores/AppDataStore.d.ts +3 -1
  49. package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
  50. package/dist/common/stores/GlobalStore.d.ts +3 -3
  51. package/dist/common/stores/GlobalUiStore.d.ts +10 -6
  52. package/dist/common/stores/UserStore.d.ts +3 -2
  53. package/dist/common/types/Account.d.ts +9 -6
  54. package/dist/dashboard/index.es.js +84 -116
  55. package/dist/debts/index.es.js +417 -413
  56. package/dist/{exportTransactionsToCSV-BrTYdSgJ.mjs → exportTransactionsToCSV-DtQ7ovAR.mjs} +1 -1
  57. package/dist/finstrong/index.es.js +1167 -1110
  58. package/dist/goals/index.es.js +618 -598
  59. package/dist/goals/stores/GoalStore.d.ts +19 -4
  60. package/dist/help/index.es.js +13 -13
  61. package/dist/investments/index.es.js +330 -325
  62. package/dist/investments/stores/HoldingStore.d.ts +1 -0
  63. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  64. package/dist/networth/components/NetWorthList.d.ts +3 -3
  65. package/dist/networth/index.es.js +423 -433
  66. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  67. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  68. package/dist/notifications/index.es.js +90 -91
  69. package/dist/notifications/stores/NotificationStore.d.ts +3 -1
  70. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  71. package/dist/recurringtransactions/index.es.js +543 -562
  72. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +4 -2
  73. package/dist/settings/index.es.js +253 -248
  74. package/dist/spending/index.es.js +282 -301
  75. package/dist/transactions/index.es.js +269 -263
  76. package/dist/transactions/stores/TransactionStore.d.ts +26 -77
  77. package/dist/transactions/stores/UiStore.d.ts +0 -2
  78. package/dist/trends/index.es.js +708 -699
  79. package/dist/{useAccountDisplayName-BTvP_pw6.mjs → useAccountDisplayName-Bot2tb4n.mjs} +1 -1
  80. package/package.json +3 -3
  81. package/dist/AccountStore-CWFzg8-E.mjs +0 -260
  82. package/dist/Accounts-CWt-NRq8.mjs +0 -9
  83. package/dist/CategoryUtil-DZflYFam.mjs +0 -78
  84. package/dist/ConnectDrawer-BOjfI6rz.mjs +0 -563
  85. package/dist/GoalStore-C7ahxxLi.mjs +0 -364
  86. package/dist/NetWorthStore-xWIo9CYU.mjs +0 -150
  87. package/dist/TransactionStore-DJwPaZuM.mjs +0 -677
  88. package/dist/WidgetContainer-CrK6tyHr.mjs +0 -572
  89. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  90. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  91. package/dist/common/components/accountfilter/index.d.ts +0 -1
  92. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,12 +1,12 @@
1
- import { makeAutoObservable as C, runInAction as l } from "mobx";
2
- import { getUnixTime as r } from "date-fns/getUnixTime";
3
- import { subMonths as h } from "date-fns/subMonths";
4
- import { startOfMonth as d } from "date-fns/startOfMonth";
5
- import { endOfMonth as y } from "date-fns/endOfMonth";
6
- import { a as m, g as p } from "./CategoryUtil-DZflYFam.mjs";
1
+ import { makeAutoObservable as y } from "mobx";
2
+ import { getUnixTime as n } from "date-fns/getUnixTime";
3
+ import { subMonths as c } from "date-fns/subMonths";
4
+ import { startOfMonth as C } from "date-fns/startOfMonth";
5
+ import { endOfMonth as h } from "date-fns/endOfMonth";
6
+ import { a as T, g as m } from "./CategoryUtil-meuejJqP.mjs";
7
7
  import { F as f, A as i } from "./Fetch-DecPFeGU.mjs";
8
- import { b as g, c as S } from "./Category-CevNQ03n.mjs";
9
- class u {
8
+ import { b as l, c as p } from "./Category-CevNQ03n.mjs";
9
+ class d {
10
10
  fetchInstance;
11
11
  constructor(t, e, o) {
12
12
  this.fetchInstance = new f(t, e, void 0, o);
@@ -20,8 +20,8 @@ class u {
20
20
  try {
21
21
  const a = `${i.MONTHLY_CATEGORY_TOTALS}/from/${t}/to/${e}`;
22
22
  if (o) {
23
- const s = o.length === 0 ? [""] : o.map((T) => T.guid);
24
- return (await this.fetchInstance.post(a, { account_guid: s })).monthly_category_totals;
23
+ const r = o.length === 0 ? [""] : o.map((u) => u.guid);
24
+ return (await this.fetchInstance.post(a, { account_guid: r })).monthly_category_totals;
25
25
  } else
26
26
  return (await this.fetchInstance.get(a)).monthly_category_totals;
27
27
  } catch (a) {
@@ -31,7 +31,7 @@ class u {
31
31
  removeCategory = async (t) => this.fetchInstance.delete(`${i.CATEGORIES}/${t}`);
32
32
  updateCategory = async (t) => this.fetchInstance.put(`${i.CATEGORIES}/${t.guid}`, t).then((e) => e.category);
33
33
  }
34
- class w {
34
+ class S {
35
35
  expandedGuid = null;
36
36
  selectedGuid = null;
37
37
  searchValue = "";
@@ -42,7 +42,7 @@ class w {
42
42
  savedOnSelect;
43
43
  // todo
44
44
  constructor() {
45
- C(this);
45
+ y(this);
46
46
  }
47
47
  setExpandedGuid = (t) => this.expandedGuid = t;
48
48
  setSelectedGuid = (t) => this.selectedGuid = t;
@@ -54,28 +54,32 @@ class w {
54
54
  onSelect = (t) => this.savedOnSelect(t);
55
55
  setOnSelect = (t) => this.savedOnSelect = t;
56
56
  }
57
- class G {
57
+ class $ {
58
58
  globalStore;
59
59
  uiStore;
60
- api = new u("/", "");
60
+ api = new d("/", "");
61
61
  categories = [];
62
+ categoriesLoaded = !1;
63
+ categoriesLoading = !1;
62
64
  dateRangeCategoryTotals = [];
63
65
  monthlyCategoryTotals = [];
64
- dataRangeTotalsLoaded = !1;
65
- isLoadingCategoryTotals = !1;
66
+ dateRangeTotalsLoaded = !1;
67
+ dateRangeTotalsLoading = !1;
66
68
  monthlyTotalsLoaded = !1;
69
+ monthlyTotalsLoading = !1;
67
70
  constructor(t) {
68
- this.globalStore = t, this.uiStore = new w(), this.api = new u(t.endpoint, t.sessionToken, t.onError), C(this);
71
+ this.globalStore = t, this.uiStore = new S(), this.api = new d(t.endpoint, t.sessionToken, t.onError), y(this);
69
72
  }
70
73
  get detailedCategories() {
71
- return m(
74
+ return this.globalStore.isInitialized ? T(
72
75
  this.categories,
76
+ this.globalStore.copyStore.copy.categories,
73
77
  this.dateRangeCategoryTotals,
74
78
  this.monthlyCategoryTotals
75
- );
79
+ ) : [];
76
80
  }
77
81
  get detailedCategoriesWithTransactions() {
78
- return p(
82
+ return m(
79
83
  this.detailedCategories,
80
84
  this.globalStore.transactionStore.sortedTransactions
81
85
  );
@@ -85,14 +89,23 @@ class G {
85
89
  }
86
90
  get spendCategories() {
87
91
  return this.detailedCategories.filter(
88
- (t) => !t.is_income && !t.isTransfer && t.guid !== g.INVESTMENTS
92
+ (t) => !t.is_income && !t.isTransfer && t.guid !== l.INVESTMENTS
89
93
  );
90
94
  }
91
95
  get transferCategories() {
92
96
  return this.detailedCategories.filter((t) => t.isTransfer);
93
97
  }
98
+ setCategories = (t) => {
99
+ this.categories = t, this.categoriesLoading = !1, this.categoriesLoaded = !0;
100
+ };
101
+ setMonthlyCategoryTotals = (t) => {
102
+ this.monthlyCategoryTotals = t, this.monthlyTotalsLoading = !1, this.monthlyTotalsLoaded = !0;
103
+ };
104
+ setDateRangeCategoryTotals = (t) => {
105
+ this.dateRangeCategoryTotals = t, this.dateRangeTotalsLoading = !1, this.dateRangeTotalsLoaded = !0;
106
+ };
94
107
  get trendsCategories() {
95
- return this.detailedCategories.filter((t) => t.totalAmount !== 0).filter((t) => t.guid !== g.INVESTMENTS && t.guid !== g.TRANSFER);
108
+ return this.detailedCategories.filter((t) => t.totalAmount !== 0).filter((t) => t.guid !== l.INVESTMENTS && t.guid !== l.TRANSFER);
96
109
  }
97
110
  addCategory = async (t, e) => {
98
111
  const o = { name: t, parent_guid: e };
@@ -102,62 +115,52 @@ class G {
102
115
  console.error(`Error occurred while adding category: ${a}`);
103
116
  }
104
117
  };
105
- loadCategories = async (t) => {
106
- try {
107
- const e = t || await this.api.getCategories(), { default_categories: o } = this.globalStore.copyStore.copy.categories;
108
- l(() => {
109
- this.categories = e.map((a) => ({
110
- ...a,
111
- name: o[a.guid] ? o[a.guid].replace(/&/g, "&") : a.name
112
- }));
113
- });
114
- } catch (e) {
115
- console.error(`Error occurred while getting categories: ${e}`);
118
+ loadCategories = async () => {
119
+ if (!this.categoriesLoading) {
120
+ this.categoriesLoading = !0;
121
+ try {
122
+ const t = await this.api.getCategories();
123
+ this.setCategories(t);
124
+ } catch (t) {
125
+ console.error(`Error occurred while getting categories: ${t}`);
126
+ }
116
127
  }
117
128
  };
118
129
  loadDateRangeCategoryTotals = async (t, e, o) => {
119
- this.setIsLoadingCategoryTotals(!0);
120
- try {
121
- const a = await this.api.getDateRangeCategoryTotals(
122
- r(e),
123
- r(o),
124
- t
125
- );
126
- l(() => {
127
- this.dateRangeCategoryTotals = a, this.setIsLoadingCategoryTotals(!1), this.dataRangeTotalsLoaded = !0;
128
- });
129
- } catch (a) {
130
- this.setIsLoadingCategoryTotals(!1), console.error(`Error occurred while getting date range category totals: ${a}`);
130
+ if (!this.dateRangeTotalsLoading) {
131
+ this.dateRangeTotalsLoading = !0;
132
+ try {
133
+ const a = await this.api.getDateRangeCategoryTotals(
134
+ n(e),
135
+ n(o),
136
+ t
137
+ );
138
+ this.setDateRangeCategoryTotals(a);
139
+ } catch (a) {
140
+ console.error(`Error occurred while getting date range category totals: ${a}`);
141
+ }
131
142
  }
132
143
  };
133
144
  loadMonthlyCategoryTotals = async (t = this.globalStore.globalUiStore.selectedAccounts, e, o) => {
134
- const a = r(d(e ?? h(/* @__PURE__ */ new Date(), 11))), s = r(y(o ?? /* @__PURE__ */ new Date()));
145
+ if (this.monthlyTotalsLoading) return;
146
+ this.monthlyTotalsLoading = !0;
147
+ const a = n(C(e ?? c(/* @__PURE__ */ new Date(), 11))), r = n(h(o ?? /* @__PURE__ */ new Date()));
135
148
  try {
136
- const n = await this.api.getMonthlyCategoryTotals(a, s, t);
137
- l(() => {
138
- this.monthlyCategoryTotals = n, this.monthlyTotalsLoaded = !0;
139
- });
140
- } catch (n) {
141
- console.error(`Error occurred while getting monthly category totals: ${n}`);
149
+ const s = await this.api.getMonthlyCategoryTotals(a, r, t);
150
+ this.setMonthlyCategoryTotals(s);
151
+ } catch (s) {
152
+ console.error(`Error occurred while getting monthly category totals: ${s}`);
142
153
  }
143
154
  };
144
155
  reloadCategoryTotals = async (t, e, o) => {
145
- this.setIsLoadingCategoryTotals(!0);
156
+ const a = e ?? c(/* @__PURE__ */ new Date(), 11), r = o ?? h(/* @__PURE__ */ new Date());
146
157
  try {
147
- const a = await this.api.getDateRangeCategoryTotals(
148
- r(e),
149
- r(o),
150
- t
151
- ), s = await this.api.getMonthlyCategoryTotals(
152
- r(d(h(o, 11))),
153
- r(y(o)),
154
- t
155
- );
156
- l(() => {
157
- this.dateRangeCategoryTotals = a, this.monthlyCategoryTotals = s, this.dataRangeTotalsLoaded = !0, this.monthlyTotalsLoaded = !0, this.setIsLoadingCategoryTotals(!1);
158
- });
159
- } catch (a) {
160
- console.error(`Error occurred while getting category totals: ${a}`);
158
+ await Promise.all([
159
+ this.loadMonthlyCategoryTotals(t, a, r),
160
+ this.loadDateRangeCategoryTotals(t, a, r)
161
+ ]);
162
+ } catch (s) {
163
+ console.error(`Error occurred while getting category totals: ${s}`);
161
164
  }
162
165
  };
163
166
  removeCategory = async (t) => {
@@ -167,9 +170,6 @@ class G {
167
170
  console.error(`Error occurred while removing category: ${e}`);
168
171
  }
169
172
  };
170
- setIsLoadingCategoryTotals = (t) => {
171
- this.isLoadingCategoryTotals = t;
172
- };
173
173
  updateCategory = async (t) => {
174
174
  try {
175
175
  await this.api.updateCategory(t), await this.loadCategories();
@@ -178,9 +178,9 @@ class G {
178
178
  }
179
179
  };
180
180
  // TODO: Remove this after refactoring Trends components to use detailedCategories
181
- getCategoryName = (t) => this.categories.find((o) => o.guid === t)?.name ?? S[t];
181
+ getCategoryName = (t) => this.categories.find((o) => o.guid === t)?.name ?? p[t];
182
182
  }
183
183
  export {
184
- G as C,
185
- u as a
184
+ $ as C,
185
+ d as a
186
186
  };
@@ -0,0 +1,80 @@
1
+ import { format as d } from "date-fns/format";
2
+ import { startOfMonth as T } from "date-fns/startOfMonth";
3
+ import { startOfToday as C } from "date-fns/startOfToday";
4
+ import { subMonths as N } from "date-fns/subMonths";
5
+ import { CategoryIconList as O } from "@mxenabled/mxui";
6
+ import { C as b, a as D, b as E } from "./Category-CevNQ03n.mjs";
7
+ import { f as R, D as v } from "./Dialog-B4PI-_bL.mjs";
8
+ const H = 3, f = 12, k = (t, o, e, r) => t.filter((n) => !n.parent_guid).map(
9
+ (n) => p(
10
+ n,
11
+ o,
12
+ e,
13
+ r,
14
+ t.filter((s) => s.parent_guid === n.guid)
15
+ )
16
+ ), z = (t, o) => {
17
+ const e = O.find((r) => r.guid === t);
18
+ return e ? o.palette.categories[e.colorName] || "" : o.palette.categories.uncategorized || "";
19
+ }, p = (t, o, e, r, n = []) => {
20
+ const s = t.guid, i = t.parent_guid || s, u = s === i, c = e.find((a) => a.category_guid === s)?.total || 0, m = y(
21
+ r.filter((a) => a.category_guid === s)
22
+ ), g = y(
23
+ r.filter(
24
+ (a) => a.category_guid === s || a.top_level_category_guid === s
25
+ )
26
+ ), l = n.map(
27
+ (a) => p(a, o, e, r)
28
+ ), A = l.reduce(
29
+ (a, M) => a + M.currentAmount,
30
+ c
31
+ ), h = o.default_categories[t.guid] ? o.default_categories[t.guid].replace(/&/g, "&") : t.name;
32
+ return {
33
+ ...t,
34
+ currentAmount: c,
35
+ averageAmount: _(m),
36
+ color: b[i],
37
+ icon: D[i],
38
+ isTransfer: i === E.TRANSFER,
39
+ monthlyAmounts: m,
40
+ name: h,
41
+ subCategories: l,
42
+ totalAmount: u ? A : 0,
43
+ totalAverageAmount: _(g),
44
+ totalMonthlyAmounts: u ? g : []
45
+ };
46
+ }, B = (t, o) => t.map((e) => {
47
+ const r = o.filter(
48
+ (n) => n.category_guid === e.guid || n.top_level_category_guid === e.guid
49
+ );
50
+ return {
51
+ ...e,
52
+ transactions: r
53
+ };
54
+ }), _ = (t, o = H) => {
55
+ const e = o > history.length ? history.length : o;
56
+ return Math.ceil(
57
+ Math.max(
58
+ 0,
59
+ t.slice(-e).reduce((r, n) => r + n.amount, 0) / e
60
+ )
61
+ );
62
+ }, y = (t) => {
63
+ const o = [], e = C();
64
+ for (let r = 0; r <= f; r++) {
65
+ const n = T(N(e, f - r)), i = t.filter(
66
+ (u) => u.year_month === Number(d(n, "yyyyMM"))
67
+ ).reduce((u, c) => u + c.total, 0);
68
+ o.push({
69
+ amount: i,
70
+ isoDate: d(n, "yyyy-MM-dd"),
71
+ label: R(n, v.MONTH_YEAR)
72
+ });
73
+ }
74
+ return o;
75
+ };
76
+ export {
77
+ k as a,
78
+ z as b,
79
+ B as g
80
+ };
@@ -3,7 +3,7 @@ import s from "react";
3
3
  import { observer as E } from "mobx-react-lite";
4
4
  import { useTheme as b } from "@mui/material/styles";
5
5
  import { ConnectionsWidget as D } from "@mxenabled/web-widget-sdk";
6
- import { C as a, c, M as i } from "./ConnectDrawer-BOjfI6rz.mjs";
6
+ import { C as a, a as c, M as i } from "./GlobalAccountFilter-DQCPNc95.mjs";
7
7
  import { d as L, e as w, u as _ } from "./hooks-ZMp65DFz.mjs";
8
8
  import { D as x } from "./Drawer-DV4NTsFg.mjs";
9
9
  const I = ({
@@ -1,25 +1,25 @@
1
- import { makeAutoObservable as l } from "mobx";
1
+ import { makeAutoObservable as d } from "mobx";
2
2
  import { getDate as r, fromUnixTime as _, startOfMonth as m } from "date-fns";
3
- import { A as p } from "./ConnectDrawer-BOjfI6rz.mjs";
3
+ import { A as b } from "./Account-BiB1F8lL.mjs";
4
4
  const E = 12, T = 100;
5
5
  var c = /* @__PURE__ */ ((a) => (a[a.FASTEST_PAYOFF_FIRST = 1] = "FASTEST_PAYOFF_FIRST", a[a.HIGHEST_INTEREST = 2] = "HIGHEST_INTEREST", a[a.LOWEST_BALANCE = 3] = "LOWEST_BALANCE", a[a.HIGHEST_BALANCE = 4] = "HIGHEST_BALANCE", a))(c || {});
6
- const b = {
6
+ const p = {
7
7
  unnamed_label: "Unnamed Debt"
8
8
  };
9
9
  function y(a, e) {
10
- const t = a.filter((n) => n.account_type === p.CHECKING_LINE_OF_CREDIT ? Number(n.balance) <= 0 : n.is_excluded_from_debts !== !0), s = e.filter((n) => t.some((i) => i.guid === n.account_guid)).map(
11
- (n) => d(t.find((i) => i.guid === n.account_guid), n)
12
- ), o = t.filter((n) => !s.some((i) => i.account.guid === n.guid)).map((n) => d(n));
10
+ const t = a.filter((n) => n.account_type === b.CHECKING_LINE_OF_CREDIT ? Number(n.balance) <= 0 : n.is_excluded_from_debts !== !0), s = e.filter((n) => t.some((i) => i.guid === n.account_guid)).map(
11
+ (n) => l(t.find((i) => i.guid === n.account_guid), n)
12
+ ), o = t.filter((n) => !s.some((i) => i.account.guid === n.guid)).map((n) => l(n));
13
13
  return [...s, ...o];
14
14
  }
15
- function d(a, e) {
15
+ function l(a, e) {
16
16
  const t = { account: a, goal: e, guid: a.guid };
17
17
  if (e) {
18
18
  const s = e.payment_due_at ? r(_(e.payment_due_at)) : 1, o = m(/* @__PURE__ */ new Date()).setDate(s);
19
19
  t.balance = Math.abs(e.amount - e.current_amount), t.interest_rate = e.interest_rate, t.is_paid_off = e.is_complete, t.monthly_payment = e.monthly_payment, t.name = e.name, t.original_balance = e.initial_amount, t.payment_due_date = o;
20
20
  } else {
21
21
  const s = a.payment_due_at ? r(_(a.payment_due_at)) : 1, o = m(/* @__PURE__ */ new Date()).setDate(s), n = a.balance ?? 0, i = a.minimum_payment ?? void 0, u = a.interest_rate ?? a.apr ?? a.apy;
22
- t.balance = Math.max(n, 0), t.interest_rate = u, t.is_paid_off = n === 0, t.monthly_payment = i, t.name = a?.name ?? b.unnamed_label, t.original_balance = a.original_balance, t.payment_due_date = o;
22
+ t.balance = Math.max(n, 0), t.interest_rate = u, t.is_paid_off = n === 0, t.monthly_payment = i, t.name = a?.name ?? p.unnamed_label, t.original_balance = a.original_balance, t.payment_due_date = o;
23
23
  }
24
24
  return t.is_impossible = !1, t.priority = void 0, t.projected_payoff_date = void 0, t;
25
25
  }
@@ -28,7 +28,7 @@ class h {
28
28
  selectedDebtChartData = {};
29
29
  selectedDebtPriority = c.LOWEST_BALANCE;
30
30
  constructor() {
31
- l(this);
31
+ d(this);
32
32
  }
33
33
  get showError() {
34
34
  const { interest_rate: e, monthly_payment: t } = this.selectedDebtChartData;
@@ -45,11 +45,11 @@ class A {
45
45
  globalStore;
46
46
  uiStore;
47
47
  constructor(e) {
48
- this.globalStore = e, this.uiStore = new h(), l(this);
48
+ this.globalStore = e, this.uiStore = new h(), d(this);
49
49
  }
50
50
  get debts() {
51
- const { visibleDebtAccounts: e } = this.globalStore.accountStore, { debtGoals: t } = this.globalStore.goalStore;
52
- return y(e, t);
51
+ const { visibleDebtAccounts: e } = this.globalStore.accountStore, { selectedAccountGuids: t } = this.globalStore.globalUiStore, { debtGoals: s } = this.globalStore.goalStore, o = t.length ? e.filter((n) => t.includes(n.guid)) : e;
52
+ return y(o, s);
53
53
  }
54
54
  get totalMonthlyPayments() {
55
55
  return this.debts.map((t) => Number(t.monthly_payment)).filter((t) => !isNaN(t)).reduce((t, s) => t + s, 0);
@@ -1,8 +1,8 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { observer as c } from "mobx-react-lite";
3
3
  import { Icon as i } from "@mxenabled/mxui";
4
- import { e as p } from "./exportTransactionsToCSV-BrTYdSgJ.mjs";
5
- import { O as m } from "./User-LJpEwPtn.mjs";
4
+ import { e as p } from "./exportTransactionsToCSV-DtQ7ovAR.mjs";
5
+ import { O as m } from "./User-B0LnmiKO.mjs";
6
6
  import { R as x } from "./ResponsiveButton-DZFp78fJ.mjs";
7
7
  import { g as _, h as C, u as l } from "./hooks-ZMp65DFz.mjs";
8
8
  const v = ({ filter: t }) => {