@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,92 +1,96 @@
1
- import { jsxs as C, jsx as e, Fragment as dt } from "react/jsx-runtime";
2
- import c, { useRef as ut, useState as ht, useEffect as gt } from "react";
1
+ import { jsxs as C, jsx as e, Fragment as _t } from "react/jsx-runtime";
2
+ import u, { useRef as Tt, useState as bt, useEffect as St } from "react";
3
3
  import { observer as R } from "mobx-react-lite";
4
- import { CategoryIcon as ve, Text as z, Icon as Se, P as me, H3 as Pe, ChevronRightIcon as mt } from "@mxenabled/mxui";
5
- import W from "@mui/material/Box";
6
- import b from "@mui/material/Stack";
4
+ import { CategoryIcon as we, Text as X, Icon as Te, P as fe, H3 as Ue, ChevronRightIcon as xt } from "@mxenabled/mxui";
5
+ import A from "@mui/material/Box";
6
+ import x from "@mui/material/Stack";
7
7
  import be from "@mui/material/Button";
8
- import { addSeconds as Fe } from "date-fns/addSeconds";
9
- import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
10
- import { useTheme as we } from "@mui/material/styles";
11
- import { LineChart as pt } from "@mui/x-charts";
12
- import { u as J } from "../useScreenSize-B6JyS_Lj.mjs";
13
- import { u as ft } from "../useDimensions-27p2evRx.mjs";
14
- import Ct from "@mui/material/Card";
15
- import yt from "@mui/material/CardContent";
16
- import Re from "@mui/material/Divider";
17
- import We from "@mui/material/Grid";
18
- import { u as O, m as Y, g as P, b as fe, h as De, d as Le, w as Ce, q as ze, f as He, n as _t, a as Tt } from "../hooks-C41HAxM5.mjs";
19
- import { b as $e } from "../Localization-2MODESHW.mjs";
20
- import { C as xe } from "../CurrencyText-Dr0EZ7bp.mjs";
21
- import { useTheme as St, Card as bt, CardContent as xt, Box as vt, Stack as wt } from "@mui/material";
22
- import { f as Q, a as F } from "../Dialog-CDV0kKxj.mjs";
23
- import { a as Me, c as Dt } from "../Category-Ccoew_sA.mjs";
24
- import { f as oe, a as Lt } from "../NumberFormatting-DjTD0t3W.mjs";
25
- import { a as Et, g as It, L as Ke } from "../TrendsStore-_mRaFUdf.mjs";
26
- import { T as zn } from "../TrendsStore-_mRaFUdf.mjs";
27
- import { i as Mt, c as At, d as Rt, e as kt, f as Ht, h as Nt, g as je, b as Ye, j as Oe } from "../SpendingData-DPQ96k3x.mjs";
28
- import Wt from "@mui/material/ToggleButton";
29
- import Ot from "@mui/material/ToggleButtonGroup";
30
- import { DataGridPro as Gt } from "@mui/x-data-grid-pro";
31
- import { H as Ge } from "../HeaderCell-DjuifqHJ.mjs";
32
- import { T as V, b as Bt } from "../ViewMoreMicroCard-CH9E-jOx.mjs";
33
- import { A as w, W as Ue } from "../WidgetContainer-B1Jzb4XA.mjs";
34
- import { a as Xe, T as Ze } from "../TransactionDetails-Duv1X9ec.mjs";
35
- import { D as ke } from "../Drawer-Dqe5EqvA.mjs";
36
- import { L as pe } from "../Loader-BSWSYqvn.mjs";
37
- import { L as Ne } from "../LineChart-bc1D9xBE.mjs";
38
- import { M as Vt } from "../MiniWidgetContainer-D7MkHG15.mjs";
8
+ import { addSeconds as Xe } from "date-fns/addSeconds";
9
+ import { differenceInCalendarMonths as Se } from "date-fns/differenceInCalendarMonths";
10
+ import wt from "numeral";
11
+ import { useTheme as le } from "@mui/material/styles";
12
+ import { useItemTooltip as vt, ChartsTooltipContainer as Dt } from "@mui/x-charts/ChartsTooltip";
13
+ import { LineChart as Lt } from "@mui/x-charts/LineChart";
14
+ import { u as q } from "../useScreenSize-B6JyS_Lj.mjs";
15
+ import { u as It } from "../useDimensions-27p2evRx.mjs";
16
+ import Ze from "@mui/material/Card";
17
+ import Qe from "@mui/material/CardContent";
18
+ import He from "@mui/material/Divider";
19
+ import Be from "@mui/material/Grid";
20
+ import { u as k, m as J, g as z, b as ye, h as ve, d as De, v as Ce, p as qe, f as We, a as Je } from "../hooks-fY_n74f7.mjs";
21
+ import { b as et } from "../Localization-2MODESHW.mjs";
22
+ import { C as xe } from "../CurrencyText-C-85TnUF.mjs";
23
+ import { a as Re, b as Ve, c as Et } from "../Category-Ccoew_sA.mjs";
24
+ import { f as Q, D as B } from "../Dialog-CWymUiuO.mjs";
25
+ import { f as oe, a as Mt } from "../NumberFormatting-DjTD0t3W.mjs";
26
+ import { a as Fe, c as At, g as Rt, L as tt } from "../TrendsStore-BdsYfCc7.mjs";
27
+ import { T as Zn } from "../TrendsStore-BdsYfCc7.mjs";
28
+ import { c as kt, i as Ht, d as Nt, e as Wt, g as ot, b as nt, f as Pe } from "../SpendingData-B7NuTQ9s.mjs";
29
+ import Ot from "@mui/material/ToggleButton";
30
+ import Gt from "@mui/material/ToggleButtonGroup";
31
+ import { DataGridPro as Bt } from "@mui/x-data-grid-pro";
32
+ import { T as G, a as Vt } from "../ViewMoreMicroCard-CDWR16_h.mjs";
33
+ import { parseISO as st } from "date-fns/parseISO";
34
+ import { H as ke } from "../HeaderCell-DjuifqHJ.mjs";
35
+ import { A as v, W as rt } from "../WidgetContainer-mzejMmz2.mjs";
36
+ import { a as at, T as it } from "../TransactionDetails-CPwv9xtZ.mjs";
37
+ import { D as Ne } from "../Drawer-Bet2ZPJo.mjs";
38
+ import { L as Le } from "../Loader-BSWSYqvn.mjs";
39
+ import { u as Ie } from "../useWidgetLoadTimer-CrUzxN-P.mjs";
40
+ import { L as Oe } from "../LineChart-DHj-Bufi.mjs";
41
+ import { M as Ft } from "../MiniWidgetContainer-DKn7ndO6.mjs";
39
42
  import { subMonths as Pt } from "date-fns";
40
- import { TrendingUp as Ft, TrendingDown as zt, MultilineChart as $t, ExpandLess as Kt, ExpandMore as jt } from "@mxenabled/mx-icons";
41
- import { M as Yt } from "../MicroWidgetContainer-BGpNl5ZS.mjs";
42
- import Ut from "@mui/material/Collapse";
43
- import Xt from "@mui/material/List";
44
- import Zt from "@mui/material/ListItem";
43
+ import { TrendingUp as zt, TrendingDown as $t, MultilineChart as Kt, ExpandLess as Yt, ExpandMore as jt } from "@mxenabled/mx-icons";
44
+ import { M as Ut } from "../MicroWidgetContainer-DSyYwRCU.mjs";
45
+ import Xt from "@mui/material/Collapse";
46
+ import Zt from "@mui/material/List";
47
+ import Qt from "@mui/material/ListItem";
45
48
  import qt from "@mui/material/ListItemButton";
46
- import Qt from "@mui/material/ListItemIcon";
47
- import Jt from "@mui/material/ListItemText";
48
- import qe from "@mui/material/styles/useTheme";
49
- import eo from "@mui/material/Paper";
50
- import { b as to } from "../CategoryUtil-DfVKKkRf.mjs";
51
- import { E as oo } from "../ExportCsvAction-CQ1grpwo.mjs";
52
- import { u as no } from "../useInsightsEnabled-CNjP5cfR.mjs";
53
- import { E as so } from "../EmptyState-DoxNUae-.mjs";
54
- import { l as ao } from "../ConnectDrawer-Dn1MlqLz.mjs";
55
- const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
56
- const { categories: t } = O(), { getCategoryName: n } = Y(), s = n(o);
57
- return /* @__PURE__ */ C(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
49
+ import Jt from "@mui/material/ListItemIcon";
50
+ import eo from "@mui/material/ListItemText";
51
+ import ct from "@mui/material/styles/useTheme";
52
+ import { Stack as to } from "@mui/material";
53
+ import oo from "@mui/material/Paper";
54
+ import { b as no } from "../CategoryUtil-CFHBvaV4.mjs";
55
+ import { E as so } from "../ExportCsvAction-oG_Mn66T.mjs";
56
+ import { u as ro } from "../useInsightsEnabled-dhmXeSyF.mjs";
57
+ import { E as ao } from "../EmptyState-DoxNUae-.mjs";
58
+ import { b as io } from "../GlobalAccountFilter-BpWlPAl5.mjs";
59
+ const lt = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
60
+ const { categories: n } = k(), { getCategoryName: t } = J(), r = t(o);
61
+ return /* @__PURE__ */ C(x, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
58
62
  /* @__PURE__ */ e(
59
- W,
63
+ A,
60
64
  {
61
- "aria-label": $e(t.category_icon_label_aria, s),
65
+ "aria-label": et(n.category_icon_label_aria, r),
62
66
  mb: 4,
63
67
  role: "img",
64
- children: /* @__PURE__ */ e(ve, { categoryGuid: a })
68
+ children: /* @__PURE__ */ e(we, { categoryGuid: s })
65
69
  }
66
70
  ),
67
- /* @__PURE__ */ e(z, { variant: "Body", children: s })
71
+ /* @__PURE__ */ e(X, { variant: "Body", children: r })
68
72
  ] });
69
- }, ro = ({
70
- categoryGuids: { guid: o, topLevelGuid: a },
71
- hoveredAreaData: t,
72
- cursorPosition: n,
73
- chartContainerRef: s
73
+ }, co = ({
74
+ categoryGuids: { guid: o, topLevelGuid: s },
75
+ hoveredAreaData: n,
76
+ cursorPosition: t,
77
+ chartContainerRef: r
74
78
  }) => {
75
- const l = we(), m = ut(null), [h, i] = ht({ x: n.x, y: n.y });
76
- if (gt(() => {
79
+ const i = le(), d = Tt(null), [h, c] = bt({ x: t.x, y: t.y });
80
+ if (St(() => {
77
81
  (() => {
78
- const p = m.current, _ = s.current;
79
- if (!p || !_) return;
80
- const u = p.getBoundingClientRect(), y = _.getBoundingClientRect();
81
- let S = n.x, g = n.y;
82
- S + u.width * 2 > y.right ? S = n.x - u.width : S - u.width < y.left && (S = n.x), g + u.height * 2 > y.bottom && (g = n.y - u.height), i({ x: S, y: g });
82
+ const m = d.current, _ = r.current;
83
+ if (!m || !_) return;
84
+ const f = m.getBoundingClientRect(), g = _.getBoundingClientRect();
85
+ let y = t.x, w = t.y;
86
+ y + f.width * 2 > g.right ? y = t.x - f.width : y - f.width < g.left && (y = t.x), w + f.height * 2 > g.bottom && (w = t.y - f.height), c({ x: y, y: w });
83
87
  })();
84
- }, [n, s]), !t) return null;
85
- const d = t.reduce((f, p) => f + p.y, 0);
88
+ }, [t, r]), !n) return null;
89
+ const l = n.reduce((p, m) => p + m.y, 0);
86
90
  return /* @__PURE__ */ e(
87
- Ct,
91
+ Ze,
88
92
  {
89
- ref: m,
93
+ ref: d,
90
94
  sx: {
91
95
  position: "absolute",
92
96
  top: h.y,
@@ -94,69 +98,57 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
94
98
  width: 250,
95
99
  pointerEvents: "none"
96
100
  },
97
- children: /* @__PURE__ */ C(yt, { children: [
98
- /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
99
- /* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: a }),
100
- /* @__PURE__ */ e(z, { variant: "Small", children: `${t.length}-month total` }),
101
- /* @__PURE__ */ e(xe, { amount: d, bold: !0, formatString: "0,0", variant: "body2" })
101
+ children: /* @__PURE__ */ C(Qe, { children: [
102
+ /* @__PURE__ */ C(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
103
+ /* @__PURE__ */ e(lt, { categoryGuid: o, topLevelCategoryGuid: s }),
104
+ /* @__PURE__ */ e(X, { variant: "Small", children: `${n.length}-month total` }),
105
+ /* @__PURE__ */ e(xe, { amount: l, bold: !0, formatString: "0,0", variant: "body2" })
102
106
  ] }),
103
- /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
104
- /* @__PURE__ */ e(We, { container: !0, children: t.map((f, p) => /* @__PURE__ */ C(c.Fragment, { children: [
105
- p > 0 && p % 3 === 0 && /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
106
- /* @__PURE__ */ e(We, { item: !0, xs: 4, children: /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
107
- /* @__PURE__ */ e(z, { color: l.palette.text.secondary, variant: "XSmall", children: f.x }),
107
+ /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
108
+ /* @__PURE__ */ e(Be, { container: !0, children: n.map((p, m) => /* @__PURE__ */ C(u.Fragment, { children: [
109
+ m > 0 && m % 3 === 0 && /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
110
+ /* @__PURE__ */ e(Be, { item: !0, xs: 4, children: /* @__PURE__ */ C(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
111
+ /* @__PURE__ */ e(X, { color: i.palette.text.secondary, variant: "XSmall", children: p.x }),
108
112
  /* @__PURE__ */ e(
109
113
  xe,
110
114
  {
111
- amount: f.y,
115
+ amount: p.y,
112
116
  bold: !0,
113
117
  formatString: "0,0",
114
118
  variant: "Body"
115
119
  }
116
120
  )
117
121
  ] }) })
118
- ] }, p)) })
122
+ ] }, m)) })
119
123
  ] })
120
124
  }
121
125
  );
122
- }, io = R(ro), co = ({
123
- categoryGuids: { guid: o, topLevelGuid: a },
124
- itemData: { dataIndex: t },
125
- series: n,
126
- xData: s
127
- }) => {
128
- const l = St(), m = n.data[t], h = s[t];
129
- return m === void 0 || !h ? null : /* @__PURE__ */ e(bt, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(xt, { children: /* @__PURE__ */ C(vt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
130
- /* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: a }),
131
- /* @__PURE__ */ e(z, { color: l.palette.text.secondary, variant: "Small", children: Q(h, F.MONTH_SHORT_YEAR) }),
132
- /* @__PURE__ */ e(xe, { amount: String(m), bold: !0, formatString: "0,0", variant: "Body" })
133
- ] }) }) });
134
- }, lo = ({
126
+ }, lo = R(co), uo = ({
135
127
  sx: o,
136
- categoryGuids: a,
137
- hoveredLegend: t,
138
- legendRef: n,
139
- onHoverLegend: s,
140
- onClickLegend: l
128
+ categoryGuids: s,
129
+ hoveredLegend: n,
130
+ legendRef: t,
131
+ onHoverLegend: r,
132
+ onClickLegend: i
141
133
  }) => {
142
- const { isMobile: m } = J(), { getCategoryName: h } = Y();
134
+ const { isMobile: d } = q(), { getCategoryName: h } = J();
143
135
  return /* @__PURE__ */ e(
144
- b,
136
+ x,
145
137
  {
146
138
  direction: "row",
147
139
  flexWrap: "wrap",
148
- gap: m ? 2 : 6,
140
+ gap: d ? 2 : 6,
149
141
  justifyContent: "start",
150
- ref: n,
142
+ ref: t,
151
143
  sx: o,
152
- children: a.map(({ guid: i, top_level_guid: d }) => {
153
- const f = t === i, p = Me[i], _ = Me[d], u = p ?? _ ?? Me.default, y = u + "33";
144
+ children: s.map(({ guid: c, top_level_guid: l }) => {
145
+ const p = n === c, m = Re[c], _ = Re[l], f = m ?? _ ?? Re.default, g = f + "33";
154
146
  return /* @__PURE__ */ C(
155
147
  be,
156
148
  {
157
- onClick: () => l(i),
158
- onMouseEnter: () => s(i),
159
- onMouseLeave: () => s(null),
149
+ onClick: () => i(c),
150
+ onMouseEnter: () => r(c),
151
+ onMouseLeave: () => r(null),
160
152
  sx: {
161
153
  color: "text.primary",
162
154
  fontWeight: "normal",
@@ -166,134 +158,151 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
166
158
  paddingX: 8,
167
159
  paddingY: 4,
168
160
  borderRadius: 1,
169
- opacity: f ? 1 : 0.7
161
+ opacity: p ? 1 : 0.7
170
162
  },
171
163
  children: [
172
164
  /* @__PURE__ */ e(
173
- W,
165
+ A,
174
166
  {
175
167
  sx: {
176
168
  width: 16,
177
169
  height: 16,
178
- marginRight: m ? 5 : 10,
170
+ marginRight: d ? 5 : 10,
179
171
  borderRadius: "2px",
180
- backgroundColor: t ? f ? u : y : u
172
+ backgroundColor: n ? p ? f : g : f
181
173
  }
182
174
  }
183
175
  ),
184
- /* @__PURE__ */ e(z, { variant: "Body", children: h(i) })
176
+ /* @__PURE__ */ e(X, { variant: "Body", children: h(c) })
185
177
  ]
186
178
  },
187
- i
179
+ c
188
180
  );
189
181
  })
190
182
  }
191
183
  );
192
- }, uo = ({
184
+ }, ho = ({
185
+ categoryGuids: { guid: o, topLevelGuid: s },
186
+ series: n,
187
+ xData: t
188
+ }) => {
189
+ const r = vt(), i = le();
190
+ if (!r?.identifier) return null;
191
+ const { dataIndex: d, seriesId: h } = r.identifier;
192
+ if (d == null || !h) return null;
193
+ const l = n.find((m) => m.id === h)?.data?.[d], p = t?.[d];
194
+ return l === void 0 || !p ? null : /* @__PURE__ */ e(Ze, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ C(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
195
+ /* @__PURE__ */ e(lt, { categoryGuid: o, topLevelCategoryGuid: s }),
196
+ /* @__PURE__ */ e(X, { color: i.palette.text.secondary, variant: "Small", children: Q(p, B.MONTH_SHORT_YEAR) }),
197
+ /* @__PURE__ */ e(xe, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
198
+ ] }) }) });
199
+ }, go = ({
193
200
  onHoverArea: o,
194
- onHoverPoint: a,
195
- onHoverLegend: t,
196
- onClickLegend: n,
197
- stackedDatasets: s,
198
- unstackedDatasets: l = [],
199
- availableHeight: m = 0,
201
+ onHoverPoint: s,
202
+ onHoverLegend: n,
203
+ onClickLegend: t,
204
+ stackedDatasets: r,
205
+ unstackedDatasets: i = [],
206
+ availableHeight: d = 0,
200
207
  minimumHeight: h = 350
201
208
  }) => {
202
- const i = we(), { isMobile: d } = J(), [f, { height: p }] = ft(), _ = c.useRef(null), [u, y] = c.useState(0);
203
- c.useEffect(() => {
204
- const r = Math.max(m - p, h);
205
- y(r);
206
- }, [m, p]);
207
- const [S, g] = c.useState(null), [v, E] = c.useState({
209
+ const c = le(), { isMobile: l } = q(), [p, { height: m }] = It(), _ = u.useRef(null), [f, g] = u.useState(0);
210
+ u.useEffect(() => {
211
+ const a = Math.max(d - m, h);
212
+ g(a);
213
+ }, [d, m]);
214
+ const [y, w] = u.useState(null), [b, M] = u.useState({
208
215
  hoveredSeriesId: null,
209
216
  hoveredAreaData: null,
210
217
  isAreaHovered: !1,
211
218
  cursorPos: { x: 0, y: 0 }
212
- }), { hoveredSeriesId: I, hoveredAreaData: x, isAreaHovered: M, cursorPos: k } = v, A = M && I && x, G = !A, ee = [...s, ...l], ne = ee[0]?.dataset.length ?? 0, H = ee.flatMap((r) => r.dataset.map((T) => T.x)), ue = ee.flatMap((r) => r.dataset.map((T) => T.y)), B = s[0]?.dataset?.map(
213
- (r, T) => s.reduce((L, j) => L + j.dataset[T]?.y || 0, 0)
214
- ) ?? [0], se = Math.max(...B), ae = Math.max(
215
- ...l.flatMap((r) => r.dataset.map((T) => T.y))
216
- ), $ = Math.floor(Math.min(...ue) / 100) * 100, ye = Math.ceil(Math.max(se, ae) / 100) * 100, U = s.map((r, T) => ({
219
+ }), { hoveredSeriesId: I, hoveredAreaData: S, isAreaHovered: H, cursorPos: N } = b, $ = H && I && S, V = !$, K = [...r, ...i], E = K[0]?.dataset.length ?? 0, te = K.flatMap((a) => a.dataset.map((T) => T.x)), O = K.flatMap((a) => a.dataset.map((T) => T.y)), ne = r[0]?.dataset?.map(
220
+ (a, T) => r.reduce((L, U) => L + U.dataset[T]?.y || 0, 0)
221
+ ) ?? [0], se = Math.max(...ne), Z = Math.max(
222
+ ...i.flatMap((a) => a.dataset.map((T) => T.y))
223
+ ), de = Math.floor(Math.min(...O) / 100) * 100, ue = Math.ceil(Math.max(se, Z) / 100) * 100, F = r.map((a, T) => ({
217
224
  id: `stacked-${T}`,
218
- guid: r.category_guid,
219
- top_level_guid: r.top_level_category_guid,
225
+ guid: a.category_guid,
226
+ top_level_guid: a.top_level_category_guid,
220
227
  area: !0,
221
- color: s[T].category_color ?? i.palette.primary.main,
222
- data: r.dataset.map((L) => L.y),
223
- label: s[T].category_name,
228
+ color: r[T].category_color ?? c.palette.primary.main,
229
+ data: a.dataset.map((L) => L.y),
230
+ label: r[T].category_name,
224
231
  stack: "total",
225
232
  type: "line",
226
233
  highlightScope: { highlight: "item" },
227
234
  valueFormatter: (L) => oe(L, "0,0")
228
- })), K = l.map((r, T) => ({
235
+ })), re = i.map((a, T) => ({
229
236
  id: `unstacked-${T}`,
230
- guid: r.category_guid,
231
- top_level_guid: r.top_level_category_guid,
237
+ guid: a.category_guid,
238
+ top_level_guid: a.top_level_category_guid,
232
239
  area: !1,
233
- color: r.category_color,
234
- data: r.dataset.map((L) => L.y),
235
- label: r.category_name,
240
+ color: a.category_color,
241
+ data: a.dataset.map((L) => L.y),
242
+ label: a.category_name,
236
243
  type: "line",
237
244
  valueFormatter: (L) => oe(L, "0,0")
238
- })), re = [...U, ...K], X = [
239
- ...U.map(({ guid: r, top_level_guid: T }) => ({
240
- guid: r,
245
+ })), Y = [...F, ...re], he = [
246
+ ...F.map(({ guid: a, top_level_guid: T }) => ({
247
+ guid: a,
241
248
  top_level_guid: T
242
249
  })),
243
- ...K.map(({ guid: r, top_level_guid: T }) => ({
244
- guid: r,
250
+ ...re.map(({ guid: a, top_level_guid: T }) => ({
251
+ guid: a,
245
252
  top_level_guid: T
246
253
  }))
247
- ], Z = (r) => {
248
- const L = r.startsWith("stacked-") ? s[parseInt(r.split("-")[1])] : l[parseInt(r.split("-")[1])];
254
+ ], j = (a) => {
255
+ const L = a.startsWith("stacked-") ? r[parseInt(a.split("-")[1])] : i[parseInt(a.split("-")[1])];
249
256
  return {
250
257
  guid: L?.category_guid,
251
258
  topLevelGuid: L?.top_level_category_guid
252
259
  };
253
- }, te = (r) => {
254
- g(r), t?.(r ?? "");
255
- }, ie = (r) => {
256
- n?.(r ?? "");
257
- }, he = () => {
258
- const r = Z(String(I)).guid;
259
- r && n?.(r);
260
- }, ce = (r) => {
261
- const T = String(r?.seriesId), L = Z(T).guid, j = re.find((de) => de.id === T), _e = j && r?.dataIndex !== void 0, Ee = j && r?.dataIndex === void 0;
262
- if (_e)
263
- E({
260
+ }, ae = (a) => {
261
+ w(a), n?.(a ?? "");
262
+ }, ge = (a) => {
263
+ t?.(a ?? "");
264
+ }, ie = () => {
265
+ const a = j(String(I)).guid;
266
+ a && t?.(a);
267
+ }, ce = (a) => {
268
+ const T = String(a?.seriesId), L = j(T).guid, U = Y.find((me) => me.id === T), Ee = U && a?.dataIndex !== void 0, _e = U && a?.dataIndex === void 0;
269
+ if (Ee)
270
+ M({
264
271
  hoveredSeriesId: T,
265
272
  hoveredAreaData: null,
266
273
  isAreaHovered: !1,
267
- cursorPos: k
268
- }), a?.(L);
269
- else if (Ee) {
270
- const de = j?.data.map((Te, Ie) => ({
271
- x: H[Ie],
272
- y: Te
274
+ cursorPos: N
275
+ }), s?.(L);
276
+ else if (_e) {
277
+ const me = U?.data.map((Me, Ae) => ({
278
+ x: te[Ae],
279
+ y: Me
273
280
  })) ?? [];
274
- E({
281
+ M({
275
282
  hoveredSeriesId: T,
276
- hoveredAreaData: de,
283
+ hoveredAreaData: me,
277
284
  isAreaHovered: !0,
278
- cursorPos: k
285
+ cursorPos: N
279
286
  }), o?.(L);
280
287
  } else
281
- E({
288
+ M({
282
289
  hoveredSeriesId: null,
283
290
  hoveredAreaData: null,
284
291
  isAreaHovered: !1,
285
- cursorPos: k
292
+ cursorPos: N
286
293
  });
287
- }, le = (r) => {
288
- const T = r.currentTarget.getBoundingClientRect();
289
- E((L) => ({
294
+ }, D = (a) => {
295
+ if (a.target instanceof Element && a.target.classList[0]?.includes("MuiMarkElement-root"))
296
+ return;
297
+ const T = a.currentTarget.getBoundingClientRect();
298
+ M((L) => ({
290
299
  ...L,
291
300
  cursorPos: {
292
- x: r.clientX - T.left,
293
- y: r.clientY - T.top
301
+ x: a.clientX - T.left,
302
+ y: a.clientY - T.top
294
303
  }
295
304
  }));
296
- }, D = {
305
+ }, P = {
297
306
  p: 4,
298
307
  "& .MuiBarLabel-root": {
299
308
  fontSize: 10,
@@ -309,17 +318,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
309
318
  '& [class*="MuiLineElement-series-unstacked-"]': {
310
319
  strokeWidth: 3
311
320
  },
312
- ...S && U.reduce((r, T, L) => {
313
- const j = `.MuiAreaElement-series-stacked-${L}`;
314
- return r[j] = {
315
- opacity: U[L].guid === S ? 0.9 : 0.2
316
- }, r;
321
+ ...y && F.reduce((a, T, L) => {
322
+ const U = `.MuiAreaElement-series-stacked-${L}`;
323
+ return a[U] = {
324
+ opacity: F[L].guid === y ? 0.9 : 0.2
325
+ }, a;
317
326
  }, {})
318
327
  };
319
328
  return /* @__PURE__ */ e(
320
- W,
329
+ A,
321
330
  {
322
- onMouseMove: le,
331
+ onMouseMove: D,
323
332
  ref: _,
324
333
  sx: {
325
334
  position: "relative",
@@ -333,77 +342,75 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
333
342
  }
334
343
  },
335
344
  children: /* @__PURE__ */ C(
336
- b,
345
+ x,
337
346
  {
338
347
  direction: { xs: "column", md: "column" },
339
348
  spacing: { xs: 0, md: 4 },
340
349
  sx: { width: "100%", position: "relative" },
341
350
  children: [
342
351
  /* @__PURE__ */ e(
343
- pt,
352
+ Lt,
344
353
  {
345
- height: u,
346
- margin: { bottom: 50 },
347
- onAreaClick: he,
354
+ height: f,
355
+ hideLegend: !0,
356
+ margin: { bottom: 24, left: 12, right: 54, top: 48 },
357
+ onAreaClick: ie,
348
358
  onHighlightChange: ce,
349
- series: re,
359
+ series: Y,
350
360
  skipAnimation: !0,
351
361
  slotProps: {
352
- legend: {
353
- hidden: !0
354
- }
362
+ tooltip: { trigger: V ? "item" : "none" }
355
363
  },
356
364
  slots: {
357
- itemContent: (r) => G && I ? /* @__PURE__ */ e(
358
- co,
365
+ tooltip: V && I ? (a) => /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(
366
+ ho,
359
367
  {
360
- categoryGuids: Z(I),
361
- xData: H,
362
- ...r
368
+ ...a,
369
+ categoryGuids: j(I),
370
+ series: Y,
371
+ xData: te
363
372
  }
364
- ) : null
365
- },
366
- sx: D,
367
- tooltip: {
368
- trigger: G ? "item" : "none"
373
+ ) }) : void 0
369
374
  },
375
+ sx: P,
370
376
  xAxis: [
371
377
  {
372
- data: H,
378
+ data: te,
373
379
  scaleType: "time",
374
- valueFormatter: (r) => Q(r, F.MONTH_SHORT_YEAR),
375
- tickNumber: ne
380
+ valueFormatter: (a) => Q(a, B.MONTH_SHORT_YEAR),
381
+ tickNumber: E
376
382
  // How many ticks to show on the x-axis
377
383
  }
378
384
  ],
379
385
  yAxis: [
380
386
  {
381
- min: $,
382
- max: ye || 100
387
+ min: de,
388
+ max: ue || 100,
389
+ valueFormatter: (a) => wt(a).format("0a")
383
390
  }
384
391
  ]
385
392
  }
386
393
  ),
387
394
  /* @__PURE__ */ e(
388
- lo,
395
+ uo,
389
396
  {
390
- categoryGuids: X,
391
- hoveredLegend: S,
392
- legendRef: f,
393
- onClickLegend: ie,
394
- onHoverLegend: te,
395
- sx: { px: d ? 0 : 24 }
397
+ categoryGuids: he,
398
+ hoveredLegend: y,
399
+ legendRef: p,
400
+ onClickLegend: ge,
401
+ onHoverLegend: ae,
402
+ sx: { px: l ? 0 : 24 }
396
403
  }
397
404
  ),
398
- A && /* @__PURE__ */ e(
399
- io,
405
+ $ && /* @__PURE__ */ e(
406
+ lo,
400
407
  {
401
- categoryGuids: Z(I),
408
+ categoryGuids: j(I),
402
409
  chartContainerRef: _,
403
- cursorPosition: k,
404
- hoveredAreaData: x.map((r) => ({
405
- ...r,
406
- x: Q(r.x, F.MONTH_SHORT_YEAR)
410
+ cursorPosition: N,
411
+ hoveredAreaData: S.map((a) => ({
412
+ ...a,
413
+ x: Q(a.x, B.MONTH_SHORT_YEAR)
407
414
  }))
408
415
  }
409
416
  )
@@ -412,29 +419,47 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
412
419
  )
413
420
  }
414
421
  );
415
- }, Je = ({ selectedTab: o, onTabChange: a }) => /* @__PURE__ */ e(
416
- Ot,
417
- {
418
- exclusive: !0,
419
- onChange: a,
420
- orientation: "horizontal",
421
- value: o,
422
- children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(Wt, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(Se, { name: "table_chart_view" }) : /* @__PURE__ */ e(Se, { name: "format_list_bulleted" }) }, t))
423
- }
424
- ), et = ({ selectedDateRange: o, selectedCategoryGuid: a }) => {
425
- const { trends: t } = O(), { isMobile: n, isDesktop: s } = J(), { getCategoryName: l } = Y(), m = c.useMemo(() => {
426
- const h = Q(
422
+ }, dt = ({ selectedTab: o, onTabChange: s }) => {
423
+ const { common: n } = k();
424
+ return /* @__PURE__ */ e(
425
+ Gt,
426
+ {
427
+ "aria-label": n.view_toggle,
428
+ exclusive: !0,
429
+ onChange: s,
430
+ orientation: "horizontal",
431
+ value: o,
432
+ children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(
433
+ Ot,
434
+ {
435
+ "aria-label": t === "Chart" ? n.view_chart : n.view_table,
436
+ "aria-pressed": o === t,
437
+ color: "primary",
438
+ sx: { width: 56 },
439
+ value: t,
440
+ children: t === "Chart" ? /* @__PURE__ */ e(Te, { name: "table_chart_view" }) : /* @__PURE__ */ e(Te, { name: "format_list_bulleted" })
441
+ },
442
+ t
443
+ ))
444
+ }
445
+ );
446
+ }, ut = ({ selectedDateRange: o, selectedCategoryGuid: s }) => {
447
+ const { trends: n } = k(), { isMobile: t, isDesktop: r } = q(), { getCategoryName: i } = J(), d = u.useMemo(() => {
448
+ const l = o.start.getFullYear() === o.end.getFullYear() ? Q(
449
+ o.start,
450
+ t ? B.MONTH_SHORT : B.MONTH_LONG
451
+ ) : Q(
427
452
  o.start,
428
- n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
429
- ), i = Q(
453
+ t ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
454
+ ), p = Q(
430
455
  o.end,
431
- n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
456
+ t ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
432
457
  );
433
- return `${h} - ${i}`;
434
- }, [o, n]);
435
- return /* @__PURE__ */ C(W, { sx: { mr: 10, minWidth: "60%" }, children: [
458
+ return `${l} - ${p}`;
459
+ }, [o, t]), c = i(s) || (t ? n.sub_title : n.sub_title_by_category);
460
+ return /* @__PURE__ */ C(A, { children: [
436
461
  /* @__PURE__ */ e(
437
- z,
462
+ X,
438
463
  {
439
464
  display: "block",
440
465
  fontWeight: 700,
@@ -443,282 +468,328 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
443
468
  overflow: "visible",
444
469
  textOverflow: "unset"
445
470
  },
446
- variant: s ? "H3" : "Body",
447
- children: l(a) || t.sub_title
448
- }
449
- ),
450
- /* @__PURE__ */ e(z, { variant: s ? "Body" : "Small", children: m })
451
- ] });
452
- }, ho = (o) => {
453
- const a = o.row[o.field];
454
- return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(xe, { amount: a, variant: "Small" }) });
455
- }, go = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
456
- const { getCategoryName: t } = Y(), { categories: n } = O(), s = n.default_categories[o]?.replace(/&amp;/g, "&") ?? t(o);
457
- return /* @__PURE__ */ C(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
458
- /* @__PURE__ */ e(
459
- W,
460
- {
461
- "aria-label": $e(n.category_icon_label_aria, s),
462
- role: "img",
463
- children: /* @__PURE__ */ e(ve, { categoryGuid: a })
471
+ variant: r ? "H3" : "Body",
472
+ children: c
464
473
  }
465
474
  ),
466
- /* @__PURE__ */ e(z, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
475
+ /* @__PURE__ */ e(X, { variant: r ? "subtitle1" : "body2", children: d })
467
476
  ] });
468
- }, mo = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
469
- go,
477
+ }, mo = ({ name: o, topLevelCategoryGuid: s }) => /* @__PURE__ */ C(x, { alignItems: "center", direction: "row", justifyContent: "center", children: [
478
+ /* @__PURE__ */ e(A, { "aria-hidden": !0, children: /* @__PURE__ */ e(we, { categoryGuid: s, variant: "twotone" }) }),
479
+ /* @__PURE__ */ e(X, { sx: { ml: 12 }, variant: "body2", children: o })
480
+ ] }), po = (o) => /* @__PURE__ */ e(x, { alignItems: "center", direction: "row", role: "rowheader", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(
481
+ mo,
470
482
  {
471
- categoryGuid: o.row.category,
483
+ name: o.row.category,
472
484
  topLevelCategoryGuid: o.row.top_level_category_guid
473
485
  }
474
- ) }), po = (o, a) => {
475
- const t = [], n = new Date(o);
476
- for (; n <= a; ) {
477
- const s = Q(n, F.MONTH);
478
- t.push(s), n.setMonth(n.getMonth() + 1);
486
+ ) }), ze = (o) => {
487
+ const s = o.row.category_guid, n = o.row.top_level_category_guid, t = s === Ve.INCOME || n === Ve.INCOME, r = o.row[o.field];
488
+ return /* @__PURE__ */ e(x, { alignItems: "flex-end", direction: "row", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(
489
+ xe,
490
+ {
491
+ amount: t ? Math.abs(r) : r,
492
+ isIncome: t,
493
+ sx: { fontWeight: t ? 600 : 500 },
494
+ symbol: t ? "+" : void 0,
495
+ variant: "body2"
496
+ }
497
+ ) });
498
+ }, $e = (o, s) => {
499
+ const n = Q(st(s.isoDate), B.MONTH_LONG);
500
+ return o[n] = s.amount, o;
501
+ }, Ke = (o) => (s, n) => {
502
+ const t = Q(st(n.isoDate), B.MONTH_LONG);
503
+ return s + (o.includes(t) ? n.amount : 0);
504
+ }, fo = (o, s) => {
505
+ const n = [], t = new Date(o);
506
+ for (; t <= s; ) {
507
+ const r = Q(t, B.MONTH_LONG);
508
+ n.push(r), t.setMonth(t.getMonth() + 1);
509
+ }
510
+ return n;
511
+ }, yo = (o, s) => {
512
+ const n = {
513
+ field: "category",
514
+ flex: 1,
515
+ headerClassName: "trends-table-header",
516
+ headerName: s.category_title,
517
+ minWidth: 210,
518
+ renderHeader: ke,
519
+ renderCell: po,
520
+ sortable: !0,
521
+ sortComparator: At,
522
+ type: "string"
523
+ }, t = o.map((i) => ({
524
+ field: i,
525
+ flex: 1,
526
+ headerClassName: "trends-table-header",
527
+ headerName: i,
528
+ minWidth: 100,
529
+ renderHeader: ke,
530
+ renderCell: ze,
531
+ align: "right",
532
+ headerAlign: "right",
533
+ sortable: !0,
534
+ hideSortIcons: !1,
535
+ type: "number",
536
+ sortComparator: Fe
537
+ })), r = {
538
+ field: "total",
539
+ flex: 1,
540
+ headerClassName: "trends-table-header",
541
+ headerName: s.table_column_total,
542
+ minWidth: 100,
543
+ renderHeader: ke,
544
+ renderCell: ze,
545
+ align: "right",
546
+ headerAlign: "right",
547
+ sortable: !0,
548
+ hideSortIcons: !1,
549
+ type: "number",
550
+ sortComparator: Fe
551
+ };
552
+ return [n, ...t, r];
553
+ }, Co = (o, s, n, t) => {
554
+ const r = o.map((i) => {
555
+ let d = i.totalMonthlyAmounts;
556
+ return t && (d = i.monthlyAmounts), {
557
+ id: i.guid,
558
+ category: i.name,
559
+ category_guid: i.guid,
560
+ isParent: !1,
561
+ top_level_category_guid: i.parent_guid || i.guid,
562
+ total: d.reduce(Ke(n), 0),
563
+ ...d.reduce($e, {})
564
+ };
565
+ });
566
+ if (t) {
567
+ const i = t.monthlyAmounts.reduce(Ke(n), 0);
568
+ i !== 0 && r.push({
569
+ id: `sub-${t.guid}`,
570
+ category: et(s.category_general, t.name),
571
+ category_guid: t.guid,
572
+ isParent: !0,
573
+ top_level_category_guid: t.guid,
574
+ total: i,
575
+ ...t.monthlyAmounts.reduce($e, {})
576
+ });
479
577
  }
480
- return t;
481
- }, tt = ({
482
- monthlyCategoryTotals: o,
483
- selectedDateRange: a,
484
- selectedCategory: t,
578
+ return r;
579
+ }, ht = ({
580
+ selectedDateRange: o,
581
+ selectedCategory: s,
485
582
  onClickRow: n,
486
- height: s = "100dvh",
487
- sx: l = {}
583
+ height: t = "100%",
584
+ sx: r = {}
488
585
  }) => {
489
- const { onEvent: m } = P(), h = Q(/* @__PURE__ */ new Date(), F.MONTH_SHORT), [i, d] = c.useState([
490
- { field: h, sort: "desc" }
491
- ]), f = c.useMemo(() => po(a.start, a.end), [a]), p = [
492
- {
493
- field: "category",
494
- flex: 1,
495
- headerName: "Category",
496
- minWidth: 175,
497
- renderHeader: Ge,
498
- renderCell: mo,
499
- sortable: !0,
500
- type: "string"
501
- },
502
- ...f.map(
503
- (u) => ({
504
- field: u,
505
- flex: 1,
506
- headerName: u,
507
- minWidth: 100,
508
- renderHeader: Ge,
509
- renderCell: ho,
510
- align: "right",
511
- headerAlign: "right",
512
- sortable: !0,
513
- hideSortIcons: !1,
514
- type: "number",
515
- sortComparator: Et
516
- })
517
- )
518
- ], _ = c.useMemo(() => {
519
- const u = o.filter(
520
- (g) => !Mt(g) && !At(g)
521
- ), S = (t ? u.filter(
522
- (g) => g.category_guid === t || g.top_level_category_guid === t
523
- ) : u).reduce(
524
- (g, v) => {
525
- const { category_guid: E, top_level_category_guid: I, month: x, total: M, year: k } = v, A = t ? E : I;
526
- g[A] || (g[A] = {
527
- id: A,
528
- category: A,
529
- category_guid: E,
530
- top_level_category_guid: I
531
- });
532
- const G = Q(new Date(k, x - 1), F.MONTH_SHORT);
533
- return g[A][G] || (g[A][G] = 0), g[A][G] = g[A][G] + Math.abs(M), g;
534
- },
535
- {}
536
- );
537
- return Object.values(S);
538
- }, [o, t]);
539
- return /* @__PURE__ */ e(W, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...l }, children: /* @__PURE__ */ e(
540
- Gt,
586
+ const i = le(), { onEvent: d } = z(), { trends: h } = k(), { trendsCategories: c } = J(), l = u.useMemo(() => fo(o.start, o.end), [o]), p = i.palette.mode === "light", m = u.useMemo(() => yo(l, h), [l, h]), _ = u.useMemo(() => {
587
+ if (s)
588
+ return c.find((g) => g.guid === s);
589
+ }, [s, c]), f = u.useMemo(() => {
590
+ let g = c;
591
+ return _ && (g = _.subCategories.filter(
592
+ (y) => y.monthlyAmounts.some((w) => w.amount !== 0)
593
+ )), Co(g, h, l, _);
594
+ }, [c, l, _, h]);
595
+ return /* @__PURE__ */ e(A, { sx: { height: t, width: "100%", overflowX: "auto", boxShadow: "none", ...r }, children: /* @__PURE__ */ e(
596
+ Bt,
541
597
  {
542
- columns: p,
598
+ columns: m,
543
599
  disableColumnFilter: !0,
544
600
  disableColumnMenu: !0,
545
601
  hideFooter: !0,
546
- initialState: { sorting: { sortModel: i } },
547
- onRowClick: (u) => {
548
- n?.(u.row.category), m(w.TRENDS_CLICK_LIST_ITEM, {
549
- ...V,
550
- listItem: Dt[u.row.category]
602
+ initialState: { sorting: { sortModel: [{ field: "category", sort: "asc" }] } },
603
+ onRowClick: (g) => {
604
+ _ || n?.(g.row.category_guid), d(v.TRENDS_CLICK_LIST_ITEM, {
605
+ ...G,
606
+ listItem: Et[g.row.category_guid]
551
607
  });
552
608
  },
553
- onSortModelChange: (u) => {
554
- d(u), m(w.TRENDS_CLICK_TABLE_SORT, V);
555
- },
556
- rows: _,
609
+ rowHeight: 64,
610
+ rows: f,
557
611
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
558
- sortModel: i,
559
- sortingOrder: ["asc", "desc"]
612
+ sortingOrder: ["asc", "desc"],
613
+ sx: {
614
+ borderColor: "divider",
615
+ borderWidth: 1,
616
+ borderStyle: "solid",
617
+ borderRadius: 2,
618
+ "& .MuiDataGrid-columnHeaders": {
619
+ bgcolor: p ? "neutral.50" : "neutral.800",
620
+ borderBottom: "none"
621
+ },
622
+ "& .trends-table-header": {
623
+ bgcolor: p ? "neutral.50" : "neutral.800"
624
+ }
625
+ }
560
626
  }
561
627
  ) });
562
- }, fo = {
628
+ }, _o = {
563
629
  title: "Transaction List"
564
- }, Co = ({
630
+ }, To = ({
565
631
  categoryGuid: o,
566
- dateRange: a,
567
- isOpen: t,
568
- onClose: n
632
+ dateRange: s,
633
+ isOpen: n,
634
+ onClose: t
569
635
  }) => {
570
- const { onEvent: s } = P(), { selectedAccountGuids: l } = fe(), { common: m } = O(), { setFilter: h, sortedTransactions: i } = De(), [d, f] = c.useState(""), p = c.useMemo(
571
- () => i.find((u) => u.guid === d),
572
- [d, i]
636
+ const { onEvent: r } = z(), { selectedAccountGuids: i } = ye(), { common: d } = k(), { setFilter: h, sortedTransactions: c } = ve(), [l, p] = u.useState(""), m = u.useMemo(
637
+ () => c.find((f) => f.guid === l),
638
+ [l, c]
573
639
  );
574
- c.useEffect(() => {
640
+ u.useEffect(() => {
575
641
  h({
576
- accounts: l,
577
- dateRange: a,
578
- custom: (u) => o === "" || o === u.category_guid || o === u.top_level_category_guid,
642
+ accounts: i,
643
+ dateRange: s,
644
+ custom: (f) => o === "" || o === f.category_guid || o === f.top_level_category_guid,
579
645
  showSplits: !!o
580
646
  });
581
- }, [l, o, a]), c.useEffect(() => s(w.TRENDS_VIEW_TRANSACTIONS), []);
647
+ }, [i, o, s]), u.useEffect(() => r(v.TRENDS_VIEW_TRANSACTIONS), []);
582
648
  const _ = () => {
583
- f(""), n();
649
+ p(""), t();
584
650
  };
585
651
  return /* @__PURE__ */ C(
586
- ke,
652
+ Ne,
587
653
  {
588
- ariaLabelClose: m.close_aria,
589
- isOpen: t,
654
+ ariaLabelClose: d.close_aria,
655
+ isOpen: n,
590
656
  onClose: _,
591
- title: fo.title,
657
+ title: _o.title,
592
658
  children: [
593
- p && /* @__PURE__ */ e(Xe, { transaction: p }),
594
- !p && /* @__PURE__ */ e(Ze, { onClick: f })
659
+ m && /* @__PURE__ */ e(at, { transaction: m }),
660
+ !m && /* @__PURE__ */ e(it, { onClick: p })
595
661
  ]
596
662
  }
597
663
  );
598
- }, yo = R(Co), _o = ({ onBackClick: o, sx: a }) => {
599
- const { onEvent: t } = P(), { isDesktop: n, isTablet: s, isMobile: l } = J(), { isAccountDataLoaded: m, loadAccountData: h, visibleAccounts: i } = Le(), {
600
- categoriesLoaded: d,
601
- loadCategories: f,
602
- loadMonthlyCategoryTotals: p,
664
+ }, bo = R(To), So = ({ onBackClick: o, sx: s }) => {
665
+ const { onEvent: n } = z(), { isDesktop: t, isTablet: r, isMobile: i } = q(), { isAccountDataLoaded: d, loadAccountData: h } = De(), {
666
+ categoriesLoaded: c,
667
+ loadCategories: l,
668
+ loadDateRangeCategoryTotals: p,
669
+ loadMonthlyCategoryTotals: m,
603
670
  monthlyCategoryTotals: _,
604
- getCategoryName: u
605
- } = Y(), {
606
- isTransactionDataLoaded: y,
607
- loadTransactionData: S,
608
- sortedTransactions: g
609
- } = De(), { selectedDateRange: v, setSelectedDateRange: E } = Ce(), { isInitialized: I, selectedAccounts: x, setSelectedAccounts: M } = fe(), { trends: k } = O(), [A, G] = c.useState(!1), [ee, ne] = c.useState(!1), [H, ue] = c.useState("Chart"), [B, se] = c.useState(""), [ae, $] = c.useState(window.innerHeight), U = ae - (l ? 315 : 345);
610
- c.useEffect(() => {
611
- const D = () => $(window.innerHeight);
612
- return window.addEventListener("resize", D), m || h().finally(), d || f().finally(), y || S().finally(), () => window.removeEventListener("resize", D);
613
- }, []), c.useEffect(() => {
614
- M(i);
615
- }, [i]), c.useEffect(() => {
616
- I && p(
617
- x,
618
- v.start,
619
- v.end
620
- ).finally(() => {
621
- G(!0);
671
+ getCategoryName: f
672
+ } = J(), {
673
+ isTransactionDataLoaded: g,
674
+ loadTransactionData: y,
675
+ sortedTransactions: w
676
+ } = ve(), { selectedDateRange: b, setSelectedDateRange: M } = Ce(), { isInitialized: I, selectedAccounts: S } = ye(), { trends: H } = k(), [N, $] = u.useState(!1), [V, K] = u.useState(!1), [E, te] = u.useState("Chart"), [O, ne] = u.useState(""), [se, Z] = u.useState(window.innerHeight), ue = se - (i ? 315 : 345);
677
+ Ie({
678
+ widgetName: "TrendsFullWidget",
679
+ isLoaded: N
680
+ }), u.useEffect(() => {
681
+ const D = () => Z(window.innerHeight);
682
+ return window.addEventListener("resize", D), d || h().finally(), c || l().finally(), g || y().finally(), () => window.removeEventListener("resize", D);
683
+ }, []), u.useEffect(() => {
684
+ I && p(S, b.start, b.end).then(() => {
685
+ m(
686
+ S,
687
+ b.start,
688
+ b.end
689
+ );
690
+ }).finally(() => {
691
+ $(!0), n(v.TRENDS_LOAD_WIDGET, {
692
+ ...G,
693
+ time_period: `${Se(b.end, b.start)}M`
694
+ });
622
695
  });
623
- }, [I, x, v]);
624
- const K = c.useMemo(() => {
625
- if (!A) return { stackedDatasets: [], unstackedDatasets: [] };
626
- const D = It(
696
+ }, [I, S, b]);
697
+ const F = u.useMemo(() => {
698
+ if (!N) return { stackedDatasets: [], unstackedDatasets: [] };
699
+ const D = Rt(
627
700
  _,
628
- v.start,
629
- v.end
630
- ), r = B.length ? D.filter(
631
- (T) => T.top_level_category_guid === B || T.category_guid === B
632
- ) : Rt(D);
701
+ b.start,
702
+ b.end
703
+ ), P = O.length ? D.filter(
704
+ (a) => a.top_level_category_guid === O || a.category_guid === O
705
+ ) : kt(D);
633
706
  return {
634
- stackedDatasets: r.filter(Ht),
635
- unstackedDatasets: r.filter(kt)
707
+ stackedDatasets: P.filter(Nt),
708
+ unstackedDatasets: P.filter(Ht)
636
709
  };
637
- }, [_, B, v]), re = (D, r) => {
638
- ue(r ?? H), t(w.TRENDS_CLICK_TOGGLE_VIEW);
639
- }, X = (D) => {
640
- const r = Fe(D?.[0], 1), T = D?.[1], L = Ae(T, r);
641
- E({ start: r, end: T }), t(w.TRENDS_CLICK_TIME_WINDOW, {
642
- time_period: L + "M"
710
+ }, [_, O, b]), re = (D, P) => {
711
+ te(P ?? E), n(v.TRENDS_CLICK_TOGGLE_VIEW);
712
+ }, Y = (D) => {
713
+ const P = Xe(D?.[0], 1), a = D?.[1], T = Se(a, P);
714
+ M({ start: P, end: a }), n(v.TRENDS_CLICK_TIME_WINDOW, {
715
+ time_period: T + "M"
643
716
  });
644
- }, Z = () => {
645
- t(w.TRENDS_CLICK_FILTER);
646
- }, te = (D) => {
647
- se(D);
717
+ }, he = () => {
718
+ n(v.TRENDS_CLICK_FILTER);
719
+ }, j = (D) => {
720
+ ne(D);
721
+ }, ae = (D) => {
722
+ ne(D), n(v.TRENDS_CLICK_LEGEND, { category: f(D) });
723
+ }, ge = (D) => {
724
+ n(v.TRENDS_HOVER_LEGEND, { category: f(D) });
648
725
  }, ie = (D) => {
649
- se(D), t(w.TRENDS_CLICK_LEGEND, { category: u(D) });
650
- }, he = (D) => {
651
- t(w.TRENDS_HOVER_LEGEND, { category: u(D) });
726
+ n(v.TRENDS_HOVER_AREA, { category: D });
652
727
  }, ce = (D) => {
653
- t(w.TRENDS_HOVER_AREA, { category: D });
654
- }, le = (D) => {
655
- t(w.TRENDS_HOVER_POINT, { category: D });
728
+ n(v.TRENDS_HOVER_POINT, { category: D });
656
729
  };
657
- return !I || !A ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ C(
658
- Ue,
730
+ return !I || !N ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ C(
731
+ rt,
659
732
  {
660
- accountOptions: i,
661
- calendarActions: { onRangeChanged: X },
662
- dateRange: v,
733
+ calendarActions: { onRangeChanged: Y },
734
+ dateRange: b,
663
735
  dateRangeVariant: "timeframebuttons",
664
- onAccountsFilterClick: Z,
736
+ onAccountsFilterClick: he,
665
737
  onBackClick: o,
666
- sx: a,
667
- title: k.title,
738
+ sx: s,
739
+ title: H.title,
668
740
  children: [
669
741
  /* @__PURE__ */ C(
670
- b,
742
+ x,
671
743
  {
672
744
  sx: {
673
745
  // eslint-disable-next-line no-nested-ternary
674
- px: n ? 48 : s ? 24 : 12
746
+ px: t ? 48 : r ? 24 : 12
675
747
  },
676
748
  children: [
677
749
  /* @__PURE__ */ C(
678
- b,
750
+ x,
679
751
  {
680
752
  flexDirection: "row",
681
753
  justifyContent: "space-between",
682
- sx: { pb: l ? 12 : 24, pt: l ? 24 : 48 },
754
+ sx: { pb: i ? 12 : 24, pt: i ? 24 : 48 },
683
755
  children: [
684
756
  /* @__PURE__ */ e(
685
- et,
757
+ ut,
686
758
  {
687
- selectedCategoryGuid: B,
688
- selectedDateRange: v
759
+ selectedCategoryGuid: O,
760
+ selectedDateRange: b
689
761
  }
690
762
  ),
691
- /* @__PURE__ */ e(Je, { onTabChange: re, selectedTab: H })
763
+ /* @__PURE__ */ e(dt, { onTabChange: re, selectedTab: E })
692
764
  ]
693
765
  }
694
766
  ),
695
- /* @__PURE__ */ C(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
696
- /* @__PURE__ */ e(W, { flexGrow: 1, children: B && /* @__PURE__ */ C(be, { onClick: () => se(""), sx: { p: 0, pr: 5 }, children: [
697
- /* @__PURE__ */ e(Se, { name: "arrow_back" }),
698
- k.all_categories
767
+ /* @__PURE__ */ C(x, { alignItems: "center", flexDirection: "row", width: "100%", children: [
768
+ /* @__PURE__ */ e(A, { flexGrow: 1, children: O && /* @__PURE__ */ C(be, { onClick: () => ne(""), sx: { p: 0, pr: 5 }, children: [
769
+ /* @__PURE__ */ e(Te, { name: "arrow_back" }),
770
+ H.all_categories
699
771
  ] }) }),
700
- /* @__PURE__ */ e(be, { onClick: () => ne(!0), sx: { px: 5 }, children: `${k.view_transactions} (${g.length})` })
772
+ /* @__PURE__ */ e(be, { onClick: () => K(!0), sx: { px: 5 }, children: `${H.view_transactions} (${w.length})` })
701
773
  ] }),
702
- /* @__PURE__ */ C(W, { children: [
703
- H === "Chart" && /* @__PURE__ */ e(
704
- uo,
774
+ /* @__PURE__ */ C(A, { children: [
775
+ E === "Chart" && /* @__PURE__ */ e(
776
+ go,
705
777
  {
706
- availableHeight: U,
707
- onClickLegend: ie,
708
- onHoverArea: ce,
709
- onHoverLegend: he,
710
- onHoverPoint: le,
711
- stackedDatasets: K.stackedDatasets,
712
- unstackedDatasets: K.unstackedDatasets
778
+ availableHeight: ue,
779
+ onClickLegend: ae,
780
+ onHoverArea: ie,
781
+ onHoverLegend: ge,
782
+ onHoverPoint: ce,
783
+ stackedDatasets: F.stackedDatasets,
784
+ unstackedDatasets: F.unstackedDatasets
713
785
  }
714
786
  ),
715
- H === "Table" && /* @__PURE__ */ e(
716
- tt,
787
+ E === "Table" && /* @__PURE__ */ e(
788
+ ht,
717
789
  {
718
- monthlyCategoryTotals: _,
719
- onClickRow: te,
720
- selectedCategory: B,
721
- selectedDateRange: v
790
+ onClickRow: j,
791
+ selectedCategory: O,
792
+ selectedDateRange: b
722
793
  }
723
794
  )
724
795
  ] })
@@ -726,27 +797,27 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
726
797
  }
727
798
  ),
728
799
  /* @__PURE__ */ e(
729
- yo,
800
+ bo,
730
801
  {
731
- categoryGuid: B,
732
- dateRange: v,
733
- isOpen: ee,
734
- onClose: () => ne(!1)
802
+ categoryGuid: O,
803
+ dateRange: b,
804
+ isOpen: V,
805
+ onClose: () => K(!1)
735
806
  }
736
807
  )
737
808
  ]
738
809
  }
739
810
  );
740
- }, On = R(_o), To = () => {
741
- const { monthlyCategoryTotals: o } = Y(), { trends: a } = O(), t = we(), { availableHeight: n = 300 } = ze(), s = Nt(o);
811
+ }, $n = R(So), xo = () => {
812
+ const { monthlyCategoryTotals: o } = J(), { trends: s } = k(), n = le(), { availableHeight: t = 300 } = qe(), r = u.useMemo(() => Wt(o), [o]);
742
813
  return /* @__PURE__ */ e(
743
- Ne,
814
+ Oe,
744
815
  {
745
816
  baseline: "min",
746
- colors: [t.palette.primary.main],
747
- datasets: [s],
748
- height: n,
749
- labels: [a.spending_label],
817
+ colors: [n.palette.primary.main],
818
+ datasets: [r],
819
+ height: t,
820
+ labels: [s.spending_label],
750
821
  showArea: !0,
751
822
  showAverage: !0,
752
823
  showLegend: !0,
@@ -755,40 +826,41 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
755
826
  valueFormatterString: "0,0"
756
827
  }
757
828
  );
758
- }, So = R(To), bo = ({ onPrimaryCtaClick: o, sx: a }) => {
759
- const { isAccountDataLoaded: t, loadAccountData: n, visibleAccounts: s } = Le(), { loadMonthlyCategoryTotals: l, monthlyTotalsLoaded: m } = Y(), { isInitialized: h } = He(), { trends: i } = O(), { selectedAccounts: d, setSelectedAccounts: f } = fe();
760
- return c.useEffect(() => {
761
- t || n().finally();
762
- }, []), c.useEffect(() => {
763
- f(s);
764
- }, [s]), c.useEffect(() => {
765
- h && l(d).finally();
766
- }, [h, d]), h ? /* @__PURE__ */ e(
767
- Vt,
829
+ }, wo = R(xo), vo = ({ onPrimaryCtaClick: o, sx: s }) => {
830
+ const { isAccountDataLoaded: n, loadAccountData: t } = De(), { loadMonthlyCategoryTotals: r, monthlyTotalsLoaded: i } = J(), { isInitialized: d } = We(), { trends: h } = k(), { selectedAccounts: c } = ye();
831
+ return u.useEffect(() => {
832
+ n || t().finally();
833
+ }, []), Ie({
834
+ widgetName: "TrendsMiniWidget",
835
+ isLoaded: i
836
+ }), u.useEffect(() => {
837
+ d && n && r(c).finally();
838
+ }, [n, d, c]), !n || !d || !i ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(
839
+ Ft,
768
840
  {
769
- contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
841
+ contentStyles: { height: "calc(100% - 72px)", minHeight: 300, ":last-child": { pb: 0 } },
770
842
  onPrimaryCtaClick: o,
771
- primaryCtaLabel: i.primary_cta,
772
- subTitle: i.sub_title,
773
- sx: { height: "100%", ...a },
774
- title: i.mini_title,
775
- children: m ? /* @__PURE__ */ e(So, {}) : /* @__PURE__ */ e(pe, {})
843
+ primaryCtaLabel: h.primary_cta,
844
+ subTitle: h.sub_title,
845
+ sx: { height: "100%", ...s },
846
+ title: h.mini_title,
847
+ children: /* @__PURE__ */ e(wo, {})
776
848
  }
777
- ) : /* @__PURE__ */ e(pe, {});
778
- }, Gn = R(bo), xo = 70, Be = ({
849
+ );
850
+ }, Kn = R(vo), Do = 70, Ye = ({
779
851
  title: o,
780
- totalAmount: a,
781
- transactionType: t,
782
- percentage: n,
783
- secondaryLabel: s,
784
- shouldDisplayPercentage: l
852
+ totalAmount: s,
853
+ transactionType: n,
854
+ percentage: t,
855
+ secondaryLabel: r,
856
+ shouldDisplayPercentage: i
785
857
  }) => {
786
- const { availableWidth: m } = ze(), h = c.useRef(null), i = c.useRef(null), d = Lt(Number(Math.abs(n)), {
858
+ const { availableWidth: d } = qe(), h = u.useRef(null), c = u.useRef(null), l = Mt(Number(Math.abs(t)), {
787
859
  style: "percent",
788
860
  minimumIntegerDigits: 1
789
- }), f = m === 288 && oe(a, "0,0.00").length > 10 ? oe(a, "0,0") : oe(a, "0,0.00"), p = t === "spending" ? n > 0 : n >= 0, _ = t === "spending" ? "error.main" : "success.main", u = t === "spending" ? "success.main" : "text.secondary", y = h?.current, S = i?.current, g = y && S ? y.scrollWidth > S.clientWidth - xo : !1;
861
+ }), p = d === 288 && oe(s, "0,0.00").length > 10 ? oe(s, "0,0") : oe(s, "0,0.00"), m = n === "spending" ? t > 0 : t >= 0, _ = n === "spending" ? "error.main" : "success.main", f = n === "spending" ? "success.main" : "text.secondary", g = h?.current, y = c?.current, w = g && y ? g.scrollWidth > y.clientWidth - Do : !1;
790
862
  return /* @__PURE__ */ C(
791
- b,
863
+ x,
792
864
  {
793
865
  sx: {
794
866
  border: 1,
@@ -801,7 +873,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
801
873
  },
802
874
  children: [
803
875
  /* @__PURE__ */ C(
804
- b,
876
+ x,
805
877
  {
806
878
  sx: {
807
879
  alignItems: "center",
@@ -809,18 +881,18 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
809
881
  justifyContent: "space-between"
810
882
  },
811
883
  children: [
812
- /* @__PURE__ */ e(me, { color: "text.secondary", variant: "caption", children: o }),
813
- l && /* @__PURE__ */ C(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
814
- p ? /* @__PURE__ */ e(Ft, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(zt, { size: 20, sx: { color: u } }),
884
+ /* @__PURE__ */ e(fe, { color: "text.secondary", variant: "caption", children: o }),
885
+ i && /* @__PURE__ */ C(x, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
886
+ m ? /* @__PURE__ */ e(zt, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e($t, { size: 20, sx: { color: f } }),
815
887
  /* @__PURE__ */ e(
816
- me,
888
+ fe,
817
889
  {
818
890
  sx: {
819
- color: p ? _ : u,
891
+ color: m ? _ : f,
820
892
  fontWeight: 600
821
893
  },
822
894
  variant: "body2",
823
- children: d
895
+ children: l
824
896
  }
825
897
  )
826
898
  ] })
@@ -828,9 +900,9 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
828
900
  }
829
901
  ),
830
902
  /* @__PURE__ */ C(
831
- b,
903
+ x,
832
904
  {
833
- ref: i,
905
+ ref: c,
834
906
  sx: {
835
907
  alignItems: "center",
836
908
  flexDirection: "row",
@@ -838,19 +910,19 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
838
910
  },
839
911
  children: [
840
912
  /* @__PURE__ */ e(
841
- W,
913
+ A,
842
914
  {
843
915
  ref: h,
844
916
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
845
- children: /* @__PURE__ */ e(Pe, { children: f })
917
+ children: /* @__PURE__ */ e(Ue, { children: p })
846
918
  }
847
919
  ),
848
- l && m >= 450 && !g && /* @__PURE__ */ e(
849
- me,
920
+ i && d >= 450 && !w && /* @__PURE__ */ e(
921
+ fe,
850
922
  {
851
- color: p ? _ : u,
923
+ color: m ? _ : f,
852
924
  variant: "caption",
853
- children: s
925
+ children: r
854
926
  }
855
927
  )
856
928
  ]
@@ -859,54 +931,55 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
859
931
  ]
860
932
  }
861
933
  );
862
- }, vo = R(() => {
863
- const { trends: o } = O();
864
- return /* @__PURE__ */ C(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
865
- /* @__PURE__ */ e($t, { size: 32 }),
866
- /* @__PURE__ */ C(b, { children: [
867
- /* @__PURE__ */ e(me, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
868
- /* @__PURE__ */ e(me, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
934
+ }, Lo = R(() => {
935
+ const { trends: o } = k();
936
+ return /* @__PURE__ */ C(x, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
937
+ /* @__PURE__ */ e(Kt, { size: 32 }),
938
+ /* @__PURE__ */ C(x, { children: [
939
+ /* @__PURE__ */ e(fe, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
940
+ /* @__PURE__ */ e(fe, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
869
941
  ] })
870
942
  ] });
871
- }), Bn = R(({ onCtaClick: o }) => {
872
- const { isAccountDataLoaded: a, loadAccountData: t, visibleAccounts: n } = Le();
873
- c.useEffect(() => {
874
- a || t().finally();
943
+ }), Yn = R(({ onCtaClick: o }) => {
944
+ const { isAccountDataLoaded: s, loadAccountData: n, visibleAccounts: t } = De();
945
+ u.useEffect(() => {
946
+ s || n().finally();
875
947
  }, []);
876
- const { onEvent: s } = P(), { monthlyCategoryTotals: l, loadMonthlyCategoryTotals: m, monthlyTotalsLoaded: h } = Y(), i = {
948
+ const { onEvent: r } = z(), { monthlyCategoryTotals: i, loadMonthlyCategoryTotals: d, monthlyTotalsLoaded: h } = J(), c = {
877
949
  start: Pt(/* @__PURE__ */ new Date(), 1),
878
950
  end: /* @__PURE__ */ new Date()
879
- }, { trends: d } = O(), { selectedAccounts: f, setSelectedAccounts: p, isInitialized: _ } = fe();
880
- c.useEffect(() => {
881
- p(n);
882
- }, [n]), c.useEffect(() => {
883
- _ && m(f, i.start).then(() => {
884
- s(w.TRENDS_LOAD_WIDGET, {
885
- state: n?.length ? "default" : "zeroState"
951
+ }, { trends: l } = k(), { selectedAccounts: p, isInitialized: m } = ye();
952
+ Ie({
953
+ widgetName: "TrendsMicroWidget",
954
+ isLoaded: h
955
+ }), u.useEffect(() => {
956
+ m && d(p, c.start).then(() => {
957
+ r(v.TRENDS_LOAD_WIDGET, {
958
+ state: t?.length ? "default" : "zeroState"
886
959
  });
887
960
  });
888
- }, [_, f]);
889
- const { spendingData: u, incomeData: y } = c.useMemo(
961
+ }, [m, p]);
962
+ const { spendingData: _, incomeData: f } = u.useMemo(
890
963
  () => ({
891
- spendingData: Ye(l, i),
892
- incomeData: je(l, i)
964
+ spendingData: nt(i, c),
965
+ incomeData: ot(i, c)
893
966
  }),
894
- [l, i]
895
- ), [S, g] = u, [v, E] = y, I = Oe(g.y, S.y), x = Oe(E.y, v.y), M = _ && !n?.length, k = () => {
896
- s(
897
- M ? w.TRENDS_CLICK_GET_STARTED : w.TRENDS_CLICK_VIEW_MORE
967
+ [i, c]
968
+ ), [g, y] = _, [w, b] = f, M = Pe(y.y, g.y), I = Pe(b.y, w.y), S = m && !t?.length, H = () => {
969
+ r(
970
+ S ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
898
971
  ), o();
899
972
  };
900
- return !h || !_ ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ e(
901
- Yt,
973
+ return !h || !m ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(
974
+ Ut,
902
975
  {
903
976
  className: "mx-trends-microwidget",
904
- ctaLabel: d.micro_primary_cta_label,
905
- onCTAClick: k,
906
- subHeader: M ? void 0 : d.micro_subheader,
907
- title: d.title,
908
- children: M ? /* @__PURE__ */ e(vo, {}) : /* @__PURE__ */ C(
909
- b,
977
+ ctaLabel: l.micro_primary_cta_label,
978
+ onCTAClick: H,
979
+ subHeader: S ? void 0 : l.micro_subheader,
980
+ title: l.title,
981
+ children: S ? /* @__PURE__ */ e(Lo, {}) : /* @__PURE__ */ C(
982
+ x,
910
983
  {
911
984
  sx: {
912
985
  alignItems: "stretch",
@@ -915,24 +988,24 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
915
988
  },
916
989
  children: [
917
990
  /* @__PURE__ */ e(
918
- Be,
991
+ Ye,
919
992
  {
920
- percentage: I,
921
- secondaryLabel: d.micro_secondary_label,
922
- shouldDisplayPercentage: g.y !== 0 && S.y !== 0,
923
- title: d.spending_label,
924
- totalAmount: g.y,
993
+ percentage: M,
994
+ secondaryLabel: l.micro_secondary_label,
995
+ shouldDisplayPercentage: y.y !== 0 && g.y !== 0,
996
+ title: l.spending_label,
997
+ totalAmount: y.y,
925
998
  transactionType: "spending"
926
999
  }
927
1000
  ),
928
1001
  /* @__PURE__ */ e(
929
- Be,
1002
+ Ye,
930
1003
  {
931
- percentage: x,
932
- secondaryLabel: d.micro_secondary_label,
933
- shouldDisplayPercentage: E.y !== 0 && v.y !== 0,
934
- title: d.income_label,
935
- totalAmount: E.y,
1004
+ percentage: I,
1005
+ secondaryLabel: l.micro_secondary_label,
1006
+ shouldDisplayPercentage: b.y !== 0 && w.y !== 0,
1007
+ title: l.income_label,
1008
+ totalAmount: b.y,
936
1009
  transactionType: "income"
937
1010
  }
938
1011
  )
@@ -941,16 +1014,16 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
941
1014
  )
942
1015
  }
943
1016
  );
944
- }), wo = R(
945
- ({ isExpanded: o, onClick: a }) => {
946
- const t = qe();
947
- return /* @__PURE__ */ e(Zt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(qt, { onClick: a, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
948
- b,
1017
+ }), Io = R(
1018
+ ({ isExpanded: o, onClick: s }) => {
1019
+ const n = ct();
1020
+ return /* @__PURE__ */ e(Qt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(qt, { onClick: s, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
1021
+ x,
949
1022
  {
950
- sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
1023
+ sx: { color: n.palette.primary.main, flexDirection: "row", alignItems: "center" },
951
1024
  children: [
952
- /* @__PURE__ */ e(Jt, { children: /* @__PURE__ */ e(z, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
953
- /* @__PURE__ */ e(Qt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(Kt, {}) : /* @__PURE__ */ e(
1025
+ /* @__PURE__ */ e(eo, { children: /* @__PURE__ */ e(X, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
1026
+ /* @__PURE__ */ e(Jt, { sx: { color: n.palette.primary.main }, children: o ? /* @__PURE__ */ e(Yt, {}) : /* @__PURE__ */ e(
954
1027
  jt,
955
1028
  {
956
1029
  sx: {
@@ -963,128 +1036,128 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
963
1036
  }
964
1037
  ) }) });
965
1038
  }
966
- ), Ve = R(
1039
+ ), je = R(
967
1040
  ({
968
1041
  totalAmount: o,
969
- guid: a,
970
- name: t,
971
- transactions: n,
972
- onClick: s,
973
- isLastItem: l = !1,
974
- showDivider: m = !0
1042
+ guid: s,
1043
+ name: n,
1044
+ transactions: t,
1045
+ onClick: r,
1046
+ isLastItem: i = !1,
1047
+ showDivider: d = !0
975
1048
  }) => {
976
- const { trends: h } = O(), { onEvent: i } = P(), d = `${n.length} ${n.length === 1 ? h.transaction : h.transactions}`, f = () => {
977
- s?.(), i(w.TRENDS_CLICK_LIST_ITEM, {
978
- ...V,
979
- listItem: t
1049
+ const { trends: h } = k(), { onEvent: c } = z(), l = `${t.length} ${t.length === 1 ? h.transaction : h.transactions}`, p = () => {
1050
+ r?.(), c(v.TRENDS_CLICK_LIST_ITEM, {
1051
+ ...G,
1052
+ listItem: n
980
1053
  });
981
1054
  };
982
- return /* @__PURE__ */ C(c.Fragment, { children: [
1055
+ return /* @__PURE__ */ C(u.Fragment, { children: [
983
1056
  /* @__PURE__ */ e(
984
- Ke,
1057
+ tt,
985
1058
  {
986
- leftIcon: a ? /* @__PURE__ */ e(ve, { categoryGuid: a }) : void 0,
987
- onClick: f,
1059
+ leftIcon: s ? /* @__PURE__ */ e(we, { categoryGuid: s }) : void 0,
1060
+ onClick: p,
988
1061
  rightContent: oe(Math.abs(o), "0,0.00"),
989
- rightIcon: s ? /* @__PURE__ */ e(mt, {}) : void 0,
990
- subtitle: d,
991
- title: t
1062
+ rightIcon: r ? /* @__PURE__ */ e(xt, {}) : void 0,
1063
+ subtitle: l,
1064
+ title: n
992
1065
  }
993
1066
  ),
994
- m && /* @__PURE__ */ e(Re, { sx: { ml: l ? 24 : 68 } })
995
- ] }, a);
1067
+ d && /* @__PURE__ */ e(He, { sx: { ml: i ? 24 : 68 } })
1068
+ ] }, s);
996
1069
  }
997
- ), Do = R(
998
- ({ availableHeight: o = 0, onCategoryClick: a }) => {
999
- const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = Ce(), { isLargeDesktop: l, isDesktop: m } = J(), { trends: h } = O(), { onEvent: i } = P(), [d, f] = c.useState(!1), p = m || l;
1000
- c.useEffect(() => {
1001
- const y = Math.floor(o / 64) - 1, S = n.length + t.length;
1002
- y !== n.length && (s(p ? Math.max(y, 5) : 5), f(y >= S));
1070
+ ), Eo = R(
1071
+ ({ availableHeight: o = 0, onCategoryClick: s }) => {
1072
+ const { collapsedCategories: n, visibleCategories: t, setVisibleListLength: r } = Ce(), { isLargeDesktop: i, isDesktop: d } = q(), { trends: h } = k(), { onEvent: c } = z(), [l, p] = u.useState(!1), m = d || i;
1073
+ u.useEffect(() => {
1074
+ const g = Math.floor(o / 64) - 1, y = t.length + n.length;
1075
+ g !== t.length && (r(m ? Math.max(g, 5) : 5), p(g >= y));
1003
1076
  }, [o]);
1004
1077
  const _ = () => {
1005
- f(!d), i(w.TRENDS_CLICK_VIEW_MORE, {
1006
- ...V
1078
+ p(!l), c(v.TRENDS_CLICK_VIEW_MORE, {
1079
+ ...G
1007
1080
  });
1008
- }, u = n.length + (d ? t.length : 0);
1009
- return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(Xt, { children: [
1010
- /* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Pe, { children: h.categories }) }),
1011
- n.map((y, S) => /* @__PURE__ */ e(
1012
- Ve,
1081
+ }, f = t.length + (l ? n.length : 0);
1082
+ return /* @__PURE__ */ e(x, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(Zt, { children: [
1083
+ /* @__PURE__ */ e(x, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Ue, { children: h.categories }) }),
1084
+ t.map((g, y) => /* @__PURE__ */ e(
1085
+ je,
1013
1086
  {
1014
- ...y,
1015
- isLastItem: S === u - 1,
1016
- onClick: y.transactions.length > 0 ? () => a(y) : void 0,
1087
+ ...g,
1088
+ isLastItem: y === f - 1,
1089
+ onClick: g.transactions.length > 0 ? () => s(g) : void 0,
1017
1090
  showDivider: !0
1018
1091
  },
1019
- y.guid
1092
+ g.guid
1020
1093
  )),
1021
1094
  /* @__PURE__ */ e(
1022
- Ut,
1095
+ Xt,
1023
1096
  {
1024
- in: d,
1097
+ in: l,
1025
1098
  sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
1026
- children: t.map((y, S) => {
1027
- const g = n.length + S;
1099
+ children: n.map((g, y) => {
1100
+ const w = t.length + y;
1028
1101
  return /* @__PURE__ */ e(
1029
- Ve,
1102
+ je,
1030
1103
  {
1031
- ...y,
1032
- isLastItem: g === u - 1,
1033
- onClick: y.transactions.length > 0 ? () => a(y) : void 0,
1104
+ ...g,
1105
+ isLastItem: w === f - 1,
1106
+ onClick: g.transactions.length > 0 ? () => s(g) : void 0,
1034
1107
  showDivider: !0
1035
1108
  },
1036
- y.guid
1109
+ g.guid
1037
1110
  );
1038
1111
  })
1039
1112
  }
1040
1113
  ),
1041
- t.length > 0 && /* @__PURE__ */ e(wo, { isExpanded: d, onClick: _ })
1114
+ n.length > 0 && /* @__PURE__ */ e(Io, { isExpanded: l, onClick: _ })
1042
1115
  ] }) });
1043
1116
  }
1044
- ), Lo = ({ beats: o, onInsightCardClick: a }) => {
1045
- const { onEvent: t } = P(), { isMobile: n, isDesktop: s, isLargeDesktop: l } = J(), { beatStore: m, endpoint: h, sessionToken: i } = He(), d = s || l, f = d || n ? 1 : 2, p = () => null, _ = (E) => {
1046
- a?.(E), t(w.TRENDS_CLICK_INSIGHT, V);
1047
- }, u = d ? 200 : 170, y = d ? 170 : 124, S = d ? 56 : 0, g = o.length > 0 ? u + S : y, v = d && o.length > 0 ? u : void 0;
1048
- return /* @__PURE__ */ e(wt, { sx: { height: g }, children: /* @__PURE__ */ e(
1049
- Bt,
1117
+ ), Mo = ({ beats: o, onInsightCardClick: s }) => {
1118
+ const { onEvent: n } = z(), { isMobile: t, isDesktop: r, isLargeDesktop: i } = q(), { beatStore: d, endpoint: h, sessionToken: c } = We(), l = r || i, p = l || t ? 1 : 2, m = () => null, _ = (M) => {
1119
+ s?.(M), n(v.TRENDS_CLICK_INSIGHT, G);
1120
+ }, f = l ? 200 : 170, g = l ? 170 : 124, y = l ? 56 : 0, w = o.length > 0 ? f + y : g, b = l && o.length > 0 ? f : void 0;
1121
+ return /* @__PURE__ */ e(to, { sx: { height: w }, children: /* @__PURE__ */ e(
1122
+ Vt,
1050
1123
  {
1051
- areBeatsLoading: m.isLoading,
1124
+ areBeatsLoading: d.isLoading,
1052
1125
  beats: o,
1053
1126
  endpoint: h,
1054
- heightOverrides: v,
1055
- logOutUser: p,
1127
+ heightOverrides: b,
1128
+ logOutUser: m,
1056
1129
  onCardClick: _,
1057
1130
  showBorder: !0,
1058
1131
  showCTAColocatedWithText: !1,
1059
1132
  showCarouselControls: !0,
1060
- showHeader: d,
1133
+ showHeader: l,
1061
1134
  showIcon: !0,
1062
1135
  showWithMargin: !1,
1063
- token: i,
1136
+ token: c,
1064
1137
  userHasFullInsightFeedBeats: !1,
1065
1138
  variant: "outlined",
1066
- visibleCardsCount: f
1139
+ visibleCardsCount: p
1067
1140
  }
1068
1141
  ) });
1069
- }, Eo = R(Lo), Io = R(({ chartLabel: o, chartColor: a }) => {
1070
- const { onEvent: t } = P(), {
1071
- categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: s }
1142
+ }, Ao = R(Mo), Ro = R(({ chartLabel: o, chartColor: s }) => {
1143
+ const { onEvent: n } = z(), {
1144
+ categoryDetailsChartData: { monthlyAmounts: t, tooltipLabels: r }
1072
1145
  } = Ce();
1073
- return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1074
- Ne,
1146
+ return /* @__PURE__ */ e(x, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1147
+ Oe,
1075
1148
  {
1076
1149
  baseline: "min",
1077
- colors: [a],
1150
+ colors: [s],
1078
1151
  curveType: "bump",
1079
- customTooltipLabels: s,
1080
- datasets: [n],
1152
+ customTooltipLabels: r,
1153
+ datasets: [t],
1081
1154
  height: 265,
1082
1155
  labels: [o],
1083
1156
  markStyles: () => ({
1084
- stroke: a
1157
+ stroke: s
1085
1158
  }),
1086
1159
  onItemClick: () => {
1087
- t(w.TRENDS_CLICK_CHART, V);
1160
+ n(v.TRENDS_CLICK_CHART, G);
1088
1161
  },
1089
1162
  showArea: !0,
1090
1163
  showAverage: !0,
@@ -1099,100 +1172,100 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
1099
1172
  valueFormatterString: "0,0"
1100
1173
  }
1101
1174
  ) });
1102
- }), Mo = R(({ onClose: o }) => {
1103
- const a = qe(), { onEvent: t } = P(), { common: n, trends: s } = O(), { selectedCategoryData: l, selectedDateRangeMonthRange: m } = Ce(), { sortedTransactions: h } = De(), [i, d] = c.useState(null);
1175
+ }), ko = R(({ onClose: o }) => {
1176
+ const s = ct(), { is_mobile_webview: n } = Je(), { isDesktop: t, isSmallTablet: r, isTablet: i } = q(), { onEvent: d } = z(), { common: h, trends: c } = k(), { selectedCategoryData: l, selectedDateRangeMonthRange: p } = Ce(), { sortedTransactions: m } = ve(), [_, f] = u.useState(null);
1104
1177
  if (!l)
1105
1178
  return null;
1106
- const { guid: f, name: p, is_income: _, totalAmount: u } = l, y = _ ? s.category_income : s.category_spending, S = to(f, a), g = _ ? s.income_label : s.spending_label, v = ` ${l.transactions.length === 1 ? s.transaction : s.transactions} (${l.transactions.length})`, E = c.useMemo(
1107
- () => h.find((M) => M.guid === i),
1108
- [i, h]
1109
- ), I = (M) => M.category_guid === f || M.top_level_category_guid === f, x = () => {
1110
- o?.(), t(w.TRENDS_CLICK_BACK, V);
1179
+ const { guid: g, name: y, is_income: w, totalAmount: b } = l, M = w ? c.category_income : c.category_spending, I = no(g, s), S = w ? c.income_label : c.spending_label, H = ` ${l.transactions.length === 1 ? c.transaction : c.transactions} (${l.transactions.length})`, N = u.useMemo(
1180
+ () => m.find((E) => E.guid === _),
1181
+ [_, m]
1182
+ ), $ = m.length > 0 && !n && (t || i && !r), V = (E) => E.category_guid === g || E.top_level_category_guid === g, K = () => {
1183
+ o?.(), d(v.TRENDS_CLICK_BACK, G);
1111
1184
  };
1112
1185
  return /* @__PURE__ */ C(
1113
- ke,
1186
+ Ne,
1114
1187
  {
1115
- ariaLabelClose: s.close_category_details,
1188
+ ariaLabelClose: c.close_category_details,
1116
1189
  isOpen: !0,
1117
- onClose: x,
1190
+ onClose: K,
1118
1191
  shouldShowHeaderShadow: !0,
1119
- title: y,
1192
+ title: M,
1120
1193
  children: [
1121
- /* @__PURE__ */ C(b, { sx: { alignItems: "center", height: "100%" }, children: [
1122
- /* @__PURE__ */ C(eo, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1194
+ /* @__PURE__ */ C(x, { sx: { alignItems: "center", height: "100%" }, children: [
1195
+ /* @__PURE__ */ C(oo, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1123
1196
  /* @__PURE__ */ e(
1124
- Ke,
1197
+ tt,
1125
1198
  {
1126
- leftIcon: /* @__PURE__ */ e(ve, { categoryGuid: f }),
1127
- rightContent: oe(Math.abs(u), "0,0.00"),
1128
- subtitle: m,
1129
- title: p
1199
+ leftIcon: /* @__PURE__ */ e(we, { categoryGuid: g }),
1200
+ rightContent: oe(Math.abs(b), "0,0.00"),
1201
+ subtitle: p,
1202
+ title: y
1130
1203
  }
1131
1204
  ),
1132
- /* @__PURE__ */ e(Io, { chartColor: S, chartLabel: g }),
1133
- /* @__PURE__ */ C(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
1134
- /* @__PURE__ */ e(z, { bold: !0, variant: "body1", children: v }),
1135
- /* @__PURE__ */ e(oo, { filter: I })
1205
+ /* @__PURE__ */ e(Ro, { chartColor: I, chartLabel: S }),
1206
+ /* @__PURE__ */ C(x, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
1207
+ /* @__PURE__ */ e(X, { bold: !0, variant: "body1", children: H }),
1208
+ $ && /* @__PURE__ */ e(so, { filter: V })
1136
1209
  ] })
1137
1210
  ] }),
1138
1211
  /* @__PURE__ */ e(
1139
- Ze,
1212
+ it,
1140
1213
  {
1141
1214
  bgcolor: "transparent",
1142
- filter: I,
1215
+ filter: V,
1143
1216
  height: "calc(100vh - 475px)",
1144
- onClick: d
1217
+ onClick: f
1145
1218
  }
1146
1219
  )
1147
1220
  ] }),
1148
1221
  /* @__PURE__ */ e(
1149
- ke,
1222
+ Ne,
1150
1223
  {
1151
- ariaLabelClose: n.close_aria,
1152
- isOpen: !!E,
1153
- onClose: () => d(""),
1154
- title: s.transaction,
1155
- children: E && /* @__PURE__ */ e(Xe, { transaction: E })
1224
+ ariaLabelClose: h.close_aria,
1225
+ isOpen: !!N,
1226
+ onClose: () => f(""),
1227
+ title: c.transaction,
1228
+ children: N && /* @__PURE__ */ e(at, { transaction: N })
1156
1229
  }
1157
1230
  )
1158
1231
  ]
1159
1232
  }
1160
1233
  );
1161
- }), Ao = (o, a) => {
1162
- const t = je(o, a), n = Ye(o, a);
1163
- return [t, n].filter((s) => s.length > 0);
1164
- }, Ro = (o, a) => {
1165
- const [t, n] = o, s = t, l = n ?? t, m = [];
1166
- if (s) {
1167
- const h = s.reduce((i, d) => i + d.y, 0);
1168
- m.push({ label: a.income_label, amount: h });
1234
+ }), Ho = (o, s) => {
1235
+ const n = ot(o, s), t = nt(o, s);
1236
+ return [n, t].filter((r) => r.length > 0);
1237
+ }, No = (o, s) => {
1238
+ const [n, t] = o, r = n, i = t ?? n, d = [];
1239
+ if (r) {
1240
+ const h = r.reduce((c, l) => c + l.y, 0);
1241
+ d.push({ label: s.income_label, amount: h });
1169
1242
  }
1170
- if (l) {
1171
- const h = l.reduce((i, d) => i + d.y, 0);
1172
- m.push({ label: a.spending_label, amount: h });
1243
+ if (i) {
1244
+ const h = i.reduce((c, l) => c + l.y, 0);
1245
+ d.push({ label: s.spending_label, amount: h });
1173
1246
  }
1174
- return m;
1175
- }, ko = ({
1247
+ return d;
1248
+ }, Wo = ({
1176
1249
  availableHeight: o = 0,
1177
- minHeight: a = 500,
1178
- selectedDateRange: t,
1179
- totals: n
1250
+ minHeight: s = 500,
1251
+ selectedDateRange: n,
1252
+ totals: t
1180
1253
  }) => {
1181
- const s = we(), { onEvent: l } = P(), { trends: m } = O(), { isSmallMobile: h, isMobile: i, isSmallTablet: d, isTablet: f } = J(), p = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = Ao(n, t), u = Ro(_, m), [y, S] = c.useState(0), g = 458, v = 195, E = 56, I = i || h ? v : d || f ? g : y;
1182
- return c.useEffect(() => {
1183
- const M = Math.max(o - E, a);
1184
- S(M);
1254
+ const r = le(), { onEvent: i } = z(), { trends: d } = k(), { isSmallMobile: h, isMobile: c, isSmallTablet: l, isTablet: p } = q(), m = [r.palette.chart?.chart1, r.palette.chart?.chart2], _ = Ho(t, n), f = No(_, d), [g, y] = u.useState(0), w = 458, b = 195, M = 56, I = c || h ? b : l || p ? w : g;
1255
+ return u.useEffect(() => {
1256
+ const H = Math.max(o - M, s);
1257
+ y(H);
1185
1258
  }, [o]), /* @__PURE__ */ e(
1186
- Ne,
1259
+ Oe,
1187
1260
  {
1188
1261
  baseline: "min",
1189
- colors: p,
1262
+ colors: m,
1190
1263
  curveType: "bump",
1191
1264
  datasets: _,
1192
1265
  height: I,
1193
- labels: u,
1266
+ labels: f,
1194
1267
  onItemClick: () => {
1195
- l(w.TRENDS_CLICK_CHART, V);
1268
+ i(v.TRENDS_CLICK_CHART, G);
1196
1269
  },
1197
1270
  showArea: !0,
1198
1271
  showAxisHighlight: !0,
@@ -1205,7 +1278,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
1205
1278
  valueFormatterString: "0.0a"
1206
1279
  }
1207
1280
  );
1208
- }, Ho = R(ko), No = [
1281
+ }, Oo = R(Wo), Go = [
1209
1282
  "BillAmountNotStandard",
1210
1283
  "CategorySpendingV2",
1211
1284
  "CostOfLivingToIncome",
@@ -1239,188 +1312,189 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
1239
1312
  "WeeklyNewMerchantsV2",
1240
1313
  "WeeklyNoSpendDays",
1241
1314
  "WeeklySmallPurchasesSummary"
1242
- ], Wo = ({ onBackClick: o, onInsightCardClick: a, sx: t }) => {
1243
- const { onEvent: n } = P(), { onLoad: s } = _t(), { config: l } = Tt(), { isLargeDesktop: m, isDesktop: h, isMobile: i } = J(), { isAccountDataLoaded: d, loadAccountData: f, visibleAccounts: p } = Le(), {
1244
- categoriesLoaded: _,
1245
- loadCategories: u,
1246
- loadDateRangeCategoryTotals: y,
1247
- loadMonthlyCategoryTotals: S,
1248
- monthlyCategoryTotals: g
1249
- } = Y(), { isTransactionDataLoaded: v, loadTransactionData: E, setFilter: I } = De(), { selectedDateRange: x, setSelectedCategoryData: M, setSelectedDateRange: k } = Ce(), { isInitialized: A, selectedAccounts: G, selectedAccountGuids: ee, setSelectedAccounts: ne } = fe(), { trends: H, connect: ue } = O(), { beatStore: B } = He(), ae = no() && l.show_insights_widget_in_master, $ = h || m, [ye, U] = c.useState(!1), [K, re] = c.useState(!1), [X, Z] = c.useState("Chart"), [te, ie] = c.useState(""), [he, ce] = c.useState(!1), [le, D] = c.useState(window.innerHeight), r = $ ? 56 : 0, T = le - 208, L = le - (ae ? 550 + r : 266), [j, _e] = c.useState(!1), Ee = l.show_connections_widget_in_master ? "buttons" : "no-buttons", de = c.useMemo(
1250
- () => p && p.length === 0 || g.length === 0,
1251
- [p, g]
1252
- ), Te = c.useMemo(() => K ? B.getFilteredBeats({ templates: No }) : [], [K]);
1253
- c.useEffect(() => {
1254
- const N = () => D(window.innerHeight);
1255
- return window.addEventListener("resize", N), d || f().finally(), _ || u().finally(), v || E().finally(), () => window.removeEventListener("resize", N);
1256
- }, []), c.useEffect(() => {
1257
- ne(p);
1258
- }, [p]), c.useEffect(() => {
1259
- A && (B.loadBeats().finally(() => re(!0)), y(G, x.start, x.end).then(() => {
1260
- S(
1261
- G,
1262
- x.start,
1263
- x.end
1315
+ ], Bo = ({ onBackClick: o, onInsightCardClick: s, sx: n }) => {
1316
+ const { onEvent: t } = z(), { config: r } = Je(), { isDesktop: i, isLargeDesktop: d, isMobile: h } = q(), { isAccountDataLoaded: c, loadAccountData: l, visibleAccounts: p } = De(), {
1317
+ categoriesLoaded: m,
1318
+ loadCategories: _,
1319
+ loadDateRangeCategoryTotals: f,
1320
+ loadMonthlyCategoryTotals: g,
1321
+ monthlyCategoryTotals: y,
1322
+ monthlyTotalsLoaded: w
1323
+ } = J(), { isTransactionDataLoaded: b, loadTransactionData: M, setFilter: I } = ve(), { selectedDateRange: S, setSelectedCategoryData: H, setSelectedDateRange: N } = Ce(), { isInitialized: $, selectedAccounts: V, selectedAccountGuids: K } = ye(), { trends: E, connect: te } = k(), { beatStore: O } = We(), se = ro() && r.show_insights_widget_in_master, Z = i || d, [de, ue] = u.useState(!1), [F, re] = u.useState(!1), [Y, he] = u.useState("Chart"), [j, ae] = u.useState(""), [ge, ie] = u.useState(!1), [ce, D] = u.useState(window.innerHeight), P = Z ? 56 : 0, a = ce - 208, T = ce - (se ? 550 + P : 266), [L, U] = u.useState(!1), Ee = r.show_connections_widget_in_master ? "buttons" : "no-buttons";
1324
+ Ie({
1325
+ widgetName: "TrendsWidget",
1326
+ isLoaded: de
1327
+ });
1328
+ const _e = u.useMemo(() => F ? O.getFilteredBeats({ templates: Go }) : [], [F]);
1329
+ u.useEffect(() => {
1330
+ const W = () => D(window.innerHeight);
1331
+ return window.addEventListener("resize", W), c || l().finally(), m || _().finally(), b || M().finally(), () => window.removeEventListener("resize", W);
1332
+ }, []), u.useEffect(() => {
1333
+ $ && (O.loadBeats().finally(() => re(!0)), f(V, S.start, S.end).then(() => {
1334
+ g(
1335
+ V,
1336
+ S.start,
1337
+ S.end
1264
1338
  );
1265
1339
  }).finally(() => {
1266
- U(!0), n(w.TRENDS_LOAD_WIDGET, {
1267
- ...V,
1268
- time_period: `${Ae(x.end, x.start)}M`
1269
- }), s?.("TrendsWidget");
1340
+ ue(!0), t(v.TRENDS_LOAD_WIDGET, {
1341
+ ...G,
1342
+ time_period: `${Se(S.end, S.start)}M`
1343
+ });
1270
1344
  }));
1271
- }, [A, G, x]), c.useEffect(() => {
1272
- if (g.length !== 0) {
1273
- const N = {
1274
- accounts: ee,
1275
- dateRange: { start: x.start, end: x.end }
1345
+ }, [$, V, S]), u.useEffect(() => {
1346
+ if (y.length !== 0) {
1347
+ const W = {
1348
+ accounts: K,
1349
+ dateRange: { start: S.start, end: S.end }
1276
1350
  };
1277
1351
  I({
1278
- ...N,
1279
- custom: (q) => !!g.find(
1280
- (ge) => ge.top_level_category_guid === q.top_level_category_guid || ge.category_guid === q.category_guid
1352
+ ...W,
1353
+ custom: (ee) => !!y.find(
1354
+ (pe) => pe.top_level_category_guid === ee.top_level_category_guid || pe.category_guid === ee.category_guid
1281
1355
  )
1282
1356
  });
1283
1357
  }
1284
- }, [g]);
1285
- const Ie = (N) => {
1286
- M(N), ce(!0);
1287
- }, ot = () => {
1288
- M(null), ce(!1);
1289
- }, nt = () => {
1290
- _e(!0), n(w.TRENDS_CLICK_CONNECT_ACCOUNTS);
1291
- }, st = (N, q) => {
1292
- Z(q ?? X), n(w.TRENDS_CLICK_TOGGLE_VIEW, {
1293
- ...V,
1294
- toggleView: q
1358
+ }, [y]);
1359
+ const me = (W) => {
1360
+ H(W), ie(!0);
1361
+ }, Me = () => {
1362
+ H(null), ie(!1);
1363
+ }, Ae = () => {
1364
+ U(!0), t(v.TRENDS_CLICK_CONNECT_ACCOUNTS);
1365
+ }, gt = (W, ee) => {
1366
+ he(ee ?? Y), t(v.TRENDS_CLICK_TOGGLE_VIEW, {
1367
+ ...G,
1368
+ toggleView: ee
1295
1369
  });
1296
- }, at = (N) => {
1297
- const q = Fe(N?.[0], 1), ge = N?.[1], lt = Ae(ge, q);
1298
- k({ start: q, end: ge }), n(w.TRENDS_CLICK_TIME_WINDOW, {
1299
- ...V,
1300
- time_period: lt + "M"
1370
+ }, mt = (W) => {
1371
+ const ee = Xe(W?.[0], 1), pe = W?.[1], Ct = Se(pe, ee);
1372
+ N({ start: ee, end: pe }), t(v.TRENDS_CLICK_TIME_WINDOW, {
1373
+ ...G,
1374
+ time_period: Ct + "M"
1301
1375
  });
1302
- }, rt = (N) => {
1303
- n(w.TRENDS_CLICK_FILTER, {
1304
- ...V,
1305
- filterValue: N
1376
+ }, pt = (W) => {
1377
+ t(v.TRENDS_CLICK_FILTER, {
1378
+ ...G,
1379
+ filterValue: W
1306
1380
  });
1307
- }, it = (N) => {
1308
- ie(N);
1309
- }, ct = () => {
1310
- ie(""), n(w.TRENDS_CLICK_ALL_CATEGORIES, V);
1381
+ }, ft = (W) => {
1382
+ ae(W);
1383
+ }, yt = () => {
1384
+ ae(""), t(v.TRENDS_CLICK_ALL_CATEGORIES, G);
1311
1385
  };
1312
- return !A || !ye ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ C(
1313
- Ue,
1386
+ if (!$ || !de || !w) return /* @__PURE__ */ e(Le, {});
1387
+ const Ge = p && p.length === 0 || y.length === 0;
1388
+ return /* @__PURE__ */ C(
1389
+ rt,
1314
1390
  {
1315
- accountOptions: p,
1316
- calendarActions: { onRangeChanged: at },
1317
- dateRange: x,
1318
- dateRangeVariant: i ? "timeframetabs" : "timeframebuttons",
1319
- onAccountsFilterClick: rt,
1391
+ calendarActions: { onRangeChanged: mt },
1392
+ dateRange: S,
1393
+ dateRangeVariant: h ? "timeframetabs" : "timeframebuttons",
1394
+ onAccountsFilterClick: pt,
1320
1395
  onBackClick: o,
1321
- sx: t,
1322
- title: H.title,
1396
+ sx: n,
1397
+ title: E.title,
1323
1398
  children: [
1324
- de && /* @__PURE__ */ e(
1325
- so,
1399
+ Ge && /* @__PURE__ */ e(
1400
+ ao,
1326
1401
  {
1327
- header: H.zero_state_content_header,
1402
+ header: E.zero_state_content_header,
1328
1403
  icon: "",
1329
- onClick: nt,
1330
- primaryButton: H.empty_state_primary,
1331
- subText: H.empty_state_sub_text,
1332
- sx: { height: T },
1404
+ onClick: Ae,
1405
+ primaryButton: E.empty_state_primary,
1406
+ subText: E.empty_state_sub_text,
1407
+ sx: { height: a },
1333
1408
  variant: Ee
1334
1409
  }
1335
1410
  ),
1336
- !de && /* @__PURE__ */ C(
1337
- b,
1411
+ !Ge && /* @__PURE__ */ C(
1412
+ x,
1338
1413
  {
1339
1414
  sx: {
1340
- px: i ? 0 : 48
1415
+ px: h ? 0 : 48
1341
1416
  },
1342
1417
  children: [
1343
1418
  /* @__PURE__ */ C(
1344
- b,
1419
+ x,
1345
1420
  {
1346
1421
  flexDirection: "row",
1347
1422
  justifyContent: "space-between",
1348
- sx: { pb: i ? 12 : 24, pt: i ? 24 : 48 },
1423
+ sx: { gap: 8, px: h ? 24 : 0, py: 16 },
1349
1424
  children: [
1350
1425
  /* @__PURE__ */ e(
1351
- et,
1426
+ ut,
1352
1427
  {
1353
- selectedCategoryGuid: te,
1354
- selectedDateRange: x
1428
+ selectedCategoryGuid: j,
1429
+ selectedDateRange: S
1355
1430
  }
1356
1431
  ),
1357
- /* @__PURE__ */ e(Je, { onTabChange: st, selectedTab: X })
1432
+ /* @__PURE__ */ e(dt, { onTabChange: gt, selectedTab: Y })
1358
1433
  ]
1359
1434
  }
1360
1435
  ),
1361
- /* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: te && /* @__PURE__ */ C(be, { onClick: ct, sx: { p: 0, pr: 5 }, children: [
1362
- /* @__PURE__ */ e(Se, { name: "arrow_back" }),
1363
- H.all_categories
1436
+ /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", sx: { pb: 8 }, width: "100%", children: /* @__PURE__ */ e(A, { flexGrow: 1, children: j && /* @__PURE__ */ C(be, { onClick: yt, sx: { p: 0, pr: 5 }, children: [
1437
+ /* @__PURE__ */ e(Te, { name: "arrow_back" }),
1438
+ E.all_categories
1364
1439
  ] }) }) }),
1365
- /* @__PURE__ */ C(b, { flexDirection: $ ? "row" : "column", gap: $ ? 48 : 16, children: [
1366
- X === "Chart" && /* @__PURE__ */ C(dt, { children: [
1367
- /* @__PURE__ */ e(W, { sx: { width: $ ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1368
- Ho,
1440
+ /* @__PURE__ */ C(x, { flexDirection: Z ? "row" : "column", gap: Z ? 48 : 16, children: [
1441
+ Y === "Chart" && /* @__PURE__ */ C(_t, { children: [
1442
+ /* @__PURE__ */ e(A, { sx: { width: Z ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1443
+ Oo,
1369
1444
  {
1370
- availableHeight: T,
1445
+ availableHeight: a,
1371
1446
  minHeight: 450,
1372
- selectedDateRange: x,
1373
- totals: g
1447
+ selectedDateRange: S,
1448
+ totals: y
1374
1449
  }
1375
1450
  ) }),
1376
- /* @__PURE__ */ C(b, { gap: 16, sx: { width: $ ? "32%" : "100%" }, children: [
1377
- ae && K && Te.length > 0 && /* @__PURE__ */ e(
1378
- Eo,
1451
+ /* @__PURE__ */ C(x, { gap: 16, sx: { width: Z ? "32%" : "100%" }, children: [
1452
+ se && F && _e.length > 0 && /* @__PURE__ */ e(
1453
+ Ao,
1379
1454
  {
1380
- beats: Te,
1381
- onInsightCardClick: a
1455
+ beats: _e,
1456
+ onInsightCardClick: s
1382
1457
  }
1383
1458
  ),
1384
1459
  /* @__PURE__ */ e(
1385
- Do,
1460
+ Eo,
1386
1461
  {
1387
- availableHeight: L,
1388
- onCategoryClick: Ie
1462
+ availableHeight: T,
1463
+ onCategoryClick: me
1389
1464
  }
1390
1465
  )
1391
1466
  ] })
1392
1467
  ] }),
1393
- X === "Table" && /* @__PURE__ */ e(W, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1394
- tt,
1468
+ Y === "Table" && /* @__PURE__ */ e(A, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1469
+ ht,
1395
1470
  {
1396
1471
  height: "unset",
1397
- monthlyCategoryTotals: g,
1398
- onClickRow: it,
1399
- selectedCategory: te,
1400
- selectedDateRange: x
1472
+ onClickRow: ft,
1473
+ selectedCategory: j,
1474
+ selectedDateRange: S
1401
1475
  }
1402
1476
  ) })
1403
1477
  ] }),
1404
- he && /* @__PURE__ */ e(Mo, { onClose: ot })
1478
+ ge && /* @__PURE__ */ e(ko, { onClose: Me })
1405
1479
  ]
1406
1480
  }
1407
1481
  ),
1408
1482
  /* @__PURE__ */ e(
1409
- ao,
1483
+ io,
1410
1484
  {
1411
- onClose: () => _e(!1),
1412
- showConnectWidget: j,
1413
- title: ue.mini_title
1485
+ onClose: () => U(!1),
1486
+ showConnectWidget: L,
1487
+ title: te.mini_title
1414
1488
  }
1415
1489
  )
1416
1490
  ]
1417
1491
  }
1418
1492
  );
1419
- }, Vn = R(Wo);
1493
+ }, jn = R(Bo);
1420
1494
  export {
1421
- On as TrendsFullWidget,
1422
- Bn as TrendsMicroWidget,
1423
- Gn as TrendsMiniWidget,
1424
- zn as TrendsStore,
1425
- Vn as TrendsWidget
1495
+ $n as TrendsFullWidget,
1496
+ Yn as TrendsMicroWidget,
1497
+ Kn as TrendsMiniWidget,
1498
+ Zn as TrendsStore,
1499
+ jn as TrendsWidget
1426
1500
  };