@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.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 (139) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
  3. package/dist/Account-CMjOp7S2.mjs +118 -0
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
  8. package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
  9. package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
  10. package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
  11. package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
  12. package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
  13. package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
  14. package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
  15. package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
  16. package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
  17. package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
  19. package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
  21. package/dist/Drawer-Bet2ZPJo.mjs +176 -0
  22. package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
  23. package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
  24. package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
  25. package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
  26. package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
  27. package/dist/LineChart-DHj-Bufi.mjs +580 -0
  28. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
  29. package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
  30. package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
  31. package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
  32. package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
  33. package/dist/NotificationSettings-e789PcRb.mjs +676 -0
  34. package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
  35. package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
  36. package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
  37. package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
  38. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
  39. package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
  40. package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
  41. package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
  42. package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
  43. package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
  44. package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
  45. package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
  46. package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
  47. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
  48. package/dist/accounts/index.es.js +933 -232
  49. package/dist/accounts/stores/AccountStore.d.ts +6 -2
  50. package/dist/accounts/utils/AccountDetails.d.ts +5 -0
  51. package/dist/analytics/index.es.js +2 -2
  52. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  53. package/dist/budgets/index.es.js +561 -522
  54. package/dist/cashflow/index.es.js +397 -396
  55. package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
  56. package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
  57. package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
  58. package/dist/categories/components/SubcategoryRow.d.ts +1 -0
  59. package/dist/categories/index.es.js +2 -2
  60. package/dist/categories/stores/CategoryStore.d.ts +5 -3
  61. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  62. package/dist/common/components/WidgetContainer.d.ts +7 -6
  63. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  64. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  65. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  66. package/dist/common/components/index.d.ts +2 -2
  67. package/dist/common/hooks/index.d.ts +1 -0
  68. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  69. package/dist/common/index.es.js +325 -306
  70. package/dist/common/stores/GlobalUiStore.d.ts +7 -4
  71. package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
  72. package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
  73. package/dist/common/types/localization/CommonCopy.d.ts +3 -0
  74. package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
  75. package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
  76. package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
  77. package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
  78. package/dist/dashboard/index.es.js +95 -125
  79. package/dist/debts/index.es.js +466 -460
  80. package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
  81. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  82. package/dist/finstrong/index.es.js +1660 -1553
  83. package/dist/goals/index.es.js +716 -677
  84. package/dist/goals/stores/GoalStore.d.ts +2 -0
  85. package/dist/help/index.es.js +14 -10
  86. package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
  87. package/dist/investments/index.es.js +464 -457
  88. package/dist/merchants/index.es.js +1 -1
  89. package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
  90. package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
  91. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
  92. package/dist/microinsights/beaticons/index.d.ts +1 -0
  93. package/dist/microinsights/cards/InsightCard.d.ts +0 -2
  94. package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
  95. package/dist/microinsights/index.d.ts +2 -2
  96. package/dist/microinsights/index.es.js +824 -14
  97. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  98. package/dist/networth/components/NetWorthList.d.ts +3 -3
  99. package/dist/networth/index.es.js +433 -438
  100. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  101. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  102. package/dist/notifications/index.es.js +5 -5
  103. package/dist/recurringtransactions/index.es.js +331 -325
  104. package/dist/settings/index.es.js +293 -285
  105. package/dist/spending/components/SpendingChart.d.ts +1 -1
  106. package/dist/spending/components/SpendingList.d.ts +1 -1
  107. package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
  108. package/dist/spending/index.es.js +250 -235
  109. package/dist/transactions/index.es.js +288 -281
  110. package/dist/transactions/stores/TransactionStore.d.ts +5 -0
  111. package/dist/trends/components/TrendsTable.d.ts +0 -2
  112. package/dist/trends/index.es.js +876 -802
  113. package/dist/trends/utils/TrendsData.d.ts +1 -0
  114. package/dist/trends/utils/TrendsTable.d.ts +12 -0
  115. package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
  116. package/dist/useAriaLive-B3_pRUio.mjs +35 -0
  117. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
  118. package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
  119. package/package.json +26 -21
  120. package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
  121. package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
  122. package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
  123. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  124. package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
  125. package/dist/Drawer-Dqe5EqvA.mjs +0 -163
  126. package/dist/LineChart-bc1D9xBE.mjs +0 -581
  127. package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
  128. package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
  129. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  130. package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
  131. package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
  132. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  133. package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
  134. package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
  135. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  136. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  137. package/dist/common/components/accountfilter/index.d.ts +0 -1
  138. package/dist/microinsights/cards/BaseCard.d.ts +0 -13
  139. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,38 +1,39 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import i from "react";
3
- import { observer as w } from "mobx-react-lite";
4
- import { startOfMonth as nt } from "date-fns/startOfMonth";
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { observer as A } from "mobx-react-lite";
4
+ import { startOfMonth as at } from "date-fns/startOfMonth";
5
5
  import { endOfMonth as ot } from "date-fns/endOfMonth";
6
6
  import v from "@mui/material/Box";
7
7
  import b from "@mui/material/Stack";
8
- import k from "@mui/material/Tab";
9
- import at from "@mui/material/Tabs";
10
- import mt from "@mui/material/styles/useTheme";
11
- import { g as it, a as rt, S as B, b as Y } from "../SpendingLegend-CZzDb-7d.mjs";
12
- import { Text as C, Icon as ht } from "@mxenabled/mxui";
8
+ import N from "@mui/material/Tab";
9
+ import it from "@mui/material/Tabs";
10
+ import yt from "@mui/material/styles/useTheme";
11
+ import { g as rt, a as st, S as k, b as Y } from "../SpendingLegend-BxefXiQd.mjs";
12
+ import { Text as T, Icon as _t } from "@mxenabled/mxui";
13
13
  import { f as R } from "../NumberFormatting-DjTD0t3W.mjs";
14
- import { u as L, m as W, d as st, b as P, a as F, h as ct, g as ft, n as bt } from "../hooks-C41HAxM5.mjs";
15
- import { L as lt } from "../Loader-BSWSYqvn.mjs";
16
- import { M as _t } from "../MiniWidgetContainer-D7MkHG15.mjs";
14
+ import { u as I, m as E, d as lt, b as z, a as V, h as ct, g as bt } from "../hooks-fY_n74f7.mjs";
15
+ import { L as dt } from "../Loader-BSWSYqvn.mjs";
16
+ import { M as Ct } from "../MiniWidgetContainer-DKn7ndO6.mjs";
17
+ import { u as gt } from "../useWidgetLoadTimer-CrUzxN-P.mjs";
17
18
  import { startOfToday as q } from "date-fns/startOfToday";
18
- import yt from "@mui/material/Button";
19
- import { useTheme as Ct } from "@mui/material";
20
- import { e as St } from "../exportTransactionsToCSV-BFpuIAXW.mjs";
21
- import { T as Tt, a as Mt } from "../TransactionDetails-Duv1X9ec.mjs";
22
- import Dt from "@mui/material/Collapse";
23
- import z from "@mui/material/Divider";
19
+ import St from "@mui/material/Button";
20
+ import { useTheme as Tt } from "@mui/material";
21
+ import { e as Mt } from "../exportTransactionsToCSV-BU1jTY0Q.mjs";
22
+ import { T as Dt, a as xt } from "../TransactionDetails-CPwv9xtZ.mjs";
23
+ import wt from "@mui/material/Collapse";
24
+ import F from "@mui/material/Divider";
24
25
  import J from "@mui/material/List";
25
26
  import Q from "@mui/material/ListItem";
26
- import xt from "@mui/material/ListItemButton";
27
- import { u as vt } from "../useScreenSize-B6JyS_Lj.mjs";
28
- import { D as Z } from "../Drawer-Dqe5EqvA.mjs";
29
- import { b as x } from "../Category-Ccoew_sA.mjs";
30
- import { A as tt, W as wt } from "../WidgetContainer-B1Jzb4XA.mjs";
31
- const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column", children: [
32
- /* @__PURE__ */ t(C, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
33
- /* @__PURE__ */ t(C, { variant: "XSmall", children: R(n, "0,0") })
34
- ] }), Lt = () => {
35
- const n = mt(), { goals: d, spending: o } = L(), { categories: r, dateRangeCategoryTotals: a } = W(), c = i.useMemo(
27
+ import Z from "@mui/material/ListItemButton";
28
+ import { u as Lt } from "../useScreenSize-B6JyS_Lj.mjs";
29
+ import { D as tt } from "../Drawer-Bet2ZPJo.mjs";
30
+ import { b as L } from "../Category-Ccoew_sA.mjs";
31
+ import { A as et, W as vt } from "../WidgetContainer-mzejMmz2.mjs";
32
+ const O = ({ amount: n, label: d, variant: a = "full" }) => /* @__PURE__ */ c(b, { direction: "column", children: [
33
+ /* @__PURE__ */ t(T, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
34
+ /* @__PURE__ */ t(T, { variant: "XSmall", children: R(n, a === "mini" ? "0,0" : "0,0.00") })
35
+ ] }), At = () => {
36
+ const n = yt(), { goals: d, spending: a } = I(), { categories: o, dateRangeCategoryTotals: i } = E(), g = l.useMemo(
36
37
  () => [
37
38
  n.palette.chartMono.chartMono5,
38
39
  n.palette.chartMono.chartMono4,
@@ -42,54 +43,56 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
42
43
  n.palette.chartMono.chartMono6
43
44
  ],
44
45
  [n]
45
- ), [e, l] = i.useState(""), [g, _] = i.useState(0), m = i.useMemo(
46
- () => it(r, d, n, a),
47
- [r, a]
48
- ), p = i.useMemo(
49
- () => rt(r, a, c),
50
- [r, a, c]
51
- ), A = (y, T) => {
52
- _(T), l("");
53
- }, f = (y) => {
54
- l(e === y ? "" : y);
46
+ ), [e, r] = l.useState(""), [p, _] = l.useState(0), u = l.useMemo(
47
+ () => rt(o, d, n, i),
48
+ [o, i]
49
+ ), m = l.useMemo(
50
+ () => st(o, i, g),
51
+ [o, i, g]
52
+ ), M = (f, D) => {
53
+ _(D), r("");
54
+ }, y = (f) => {
55
+ r(e === f ? "" : f);
55
56
  };
56
- return /* @__PURE__ */ s(v, { width: "100%", children: [
57
- /* @__PURE__ */ s(
58
- at,
57
+ return /* @__PURE__ */ c(v, { width: "100%", children: [
58
+ /* @__PURE__ */ c(
59
+ it,
59
60
  {
60
- "aria-label": o.mini_title,
61
- onChange: A,
62
- value: g,
61
+ "aria-label": a.mini_title,
62
+ onChange: M,
63
+ value: p,
63
64
  variant: "fullWidth",
64
65
  children: [
65
66
  /* @__PURE__ */ t(
66
- k,
67
+ N,
67
68
  {
68
69
  "aria-controls": "spending-tabpanel",
69
70
  id: "spending-tab",
70
71
  label: /* @__PURE__ */ t(
71
- G,
72
+ O,
72
73
  {
73
- amount: m.totalAmount,
74
- label: o.spend_tab_title
74
+ amount: u.totalAmount,
75
+ label: a.spend_tab_title,
76
+ variant: "mini"
75
77
  }
76
78
  ),
77
- tabIndex: g === 0 ? 0 : -1
79
+ tabIndex: p === 0 ? 0 : -1
78
80
  }
79
81
  ),
80
82
  /* @__PURE__ */ t(
81
- k,
83
+ N,
82
84
  {
83
85
  "aria-controls": "income-tabpanel",
84
86
  id: "income-tab",
85
87
  label: /* @__PURE__ */ t(
86
- G,
88
+ O,
87
89
  {
88
- amount: p.totalAmount,
89
- label: o.income_tab_title
90
+ amount: m.totalAmount,
91
+ label: a.income_tab_title,
92
+ variant: "mini"
90
93
  }
91
94
  ),
92
- tabIndex: g === 1 ? 0 : -1
95
+ tabIndex: p === 1 ? 0 : -1
93
96
  }
94
97
  )
95
98
  ]
@@ -99,20 +102,20 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
99
102
  v,
100
103
  {
101
104
  "aria-labelledby": "spending-tab",
102
- hidden: g !== 0,
105
+ hidden: p !== 0,
103
106
  id: "spending-tabpanel",
104
107
  role: "tabpanel",
105
- children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
108
+ children: /* @__PURE__ */ c(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
106
109
  /* @__PURE__ */ t(
107
- B,
110
+ k,
108
111
  {
109
- data: m,
110
- onSelected: f,
112
+ data: u,
113
+ onSelected: y,
111
114
  selectedId: e,
112
- totalLabel: o.total_spending
115
+ totalLabel: a.total_spending
113
116
  }
114
117
  ),
115
- /* @__PURE__ */ t(Y, { data: m, onSelected: f, selectedId: e })
118
+ /* @__PURE__ */ t(Y, { data: u, onSelected: y, selectedId: e })
116
119
  ] })
117
120
  }
118
121
  ),
@@ -120,59 +123,60 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
120
123
  v,
121
124
  {
122
125
  "aria-labelledby": "income-tab",
123
- hidden: g !== 1,
126
+ hidden: p !== 1,
124
127
  id: "income-tabpanel",
125
128
  role: "tabpanel",
126
- children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
129
+ children: /* @__PURE__ */ c(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
127
130
  /* @__PURE__ */ t(
128
- B,
131
+ k,
129
132
  {
130
- data: p,
133
+ data: m,
131
134
  isIncome: !0,
132
- onSelected: f,
135
+ onSelected: y,
133
136
  selectedId: e,
134
- totalLabel: o.total_income
137
+ totalLabel: a.total_income
135
138
  }
136
139
  ),
137
- /* @__PURE__ */ t(Y, { data: p, onSelected: f, selectedId: e })
140
+ /* @__PURE__ */ t(Y, { data: m, onSelected: y, selectedId: e })
138
141
  ] })
139
142
  }
140
143
  )
141
144
  ] });
142
- }, At = w(Lt), It = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
143
- const { isAccountDataLoaded: o, loadAccountData: r, visibleAccounts: a } = st(), { categoriesLoaded: c, loadCategories: e, loadDateRangeCategoryTotals: l } = W(), { spending: g } = L(), { isInitialized: _, selectedAccounts: m, setSelectedAccounts: p } = P();
144
- return i.useEffect(() => {
145
- o || r().finally(), c || e().finally();
146
- }, []), i.useEffect(() => {
147
- p(a);
148
- }, [a]), i.useEffect(() => {
149
- l(
150
- m,
151
- nt(/* @__PURE__ */ new Date()),
145
+ }, It = A(At), Et = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
146
+ const { isAccountDataLoaded: a, loadAccountData: o } = lt(), { dateRangeTotalsLoaded: i, categoriesLoaded: g, loadCategories: e, loadDateRangeCategoryTotals: r } = E(), { spending: p } = I(), { isInitialized: _, selectedAccounts: u } = z();
147
+ return gt({
148
+ widgetName: "SpendingMiniWidget",
149
+ isLoaded: i
150
+ }), l.useEffect(() => {
151
+ a || o().finally(), g || e().finally();
152
+ }, []), l.useEffect(() => {
153
+ r(
154
+ u,
155
+ at(/* @__PURE__ */ new Date()),
152
156
  ot(/* @__PURE__ */ new Date())
153
157
  ).finally();
154
- }, [m]), _ ? /* @__PURE__ */ t(
155
- _t,
158
+ }, [u]), _ ? /* @__PURE__ */ t(
159
+ Ct,
156
160
  {
157
161
  className: "mx-exp-spending-miniwidget",
158
162
  onPrimaryCtaClick: n,
159
- primaryCtaLabel: g.primary_cta,
163
+ primaryCtaLabel: p.primary_cta,
160
164
  sx: { height: "100%", ...d },
161
- title: g.mini_title,
162
- children: /* @__PURE__ */ t(At, {})
165
+ title: p.mini_title,
166
+ children: /* @__PURE__ */ t(It, {})
163
167
  }
164
- ) : /* @__PURE__ */ t(lt, {});
165
- }, me = w(It), Et = ({
168
+ ) : /* @__PURE__ */ t(dt, {});
169
+ }, fe = A(Et), Wt = ({
166
170
  data: n,
167
171
  onSelected: d,
168
- selectedId: o = "",
169
- title: r
172
+ selectedId: a = "",
173
+ title: o
170
174
  }) => {
171
- const { spending: a } = L(), c = n.categoryData.find((e) => e.guid === o);
172
- return /* @__PURE__ */ s(b, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
173
- /* @__PURE__ */ t(C, { bold: !0, sx: { py: 12 }, children: `${r} ${a.by_category}` }),
174
- /* @__PURE__ */ t(z, { "aria-hidden": "true" }),
175
- /* @__PURE__ */ t(J, { children: n.categoryData.map((e) => /* @__PURE__ */ s(i.Fragment, { children: [
175
+ const { spending: i } = I(), g = n.categoryData.find((e) => e.guid === a);
176
+ return /* @__PURE__ */ c(b, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
177
+ /* @__PURE__ */ t(T, { bold: !0, id: "spending-list-title", sx: { py: 12 }, variant: "h3", children: `${o} ${i.by_category}` }),
178
+ /* @__PURE__ */ t(F, { "aria-hidden": "true" }),
179
+ /* @__PURE__ */ t(J, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ c(l.Fragment, { children: [
176
180
  /* @__PURE__ */ t(
177
181
  Q,
178
182
  {
@@ -181,10 +185,11 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
181
185
  sx: {
182
186
  minHeight: 44
183
187
  },
184
- children: /* @__PURE__ */ s(
185
- xt,
188
+ children: /* @__PURE__ */ c(
189
+ Z,
186
190
  {
187
- "aria-expanded": c?.guid === e.guid,
191
+ "aria-expanded": g?.guid === e.guid,
192
+ id: `spending-list-category-${e.guid}`,
188
193
  onClick: () => d(e.guid),
189
194
  sx: { minHeight: 44, px: 8, py: 0 },
190
195
  children: [
@@ -198,7 +203,7 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
198
203
  width: 8
199
204
  }
200
205
  ),
201
- /* @__PURE__ */ s(
206
+ /* @__PURE__ */ c(
202
207
  b,
203
208
  {
204
209
  alignItems: "center",
@@ -206,8 +211,8 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
206
211
  justifyContent: "space-between",
207
212
  width: "100%",
208
213
  children: [
209
- /* @__PURE__ */ t(C, { bold: o === e.guid, children: e.name }),
210
- /* @__PURE__ */ t(C, { bold: o === e.guid, variant: "Body", children: R(e.amount, "0,0") })
214
+ /* @__PURE__ */ t(T, { bold: a === e.guid, children: e.name }),
215
+ /* @__PURE__ */ t(T, { bold: a === e.guid, variant: "Body", children: R(e.amount, "0,0.00") })
211
216
  ]
212
217
  }
213
218
  )
@@ -216,40 +221,47 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
216
221
  )
217
222
  }
218
223
  ),
219
- /* @__PURE__ */ t(z, {}),
220
- e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(Dt, { in: c?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ s(J, { children: [
221
- c?.categoryTotals?.map((l) => /* @__PURE__ */ t(
224
+ /* @__PURE__ */ t(F, {}),
225
+ e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(wt, { in: g?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ c(J, { children: [
226
+ g?.categoryTotals?.map((r) => /* @__PURE__ */ t(
222
227
  Q,
223
228
  {
224
229
  sx: {
225
- pl: 24,
226
- pr: 8,
230
+ pl: 12,
227
231
  py: 0
228
232
  },
229
- children: /* @__PURE__ */ s(b, { direction: "row", justifyContent: "space-between", width: "100%", children: [
230
- /* @__PURE__ */ s(C, { children: [
231
- l.name,
232
- " "
233
- ] }),
234
- /* @__PURE__ */ t(C, { children: R(l.amount, "0,0") })
235
- ] })
233
+ children: /* @__PURE__ */ t(
234
+ Z,
235
+ {
236
+ id: `spending-list-subcategory-${r.guid}`,
237
+ onClick: () => d(r.guid, !0),
238
+ sx: { minHeight: 44, px: 8, py: 0 },
239
+ children: /* @__PURE__ */ c(b, { direction: "row", justifyContent: "space-between", width: "100%", children: [
240
+ /* @__PURE__ */ c(T, { children: [
241
+ r.name,
242
+ " "
243
+ ] }),
244
+ /* @__PURE__ */ t(T, { children: R(r.amount, "0,0.00") })
245
+ ] })
246
+ }
247
+ )
236
248
  },
237
- l.guid
249
+ r.guid
238
250
  )),
239
- /* @__PURE__ */ t(z, {})
251
+ /* @__PURE__ */ t(F, {})
240
252
  ] }) })
241
253
  ] }, e.guid)) }),
242
- /* @__PURE__ */ t(C, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${a.total}: ${R(n.totalAmount, "0,0")}` })
254
+ /* @__PURE__ */ t(T, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${R(n.totalAmount, "0,0.00")}` })
243
255
  ] });
244
- }, Wt = w(Et), Nt = ({
256
+ }, Rt = A(Wt), Nt = ({
245
257
  data: n,
246
258
  onSelected: d,
247
- onViewTransactions: o,
248
- selectedId: r,
249
- title: a
259
+ onViewTransactions: a,
260
+ selectedId: o,
261
+ title: i
250
262
  }) => {
251
- const { isDesktop: c, isMobile: e } = vt(), { isLoadingCategoryTotals: l } = W(), { spending: g } = L();
252
- return /* @__PURE__ */ s(
263
+ const { isDesktop: g, isMobile: e } = Lt(), { dateRangeTotalsLoading: r } = E(), { spending: p } = I();
264
+ return /* @__PURE__ */ c(
253
265
  b,
254
266
  {
255
267
  alignItems: e ? "center" : "flex-start",
@@ -259,8 +271,8 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
259
271
  pt: 50,
260
272
  px: 8,
261
273
  children: [
262
- l && /* @__PURE__ */ t(
263
- B,
274
+ r && /* @__PURE__ */ t(
275
+ k,
264
276
  {
265
277
  data: {
266
278
  categoryData: [],
@@ -270,103 +282,114 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
270
282
  onSelected: () => {
271
283
  },
272
284
  selectedId: "",
273
- size: c ? 400 : 300,
285
+ size: g ? 400 : 300,
274
286
  totalLabel: "Loading ...",
275
287
  variant: "full"
276
288
  }
277
289
  ),
278
- !l && /* @__PURE__ */ t(
279
- B,
290
+ !r && /* @__PURE__ */ t(
291
+ k,
280
292
  {
281
293
  data: n,
282
- onSelected: d,
283
- onViewTransactions: o,
284
- selectedId: r,
285
- size: c ? 400 : 300,
286
- totalLabel: g.total_amount,
294
+ onSelected: (m) => {
295
+ d(m), setTimeout(() => document.getElementById(`spending-list-category-${m}`)?.focus(), 0);
296
+ },
297
+ onViewTransactions: a,
298
+ selectedId: o,
299
+ size: g ? 400 : 300,
300
+ totalLabel: p.total_amount,
287
301
  variant: "full"
288
302
  }
289
303
  ),
290
- /* @__PURE__ */ t(Wt, { data: n, onSelected: d, selectedId: r, title: a })
304
+ /* @__PURE__ */ t(Rt, { data: n, onSelected: d, selectedId: o, title: i })
291
305
  ]
292
306
  }
293
307
  );
294
- }, et = w(Nt), Ot = (n) => [
308
+ }, nt = A(Nt), kt = (n) => [
295
309
  n.palette.chartMono.chartMono5,
296
310
  n.palette.chartMono.chartMono4,
297
311
  n.palette.chartMono.chartMono3,
298
312
  n.palette.chartMono.chartMono2,
299
313
  n.palette.chartMono.chartMono1,
300
314
  n.palette.chartMono.chartMono6
301
- ], Rt = () => {
302
- const n = Ct(), { is_mobile_webview: d } = F(), { clientConfig: o } = F(), { categories: r, dateRangeCategoryTotals: a } = W(), {
303
- goals: c,
315
+ ], Ot = () => {
316
+ const n = Tt(), { is_mobile_webview: d } = V(), { clientConfig: a } = V(), { categories: o, dateRangeCategoryTotals: i } = E(), {
317
+ goals: g,
304
318
  spending: e,
305
- transactions: l
306
- } = L(), { displayedDateRange: g, selectedAccountGuids: _ } = P(), {
307
- setFilter: m,
308
- sortedTransactions: p,
309
- sortedTransactionsWithSplits: A,
310
- tags: f
311
- } = ct(), y = o?.master?.deep_link_params?.account_guids, T = o?.master?.deep_link_params?.view, [M, N] = i.useState(""), [D, S] = i.useState(T === "income" ? 1 : 0), [O, I] = i.useState(""), [dt, H] = i.useState(!1), j = i.useMemo(
312
- () => it(r, c, n, a),
313
- [r, a]
314
- ), K = i.useMemo(
315
- () => rt(r, a, Ot(n)),
316
- [r, a]
317
- ), $ = i.useMemo(
318
- () => p.find((u) => u.guid === O),
319
- [O, p]
320
- ), gt = (u, E) => {
321
- S(E), N("");
322
- }, U = (u) => {
323
- N(M === u || u === "0" ? "" : u);
324
- }, X = (u) => {
325
- const E = {
326
- accounts: y || _,
327
- dateRange: g
319
+ transactions: r
320
+ } = I(), { displayedDateRange: p, selectedAccountGuids: _ } = z(), {
321
+ setFilter: u,
322
+ sortedTransactions: m,
323
+ sortedTransactionsWithSplits: M,
324
+ tags: y
325
+ } = ct(), f = a?.master?.deep_link_params?.account_guids, D = a?.master?.deep_link_params?.view, [x, C] = l.useState(""), [w, W] = l.useState(D === "income" ? 1 : 0), [H, P] = l.useState(""), [pt, $] = l.useState(!1), B = l.useMemo(
326
+ () => rt(o, g, n, i),
327
+ [o, i]
328
+ ), K = l.useMemo(
329
+ () => st(o, i, kt(n)),
330
+ [o, i]
331
+ ), G = l.useMemo(
332
+ () => m.find((s) => s.guid === H),
333
+ [H, m]
334
+ ), ut = (s, S) => {
335
+ W(S), C("");
336
+ }, U = (s, S = !1) => {
337
+ S ? mt(s) : C(x === s || s === "0" ? "" : s);
338
+ }, mt = (s) => {
339
+ u({
340
+ ...{
341
+ accounts: f || _,
342
+ dateRange: p
343
+ },
344
+ custom: (h) => x === "other" ? h.top_level_category_guid === s : h.category_guid === s,
345
+ showSplits: !0
346
+ }), $(!0);
347
+ }, X = (s) => {
348
+ const S = {
349
+ accounts: f || _,
350
+ dateRange: p
328
351
  };
329
- if (D === 0)
330
- if (u === "other") {
331
- const h = j.categoryData.find((V) => V.guid === "other");
332
- m({
333
- ...E,
334
- custom: (V) => !!h?.categoryTotals?.find((ut) => ut.guid === V.top_level_category_guid)
352
+ if (w === 0)
353
+ if (s === "other") {
354
+ const h = B.categoryData.find((j) => j.guid === "other");
355
+ u({
356
+ ...S,
357
+ custom: (j) => !!h?.categoryTotals?.find((ft) => ft.guid === j.top_level_category_guid)
335
358
  });
336
359
  } else
337
- m({
338
- ...E,
339
- custom: (h) => u ? h.top_level_category_guid === u : h.top_level_category_guid !== x.INCOME && h.category_guid !== x.INCOME && h.top_level_category_guid !== x.INVESTMENTS && h.top_level_category_guid !== x.TRANSFER,
340
- showSplits: !!u
360
+ u({
361
+ ...S,
362
+ custom: (h) => s ? h.top_level_category_guid === s : h.top_level_category_guid !== L.INCOME && h.category_guid !== L.INCOME && h.top_level_category_guid !== L.INVESTMENTS && h.top_level_category_guid !== L.TRANSFER,
363
+ showSplits: !!s
341
364
  });
342
365
  else
343
- m({
344
- ...E,
345
- custom: (h) => u ? h.category_guid === u : h.category_guid === x.INCOME || h.top_level_category_guid === x.INCOME
366
+ u({
367
+ ...S,
368
+ custom: (h) => s ? h.category_guid === s : h.category_guid === L.INCOME || h.top_level_category_guid === L.INCOME
346
369
  });
347
- H(!0);
348
- }, pt = () => {
349
- St(A, f);
370
+ $(!0);
371
+ }, ht = () => {
372
+ Mt(M, y);
350
373
  };
351
- return /* @__PURE__ */ s(v, { children: [
352
- /* @__PURE__ */ s(at, { onChange: gt, value: D, variant: "fullWidth", children: [
374
+ return /* @__PURE__ */ c(v, { children: [
375
+ /* @__PURE__ */ c(it, { onChange: ut, value: w, variant: "fullWidth", children: [
353
376
  /* @__PURE__ */ t(
354
- k,
377
+ N,
355
378
  {
356
379
  label: /* @__PURE__ */ t(
357
- G,
380
+ O,
358
381
  {
359
- amount: j.totalAmount,
382
+ amount: B.totalAmount,
360
383
  label: e.spend_tab_title
361
384
  }
362
385
  )
363
386
  }
364
387
  ),
365
388
  /* @__PURE__ */ t(
366
- k,
389
+ N,
367
390
  {
368
391
  label: /* @__PURE__ */ t(
369
- G,
392
+ O,
370
393
  {
371
394
  amount: K.totalAmount,
372
395
  label: e.income_tab_title
@@ -375,96 +398,88 @@ const G = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
375
398
  }
376
399
  )
377
400
  ] }),
378
- D === 0 && /* @__PURE__ */ t(
379
- et,
401
+ w === 0 && /* @__PURE__ */ t(
402
+ nt,
380
403
  {
381
- data: j,
404
+ data: B,
382
405
  onSelected: U,
383
406
  onViewTransactions: X,
384
- selectedId: M,
407
+ selectedId: x,
385
408
  title: e.spend_tab_title
386
409
  }
387
410
  ),
388
- D === 1 && /* @__PURE__ */ t(
389
- et,
411
+ w === 1 && /* @__PURE__ */ t(
412
+ nt,
390
413
  {
391
414
  data: K,
392
415
  onSelected: U,
393
416
  onViewTransactions: X,
394
- selectedId: M,
417
+ selectedId: x,
395
418
  title: e.income_tab_title
396
419
  }
397
420
  ),
398
421
  /* @__PURE__ */ t(
399
- Z,
422
+ tt,
400
423
  {
401
424
  ariaLabelClose: e.close_drawer_aria,
402
- isOpen: dt,
403
- onClose: () => H(!1),
425
+ isOpen: pt,
426
+ onClose: () => $(!1),
404
427
  title: e.transactions_drawer_title,
405
- children: /* @__PURE__ */ s(b, { children: [
406
- !d && p.length > 0 && /* @__PURE__ */ t(b, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
407
- yt,
428
+ children: /* @__PURE__ */ c(b, { children: [
429
+ !d && m.length > 0 && /* @__PURE__ */ t(b, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
430
+ St,
408
431
  {
409
- onClick: pt,
410
- startIcon: /* @__PURE__ */ t(ht, { name: "ios_share" }),
432
+ onClick: ht,
433
+ startIcon: /* @__PURE__ */ t(_t, { name: "ios_share" }),
411
434
  variant: "text",
412
- children: l.export_csv_btn
435
+ children: r.export_csv_btn
413
436
  }
414
437
  ) }),
415
- /* @__PURE__ */ t(Tt, { onClick: I })
438
+ /* @__PURE__ */ t(Dt, { onClick: P })
416
439
  ] })
417
440
  }
418
441
  ),
419
442
  /* @__PURE__ */ t(
420
- Z,
443
+ tt,
421
444
  {
422
445
  ariaLabelClose: e.close_drawer_aria,
423
- isOpen: !!$,
424
- onClose: () => I(""),
446
+ isOpen: !!G,
447
+ onClose: () => P(""),
425
448
  title: e.transaction_details_drawer_title,
426
- children: $ && /* @__PURE__ */ t(Mt, { transaction: $ })
449
+ children: G && /* @__PURE__ */ t(xt, { transaction: G })
427
450
  }
428
451
  )
429
452
  ] });
430
- }, kt = w(Rt), Bt = ({ onBackClick: n, sx: d = {} }) => {
431
- const { visibleAccounts: o, isAccountDataLoaded: r, loadAccountData: a } = st(), { categoriesLoaded: c, loadCategories: e, loadDateRangeCategoryTotals: l } = W(), { isTransactionDataLoaded: g, loadTransactionData: _ } = ct(), { spending: m } = L(), {
432
- displayedDateRange: p,
433
- isInitialized: A,
434
- setDisplayedDate: f,
435
- setSelectedAccounts: y,
436
- selectedAccounts: T
437
- } = P(), { onEvent: M } = ft(), { onLoad: N } = bt(), { clientConfig: D } = F(), S = D?.master?.deep_link_params?.date_range;
438
- i.useEffect(() => {
439
- S && Array.isArray(S) && S.length === 2 ? f(S[0], S[1]) : f(nt(q()), ot(q())), r || a().finally(), c || e().finally(), g || _().finally(), M(tt.SPENDING_VIEW);
440
- }, []), i.useEffect(() => {
441
- y(o);
442
- }, [o]), i.useEffect(() => {
443
- l(
444
- T,
445
- p.start,
446
- p.end
447
- ).finally(() => {
448
- N?.("SpendingWidget");
449
- });
450
- }, [p, T]);
451
- const O = (I) => {
452
- f(I[0], I[1]);
453
+ }, $t = A(Ot), Bt = ({ onBackClick: n, sx: d = {} }) => {
454
+ const { isAccountDataLoaded: a, loadAccountData: o } = lt(), { categoriesLoaded: i, dateRangeTotalsLoaded: g, loadCategories: e, loadDateRangeCategoryTotals: r } = E(), { isTransactionDataLoaded: p, loadTransactionData: _ } = ct(), { spending: u } = I(), { displayedDateRange: m, isInitialized: M, setDisplayedDate: y, selectedAccounts: f } = z(), { onEvent: D } = bt(), { clientConfig: x } = V(), C = x?.master?.deep_link_params?.date_range;
455
+ gt({
456
+ widgetName: "SpendingWidget",
457
+ isLoaded: g
458
+ }), l.useEffect(() => {
459
+ C && Array.isArray(C) && C.length === 2 ? y(C[0], C[1]) : y(at(q()), ot(q())), a || o().finally(), i || e().finally(), p || _().finally(), D(et.SPENDING_VIEW);
460
+ }, []), l.useEffect(() => {
461
+ M && r(
462
+ f,
463
+ m.start,
464
+ m.end
465
+ ).finally();
466
+ }, [m, M, f]);
467
+ const w = (W) => {
468
+ y(W[0], W[1]);
453
469
  };
454
- return A ? /* @__PURE__ */ t(
455
- wt,
470
+ return M ? /* @__PURE__ */ t(
471
+ vt,
456
472
  {
457
- accountOptions: o,
458
- calendarActions: { onRangeChanged: O },
459
- onAccountsFilterClick: () => M(tt.SPENDING_CLICK_FILTER),
473
+ calendarActions: { onRangeChanged: w },
474
+ onAccountsFilterClick: () => D(et.SPENDING_CLICK_FILTER),
460
475
  onBackClick: n,
461
476
  sx: d,
462
- title: m.title,
463
- children: /* @__PURE__ */ t(v, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(kt, {}) })
477
+ title: u.title,
478
+ children: /* @__PURE__ */ t(v, { width: "100%", children: /* @__PURE__ */ t($t, {}) })
464
479
  }
465
- ) : /* @__PURE__ */ t(lt, {});
466
- }, he = w(Bt);
480
+ ) : /* @__PURE__ */ t(dt, {});
481
+ }, ye = A(Bt);
467
482
  export {
468
- me as SpendingMiniWidget,
469
- he as SpendingWidget
483
+ fe as SpendingMiniWidget,
484
+ ye as SpendingWidget
470
485
  };