@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.sms1

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 (182) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-BDXA6PWh.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CUztd3-b.mjs} +87 -83
  4. package/dist/AccountDetailsHeader-i3KFhNuo.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-QZspYAji.mjs} +6 -6
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DX5upmCS.mjs} +5 -5
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-BcnDpyLL.mjs} +19 -8
  8. package/dist/{Accounts-BRf_YeTf.mjs → Accounts-DXfZotRC.mjs} +1 -1
  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-Df2nII9u.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +23 -21
  13. package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-DTgyAMM7.mjs} +12 -10
  14. package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-C5cR-nfQ.mjs} +1 -1
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BIbTqYOH.mjs} +2 -2
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-BFfY3_zB.mjs} +3 -3
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-BFKcs-_K.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-BbJB0nmu.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-BEtCk82g.mjs +163 -0
  24. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  25. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-DzTrtPzk.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-DpWY3gVb.mjs} +5 -5
  29. package/dist/{Help-B6dIcujh.mjs → Help-BnPXM_N2.mjs} +2 -2
  30. package/dist/LineChart-bc1D9xBE.mjs +581 -0
  31. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
  32. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-NpXHhO1n.mjs} +177 -174
  33. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  34. package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  35. package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  36. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-lsuhEpn6.mjs} +2 -2
  37. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-CNmJWVeI.mjs} +241 -238
  38. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
  39. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  40. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +4 -4
  41. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-CqZh1SQa.mjs} +17 -17
  42. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BKcYmpv3.mjs} +46 -45
  43. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-Ni5tSQIO.mjs} +80 -73
  44. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  45. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  46. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
  47. package/dist/SpendingLegend-CjX-hX2O.mjs +193 -0
  48. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  49. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  50. package/dist/TransactionDetails-5M2vfr59.mjs +1379 -0
  51. package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-D-Q3BU9Z.mjs} +119 -121
  52. package/dist/TrendsStore-BW9FGQeE.mjs +182 -0
  53. package/dist/{User-BQUxBeZV.mjs → User-wXzDI4M8.mjs} +2 -2
  54. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-C0832BMe.mjs} +702 -723
  55. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-BhQ1Kx2z.mjs} +4 -4
  56. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  57. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  58. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  59. package/dist/accounts/index.es.js +229 -222
  60. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  61. package/dist/analytics/index.es.js +2 -2
  62. package/dist/budgets/index.es.js +380 -382
  63. package/dist/cashflow/index.es.js +405 -413
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +1 -1
  66. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  67. package/dist/common/components/Select.d.ts +4 -2
  68. package/dist/common/components/charts/LineChart.d.ts +12 -2
  69. package/dist/common/components/charts/index.d.ts +0 -3
  70. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  71. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  72. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  73. package/dist/common/components/drawer/Footer.d.ts +17 -0
  74. package/dist/common/hooks/index.d.ts +0 -1
  75. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  76. package/dist/common/index.es.js +320 -321
  77. package/dist/common/stores/GlobalStore.d.ts +7 -1
  78. package/dist/common/types/Finstrong.d.ts +54 -0
  79. package/dist/common/types/Global.d.ts +1 -0
  80. package/dist/common/types/Widgets.d.ts +1 -0
  81. package/dist/common/types/index.d.ts +1 -1
  82. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  83. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  84. package/dist/dashboard/index.es.js +2 -2
  85. package/dist/debts/index.es.js +506 -498
  86. package/dist/exportTransactionsToCSV-Cz2t0lmA.mjs +48 -0
  87. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  88. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  89. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  90. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  91. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  92. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  93. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  94. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  95. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  96. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  97. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  98. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  99. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  100. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  101. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  102. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  103. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  104. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  105. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  106. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  107. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  108. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  109. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  110. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  111. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  112. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  113. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  114. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  115. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  116. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  117. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  118. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  119. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  120. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  121. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  122. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  123. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  124. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  125. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  126. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  127. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  128. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  129. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  130. package/dist/finstrong/constants/index.d.ts +9 -0
  131. package/dist/finstrong/index.es.js +3171 -1063
  132. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  133. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  134. package/dist/goals/index.es.js +566 -562
  135. package/dist/help/index.es.js +3 -3
  136. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  137. package/dist/insights/index.es.js +1 -1
  138. package/dist/investments/index.es.js +437 -435
  139. package/dist/merchants/index.es.js +2 -2
  140. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  141. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  142. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  143. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  144. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  145. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  146. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  147. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  148. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  149. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  150. package/dist/microinsights/constants/App.d.ts +0 -1
  151. package/dist/microinsights/index.d.ts +3 -3
  152. package/dist/microinsights/index.es.js +7 -7
  153. package/dist/microinsights/interfaces.d.ts +0 -6
  154. package/dist/networth/index.es.js +188 -186
  155. package/dist/notifications/index.es.js +95 -96
  156. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  157. package/dist/recurringtransactions/index.es.js +584 -560
  158. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
  159. package/dist/settings/index.es.js +286 -280
  160. package/dist/spending/index.es.js +269 -421
  161. package/dist/spending/utils/SpendingData.d.ts +2 -1
  162. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  163. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  164. package/dist/transactions/index.es.js +226 -220
  165. package/dist/transactions/stores/TransactionStore.d.ts +1 -1
  166. package/dist/transactions/stores/UiStore.d.ts +0 -2
  167. package/dist/trends/index.es.js +963 -586
  168. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CFNF8766.mjs} +2 -2
  169. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  170. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  171. package/package.json +7 -7
  172. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  173. package/dist/Drawer-kEE73B87.mjs +0 -113
  174. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  175. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  176. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  177. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  178. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  179. package/dist/common/hooks/usePrevious.d.ts +0 -2
  180. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  181. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  182. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,559 +0,0 @@
1
- import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
- import M, { useRef as Ct, useState as bt, useEffect as vt } from "react";
3
- import L from "@mui/material/Box";
4
- import T from "@mui/material/Stack";
5
- import { useTheme as J } from "@mui/material/styles";
6
- import { LineChart as St } from "@mui/x-charts";
7
- import { u as K } from "./useScreenSize-B6JyS_Lj.mjs";
8
- import { u as _t } from "./useDimensions-27p2evRx.mjs";
9
- import { observer as Mt } from "mobx-react-lite";
10
- import Tt from "@mui/material/Card";
11
- import Dt from "@mui/material/CardContent";
12
- import P from "@mui/material/Divider";
13
- import X from "@mui/material/Grid";
14
- import { CategoryIcon as At, Text as S } from "@mxenabled/mxui";
15
- import { u as Lt, m as Q } from "./hooks-D6XlXHf4.mjs";
16
- import { b as Rt } from "./Localization-2MODESHW.mjs";
17
- import { C as O } from "./CurrencyText-kyC1aseI.mjs";
18
- import { useTheme as wt, Card as Ht, CardContent as It, Box as kt } from "@mui/material";
19
- import { f as R, D as w } from "./Dialog-CWW597AF.mjs";
20
- import Et from "@mui/material/Button";
21
- import { C as A, b as Gt, c as Nt } from "./Category-CevNQ03n.mjs";
22
- import { f as V } from "./NumberFormatting-Buh7u8Oi.mjs";
23
- import Bt from "@mui/material/ListItem";
24
- import Ot from "@mui/material/ListItemButton";
25
- import z from "@mui/material/ListItemIcon";
26
- import $t from "@mui/material/ListItemText";
27
- import { makeAutoObservable as Wt } from "mobx";
28
- import { addSeconds as jt } from "date-fns/addSeconds";
29
- import { differenceInCalendarMonths as Ft } from "date-fns/differenceInCalendarMonths";
30
- import { endOfMonth as q } from "date-fns/endOfMonth";
31
- import { subMonths as Yt } from "date-fns/subMonths";
32
- const U = ({ categoryGuid: r, topLevelCategoryGuid: e }) => {
33
- const { categories: o } = Lt(), { getCategoryName: a } = Q(), n = a(r);
34
- return /* @__PURE__ */ f(T, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
35
- /* @__PURE__ */ s(
36
- L,
37
- {
38
- "aria-label": Rt(o.category_icon_label_aria, n),
39
- mb: 4,
40
- role: "img",
41
- children: /* @__PURE__ */ s(At, { categoryGuid: e })
42
- }
43
- ),
44
- /* @__PURE__ */ s(S, { variant: "Body", children: n })
45
- ] });
46
- }, Pt = ({
47
- categoryGuids: { guid: r, topLevelGuid: e },
48
- hoveredAreaData: o,
49
- cursorPosition: a,
50
- chartContainerRef: n
51
- }) => {
52
- const i = J(), l = Ct(null), [h, g] = bt({ x: a.x, y: a.y });
53
- if (vt(() => {
54
- (() => {
55
- const u = l.current, x = n.current;
56
- if (!u || !x) return;
57
- const y = u.getBoundingClientRect(), b = x.getBoundingClientRect();
58
- let p = a.x, v = a.y;
59
- p + y.width * 2 > b.right ? p = a.x - y.width : p - y.width < b.left && (p = a.x), v + y.height * 2 > b.bottom && (v = a.y - y.height), g({ x: p, y: v });
60
- })();
61
- }, [a, n]), !o) return null;
62
- const C = o.reduce((d, u) => d + u.y, 0);
63
- return /* @__PURE__ */ s(
64
- Tt,
65
- {
66
- ref: l,
67
- sx: {
68
- position: "absolute",
69
- top: h.y,
70
- left: h.x,
71
- width: 250,
72
- pointerEvents: "none"
73
- },
74
- children: /* @__PURE__ */ f(Dt, { children: [
75
- /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
76
- /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
77
- /* @__PURE__ */ s(S, { variant: "Small", children: `${o.length}-month total` }),
78
- /* @__PURE__ */ s(O, { amount: C, bold: !0, formatString: "0,0", variant: "body2" })
79
- ] }),
80
- /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
81
- /* @__PURE__ */ s(X, { container: !0, children: o.map((d, u) => /* @__PURE__ */ f(M.Fragment, { children: [
82
- u > 0 && u % 3 === 0 && /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
83
- /* @__PURE__ */ s(X, { item: !0, xs: 4, children: /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
84
- /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "XSmall", children: d.x }),
85
- /* @__PURE__ */ s(
86
- O,
87
- {
88
- amount: d.y,
89
- bold: !0,
90
- formatString: "0,0",
91
- variant: "Body"
92
- }
93
- )
94
- ] }) })
95
- ] }, u)) })
96
- ] })
97
- }
98
- );
99
- }, Xt = Mt(Pt), Vt = ({
100
- categoryGuids: { guid: r, topLevelGuid: e },
101
- itemData: { dataIndex: o },
102
- series: a,
103
- xData: n
104
- }) => {
105
- const i = wt(), l = a.data[o], h = n[o];
106
- return l === void 0 || !h ? null : /* @__PURE__ */ s(Ht, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ s(It, { children: /* @__PURE__ */ f(kt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
107
- /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
108
- /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h, w.MONTH_SHORT_YEAR) }),
109
- /* @__PURE__ */ s(O, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
110
- ] }) }) });
111
- }, zt = ({
112
- sx: r,
113
- categoryGuids: e,
114
- hoveredLegend: o,
115
- legendRef: a,
116
- onHoverLegend: n,
117
- onClickLegend: i
118
- }) => {
119
- const { isMobile: l } = K(), { getCategoryName: h } = Q();
120
- return /* @__PURE__ */ s(
121
- T,
122
- {
123
- direction: "row",
124
- flexWrap: "wrap",
125
- gap: l ? 2 : 6,
126
- justifyContent: "start",
127
- ref: a,
128
- sx: r,
129
- children: e.map(({ guid: g, top_level_guid: C }) => {
130
- const d = o === g, u = A[g], x = A[C], y = u ?? x ?? A.default, b = y + "33";
131
- return /* @__PURE__ */ f(
132
- Et,
133
- {
134
- onClick: () => i(g),
135
- onMouseEnter: () => n(g),
136
- onMouseLeave: () => n(null),
137
- sx: {
138
- color: "text.primary",
139
- fontWeight: "normal",
140
- display: "flex",
141
- justifyContent: "center",
142
- alignItems: "center",
143
- paddingX: 8,
144
- paddingY: 4,
145
- borderRadius: 1,
146
- opacity: d ? 1 : 0.7
147
- },
148
- children: [
149
- /* @__PURE__ */ s(
150
- L,
151
- {
152
- sx: {
153
- width: 16,
154
- height: 16,
155
- marginRight: l ? 5 : 10,
156
- borderRadius: "2px",
157
- backgroundColor: o ? d ? y : b : y
158
- }
159
- }
160
- ),
161
- /* @__PURE__ */ s(S, { variant: "Body", children: h(g) })
162
- ]
163
- },
164
- g
165
- );
166
- })
167
- }
168
- );
169
- }, Ie = ({
170
- onHoverArea: r,
171
- onHoverPoint: e,
172
- onHoverLegend: o,
173
- onClickLegend: a,
174
- stackedDatasets: n,
175
- unstackedDatasets: i = [],
176
- availableHeight: l = 0,
177
- minimumHeight: h = 350
178
- }) => {
179
- const g = J(), { isMobile: C } = K(), [d, { height: u }] = _t(), x = M.useRef(null), [y, b] = M.useState(0);
180
- M.useEffect(() => {
181
- const t = Math.max(l - u, h);
182
- b(t);
183
- }, [l, u]);
184
- const [p, v] = M.useState(null), [Z, H] = M.useState({
185
- hoveredSeriesId: null,
186
- hoveredAreaData: null,
187
- isAreaHovered: !1,
188
- cursorPos: { x: 0, y: 0 }
189
- }), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered: tt, cursorPos: I } = Z, W = tt && D && $, j = !W, G = [...n, ...i], et = G[0]?.dataset.length ?? 0, N = G.flatMap((t) => t.dataset.map((c) => c.x)), ot = G.flatMap((t) => t.dataset.map((c) => c.y)), rt = n[0]?.dataset?.map(
190
- (t, c) => n.reduce((m, _) => m + _.dataset[c]?.y || 0, 0)
191
- ) ?? [0], at = Math.max(...rt), nt = Math.max(
192
- ...i.flatMap((t) => t.dataset.map((c) => c.y))
193
- ), st = Math.floor(Math.min(...ot) / 100) * 100, it = Math.ceil(Math.max(at, nt) / 100) * 100, k = n.map((t, c) => ({
194
- id: `stacked-${c}`,
195
- guid: t.category_guid,
196
- top_level_guid: t.top_level_category_guid,
197
- area: !0,
198
- color: n[c].category_color ?? g.palette.primary.main,
199
- data: t.dataset.map((m) => m.y),
200
- label: n[c].category_name,
201
- stack: "total",
202
- type: "line",
203
- highlightScope: { highlight: "item" },
204
- valueFormatter: (m) => V(m, "0,0")
205
- })), F = i.map((t, c) => ({
206
- id: `unstacked-${c}`,
207
- guid: t.category_guid,
208
- top_level_guid: t.top_level_category_guid,
209
- area: !1,
210
- color: t.category_color,
211
- data: t.dataset.map((m) => m.y),
212
- label: t.category_name,
213
- type: "line",
214
- valueFormatter: (m) => V(m, "0,0")
215
- })), Y = [...k, ...F], ct = [
216
- ...k.map(({ guid: t, top_level_guid: c }) => ({
217
- guid: t,
218
- top_level_guid: c
219
- })),
220
- ...F.map(({ guid: t, top_level_guid: c }) => ({
221
- guid: t,
222
- top_level_guid: c
223
- }))
224
- ], E = (t) => {
225
- const m = t.startsWith("stacked-") ? n[parseInt(t.split("-")[1])] : i[parseInt(t.split("-")[1])];
226
- return {
227
- guid: m?.category_guid,
228
- topLevelGuid: m?.top_level_category_guid
229
- };
230
- }, lt = (t) => {
231
- v(t), o?.(t ?? "");
232
- }, dt = (t) => {
233
- a?.(t ?? "");
234
- }, ut = () => {
235
- const t = E(String(D)).guid;
236
- t && a?.(t);
237
- }, mt = (t) => {
238
- const c = String(t?.seriesId), m = E(c).guid, _ = Y.find((B) => B.id === c), pt = _ && t?.dataIndex !== void 0, yt = _ && t?.dataIndex === void 0;
239
- if (pt)
240
- H({
241
- hoveredSeriesId: c,
242
- hoveredAreaData: null,
243
- isAreaHovered: !1,
244
- cursorPos: I
245
- }), e?.(m);
246
- else if (yt) {
247
- const B = _?.data.map((ft, xt) => ({
248
- x: N[xt],
249
- y: ft
250
- })) ?? [];
251
- H({
252
- hoveredSeriesId: c,
253
- hoveredAreaData: B,
254
- isAreaHovered: !0,
255
- cursorPos: I
256
- }), r?.(m);
257
- } else
258
- H({
259
- hoveredSeriesId: null,
260
- hoveredAreaData: null,
261
- isAreaHovered: !1,
262
- cursorPos: I
263
- });
264
- }, gt = (t) => {
265
- const c = t.currentTarget.getBoundingClientRect();
266
- H((m) => ({
267
- ...m,
268
- cursorPos: {
269
- x: t.clientX - c.left,
270
- y: t.clientY - c.top
271
- }
272
- }));
273
- }, ht = {
274
- p: 4,
275
- "& .MuiBarLabel-root": {
276
- fontSize: 10,
277
- fontWeight: 600
278
- },
279
- "& .MuiAreaElement-root": {
280
- opacity: 0.4,
281
- transition: "opacity 0.3s ease"
282
- },
283
- "& .MuiAreaElement-root:hover": {
284
- opacity: 1
285
- },
286
- '& [class*="MuiLineElement-series-unstacked-"]': {
287
- strokeWidth: 3
288
- },
289
- ...p && k.reduce((t, c, m) => {
290
- const _ = `.MuiAreaElement-series-stacked-${m}`;
291
- return t[_] = {
292
- opacity: k[m].guid === p ? 0.9 : 0.2
293
- }, t;
294
- }, {})
295
- };
296
- return /* @__PURE__ */ s(
297
- L,
298
- {
299
- onMouseMove: gt,
300
- ref: x,
301
- sx: {
302
- position: "relative",
303
- touchAction: "pan-y",
304
- "& svg": {
305
- touchAction: "pan-y",
306
- userSelect: "none"
307
- },
308
- "& .recharts-wrapper": {
309
- touchAction: "pan-y"
310
- }
311
- },
312
- children: /* @__PURE__ */ f(
313
- T,
314
- {
315
- direction: { xs: "column", md: "column" },
316
- spacing: { xs: 0, md: 4 },
317
- sx: { width: "100%", position: "relative" },
318
- children: [
319
- /* @__PURE__ */ s(
320
- St,
321
- {
322
- height: y,
323
- margin: { bottom: 50 },
324
- onAreaClick: ut,
325
- onHighlightChange: mt,
326
- series: Y,
327
- skipAnimation: !0,
328
- slotProps: {
329
- legend: {
330
- hidden: !0
331
- }
332
- },
333
- slots: {
334
- itemContent: (t) => j && D ? /* @__PURE__ */ s(
335
- Vt,
336
- {
337
- categoryGuids: E(D),
338
- xData: N,
339
- ...t
340
- }
341
- ) : null
342
- },
343
- sx: ht,
344
- tooltip: {
345
- trigger: j ? "item" : "none"
346
- },
347
- xAxis: [
348
- {
349
- data: N,
350
- scaleType: "time",
351
- valueFormatter: (t) => R(t, w.MONTH_SHORT_YEAR),
352
- tickNumber: et
353
- // How many ticks to show on the x-axis
354
- }
355
- ],
356
- yAxis: [
357
- {
358
- min: st,
359
- max: it || 100
360
- }
361
- ]
362
- }
363
- ),
364
- /* @__PURE__ */ s(
365
- zt,
366
- {
367
- categoryGuids: ct,
368
- hoveredLegend: p,
369
- legendRef: d,
370
- onClickLegend: dt,
371
- onHoverLegend: lt,
372
- sx: { px: C ? 0 : 24 }
373
- }
374
- ),
375
- W && /* @__PURE__ */ s(
376
- Xt,
377
- {
378
- categoryGuids: E(D),
379
- chartContainerRef: x,
380
- cursorPosition: I,
381
- hoveredAreaData: $.map((t) => ({
382
- ...t,
383
- x: R(t.x, w.MONTH_SHORT_YEAR)
384
- }))
385
- }
386
- )
387
- ]
388
- }
389
- )
390
- }
391
- );
392
- }, ke = ({
393
- onClick: r,
394
- leftIcon: e,
395
- rightIcon: o,
396
- title: a,
397
- subtitle: n,
398
- rightContent: i,
399
- titleBold: l = !0,
400
- rightContentBold: h = !0
401
- }) => {
402
- const g = /* @__PURE__ */ f(M.Fragment, { children: [
403
- e && /* @__PURE__ */ s(z, { sx: { ml: 0 }, children: e }),
404
- /* @__PURE__ */ s($t, { children: /* @__PURE__ */ f(
405
- T,
406
- {
407
- sx: {
408
- alignItems: "center",
409
- flexDirection: "row",
410
- marginLeft: 12
411
- },
412
- children: [
413
- /* @__PURE__ */ f(T, { sx: { flex: 1, minWidth: 0 }, children: [
414
- /* @__PURE__ */ s(S, { bold: l, variant: "body1", children: a }),
415
- n && /* @__PURE__ */ s(S, { variant: "caption", children: n })
416
- ] }),
417
- /* @__PURE__ */ f(T, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
418
- i && /* @__PURE__ */ s(S, { bold: h, display: "flex", variant: "body1", children: i }),
419
- o && /* @__PURE__ */ s(z, { children: o })
420
- ] })
421
- ]
422
- }
423
- ) })
424
- ] });
425
- return /* @__PURE__ */ s(Bt, { sx: { bgcolor: "background.paper" }, children: r ? /* @__PURE__ */ s(
426
- Ot,
427
- {
428
- onClick: r,
429
- sx: {
430
- py: 14
431
- },
432
- children: g
433
- }
434
- ) : /* @__PURE__ */ s(
435
- T,
436
- {
437
- sx: {
438
- py: 14,
439
- px: 24,
440
- width: "100%",
441
- flexDirection: "row",
442
- alignItems: "center"
443
- },
444
- children: g
445
- }
446
- ) });
447
- }, qt = (r) => A[r] ?? A.default, Jt = (r) => Nt[r];
448
- function Kt(r, e) {
449
- const o = [], a = new Date(r);
450
- for (; a <= e; ) {
451
- const n = a.getFullYear(), i = String(a.getMonth() + 1).padStart(2, "0");
452
- o.push(+`${n}${i}`), a.setMonth(a.getMonth() + 1);
453
- }
454
- return o;
455
- }
456
- const Qt = (r) => r.reduce((o, a) => {
457
- const n = {
458
- top_level_category_guid: a.top_level_category_guid,
459
- category_guid: a.category_guid,
460
- amount: a.total,
461
- year_month: a.year_month
462
- }, { top_level_category_guid: i, category_guid: l } = n;
463
- return o[l] || (o[l] = []), o[l].push(n), i !== l && (o[i] || (o[i] = []), o[i].push(n)), o;
464
- }, {}), Ee = (r, e, o) => {
465
- const a = Qt(r), n = Kt(e, o);
466
- return Object.entries(a).map(([l, h]) => {
467
- const g = h[0].top_level_category_guid, C = n.map((d) => {
468
- const u = h.filter((p) => p.year_month === d).reduce((p, v) => p + Math.abs(v.amount), 0), x = Number(String(d).slice(0, 4)), y = Number(String(d).slice(4));
469
- return { x: new Date(x, y - 1), y: u };
470
- }).sort((d, u) => d.x.getTime() - u.x.getTime());
471
- return {
472
- top_level_category_guid: g,
473
- category_guid: l,
474
- category_name: Jt(l),
475
- category_color: qt(g),
476
- dataset: C
477
- };
478
- });
479
- }, Ge = (r, e) => {
480
- const o = typeof r == "string" ? parseFloat(r.replace(/[^0-9.-]+/g, "")) : r, a = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e;
481
- return (o || 0) - (a || 0);
482
- }, Ut = (r, e) => {
483
- const o = r.subCategories.filter((i) => i.currentAmount !== 0), a = r.totalMonthlyAmounts.slice(-e), n = (i) => i.substring(0, 3) + " " + i.slice(-4);
484
- return a.map((i) => {
485
- const l = n(i.label), h = o.map((d) => {
486
- const u = d.monthlyAmounts.slice(-e).find((x) => n(x.label) === l);
487
- return {
488
- label: d.name,
489
- amount: Math.abs(u?.amount || 0),
490
- header: l
491
- };
492
- }), g = r.monthlyAmounts.slice(-e).find((d) => n(d.label) === l);
493
- return [{
494
- label: r.name,
495
- amount: Math.abs(g?.amount || 0),
496
- header: l
497
- }, ...h].sort((d, u) => u.amount - d.amount);
498
- });
499
- }, Zt = (r, e) => {
500
- const o = r ? r.totalMonthlyAmounts.slice(-e).map((n) => ({
501
- x: n.label.substring(0, 3),
502
- y: Math.abs(n.amount)
503
- })) : [], a = r ? Ut(r, e) : [];
504
- return { monthlyAmounts: o, tooltipLabels: a };
505
- }, te = (r) => r.slice().filter(
506
- (e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !== Gt.INVESTMENTS
507
- ).sort((e, o) => Math.abs(o.totalAmount) - Math.abs(e.totalAmount));
508
- class Ne {
509
- globalStore;
510
- selectedCategoryData = null;
511
- selectedDateRange;
512
- visibleListLength = 5;
513
- constructor(e) {
514
- this.globalStore = e, this.selectedDateRange = {
515
- start: jt(q(Yt(/* @__PURE__ */ new Date(), 6)), 1),
516
- end: q(/* @__PURE__ */ new Date())
517
- }, Wt(this);
518
- }
519
- setSelectedCategoryData = (e) => {
520
- this.selectedCategoryData = e;
521
- };
522
- setSelectedDateRange = (e) => {
523
- this.selectedDateRange = e;
524
- };
525
- setVisibleListLength = (e) => {
526
- this.visibleListLength = e;
527
- };
528
- get sortedDetailedCategoriesWithTransactions() {
529
- return te(
530
- this.globalStore.categoryStore.detailedCategoriesWithTransactions
531
- );
532
- }
533
- get selectedDateRangeMonthCount() {
534
- return Ft(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
535
- }
536
- get selectedDateRangeMonthRange() {
537
- const e = R(this.selectedDateRange.start, w.MONTH_LONG), o = R(this.selectedDateRange.end, w.MONTH_LONG);
538
- return `${e} - ${o}`;
539
- }
540
- get visibleCategories() {
541
- return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
542
- }
543
- get collapsedCategories() {
544
- return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
545
- }
546
- get categoryDetailsChartData() {
547
- return Zt(
548
- this.selectedCategoryData,
549
- this.selectedDateRangeMonthCount
550
- );
551
- }
552
- }
553
- export {
554
- ke as L,
555
- Ie as S,
556
- Ne as T,
557
- Ge as a,
558
- Ee as g
559
- };
@@ -1,2 +0,0 @@
1
- export declare const usePrevious: (value: any) => undefined;
2
- export default usePrevious;
@@ -1,47 +0,0 @@
1
- import { fromUnixTime as d } from "date-fns/fromUnixTime";
2
- import { c as u } from "./Category-CevNQ03n.mjs";
3
- import { f as p, D as m } from "./Dialog-CWW597AF.mjs";
4
- import { T as g } from "./User-BQUxBeZV.mjs";
5
- function f(e) {
6
- return new Set(
7
- e.filter((n) => n.parent_guid !== void 0).map((n) => n.parent_guid)
8
- );
9
- }
10
- function T(e) {
11
- return e.reduce((n, t) => (t.parent_guid && (n[t.parent_guid] || (n[t.parent_guid] = []), n[t.parent_guid].push(t)), n), {});
12
- }
13
- function j(e, n) {
14
- const t = f(n), r = T(n), o = /* @__PURE__ */ new Set(), a = [];
15
- for (const s of e)
16
- t.has(s.guid) ? (r[s.guid] ?? []).slice().sort((i, c) => Math.abs(c.amount) - Math.abs(i.amount)).forEach((i) => {
17
- o.has(i.guid) || (a.push(i), o.add(i.guid));
18
- }) : o.has(s.guid) || (a.push(s), o.add(s.guid));
19
- return a;
20
- }
21
- const A = (e, n) => {
22
- const t = _(h(e, n)), r = encodeURIComponent(t), o = document.createElement("a");
23
- o.href = `data:attachment/csv;charset=utf-8,${r}`, o.download = "transactions.csv", document.body.appendChild(o), o.click(), document.body.removeChild(o);
24
- }, h = (e, n) => e.map((t) => ({
25
- Date: p(d(t.date), m.YEAR_MONTH_DAY),
26
- Description: C(t),
27
- "Original Description": t.feed_description,
28
- Amount: `${t.amount}`,
29
- Type: t.transaction_type === g.CREDIT ? "Credit" : "Debit",
30
- "Parent Category": u[t.top_level_category_guid || ""],
31
- Category: t.category,
32
- Account: t.account,
33
- Tags: y(t, n),
34
- Memo: t.memo
35
- })), l = (e) => e ? /[,"\n\r]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e : "", _ = (e) => {
36
- const n = Object.keys(e[0]).join(",").concat(`\r
37
- `), t = e.map((r) => Object.values(r).map(l).join(",")).join(`\r
38
- `);
39
- return n + t;
40
- }, C = (e) => {
41
- let n = e.parent_guid ? "Split: " : "";
42
- return n += e.is_hidden ? "(Excluded) " : "", n += e.description, n;
43
- }, y = (e, n) => e.tags.map((t) => n.filter((o) => o.guid === t)[0]?.name ?? "").join(" ");
44
- export {
45
- A as e,
46
- j as f
47
- };
@@ -1,6 +0,0 @@
1
- export declare const augmentChartData: (averageHealthScores: {
2
- health_scores: any[];
3
- }) => {
4
- x: string;
5
- y: any;
6
- }[];
@@ -1,35 +0,0 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import e from "react";
3
- import u from "@mui/material/Box";
4
- const x = (a = "polite") => {
5
- const [s, o] = e.useState(""), [t, r] = e.useState(a), n = e.useCallback((c, i) => {
6
- i && r(i), o(c);
7
- }, []), p = e.useMemo(
8
- () => /* @__PURE__ */ l(
9
- u,
10
- {
11
- "aria-atomic": "true",
12
- "aria-live": t,
13
- role: t === "assertive" ? "alert" : "status",
14
- sx: {
15
- position: "absolute",
16
- width: "1px",
17
- height: "1px",
18
- padding: 0,
19
- margin: "-1px",
20
- overflow: "hidden",
21
- clip: "rect(0 0 0 0)",
22
- clipPath: "inset(50%)",
23
- whiteSpace: "nowrap",
24
- border: 0
25
- },
26
- children: s
27
- }
28
- ),
29
- [s, t]
30
- );
31
- return { announce: n, ariaLive: p };
32
- };
33
- export {
34
- x as u
35
- };