@mx-cartographer/experiences 8.1.12 → 8.2.0

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 (246) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{Account-CMjOp7S2.mjs → Account-BaJmiJAG.mjs} +4 -4
  3. package/dist/{Account-BIKn4XEZ.mjs → Account-BxHMlV9R.mjs} +1 -1
  4. package/dist/{AccountDetailsHeader-CzefHTWU.mjs → AccountDetailsHeader-CfdnKyJK.mjs} +21 -21
  5. package/dist/{AccountFields-BWmpVsS3.mjs → AccountFields-CAy0x_4i.mjs} +6 -6
  6. package/dist/{AccountListItem-DRDxaRBe.mjs → AccountListItem-BYyeeCf6.mjs} +7 -7
  7. package/dist/{Accounts-DX3xJE97.mjs → AccountUtils-T5_Odvos.mjs} +1 -1
  8. package/dist/{Analytics-CxK7O19c.mjs → Analytics-CkYXKvco.mjs} +1 -1
  9. package/dist/ApiEndpoints-DXwIYNUV.mjs +49 -0
  10. package/dist/BudgetUtil-Bg2AQJpQ.mjs +74 -0
  11. package/dist/{Category-Ccoew_sA.mjs → Category-DEKZGLYe.mjs} +3 -3
  12. package/dist/{CategorySelectorDrawer-hhDdSFHO.mjs → CategorySelectorDrawer-Cu1ohxeM.mjs} +2 -2
  13. package/dist/{Connect-CBBTL1HJ.mjs → Connect-Dk6GZEsA.mjs} +1 -1
  14. package/dist/ConnectCard-Dix8BoV_.mjs +54 -0
  15. package/dist/{ConnectDrawer-DNnuF80E.mjs → ConnectDrawer-DgfsTpyW.mjs} +2 -2
  16. package/dist/{ConnectionsDrawer-DX6d7uwJ.mjs → ConnectionsDrawer-D7IXAza2.mjs} +2 -2
  17. package/dist/CurrencyDialog-d4dL7vA5.mjs +371 -0
  18. package/dist/{CurrencyInput-BMbUVSvz.mjs → CurrencyInput-B59ugxPN.mjs} +15 -16
  19. package/dist/{CurrencyText-oqd6cX3M.mjs → CurrencyText-CCbE6MmF.mjs} +1 -1
  20. package/dist/{DateFormats-CaOj_4eI.mjs → DateFormats-HudZ3Bjs.mjs} +6 -7
  21. package/dist/{DateUtil-D0TO0DaZ.mjs → DateUtil-Bhq59ZVg.mjs} +1 -1
  22. package/dist/DebtUtils-DD3186U-.mjs +153 -0
  23. package/dist/EmbeddedCard-BNl3quCs.mjs +856 -0
  24. package/dist/Error-Dogaw2jO.mjs +84 -0
  25. package/dist/ErrorBoundary-CsdOcnJ9.mjs +23 -0
  26. package/dist/{ExportCsvAction-BDFu6YIe.mjs → ExportCsvAction-hDprC41l.mjs} +6 -5
  27. package/dist/{GlobalAccountFilter-jkFxqPg6.mjs → GlobalAccountFilter-DrhtwPqh.mjs} +1 -1
  28. package/dist/GlobalCopyApi-wcnDUzMV.mjs +128 -0
  29. package/dist/GoalsUtil-C9EnLWvC.mjs +107 -0
  30. package/dist/{Help-C_CM4gpK.mjs → Help-BSQm9o29.mjs} +68 -67
  31. package/dist/{Help-CgpJK03Q.mjs → Help-CkQTjORd.mjs} +6 -27
  32. package/dist/InformationTooltip-4su8bn1e.mjs +41 -0
  33. package/dist/{LineChart-CeZnCZ7j.mjs → LineChart-CejWS_rh.mjs} +2 -2
  34. package/dist/{ListItemAction-CNpknVvo.mjs → ListItemAction-DGjHxNDJ.mjs} +1 -1
  35. package/dist/ListItemRow-kH1rn8Xu.mjs +67 -0
  36. package/dist/ListItemWrapper-B5r-YQQ_.mjs +42 -0
  37. package/dist/Localization-DnoVyBNK.mjs +38 -0
  38. package/dist/{ManageIncome-BX2IqW57.mjs → ManageIncome-DwylSiWs.mjs} +51 -51
  39. package/dist/{MicroWidgetContainer-DAesImQ6.mjs → MicroWidgetContainer-CfKdQfhi.mjs} +1 -1
  40. package/dist/{MiniWidgetContainer-BOv3n4iw.mjs → MiniWidgetContainer-BdPiUU-u.mjs} +1 -1
  41. package/dist/NetWorthUtils-DilGN1nW.mjs +95 -0
  42. package/dist/{NotificationSettings-DatCL2Ej.mjs → NotificationSettings-CCg-Tml2.mjs} +13 -13
  43. package/dist/NotificationUtils-BRGFTePr.mjs +23 -0
  44. package/dist/{NumberFormatting-CyrvFgfd.mjs → NumberFormatting--XMeeBfr.mjs} +2 -1
  45. package/dist/{OriginalBalanceAction-CWQ0CK-T.mjs → OriginalBalanceAction-CvDx0K6k.mjs} +4 -4
  46. package/dist/{RecurringSettings-DCplGEv_.mjs → RecurringSettings-CPXLW6AR.mjs} +9 -9
  47. package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +253 -0
  48. package/dist/Select-BZRUpOib.mjs +51 -0
  49. package/dist/SelectionBox-Bx2a5rh4.mjs +48 -0
  50. package/dist/Sizes-DISGrlUg.mjs +6 -0
  51. package/dist/{SpendingData-Dj85XEUp.mjs → SpendingData-PKlh8caU.mjs} +6 -6
  52. package/dist/{SpendingLegend-BS8mHUbu.mjs → SpendingLegend-BmkEr9Nh.mjs} +4 -4
  53. package/dist/{TransactionDetails-C_skrQk8.mjs → TransactionDetails-CbBSxdOi.mjs} +33 -33
  54. package/dist/TransactionUtils-BphBJBbU.mjs +234 -0
  55. package/dist/TrendsUtil-D9z3kIj_.mjs +69 -0
  56. package/dist/UserStore-CRpKQjpP.mjs +3002 -0
  57. package/dist/{ViewMoreMicroCard-D1j0w64K.mjs → ViewMoreMicroCard-K69RRs_b.mjs} +28 -30
  58. package/dist/{WidgetContainer-BPJoDkhL.mjs → WidgetContainer-DalWyz5A.mjs} +3 -3
  59. package/dist/accounts/hooks/useUiStore.d.ts +6 -1
  60. package/dist/accounts/index.d.ts +0 -1
  61. package/dist/accounts/index.es.js +62 -64
  62. package/dist/analytics/index.es.js +2 -2
  63. package/dist/budgets/index.es.js +18 -18
  64. package/dist/cashflow/context/hooks.d.ts +15 -1
  65. package/dist/cashflow/index.d.ts +0 -1
  66. package/dist/cashflow/index.es.js +28 -31
  67. package/dist/categories/context/hooks.d.ts +19 -1
  68. package/dist/categories/index.d.ts +0 -1
  69. package/dist/categories/index.es.js +4 -6
  70. package/dist/common/constants/ScheduledPayment.d.ts +1 -1
  71. package/dist/common/constants/index.d.ts +0 -3
  72. package/dist/common/context/GlobalDataProvider.d.ts +1 -1
  73. package/dist/common/context/hooks.d.ts +20 -20
  74. package/dist/common/index.d.ts +3 -1
  75. package/dist/common/index.es.js +215 -961
  76. package/dist/common/utils/AccountFilter.d.ts +1 -1
  77. package/dist/common/utils/index.d.ts +0 -4
  78. package/dist/{common → core}/constants/DefaultConfig.d.ts +1 -1
  79. package/dist/core/constants/Transaction.d.ts +10 -0
  80. package/dist/core/constants/index.d.ts +2 -0
  81. package/dist/core/index.d.ts +1 -1
  82. package/dist/core/index.es.js +94 -79
  83. package/dist/{accounts → core}/stores/AccountStore.d.ts +14 -4
  84. package/dist/{analytics → core}/stores/AnalyticsStore.d.ts +1 -1
  85. package/dist/{common → core}/stores/AppDataStore.d.ts +4 -5
  86. package/dist/{insights/store → core/stores}/BeatStore.d.ts +3 -3
  87. package/dist/{budgets/store → core/stores}/BudgetsStore.d.ts +3 -4
  88. package/dist/{cashflow/stores/UiStore.d.ts → core/stores/CashflowStore.d.ts} +10 -2
  89. package/dist/{categories → core}/stores/CategoryStore.d.ts +24 -4
  90. package/dist/{common → core}/stores/ConnectStore.d.ts +2 -2
  91. package/dist/core/stores/DebtsStore.d.ts +22 -0
  92. package/dist/{finstrong → core}/stores/FinstrongStore.d.ts +4 -4
  93. package/dist/{common → core}/stores/GlobalCopyStore.d.ts +2 -2
  94. package/dist/{common → core}/stores/GlobalStore.d.ts +2 -25
  95. package/dist/{common → core}/stores/GlobalUiStore.d.ts +3 -3
  96. package/dist/{goals → core}/stores/GoalStore.d.ts +3 -3
  97. package/dist/{help/store → core/stores}/HelpStore.d.ts +4 -6
  98. package/dist/{investments → core}/stores/HoldingStore.d.ts +4 -4
  99. package/dist/{merchants → core}/stores/MerchantStore.d.ts +3 -3
  100. package/dist/{networth → core}/stores/NetWorthStore.d.ts +3 -4
  101. package/dist/{notifications → core}/stores/NotificationStore.d.ts +3 -3
  102. package/dist/{recurringtransactions → core}/stores/RecurringTransactionsStore.d.ts +3 -3
  103. package/dist/{settings → core}/stores/SettingsStore.d.ts +4 -5
  104. package/dist/{transactions → core}/stores/TransactionStore.d.ts +27 -6
  105. package/dist/{trends → core}/stores/TrendsStore.d.ts +11 -5
  106. package/dist/{common → core}/stores/UserStore.d.ts +2 -2
  107. package/dist/core/stores/index.d.ts +24 -0
  108. package/dist/{networth → core}/types/NetWorth.d.ts +1 -10
  109. package/dist/core/types/Offer.d.ts +32 -0
  110. package/dist/core/types/index.d.ts +3 -1
  111. package/dist/{accounts/utils/Accounts.d.ts → core/utils/AccountUtils.d.ts} +1 -1
  112. package/dist/{microinsights/utils/beatUtils.d.ts → core/utils/BeatUtils.d.ts} +1 -1
  113. package/dist/{budgets → core}/utils/BudgetUtil.d.ts +2 -2
  114. package/dist/{categories/util → core/utils}/CategoryUtil.d.ts +6 -1
  115. package/dist/core/utils/DebtUtils.d.ts +31 -0
  116. package/dist/core/utils/FinstrongUtils.d.ts +7 -0
  117. package/dist/{goals/util → core/utils}/GoalsUtil.d.ts +1 -1
  118. package/dist/core/utils/HelpUtil.d.ts +3 -0
  119. package/dist/{investments/util → core/utils}/InvestmentUtil.d.ts +2 -2
  120. package/dist/core/utils/Localization.d.ts +3 -0
  121. package/dist/{networth → core}/utils/NetWorthUtils.d.ts +1 -2
  122. package/dist/{notifications → core}/utils/NotificationUtils.d.ts +1 -1
  123. package/dist/{common → core}/utils/NumberFormatting.d.ts +1 -1
  124. package/dist/{recurringtransactions/util/RecurringTransactions.d.ts → core/utils/RecurringTransactionsUtil.d.ts} +1 -1
  125. package/dist/{settings/util/Notifications.d.ts → core/utils/SettingsUtil.d.ts} +1 -1
  126. package/dist/{transactions/utils/buildDetailedTransactions.d.ts → core/utils/TransactionUtils.d.ts} +12 -2
  127. package/dist/{trends/utils/TrendsData.d.ts → core/utils/TrendsUtil.d.ts} +1 -1
  128. package/dist/{common/utils/User.d.ts → core/utils/UserUtils.d.ts} +1 -1
  129. package/dist/core/utils/index.d.ts +1 -1
  130. package/dist/dashboard/index.es.js +4 -4
  131. package/dist/debts/components/DebtsChart.d.ts +1 -1
  132. package/dist/debts/components/DebtsTable.d.ts +1 -1
  133. package/dist/debts/components/SnowballCard.d.ts +1 -1
  134. package/dist/debts/components/actions/InterestRateAction.d.ts +1 -1
  135. package/dist/debts/components/actions/MonthlyPaymentAction.d.ts +1 -1
  136. package/dist/debts/components/actions/OriginalBalanceAction.d.ts +1 -1
  137. package/dist/debts/hooks/useDebtsUiStore.d.ts +1 -1
  138. package/dist/debts/index.d.ts +0 -1
  139. package/dist/debts/index.es.js +568 -691
  140. package/dist/debts/utils/DebtsTable.d.ts +1 -1
  141. package/dist/debts/utils/SnowballCard.d.ts +2 -2
  142. package/dist/finstrong/index.d.ts +0 -1
  143. package/dist/finstrong/index.es.js +1565 -1342
  144. package/dist/finstrong/util/finstrongUtils.d.ts +1 -7
  145. package/dist/goals/components/addgoal/AddGoalListItem.d.ts +1 -1
  146. package/dist/goals/index.d.ts +0 -1
  147. package/dist/goals/index.es.js +71 -73
  148. package/dist/help/index.es.js +4 -4
  149. package/dist/help/utils/index.d.ts +0 -1
  150. package/dist/{hooks-RzCoiTd0.mjs → hooks-BaO_gOI6.mjs} +17 -17
  151. package/dist/insights/index.d.ts +0 -1
  152. package/dist/insights/index.es.js +52 -54
  153. package/dist/investments/components/AnalysisDetails.d.ts +1 -1
  154. package/dist/investments/index.es.js +6 -6
  155. package/dist/merchants/index.d.ts +0 -1
  156. package/dist/merchants/index.es.js +12 -14
  157. package/dist/microinsights/index.es.js +1 -1
  158. package/dist/microinsights/interfaces.d.ts +1 -33
  159. package/dist/networth/components/AssetsLiabilitiesDetail.d.ts +1 -1
  160. package/dist/networth/components/GainsLossesDetail.d.ts +1 -1
  161. package/dist/networth/components/NetWorthChange.d.ts +1 -1
  162. package/dist/networth/components/NetWorthListItem.d.ts +1 -1
  163. package/dist/networth/components/NetWorthSummary.d.ts +1 -1
  164. package/dist/networth/index.d.ts +0 -4
  165. package/dist/networth/index.es.js +232 -237
  166. package/dist/notifications/index.d.ts +0 -2
  167. package/dist/notifications/index.es.js +23 -26
  168. package/dist/recurringtransactions/index.d.ts +0 -1
  169. package/dist/recurringtransactions/index.es.js +92 -96
  170. package/dist/settings/index.d.ts +0 -1
  171. package/dist/settings/index.es.js +11 -13
  172. package/dist/spending/index.es.js +10 -10
  173. package/dist/transactions/context/hooks.d.ts +1 -1
  174. package/dist/transactions/index.d.ts +0 -4
  175. package/dist/transactions/index.es.js +102 -109
  176. package/dist/trends/index.d.ts +0 -1
  177. package/dist/trends/index.es.js +67 -68
  178. package/dist/trends/utils/shared.d.ts +1 -1
  179. package/dist/{useAccountDisplayName-pliH6hz0.mjs → useAccountDisplayName-CFa_MrS6.mjs} +1 -1
  180. package/dist/{useInsightsEnabled-CzJoG8xi.mjs → useInsightsEnabled-DaNLPmUU.mjs} +1 -1
  181. package/dist/{useWidgetLoadTimer-BZjr-BiE.mjs → useWidgetLoadTimer-CJb-RELP.mjs} +1 -1
  182. package/package.json +1 -1
  183. package/dist/AccountApi-WEM2M9tg.mjs +0 -19
  184. package/dist/AccountStore-CGrjC2Oe.mjs +0 -253
  185. package/dist/ApiEndpoints-C5IA97i7.mjs +0 -118
  186. package/dist/BeatApi-C6pBa0Rb.mjs +0 -21
  187. package/dist/BeatStore-C7-PIhpB.mjs +0 -163
  188. package/dist/BudgetUtil-H9igoNVm.mjs +0 -479
  189. package/dist/CashflowStore-BEi92kJg.mjs +0 -91
  190. package/dist/CategoryApi-CogDFScz.mjs +0 -29
  191. package/dist/CategoryStore-CA4NTaKH.mjs +0 -160
  192. package/dist/CategoryUtil-BJOHgYKS.mjs +0 -80
  193. package/dist/DebtsStore-BJlC2-yO.mjs +0 -63
  194. package/dist/EmbeddedCard-B9JoBaan.mjs +0 -811
  195. package/dist/FinstrongApi-FpmsS_sy.mjs +0 -19
  196. package/dist/FinstrongStore-DYawCv1d.mjs +0 -435
  197. package/dist/GlobalCopyApi-DkS-2Zf_.mjs +0 -41
  198. package/dist/Goal-MFBpoOIC.mjs +0 -29
  199. package/dist/GoalStore-BBAEbf43.mjs +0 -395
  200. package/dist/Localization-C_HZg9tJ.mjs +0 -15
  201. package/dist/Localization-CkQ49EKr.mjs +0 -26
  202. package/dist/MerchantApi-D8ahYxiG.mjs +0 -15
  203. package/dist/MerchantStore-CyZTv-BM.mjs +0 -26
  204. package/dist/NetWorthStore-BY-B_hxy.mjs +0 -168
  205. package/dist/NotificationApi-DF0obHoR.mjs +0 -20
  206. package/dist/NotificationStore-DlAM5Ue0.mjs +0 -69
  207. package/dist/RecurringTransactions-DCt94TN4.mjs +0 -297
  208. package/dist/RecurringTransactionsStore-CFJYC7lI.mjs +0 -264
  209. package/dist/RepeatingTransaction-D2gmBTd0.mjs +0 -7
  210. package/dist/RepeatingTransactionsApi-BNZgZPLs.mjs +0 -17
  211. package/dist/SettingsApi-D9d7SLhB.mjs +0 -22
  212. package/dist/SettingsStore-BcbuKfFO.mjs +0 -250
  213. package/dist/Transaction-Cn5_iFm0.mjs +0 -5
  214. package/dist/TransactionApi-CLG2eSNe.mjs +0 -86
  215. package/dist/TransactionStore-amPYxHnA.mjs +0 -710
  216. package/dist/TrendsStore-bYjIGqyR.mjs +0 -183
  217. package/dist/WidgetApi-C0BA2cFX.mjs +0 -102
  218. package/dist/accounts/stores/UiStore.d.ts +0 -10
  219. package/dist/accounts/utils/index.d.ts +0 -1
  220. package/dist/cashflow/stores/CashflowStore.d.ts +0 -8
  221. package/dist/categories/stores/UiStore.d.ts +0 -20
  222. package/dist/common/stores/index.d.ts +0 -3
  223. package/dist/common/utils/Categories.d.ts +0 -6
  224. package/dist/common/utils/Localization.d.ts +0 -3
  225. package/dist/debts/store/DebtsStore.d.ts +0 -10
  226. package/dist/debts/store/DebtsUiStore.d.ts +0 -13
  227. package/dist/debts/utils/DebtStore.d.ts +0 -4
  228. package/dist/debts/utils/DebtsWidget.d.ts +0 -20
  229. package/dist/debts/utils/shared.d.ts +0 -12
  230. package/dist/exportTransactionsToCSV-CSvbZrvL.mjs +0 -133
  231. package/dist/help/constants/index.d.ts +0 -1
  232. package/dist/help/utils/getAccessibleHelpCategories.d.ts +0 -3
  233. package/dist/transactions/analytics.d.ts +0 -3
  234. package/dist/transactions/constants/Transaction.d.ts +0 -2
  235. package/dist/transactions/constants/TransactionsTable.d.ts +0 -17
  236. package/dist/transactions/stores/UiStore.d.ts +0 -25
  237. package/dist/transactions/utils/exportTransactionsToCSV.d.ts +0 -9
  238. package/dist/transactions/utils/sortAndFilterTransactions.d.ts +0 -3
  239. /package/dist/{common → core}/constants/Category.d.ts +0 -0
  240. /package/dist/{common → core}/constants/DateFormats.d.ts +0 -0
  241. /package/dist/{debts/constants/index.d.ts → core/constants/Debts.d.ts} +0 -0
  242. /package/dist/{help → core}/constants/Help.d.ts +0 -0
  243. /package/dist/{investments/constants/index.d.ts → core/constants/Investments.d.ts} +0 -0
  244. /package/dist/{common → core}/constants/Numbers.d.ts +0 -0
  245. /package/dist/{common → core}/constants/Table.d.ts +0 -0
  246. /package/dist/{common → core}/utils/DateUtil.d.ts +0 -0
@@ -1,160 +0,0 @@
1
- import { makeAutoObservable as c } from "mobx";
2
- import { getUnixTime as i } from "date-fns/getUnixTime";
3
- import { subMonths as n } from "date-fns/subMonths";
4
- import { startOfMonth as y } from "date-fns/startOfMonth";
5
- import { endOfMonth as g } from "date-fns/endOfMonth";
6
- import { C as d } from "./CategoryApi-CogDFScz.mjs";
7
- import { a as u, g as C } from "./CategoryUtil-BJOHgYKS.mjs";
8
- import { b as l, c as T } from "./Category-Ccoew_sA.mjs";
9
- class m {
10
- expandedGuid = null;
11
- selectedGuid = null;
12
- searchValue = "";
13
- showSelected = !0;
14
- shouldDisableDrawerScroll = !1;
15
- unselectable = [];
16
- unselectableText = "";
17
- savedOnSelect;
18
- // todo
19
- constructor() {
20
- c(this);
21
- }
22
- setExpandedGuid = (e) => this.expandedGuid = e;
23
- setSelectedGuid = (e) => this.selectedGuid = e;
24
- setSearchValue = (e) => this.searchValue = e;
25
- setShouldDisableDrawerScroll = (e) => this.shouldDisableDrawerScroll = e;
26
- setShowSelected = (e) => this.showSelected = e;
27
- setUnselectable = (e) => this.unselectable = e;
28
- setUnselectableText = (e) => this.unselectableText = e;
29
- onSelect = (e) => this.savedOnSelect(e);
30
- setOnSelect = (e) => this.savedOnSelect = e;
31
- }
32
- class E {
33
- globalStore;
34
- uiStore;
35
- api = new d("/", "");
36
- categories = [];
37
- categoriesLoaded = !1;
38
- categoriesLoading = !1;
39
- dateRangeCategoryTotals = [];
40
- monthlyCategoryTotals = [];
41
- dateRangeTotalsLoaded = !1;
42
- dateRangeTotalsLoading = !1;
43
- monthlyTotalsLoaded = !1;
44
- monthlyTotalsLoading = !1;
45
- constructor(e) {
46
- this.globalStore = e, this.uiStore = new m(), this.api = new d(e.endpoint, e.sessionToken, e.onError), c(this);
47
- }
48
- get detailedCategories() {
49
- return this.globalStore.isInitialized ? u(
50
- this.categories,
51
- this.globalStore.copyStore.copy.categories,
52
- this.dateRangeCategoryTotals,
53
- this.monthlyCategoryTotals
54
- ) : [];
55
- }
56
- get detailedCategoriesWithTransactions() {
57
- return C(
58
- this.detailedCategories,
59
- this.globalStore.transactionStore.sortedTransactions
60
- );
61
- }
62
- get incomeCategories() {
63
- return this.detailedCategories.filter((e) => e.is_income);
64
- }
65
- get spendCategories() {
66
- return this.detailedCategories.filter(
67
- (e) => !e.is_income && !e.isTransfer && e.guid !== l.INVESTMENTS
68
- );
69
- }
70
- get transferCategories() {
71
- return this.detailedCategories.filter((e) => e.isTransfer);
72
- }
73
- setCategories = (e) => {
74
- this.categories = e, this.categoriesLoading = !1, this.categoriesLoaded = !0;
75
- };
76
- setMonthlyCategoryTotals = (e) => {
77
- this.monthlyCategoryTotals = e, this.monthlyTotalsLoading = !1, this.monthlyTotalsLoaded = !0;
78
- };
79
- setDateRangeCategoryTotals = (e) => {
80
- this.dateRangeCategoryTotals = e, this.dateRangeTotalsLoading = !1, this.dateRangeTotalsLoaded = !0;
81
- };
82
- get trendsCategories() {
83
- return this.detailedCategories.filter((e) => e.totalAmount !== 0).filter((e) => e.guid !== l.INVESTMENTS && e.guid !== l.TRANSFER);
84
- }
85
- addCategory = async (e, t) => {
86
- const o = { name: e, parent_guid: t };
87
- try {
88
- await this.api.addCategory(o), await this.loadCategories();
89
- } catch (a) {
90
- console.error(`Error occurred while adding category: ${a}`);
91
- }
92
- };
93
- loadCategories = async () => {
94
- if (!this.categoriesLoading) {
95
- this.categoriesLoading = !0;
96
- try {
97
- const e = await this.api.getCategories();
98
- this.setCategories(e);
99
- } catch (e) {
100
- console.error(`Error occurred while getting categories: ${e}`);
101
- }
102
- }
103
- };
104
- loadDateRangeCategoryTotals = async (e, t, o) => {
105
- if (!this.dateRangeTotalsLoading) {
106
- this.dateRangeTotalsLoading = !0;
107
- try {
108
- const a = await this.api.getDateRangeCategoryTotals(
109
- i(t),
110
- i(o),
111
- e
112
- );
113
- this.setDateRangeCategoryTotals(a);
114
- } catch (a) {
115
- console.error(`Error occurred while getting date range category totals: ${a}`);
116
- }
117
- }
118
- };
119
- loadMonthlyCategoryTotals = async (e = this.globalStore.globalUiStore.selectedAccounts, t, o) => {
120
- if (this.monthlyTotalsLoading) return;
121
- this.monthlyTotalsLoading = !0;
122
- const a = i(y(t ?? n(/* @__PURE__ */ new Date(), 11))), s = i(g(o ?? /* @__PURE__ */ new Date()));
123
- try {
124
- const r = await this.api.getMonthlyCategoryTotals(a, s, e);
125
- this.setMonthlyCategoryTotals(r);
126
- } catch (r) {
127
- console.error(`Error occurred while getting monthly category totals: ${r}`);
128
- }
129
- };
130
- reloadCategoryTotals = async (e, t, o) => {
131
- const a = t ?? n(/* @__PURE__ */ new Date(), 11), s = o ?? g(/* @__PURE__ */ new Date());
132
- try {
133
- await Promise.all([
134
- this.loadMonthlyCategoryTotals(e, a, s),
135
- this.loadDateRangeCategoryTotals(e, a, s)
136
- ]);
137
- } catch (r) {
138
- console.error(`Error occurred while getting category totals: ${r}`);
139
- }
140
- };
141
- removeCategory = async (e) => {
142
- try {
143
- await this.api.removeCategory(e), await this.loadCategories();
144
- } catch (t) {
145
- console.error(`Error occurred while removing category: ${t}`);
146
- }
147
- };
148
- updateCategory = async (e) => {
149
- try {
150
- await this.api.updateCategory(e), await this.loadCategories();
151
- } catch (t) {
152
- console.error(`Error occurred while updating category: ${t}`);
153
- }
154
- };
155
- // TODO: Remove this after refactoring Trends components to use detailedCategories
156
- getCategoryName = (e) => this.categories.find((o) => o.guid === e)?.name ?? T[e];
157
- }
158
- export {
159
- E as C
160
- };
@@ -1,80 +0,0 @@
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-Ccoew_sA.mjs";
7
- import { f as R, D as v } from "./DateFormats-CaOj_4eI.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: D[i],
37
- icon: b[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
- };
@@ -1,63 +0,0 @@
1
- import { makeAutoObservable as d } from "mobx";
2
- import { getDate as r, fromUnixTime as _, startOfMonth as m } from "date-fns";
3
- import { A as b } from "./Account-CMjOp7S2.mjs";
4
- const E = 12, T = 100;
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 p = {
7
- unnamed_label: "Unnamed Debt"
8
- };
9
- function y(a, e) {
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
- return [...s, ...o];
14
- }
15
- function l(a, e) {
16
- const t = { account: a, goal: e, guid: a.guid };
17
- if (e) {
18
- const s = e.payment_due_at ? r(_(e.payment_due_at)) : 1, o = m(/* @__PURE__ */ new Date()).setDate(s);
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
- } else {
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 ?? p.unnamed_label, t.original_balance = a.original_balance, t.payment_due_date = o;
23
- }
24
- return t.is_impossible = !1, t.priority = void 0, t.projected_payoff_date = void 0, t;
25
- }
26
- class h {
27
- isLoading = !1;
28
- selectedDebtChartData = {};
29
- selectedDebtPriority = c.LOWEST_BALANCE;
30
- constructor() {
31
- d(this);
32
- }
33
- get showError() {
34
- const { interest_rate: e, monthly_payment: t } = this.selectedDebtChartData;
35
- return e === void 0 || t === void 0;
36
- }
37
- get showCompleted() {
38
- return this.selectedDebtChartData.is_paid_off;
39
- }
40
- setIsLoading = (e) => this.isLoading = e;
41
- setSelectedDebtChartData = (e) => this.selectedDebtChartData = e;
42
- setSelectedDebtPriority = (e) => this.selectedDebtPriority = e;
43
- }
44
- class A {
45
- globalStore;
46
- uiStore;
47
- constructor(e) {
48
- this.globalStore = e, this.uiStore = new h(), d(this);
49
- }
50
- get debts() {
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
- }
54
- get totalMonthlyPayments() {
55
- return this.debts.map((t) => Number(t.monthly_payment)).filter((t) => !isNaN(t)).reduce((t, s) => t + s, 0);
56
- }
57
- }
58
- export {
59
- A as D,
60
- T as I,
61
- E as M,
62
- c as a
63
- };