@mx-cartographer/experiences 8.0.0-alpha.bb3 → 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 (203) hide show
  1. package/CHANGELOG.md +178 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CitErkuS.mjs} +89 -82
  4. package/dist/AccountDetailsHeader-BkG3MNYo.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-zCMqet85.mjs} +6 -6
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DHrz8Mml.mjs} +9 -9
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-LgfBcYMe.mjs} +112 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-BmZXkL0C.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +23 -21
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BkvlItWx.mjs} +11 -11
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-itK0R3wV.mjs} +2 -2
  18. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  19. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  20. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-Bq-aPy-5.mjs} +1 -1
  21. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  22. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  23. package/dist/Drawer-By9V-B5L.mjs +178 -0
  24. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  25. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
  26. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  27. package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
  28. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-1P19goZ7.mjs} +112 -152
  29. package/dist/{Help-B6dIcujh.mjs → Help-Ea3BlXQp.mjs} +2 -2
  30. package/dist/LineChart-KpPw1phO.mjs +580 -0
  31. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BxTkF6Tz.mjs} +10 -10
  32. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-CaoQl609.mjs} +91 -88
  33. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  34. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  35. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  36. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-rC0q7P7t.mjs} +2 -2
  37. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-uzM8tCoH.mjs} +236 -231
  38. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
  39. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  40. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +4 -4
  41. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-B4ybrS0B.mjs} +4 -4
  42. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BqijW_8S.mjs} +49 -48
  43. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +26 -29
  44. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  45. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DQ1b9uqq.mjs} +11 -13
  46. package/dist/SpendingLegend-CDO060GT.mjs +193 -0
  47. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  48. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  49. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  50. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  51. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  52. package/dist/{User-BQUxBeZV.mjs → User-Cnlegl1N.mjs} +2 -2
  53. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +711 -728
  54. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CoFDmQRE.mjs} +4 -4
  55. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  56. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  57. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  58. package/dist/accounts/index.es.js +245 -235
  59. package/dist/accounts/stores/AccountStore.d.ts +24 -25
  60. package/dist/accounts/utils/Accounts.d.ts +1 -2
  61. package/dist/analytics/index.es.js +2 -2
  62. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  63. package/dist/budgets/index.es.js +611 -580
  64. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  65. package/dist/cashflow/index.es.js +187 -180
  66. package/dist/categories/index.es.js +2 -2
  67. package/dist/categories/stores/CategoryStore.d.ts +2 -5
  68. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  69. package/dist/common/components/Select.d.ts +4 -2
  70. package/dist/common/components/charts/LineChart.d.ts +12 -2
  71. package/dist/common/components/charts/index.d.ts +0 -3
  72. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  73. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  74. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  75. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  76. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  77. package/dist/common/components/drawer/Footer.d.ts +17 -0
  78. package/dist/common/hooks/index.d.ts +1 -0
  79. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  80. package/dist/common/index.es.js +397 -387
  81. package/dist/common/stores/AppDataStore.d.ts +1 -3
  82. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  83. package/dist/common/stores/GlobalStore.d.ts +10 -4
  84. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  85. package/dist/common/stores/UserStore.d.ts +2 -3
  86. package/dist/common/types/Account.d.ts +6 -9
  87. package/dist/common/types/Finstrong.d.ts +54 -0
  88. package/dist/common/types/Global.d.ts +1 -0
  89. package/dist/common/types/Widgets.d.ts +1 -0
  90. package/dist/common/types/index.d.ts +1 -1
  91. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  92. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  93. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  94. package/dist/dashboard/index.es.js +90 -88
  95. package/dist/debts/index.es.js +458 -448
  96. package/dist/exportTransactionsToCSV-DuAaI5XA.mjs +48 -0
  97. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  98. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  99. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  100. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  101. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  102. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  103. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  104. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  105. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  106. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  107. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  108. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  109. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  110. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  111. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  112. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  113. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  114. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  115. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  116. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  117. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  118. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  119. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  120. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  121. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  122. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  123. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  124. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  125. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  126. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  127. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  128. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  129. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  130. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  131. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  132. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  133. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  134. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +24 -0
  135. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  136. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  137. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  138. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  139. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  140. package/dist/finstrong/constants/index.d.ts +9 -0
  141. package/dist/finstrong/index.es.js +3190 -1073
  142. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  143. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  144. package/dist/goals/index.es.js +302 -291
  145. package/dist/goals/stores/GoalStore.d.ts +4 -17
  146. package/dist/help/index.es.js +13 -9
  147. package/dist/{hooks-D6XlXHf4.mjs → hooks-ZMp65DFz.mjs} +12 -12
  148. package/dist/insights/index.es.js +1 -1
  149. package/dist/investments/index.es.js +108 -104
  150. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  151. package/dist/merchants/index.es.js +2 -2
  152. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  153. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  154. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  155. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  156. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  157. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  158. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  159. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  160. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  161. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  162. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  163. package/dist/microinsights/constants/App.d.ts +0 -1
  164. package/dist/microinsights/index.d.ts +4 -3
  165. package/dist/microinsights/index.es.js +101 -14
  166. package/dist/microinsights/interfaces.d.ts +0 -6
  167. package/dist/networth/index.es.js +197 -190
  168. package/dist/notifications/index.es.js +25 -25
  169. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  170. package/dist/recurringtransactions/index.es.js +395 -351
  171. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
  172. package/dist/settings/index.es.js +307 -298
  173. package/dist/spending/index.es.js +299 -438
  174. package/dist/spending/utils/SpendingData.d.ts +2 -1
  175. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  176. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  177. package/dist/transactions/index.es.js +115 -112
  178. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  179. package/dist/trends/components/TrendsTable.d.ts +0 -2
  180. package/dist/trends/index.es.js +1025 -604
  181. package/dist/trends/utils/TrendsData.d.ts +1 -0
  182. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  183. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  184. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  185. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  186. package/package.json +4 -4
  187. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  188. package/dist/Accounts-BRf_YeTf.mjs +0 -27
  189. package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
  190. package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
  191. package/dist/Drawer-kEE73B87.mjs +0 -113
  192. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  193. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  194. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  195. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  196. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  197. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  198. package/dist/TransactionStore-ai3uII_r.mjs +0 -690
  199. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  200. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  201. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  202. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  203. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -14,6 +14,7 @@ export interface StackedLineChartData {
14
14
  }
15
15
  export declare const getStackedLineChartData: (totals: MonthlyCategoryTotals[], start: Date, end: Date) => StackedLineChartData[];
16
16
  export declare const amountComparator: GridComparatorFn<string | number>;
17
+ export declare const categoryComparator: GridComparatorFn<string | number>;
17
18
  export declare const buildCategoryDetailsChartData: (data: DetailedCategoryWithTransactions | null, monthsCount: number) => {
18
19
  monthlyAmounts: {
19
20
  x: string;
@@ -1,6 +1,6 @@
1
1
  import s from "react";
2
- import { g as e } from "./ConnectDrawer-BQNs-hjk.mjs";
3
- import { a as n } from "./hooks-D6XlXHf4.mjs";
2
+ import { g as e } from "./ConnectDrawer-BkvlItWx.mjs";
3
+ import { a as n } from "./hooks-ZMp65DFz.mjs";
4
4
  const i = (o) => {
5
5
  const { config: a } = n();
6
6
  return s.useMemo(
@@ -1,6 +1,6 @@
1
1
  import { getUnixTime as l } from "date-fns/getUnixTime";
2
2
  import A from "bowser";
3
- import { F as u, A as r } from "./Fetch-87LIQbEA.mjs";
3
+ import { F as u, A as r } from "./Fetch-DecPFeGU.mjs";
4
4
  import y from "react";
5
5
  const g = async (o, t, n = "1.0.0", s = "Experiences") => {
6
6
  const a = new _(o, t), { analytics_session: i } = await a.initializeAnalyticsSession(
@@ -1,5 +1,5 @@
1
1
  import { useState as n, useEffect as a } from "react";
2
- import { f as o } from "./hooks-D6XlXHf4.mjs";
2
+ import { f as o } from "./hooks-ZMp65DFz.mjs";
3
3
  const f = () => {
4
4
  const { isInitialized: e, appDataStore: t } = o(), [s, i] = n(!1);
5
5
  return a(() => {
@@ -0,0 +1,19 @@
1
+ import { useRef as r, useEffect as c } from "react";
2
+ import { g as l } from "./hooks-ZMp65DFz.mjs";
3
+ let n = !0;
4
+ const d = ({ widgetName: i, isLoaded: u = !0 }) => {
5
+ const { onEvent: o } = l(), t = r(null), s = r(!1), e = r(!1);
6
+ t.current === null && (e.current = n, t.current = n ? performance.timeOrigin : Date.now()), c(() => {
7
+ if (u && !s.current && t.current !== null) {
8
+ const a = Date.now() - t.current;
9
+ o("WidgetLoad", {
10
+ widgetName: i,
11
+ loadTimeMs: a,
12
+ isInitialLoad: e.current
13
+ }), s.current = !0, t.current = null, e.current && (n = !1);
14
+ }
15
+ }, [u, i, o]);
16
+ };
17
+ export {
18
+ d as u
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "8.0.0-alpha.bb3",
3
+ "version": "8.0.0-alpha.mega1",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -180,7 +180,7 @@
180
180
  "@mui/lab": "^5.0.0-alpha.177",
181
181
  "@mui/material": "^5.18.0",
182
182
  "@mui/system": "^5.18.0",
183
- "@mui/x-charts": "^7.29.1",
183
+ "@mui/x-charts": "^8.23.0",
184
184
  "@mui/x-data-grid-pro": "^7.29.8",
185
185
  "@mui/x-date-pickers": "^7.29.4",
186
186
  "@mui/x-date-pickers-pro": "^7.29.4",
@@ -252,7 +252,7 @@
252
252
  "storybook-dark-mode": "4.0.1",
253
253
  "typescript": "^5.8.2",
254
254
  "vi-canvas-mock": "^1.0.0",
255
- "vite": "^5.4.21",
255
+ "vite": "^5.4.19",
256
256
  "vite-plugin-dts": "^4.5.3",
257
257
  "vite-tsconfig-paths": "^5.1.4",
258
258
  "vitest": "^3.0.8"
@@ -272,5 +272,5 @@
272
272
  "CHANGELOG.md",
273
273
  "README.md"
274
274
  ],
275
- "packageManager": "yarn@4.11.0"
275
+ "packageManager": "yarn@4.9.2"
276
276
  }
@@ -1,120 +0,0 @@
1
- import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
- import { observer as p } from "mobx-react-lite";
3
- import d from "@mui/material/Stack";
4
- import { H3 as w, InstitutionLogo as I, Text as m, H2 as L } from "@mxenabled/mxui";
5
- import { g as v } from "./AccountFields-C9FlatNb.mjs";
6
- import h from "react";
7
- import { G as E, d as y, m as S, u as _, f as G } from "./hooks-D6XlXHf4.mjs";
8
- import O from "@mui/material/Card";
9
- import P from "@mui/material/CardContent";
10
- import M from "@mui/material/CardHeader";
11
- import { useTheme as B } from "@mui/material/styles";
12
- import { g as H, a as U, b as j } from "./SpendingData-D5vsfYKo.mjs";
13
- import { L as z } from "./LineChart-D4GI7nVh.mjs";
14
- import { I as f, P as g, S as C } from "./Account-Bxw0_4FU.mjs";
15
- import { A } from "./ConnectDrawer-BQNs-hjk.mjs";
16
- import { L as Y } from "./Loader-DUaFpDGv.mjs";
17
- import { f as R, D as $ } from "./Dialog-CWW597AF.mjs";
18
- import { u as k } from "./useAccountDisplayName-BUAApBIb.mjs";
19
- import { f as F } from "./NumberFormatting-Buh7u8Oi.mjs";
20
- const b = () => {
21
- if (!h.useContext(E))
22
- throw new Error("useCategoryUiStore() must be used within the GlobalDataContext");
23
- return y().uiStore;
24
- }, V = (o, n) => {
25
- const t = f.includes(n) ? H(o) : [], a = g.includes(n) ? U(o) : [], r = C.includes(n) ? j(o) : [];
26
- return [t, a, r].filter((s) => s.length > 0);
27
- }, W = (o, n, t) => {
28
- const [a, r] = o, s = a, c = r ?? a, i = [];
29
- if (s && c && f.includes(n)) {
30
- const l = s[s.length - 1].y;
31
- i.push({ label: t.income_label, amount: l });
32
- } else if (g.includes(n)) {
33
- const l = s[s.length - 1].y;
34
- i.push({ label: t.payments_label, amount: l });
35
- }
36
- if (c && C.includes(n)) {
37
- const l = c[c.length - 1].y;
38
- i.push({ label: t.spending_label, amount: l });
39
- }
40
- return i;
41
- }, q = () => {
42
- const o = B(), { selectedAccount: n } = b(), { monthlyCategoryTotals: t } = S(), { trends: a } = _(), r = [o.palette.chart?.chart1, o.palette.chart?.chart2], s = V(t, n.account_type), c = W(s, n.account_type, a), i = [A.LOAN, A.MORTGAGE].includes(n.account_type);
43
- return /* @__PURE__ */ e("div", { "data-testid": "TrendsChart", children: /* @__PURE__ */ e(
44
- z,
45
- {
46
- colors: r,
47
- datasets: s,
48
- height: 185,
49
- labels: c,
50
- showAverage: i,
51
- showBars: i,
52
- showLegend: !0,
53
- valueFormatterString: "0,0"
54
- }
55
- ) });
56
- }, J = p(q), K = ({ sx: o }) => {
57
- const { loadMonthlyCategoryTotals: n } = S(), { isInitialized: t } = G(), { selectedAccount: a } = b(), [r, s] = h.useState(!1);
58
- return h.useEffect(() => {
59
- t && n([a]).finally(() => {
60
- s(!0);
61
- });
62
- }, [t, a]), !t || !r ? /* @__PURE__ */ e(Y, {}) : /* @__PURE__ */ u(
63
- O,
64
- {
65
- sx: {
66
- "& .MuiCardContent-root:last-child": {
67
- pb: 0
68
- },
69
- ...o
70
- },
71
- children: [
72
- /* @__PURE__ */ e(
73
- M,
74
- {
75
- sx: { pb: 0 },
76
- title: /* @__PURE__ */ e(w, { sx: { pb: 4 }, children: R(/* @__PURE__ */ new Date(), $.MONTH_LONG) })
77
- }
78
- ),
79
- /* @__PURE__ */ e(P, { sx: { p: 0 }, children: /* @__PURE__ */ e(J, {}) })
80
- ]
81
- }
82
- );
83
- }, Q = p(K), X = ({ customDetailsChart: o }) => {
84
- const { institutions: n } = y(), { selectedAccount: t } = b(), { accounts: a } = _(), { firstSubtitle: r, firstValue: s, hasAvailableBalance: c, secondSubtitle: i, secondValue: l } = v(t, a), T = n.find(
85
- (N) => N.guid === t?.institution_guid
86
- ), D = [
87
- ...f,
88
- ...g,
89
- ...C
90
- ].includes(t.account_type), x = k(t);
91
- return /* @__PURE__ */ u(d, { bgcolor: "background.default", p: 24, children: [
92
- /* @__PURE__ */ u(d, { gap: 12, children: [
93
- /* @__PURE__ */ e(
94
- I,
95
- {
96
- alt: a.institution_logo_alt,
97
- institutionGuid: t.institution_guid || "",
98
- size: 64
99
- }
100
- ),
101
- /* @__PURE__ */ e(m, { variant: "Small", children: T?.name })
102
- ] }),
103
- /* @__PURE__ */ u(d, { gap: 8, mb: 24, mt: 4, children: [
104
- /* @__PURE__ */ e(L, { children: x }),
105
- /* @__PURE__ */ u(d, { direction: "row", justifyContent: "space-between", children: [
106
- /* @__PURE__ */ e(m, { bold: c, variant: "Body", children: r }),
107
- /* @__PURE__ */ e(m, { bold: !0, variant: "Body", children: F(s, "0,0.00") })
108
- ] }),
109
- /* @__PURE__ */ u(d, { direction: "row", justifyContent: "space-between", children: [
110
- /* @__PURE__ */ e(m, { variant: "Small", children: i }),
111
- /* @__PURE__ */ e(m, { variant: "Small", children: l })
112
- ] })
113
- ] }),
114
- D && /* @__PURE__ */ e(d, { children: o || /* @__PURE__ */ e(Q, {}) })
115
- ] });
116
- }, bt = p(X);
117
- export {
118
- bt as A,
119
- b as u
120
- };
@@ -1,27 +0,0 @@
1
- import { A as e, C as u, E as r, c as p, M as y } from "./ConnectDrawer-BQNs-hjk.mjs";
2
- const l = (t) => t && (t.account_type === e.CREDIT_CARD || t.account_type === e.LOAN || t.account_type === e.MORTGAGE || t.account_type === e.LINE_OF_CREDIT || t.account_type === e.CHECKING_LINE_OF_CREDIT), I = (t) => t.is_manual || !t.guid, R = (t) => t.account_type === e.LINE_OF_CREDIT || t.account_type === e.CREDIT_CARD || t.account_type === e.CHECKING_LINE_OF_CREDIT, f = (t) => t.account_type === e.SAVINGS || t.account_type === e.CHECKING || t.account_type === e.LINE_OF_CREDIT || t.account_type === e.CREDIT_CARD || t.account_type === e.LOAN || t.account_type === e.MORTGAGE, m = (t) => t.account_type === e.LOAN || t.account_type === e.MORTGAGE, A = (t, n, s, _) => t.filter((i) => !(i.member_is_managed_by_user && _)).sort(d).map((i) => {
3
- const c = n.find((a) => a.guid === i.institution_guid), o = s.find((a) => a.guid === i.member_guid);
4
- return E(i, c, o);
5
- }), E = (t, n, s) => {
6
- let _ = u.Connected;
7
- s && (r.includes(s.connection_status) ? _ = u.Error : p.includes(s.connection_status) ? _ = u.Processing : y.includes(s.connection_status) && (_ = u.RequiresMfa));
8
- const i = [
9
- t.user_name || t.feed_name || "",
10
- t.account_number ? `*${t.account_number}` : ""
11
- ].join(" ").trim();
12
- return {
13
- ...t,
14
- connectionStatus: _,
15
- displayName: i,
16
- institution: n,
17
- member: s
18
- };
19
- }, d = (t, n) => t.account_type > n.account_type ? 1 : t.account_type < n.account_type ? -1 : (t.name || "") > (n.name || "") ? 1 : (t.name || "") < (n.name || "") ? -1 : 0;
20
- export {
21
- l as a,
22
- R as b,
23
- m as c,
24
- A as d,
25
- I as i,
26
- f as u
27
- };
@@ -1,174 +0,0 @@
1
- import { makeAutoObservable as g } from "mobx";
2
- import { getUnixTime as n } from "date-fns/getUnixTime";
3
- import { subMonths as d } from "date-fns/subMonths";
4
- import { startOfMonth as y } from "date-fns/startOfMonth";
5
- import { endOfMonth as u } from "date-fns/endOfMonth";
6
- import { a as C, g as T } from "./CategoryUtil-pZRIYOgN.mjs";
7
- import { F as m, A as r } from "./Fetch-87LIQbEA.mjs";
8
- import { b as p, c as f } from "./Category-CevNQ03n.mjs";
9
- class c {
10
- fetchInstance;
11
- constructor(t, e, a) {
12
- this.fetchInstance = new m(t, e, void 0, a);
13
- }
14
- addCategory = async (t) => this.fetchInstance.post(r.CATEGORIES, t).then((e) => e.category);
15
- getCategories = async () => this.fetchInstance.get(r.CATEGORIES).then((t) => t.categories);
16
- getDateRangeCategoryTotals = async (t, e, a) => a.length === 0 ? [] : this.fetchInstance.post(`${r.DATE_RANGE_CATEGORY_TOTALS}/from/${t}/to/${e}`, {
17
- account_guid: a.map((o) => o.guid)
18
- }).then((o) => o.date_range_category_totals);
19
- getMonthlyCategoryTotals = async (t, e, a) => {
20
- try {
21
- const o = `${r.MONTHLY_CATEGORY_TOTALS}/from/${t}/to/${e}`;
22
- if (a) {
23
- const s = a.length === 0 ? [""] : a.map((h) => h.guid);
24
- return (await this.fetchInstance.post(o, { account_guid: s })).monthly_category_totals;
25
- } else
26
- return (await this.fetchInstance.get(o)).monthly_category_totals;
27
- } catch (o) {
28
- throw console.error("Error fetching monthly category totals:", o), o;
29
- }
30
- };
31
- removeCategory = async (t) => this.fetchInstance.delete(`${r.CATEGORIES}/${t}`);
32
- updateCategory = async (t) => this.fetchInstance.put(`${r.CATEGORIES}/${t.guid}`, t).then((e) => e.category);
33
- }
34
- class w {
35
- expandedGuid = null;
36
- selectedGuid = null;
37
- searchValue = "";
38
- showSelected = !0;
39
- shouldDisableDrawerScroll = !1;
40
- unselectable = [];
41
- unselectableText = "";
42
- savedOnSelect;
43
- // todo
44
- constructor() {
45
- g(this);
46
- }
47
- setExpandedGuid = (t) => this.expandedGuid = t;
48
- setSelectedGuid = (t) => this.selectedGuid = t;
49
- setSearchValue = (t) => this.searchValue = t;
50
- setShouldDisableDrawerScroll = (t) => this.shouldDisableDrawerScroll = t;
51
- setShowSelected = (t) => this.showSelected = t;
52
- setUnselectable = (t) => this.unselectable = t;
53
- setUnselectableText = (t) => this.unselectableText = t;
54
- onSelect = (t) => this.savedOnSelect(t);
55
- setOnSelect = (t) => this.savedOnSelect = t;
56
- }
57
- class L {
58
- globalStore;
59
- uiStore;
60
- api = new c("/", "");
61
- categories = [];
62
- categoriesLoaded = !1;
63
- dateRangeCategoryTotals = [];
64
- monthlyCategoryTotals = [];
65
- dataRangeTotalsLoaded = !1;
66
- isLoadingCategoryTotals = !1;
67
- monthlyTotalsLoaded = !1;
68
- constructor(t) {
69
- this.globalStore = t, this.uiStore = new w(), this.api = new c(t.endpoint, t.sessionToken, t.onError), g(this);
70
- }
71
- get detailedCategories() {
72
- return C(
73
- this.categories,
74
- this.globalStore.copyStore.copy.categories,
75
- this.dateRangeCategoryTotals,
76
- this.monthlyCategoryTotals
77
- );
78
- }
79
- get detailedCategoriesWithTransactions() {
80
- return T(
81
- this.detailedCategories,
82
- this.globalStore.transactionStore.sortedTransactions
83
- );
84
- }
85
- get incomeCategories() {
86
- return this.detailedCategories.filter((t) => t.is_income);
87
- }
88
- get spendCategories() {
89
- return this.detailedCategories.filter(
90
- (t) => !t.is_income && !t.isTransfer && t.guid !== p.INVESTMENTS
91
- );
92
- }
93
- get transferCategories() {
94
- return this.detailedCategories.filter((t) => t.isTransfer);
95
- }
96
- setCategories = (t) => {
97
- this.categories = t, this.categoriesLoaded = !0;
98
- };
99
- setMonthlyCategoryTotals = (t) => {
100
- this.monthlyCategoryTotals = t, this.monthlyTotalsLoaded = !0;
101
- };
102
- setDateRangeCategoryTotals = (t) => {
103
- this.dateRangeCategoryTotals = t, this.dataRangeTotalsLoaded = !0;
104
- };
105
- addCategory = async (t, e) => {
106
- const a = { name: t, parent_guid: e };
107
- try {
108
- await this.api.addCategory(a), await this.loadCategories();
109
- } catch (o) {
110
- console.error(`Error occurred while adding category: ${o}`);
111
- }
112
- };
113
- loadCategories = async () => {
114
- try {
115
- const t = await this.api.getCategories();
116
- this.setCategories(t);
117
- } catch (t) {
118
- console.error(`Error occurred while getting categories: ${t}`);
119
- }
120
- };
121
- loadDateRangeCategoryTotals = async (t, e, a) => {
122
- this.setIsLoadingCategoryTotals(!0);
123
- try {
124
- const o = await this.api.getDateRangeCategoryTotals(
125
- n(e),
126
- n(a),
127
- t
128
- );
129
- this.setDateRangeCategoryTotals(o), this.setIsLoadingCategoryTotals(!1);
130
- } catch (o) {
131
- this.setIsLoadingCategoryTotals(!1), console.error(`Error occurred while getting date range category totals: ${o}`);
132
- }
133
- };
134
- loadMonthlyCategoryTotals = async (t = this.globalStore.globalUiStore.selectedAccounts, e, a) => {
135
- const o = n(y(e ?? d(/* @__PURE__ */ new Date(), 11))), s = n(u(a ?? /* @__PURE__ */ new Date()));
136
- try {
137
- const i = await this.api.getMonthlyCategoryTotals(o, s, t);
138
- this.setMonthlyCategoryTotals(i);
139
- } catch (i) {
140
- console.error(`Error occurred while getting monthly category totals: ${i}`);
141
- }
142
- };
143
- reloadCategoryTotals = async (t, e, a) => {
144
- this.setIsLoadingCategoryTotals(!0);
145
- try {
146
- await this.loadMonthlyCategoryTotals(t, e, a), await this.loadDateRangeCategoryTotals(t, e, a);
147
- } catch (o) {
148
- console.error(`Error occurred while getting category totals: ${o}`);
149
- }
150
- };
151
- removeCategory = async (t) => {
152
- try {
153
- await this.api.removeCategory(t), await this.loadCategories();
154
- } catch (e) {
155
- console.error(`Error occurred while removing category: ${e}`);
156
- }
157
- };
158
- setIsLoadingCategoryTotals = (t) => {
159
- this.isLoadingCategoryTotals = t;
160
- };
161
- updateCategory = async (t) => {
162
- try {
163
- await this.api.updateCategory(t), await this.loadCategories();
164
- } catch (e) {
165
- console.error(`Error occurred while updating category: ${e}`);
166
- }
167
- };
168
- // TODO: Remove this after refactoring Trends components to use detailedCategories
169
- getCategoryName = (t) => this.categories.find((a) => a.guid === t)?.name ?? f[t];
170
- }
171
- export {
172
- L as C,
173
- c as a
174
- };
@@ -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-CevNQ03n.mjs";
7
- import { f as R, D as v } from "./Dialog-CWW597AF.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(/&amp;/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
- };
@@ -1,113 +0,0 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import n from "@mui/material/Box";
3
- import c from "@mui/material/Stack";
4
- import { H2 as D, Drawer as S, Footer as y } from "@mxenabled/mxui";
5
- import B from "@mui/material/IconButton";
6
- import { ArrowBack as C } from "@mxenabled/mx-icons";
7
- const j = ({
8
- ariaLabelClose: o,
9
- onClose: e,
10
- shouldShowBorders: a,
11
- shouldShowShadow: t,
12
- title: i
13
- }) => /* @__PURE__ */ p(
14
- c,
15
- {
16
- "aria-level": 1,
17
- direction: "row",
18
- role: "heading",
19
- sx: {
20
- alignItems: "center",
21
- backgroundColor: "background.paper",
22
- ...a && {
23
- borderBottom: 1,
24
- borderTop: 1,
25
- borderColor: "border.light"
26
- },
27
- ...t && {
28
- boxShadow: "0px 2px 8px 0px #6A73811F"
29
- },
30
- padding: "8px 8px 8px 8px"
31
- },
32
- children: [
33
- /* @__PURE__ */ r(B, { "aria-label": o, color: "primary", onClick: e, children: /* @__PURE__ */ r(C, { color: "primary", sx: { fontSize: 22 } }) }),
34
- /* @__PURE__ */ r(
35
- n,
36
- {
37
- sx: {
38
- flexGrow: 1,
39
- margin: "auto",
40
- textAlign: "center"
41
- },
42
- children: /* @__PURE__ */ r(D, { bold: !0, variant: "Body", children: i })
43
- }
44
- ),
45
- /* @__PURE__ */ r(n, { width: "44px" })
46
- ]
47
- }
48
- ), v = ({
49
- ariaLabelClose: o = "Close",
50
- children: e,
51
- hasSecondaryAction: a = !0,
52
- id: t,
53
- isOpen: i,
54
- isPrimaryDisabled: h,
55
- onClose: d,
56
- onPrimaryAction: l,
57
- onSecondaryAction: u,
58
- primaryColor: s = "primary",
59
- primaryText: x,
60
- secondaryColor: m = "secondary",
61
- secondaryText: b,
62
- shouldShowHeaderBorders: w = !0,
63
- shouldShowHeaderShadow: g = !1,
64
- title: f,
65
- ...k
66
- }) => /* @__PURE__ */ r(
67
- S,
68
- {
69
- id: t,
70
- isOpen: i,
71
- onClose: d,
72
- sx: {
73
- "& .MuiDrawer-paper": {
74
- backgroundColor: "background.default",
75
- borderRadius: 0
76
- },
77
- height: "100%",
78
- "& .MuiToolbar-root": {
79
- backgroundColor: "background.paper"
80
- }
81
- },
82
- ...k,
83
- children: /* @__PURE__ */ p(c, { height: "100%", justifyContent: "space-between", children: [
84
- /* @__PURE__ */ r(
85
- j,
86
- {
87
- ariaLabelClose: o,
88
- onClose: d,
89
- shouldShowBorders: w,
90
- shouldShowShadow: g,
91
- title: f
92
- }
93
- ),
94
- /* @__PURE__ */ r(n, { height: "100%", overflow: "auto", children: e }),
95
- l && /* @__PURE__ */ r(
96
- y,
97
- {
98
- hasSecondaryAction: a,
99
- isPrimaryDisabled: h,
100
- onPrimaryAction: l,
101
- onSecondaryAction: u ?? d,
102
- primaryColor: s,
103
- primaryText: x,
104
- secondaryColor: m,
105
- secondaryText: b
106
- }
107
- )
108
- ] })
109
- }
110
- ), $ = v;
111
- export {
112
- $ as D
113
- };