@mx-cartographer/experiences 9.0.3 → 9.1.0-alpha.bb1

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 (121) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/dist/Analytics-BKzTPees.mjs +61 -0
  3. package/dist/GlobalCopyApi-BeXzaDH9.mjs +487 -0
  4. package/dist/HeaderCell-EhCUSjvj.mjs +10 -0
  5. package/dist/Loader-BlVzRtUd.mjs +73 -0
  6. package/dist/MiniWidgetContainer-COwnjfy7.mjs +110 -0
  7. package/dist/OriginalBalanceAction-sbiqaxok.mjs +110 -0
  8. package/dist/SpendingLegend-D15ixlQ1.mjs +222 -0
  9. package/dist/accounts/index.es.js +12 -1598
  10. package/dist/accounts-DkyAiLpg.mjs +15632 -0
  11. package/dist/analytics/index.es.js +155 -139
  12. package/dist/budgets/index.es.js +1317 -1266
  13. package/dist/cashflow/index.es.js +1047 -942
  14. package/dist/categories/index.es.js +4 -4
  15. package/dist/common/index.es.js +101 -310
  16. package/dist/core/index.es.js +80 -104
  17. package/dist/core-BexP5oiV.mjs +4047 -0
  18. package/dist/dashboard/index.es.js +185 -141
  19. package/dist/debts/index.es.js +1384 -1272
  20. package/dist/finstrong/index.es.js +3366 -3471
  21. package/dist/goals/index.es.js +1103 -984
  22. package/dist/help/index.es.js +3 -25
  23. package/dist/help-CctDYrAH.mjs +2308 -0
  24. package/dist/insights/index.es.js +93 -4843
  25. package/dist/investments/index.es.js +1533 -1522
  26. package/dist/merchants/index.es.js +75 -64
  27. package/dist/microinsights/index.es.js +15 -824
  28. package/dist/microinsights-CRf3ChsJ.mjs +1814 -0
  29. package/dist/networth/index.es.js +550 -503
  30. package/dist/notifications/index.es.js +169 -161
  31. package/dist/recurringtransactions/index.es.js +10 -962
  32. package/dist/recurringtransactions-gbJ_NA8u.mjs +1564 -0
  33. package/dist/settings/index.es.js +13 -880
  34. package/dist/settings-ZMHe439l.mjs +1526 -0
  35. package/dist/spending/index.es.js +400 -456
  36. package/dist/transactions/index.es.js +10 -603
  37. package/dist/trends/index.es.js +1268 -1407
  38. package/package.json +28 -28
  39. package/dist/Account-BaJmiJAG.mjs +0 -118
  40. package/dist/Account-BxHMlV9R.mjs +0 -30
  41. package/dist/AccountDetailsHeader-DIysk_4w.mjs +0 -95
  42. package/dist/AccountDisplayName-CO7z3v99.mjs +0 -11
  43. package/dist/AccountFields-mwJ8NXsX.mjs +0 -141
  44. package/dist/AccountListItem-BDXHs4tV.mjs +0 -94
  45. package/dist/AccountUtils-T5_Odvos.mjs +0 -27
  46. package/dist/Accounts-CseLC3lL.mjs +0 -5
  47. package/dist/Analytics-CkYXKvco.mjs +0 -53
  48. package/dist/Analytics-CzGzz_sE.mjs +0 -136
  49. package/dist/ApiEndpoints-DXwIYNUV.mjs +0 -49
  50. package/dist/BudgetUtil-Bg2AQJpQ.mjs +0 -74
  51. package/dist/Category-DEKZGLYe.mjs +0 -301
  52. package/dist/CategorySelectorDrawer-8soGrhB8.mjs +0 -430
  53. package/dist/Connect-Dk6GZEsA.mjs +0 -39
  54. package/dist/ConnectCard-CCep7Zqe.mjs +0 -54
  55. package/dist/ConnectDrawer-Cnjr3Ddg.mjs +0 -58
  56. package/dist/ConnectionsDrawer-CtfPXk0M.mjs +0 -54
  57. package/dist/CurrencyDialog-DumQCTPO.mjs +0 -373
  58. package/dist/CurrencyInput-adTIRtL3.mjs +0 -87
  59. package/dist/CurrencyText-CCbE6MmF.mjs +0 -20
  60. package/dist/DateFormats-HudZ3Bjs.mjs +0 -64
  61. package/dist/DateUtil-Bhq59ZVg.mjs +0 -58
  62. package/dist/DebtUtils-DD3186U-.mjs +0 -153
  63. package/dist/Dialog-Bvd2n8hz.mjs +0 -66
  64. package/dist/Donut-SzzfZDHF.mjs +0 -88
  65. package/dist/Drawer-BXqqBMxg.mjs +0 -174
  66. package/dist/EmbeddedCard-DPwJjqMH.mjs +0 -856
  67. package/dist/EmptyState-CJUDc3kD.mjs +0 -84
  68. package/dist/Error-Dogaw2jO.mjs +0 -84
  69. package/dist/ErrorBoundary-CsdOcnJ9.mjs +0 -23
  70. package/dist/ExportCsvAction-Bw02ZJEj.mjs +0 -24
  71. package/dist/GlobalAccountFilter-7Cg2-9A5.mjs +0 -237
  72. package/dist/GlobalCopyApi-wcnDUzMV.mjs +0 -128
  73. package/dist/GoalsUtil-C9EnLWvC.mjs +0 -107
  74. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  75. package/dist/Help-CkQTjORd.mjs +0 -299
  76. package/dist/Help-DJ8PrVHX.mjs +0 -3209
  77. package/dist/IconBacking-DgT8DCeh.mjs +0 -39
  78. package/dist/InformationTooltip-4su8bn1e.mjs +0 -41
  79. package/dist/InvestmentUtil-BItV7uEs.mjs +0 -134
  80. package/dist/LineChart-CejWS_rh.mjs +0 -612
  81. package/dist/ListItemAction-CzZ8s39Z.mjs +0 -69
  82. package/dist/ListItemRow-kH1rn8Xu.mjs +0 -67
  83. package/dist/ListItemWrapper-B5r-YQQ_.mjs +0 -42
  84. package/dist/Loader-CxeBwuPG.mjs +0 -21
  85. package/dist/Localization-DnoVyBNK.mjs +0 -38
  86. package/dist/ManageIncome-D1yBODQi.mjs +0 -595
  87. package/dist/MicroWidgetContainer-CfKdQfhi.mjs +0 -45
  88. package/dist/MiniWidgetContainer-BdPiUU-u.mjs +0 -66
  89. package/dist/NetWorthUtils-DilGN1nW.mjs +0 -95
  90. package/dist/Notification-DTNYSd8P.mjs +0 -7
  91. package/dist/NotificationSettings-B4JA5IKE.mjs +0 -677
  92. package/dist/NotificationUtils-BRGFTePr.mjs +0 -23
  93. package/dist/NumberFormatting--XMeeBfr.mjs +0 -49
  94. package/dist/OriginalBalanceAction-BybTXDtO.mjs +0 -114
  95. package/dist/RecurringSettings-D2xbNb67.mjs +0 -88
  96. package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +0 -253
  97. package/dist/ResponsiveButton-CC9F_Ezk.mjs +0 -45
  98. package/dist/SearchBox-Cpgu_gdO.mjs +0 -50
  99. package/dist/Select-BFt-HD-L.mjs +0 -55
  100. package/dist/SelectionBox-B4xELRgp.mjs +0 -48
  101. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +0 -69
  102. package/dist/Sizes-DISGrlUg.mjs +0 -6
  103. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  104. package/dist/SpendingData-Fii_xATx.mjs +0 -53
  105. package/dist/SpendingLegend-5Ct_FZ8o.mjs +0 -193
  106. package/dist/StatusBar-CPfSXe80.mjs +0 -30
  107. package/dist/TabContentContainer-CnMXkVqr.mjs +0 -21
  108. package/dist/ToggleListItem-Dl1lXNwj.mjs +0 -91
  109. package/dist/TransactionDetails-DctXr07p.mjs +0 -1714
  110. package/dist/TransactionUtils-BphBJBbU.mjs +0 -234
  111. package/dist/TrendsUtil-D9z3kIj_.mjs +0 -69
  112. package/dist/UserStore-CRpKQjpP.mjs +0 -3002
  113. package/dist/ViewMoreMicroCard-BD_MNc2z.mjs +0 -1295
  114. package/dist/WidgetContainer-CmbU4CBH.mjs +0 -482
  115. package/dist/hooks-BaO_gOI6.mjs +0 -77
  116. package/dist/useAccountDisplayName-CFa_MrS6.mjs +0 -15
  117. package/dist/useAriaLive-MkYebyUR.mjs +0 -35
  118. package/dist/useDimensions-CeDR9V8N.mjs +0 -36
  119. package/dist/useInsightsEnabled-DaNLPmUU.mjs +0 -11
  120. package/dist/useScreenSize-mWpmnh5w.mjs +0 -36
  121. package/dist/useWidgetLoadTimer-CJb-RELP.mjs +0 -19
@@ -1,115 +1,128 @@
1
- import { jsxs as r, jsx as e, Fragment as N } from "react/jsx-runtime";
2
- import u from "react";
3
- import { observer as _ } from "mobx-react-lite";
4
- import m from "@mui/material/Stack";
5
- import { P as Y, Text as d, Icon as R } from "@mxenabled/mxui";
6
- import { Icon as Z } from "@mxenabled/mx-icons";
7
- import { f as F } from "../NumberFormatting--XMeeBfr.mjs";
8
- import { d as oe, g as $, u as E, b as q, x as j, D as re } from "../hooks-BaO_gOI6.mjs";
9
- import { u as J } from "../useWidgetLoadTimer-CJb-RELP.mjs";
10
- import { A as v } from "../Analytics-CzGzz_sE.mjs";
11
- import { L as Q } from "../Loader-CxeBwuPG.mjs";
12
- import { M as ie } from "../MicroWidgetContainer-CfKdQfhi.mjs";
13
- import { format as ae, fromUnixTime as se, differenceInMonths as ce } from "date-fns";
14
- import P from "@mui/material/Box";
15
- import { C as le } from "../ConnectionsDrawer-CtfPXk0M.mjs";
16
- import { fromUnixTime as de } from "date-fns/fromUnixTime";
1
+ import { J as F, ln as re, m as Y, un as oe, x as K } from "../core-BexP5oiV.mjs";
2
+ import { An as ie, Gn as ae, i as se, jn as x, lr as U, mr as q, qn as ce, sr as w, yn as le } from "../accounts-DkyAiLpg.mjs";
3
+ import { n as J } from "../Analytics-BKzTPees.mjs";
4
+ import { d as B, h as Z, k as de, n as he, p as E, t as Q, x as j } from "../Loader-BlVzRtUd.mjs";
5
+ import p from "react";
6
+ import { observer as C } from "mobx-react-lite";
7
+ import h from "@mui/material/Stack";
8
+ import { Icon as R, P, Text as d } from "@mxenabled/mxui";
9
+ import me from "@mui/material/Button";
10
+ import { Icon as ee } from "@mxenabled/mx-icons";
11
+ import { Fragment as N, jsx as e, jsxs as o } from "react/jsx-runtime";
17
12
  import { useTheme as H } from "@mui/material/styles";
18
- import { L as me } from "../LineChart-CejWS_rh.mjs";
19
- import { u as ee } from "../useScreenSize-mWpmnh5w.mjs";
20
- import { f as he, D as pe } from "../DateFormats-HudZ3Bjs.mjs";
21
- import ue from "@mui/material/Button";
13
+ import te from "@mui/material/Box";
14
+ import { fromUnixTime as ue } from "date-fns/fromUnixTime";
15
+ import { differenceInMonths as pe, format as fe, fromUnixTime as xe } from "date-fns";
16
+ import { Stack as ge } from "@mui/material";
22
17
  import L from "@mui/material/Divider";
23
- import z from "@mui/material/List";
24
- import A from "@mui/material/ListSubheader";
25
- import O from "@mui/material/ListItem";
26
- import te from "@mui/material/ListItemButton";
27
- import b from "@mui/material/ListItemText";
28
- import { j as ne } from "../DateUtil-Bhq59ZVg.mjs";
29
- import { C as x } from "../CurrencyText-CCbE6MmF.mjs";
30
- import { Stack as fe } from "@mui/material";
31
- import xe from "@mui/material/Collapse";
32
- import K from "@mui/material/ListItemIcon";
33
- import { g as U } from "../NetWorthUtils-DilGN1nW.mjs";
34
- import { D as V } from "../Drawer-BXqqBMxg.mjs";
35
- import { W as ge } from "../WidgetContainer-CmbU4CBH.mjs";
36
- import { E as ye } from "../EmptyState-CJUDc3kD.mjs";
37
- const Ce = ({ amount: t, copy: s, trendValue: i }) => {
38
- const n = i > 0, o = i === 0 ? "trending_flat" : n ? "trending_up" : "trending_down";
39
- return /* @__PURE__ */ r(m, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
40
- /* @__PURE__ */ e(Y, { variant: "h1", children: F(t, "0,0") }),
41
- t !== 0 && /* @__PURE__ */ r(m, { sx: { color: n ? "success.main" : "text.secondary" }, children: [
42
- /* @__PURE__ */ r(m, { sx: { flexDirection: "row", gap: 8 }, children: [
43
- /* @__PURE__ */ e(Z, { name: o, size: 20 }),
44
- /* @__PURE__ */ e(d, { sx: { fontWeight: 600, textAlign: "right" }, variant: "body1", children: F(i, "0,0.00") })
45
- ] }),
46
- /* @__PURE__ */ e(d, { sx: { display: "block", textAlign: "right" }, variant: "caption", children: s.this_month })
47
- ] })
48
- ] });
49
- }, be = ({ copy: t }) => /* @__PURE__ */ r(m, { sx: { flexDirection: "row", gap: 12 }, children: [
50
- /* @__PURE__ */ e(Z, { name: "elevation", size: 32, sx: { color: "text.primary" } }),
51
- /* @__PURE__ */ r(m, { children: [
52
- /* @__PURE__ */ e(d, { sx: { display: "block", fontWeight: 600 }, variant: "body1", children: t.empty_widget_header }),
53
- /* @__PURE__ */ e(Y, { sx: { color: "text.secondary" }, variant: "body2", children: t.zero_state_description })
54
- ] })
55
- ] }), gt = _(({ onCTAClick: t }) => {
56
- const { visibleAccounts: s } = oe(), { onEvent: i } = $(), { net_worth: n, common: a } = E(), { isInitialized: o } = q(), { isNetWorthDataLoaded: c, loadNetWorthData: l, netWorthData: g, selectedData: f } = j();
57
- if (u.useEffect(() => {
18
+ import G from "@mui/material/List";
19
+ import A from "@mui/material/ListItem";
20
+ import ne from "@mui/material/ListItemButton";
21
+ import V from "@mui/material/ListItemIcon";
22
+ import v from "@mui/material/ListItemText";
23
+ import O from "@mui/material/ListSubheader";
24
+ import ye from "@mui/material/Collapse";
25
+ var _e = ({ amount: t, copy: s, trendValue: i }) => {
26
+ const n = i > 0, r = i === 0 ? "trending_flat" : n ? "trending_up" : "trending_down";
27
+ return /* @__PURE__ */ o(h, {
28
+ sx: {
29
+ flexDirection: "row",
30
+ justifyContent: "space-between"
31
+ },
32
+ children: [/* @__PURE__ */ e(P, {
33
+ variant: "h1",
34
+ children: F(t, "0,0")
35
+ }), t !== 0 && /* @__PURE__ */ o(h, {
36
+ sx: { color: n ? "success.main" : "text.secondary" },
37
+ children: [/* @__PURE__ */ o(h, {
38
+ sx: {
39
+ flexDirection: "row",
40
+ gap: 8
41
+ },
42
+ children: [/* @__PURE__ */ e(ee, {
43
+ name: r,
44
+ size: 20
45
+ }), /* @__PURE__ */ e(d, {
46
+ sx: {
47
+ fontWeight: 600,
48
+ textAlign: "right"
49
+ },
50
+ variant: "body1",
51
+ children: F(i, "0,0.00")
52
+ })]
53
+ }), /* @__PURE__ */ e(d, {
54
+ sx: {
55
+ display: "block",
56
+ textAlign: "right"
57
+ },
58
+ variant: "caption",
59
+ children: s.this_month
60
+ })]
61
+ })]
62
+ });
63
+ }, ve = ({ copy: t }) => /* @__PURE__ */ o(h, {
64
+ sx: {
65
+ flexDirection: "row",
66
+ gap: 12
67
+ },
68
+ children: [/* @__PURE__ */ e(ee, {
69
+ name: "elevation",
70
+ size: 32,
71
+ sx: { color: "text.primary" }
72
+ }), /* @__PURE__ */ o(h, { children: [/* @__PURE__ */ e(d, {
73
+ sx: {
74
+ display: "block",
75
+ fontWeight: 600
76
+ },
77
+ variant: "body1",
78
+ children: t.empty_widget_header
79
+ }), /* @__PURE__ */ e(P, {
80
+ sx: { color: "text.secondary" },
81
+ variant: "body2",
82
+ children: t.zero_state_description
83
+ })] })]
84
+ }), it = C(({ onCTAClick: t }) => {
85
+ const { visibleAccounts: s } = he(), { onEvent: i } = B(), { net_worth: n, common: r } = E(), { isInitialized: a } = Z(), { isNetWorthDataLoaded: c, loadNetWorthData: l, netWorthData: g, selectedData: f } = j();
86
+ if (p.useEffect(() => {
58
87
  c || l().finally();
59
88
  }, []), J({
60
89
  widgetName: "NetWorthMicroWidget",
61
90
  isLoaded: c
62
- }), u.useEffect(() => {
63
- c && i(v.NET_WORTH_LOAD_WIDGET, {
64
- state: s?.length ? "default" : "zeroState"
65
- });
66
- }, [c]), !o || !c) return /* @__PURE__ */ e(Q, { height: 100 });
67
- const W = () => {
68
- i(
69
- s.length ? v.NET_WORTH_CLICK_VIEW_DETAILS : v.NET_WORTH_CLICK_GET_STARTED
70
- ), t();
91
+ }), p.useEffect(() => {
92
+ c && i(w.NET_WORTH_LOAD_WIDGET, { state: s?.length ? "default" : "zeroState" });
93
+ }, [c]), !a || !c) return /* @__PURE__ */ e(Q, { height: 100 });
94
+ const S = () => {
95
+ i(s.length ? w.NET_WORTH_CLICK_VIEW_DETAILS : w.NET_WORTH_CLICK_GET_STARTED), t();
71
96
  };
72
- return /* @__PURE__ */ e(
73
- ie,
74
- {
75
- className: "mx-networth-microwidget",
76
- ctaLabel: a.see_details,
77
- onCTAClick: W,
78
- title: n.net_worth,
79
- children: g.accounts.length ? /* @__PURE__ */ e(
80
- Ce,
81
- {
82
- amount: f?.y,
83
- copy: n,
84
- trendValue: f?.change
85
- }
86
- ) : /* @__PURE__ */ e(be, { copy: n })
87
- }
88
- );
89
- }), _e = () => {
90
- const { isMobile: t } = ee(), { availableWidth: s } = re(), i = H(), {
91
- hoveredData: n,
92
- netWorthChartData: a,
93
- selectedData: o,
94
- setHoveredIndex: c,
95
- setSelectedIndex: l
96
- } = j(), g = s - 320, f = a.map((h) => ({
97
- x: he(de(h.x), pe.MONTH_SHORT),
98
- y: h.y
99
- })), W = o ? { index: a.findIndex((h) => h.x === o.x) } : void 0, S = n ? { index: a.findIndex((h) => h.x === n.x) } : void 0, w = (h) => ({
100
- fill: h === W?.index ? i.palette.success.main : "",
101
- filter: h === S?.index ? `drop-shadow(0px 0px 10px ${i.palette.success.main})` : "none",
97
+ return /* @__PURE__ */ e(ce, {
98
+ className: "mx-networth-microwidget",
99
+ ctaLabel: r.see_details,
100
+ onCTAClick: S,
101
+ title: n.net_worth,
102
+ children: g.accounts.length ? /* @__PURE__ */ e(_e, {
103
+ amount: f?.y,
104
+ copy: n,
105
+ trendValue: f?.change
106
+ }) : /* @__PURE__ */ e(ve, { copy: n })
107
+ });
108
+ }), Ce = () => {
109
+ const { isMobile: t } = q(), { availableWidth: s } = de(), i = H(), { hoveredData: n, netWorthChartData: r, selectedData: a, setHoveredIndex: c, setSelectedIndex: l } = j(), g = s - 320, f = r.map((m) => ({
110
+ x: oe(ue(m.x), re.MONTH_SHORT),
111
+ y: m.y
112
+ })), S = a ? { index: r.findIndex((m) => m.x === a.x) } : void 0, W = n ? { index: r.findIndex((m) => m.x === n.x) } : void 0, b = (m) => ({
113
+ fill: m === S?.index ? i.palette.success.main : "",
114
+ filter: m === W?.index ? `drop-shadow(0px 0px 10px ${i.palette.success.main})` : "none",
102
115
  stroke: i.palette.success.main
103
- }), y = (h, M) => {
116
+ }), y = (m, M) => {
104
117
  l(M);
105
- }, k = (h) => {
106
- c(h);
118
+ }, k = (m) => {
119
+ c(m);
107
120
  }, D = () => {
108
121
  c(-1);
109
122
  };
110
- return /* @__PURE__ */ e(m, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
111
- me,
112
- {
123
+ return /* @__PURE__ */ e(h, {
124
+ sx: { width: "100%" },
125
+ children: /* @__PURE__ */ e(le, {
113
126
  baseline: "min",
114
127
  chartFor: "networthChart",
115
128
  chartXaxisSx: { "& .MuiChartsAxis-tickLabel": { transform: "translateX(8px)" } },
@@ -118,447 +131,481 @@ const Ce = ({ amount: t, copy: s, trendValue: i }) => {
118
131
  datasets: [f],
119
132
  height: 350,
120
133
  labels: [],
121
- margin: { right: 20, left: 38 },
122
- markHandlers: { onMarkClick: y, onMouseEnter: k, onMouseLeave: D },
123
- markStyles: w,
134
+ margin: {
135
+ right: 20,
136
+ left: 38
137
+ },
138
+ markHandlers: {
139
+ onMarkClick: y,
140
+ onMouseEnter: k,
141
+ onMouseLeave: D
142
+ },
143
+ markStyles: b,
124
144
  showArea: !0,
125
145
  useCustomMark: !0,
126
146
  valueFormatterString: "0.0[0]a",
127
147
  width: t ? s - 48 : g
128
- }
129
- ) });
130
- }, we = _(_e), ve = ({
131
- item: t,
132
- getStyles: s,
133
- isHovered: i = !1,
134
- isSelected: n = !1,
135
- onItemClick: a,
136
- onMouseEnter: o,
137
- onMouseLeave: c
138
- }) => {
139
- const [l, g] = u.useState({
140
- color: ""
148
+ })
141
149
  });
142
- return u.useEffect(() => {
150
+ }, be = C(Ce), we = ({ item: t, getStyles: s, isHovered: i = !1, isSelected: n = !1, onItemClick: r, onMouseEnter: a, onMouseLeave: c }) => {
151
+ const [l, g] = p.useState({ color: "" });
152
+ return p.useEffect(() => {
143
153
  g(s(t));
144
- }, [i, n]), /* @__PURE__ */ r(u.Fragment, { children: [
145
- /* @__PURE__ */ e(
146
- O,
147
- {
148
- sx: {
149
- ...l,
150
- minHeight: 44,
151
- "&:hover": { color: n ? "inherit" : l.color }
152
- },
153
- children: /* @__PURE__ */ e(
154
- te,
155
- {
156
- onClick: (f) => a?.(f, t.x),
157
- onMouseEnter: () => o(t.x),
158
- onMouseLeave: () => c(),
159
- sx: { minHeight: 20, padding: 12 },
160
- children: /* @__PURE__ */ e(
161
- b,
162
- {
163
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
164
- /* @__PURE__ */ e(d, { variant: "body1", children: ne(t.x) }),
165
- /* @__PURE__ */ e(x, { amount: t.y, sx: { color: "inherit" }, variant: "body1" })
166
- ] })
167
- }
168
- )
169
- }
170
- )
171
- }
172
- ),
173
- /* @__PURE__ */ e(L, {})
174
- ] }, t.x);
175
- }, We = _(ve), Se = ({
176
- currencyLabel: t,
177
- currencyVariant: s = "body2",
178
- iconSize: i,
179
- netWorth: n,
180
- theme: a
181
- }) => {
182
- let o = a.palette.secondary.main, c = a.palette.secondary.main, l = "trending_flat";
183
- return n.change < 0 ? l = "trending_down" : n.change > 0 && (o = a.palette.success.main, c = a.palette.success.main, l = "trending_up"), /* @__PURE__ */ r(fe, { alignItems: "center", direction: "row", spacing: 4, children: [
184
- /* @__PURE__ */ e(
185
- R,
186
- {
154
+ }, [i, n]), /* @__PURE__ */ o(p.Fragment, { children: [/* @__PURE__ */ e(A, {
155
+ sx: {
156
+ ...l,
157
+ minHeight: 44,
158
+ "&:hover": { color: n ? "inherit" : l.color }
159
+ },
160
+ children: /* @__PURE__ */ e(ne, {
161
+ onClick: (f) => r?.(f, t.x),
162
+ onMouseEnter: () => a(t.x),
163
+ onMouseLeave: () => c(),
164
+ sx: {
165
+ minHeight: 20,
166
+ padding: 12
167
+ },
168
+ children: /* @__PURE__ */ e(v, { primary: /* @__PURE__ */ o(h, {
169
+ direction: "row",
170
+ justifyContent: "space-between",
171
+ sx: { fontWeight: 400 },
172
+ children: [/* @__PURE__ */ e(d, {
173
+ variant: "body1",
174
+ children: Y(t.x)
175
+ }), /* @__PURE__ */ e(x, {
176
+ amount: t.y,
177
+ sx: { color: "inherit" },
178
+ variant: "body1"
179
+ })]
180
+ }) })
181
+ })
182
+ }), /* @__PURE__ */ e(L, {})] }, t.x);
183
+ }, Se = C(we), We = ({ currencyLabel: t, currencyVariant: s = "body2", iconSize: i, netWorth: n, theme: r }) => {
184
+ let a = r.palette.secondary.main, c = r.palette.secondary.main, l = "trending_flat";
185
+ return n.change < 0 ? l = "trending_down" : n.change > 0 && (a = r.palette.success.main, c = r.palette.success.main, l = "trending_up"), /* @__PURE__ */ o(ge, {
186
+ alignItems: "center",
187
+ direction: "row",
188
+ spacing: 4,
189
+ children: [
190
+ /* @__PURE__ */ e(R, {
187
191
  name: l,
188
192
  size: i,
189
- sx: {
190
- color: o
191
- }
192
- }
193
- ),
194
- /* @__PURE__ */ e(x, { amount: n.change, color: c, variant: s }),
195
- /* @__PURE__ */ e(d, { variant: "body2", children: t })
196
- ] });
197
- }, B = _(Se), Ie = ({
198
- netWorth: t,
199
- gains: s,
200
- losses: i,
201
- totalGains: n,
202
- totalLosses: a
203
- }) => {
204
- const { net_worth: o } = E(), c = H();
205
- return /* @__PURE__ */ r(N, { children: [
206
- /* @__PURE__ */ r(m, { alignItems: "center", justifyContent: "space-between", mb: 8, pt: 24, children: [
207
- /* @__PURE__ */ e(d, { variant: "body2", children: ne(t?.x) }),
208
- /* @__PURE__ */ e(d, { variant: "body1", children: o.total_change }),
209
- t && /* @__PURE__ */ e(B, { currencyVariant: "h1", iconSize: 32, netWorth: t, theme: c })
210
- ] }),
211
- /* @__PURE__ */ r(z, { children: [
212
- /* @__PURE__ */ e(A, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
213
- b,
214
- {
215
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", children: [
216
- /* @__PURE__ */ e(d, { sx: { fontWeight: 700 }, variant: "caption", children: o.gains }),
217
- /* @__PURE__ */ e(x, { amount: n, sx: { fontWeight: 400 }, variant: "caption" })
218
- ] })
219
- }
220
- ) }),
221
- s?.map((l) => /* @__PURE__ */ r(u.Fragment, { children: [
222
- /* @__PURE__ */ e(O, { sx: { backgroundColor: c.palette.background.paper, py: 14 }, children: /* @__PURE__ */ e(
223
- b,
224
- {
225
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", children: [
226
- /* @__PURE__ */ e(d, { sx: { mr: 10 }, variant: "body1", children: l.accountName }),
227
- /* @__PURE__ */ e(
228
- x,
229
- {
230
- amount: l.gain,
231
- sx: { color: c.palette.success.main, flexShrink: 0, fontWeight: 700 },
232
- variant: "body1"
233
- }
234
- )
235
- ] }),
236
- sx: { px: 16 }
237
- }
238
- ) }),
239
- /* @__PURE__ */ e(L, {})
240
- ] }, l.accountName)),
241
- /* @__PURE__ */ e(A, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
242
- b,
243
- {
244
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", children: [
245
- /* @__PURE__ */ e(d, { sx: { fontWeight: 700 }, variant: "caption", children: o.losses }),
246
- /* @__PURE__ */ e(x, { amount: a, sx: { fontWeight: 400 }, variant: "caption" })
247
- ] })
248
- }
249
- ) }),
250
- i?.map((l) => /* @__PURE__ */ r(N, { children: [
251
- /* @__PURE__ */ e(
252
- O,
253
- {
254
- sx: { backgroundColor: c.palette.background.paper, py: 14 },
255
- children: /* @__PURE__ */ e(
256
- b,
257
- {
258
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", children: [
259
- /* @__PURE__ */ e(
260
- d,
261
- {
262
- sx: {
263
- mr: 10
264
- },
265
- variant: "body1",
266
- children: l.accountName
267
- }
268
- ),
269
- /* @__PURE__ */ e(
270
- x,
271
- {
272
- amount: l.loss,
273
- sx: { flexShrink: 0, fontWeight: 700 },
274
- variant: "body1"
275
- }
276
- )
277
- ] }),
278
- sx: { px: 16 }
279
- }
280
- )
281
- },
282
- l.accountName
283
- ),
284
- /* @__PURE__ */ e(L, {})
285
- ] }))
286
- ] })
287
- ] });
288
- }, Te = _(Ie), Le = ({ accounts: t, name: s, icon: i }) => {
289
- const [n, a] = u.useState(!1);
290
- return /* @__PURE__ */ r(N, { children: [
291
- /* @__PURE__ */ e(O, { sx: (o) => ({ backgroundColor: o.palette.background.paper }), children: /* @__PURE__ */ r(te, { onClick: () => a(!n), children: [
292
- i && /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(R, { name: i, size: 24, sx: { mr: 12 } }) }),
293
- /* @__PURE__ */ e(
294
- b,
295
- {
296
- primary: /* @__PURE__ */ e(d, { sx: { fontWeight: 700 }, variant: "body1", children: s })
297
- }
298
- ),
299
- /* @__PURE__ */ e(K, { children: n ? /* @__PURE__ */ e(R, { name: "expand_less", size: 24 }) : /* @__PURE__ */ e(R, { name: "expand_more", size: 24 }) })
300
- ] }) }),
301
- /* @__PURE__ */ e(L, {}),
302
- /* @__PURE__ */ e(xe, { in: n, timeout: "auto", unmountOnExit: !0, children: t.map((o, c) => /* @__PURE__ */ r(z, { children: [
303
- /* @__PURE__ */ e(O, { sx: () => ({ py: 14 }), children: /* @__PURE__ */ e(
304
- b,
305
- {
306
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
307
- /* @__PURE__ */ e(
308
- d,
309
- {
310
- sx: {
311
- marginRight: 10
312
- },
313
- variant: "body1",
314
- children: o.accountName
315
- }
316
- ),
317
- /* @__PURE__ */ e(
318
- x,
319
- {
320
- amount: o.balance,
321
- sx: {
322
- flexShrink: 0
323
- },
324
- variant: "body2"
325
- }
326
- )
327
- ] }),
328
- sx: { pl: 72, pr: 16 }
329
- }
330
- ) }),
331
- c < t.length - 1 ? /* @__PURE__ */ e(L, { variant: "inset" }) : /* @__PURE__ */ e(L, {})
332
- ] }, o.accountName)) })
333
- ] });
334
- }, X = ({ groupedAccounts: t }) => /* @__PURE__ */ e(N, { children: t.map(({ accounts: s, icon: i, name: n }) => /* @__PURE__ */ e(Le, { accounts: s, icon: i, name: n }, n)) }), De = ({
335
- netWorth: t,
336
- assets: s,
337
- liabilities: i,
338
- totalAssets: n,
339
- totalLiabilities: a
340
- }) => {
341
- const { net_worth: o } = E(), c = H();
342
- return /* @__PURE__ */ r(N, { children: [
343
- /* @__PURE__ */ r(
344
- P,
345
- {
346
- sx: {
347
- alignItems: "center",
348
- display: "flex",
349
- flexDirection: "column",
193
+ sx: { color: a }
194
+ }),
195
+ /* @__PURE__ */ e(x, {
196
+ amount: n.change,
197
+ color: c,
198
+ variant: s
199
+ }),
200
+ /* @__PURE__ */ e(d, {
201
+ variant: "body2",
202
+ children: t
203
+ })
204
+ ]
205
+ });
206
+ }, $ = C(We), Te = ({ netWorth: t, gains: s, losses: i, totalGains: n, totalLosses: r }) => {
207
+ const { net_worth: a } = E(), c = H();
208
+ return /* @__PURE__ */ o(N, { children: [/* @__PURE__ */ o(h, {
209
+ alignItems: "center",
210
+ justifyContent: "space-between",
211
+ mb: 8,
212
+ pt: 24,
213
+ children: [
214
+ /* @__PURE__ */ e(d, {
215
+ variant: "body2",
216
+ children: Y(t?.x)
217
+ }),
218
+ /* @__PURE__ */ e(d, {
219
+ variant: "body1",
220
+ children: a.total_change
221
+ }),
222
+ t && /* @__PURE__ */ e($, {
223
+ currencyVariant: "h1",
224
+ iconSize: 32,
225
+ netWorth: t,
226
+ theme: c
227
+ })
228
+ ]
229
+ }), /* @__PURE__ */ o(G, { children: [
230
+ /* @__PURE__ */ e(O, {
231
+ sx: {
232
+ mb: 8,
233
+ mt: 12,
234
+ mx: 8
235
+ },
236
+ children: /* @__PURE__ */ e(v, { primary: /* @__PURE__ */ o(h, {
237
+ direction: "row",
238
+ justifyContent: "space-between",
239
+ children: [/* @__PURE__ */ e(d, {
240
+ sx: { fontWeight: 700 },
241
+ variant: "caption",
242
+ children: a.gains
243
+ }), /* @__PURE__ */ e(x, {
244
+ amount: n,
245
+ sx: { fontWeight: 400 },
246
+ variant: "caption"
247
+ })]
248
+ }) })
249
+ }),
250
+ s?.map((l) => /* @__PURE__ */ o(p.Fragment, { children: [/* @__PURE__ */ e(A, {
251
+ sx: {
252
+ backgroundColor: c.palette.background.paper,
253
+ py: 14
254
+ },
255
+ children: /* @__PURE__ */ e(v, {
256
+ primary: /* @__PURE__ */ o(h, {
257
+ direction: "row",
350
258
  justifyContent: "space-between",
351
- paddingTop: 24,
352
- marginBottom: 8
353
- },
259
+ children: [/* @__PURE__ */ e(d, {
260
+ sx: { mr: 10 },
261
+ variant: "body1",
262
+ children: l.accountName
263
+ }), /* @__PURE__ */ e(x, {
264
+ amount: l.gain,
265
+ sx: {
266
+ color: c.palette.success.main,
267
+ flexShrink: 0,
268
+ fontWeight: 700
269
+ },
270
+ variant: "body1"
271
+ })]
272
+ }),
273
+ sx: { px: 16 }
274
+ })
275
+ }), /* @__PURE__ */ e(L, {})] }, l.accountName)),
276
+ /* @__PURE__ */ e(O, {
277
+ sx: {
278
+ mb: 8,
279
+ mt: 12,
280
+ mx: 8
281
+ },
282
+ children: /* @__PURE__ */ e(v, { primary: /* @__PURE__ */ o(h, {
283
+ direction: "row",
284
+ justifyContent: "space-between",
285
+ children: [/* @__PURE__ */ e(d, {
286
+ sx: { fontWeight: 700 },
287
+ variant: "caption",
288
+ children: a.losses
289
+ }), /* @__PURE__ */ e(x, {
290
+ amount: r,
291
+ sx: { fontWeight: 400 },
292
+ variant: "caption"
293
+ })]
294
+ }) })
295
+ }),
296
+ i?.map((l) => /* @__PURE__ */ o(N, { children: [/* @__PURE__ */ e(A, {
297
+ sx: {
298
+ backgroundColor: c.palette.background.paper,
299
+ py: 14
300
+ },
301
+ children: /* @__PURE__ */ e(v, {
302
+ primary: /* @__PURE__ */ o(h, {
303
+ direction: "row",
304
+ justifyContent: "space-between",
305
+ children: [/* @__PURE__ */ e(d, {
306
+ sx: { mr: 10 },
307
+ variant: "body1",
308
+ children: l.accountName
309
+ }), /* @__PURE__ */ e(x, {
310
+ amount: l.loss,
311
+ sx: {
312
+ flexShrink: 0,
313
+ fontWeight: 700
314
+ },
315
+ variant: "body1"
316
+ })]
317
+ }),
318
+ sx: { px: 16 }
319
+ })
320
+ }, l.accountName), /* @__PURE__ */ e(L, {})] }))
321
+ ] })] });
322
+ }, Ie = C(Te), Le = ({ accounts: t, name: s, icon: i }) => {
323
+ const [n, r] = p.useState(!1);
324
+ return /* @__PURE__ */ o(N, { children: [
325
+ /* @__PURE__ */ e(A, {
326
+ sx: (a) => ({ backgroundColor: a.palette.background.paper }),
327
+ children: /* @__PURE__ */ o(ne, {
328
+ onClick: () => r(!n),
354
329
  children: [
355
- /* @__PURE__ */ e(d, { variant: "body1", children: o.current_net_worth }),
356
- /* @__PURE__ */ e(x, { amount: t?.y ?? 0, variant: "h1" }),
357
- t && /* @__PURE__ */ e(
358
- B,
359
- {
360
- currencyLabel: o.this_month,
361
- iconSize: 20,
362
- netWorth: t,
363
- theme: c
364
- }
365
- )
330
+ i && /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(R, {
331
+ name: i,
332
+ size: 24,
333
+ sx: { mr: 12 }
334
+ }) }),
335
+ /* @__PURE__ */ e(v, { primary: /* @__PURE__ */ e(d, {
336
+ sx: { fontWeight: 700 },
337
+ variant: "body1",
338
+ children: s
339
+ }) }),
340
+ /* @__PURE__ */ e(V, { children: n ? /* @__PURE__ */ e(R, {
341
+ name: "expand_less",
342
+ size: 24
343
+ }) : /* @__PURE__ */ e(R, {
344
+ name: "expand_more",
345
+ size: 24
346
+ }) })
366
347
  ]
367
- }
368
- ),
369
- /* @__PURE__ */ r(z, { children: [
370
- /* @__PURE__ */ e(A, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
371
- b,
372
- {
373
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", children: [
374
- /* @__PURE__ */ e(d, { sx: { fontWeight: 700 }, variant: "caption", children: o.assets }),
375
- /* @__PURE__ */ e(x, { amount: n, sx: { fontWeight: 400 }, variant: "caption" })
376
- ] })
377
- }
378
- ) }),
379
- /* @__PURE__ */ e(X, { groupedAccounts: U(s) }),
380
- /* @__PURE__ */ e(A, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
381
- b,
382
- {
383
- primary: /* @__PURE__ */ r(m, { direction: "row", justifyContent: "space-between", children: [
384
- /* @__PURE__ */ e(d, { sx: { fontWeight: 700 }, variant: "caption", children: o.liabilities }),
385
- /* @__PURE__ */ e(
386
- x,
387
- {
388
- amount: a,
389
- sx: { fontWeight: 400 },
390
- variant: "caption"
391
- }
392
- )
393
- ] })
394
- }
395
- ) }),
396
- /* @__PURE__ */ e(X, { groupedAccounts: U(i) })
397
- ] })
348
+ })
349
+ }),
350
+ /* @__PURE__ */ e(L, {}),
351
+ /* @__PURE__ */ e(ye, {
352
+ in: n,
353
+ timeout: "auto",
354
+ unmountOnExit: !0,
355
+ children: t.map((a, c) => /* @__PURE__ */ o(G, { children: [/* @__PURE__ */ e(A, {
356
+ sx: () => ({ py: 14 }),
357
+ children: /* @__PURE__ */ e(v, {
358
+ primary: /* @__PURE__ */ o(h, {
359
+ direction: "row",
360
+ justifyContent: "space-between",
361
+ sx: { fontWeight: 400 },
362
+ children: [/* @__PURE__ */ e(d, {
363
+ sx: { marginRight: 10 },
364
+ variant: "body1",
365
+ children: a.accountName
366
+ }), /* @__PURE__ */ e(x, {
367
+ amount: a.balance,
368
+ sx: { flexShrink: 0 },
369
+ variant: "body2"
370
+ })]
371
+ }),
372
+ sx: {
373
+ pl: 72,
374
+ pr: 16
375
+ }
376
+ })
377
+ }), c < t.length - 1 ? /* @__PURE__ */ e(L, { variant: "inset" }) : /* @__PURE__ */ e(L, {})] }, a.accountName))
378
+ })
398
379
  ] });
399
- }, Ne = _(De), Ee = () => {
400
- const { net_worth: t } = E(), s = H(), { onEvent: i } = $(), {
401
- assetsLiabilities: n,
402
- gainsLosses: a,
403
- hoveredData: o,
404
- netWorthChartData: c,
405
- selectedData: l,
406
- setHoveredIndex: g,
407
- setSelectedIndex: f
408
- } = j(), [W, S] = u.useState(!1), [w, y] = u.useState(!1), k = (p) => {
409
- const C = p.x === o?.x, I = p.x === l?.x, T = {
380
+ }, X = ({ groupedAccounts: t }) => /* @__PURE__ */ e(N, { children: t.map(({ accounts: s, icon: i, name: n }) => /* @__PURE__ */ e(Le, {
381
+ accounts: s,
382
+ icon: i,
383
+ name: n
384
+ }, n)) }), De = ({ netWorth: t, assets: s, liabilities: i, totalAssets: n, totalLiabilities: r }) => {
385
+ const { net_worth: a } = E(), c = H();
386
+ return /* @__PURE__ */ o(N, { children: [/* @__PURE__ */ o(te, {
387
+ sx: {
388
+ alignItems: "center",
389
+ display: "flex",
390
+ flexDirection: "column",
391
+ justifyContent: "space-between",
392
+ paddingTop: 24,
393
+ marginBottom: 8
394
+ },
395
+ children: [
396
+ /* @__PURE__ */ e(d, {
397
+ variant: "body1",
398
+ children: a.current_net_worth
399
+ }),
400
+ /* @__PURE__ */ e(x, {
401
+ amount: t?.y ?? 0,
402
+ variant: "h1"
403
+ }),
404
+ t && /* @__PURE__ */ e($, {
405
+ currencyLabel: a.this_month,
406
+ iconSize: 20,
407
+ netWorth: t,
408
+ theme: c
409
+ })
410
+ ]
411
+ }), /* @__PURE__ */ o(G, { children: [
412
+ /* @__PURE__ */ e(O, {
413
+ sx: {
414
+ mb: 8,
415
+ mt: 12,
416
+ mx: 8
417
+ },
418
+ children: /* @__PURE__ */ e(v, { primary: /* @__PURE__ */ o(h, {
419
+ direction: "row",
420
+ justifyContent: "space-between",
421
+ children: [/* @__PURE__ */ e(d, {
422
+ sx: { fontWeight: 700 },
423
+ variant: "caption",
424
+ children: a.assets
425
+ }), /* @__PURE__ */ e(x, {
426
+ amount: n,
427
+ sx: { fontWeight: 400 },
428
+ variant: "caption"
429
+ })]
430
+ }) })
431
+ }),
432
+ /* @__PURE__ */ e(X, { groupedAccounts: K(s) }),
433
+ /* @__PURE__ */ e(O, {
434
+ sx: {
435
+ mb: 8,
436
+ mt: 12,
437
+ mx: 8
438
+ },
439
+ children: /* @__PURE__ */ e(v, { primary: /* @__PURE__ */ o(h, {
440
+ direction: "row",
441
+ justifyContent: "space-between",
442
+ children: [/* @__PURE__ */ e(d, {
443
+ sx: { fontWeight: 700 },
444
+ variant: "caption",
445
+ children: a.liabilities
446
+ }), /* @__PURE__ */ e(x, {
447
+ amount: r,
448
+ sx: { fontWeight: 400 },
449
+ variant: "caption"
450
+ })]
451
+ }) })
452
+ }),
453
+ /* @__PURE__ */ e(X, { groupedAccounts: K(i) })
454
+ ] })] });
455
+ }, Ne = C(De), Ee = () => {
456
+ const { net_worth: t } = E(), s = H(), { onEvent: i } = B(), { assetsLiabilities: n, gainsLosses: r, hoveredData: a, netWorthChartData: c, selectedData: l, setHoveredIndex: g, setSelectedIndex: f } = j(), [S, W] = p.useState(!1), [b, y] = p.useState(!1), k = (u) => {
457
+ const _ = u.x === a?.x, T = u.x === l?.x, I = {
410
458
  backgroundColor: "inherit",
411
459
  borderBottom: "inherit",
412
460
  color: "inherit"
413
461
  };
414
- return C && (T.color = I ? "inherit" : T.color, T.backgroundColor = s.palette.action.hover), I && (T.backgroundColor = s.palette.primary.main, T.borderBottom = s.palette.neutral.light, T.color = s.palette.common.white), T;
415
- }, D = (p, C) => {
416
- f(C), p.currentTarget instanceof HTMLDivElement && S(!0);
417
- }, h = () => {
418
- y(!0), i(v.NET_WORTH_WIDGET_CLICK_ASSETS_LIABILITIES);
419
- }, M = (p) => {
420
- g(p);
421
- }, G = () => {
462
+ return _ && (I.color = T ? "inherit" : I.color, I.backgroundColor = s.palette.action.hover), T && (I.backgroundColor = s.palette.primary.main, I.borderBottom = s.palette.neutral.light, I.color = s.palette.common.white), I;
463
+ }, D = (u, _) => {
464
+ f(_), u.currentTarget instanceof HTMLDivElement && W(!0);
465
+ }, m = () => {
466
+ y(!0), i(w.NET_WORTH_WIDGET_CLICK_ASSETS_LIABILITIES);
467
+ }, M = (u) => {
468
+ g(u);
469
+ }, z = () => {
422
470
  g(-1);
423
471
  };
424
- return /* @__PURE__ */ r(m, { direction: "column", sx: { width: 320 }, children: [
425
- /* @__PURE__ */ r(z, { children: [
426
- /* @__PURE__ */ e(A, { sx: { backgroundColor: "transparent", mb: 8, mt: 12, px: 12 }, children: /* @__PURE__ */ e(d, { bold: !0, component: "h2", variant: "body1", children: t.monthly_totals }) }),
427
- /* @__PURE__ */ e(L, {}),
428
- c.map((p, C) => /* @__PURE__ */ e(
429
- We,
430
- {
472
+ return /* @__PURE__ */ o(h, {
473
+ direction: "column",
474
+ sx: { width: 320 },
475
+ children: [
476
+ /* @__PURE__ */ o(G, { children: [
477
+ /* @__PURE__ */ e(O, {
478
+ sx: {
479
+ backgroundColor: "transparent",
480
+ mb: 8,
481
+ mt: 12,
482
+ px: 12
483
+ },
484
+ children: /* @__PURE__ */ e(d, {
485
+ bold: !0,
486
+ component: "h2",
487
+ variant: "body1",
488
+ children: t.monthly_totals
489
+ })
490
+ }),
491
+ /* @__PURE__ */ e(L, {}),
492
+ c.map((u, _) => /* @__PURE__ */ e(Se, {
431
493
  getStyles: k,
432
- isHovered: p.x === o?.x,
433
- isSelected: p.x === l?.x,
434
- item: p,
435
- onItemClick: (I) => D(I, C),
436
- onMouseEnter: () => M(C),
437
- onMouseLeave: () => G()
494
+ isHovered: u.x === a?.x,
495
+ isSelected: u.x === l?.x,
496
+ item: u,
497
+ onItemClick: (T) => D(T, _),
498
+ onMouseEnter: () => M(_),
499
+ onMouseLeave: () => z()
500
+ }, u.x))
501
+ ] }),
502
+ /* @__PURE__ */ e(me, {
503
+ onClick: () => m(),
504
+ sx: {
505
+ alignSelf: "center",
506
+ marginTop: 16,
507
+ width: "fit-content"
438
508
  },
439
- p.x
440
- ))
441
- ] }),
442
- /* @__PURE__ */ e(
443
- ue,
444
- {
445
- onClick: () => h(),
446
- sx: { alignSelf: "center", marginTop: 16, width: "fit-content" },
447
509
  variant: "outlined",
448
510
  children: t.view_assets_and_liabilities
449
- }
450
- ),
451
- /* @__PURE__ */ e(
452
- V,
453
- {
511
+ }),
512
+ /* @__PURE__ */ e(U, {
454
513
  ariaLabelClose: "Close",
455
- isOpen: W,
456
- onClose: () => S(!1),
514
+ isOpen: S,
515
+ onClose: () => W(!1),
457
516
  shouldShowHeaderBorders: !1,
458
517
  shouldShowHeaderShadow: !0,
459
518
  title: t.gains_and_losses,
460
- children: a && /* @__PURE__ */ e(Te, { ...a })
461
- }
462
- ),
463
- /* @__PURE__ */ e(
464
- V,
465
- {
519
+ children: r && /* @__PURE__ */ e(Ie, { ...r })
520
+ }),
521
+ /* @__PURE__ */ e(U, {
466
522
  ariaLabelClose: "Close",
467
- isOpen: w,
523
+ isOpen: b,
468
524
  onClose: () => y(!1),
469
525
  shouldShowHeaderBorders: !1,
470
526
  shouldShowHeaderShadow: !0,
471
527
  title: t.assets_and_liabilities,
472
528
  children: n && /* @__PURE__ */ e(Ne, { ...n })
473
- }
474
- )
475
- ] });
476
- }, ke = _(Ee), Me = ({ hoveredData: t, selectedData: s }) => {
477
- const { net_worth: i } = E(), n = H(), a = t || s, o = ae(se(a.x), "MMMM");
478
- return /* @__PURE__ */ r(m, { alignItems: "center", direction: "column", m: 24, children: [
479
- /* @__PURE__ */ e(d, { color: n.palette.secondary.main, variant: "body2", children: `${o} ${i.net_worth}` }),
480
- /* @__PURE__ */ e(x, { amount: a.y, variant: "h2" }),
481
- /* @__PURE__ */ e(B, { currencyLabel: i.this_month, netWorth: a, theme: n })
482
- ] });
483
- }, Ae = _(Me), yt = _(({ onBackClick: t, onMenuClick: s }) => {
484
- const { isInitialized: i } = q(), { accounts: n, net_worth: a } = E(), {
485
- hoveredData: o,
486
- isNetWorthDataLoaded: c,
487
- loadNetWorthData: l,
488
- netWorthChartData: g,
489
- selectedData: f,
490
- setTimeframe: W,
491
- timeframe: S
492
- } = j(), { isMobile: w } = ee(), { onEvent: y } = $(), [k, D] = u.useState(!1);
529
+ })
530
+ ]
531
+ });
532
+ }, ke = C(Ee), Me = ({ hoveredData: t, selectedData: s }) => {
533
+ const { net_worth: i } = E(), n = H(), r = t || s, a = fe(xe(r.x), "MMMM");
534
+ return /* @__PURE__ */ o(h, {
535
+ alignItems: "center",
536
+ direction: "column",
537
+ m: 24,
538
+ children: [
539
+ /* @__PURE__ */ e(d, {
540
+ color: n.palette.secondary.main,
541
+ variant: "body2",
542
+ children: `${a} ${i.net_worth}`
543
+ }),
544
+ /* @__PURE__ */ e(x, {
545
+ amount: r.y,
546
+ variant: "h2"
547
+ }),
548
+ /* @__PURE__ */ e($, {
549
+ currencyLabel: i.this_month,
550
+ netWorth: r,
551
+ theme: n
552
+ })
553
+ ]
554
+ });
555
+ }, Ae = C(Me), at = C(({ onBackClick: t, onMenuClick: s }) => {
556
+ const { isInitialized: i } = Z(), { accounts: n, net_worth: r } = E(), { hoveredData: a, isNetWorthDataLoaded: c, loadNetWorthData: l, netWorthChartData: g, selectedData: f, setTimeframe: S, timeframe: W } = j(), { isMobile: b } = q(), { onEvent: y } = B(), [k, D] = p.useState(!1);
493
557
  J({
494
558
  widgetName: "NetWorthWidget",
495
559
  isLoaded: c
496
- }), u.useEffect(() => {
497
- c || l().finally(), y(v.NET_WORTH_VIEW);
498
- }, []), u.useEffect(() => {
499
- y(v.NET_WORTH_WIDGET_CLICK_TIMEFRAME, { time_period: S + "M" });
500
- }, [S]);
501
- const h = async (p) => {
502
- const C = p[0], I = p[1];
503
- C && I && W(ce(I, C));
560
+ }), p.useEffect(() => {
561
+ c || l().finally(), y(w.NET_WORTH_VIEW);
562
+ }, []), p.useEffect(() => {
563
+ y(w.NET_WORTH_WIDGET_CLICK_TIMEFRAME, { time_period: W + "M" });
564
+ }, [W]);
565
+ const m = async (u) => {
566
+ const _ = u[0], T = u[1];
567
+ _ && T && S(pe(T, _));
504
568
  }, M = () => {
505
- D(!0), y(v.ACCOUNTS_CLICK_CONNECT);
569
+ D(!0), y(w.ACCOUNTS_CLICK_CONNECT);
506
570
  };
507
571
  if (!i || !c) return /* @__PURE__ */ e(Q, {});
508
- const G = g.length === 0;
509
- return /* @__PURE__ */ r(
510
- ge,
511
- {
512
- calendarActions: { onRangeChanged: h },
513
- dateRangeVariant: w ? "timeframetabs" : "timeframebuttons",
514
- onAccountsFilterClick: () => y(v.NET_WORTH_WIDGET_CLICK_FILTER),
515
- onBackClick: t,
516
- onMenuClick: s,
517
- title: a.net_worth,
518
- children: [
519
- G ? /* @__PURE__ */ e(P, { sx: { justifyItems: "center" }, children: /* @__PURE__ */ e(
520
- ye,
521
- {
522
- header: a.empty_widget_header,
523
- icon: "elevation",
524
- onClick: M,
525
- primaryButton: a.empty_widget_button,
526
- subText: a.empty_widget_description,
527
- sx: {
528
- width: { sm: 432 },
529
- ".buttons-footer": {
530
- width: 167
531
- }
532
- }
533
- }
534
- ) }) : /* @__PURE__ */ r(N, { children: [
535
- f && /* @__PURE__ */ e(Ae, { hoveredData: o, selectedData: f }),
536
- /* @__PURE__ */ r(
537
- m,
538
- {
539
- alignItems: w ? "center" : "flex-start",
540
- direction: w ? "column" : "row",
541
- spacing: w ? 0 : 48,
542
- children: [
543
- /* @__PURE__ */ e(we, {}),
544
- /* @__PURE__ */ e(ke, {})
545
- ]
546
- }
547
- )
548
- ] }),
549
- /* @__PURE__ */ e(
550
- le,
551
- {
552
- onClose: () => D(!1),
553
- showConnectionsWidget: k,
554
- title: n.manage_connections
555
- }
556
- )
557
- ]
558
- }
559
- );
572
+ const z = g.length === 0;
573
+ return /* @__PURE__ */ o(ae, {
574
+ calendarActions: { onRangeChanged: m },
575
+ dateRangeVariant: b ? "timeframetabs" : "timeframebuttons",
576
+ onAccountsFilterClick: () => y(w.NET_WORTH_WIDGET_CLICK_FILTER),
577
+ onBackClick: t,
578
+ onMenuClick: s,
579
+ title: r.net_worth,
580
+ children: [z ? /* @__PURE__ */ e(te, {
581
+ sx: { justifyItems: "center" },
582
+ children: /* @__PURE__ */ e(ie, {
583
+ header: r.empty_widget_header,
584
+ icon: "elevation",
585
+ onClick: M,
586
+ primaryButton: r.empty_widget_button,
587
+ subText: r.empty_widget_description,
588
+ sx: {
589
+ width: { sm: 432 },
590
+ ".buttons-footer": { width: 167 }
591
+ }
592
+ })
593
+ }) : /* @__PURE__ */ o(N, { children: [f && /* @__PURE__ */ e(Ae, {
594
+ hoveredData: a,
595
+ selectedData: f
596
+ }), /* @__PURE__ */ o(h, {
597
+ alignItems: b ? "center" : "flex-start",
598
+ direction: b ? "column" : "row",
599
+ spacing: b ? 0 : 48,
600
+ children: [/* @__PURE__ */ e(be, {}), /* @__PURE__ */ e(ke, {})]
601
+ })] }), /* @__PURE__ */ e(se, {
602
+ onClose: () => D(!1),
603
+ showConnectionsWidget: k,
604
+ title: n.manage_connections
605
+ })]
606
+ });
560
607
  });
561
608
  export {
562
- gt as NetWorthMicroWidget,
563
- yt as NetWorthWidget
609
+ it as NetWorthMicroWidget,
610
+ at as NetWorthWidget
564
611
  };