@mx-cartographer/experiences 7.11.3 → 7.11.4

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.
@@ -1,30 +1,30 @@
1
1
  import { jsxs as C, jsx as e, Fragment as St } from "react/jsx-runtime";
2
- import g, { useRef as wt, useState as xt, useEffect as vt } from "react";
2
+ import h, { useRef as wt, useState as xt, useEffect as vt } from "react";
3
3
  import { observer as M } from "mobx-react-lite";
4
- import { CategoryIcon as ve, Text as Q, Icon as Ne, H3 as Oe, P as ye, ChevronRightIcon as Dt } from "@mxenabled/mxui";
4
+ import { CategoryIcon as xe, Text as Q, Icon as He, H3 as Oe, P as fe, ChevronRightIcon as Dt } from "@mxenabled/mxui";
5
5
  import W from "@mui/material/Box";
6
6
  import x from "@mui/material/Stack";
7
- import Se from "@mui/material/Button";
7
+ import Te from "@mui/material/Button";
8
8
  import { addSeconds as qe } from "date-fns/addSeconds";
9
- import { differenceInCalendarMonths as we } from "date-fns/differenceInCalendarMonths";
9
+ import { differenceInCalendarMonths as Se } from "date-fns/differenceInCalendarMonths";
10
10
  import It from "numeral";
11
- import { useTheme as de, styled as Lt } from "@mui/material/styles";
11
+ import { useTheme as ce, styled as Lt } from "@mui/material/styles";
12
12
  import { useItemTooltip as Et, ChartsTooltipContainer as Mt } from "@mui/x-charts/ChartsTooltip";
13
13
  import { LineChart as At } from "@mui/x-charts/LineChart";
14
14
  import { u as q } from "../useScreenSize-B6JyS_Lj.mjs";
15
15
  import { u as Rt } from "../useDimensions-CeDR9V8N.mjs";
16
16
  import Je from "@mui/material/Card";
17
17
  import et from "@mui/material/CardContent";
18
- import He from "@mui/material/Divider";
18
+ import Ne from "@mui/material/Divider";
19
19
  import Ve from "@mui/material/Grid";
20
- import { u as A, m as J, g as $, b as Ce, h as De, d as Ie, B as _e, p as tt, f as Ge, a as ot } from "../hooks-0kWPTHNb.mjs";
20
+ import { u as A, m as J, g as $, b as ye, h as ve, d as De, B as Ce, p as tt, f as Ge, a as ot } from "../hooks-0kWPTHNb.mjs";
21
21
  import { b as nt } from "../Localization-2MODESHW.mjs";
22
- import { C as xe } from "../CurrencyText-C-85TnUF.mjs";
22
+ import { C as we } from "../CurrencyText-C-85TnUF.mjs";
23
23
  import { C as Re, b as Fe, c as kt } from "../Category-CevNQ03n.mjs";
24
24
  import { f as Z, D as B } from "../DateFormats-Cs-NbEZ7.mjs";
25
- import { f as oe, a as Nt } from "../NumberFormatting-DjTD0t3W.mjs";
26
- import { c as Ht, a as $e, g as Wt, L as st } from "../TrendsStore-Ys6BY_Uo.mjs";
27
- import { T as ds } from "../TrendsStore-Ys6BY_Uo.mjs";
25
+ import { f as oe, a as Ht } from "../NumberFormatting-DjTD0t3W.mjs";
26
+ import { c as Nt, a as $e, g as Wt, L as st } from "../TrendsStore-Ys6BY_Uo.mjs";
27
+ import { T as us } from "../TrendsStore-Ys6BY_Uo.mjs";
28
28
  import { c as Ot, i as Gt, d as Bt, e as Pt, b as rt, g as at, f as ze } from "../SpendingData-C3bN-37j.mjs";
29
29
  import Vt from "@mui/material/ToggleButton";
30
30
  import Ft from "@mui/material/ToggleButtonGroup";
@@ -38,8 +38,8 @@ import { A as v } from "../Analytics-i5h6BxR1.mjs";
38
38
  import { T as lt } from "../TransactionList-DrtItQUk.mjs";
39
39
  import { T as ct } from "../TransactionDetails-DGLtjFZF.mjs";
40
40
  import { D as We } from "../Drawer-DV4NTsFg.mjs";
41
- import { u as Le } from "../useWidgetLoadTimer-yzSfT9dS.mjs";
42
- import { L as Ee } from "../Loader-D3rjKx72.mjs";
41
+ import { u as Ie } from "../useWidgetLoadTimer-yzSfT9dS.mjs";
42
+ import { L as Le } from "../Loader-D3rjKx72.mjs";
43
43
  import { W as dt } from "../WidgetContainer-B5jzz8M1.mjs";
44
44
  import { L as Be } from "../LineChart-Dlp9RAJz.mjs";
45
45
  import { M as Xt } from "../MiniWidgetContainer-B4gbUTJ2.mjs";
@@ -55,42 +55,42 @@ import co from "@mui/material/ListItemText";
55
55
  import ut from "@mui/material/styles/useTheme";
56
56
  import { Stack as uo } from "@mui/material";
57
57
  import mo from "@mui/material/Paper";
58
- import { b as go } from "../CategoryUtil-Cufq3fxg.mjs";
59
- import { E as ho } from "../ExportCsvAction-B5Ra5duE.mjs";
58
+ import { b as ho } from "../CategoryUtil-Cufq3fxg.mjs";
59
+ import { E as go } from "../ExportCsvAction-B5Ra5duE.mjs";
60
60
  import { u as po } from "../useInsightsEnabled-bDCTNOJS.mjs";
61
61
  import { E as fo } from "../EmptyState-DHAkGsjk.mjs";
62
62
  import { C as yo } from "../ConnectDrawer-BLwcW0Oe.mjs";
63
- const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
64
- const { categories: n } = A(), { getCategoryName: o } = J(), s = o(t);
63
+ const mt = ({ categoryGuid: t, topLevelCategoryGuid: s }) => {
64
+ const { categories: n } = A(), { getCategoryName: o } = J(), r = o(t);
65
65
  return /* @__PURE__ */ C(x, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
66
66
  /* @__PURE__ */ e(
67
67
  W,
68
68
  {
69
- "aria-label": nt(n.category_icon_label_aria, s),
69
+ "aria-label": nt(n.category_icon_label_aria, r),
70
70
  mb: 4,
71
71
  role: "img",
72
- children: /* @__PURE__ */ e(ve, { categoryGuid: r })
72
+ children: /* @__PURE__ */ e(xe, { categoryGuid: s })
73
73
  }
74
74
  ),
75
- /* @__PURE__ */ e(Q, { variant: "Body", children: s })
75
+ /* @__PURE__ */ e(Q, { variant: "Body", children: r })
76
76
  ] });
77
77
  }, Co = ({
78
- categoryGuids: { guid: t, topLevelGuid: r },
78
+ categoryGuids: { guid: t, topLevelGuid: s },
79
79
  hoveredAreaData: n,
80
80
  cursorPosition: o,
81
- chartContainerRef: s
81
+ chartContainerRef: r
82
82
  }) => {
83
- const l = de(), a = wt(null), [u, d] = xt({ x: o.x, y: o.y });
83
+ const l = ce(), a = wt(null), [u, c] = xt({ x: o.x, y: o.y });
84
84
  if (vt(() => {
85
85
  (() => {
86
- const h = a.current, _ = s.current;
87
- if (!h || !_) return;
88
- const m = h.getBoundingClientRect(), p = _.getBoundingClientRect();
86
+ const g = a.current, _ = r.current;
87
+ if (!g || !_) return;
88
+ const m = g.getBoundingClientRect(), p = _.getBoundingClientRect();
89
89
  let f = o.x, T = o.y;
90
- f + m.width * 2 > p.right ? f = o.x - m.width : f - m.width < p.left && (f = o.x), T + m.height * 2 > p.bottom && (T = o.y - m.height), d({ x: f, y: T });
90
+ f + m.width * 2 > p.right ? f = o.x - m.width : f - m.width < p.left && (f = o.x), T + m.height * 2 > p.bottom && (T = o.y - m.height), c({ x: f, y: T });
91
91
  })();
92
- }, [o, s]), !n) return null;
93
- const i = n.reduce((y, h) => y + h.y, 0);
92
+ }, [o, r]), !n) return null;
93
+ const i = n.reduce((y, g) => y + g.y, 0);
94
94
  return /* @__PURE__ */ e(
95
95
  Je,
96
96
  {
@@ -104,17 +104,17 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
104
104
  },
105
105
  children: /* @__PURE__ */ C(et, { children: [
106
106
  /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
107
- /* @__PURE__ */ e(mt, { categoryGuid: t, topLevelCategoryGuid: r }),
107
+ /* @__PURE__ */ e(mt, { categoryGuid: t, topLevelCategoryGuid: s }),
108
108
  /* @__PURE__ */ e(Q, { variant: "Small", children: `${n.length}-month total` }),
109
- /* @__PURE__ */ e(xe, { amount: i, bold: !0, formatString: "0,0", variant: "body2" })
109
+ /* @__PURE__ */ e(we, { amount: i, bold: !0, formatString: "0,0", variant: "body2" })
110
110
  ] }),
111
- /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
112
- /* @__PURE__ */ e(Ve, { container: !0, children: n.map((y, h) => /* @__PURE__ */ C(g.Fragment, { children: [
113
- h > 0 && h % 3 === 0 && /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
111
+ /* @__PURE__ */ e(Ne, { sx: { my: 16, width: "100%" } }),
112
+ /* @__PURE__ */ e(Ve, { container: !0, children: n.map((y, g) => /* @__PURE__ */ C(h.Fragment, { children: [
113
+ g > 0 && g % 3 === 0 && /* @__PURE__ */ e(Ne, { sx: { my: 16, width: "100%" } }),
114
114
  /* @__PURE__ */ e(Ve, { item: !0, xs: 4, children: /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
115
115
  /* @__PURE__ */ e(Q, { color: l.palette.text.secondary, variant: "XSmall", children: y.x }),
116
116
  /* @__PURE__ */ e(
117
- xe,
117
+ we,
118
118
  {
119
119
  amount: y.y,
120
120
  bold: !0,
@@ -123,16 +123,16 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
123
123
  }
124
124
  )
125
125
  ] }) })
126
- ] }, h)) })
126
+ ] }, g)) })
127
127
  ] })
128
128
  }
129
129
  );
130
130
  }, _o = M(Co), bo = ({
131
131
  sx: t,
132
- categoryGuids: r,
132
+ categoryGuids: s,
133
133
  hoveredLegend: n,
134
134
  legendRef: o,
135
- onHoverLegend: s,
135
+ onHoverLegend: r,
136
136
  onClickLegend: l
137
137
  }) => {
138
138
  const { isMobile: a } = q(), { getCategoryName: u } = J();
@@ -145,14 +145,14 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
145
145
  justifyContent: "start",
146
146
  ref: o,
147
147
  sx: t,
148
- children: r.map(({ guid: d, top_level_guid: i }) => {
149
- const y = n === d, h = Re[d], _ = Re[i], m = h ?? _ ?? Re.default, p = m + "33";
148
+ children: s.map(({ guid: c, top_level_guid: i }) => {
149
+ const y = n === c, g = Re[c], _ = Re[i], m = g ?? _ ?? Re.default, p = m + "33";
150
150
  return /* @__PURE__ */ C(
151
- Se,
151
+ Te,
152
152
  {
153
- onClick: () => l(d),
154
- onMouseEnter: () => s(d),
155
- onMouseLeave: () => s(null),
153
+ onClick: () => l(c),
154
+ onMouseEnter: () => r(c),
155
+ onMouseLeave: () => r(null),
156
156
  sx: {
157
157
  color: "text.primary",
158
158
  fontWeight: "normal",
@@ -177,133 +177,133 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
177
177
  }
178
178
  }
179
179
  ),
180
- /* @__PURE__ */ e(Q, { variant: "Body", children: u(d) })
180
+ /* @__PURE__ */ e(Q, { variant: "Body", children: u(c) })
181
181
  ]
182
182
  },
183
- d
183
+ c
184
184
  );
185
185
  })
186
186
  }
187
187
  );
188
188
  }, To = ({
189
- categoryGuids: { guid: t, topLevelGuid: r },
189
+ categoryGuids: { guid: t, topLevelGuid: s },
190
190
  series: n,
191
191
  xData: o
192
192
  }) => {
193
- const s = Et(), l = de();
194
- if (!s?.identifier) return null;
195
- const { dataIndex: a, seriesId: u } = s.identifier;
193
+ const r = Et(), l = ce();
194
+ if (!r?.identifier) return null;
195
+ const { dataIndex: a, seriesId: u } = r.identifier;
196
196
  if (a == null || !u) return null;
197
- const i = n.find((h) => h.id === u)?.data?.[a], y = o?.[a];
197
+ const i = n.find((g) => g.id === u)?.data?.[a], y = o?.[a];
198
198
  return i === void 0 || !y ? null : /* @__PURE__ */ e(Je, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(et, { children: /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
199
- /* @__PURE__ */ e(mt, { categoryGuid: t, topLevelCategoryGuid: r }),
199
+ /* @__PURE__ */ e(mt, { categoryGuid: t, topLevelCategoryGuid: s }),
200
200
  /* @__PURE__ */ e(Q, { color: l.palette.text.secondary, variant: "Small", children: Z(y, B.MONTH_SHORT_YEAR) }),
201
- /* @__PURE__ */ e(xe, { amount: String(i), bold: !0, formatString: "0,0", variant: "Body" })
201
+ /* @__PURE__ */ e(we, { amount: String(i), bold: !0, formatString: "0,0", variant: "Body" })
202
202
  ] }) }) });
203
203
  }, So = ({
204
204
  onHoverArea: t,
205
- onHoverPoint: r,
205
+ onHoverPoint: s,
206
206
  onHoverLegend: n,
207
207
  onClickLegend: o,
208
- stackedDatasets: s,
208
+ stackedDatasets: r,
209
209
  unstackedDatasets: l = [],
210
210
  availableHeight: a = 0,
211
211
  minimumHeight: u = 350
212
212
  }) => {
213
- const d = de(), { isMobile: i } = q(), [y, { height: h }] = Rt(), _ = g.useRef(null), [m, p] = g.useState(0);
214
- g.useEffect(() => {
215
- const c = Math.max(a - h, u);
216
- p(c);
217
- }, [a, h]);
218
- const [f, T] = g.useState(null), [S, R] = g.useState({
213
+ const c = ce(), { isMobile: i } = q(), [y, { height: g }] = Rt(), _ = h.useRef(null), [m, p] = h.useState(0);
214
+ h.useEffect(() => {
215
+ const d = Math.max(a - g, u);
216
+ p(d);
217
+ }, [a, g]);
218
+ const [f, T] = h.useState(null), [S, R] = h.useState({
219
219
  hoveredSeriesId: null,
220
220
  hoveredAreaData: null,
221
221
  isAreaHovered: !1,
222
222
  cursorPos: { x: 0, y: 0 }
223
- }), { hoveredSeriesId: E, hoveredAreaData: w, isAreaHovered: k, cursorPos: N } = S, z = k && E && w, P = !z, K = [...s, ...l], L = K[0]?.dataset.length ?? 0, te = K.flatMap((c) => c.dataset.map((b) => b.x)), O = K.flatMap((c) => c.dataset.map((b) => b.y)), ne = s[0]?.dataset?.map(
224
- (c, b) => s.reduce((I, U) => I + U.dataset[b]?.y || 0, 0)
223
+ }), { hoveredSeriesId: L, hoveredAreaData: w, isAreaHovered: k, cursorPos: H } = S, z = k && L && w, P = !z, K = [...r, ...l], E = K[0]?.dataset.length ?? 0, te = K.flatMap((d) => d.dataset.map((b) => b.x)), O = K.flatMap((d) => d.dataset.map((b) => b.y)), ne = r[0]?.dataset?.map(
224
+ (d, b) => r.reduce((I, U) => I + U.dataset[b]?.y || 0, 0)
225
225
  ) ?? [0], se = Math.max(...ne), X = Math.max(
226
- ...l.flatMap((c) => c.dataset.map((b) => b.y))
227
- ), ue = Math.floor(Math.min(...O) / 100) * 100, me = Math.ceil(Math.max(se, X) / 100) * 100, V = s.map((c, b) => ({
226
+ ...l.flatMap((d) => d.dataset.map((b) => b.y))
227
+ ), de = Math.floor(Math.min(...O) / 100) * 100, ue = Math.ceil(Math.max(se, X) / 100) * 100, V = r.map((d, b) => ({
228
228
  id: `stacked-${b}`,
229
- guid: c.category_guid,
230
- top_level_guid: c.top_level_category_guid,
229
+ guid: d.category_guid,
230
+ top_level_guid: d.top_level_category_guid,
231
231
  area: !0,
232
- color: s[b].category_color ?? d.palette.primary.main,
233
- data: c.dataset.map((I) => I.y),
234
- label: s[b].category_name,
232
+ color: r[b].category_color ?? c.palette.primary.main,
233
+ data: d.dataset.map((I) => I.y),
234
+ label: r[b].category_name,
235
235
  stack: "total",
236
236
  type: "line",
237
237
  highlightScope: { highlight: "item" },
238
238
  valueFormatter: (I) => oe(I, "0,0")
239
- })), re = l.map((c, b) => ({
239
+ })), re = l.map((d, b) => ({
240
240
  id: `unstacked-${b}`,
241
- guid: c.category_guid,
242
- top_level_guid: c.top_level_category_guid,
241
+ guid: d.category_guid,
242
+ top_level_guid: d.top_level_category_guid,
243
243
  area: !1,
244
- color: c.category_color,
245
- data: c.dataset.map((I) => I.y),
246
- label: c.category_name,
244
+ color: d.category_color,
245
+ data: d.dataset.map((I) => I.y),
246
+ label: d.category_name,
247
247
  type: "line",
248
248
  valueFormatter: (I) => oe(I, "0,0")
249
- })), Y = [...V, ...re], ge = [
250
- ...V.map(({ guid: c, top_level_guid: b }) => ({
251
- guid: c,
249
+ })), Y = [...V, ...re], me = [
250
+ ...V.map(({ guid: d, top_level_guid: b }) => ({
251
+ guid: d,
252
252
  top_level_guid: b
253
253
  })),
254
- ...re.map(({ guid: c, top_level_guid: b }) => ({
255
- guid: c,
254
+ ...re.map(({ guid: d, top_level_guid: b }) => ({
255
+ guid: d,
256
256
  top_level_guid: b
257
257
  }))
258
- ], j = (c) => {
259
- const I = c.startsWith("stacked-") ? s[parseInt(c.split("-")[1])] : l[parseInt(c.split("-")[1])];
258
+ ], j = (d) => {
259
+ const I = d.startsWith("stacked-") ? r[parseInt(d.split("-")[1])] : l[parseInt(d.split("-")[1])];
260
260
  return {
261
261
  guid: I?.category_guid,
262
262
  topLevelGuid: I?.top_level_category_guid
263
263
  };
264
- }, ae = (c) => {
265
- T(c), n?.(c ?? "");
266
- }, he = (c) => {
267
- o?.(c ?? "");
264
+ }, ae = (d) => {
265
+ T(d), n?.(d ?? "");
266
+ }, he = (d) => {
267
+ o?.(d ?? "");
268
268
  }, ie = () => {
269
- const c = j(String(E)).guid;
270
- c && o?.(c);
271
- }, le = (c) => {
272
- const b = String(c?.seriesId), I = j(b).guid, U = Y.find((pe) => pe.id === b), ce = U && c?.dataIndex !== void 0, be = U && c?.dataIndex === void 0;
273
- if (ce)
269
+ const d = j(String(L)).guid;
270
+ d && o?.(d);
271
+ }, le = (d) => {
272
+ const b = String(d?.seriesId), I = j(b).guid, U = Y.find((ge) => ge.id === b), Ee = U && d?.dataIndex !== void 0, _e = U && d?.dataIndex === void 0;
273
+ if (Ee)
274
274
  R({
275
275
  hoveredSeriesId: b,
276
276
  hoveredAreaData: null,
277
277
  isAreaHovered: !1,
278
- cursorPos: N
279
- }), r?.(I);
280
- else if (be) {
281
- const pe = U?.data.map((Me, Ae) => ({
278
+ cursorPos: H
279
+ }), s?.(I);
280
+ else if (_e) {
281
+ const ge = U?.data.map((Me, Ae) => ({
282
282
  x: te[Ae],
283
283
  y: Me
284
284
  })) ?? [];
285
285
  R({
286
286
  hoveredSeriesId: b,
287
- hoveredAreaData: pe,
287
+ hoveredAreaData: ge,
288
288
  isAreaHovered: !0,
289
- cursorPos: N
289
+ cursorPos: H
290
290
  }), t?.(I);
291
291
  } else
292
292
  R({
293
293
  hoveredSeriesId: null,
294
294
  hoveredAreaData: null,
295
295
  isAreaHovered: !1,
296
- cursorPos: N
296
+ cursorPos: H
297
297
  });
298
- }, D = (c) => {
299
- if (c.target instanceof Element && c.target.classList[0]?.includes("MuiMarkElement-root"))
298
+ }, D = (d) => {
299
+ if (d.target instanceof Element && d.target.classList[0]?.includes("MuiMarkElement-root"))
300
300
  return;
301
- const b = c.currentTarget.getBoundingClientRect();
301
+ const b = d.currentTarget.getBoundingClientRect();
302
302
  R((I) => ({
303
303
  ...I,
304
304
  cursorPos: {
305
- x: c.clientX - b.left,
306
- y: c.clientY - b.top
305
+ x: d.clientX - b.left,
306
+ y: d.clientY - b.top
307
307
  }
308
308
  }));
309
309
  }, F = {
@@ -322,11 +322,11 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
322
322
  '& [class*="MuiLineElement-series-unstacked-"]': {
323
323
  strokeWidth: 3
324
324
  },
325
- ...f && V.reduce((c, b, I) => {
325
+ ...f && V.reduce((d, b, I) => {
326
326
  const U = `.MuiAreaElement-series-stacked-${I}`;
327
- return c[U] = {
327
+ return d[U] = {
328
328
  opacity: V[I].guid === f ? 0.9 : 0.2
329
- }, c;
329
+ }, d;
330
330
  }, {})
331
331
  };
332
332
  return /* @__PURE__ */ e(
@@ -366,11 +366,11 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
366
366
  tooltip: { trigger: P ? "item" : "none" }
367
367
  },
368
368
  slots: {
369
- tooltip: P && E ? (c) => /* @__PURE__ */ e(Mt, { children: /* @__PURE__ */ e(
369
+ tooltip: P && L ? (d) => /* @__PURE__ */ e(Mt, { children: /* @__PURE__ */ e(
370
370
  To,
371
371
  {
372
- ...c,
373
- categoryGuids: j(E),
372
+ ...d,
373
+ categoryGuids: j(L),
374
374
  series: Y,
375
375
  xData: te
376
376
  }
@@ -381,16 +381,16 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
381
381
  {
382
382
  data: te,
383
383
  scaleType: "time",
384
- valueFormatter: (c) => Z(c, B.MONTH_SHORT_YEAR),
385
- tickNumber: L
384
+ valueFormatter: (d) => Z(d, B.MONTH_SHORT_YEAR),
385
+ tickNumber: E
386
386
  // How many ticks to show on the x-axis
387
387
  }
388
388
  ],
389
389
  yAxis: [
390
390
  {
391
- min: ue,
392
- max: me || 100,
393
- valueFormatter: (c) => It(c).format("0a")
391
+ min: de,
392
+ max: ue || 100,
393
+ valueFormatter: (d) => It(d).format("0a")
394
394
  }
395
395
  ]
396
396
  }
@@ -398,7 +398,7 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
398
398
  /* @__PURE__ */ e(
399
399
  bo,
400
400
  {
401
- categoryGuids: ge,
401
+ categoryGuids: me,
402
402
  hoveredLegend: f,
403
403
  legendRef: y,
404
404
  onClickLegend: he,
@@ -409,12 +409,12 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
409
409
  z && /* @__PURE__ */ e(
410
410
  _o,
411
411
  {
412
- categoryGuids: j(E),
412
+ categoryGuids: j(L),
413
413
  chartContainerRef: _,
414
- cursorPosition: N,
415
- hoveredAreaData: w.map((c) => ({
416
- ...c,
417
- x: Z(c.x, B.MONTH_SHORT_YEAR)
414
+ cursorPosition: H,
415
+ hoveredAreaData: w.map((d) => ({
416
+ ...d,
417
+ x: Z(d.x, B.MONTH_SHORT_YEAR)
418
418
  }))
419
419
  }
420
420
  )
@@ -423,14 +423,14 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
423
423
  )
424
424
  }
425
425
  );
426
- }, gt = ({ selectedTab: t, onTabChange: r }) => {
426
+ }, ht = ({ selectedTab: t, onTabChange: s }) => {
427
427
  const { common: n } = A();
428
428
  return /* @__PURE__ */ e(
429
429
  Ft,
430
430
  {
431
431
  "aria-label": n.view_toggle,
432
432
  exclusive: !0,
433
- onChange: r,
433
+ onChange: s,
434
434
  orientation: "horizontal",
435
435
  value: t,
436
436
  children: ["Chart", "Table"].map((o) => /* @__PURE__ */ e(
@@ -441,14 +441,14 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
441
441
  color: "primary",
442
442
  sx: { width: 56 },
443
443
  value: o,
444
- children: o === "Chart" ? /* @__PURE__ */ e(Ne, { name: "table_chart_view" }) : /* @__PURE__ */ e(Ne, { name: "format_list_bulleted" })
444
+ children: o === "Chart" ? /* @__PURE__ */ e(He, { name: "table_chart_view" }) : /* @__PURE__ */ e(He, { name: "format_list_bulleted" })
445
445
  },
446
446
  o
447
447
  ))
448
448
  }
449
449
  );
450
- }, ht = ({ selectedDateRange: t, selectedCategoryGuid: r }) => {
451
- const { trends: n } = A(), { isMobile: o, isDesktop: s } = q(), { getCategoryName: l } = J(), a = g.useMemo(() => {
450
+ }, gt = ({ selectedDateRange: t, selectedCategoryGuid: s }) => {
451
+ const { trends: n } = A(), { isMobile: o, isDesktop: r } = q(), { getCategoryName: l } = J(), a = h.useMemo(() => {
452
452
  const i = t.start.getFullYear() === t.end.getFullYear() ? Z(
453
453
  t.start,
454
454
  o ? B.MONTH_SHORT : B.MONTH_LONG
@@ -460,64 +460,64 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
460
460
  o ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
461
461
  );
462
462
  return `${i} - ${y}`;
463
- }, [t, o]), d = l(r) || (o ? n.sub_title : n.sub_title_by_category);
463
+ }, [t, o]), c = l(s) || (o ? n.sub_title : n.sub_title_by_category);
464
464
  return /* @__PURE__ */ C(W, { children: [
465
465
  /* @__PURE__ */ e(
466
466
  Oe,
467
467
  {
468
468
  sx: {
469
- fontSize: s ? null : 15,
469
+ fontSize: r ? null : 15,
470
470
  whiteSpace: "normal",
471
471
  overflow: "visible",
472
472
  textOverflow: "unset"
473
473
  },
474
- children: d
474
+ children: c
475
475
  }
476
476
  ),
477
- /* @__PURE__ */ e(Q, { variant: s ? "subtitle1" : "body2", children: a })
477
+ /* @__PURE__ */ e(Q, { variant: r ? "subtitle1" : "body2", children: a })
478
478
  ] });
479
479
  }, wo = (t) => {
480
- const r = t.id === "total";
480
+ const s = t.id === "total";
481
481
  return /* @__PURE__ */ C(x, { alignItems: "center", direction: "row", role: "rowheader", tabIndex: t.tabIndex, children: [
482
- !r && /* @__PURE__ */ e(W, { "aria-hidden": !0, children: /* @__PURE__ */ e(ve, { categoryGuid: t.row.top_level_category_guid, variant: "twotone" }) }),
483
- /* @__PURE__ */ e(Q, { bold: r, sx: { ml: 12 }, variant: r ? "body1" : "body2", children: t.row.category })
482
+ !s && /* @__PURE__ */ e(W, { "aria-hidden": !0, children: /* @__PURE__ */ e(xe, { categoryGuid: t.row.top_level_category_guid, variant: "twotone" }) }),
483
+ /* @__PURE__ */ e(Q, { bold: s, sx: { ml: 12 }, variant: s ? "body1" : "body2", children: t.row.category })
484
484
  ] });
485
485
  }, Ke = (t) => {
486
- const r = t.row.category_guid, n = t.row.top_level_category_guid, o = r === Fe.INCOME || n === Fe.INCOME, s = t.id === "total", l = t.field === "total", a = l ? t.row[t.field] : t.row.monthlyAmounts[t.field];
486
+ const s = t.row.category_guid, n = t.row.top_level_category_guid, o = s === Fe.INCOME || n === Fe.INCOME, r = t.id === "total", l = t.field === "total", a = l ? t.row[t.field] : t.row.monthlyAmounts[t.field];
487
487
  return /* @__PURE__ */ e(x, { alignItems: "flex-end", direction: "row", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(
488
- xe,
488
+ we,
489
489
  {
490
490
  amount: o ? Math.abs(a) : a,
491
491
  isIncome: o,
492
- sx: { fontWeight: o || l || s ? 600 : 500 },
492
+ sx: { fontWeight: o || l || r ? 600 : 500 },
493
493
  symbol: o ? "+" : void 0,
494
- variant: s ? "body1" : "body2"
494
+ variant: r ? "body1" : "body2"
495
495
  }
496
496
  ) });
497
- }, Ye = (t, r) => {
498
- const n = Z(it(r.isoDate), B.MONTH_LONG);
499
- return t[n] = r.amount, t;
500
- }, je = (t) => (r, n) => {
497
+ }, Ye = (t, s) => {
498
+ const n = Z(it(s.isoDate), B.MONTH_LONG);
499
+ return t[n] = s.amount, t;
500
+ }, je = (t) => (s, n) => {
501
501
  const o = Z(it(n.isoDate), B.MONTH_LONG);
502
- return r + (t.includes(o) ? n.amount : 0);
503
- }, xo = (t, r) => {
502
+ return s + (t.includes(o) ? n.amount : 0);
503
+ }, xo = (t, s) => {
504
504
  const n = [], o = new Date(t);
505
- for (; o <= r; ) {
506
- const s = Z(o, B.MONTH_LONG);
507
- n.push(s), o.setMonth(o.getMonth() + 1);
505
+ for (; o <= s; ) {
506
+ const r = Z(o, B.MONTH_LONG);
507
+ n.push(r), o.setMonth(o.getMonth() + 1);
508
508
  }
509
509
  return n;
510
- }, vo = (t, r) => {
510
+ }, vo = (t, s) => {
511
511
  const n = {
512
512
  field: "category",
513
513
  flex: 1,
514
514
  headerClassName: "trends-table-header",
515
- headerName: r.category_title,
515
+ headerName: s.category_title,
516
516
  minWidth: 210,
517
517
  renderHeader: ke,
518
518
  renderCell: wo,
519
519
  sortable: !0,
520
- sortComparator: Ht,
520
+ sortComparator: Nt,
521
521
  type: "string"
522
522
  }, o = t.map((l) => ({
523
523
  field: l,
@@ -534,11 +534,11 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
534
534
  type: "number",
535
535
  sortComparator: $e,
536
536
  valueGetter: (a, u) => u.monthlyAmounts?.[l] ?? 0
537
- })), s = {
537
+ })), r = {
538
538
  field: "total",
539
539
  flex: 1,
540
540
  headerClassName: "trends-table-header",
541
- headerName: r.table_column_total,
541
+ headerName: s.table_column_total,
542
542
  minWidth: 100,
543
543
  renderHeader: ke,
544
544
  renderCell: Ke,
@@ -549,11 +549,11 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
549
549
  type: "number",
550
550
  sortComparator: $e
551
551
  };
552
- return [n, ...o, s];
553
- }, Ue = (t, r, n, o, s) => {
552
+ return [n, ...o, r];
553
+ }, Ue = (t, s, n, o, r) => {
554
554
  const l = t.filter((a) => a.is_income === n).map((a) => {
555
555
  let u = a.totalMonthlyAmounts;
556
- return s && (u = a.monthlyAmounts), {
556
+ return r && (u = a.monthlyAmounts), {
557
557
  id: a.guid,
558
558
  category: a.name,
559
559
  category_guid: a.guid,
@@ -563,16 +563,16 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
563
563
  monthlyAmounts: u.reduce(Ye, {})
564
564
  };
565
565
  });
566
- if (s && s.is_income === n) {
567
- const a = s.monthlyAmounts.reduce(je(o), 0);
566
+ if (r && r.is_income === n) {
567
+ const a = r.monthlyAmounts.reduce(je(o), 0);
568
568
  a !== 0 && l.push({
569
- id: `sub-${s.guid}`,
570
- category: nt(r.category_general, s.name),
571
- category_guid: s.guid,
569
+ id: `sub-${r.guid}`,
570
+ category: nt(s.category_general, r.name),
571
+ category_guid: r.guid,
572
572
  isParent: !0,
573
- top_level_category_guid: s.guid,
573
+ top_level_category_guid: r.guid,
574
574
  total: a,
575
- monthlyAmounts: s.monthlyAmounts.reduce(Ye, {})
575
+ monthlyAmounts: r.monthlyAmounts.reduce(Ye, {})
576
576
  });
577
577
  }
578
578
  return l;
@@ -583,20 +583,20 @@ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
583
583
  });
584
584
  function Io({
585
585
  direction: t,
586
- index: r,
586
+ index: s,
587
587
  sortingOrder: n,
588
588
  disabled: o,
589
- className: s,
589
+ className: r,
590
590
  field: l
591
591
  }) {
592
592
  const a = zt(), u = Kt();
593
- let d = null;
593
+ let c = null;
594
594
  const i = {};
595
- if (t === "asc" ? d = u.slots.columnSortedAscendingIcon : t === "desc" ? d = u.slots.columnSortedDescendingIcon : (d = u.slots.columnUnsortedIcon ?? null, i.sortingOrder = n), !d) return null;
596
- const h = a.current.getColumn(l)?.headerName ?? l;
595
+ if (t === "asc" ? c = u.slots.columnSortedAscendingIcon : t === "desc" ? c = u.slots.columnSortedDescendingIcon : (c = u.slots.columnUnsortedIcon ?? null, i.sortingOrder = n), !c) return null;
596
+ const g = a.current.getColumn(l)?.headerName ?? l;
597
597
  let _ = "";
598
598
  t === "asc" ? _ = ", sorted ascending" : t === "desc" && (_ = ", sorted descending");
599
- const m = ["Total", "Category"].includes(h) ? "" : " category totals", p = `Sort by ${h}${m}${_}`, f = /* @__PURE__ */ e(d, { className: "MuiDataGrid-sortIcon", fontSize: "small", ...i }), T = /* @__PURE__ */ e(
599
+ const m = ["Total", "Category"].includes(g) ? "" : " category totals", p = `Sort by ${g}${m}${_}`, f = /* @__PURE__ */ e(c, { className: "MuiDataGrid-sortIcon", fontSize: "small", ...i }), T = /* @__PURE__ */ e(
600
600
  Ut,
601
601
  {
602
602
  disabled: o,
@@ -604,21 +604,21 @@ function Io({
604
604
  tabIndex: -1,
605
605
  ...u.slotProps?.baseIconButton,
606
606
  "aria-label": p,
607
- className: `MuiDataGrid-sortButton${s ? ` ${s}` : ""}`,
607
+ className: `MuiDataGrid-sortButton${r ? ` ${r}` : ""}`,
608
608
  title: p,
609
609
  children: f
610
610
  }
611
611
  );
612
- return /* @__PURE__ */ e(Do, { className: "MuiDataGrid-iconButtonContainer", children: r != null ? /* @__PURE__ */ e(jt, { badgeContent: r, color: "default", overlap: "circular", children: T }) : T });
612
+ return /* @__PURE__ */ e(Do, { className: "MuiDataGrid-iconButtonContainer", children: s != null ? /* @__PURE__ */ e(jt, { badgeContent: s, color: "default", overlap: "circular", children: T }) : T });
613
613
  }
614
- const Lo = g.memo(Io), Xe = ({
614
+ const Lo = h.memo(Io), Xe = ({
615
615
  columns: t,
616
- onRowClick: r,
616
+ onRowClick: s,
617
617
  parentCategory: n,
618
618
  rows: o,
619
- totalRow: s
619
+ totalRow: r
620
620
  }) => {
621
- const l = de(), { onEvent: a } = $(), u = l.palette.mode === "light";
621
+ const l = ce(), { onEvent: a } = $(), u = l.palette.mode === "light";
622
622
  return /* @__PURE__ */ e(
623
623
  Yt,
624
624
  {
@@ -627,14 +627,14 @@ const Lo = g.memo(Io), Xe = ({
627
627
  disableColumnMenu: !0,
628
628
  hideFooter: !0,
629
629
  initialState: { sorting: { sortModel: [{ field: "category", sort: "asc" }] } },
630
- onRowClick: (d) => {
631
- n || r?.(d.row.category_guid), a(v.TRENDS_CLICK_LIST_ITEM, {
630
+ onRowClick: (c) => {
631
+ n || s?.(c.row.category_guid), a(v.TRENDS_CLICK_LIST_ITEM, {
632
632
  ...G,
633
- listItem: kt[d.row.category_guid]
633
+ listItem: kt[c.row.category_guid]
634
634
  });
635
635
  },
636
636
  pinnedRows: {
637
- bottom: s ? [s] : []
637
+ bottom: r ? [r] : []
638
638
  },
639
639
  rowHeight: 64,
640
640
  rows: o,
@@ -658,15 +658,15 @@ const Lo = g.memo(Io), Xe = ({
658
658
  );
659
659
  }, pt = ({
660
660
  selectedDateRange: t,
661
- selectedCategory: r,
661
+ selectedCategory: s,
662
662
  onClickRow: n,
663
663
  height: o = "100%",
664
- sx: s = {}
664
+ sx: r = {}
665
665
  }) => {
666
- const { trends: l } = A(), { trendsCategories: a } = J(), u = g.useMemo(() => xo(t.start, t.end), [t]), d = g.useMemo(() => vo(u, l), [u, l]), i = g.useMemo(() => {
667
- if (r)
668
- return a.find((m) => m.guid === r);
669
- }, [r, a]), [y, h] = g.useMemo(() => {
666
+ const { trends: l } = A(), { trendsCategories: a } = J(), u = h.useMemo(() => xo(t.start, t.end), [t]), c = h.useMemo(() => vo(u, l), [u, l]), i = h.useMemo(() => {
667
+ if (s)
668
+ return a.find((m) => m.guid === s);
669
+ }, [s, a]), [y, g] = h.useMemo(() => {
670
670
  let m = a;
671
671
  return i && (m = i.subCategories.filter(
672
672
  (p) => p.monthlyAmounts.some((f) => f.amount !== 0)
@@ -680,8 +680,8 @@ const Lo = g.memo(Io), Xe = ({
680
680
  category_guid: "total",
681
681
  isParent: !1,
682
682
  top_level_category_guid: "total",
683
- total: h.reduce((m, p) => m + p.total, 0),
684
- monthlyAmounts: h.reduce(
683
+ total: g.reduce((m, p) => m + p.total, 0),
684
+ monthlyAmounts: g.reduce(
685
685
  (m, p) => (Object.entries(p.monthlyAmounts).forEach(([f, T]) => {
686
686
  m[f] = (m[f] || 0) + T;
687
687
  }), m),
@@ -692,12 +692,12 @@ const Lo = g.memo(Io), Xe = ({
692
692
  x,
693
693
  {
694
694
  gap: 24,
695
- sx: { height: o, width: "100%", overflowX: "auto", boxShadow: "none", ...s },
695
+ sx: { height: o, width: "100%", overflowX: "auto", boxShadow: "none", ...r },
696
696
  children: [
697
697
  (!i || i && i.is_income) && /* @__PURE__ */ e(
698
698
  Xe,
699
699
  {
700
- columns: d,
700
+ columns: c,
701
701
  onRowClick: n,
702
702
  parentCategory: i,
703
703
  rows: y
@@ -706,10 +706,10 @@ const Lo = g.memo(Io), Xe = ({
706
706
  (!i || i && !i.is_income) && /* @__PURE__ */ e(
707
707
  Xe,
708
708
  {
709
- columns: d,
709
+ columns: c,
710
710
  onRowClick: n,
711
711
  parentCategory: i,
712
- rows: h,
712
+ rows: g,
713
713
  totalRow: _
714
714
  }
715
715
  )
@@ -720,22 +720,22 @@ const Lo = g.memo(Io), Xe = ({
720
720
  title: "Transaction List"
721
721
  }, Mo = ({
722
722
  categoryGuid: t,
723
- dateRange: r,
723
+ dateRange: s,
724
724
  isOpen: n,
725
725
  onClose: o
726
726
  }) => {
727
- const { onEvent: s } = $(), { selectedAccountGuids: l } = Ce(), { common: a } = A(), { setFilter: u, sortedTransactions: d } = De(), [i, y] = g.useState(""), h = g.useMemo(
728
- () => d.find((m) => m.guid === i),
729
- [i, d]
727
+ const { onEvent: r } = $(), { selectedAccountGuids: l } = ye(), { common: a } = A(), { setFilter: u, sortedTransactions: c } = ve(), [i, y] = h.useState(""), g = h.useMemo(
728
+ () => c.find((m) => m.guid === i),
729
+ [i, c]
730
730
  );
731
- g.useEffect(() => {
731
+ h.useEffect(() => {
732
732
  u({
733
733
  accounts: l,
734
- dateRange: r,
734
+ dateRange: s,
735
735
  custom: (m) => t === "" || t === m.category_guid || t === m.top_level_category_guid,
736
736
  showSplits: !!t
737
737
  });
738
- }, [l, t, r]), g.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
738
+ }, [l, t, s]), h.useEffect(() => r(v.TRENDS_VIEW_TRANSACTIONS), []);
739
739
  const _ = () => {
740
740
  y(""), o();
741
741
  };
@@ -747,33 +747,33 @@ const Lo = g.memo(Io), Xe = ({
747
747
  onClose: _,
748
748
  title: Eo.title,
749
749
  children: [
750
- h && /* @__PURE__ */ e(ct, { transaction: h }),
751
- !h && /* @__PURE__ */ e(lt, { onClick: y })
750
+ g && /* @__PURE__ */ e(ct, { transaction: g }),
751
+ !g && /* @__PURE__ */ e(lt, { onClick: y })
752
752
  ]
753
753
  }
754
754
  );
755
- }, Ao = M(Mo), Ro = ({ onBackClick: t, sx: r }) => {
756
- const { onEvent: n } = $(), { isDesktop: o, isTablet: s, isMobile: l } = q(), { isAccountDataLoaded: a, loadAccountData: u } = Ie(), {
757
- categoriesLoaded: d,
755
+ }, Ao = M(Mo), Ro = ({ onBackClick: t, sx: s }) => {
756
+ const { onEvent: n } = $(), { isDesktop: o, isTablet: r, isMobile: l } = q(), { isAccountDataLoaded: a, loadAccountData: u } = De(), {
757
+ categoriesLoaded: c,
758
758
  loadCategories: i,
759
759
  loadDateRangeCategoryTotals: y,
760
- loadMonthlyCategoryTotals: h,
760
+ loadMonthlyCategoryTotals: g,
761
761
  monthlyCategoryTotals: _,
762
762
  getCategoryName: m
763
763
  } = J(), {
764
764
  isTransactionDataLoaded: p,
765
765
  loadTransactionData: f,
766
766
  sortedTransactions: T
767
- } = De(), { selectedDateRange: S, setSelectedDateRange: R } = _e(), { isInitialized: E, selectedAccounts: w } = Ce(), { trends: k } = A(), [N, z] = g.useState(!1), [P, K] = g.useState(!1), [L, te] = g.useState("Chart"), [O, ne] = g.useState(""), [se, X] = g.useState(window.innerHeight), me = se - (l ? 315 : 345);
768
- Le({
767
+ } = ve(), { selectedDateRange: S, setSelectedDateRange: R } = Ce(), { isInitialized: L, selectedAccounts: w } = ye(), { trends: k } = A(), [H, z] = h.useState(!1), [P, K] = h.useState(!1), [E, te] = h.useState("Chart"), [O, ne] = h.useState(""), [se, X] = h.useState(window.innerHeight), ue = se - (l ? 315 : 345);
768
+ Ie({
769
769
  widgetName: "TrendsFullWidget",
770
- isLoaded: N
771
- }), g.useEffect(() => {
770
+ isLoaded: H
771
+ }), h.useEffect(() => {
772
772
  const D = () => X(window.innerHeight);
773
- return window.addEventListener("resize", D), a || u().finally(), d || i().finally(), p || f().finally(), () => window.removeEventListener("resize", D);
774
- }, []), g.useEffect(() => {
775
- E && y(w, S.start, S.end).then(() => {
776
- h(
773
+ return window.addEventListener("resize", D), a || u().finally(), c || i().finally(), p || f().finally(), () => window.removeEventListener("resize", D);
774
+ }, []), h.useEffect(() => {
775
+ L && y(w, S.start, S.end).then(() => {
776
+ g(
777
777
  w,
778
778
  S.start,
779
779
  S.end
@@ -781,31 +781,31 @@ const Lo = g.memo(Io), Xe = ({
781
781
  }).finally(() => {
782
782
  z(!0), n(v.TRENDS_LOAD_WIDGET, {
783
783
  ...G,
784
- time_period: `${we(S.end, S.start)}M`
784
+ time_period: `${Se(S.end, S.start)}M`
785
785
  });
786
786
  });
787
- }, [E, w, S]);
788
- const V = g.useMemo(() => {
789
- if (!N) return { stackedDatasets: [], unstackedDatasets: [] };
787
+ }, [L, w, S]);
788
+ const V = h.useMemo(() => {
789
+ if (!H) return { stackedDatasets: [], unstackedDatasets: [] };
790
790
  const D = Wt(
791
791
  _,
792
792
  S.start,
793
793
  S.end
794
794
  ), F = O.length ? D.filter(
795
- (c) => c.top_level_category_guid === O || c.category_guid === O
795
+ (d) => d.top_level_category_guid === O || d.category_guid === O
796
796
  ) : Ot(D);
797
797
  return {
798
798
  stackedDatasets: F.filter(Gt),
799
799
  unstackedDatasets: F.filter(Bt)
800
800
  };
801
801
  }, [_, O, S]), re = (D, F) => {
802
- te(F ?? L), n(v.TRENDS_CLICK_TOGGLE_VIEW);
802
+ te(F ?? E), n(v.TRENDS_CLICK_TOGGLE_VIEW);
803
803
  }, Y = (D) => {
804
- const F = qe(D?.[0], 1), c = D?.[1], b = we(c, F);
805
- R({ start: F, end: c }), n(v.TRENDS_CLICK_TIME_WINDOW, {
804
+ const F = qe(D?.[0], 1), d = D?.[1], b = Se(d, F);
805
+ R({ start: F, end: d }), n(v.TRENDS_CLICK_TIME_WINDOW, {
806
806
  time_period: b + "M"
807
807
  });
808
- }, ge = () => {
808
+ }, me = () => {
809
809
  n(v.TRENDS_CLICK_FILTER);
810
810
  }, j = (D) => {
811
811
  ne(D);
@@ -818,15 +818,15 @@ const Lo = g.memo(Io), Xe = ({
818
818
  }, le = (D) => {
819
819
  n(v.TRENDS_HOVER_POINT, { category: D });
820
820
  };
821
- return !E || !N ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ C(
821
+ return !L || !H ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ C(
822
822
  dt,
823
823
  {
824
824
  calendarActions: { onRangeChanged: Y },
825
825
  dateRange: S,
826
826
  dateRangeVariant: "timeframebuttons",
827
- onAccountsFilterClick: ge,
827
+ onAccountsFilterClick: me,
828
828
  onBackClick: t,
829
- sx: r,
829
+ sx: s,
830
830
  title: k.title,
831
831
  children: [
832
832
  /* @__PURE__ */ C(
@@ -834,7 +834,7 @@ const Lo = g.memo(Io), Xe = ({
834
834
  {
835
835
  sx: {
836
836
  // eslint-disable-next-line no-nested-ternary
837
- px: o ? 48 : s ? 24 : 12
837
+ px: o ? 48 : r ? 24 : 12
838
838
  },
839
839
  children: [
840
840
  /* @__PURE__ */ C(
@@ -845,28 +845,28 @@ const Lo = g.memo(Io), Xe = ({
845
845
  sx: { pb: l ? 12 : 24, pt: l ? 24 : 48 },
846
846
  children: [
847
847
  /* @__PURE__ */ e(
848
- ht,
848
+ gt,
849
849
  {
850
850
  selectedCategoryGuid: O,
851
851
  selectedDateRange: S
852
852
  }
853
853
  ),
854
- /* @__PURE__ */ e(gt, { onTabChange: re, selectedTab: L })
854
+ /* @__PURE__ */ e(ht, { onTabChange: re, selectedTab: E })
855
855
  ]
856
856
  }
857
857
  ),
858
858
  /* @__PURE__ */ C(x, { alignItems: "center", flexDirection: "row", width: "100%", children: [
859
- /* @__PURE__ */ e(W, { flexGrow: 1, children: O && /* @__PURE__ */ C(Se, { onClick: () => ne(""), sx: { p: 0, pr: 5 }, children: [
860
- /* @__PURE__ */ e(Ne, { name: "arrow_back" }),
859
+ /* @__PURE__ */ e(W, { flexGrow: 1, children: O && /* @__PURE__ */ C(Te, { onClick: () => ne(""), sx: { p: 0, pr: 5 }, children: [
860
+ /* @__PURE__ */ e(He, { name: "arrow_back" }),
861
861
  k.all_categories
862
862
  ] }) }),
863
- /* @__PURE__ */ e(Se, { onClick: () => K(!0), sx: { px: 5 }, children: `${k.view_transactions} (${T.length})` })
863
+ /* @__PURE__ */ e(Te, { onClick: () => K(!0), sx: { px: 5 }, children: `${k.view_transactions} (${T.length})` })
864
864
  ] }),
865
865
  /* @__PURE__ */ C(W, { children: [
866
- L === "Chart" && /* @__PURE__ */ e(
866
+ E === "Chart" && /* @__PURE__ */ e(
867
867
  So,
868
868
  {
869
- availableHeight: me,
869
+ availableHeight: ue,
870
870
  onClickLegend: ae,
871
871
  onHoverArea: ie,
872
872
  onHoverLegend: he,
@@ -875,7 +875,7 @@ const Lo = g.memo(Io), Xe = ({
875
875
  unstackedDatasets: V.unstackedDatasets
876
876
  }
877
877
  ),
878
- L === "Table" && /* @__PURE__ */ e(
878
+ E === "Table" && /* @__PURE__ */ e(
879
879
  pt,
880
880
  {
881
881
  onClickRow: j,
@@ -899,16 +899,16 @@ const Lo = g.memo(Io), Xe = ({
899
899
  ]
900
900
  }
901
901
  );
902
- }, ss = M(Ro), ko = () => {
903
- const { monthlyCategoryTotals: t } = J(), { trends: r } = A(), n = de(), { availableHeight: o = 300 } = tt(), s = g.useMemo(() => Pt(t), [t]);
902
+ }, rs = M(Ro), ko = () => {
903
+ const { monthlyCategoryTotals: t } = J(), { trends: s } = A(), n = ce(), { availableHeight: o = 300 } = tt(), r = h.useMemo(() => Pt(t), [t]);
904
904
  return /* @__PURE__ */ e(
905
905
  Be,
906
906
  {
907
907
  baseline: "min",
908
908
  colors: [n.palette.primary.main],
909
- datasets: [s],
909
+ datasets: [r],
910
910
  height: o,
911
- labels: [r.spending_label],
911
+ labels: [s.spending_label],
912
912
  showArea: !0,
913
913
  showAverage: !0,
914
914
  showLegend: !0,
@@ -917,39 +917,39 @@ const Lo = g.memo(Io), Xe = ({
917
917
  valueFormatterString: "0,0"
918
918
  }
919
919
  );
920
- }, No = M(ko), Ho = ({ onPrimaryCtaClick: t, sx: r }) => {
921
- const { isAccountDataLoaded: n, loadAccountData: o } = Ie(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: l } = J(), { isInitialized: a } = Ge(), { trends: u } = A(), { selectedAccounts: d } = Ce();
922
- return g.useEffect(() => {
920
+ }, Ho = M(ko), No = ({ onPrimaryCtaClick: t, sx: s }) => {
921
+ const { isAccountDataLoaded: n, loadAccountData: o } = De(), { loadMonthlyCategoryTotals: r, monthlyTotalsLoaded: l } = J(), { isInitialized: a } = Ge(), { trends: u } = A(), { selectedAccounts: c } = ye();
922
+ return h.useEffect(() => {
923
923
  n || o().finally();
924
- }, []), Le({
924
+ }, []), Ie({
925
925
  widgetName: "TrendsMiniWidget",
926
926
  isLoaded: l
927
- }), g.useEffect(() => {
928
- a && n && s(d).finally();
929
- }, [n, a, d]), !n || !a || !l ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
927
+ }), h.useEffect(() => {
928
+ a && n && r(c).finally();
929
+ }, [n, a, c]), !n || !a || !l ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(
930
930
  Xt,
931
931
  {
932
932
  contentStyles: { height: "calc(100% - 72px)", minHeight: 300, ":last-child": { pb: 0 } },
933
933
  onPrimaryCtaClick: t,
934
934
  primaryCtaLabel: u.primary_cta,
935
935
  subTitle: u.sub_title,
936
- sx: { height: "100%", ...r },
936
+ sx: { height: "100%", ...s },
937
937
  title: u.mini_title,
938
- children: /* @__PURE__ */ e(No, {})
938
+ children: /* @__PURE__ */ e(Ho, {})
939
939
  }
940
940
  );
941
- }, rs = M(Ho), Wo = 70, Ze = ({
941
+ }, as = M(No), Wo = 70, Ze = ({
942
942
  title: t,
943
- totalAmount: r,
943
+ totalAmount: s,
944
944
  transactionType: n,
945
945
  percentage: o,
946
- secondaryLabel: s,
946
+ secondaryLabel: r,
947
947
  shouldDisplayPercentage: l
948
948
  }) => {
949
- const { availableWidth: a } = tt(), u = g.useRef(null), d = g.useRef(null), i = Nt(Number(Math.abs(o)), {
949
+ const { availableWidth: a } = tt(), u = h.useRef(null), c = h.useRef(null), i = Ht(Number(Math.abs(o)), {
950
950
  style: "percent",
951
951
  minimumIntegerDigits: 1
952
- }), y = a === 288 && oe(r, "0,0.00").length > 10 ? oe(r, "0,0") : oe(r, "0,0.00"), h = n === "spending" ? o > 0 : o >= 0, _ = n === "spending" ? "error.main" : "success.main", m = n === "spending" ? "success.main" : "text.secondary", p = u?.current, f = d?.current, T = p && f ? p.scrollWidth > f.clientWidth - Wo : !1;
952
+ }), y = a === 288 && oe(s, "0,0.00").length > 10 ? oe(s, "0,0") : oe(s, "0,0.00"), g = n === "spending" ? o > 0 : o >= 0, _ = n === "spending" ? "error.main" : "success.main", m = n === "spending" ? "success.main" : "text.secondary", p = u?.current, f = c?.current, T = p && f ? p.scrollWidth > f.clientWidth - Wo : !1;
953
953
  return /* @__PURE__ */ C(
954
954
  x,
955
955
  {
@@ -972,14 +972,14 @@ const Lo = g.memo(Io), Xe = ({
972
972
  justifyContent: "space-between"
973
973
  },
974
974
  children: [
975
- /* @__PURE__ */ e(ye, { color: "text.secondary", variant: "caption", children: t }),
975
+ /* @__PURE__ */ e(fe, { color: "text.secondary", variant: "caption", children: t }),
976
976
  l && /* @__PURE__ */ C(x, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
977
- h ? /* @__PURE__ */ e(Qt, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(qt, { size: 20, sx: { color: m } }),
977
+ g ? /* @__PURE__ */ e(Qt, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(qt, { size: 20, sx: { color: m } }),
978
978
  /* @__PURE__ */ e(
979
- ye,
979
+ fe,
980
980
  {
981
981
  sx: {
982
- color: h ? _ : m,
982
+ color: g ? _ : m,
983
983
  fontWeight: 600
984
984
  },
985
985
  variant: "body2",
@@ -993,7 +993,7 @@ const Lo = g.memo(Io), Xe = ({
993
993
  /* @__PURE__ */ C(
994
994
  x,
995
995
  {
996
- ref: d,
996
+ ref: c,
997
997
  sx: {
998
998
  alignItems: "center",
999
999
  flexDirection: "row",
@@ -1009,11 +1009,11 @@ const Lo = g.memo(Io), Xe = ({
1009
1009
  }
1010
1010
  ),
1011
1011
  l && a >= 450 && !T && /* @__PURE__ */ e(
1012
- ye,
1012
+ fe,
1013
1013
  {
1014
- color: h ? _ : m,
1014
+ color: g ? _ : m,
1015
1015
  variant: "caption",
1016
- children: s
1016
+ children: r
1017
1017
  }
1018
1018
  )
1019
1019
  ]
@@ -1027,41 +1027,41 @@ const Lo = g.memo(Io), Xe = ({
1027
1027
  return /* @__PURE__ */ C(x, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
1028
1028
  /* @__PURE__ */ e(Jt, { size: 32 }),
1029
1029
  /* @__PURE__ */ C(x, { children: [
1030
- /* @__PURE__ */ e(ye, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
1031
- /* @__PURE__ */ e(ye, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
1030
+ /* @__PURE__ */ e(fe, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
1031
+ /* @__PURE__ */ e(fe, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
1032
1032
  ] })
1033
1033
  ] });
1034
- }), as = M(({ onCtaClick: t }) => {
1035
- const { isAccountDataLoaded: r, loadAccountData: n, visibleAccounts: o } = Ie();
1036
- g.useEffect(() => {
1037
- r || n().finally();
1034
+ }), is = M(({ onCtaClick: t }) => {
1035
+ const { isAccountDataLoaded: s, loadAccountData: n, visibleAccounts: o } = De();
1036
+ h.useEffect(() => {
1037
+ s || n().finally();
1038
1038
  }, []);
1039
- const { onEvent: s } = $(), { monthlyCategoryTotals: l, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: u } = J(), d = {
1039
+ const { onEvent: r } = $(), { monthlyCategoryTotals: l, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: u } = J(), c = {
1040
1040
  start: Zt(/* @__PURE__ */ new Date(), 1),
1041
1041
  end: /* @__PURE__ */ new Date()
1042
- }, { trends: i } = A(), { selectedAccounts: y, isInitialized: h } = Ce();
1043
- Le({
1042
+ }, { trends: i } = A(), { selectedAccounts: y, isInitialized: g } = ye();
1043
+ Ie({
1044
1044
  widgetName: "TrendsMicroWidget",
1045
1045
  isLoaded: u
1046
- }), g.useEffect(() => {
1047
- h && a(y, d.start).then(() => {
1048
- s(v.TRENDS_LOAD_WIDGET, {
1046
+ }), h.useEffect(() => {
1047
+ g && a(y, c.start).then(() => {
1048
+ r(v.TRENDS_LOAD_WIDGET, {
1049
1049
  state: o?.length ? "default" : "zeroState"
1050
1050
  });
1051
1051
  });
1052
- }, [h, y]);
1053
- const { spendingData: _, incomeData: m } = g.useMemo(
1052
+ }, [g, y]);
1053
+ const { spendingData: _, incomeData: m } = h.useMemo(
1054
1054
  () => ({
1055
- spendingData: rt(l, d),
1056
- incomeData: at(l, d)
1055
+ spendingData: rt(l, c),
1056
+ incomeData: at(l, c)
1057
1057
  }),
1058
- [l, d]
1059
- ), [p, f] = _, [T, S] = m, R = ze(f.y, p.y), E = ze(S.y, T.y), w = h && !o?.length, k = () => {
1060
- s(
1058
+ [l, c]
1059
+ ), [p, f] = _, [T, S] = m, R = ze(f.y, p.y), L = ze(S.y, T.y), w = g && !o?.length, k = () => {
1060
+ r(
1061
1061
  w ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
1062
1062
  ), t();
1063
1063
  };
1064
- return !u || !h ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
1064
+ return !u || !g ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(
1065
1065
  no,
1066
1066
  {
1067
1067
  className: "mx-trends-microwidget",
@@ -1092,7 +1092,7 @@ const Lo = g.memo(Io), Xe = ({
1092
1092
  /* @__PURE__ */ e(
1093
1093
  Ze,
1094
1094
  {
1095
- percentage: E,
1095
+ percentage: L,
1096
1096
  secondaryLabel: i.micro_secondary_label,
1097
1097
  shouldDisplayPercentage: S.y !== 0 && T.y !== 0,
1098
1098
  title: i.income_label,
@@ -1106,9 +1106,9 @@ const Lo = g.memo(Io), Xe = ({
1106
1106
  }
1107
1107
  );
1108
1108
  }), Go = M(
1109
- ({ isExpanded: t, onClick: r }) => {
1109
+ ({ isExpanded: t, onClick: s }) => {
1110
1110
  const n = ut();
1111
- return /* @__PURE__ */ e(ao, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(io, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
1111
+ return /* @__PURE__ */ e(ao, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(io, { onClick: s, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
1112
1112
  x,
1113
1113
  {
1114
1114
  sx: { color: n.palette.primary.main, flexDirection: "row", alignItems: "center" },
@@ -1130,43 +1130,43 @@ const Lo = g.memo(Io), Xe = ({
1130
1130
  ), Qe = M(
1131
1131
  ({
1132
1132
  totalAmount: t,
1133
- guid: r,
1133
+ guid: s,
1134
1134
  name: n,
1135
1135
  transactions: o,
1136
- onClick: s,
1136
+ onClick: r,
1137
1137
  isLastItem: l = !1,
1138
1138
  showDivider: a = !0
1139
1139
  }) => {
1140
- const { trends: u } = A(), { onEvent: d } = $(), i = `${o.length} ${o.length === 1 ? u.transaction : u.transactions}`, y = () => {
1141
- s?.(), d(v.TRENDS_CLICK_LIST_ITEM, {
1140
+ const { trends: u } = A(), { onEvent: c } = $(), i = `${o.length} ${o.length === 1 ? u.transaction : u.transactions}`, y = () => {
1141
+ r?.(), c(v.TRENDS_CLICK_LIST_ITEM, {
1142
1142
  ...G,
1143
1143
  listItem: n
1144
1144
  });
1145
1145
  };
1146
- return /* @__PURE__ */ C(g.Fragment, { children: [
1146
+ return /* @__PURE__ */ C(h.Fragment, { children: [
1147
1147
  /* @__PURE__ */ e(
1148
1148
  st,
1149
1149
  {
1150
- leftIcon: r ? /* @__PURE__ */ e(ve, { categoryGuid: r }) : void 0,
1150
+ leftIcon: s ? /* @__PURE__ */ e(xe, { categoryGuid: s }) : void 0,
1151
1151
  onClick: y,
1152
1152
  rightContent: oe(Math.abs(t), "0,0.00"),
1153
- rightIcon: s ? /* @__PURE__ */ e(Dt, {}) : void 0,
1153
+ rightIcon: r ? /* @__PURE__ */ e(Dt, {}) : void 0,
1154
1154
  subtitle: i,
1155
1155
  title: n
1156
1156
  }
1157
1157
  ),
1158
- a && /* @__PURE__ */ e(He, { sx: { ml: l ? 24 : 68 } })
1159
- ] }, r);
1158
+ a && /* @__PURE__ */ e(Ne, { sx: { ml: l ? 24 : 68 } })
1159
+ ] }, s);
1160
1160
  }
1161
1161
  ), Bo = M(
1162
- ({ availableHeight: t = 0, onCategoryClick: r }) => {
1163
- const { collapsedCategories: n, visibleCategories: o, setVisibleListLength: s } = _e(), { isLargeDesktop: l, isDesktop: a } = q(), { trends: u } = A(), { onEvent: d } = $(), [i, y] = g.useState(!1), h = a || l;
1164
- g.useEffect(() => {
1162
+ ({ availableHeight: t = 0, onCategoryClick: s }) => {
1163
+ const { collapsedCategories: n, visibleCategories: o, setVisibleListLength: r } = Ce(), { isLargeDesktop: l, isDesktop: a } = q(), { trends: u } = A(), { onEvent: c } = $(), [i, y] = h.useState(!1), g = a || l;
1164
+ h.useEffect(() => {
1165
1165
  const p = Math.floor(t / 64) - 1, f = o.length + n.length;
1166
- p !== o.length && (s(h ? Math.max(p, 5) : 5), y(p >= f));
1166
+ p !== o.length && (r(g ? Math.max(p, 5) : 5), y(p >= f));
1167
1167
  }, [t]);
1168
1168
  const _ = () => {
1169
- y(!i), d(v.TRENDS_CLICK_VIEW_MORE, {
1169
+ y(!i), c(v.TRENDS_CLICK_VIEW_MORE, {
1170
1170
  ...G
1171
1171
  });
1172
1172
  }, m = o.length + (i ? n.length : 0);
@@ -1177,7 +1177,7 @@ const Lo = g.memo(Io), Xe = ({
1177
1177
  {
1178
1178
  ...p,
1179
1179
  isLastItem: f === m - 1,
1180
- onClick: p.transactions.length > 0 ? () => r(p) : void 0,
1180
+ onClick: p.transactions.length > 0 ? () => s(p) : void 0,
1181
1181
  showDivider: !0
1182
1182
  },
1183
1183
  p.guid
@@ -1194,7 +1194,7 @@ const Lo = g.memo(Io), Xe = ({
1194
1194
  {
1195
1195
  ...p,
1196
1196
  isLastItem: T === m - 1,
1197
- onClick: p.transactions.length > 0 ? () => r(p) : void 0,
1197
+ onClick: p.transactions.length > 0 ? () => s(p) : void 0,
1198
1198
  showDivider: !0
1199
1199
  },
1200
1200
  p.guid
@@ -1205,9 +1205,9 @@ const Lo = g.memo(Io), Xe = ({
1205
1205
  n.length > 0 && /* @__PURE__ */ e(Go, { isExpanded: i, onClick: _ })
1206
1206
  ] }) });
1207
1207
  }
1208
- ), Po = ({ beats: t, onInsightCardClick: r }) => {
1209
- const { onEvent: n } = $(), { isMobile: o, isDesktop: s, isLargeDesktop: l } = q(), { beatStore: a, endpoint: u, sessionToken: d } = Ge(), i = s || l, y = i || o ? 1 : 2, h = () => null, _ = (S) => {
1210
- r?.(S), n(v.TRENDS_CLICK_INSIGHT, G);
1208
+ ), Po = ({ beats: t, onInsightCardClick: s }) => {
1209
+ const { onEvent: n } = $(), { isMobile: o, isDesktop: r, isLargeDesktop: l } = q(), { beatStore: a, endpoint: u, sessionToken: c } = Ge(), i = r || l, y = i || o ? 1 : 2, g = () => null, _ = (S) => {
1210
+ s?.(S), n(v.TRENDS_CLICK_INSIGHT, G);
1211
1211
  }, m = i ? 200 : 170, p = i ? 170 : 124, f = i ? 56 : 0, T = t.length > 0 ? m + f : p;
1212
1212
  return /* @__PURE__ */ e(uo, { sx: { height: T }, children: /* @__PURE__ */ e(
1213
1213
  $t,
@@ -1216,7 +1216,7 @@ const Lo = g.memo(Io), Xe = ({
1216
1216
  beats: t,
1217
1217
  endpoint: u,
1218
1218
  headerSx: { p: 0 },
1219
- logOutUser: h,
1219
+ logOutUser: g,
1220
1220
  onCardClick: _,
1221
1221
  showBorder: !0,
1222
1222
  showCTAColocatedWithText: !1,
@@ -1224,28 +1224,28 @@ const Lo = g.memo(Io), Xe = ({
1224
1224
  showHeader: i,
1225
1225
  showIcon: !0,
1226
1226
  showWithMargin: !1,
1227
- token: d,
1227
+ token: c,
1228
1228
  userHasFullInsightFeedBeats: !1,
1229
1229
  variant: "outlined",
1230
1230
  visibleCardsCount: y
1231
1231
  }
1232
1232
  ) });
1233
- }, Vo = M(Po), Fo = M(({ chartLabel: t, chartColor: r }) => {
1233
+ }, Vo = M(Po), Fo = M(({ chartLabel: t, chartColor: s }) => {
1234
1234
  const { onEvent: n } = $(), {
1235
- categoryDetailsChartData: { monthlyAmounts: o, tooltipLabels: s }
1236
- } = _e();
1235
+ categoryDetailsChartData: { monthlyAmounts: o, tooltipLabels: r }
1236
+ } = Ce();
1237
1237
  return /* @__PURE__ */ e(x, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1238
1238
  Be,
1239
1239
  {
1240
1240
  baseline: "min",
1241
- colors: [r],
1241
+ colors: [s],
1242
1242
  curveType: "bump",
1243
- customTooltipLabels: s,
1243
+ customTooltipLabels: r,
1244
1244
  datasets: [o],
1245
1245
  height: 265,
1246
1246
  labels: [t],
1247
1247
  markStyles: () => ({
1248
- stroke: r
1248
+ stroke: s
1249
1249
  }),
1250
1250
  onItemClick: () => {
1251
1251
  n(v.TRENDS_CLICK_CHART, G);
@@ -1264,19 +1264,19 @@ const Lo = g.memo(Io), Xe = ({
1264
1264
  }
1265
1265
  ) });
1266
1266
  }), $o = M(({ onClose: t }) => {
1267
- const r = ut(), { is_mobile_webview: n } = ot(), { isDesktop: o, isSmallTablet: s, isTablet: l } = q(), { onEvent: a } = $(), { common: u, trends: d } = A(), { selectedCategoryData: i, selectedDateRangeMonthRange: y } = _e(), { sortedTransactions: h } = De(), [_, m] = g.useState(null);
1267
+ const s = ut(), { is_mobile_webview: n } = ot(), { isDesktop: o, isSmallTablet: r, isTablet: l } = q(), { onEvent: a } = $(), { common: u, trends: c } = A(), { selectedCategoryData: i, selectedDateRangeMonthRange: y } = Ce(), { sortedTransactions: g } = ve(), [_, m] = h.useState(null);
1268
1268
  if (!i)
1269
1269
  return null;
1270
- const { guid: p, name: f, is_income: T, totalAmount: S } = i, R = T ? d.category_income : d.category_spending, E = go(p, r), w = T ? d.income_label : d.spending_label, k = ` ${i.transactions.length === 1 ? d.transaction : d.transactions} (${i.transactions.length})`, N = g.useMemo(
1271
- () => h.find((L) => L.guid === _),
1272
- [_, h]
1273
- ), z = h.length > 0 && !n && (o || l && !s), P = (L) => L.category_guid === p || L.top_level_category_guid === p, K = () => {
1270
+ const { guid: p, name: f, is_income: T, totalAmount: S } = i, R = T ? c.category_income : c.category_spending, L = ho(p, s), w = T ? c.income_label : c.spending_label, k = ` ${i.transactions.length === 1 ? c.transaction : c.transactions} (${i.transactions.length})`, H = h.useMemo(
1271
+ () => g.find((E) => E.guid === _),
1272
+ [_, g]
1273
+ ), z = g.length > 0 && !n && (o || l && !r), P = (E) => E.category_guid === p || E.top_level_category_guid === p, K = () => {
1274
1274
  t?.(), a(v.TRENDS_CLICK_BACK, G);
1275
1275
  };
1276
1276
  return /* @__PURE__ */ C(
1277
1277
  We,
1278
1278
  {
1279
- ariaLabelClose: d.close_category_details,
1279
+ ariaLabelClose: c.close_category_details,
1280
1280
  isOpen: !0,
1281
1281
  onClose: K,
1282
1282
  shouldShowHeaderShadow: !0,
@@ -1287,16 +1287,16 @@ const Lo = g.memo(Io), Xe = ({
1287
1287
  /* @__PURE__ */ e(
1288
1288
  st,
1289
1289
  {
1290
- leftIcon: /* @__PURE__ */ e(ve, { categoryGuid: p }),
1290
+ leftIcon: /* @__PURE__ */ e(xe, { categoryGuid: p }),
1291
1291
  rightContent: oe(Math.abs(S), "0,0.00"),
1292
1292
  subtitle: y,
1293
1293
  title: f
1294
1294
  }
1295
1295
  ),
1296
- /* @__PURE__ */ e(Fo, { chartColor: E, chartLabel: w }),
1296
+ /* @__PURE__ */ e(Fo, { chartColor: L, chartLabel: w }),
1297
1297
  /* @__PURE__ */ C(x, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
1298
1298
  /* @__PURE__ */ e(Q, { bold: !0, variant: "body1", children: k }),
1299
- z && /* @__PURE__ */ e(ho, { filter: P })
1299
+ z && /* @__PURE__ */ e(go, { filter: P })
1300
1300
  ] })
1301
1301
  ] }),
1302
1302
  /* @__PURE__ */ e(
@@ -1313,47 +1313,47 @@ const Lo = g.memo(Io), Xe = ({
1313
1313
  We,
1314
1314
  {
1315
1315
  ariaLabelClose: u.close_aria,
1316
- isOpen: !!N,
1316
+ isOpen: !!H,
1317
1317
  onClose: () => m(""),
1318
- title: d.transaction,
1319
- children: N && /* @__PURE__ */ e(ct, { transaction: N })
1318
+ title: c.transaction,
1319
+ children: H && /* @__PURE__ */ e(ct, { transaction: H })
1320
1320
  }
1321
1321
  )
1322
1322
  ]
1323
1323
  }
1324
1324
  );
1325
- }), zo = (t, r) => {
1326
- const n = at(t, r), o = rt(t, r);
1327
- return [n, o].filter((s) => s.length > 0);
1328
- }, Ko = (t, r) => {
1329
- const [n, o] = t, s = n, l = o ?? n, a = [];
1330
- if (s) {
1331
- const u = s.reduce((d, i) => d + i.y, 0);
1332
- a.push({ label: r.income_label, amount: u });
1325
+ }), zo = (t, s) => {
1326
+ const n = at(t, s), o = rt(t, s);
1327
+ return [n, o].filter((r) => r.length > 0);
1328
+ }, Ko = (t, s) => {
1329
+ const [n, o] = t, r = n, l = o ?? n, a = [];
1330
+ if (r) {
1331
+ const u = r.reduce((c, i) => c + i.y, 0);
1332
+ a.push({ label: s.income_label, amount: u });
1333
1333
  }
1334
1334
  if (l) {
1335
- const u = l.reduce((d, i) => d + i.y, 0);
1336
- a.push({ label: r.spending_label, amount: u });
1335
+ const u = l.reduce((c, i) => c + i.y, 0);
1336
+ a.push({ label: s.spending_label, amount: u });
1337
1337
  }
1338
1338
  return a;
1339
1339
  }, Yo = ({
1340
1340
  availableHeight: t = 0,
1341
- minHeight: r = 500,
1341
+ minHeight: s = 500,
1342
1342
  selectedDateRange: n,
1343
1343
  totals: o
1344
1344
  }) => {
1345
- const s = de(), { onEvent: l } = $(), { trends: a } = A(), { isSmallMobile: u, isMobile: d, isSmallTablet: i, isTablet: y } = q(), h = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = zo(o, n), m = Ko(_, a), [p, f] = g.useState(0), T = 458, S = 195, R = 56, E = d || u ? S : i || y ? T : p;
1346
- return g.useEffect(() => {
1347
- const k = Math.max(t - R, r);
1345
+ const r = ce(), { onEvent: l } = $(), { trends: a } = A(), { isSmallMobile: u, isMobile: c, isSmallTablet: i, isTablet: y } = q(), g = [r.palette.chart?.chart1, r.palette.chart?.chart2], _ = zo(o, n), m = Ko(_, a), [p, f] = h.useState(0), T = 458, S = 195, R = 56, L = c || u ? S : i || y ? T : p;
1346
+ return h.useEffect(() => {
1347
+ const k = Math.max(t - R, s);
1348
1348
  f(k);
1349
1349
  }, [t]), /* @__PURE__ */ e(
1350
1350
  Be,
1351
1351
  {
1352
1352
  baseline: "min",
1353
- colors: h,
1353
+ colors: g,
1354
1354
  curveType: "bump",
1355
1355
  datasets: _,
1356
- height: E,
1356
+ height: L,
1357
1357
  labels: m,
1358
1358
  onItemClick: () => {
1359
1359
  l(v.TRENDS_CLICK_CHART, G);
@@ -1403,84 +1403,85 @@ const Lo = g.memo(Io), Xe = ({
1403
1403
  "WeeklyNewMerchantsV2",
1404
1404
  "WeeklyNoSpendDays",
1405
1405
  "WeeklySmallPurchasesSummary"
1406
- ], Xo = ({ onBackClick: t, onInsightCardClick: r, sx: n }) => {
1407
- const { onEvent: o } = $(), { config: s } = ot(), { isDesktop: l, isLargeDesktop: a, isMobile: u } = q(), { isAccountDataLoaded: d, loadAccountData: i, visibleAccounts: y } = Ie(), {
1408
- categoriesLoaded: h,
1406
+ ], Xo = (t, s, n) => ({
1407
+ description: s ? t.empty_state_sub_text : t.empty_state_sub_text_no_aggregation,
1408
+ header: s ? t.zero_state_content_header : t.zero_state_content_header_no_aggregation,
1409
+ onClickHandler: s ? n : void 0,
1410
+ primaryButton: s ? t.empty_state_primary : void 0
1411
+ }), Zo = ({ onBackClick: t, onInsightCardClick: s, sx: n }) => {
1412
+ const { onEvent: o } = $(), { config: r } = ot(), { isDesktop: l, isLargeDesktop: a, isMobile: u } = q(), { isAccountDataLoaded: c, loadAccountData: i, visibleAccounts: y } = De(), {
1413
+ categoriesLoaded: g,
1409
1414
  loadCategories: _,
1410
1415
  loadDateRangeCategoryTotals: m,
1411
1416
  loadMonthlyCategoryTotals: p,
1412
1417
  monthlyCategoryTotals: f,
1413
1418
  monthlyTotalsLoaded: T
1414
- } = J(), { isTransactionDataLoaded: S, loadTransactionData: R, setFilter: E } = De(), { selectedDateRange: w, setSelectedCategoryData: k, setSelectedDateRange: N } = _e(), { isInitialized: z, selectedAccounts: P, selectedAccountGuids: K } = Ce(), { trends: L, connect: te } = A(), { beatStore: O } = Ge(), se = po() && s.show_insights_widget_in_master, X = l || a, [ue, me] = g.useState(!1), [V, re] = g.useState(!1), [Y, ge] = g.useState("Chart"), [j, ae] = g.useState(""), [he, ie] = g.useState(!1), [le, D] = g.useState(window.innerHeight), F = X ? 56 : 0, c = le - 208, b = le - (se ? 550 + F : 266), [I, U] = g.useState(!1), ce = s.show_connections_widget_in_master;
1415
- Le({
1419
+ } = J(), { isTransactionDataLoaded: S, loadTransactionData: R, setFilter: L } = ve(), { selectedDateRange: w, setSelectedCategoryData: k, setSelectedDateRange: H } = Ce(), { isInitialized: z, selectedAccounts: P, selectedAccountGuids: K } = ye(), { trends: E, connect: te } = A(), { beatStore: O } = Ge(), se = po() && r.show_insights_widget_in_master, X = l || a, [de, ue] = h.useState(!1), [V, re] = h.useState(!1), [Y, me] = h.useState("Chart"), [j, ae] = h.useState(""), [he, ie] = h.useState(!1), [le, D] = h.useState(window.innerHeight), F = X ? 56 : 0, d = le - 208, b = le - (se ? 550 + F : 266), [I, U] = h.useState(!1), Ee = r.show_connections_widget_in_master;
1420
+ Ie({
1416
1421
  widgetName: "TrendsWidget",
1417
- isLoaded: ue
1422
+ isLoaded: de
1418
1423
  });
1419
- const be = g.useMemo(() => V ? O.getFilteredBeats({ templates: Uo }) : [], [V]);
1420
- g.useEffect(() => {
1421
- const H = () => D(window.innerHeight);
1422
- return window.addEventListener("resize", H), d || i().finally(), h || _().finally(), S || R().finally(), () => window.removeEventListener("resize", H);
1423
- }, []), g.useEffect(() => {
1424
- z && (O.loadBeats().finally(() => re(!0)), m(P, w.start, w.end).then(() => {
1424
+ const _e = h.useMemo(() => V ? O.getFilteredBeats({ templates: Uo }) : [], [V]);
1425
+ h.useEffect(() => {
1426
+ const N = () => D(window.innerHeight);
1427
+ return window.addEventListener("resize", N), c || i().finally(), g || _().finally(), S || R().finally(), () => window.removeEventListener("resize", N);
1428
+ }, []), h.useEffect(() => {
1429
+ z && c && (O.loadBeats().finally(() => re(!0)), m(P, w.start, w.end).then(() => {
1425
1430
  p(
1426
1431
  P,
1427
1432
  w.start,
1428
1433
  w.end
1429
1434
  );
1430
1435
  }).finally(() => {
1431
- me(!0), o(v.TRENDS_LOAD_WIDGET, {
1436
+ ue(!0), o(v.TRENDS_LOAD_WIDGET, {
1432
1437
  ...G,
1433
- time_period: `${we(w.end, w.start)}M`
1438
+ time_period: `${Se(w.end, w.start)}M`
1434
1439
  });
1435
1440
  }));
1436
- }, [z, P, w]), g.useEffect(() => {
1441
+ }, [z, c, P, w]), h.useEffect(() => {
1437
1442
  if (f.length !== 0) {
1438
- const H = {
1443
+ const N = {
1439
1444
  accounts: K,
1440
1445
  dateRange: { start: w.start, end: w.end }
1441
1446
  };
1442
- E({
1443
- ...H,
1447
+ L({
1448
+ ...N,
1444
1449
  custom: (ee) => !!f.find(
1445
- (fe) => fe.top_level_category_guid === ee.top_level_category_guid || fe.category_guid === ee.category_guid
1450
+ (pe) => pe.top_level_category_guid === ee.top_level_category_guid || pe.category_guid === ee.category_guid
1446
1451
  )
1447
1452
  });
1448
1453
  }
1449
1454
  }, [f]);
1450
- const pe = (H) => {
1451
- k(H), ie(!0);
1455
+ const ge = (N) => {
1456
+ k(N), ie(!0);
1452
1457
  }, Me = () => {
1453
1458
  k(null), ie(!1);
1454
1459
  }, Ae = () => {
1455
1460
  U(!0), o(v.TRENDS_CLICK_CONNECT_ACCOUNTS);
1456
- }, ft = (H, ee) => {
1457
- ge(ee ?? Y), o(v.TRENDS_CLICK_TOGGLE_VIEW, {
1461
+ }, ft = (N, ee) => {
1462
+ me(ee ?? Y), o(v.TRENDS_CLICK_TOGGLE_VIEW, {
1458
1463
  ...G,
1459
1464
  toggleView: ee
1460
1465
  });
1461
- }, yt = (H) => {
1462
- const ee = qe(H?.[0], 1), fe = H?.[1], Tt = we(fe, ee);
1463
- N({ start: ee, end: fe }), o(v.TRENDS_CLICK_TIME_WINDOW, {
1466
+ }, yt = (N) => {
1467
+ const ee = qe(N?.[0], 1), pe = N?.[1], Tt = Se(pe, ee);
1468
+ H({ start: ee, end: pe }), o(v.TRENDS_CLICK_TIME_WINDOW, {
1464
1469
  ...G,
1465
1470
  time_period: Tt + "M"
1466
1471
  });
1467
- }, Ct = (H) => {
1472
+ }, Ct = (N) => {
1468
1473
  o(v.TRENDS_CLICK_FILTER, {
1469
1474
  ...G,
1470
- filterValue: H
1475
+ filterValue: N
1471
1476
  });
1472
- }, _t = (H) => {
1473
- ae(H);
1477
+ }, _t = (N) => {
1478
+ ae(N);
1474
1479
  }, bt = () => {
1475
1480
  ae(""), o(v.TRENDS_CLICK_ALL_CATEGORIES, G);
1476
1481
  };
1477
- if (!z || !ue || !T) return /* @__PURE__ */ e(Ee, {});
1478
- const Pe = y && y.length === 0 || f.length === 0, Te = {
1479
- description: ce ? L.empty_state_sub_text : L.empty_state_sub_text_no_aggregation,
1480
- header: ce ? L.zero_state_content_header : L.zero_state_content_header_no_aggregation,
1481
- onClick: ce ? Ae : void 0,
1482
- primaryButton: ce ? L.empty_state_primary : void 0
1483
- };
1482
+ if (!z || !c || !de || !T)
1483
+ return /* @__PURE__ */ e(Le, {});
1484
+ const Pe = y.length === 0 || f.length === 0, be = Xo(E, Ee, Ae);
1484
1485
  return /* @__PURE__ */ C(
1485
1486
  dt,
1486
1487
  {
@@ -1490,7 +1491,7 @@ const Lo = g.memo(Io), Xe = ({
1490
1491
  onAccountsFilterClick: Ct,
1491
1492
  onBackClick: t,
1492
1493
  sx: n,
1493
- title: L.title,
1494
+ title: E.title,
1494
1495
  children: [
1495
1496
  /* @__PURE__ */ C(
1496
1497
  x,
@@ -1507,29 +1508,29 @@ const Lo = g.memo(Io), Xe = ({
1507
1508
  sx: { px: u ? 16 : 0, py: 16 },
1508
1509
  children: [
1509
1510
  /* @__PURE__ */ e(
1510
- ht,
1511
+ gt,
1511
1512
  {
1512
1513
  selectedCategoryGuid: j,
1513
1514
  selectedDateRange: w
1514
1515
  }
1515
1516
  ),
1516
- /* @__PURE__ */ e(gt, { onTabChange: ft, selectedTab: Y })
1517
+ /* @__PURE__ */ e(ht, { onTabChange: ft, selectedTab: Y })
1517
1518
  ]
1518
1519
  }
1519
1520
  ),
1520
- /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", sx: { pb: 8 }, width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: j && /* @__PURE__ */ C(Se, { onClick: bt, sx: { p: 0, pr: 5 }, children: [
1521
+ /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", sx: { pb: 8 }, width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: j && /* @__PURE__ */ C(Te, { onClick: bt, sx: { p: 0, pr: 5 }, children: [
1521
1522
  /* @__PURE__ */ e(oo, {}),
1522
- L.all_categories
1523
+ E.all_categories
1523
1524
  ] }) }) }),
1524
1525
  Pe && /* @__PURE__ */ e(
1525
1526
  fo,
1526
1527
  {
1527
- header: Te.header,
1528
+ header: be.header,
1528
1529
  icon: "multiline_chart",
1529
- onClick: Te.onClick,
1530
- primaryButton: Te.primaryButton,
1531
- subText: Te.description,
1532
- sx: { height: c, maxWidth: 432 }
1530
+ onClick: be.onClickHandler,
1531
+ primaryButton: be.primaryButton,
1532
+ subText: be.description,
1533
+ sx: { height: d, maxWidth: 432 }
1533
1534
  }
1534
1535
  ),
1535
1536
  !Pe && /* @__PURE__ */ C(x, { flexDirection: X ? "row" : "column", gap: X ? 48 : 16, children: [
@@ -1537,25 +1538,25 @@ const Lo = g.memo(Io), Xe = ({
1537
1538
  /* @__PURE__ */ e(W, { sx: { width: X ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1538
1539
  jo,
1539
1540
  {
1540
- availableHeight: c,
1541
+ availableHeight: d,
1541
1542
  minHeight: 450,
1542
1543
  selectedDateRange: w,
1543
1544
  totals: f
1544
1545
  }
1545
1546
  ) }),
1546
1547
  /* @__PURE__ */ C(x, { gap: 16, sx: { width: X ? "32%" : "100%" }, children: [
1547
- se && V && be.length > 0 && /* @__PURE__ */ e(
1548
+ se && V && _e.length > 0 && /* @__PURE__ */ e(
1548
1549
  Vo,
1549
1550
  {
1550
- beats: be,
1551
- onInsightCardClick: r
1551
+ beats: _e,
1552
+ onInsightCardClick: s
1552
1553
  }
1553
1554
  ),
1554
1555
  /* @__PURE__ */ e(
1555
1556
  Bo,
1556
1557
  {
1557
1558
  availableHeight: b,
1558
- onCategoryClick: pe
1559
+ onCategoryClick: ge
1559
1560
  }
1560
1561
  )
1561
1562
  ] })
@@ -1585,11 +1586,11 @@ const Lo = g.memo(Io), Xe = ({
1585
1586
  ]
1586
1587
  }
1587
1588
  );
1588
- }, is = M(Xo);
1589
+ }, ls = M(Zo);
1589
1590
  export {
1590
- ss as TrendsFullWidget,
1591
- as as TrendsMicroWidget,
1592
- rs as TrendsMiniWidget,
1593
- ds as TrendsStore,
1594
- is as TrendsWidget
1591
+ rs as TrendsFullWidget,
1592
+ is as TrendsMicroWidget,
1593
+ as as TrendsMiniWidget,
1594
+ us as TrendsStore,
1595
+ ls as TrendsWidget
1595
1596
  };