@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,64 +1,58 @@
1
- import { makeAutoObservable as R, runInAction as c } from "mobx";
2
- import { endOfMonth as f } from "date-fns/endOfMonth";
3
- import { isAfter as g } from "date-fns/isAfter";
4
- import { isBefore as S } from "date-fns/isBefore";
5
- import { isSameDay as p } from "date-fns/isSameDay";
6
- import { isWithinInterval as T } from "date-fns/isWithinInterval";
7
- import { startOfMonth as y } from "date-fns/startOfMonth";
8
- import { startOfToday as i } from "date-fns/startOfToday";
9
- import { subDays as I } from "date-fns/subDays";
1
+ import { makeAutoObservable as f, runInAction as i } from "mobx";
2
+ import { endOfMonth as R } from "date-fns/endOfMonth";
3
+ import { isAfter as p } from "date-fns/isAfter";
4
+ import { isBefore as I } from "date-fns/isBefore";
5
+ import { isSameDay as g } from "date-fns/isSameDay";
6
+ import { isWithinInterval as m } from "date-fns/isWithinInterval";
7
+ import { startOfMonth as S } from "date-fns/startOfMonth";
8
+ import { startOfToday as c } from "date-fns/startOfToday";
9
+ import { subDays as y } from "date-fns/subDays";
10
10
  import { F as x, A as o } from "./Fetch-DecPFeGU.mjs";
11
- import { a as u, b as A, c as r, d } from "./RecurringTransactions-CxcSL1dY.mjs";
12
- var E = /* @__PURE__ */ ((a) => (a.Small = "small", a.Medium = "medium", a.Large = "large", a))(E || {});
13
- const G = 44;
11
+ import { b as E, a, c as d, d as u } from "./RecurringTransactions-BqijW_8S.mjs";
12
+ var A = /* @__PURE__ */ ((r) => (r.Small = "small", r.Medium = "medium", r.Large = "large", r))(A || {});
13
+ const U = 44;
14
14
  class h {
15
15
  fetchInstance;
16
- constructor(t, e, n) {
17
- this.fetchInstance = new x(t, e, void 0, n);
16
+ constructor(e, t, n) {
17
+ this.fetchInstance = new x(e, t, void 0, n);
18
18
  }
19
- addRepeatingTransaction = async (t) => this.fetchInstance.post(o.REPEATING_TRANSACTIONS, t).then((e) => e.repeating_transaction);
20
- getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((t) => t.repeating_transactions);
21
- updateRepeatingTransaction = async (t) => this.fetchInstance.put(
22
- `${o.REPEATING_TRANSACTIONS}/${t.guid}`,
23
- t
24
- ).then((e) => e.repeating_transaction);
25
- deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${o.REPEATING_TRANSACTIONS}/${t}`).then((e) => e);
19
+ addRepeatingTransaction = async (e) => this.fetchInstance.post(o.REPEATING_TRANSACTIONS, e).then((t) => t.repeating_transaction);
20
+ getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((e) => e.repeating_transactions);
21
+ updateRepeatingTransaction = async (e) => this.fetchInstance.put(
22
+ `${o.REPEATING_TRANSACTIONS}/${e.guid}`,
23
+ e
24
+ ).then((t) => t.repeating_transaction);
25
+ deleteRepeatingTransaction = async (e) => this.fetchInstance.delete(`${o.REPEATING_TRANSACTIONS}/${e}`).then((t) => t);
26
26
  }
27
- const l = (a, t) => T(t.expectedDate, a), s = (a, t) => a + t.amount;
28
- class U {
27
+ const l = (r, e) => m(e.expectedDate, r), s = (r, e) => r + e.amount;
28
+ class C {
29
29
  globalStore;
30
30
  api = new h("/", "");
31
+ transactions = [];
31
32
  repeatingTransactions = [];
32
- isDataLoaded = !1;
33
33
  selectedDay;
34
- dateRange = { start: y(i()), end: f(i()) };
35
- constructor(t) {
36
- this.globalStore = t, this.api = new h(
37
- t.endpoint,
38
- t.sessionToken,
39
- t.onError
40
- ), R(this);
41
- }
42
- get detailedRepeatingTransactions() {
43
- return u(
44
- this.globalStore.accountStore.visibleAccounts,
45
- this.repeatingTransactions,
46
- this.globalStore.transactionStore.transactions
47
- );
34
+ dateRange = { start: S(c()), end: R(c()) };
35
+ isDataLoaded = !1;
36
+ constructor(e) {
37
+ this.globalStore = e, this.api = new h(
38
+ e.endpoint,
39
+ e.sessionToken,
40
+ e.onError
41
+ ), f(this);
48
42
  }
49
43
  /**
50
44
  * Returns all recurrences built from repeating transactions and filtered by accounts.
51
45
  */
52
46
  get recurrences() {
53
- const t = this.globalStore.accountStore.visibleAccounts;
54
- return A(this.detailedRepeatingTransactions, this.dateRange).filter((e) => t.some((n) => n.guid === e.accountGuid && !n.is_excluded_from_accounts)).filter((e) => T(e.expectedDate, this.dateRange));
47
+ const e = this.globalStore.accountStore.visibleAccounts;
48
+ return E(this.repeatingTransactions, this.dateRange).filter((t) => e.some((n) => n.guid === t.accountGuid && !n.is_excluded_from_accounts)).filter((t) => m(t.expectedDate, this.dateRange));
55
49
  }
56
50
  /**
57
51
  * Returns all recurrences that have occurred in the past, including those that are paid or missed
58
52
  */
59
53
  get pastRecurrences() {
60
54
  return this.recurrences.filter(
61
- (t) => t.status === r.Paid || t.status === r.Missed
55
+ (e) => e.status === a.Paid || e.status === a.Missed
62
56
  );
63
57
  }
64
58
  /**
@@ -67,7 +61,7 @@ class U {
67
61
  */
68
62
  get upcomingRecurrences() {
69
63
  return this.recurrences.filter(
70
- (t) => g(t.expectedDate, I(i(), 3)) && S(t.expectedDate, this.dateRange.end) && t.status === r.Upcoming
64
+ (e) => p(e.expectedDate, y(c(), 3)) && I(e.expectedDate, this.dateRange.end) && e.status === a.Upcoming
71
65
  );
72
66
  }
73
67
  /**
@@ -75,7 +69,7 @@ class U {
75
69
  */
76
70
  get expenses() {
77
71
  return this.recurrences.filter(
78
- (t) => t.type === d.Expense
72
+ (e) => e.type === d.Expense
79
73
  );
80
74
  }
81
75
  /**
@@ -83,7 +77,7 @@ class U {
83
77
  */
84
78
  get upcomingExpenses() {
85
79
  return this.expenses.filter(
86
- (t) => t.status === r.Upcoming
80
+ (e) => e.status === a.Upcoming
87
81
  );
88
82
  }
89
83
  /**
@@ -91,7 +85,7 @@ class U {
91
85
  */
92
86
  get income() {
93
87
  return this.recurrences.filter(
94
- (t) => t.type === d.Income
88
+ (e) => e.type === d.Income
95
89
  );
96
90
  }
97
91
  /**
@@ -99,18 +93,18 @@ class U {
99
93
  */
100
94
  get upcomingIncome() {
101
95
  return this.income.filter(
102
- (t) => t.status === r.Upcoming
96
+ (e) => e.status === a.Upcoming
103
97
  );
104
98
  }
105
99
  get nextIncomeRecurrence() {
106
- return this.upcomingIncome.find((t) => g(t.expectedDate, i()));
100
+ return this.upcomingIncome.find((e) => p(e.expectedDate, c()));
107
101
  }
108
102
  /**
109
103
  * Returns the expense recurrences for the current month.
110
104
  */
111
105
  get currentMonthExpenses() {
112
106
  return this.expenses.filter(
113
- (t) => l(this.dateRange, t)
107
+ (e) => l(this.dateRange, e)
114
108
  );
115
109
  }
116
110
  /**
@@ -118,7 +112,7 @@ class U {
118
112
  */
119
113
  get currentMonthIncome() {
120
114
  return this.income.filter(
121
- (t) => l(this.dateRange, t)
115
+ (e) => l(this.dateRange, e)
122
116
  );
123
117
  }
124
118
  /**
@@ -131,19 +125,19 @@ class U {
131
125
  * Calculates the total amount of all paid expenses for the current month.
132
126
  */
133
127
  get paidExpenseTotal() {
134
- return this.currentMonthExpenses.filter((t) => t.status === r.Paid).reduce(s, 0);
128
+ return this.currentMonthExpenses.filter((e) => e.status === a.Paid).reduce(s, 0);
135
129
  }
136
130
  /**
137
131
  * Calculates the total amount of all missed expenses for the current month.
138
132
  */
139
133
  get missedExpenseTotal() {
140
- return this.currentMonthExpenses.filter((t) => t.status === r.Missed).reduce(s, 0);
134
+ return this.currentMonthExpenses.filter((e) => e.status === a.Missed).reduce(s, 0);
141
135
  }
142
136
  /**
143
137
  * Calculates the total amount of all upcoming expenses for the current month.
144
138
  */
145
139
  get upcomingExpenseTotal() {
146
- return this.currentMonthExpenses.filter((t) => t.status === r.Upcoming).reduce(s, 0);
140
+ return this.currentMonthExpenses.filter((e) => e.status === a.Upcoming).reduce(s, 0);
147
141
  }
148
142
  /**
149
143
  * Calculates the total amount of all income for the current month.
@@ -155,53 +149,49 @@ class U {
155
149
  * Calculates the total amount of all paid income for the current month.
156
150
  */
157
151
  get paidIncomeTotal() {
158
- return this.currentMonthIncome.filter((t) => t.status === r.Paid).reduce(s, 0);
152
+ return this.currentMonthIncome.filter((e) => e.status === a.Paid).reduce(s, 0);
159
153
  }
160
154
  /**
161
155
  * Calculates the total amount of all upcoming income for the current month.
162
156
  */
163
157
  get upcomingIncomeTotal() {
164
- return this.currentMonthIncome.filter((t) => t.status === r.Upcoming).reduce(s, 0);
158
+ return this.currentMonthIncome.filter((e) => e.status === a.Upcoming).reduce(s, 0);
165
159
  }
166
160
  /**
167
161
  * Get the recurrences for the currently selected day.
168
162
  */
169
163
  get selectedDayRecurrences() {
170
164
  return this.selectedDay && this.recurrences.filter(
171
- (t) => this.selectedDay && p(t.occurredOnDate || t.expectedDate, this.selectedDay)
165
+ (e) => this.selectedDay && g(e.occurredOnDate || e.expectedDate, this.selectedDay)
172
166
  );
173
167
  }
174
- setRepeatingTransactions = (t) => {
175
- this.repeatingTransactions = t, this.isDataLoaded = !0;
176
- };
177
168
  /**
178
169
  * Set the date range for filtering recurrences.
179
170
  * @param dateRange - The date range to set.
180
171
  */
181
- setDateRange = (t) => this.dateRange = t;
172
+ setDateRange = (e) => this.dateRange = e;
182
173
  /**
183
174
  * Set the currently selected day.
184
175
  * @param day - The day to select.
185
176
  */
186
- setSelectedDay = (t) => {
187
- this.selectedDay = this.selectedDay && p(t, this.selectedDay) ? void 0 : t;
188
- };
189
- loadRepeatingTransactionData = async () => {
190
- await Promise.all([
191
- this.globalStore.accountStore.loadAccountData(),
192
- this.globalStore.categoryStore.loadCategories(),
193
- this.globalStore.transactionStore.loadTransactionData()
194
- ]), await this.loadRepeatingTransactions();
177
+ setSelectedDay = (e) => {
178
+ this.selectedDay = this.selectedDay && g(e, this.selectedDay) ? void 0 : e;
195
179
  };
196
180
  /**
197
181
  * Load repeating transactions and augment them with additional data.
198
182
  */
199
183
  loadRepeatingTransactions = async () => {
200
184
  try {
201
- const t = await this.api.getRepeatingTransactions();
202
- this.setRepeatingTransactions(t);
203
- } catch (t) {
204
- console.error(`Error occurred while getting repeating transactions: ${t}`);
185
+ const e = await this.api.getRepeatingTransactions();
186
+ i(() => {
187
+ this.repeatingTransactions = u(
188
+ this.globalStore.accountStore.visibleAccounts,
189
+ e,
190
+ this.globalStore.transactionStore.transactions
191
+ ), this.isDataLoaded = !0;
192
+ });
193
+ } catch (e) {
194
+ console.error(`Error occurred while getting repeating transactions: ${e}`);
205
195
  }
206
196
  };
207
197
  /**
@@ -209,13 +199,13 @@ class U {
209
199
  * @param repeatingTransaction - The repeating transaction to add.
210
200
  * @param transaction - The transaction associated with the repeating transaction.
211
201
  */
212
- addRepeatingTransaction = async (t, e) => {
202
+ addRepeatingTransaction = async (e, t) => {
213
203
  try {
214
- const n = await this.api.addRepeatingTransaction(t);
204
+ const n = await this.api.addRepeatingTransaction(e);
215
205
  await this.globalStore.transactionStore.updateTransaction({
216
- ...e,
206
+ ...t,
217
207
  repeating_transaction_guid: n.guid
218
- }), c(() => {
208
+ }), i(() => {
219
209
  this.repeatingTransactions = [
220
210
  ...this.repeatingTransactions,
221
211
  ...u(
@@ -233,45 +223,45 @@ class U {
233
223
  * Delete a repeating transaction by its GUID.
234
224
  * @param guid - The GUID of the repeating transaction to delete.
235
225
  */
236
- deleteRepeatingTransaction = async (t) => {
226
+ deleteRepeatingTransaction = async (e) => {
237
227
  try {
238
- await this.api.deleteRepeatingTransaction(t), c(() => {
228
+ await this.api.deleteRepeatingTransaction(e), i(() => {
239
229
  this.repeatingTransactions = [
240
- ...this.repeatingTransactions.filter((e) => e.guid !== t)
230
+ ...this.repeatingTransactions.filter((t) => t.guid !== e)
241
231
  ];
242
232
  });
243
- } catch (e) {
244
- console.error(`Error occurred while deleting repeating transaction: ${e}`);
233
+ } catch (t) {
234
+ console.error(`Error occurred while deleting repeating transaction: ${t}`);
245
235
  }
246
236
  };
247
237
  /**
248
238
  * Update an existing repeating transaction.
249
239
  * @param transaction - The repeating transaction to update.
250
240
  */
251
- updateRepeatingTransaction = async (t) => {
241
+ updateRepeatingTransaction = async (e) => {
252
242
  try {
253
- const e = await this.api.updateRepeatingTransaction(t), n = this.repeatingTransactions.findIndex(
254
- (m) => m.guid === e.guid
243
+ const t = await this.api.updateRepeatingTransaction(e), n = this.repeatingTransactions.findIndex(
244
+ (T) => T.guid === t.guid
255
245
  );
256
246
  if (n < 0) return;
257
- c(() => {
247
+ i(() => {
258
248
  this.repeatingTransactions = [
259
249
  ...this.repeatingTransactions.slice(0, n),
260
250
  ...u(
261
251
  this.globalStore.accountStore.visibleAccounts,
262
- [e],
252
+ [t],
263
253
  this.globalStore.transactionStore.transactions
264
254
  ),
265
255
  ...this.repeatingTransactions.slice(n + 1)
266
256
  ];
267
257
  });
268
- } catch (e) {
269
- console.error(`Error occurred while updating repeating transaction: ${e}`);
258
+ } catch (t) {
259
+ console.error(`Error occurred while updating repeating transaction: ${t}`);
270
260
  }
271
261
  };
272
262
  }
273
263
  export {
274
- U as R,
275
- E as S,
276
- G as T
264
+ C as R,
265
+ A as S,
266
+ U as T
277
267
  };
@@ -3,16 +3,16 @@ import p from "react";
3
3
  import d from "@mui/material/Button";
4
4
  import a from "@mui/material/IconButton";
5
5
  import c from "@mui/material/Tooltip";
6
- import { useTheme as f } from "@mui/material/styles";
7
- const B = ({
6
+ import f from "@mui/material/styles/useTheme";
7
+ const u = ({
8
8
  icon: e,
9
9
  label: i,
10
10
  onClick: o,
11
11
  placement: s = "bottom",
12
- tooltipText: r,
12
+ tooltipText: n,
13
13
  variant: l = "text"
14
14
  }) => {
15
- const n = f();
15
+ const r = f();
16
16
  return /* @__PURE__ */ m(p.Fragment, { children: [
17
17
  /* @__PURE__ */ t(
18
18
  d,
@@ -20,10 +20,10 @@ const B = ({
20
20
  onClick: o,
21
21
  startIcon: e,
22
22
  sx: {
23
- [n.breakpoints.down("lg")]: { display: "none" },
24
- [n.breakpoints.up("lg")]: { display: "inline-flex" }
23
+ [r.breakpoints.down("lg")]: { display: "none" },
24
+ [r.breakpoints.up("lg")]: { display: "inline-flex" }
25
25
  },
26
- title: r,
26
+ title: n,
27
27
  variant: l,
28
28
  children: i
29
29
  }
@@ -34,12 +34,12 @@ const B = ({
34
34
  describeChild: !0,
35
35
  placement: s,
36
36
  sx: { display: { xs: "inline-flex", lg: "none" } },
37
- title: r,
37
+ title: n,
38
38
  children: /* @__PURE__ */ t(a, { onClick: o, children: e })
39
39
  }
40
40
  )
41
41
  ] });
42
- };
42
+ }, y = u;
43
43
  export {
44
- B as R
44
+ y as R
45
45
  };
@@ -0,0 +1,42 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { observer as p } from "mobx-react-lite";
3
+ import d from "@mui/material/Box";
4
+ import h from "@mui/material/IconButton";
5
+ import a from "@mui/material/InputAdornment";
6
+ import { useTokens as x, TextField as u, Icon as c } from "@mxenabled/mxui";
7
+ const b = ({
8
+ ariaLabel: t = "Search",
9
+ cancelAriaLabel: s = "Cancel Search",
10
+ onChange: e,
11
+ placeholder: i = "Search",
12
+ searchValue: o
13
+ }) => {
14
+ const n = x(), m = /* @__PURE__ */ r(
15
+ h,
16
+ {
17
+ "aria-label": s,
18
+ className: "mx-cat-cancel-search-button",
19
+ color: "primary",
20
+ onClick: () => e(""),
21
+ children: /* @__PURE__ */ r(c, { name: "cancel", size: 24 })
22
+ }
23
+ );
24
+ return /* @__PURE__ */ r(d, { className: "mx-cmn-search-box", px: n.Spacing.Large, py: n.Spacing.Medium, children: /* @__PURE__ */ r(
25
+ u,
26
+ {
27
+ InputProps: {
28
+ startAdornment: /* @__PURE__ */ r(a, { position: "start", children: /* @__PURE__ */ r(c, { color: "disabled", name: "search", size: 26 }) }),
29
+ endAdornment: /* @__PURE__ */ r(a, { position: "end", sx: { p: 0 }, children: o ? m : null })
30
+ },
31
+ "aria-label": t,
32
+ name: "search",
33
+ onChange: (l) => e(l.target.value),
34
+ placeholder: i,
35
+ sx: { bgcolor: "background.paper", width: "100%" },
36
+ value: o
37
+ }
38
+ ) });
39
+ }, v = p(b);
40
+ export {
41
+ v as S
42
+ };
@@ -1,6 +1,6 @@
1
1
  import { makeAutoObservable as N, runInAction as l } from "mobx";
2
2
  import { F as D, A as r } from "./Fetch-DecPFeGU.mjs";
3
- import { I as i, A as n, B as f } from "./ToggleListItem-ciFTiqRS.mjs";
3
+ import { B as f, A as n, I as i } from "./ToggleListItem-ciFTiqRS.mjs";
4
4
  import { T as m } from "./TransactionApi-CjBoLleL.mjs";
5
5
  class y {
6
6
  fetchInstance;
@@ -1,11 +1,11 @@
1
1
  import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
2
  import l from "@mui/material/Box";
3
- import { useTheme as D } from "@mui/material/styles";
4
- const p = 48, d = 4, y = ({
3
+ import D from "@mui/material/styles/useTheme";
4
+ const p = 48, u = 4, S = ({
5
5
  color: m = "",
6
6
  percent: r = 0,
7
7
  size: t = p,
8
- strokeWidth: s = d,
8
+ strokeWidth: s = u,
9
9
  children: i,
10
10
  backgroundStrokeColor: c
11
11
  }) => {
@@ -61,9 +61,9 @@ const p = 48, d = 4, y = ({
61
61
  ]
62
62
  }
63
63
  );
64
- };
64
+ }, E = S;
65
65
  export {
66
66
  p as D,
67
- y as S,
68
- d as a
67
+ E as S,
68
+ u as a
69
69
  };
@@ -0,0 +1,53 @@
1
+ import { addMonths as u } from "date-fns/addMonths";
2
+ import { isBefore as d } from "date-fns/isBefore";
3
+ import { startOfMonth as _ } from "date-fns/startOfMonth";
4
+ import { subMonths as y } from "date-fns/subMonths";
5
+ import { endOfMonth as M } from "date-fns/endOfMonth";
6
+ import { b as a, P as l } from "./Category-CevNQ03n.mjs";
7
+ import { f as m, a as T } from "./Dialog-BPTr3qHE.mjs";
8
+ const i = (e) => (e.top_level_category_guid === a.INCOME || e.category_guid === a.INCOME) && !h(e), C = (e) => !i(e) && !f(e), p = (e) => l.includes(e.top_level_category_guid) || l.includes(e.category_guid), f = (e) => e.top_level_category_guid === a.TRANSFER || e.category_guid === a.TRANSFER, h = (e) => e.top_level_category_guid === a.INVESTMENTS || e.category_guid === a.INVESTMENTS, N = (e) => !i(e) && !p(e) && !f(e) && !h(e), w = (e) => e.filter((r) => r.category_guid === r.top_level_category_guid), F = (e, r) => {
9
+ if (r === 0) return 0;
10
+ const o = (e - r) / r;
11
+ return isNaN(o) ? 0 : o;
12
+ }, g = (e, r) => {
13
+ const o = [];
14
+ let t = _(r?.start ?? y(/* @__PURE__ */ new Date(), 5));
15
+ const s = r?.end ?? /* @__PURE__ */ new Date();
16
+ for (; d(t, s); )
17
+ o.push({
18
+ x: m(t, T.MONTH_SHORT),
19
+ y: e.filter((n) => n.year === t.getFullYear() && n.month === t.getMonth() + 1).reduce((n, c) => n + c.total, 0)
20
+ }), t = u(t, 1);
21
+ return o;
22
+ }, b = (e, r) => {
23
+ const o = e.filter(i);
24
+ return g(o, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
25
+ }, A = (e, r) => {
26
+ const o = e.filter(p);
27
+ return g(o, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
28
+ }, x = (e, r) => {
29
+ const o = e.filter(N);
30
+ return g(o, r);
31
+ }, H = (e) => {
32
+ const r = [], o = e.filter(
33
+ (n) => n.top_level_category_guid !== a.INCOME && n.top_level_category_guid !== a.TRANSFER && n.total > 0
34
+ );
35
+ let t = _(y(/* @__PURE__ */ new Date(), 5));
36
+ const s = M(/* @__PURE__ */ new Date());
37
+ for (; d(t, s); )
38
+ r.push({
39
+ x: m(t, T.MONTH_SHORT),
40
+ y: o.filter((n) => n.year === t.getFullYear() && n.month === t.getMonth() + 1).reduce((n, c) => n + c.total, 0)
41
+ }), t = u(t, 1);
42
+ return r;
43
+ };
44
+ export {
45
+ A as a,
46
+ x as b,
47
+ w as c,
48
+ i as d,
49
+ H as e,
50
+ F as f,
51
+ b as g,
52
+ C as i
53
+ };