@mx-cartographer/experiences 7.0.11-alpha.al0 → 7.0.11-alpha.mega1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/{Account-D_kRKI6x.mjs → Account-BW3-oYEs.mjs} +1 -1
- package/dist/{AccountDetailsContent-Dfja2v8K.mjs → AccountDetailsContent-Tm7IjJIc.mjs} +16 -16
- package/dist/{AccountDetailsHeader-nc5mqlHm.mjs → AccountDetailsHeader-sum_Bgdy.mjs} +5 -5
- package/dist/{AccountFields-DeebSePp.mjs → AccountFields-CIz-r3gP.mjs} +2 -2
- package/dist/{AccountListItem-dh03tivj.mjs → AccountListItem-B-ZjJ4Gp.mjs} +3 -3
- package/dist/{AccountStore-Cp7xWX8n.mjs → AccountStore-BaMynkQT.mjs} +11 -11
- package/dist/{Accounts-DppzmFak.mjs → Accounts-CA-nqAjT.mjs} +1 -1
- package/dist/{BeatApi-D0WcLW3O.mjs → BeatApi-DLu87ijw.mjs} +3 -3
- package/dist/{BeatStore-y6WVs07e.mjs → BeatStore-By4aGoRM.mjs} +17 -17
- package/dist/{BudgetUtil-DmWvHV7C.mjs → BudgetUtil-CeSLAcsl.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-uTU7Nwn2.mjs → CategorySelectorDrawer-BPvjZ-Xo.mjs} +1 -1
- package/dist/{CategoryStore-BfYppD3g.mjs → CategoryStore-BOyzQjQp.mjs} +4 -4
- package/dist/{ConnectDrawer-BfYwIgKa.mjs → ConnectDrawer-phFH6OHt.mjs} +5 -5
- package/dist/{ConnectionsDrawer-BKG07Loi.mjs → ConnectionsDrawer-ihxkAi1P.mjs} +2 -2
- package/dist/{CurrencyInput-BtrNBP3z.mjs → CurrencyInput-bEx2Mbd0.mjs} +1 -1
- package/dist/{DebtsStore-BR1o55kk.mjs → DebtsStore-Dp-CraCD.mjs} +1 -1
- package/dist/{ExportCsvAction-BH369hls.mjs → ExportCsvAction-CbMfQ2Wa.mjs} +3 -3
- package/dist/{Fetch-CJ9cgjgV.mjs → Fetch-CkFKy79O.mjs} +8 -9
- package/dist/{FinstrongStore-rC2F4Tq3.mjs → FinstrongStore-mkALvztw.mjs} +4 -4
- package/dist/{GoalStore-rZKi2YjE.mjs → GoalStore-BWHkOQ8o.mjs} +21 -21
- package/dist/{Help-t24Ldz-O.mjs → Help-B3oENhkG.mjs} +1 -1
- package/dist/{LineChart-CfEEnHUy.mjs → LineChart-BWWmmJxV.mjs} +204 -183
- package/dist/{ListItemAction-Cwadpg85.mjs → ListItemAction-DNZZ5fSa.mjs} +1 -1
- package/dist/{ManageIncome-xksS_sWM.mjs → ManageIncome-Bef4VWt7.mjs} +4 -4
- package/dist/MerchantStore-DVH-QOf0.mjs +37 -0
- package/dist/{MicroWidgetContainer-DwTAjSdX.mjs → MicroWidgetContainer-Dxz8uBN9.mjs} +1 -1
- package/dist/{MiniWidgetContainer-CxggrnHk.mjs → MiniWidgetContainer-CTyjmE1h.mjs} +1 -1
- package/dist/{NetWorthStore-5qSDIglU.mjs → NetWorthStore-B6xF9eGH.mjs} +2 -2
- package/dist/{NotificationSettings-Cny7J1hO.mjs → NotificationSettings-uXVwpIa1.mjs} +2 -2
- package/dist/{NotificationStore-DpV9hXSE.mjs → NotificationStore-DHtSGySy.mjs} +4 -8
- package/dist/{OriginalBalanceAction-DDMRgIBU.mjs → OriginalBalanceAction-DepsKiJz.mjs} +3 -3
- package/dist/{RecurringSettings-DXQ64A8U.mjs → RecurringSettings-1EOh67IT.mjs} +3 -3
- package/dist/{RecurringTransactionsStore-CXhnipfd.mjs → RecurringTransactionsStore-D62XJtdL.mjs} +16 -20
- package/dist/{SettingsStore-CLLqNa_S.mjs → SettingsStore-B4gi6oOw.mjs} +29 -33
- package/dist/{TransactionApi-C0HMGDBV.mjs → TransactionApi-DbbcjI2L.mjs} +29 -29
- package/dist/TransactionDetails-DYF-P762.mjs +1337 -0
- package/dist/{TransactionStore-Cu_KM_J9.mjs → TransactionStore-0tLtBEIC.mjs} +25 -29
- package/dist/TrendsStore-WrHxzdbQ.mjs +565 -0
- package/dist/{Transaction-CXMMfhz-.mjs → User-Dq9Qj764.mjs} +48 -46
- package/dist/{ViewMoreMicroCard-DJoNOqkD.mjs → ViewMoreMicroCard-BZI5VMNW.mjs} +2 -5
- package/dist/{WidgetContainer-QcfqagZD.mjs → WidgetContainer-C2NBfpDg.mjs} +2 -2
- package/dist/accounts/api/AccountApi.d.ts +2 -2
- package/dist/accounts/index.es.js +17 -17
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/api/BudgetsApi.d.ts +2 -2
- package/dist/budgets/index.es.js +10 -10
- package/dist/cashflow/api/CashflowApi.d.ts +2 -3
- package/dist/cashflow/index.es.js +10 -10
- package/dist/categories/index.es.js +2 -2
- package/dist/common/api/AnalyticsApi.d.ts +2 -2
- package/dist/common/api/AppDataApi.d.ts +2 -2
- package/dist/common/api/BeatApi.d.ts +2 -2
- package/dist/common/api/CategoryApi.d.ts +3 -2
- package/dist/common/api/GlobalCopyApi.d.ts +1 -2
- package/dist/common/api/LocalizedCopyApi.d.ts +1 -2
- package/dist/common/api/NotificationApi.d.ts +2 -2
- package/dist/common/api/ScheduledPaymentsApi.d.ts +2 -3
- package/dist/common/api/UserApi.d.ts +2 -2
- package/dist/common/context/GlobalDataProvider.d.ts +2 -3
- package/dist/common/context/hooks.d.ts +1 -4
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +315 -321
- package/dist/common/stores/GlobalStore.d.ts +1 -2
- package/dist/common/types/index.d.ts +0 -1
- package/dist/common/utils/Fetch.d.ts +1 -3
- package/dist/dashboard/index.es.js +7 -7
- package/dist/debts/index.es.js +197 -180
- package/dist/{exportTransactionsToCSV-DpP_a1g8.mjs → exportTransactionsToCSV-BDlt8u0n.mjs} +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +1 -2
- package/dist/finstrong/index.es.js +7 -7
- package/dist/goals/api/GoalApi.d.ts +2 -3
- package/dist/goals/index.es.js +11 -11
- package/dist/help/api/HelpApi.d.ts +2 -2
- package/dist/help/index.es.js +3 -3
- package/dist/hooks-DkUqN6JE.mjs +71 -0
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/api/HoldingApi.d.ts +2 -3
- package/dist/investments/index.es.js +3 -3
- package/dist/merchants/api/MerchantApi.d.ts +1 -2
- package/dist/merchants/index.es.js +2 -2
- package/dist/microinsights/context/InsightsMicroWidgetDataProvider.d.ts +1 -2
- package/dist/microinsights/context/hooks.d.ts +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +7 -7
- package/dist/notifications/index.es.js +5 -5
- package/dist/recurringtransactions/api/RepeatingTransactionsApi.d.ts +2 -2
- package/dist/recurringtransactions/index.es.js +10 -10
- package/dist/settings/api/SettingsApi.d.ts +2 -3
- package/dist/settings/index.es.js +7 -7
- package/dist/spending/index.es.js +4 -4
- package/dist/transactions/api/TransactionApi.d.ts +2 -3
- package/dist/transactions/components/shared/transactiondetails/Description.d.ts +1 -0
- package/dist/transactions/components/shared/transactiondetails/TransactionDetailsView.d.ts +8 -0
- package/dist/transactions/index.es.js +121 -120
- package/dist/trends/index.es.js +10 -10
- package/dist/{useCombineEvents-Dbjzfwvo.mjs → useCombineEvents-DaDBSR_1.mjs} +29 -29
- package/package.json +1 -1
- package/dist/MerchantStore-h96aTml7.mjs +0 -37
- package/dist/TransactionDetails-v77agHHP.mjs +0 -1280
- package/dist/TrendsStore-B4Q-iLX0.mjs +0 -547
- package/dist/common/types/Handlers.d.ts +0 -2
- package/dist/hooks-DcS6DyRl.mjs +0 -74
|
@@ -1,547 +0,0 @@
|
|
|
1
|
-
import M, { useState as J, useEffect as K, useRef as ve } from "react";
|
|
2
|
-
import { l as Se, u as _e, k as Q } from "./hooks-DcS6DyRl.mjs";
|
|
3
|
-
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
4
|
-
import A from "@mui/material/Box";
|
|
5
|
-
import T from "@mui/material/Stack";
|
|
6
|
-
import { useTheme as U } from "@mui/material/styles";
|
|
7
|
-
import { LineChart as Me } from "@mui/x-charts";
|
|
8
|
-
import { u as Z } from "./useScreenSize-B6JyS_Lj.mjs";
|
|
9
|
-
import { u as Te } from "./useDimensions-27p2evRx.mjs";
|
|
10
|
-
import { observer as De } from "mobx-react-lite";
|
|
11
|
-
import Le from "@mui/material/Card";
|
|
12
|
-
import Ae from "@mui/material/CardContent";
|
|
13
|
-
import P from "@mui/material/Divider";
|
|
14
|
-
import X from "@mui/material/Grid";
|
|
15
|
-
import { CategoryIcon as Re, Text as S } from "@mxenabled/mxui";
|
|
16
|
-
import { b as Ie } from "./Localization-2MODESHW.mjs";
|
|
17
|
-
import { C as O } from "./CurrencyText-YUhH2caW.mjs";
|
|
18
|
-
import { useTheme as we, Card as He, CardContent as Ee, Box as ke } from "@mui/material";
|
|
19
|
-
import { f as R, D as I } from "./Dialog-CWW597AF.mjs";
|
|
20
|
-
import Ge from "@mui/material/Button";
|
|
21
|
-
import { C as L, b as Ne, c as Be } from "./Category-CevNQ03n.mjs";
|
|
22
|
-
import { f as z } from "./NumberFormatting-CtWHhyBX.mjs";
|
|
23
|
-
import Oe from "@mui/material/ListItem";
|
|
24
|
-
import $e from "@mui/material/ListItemButton";
|
|
25
|
-
import V from "@mui/material/ListItemIcon";
|
|
26
|
-
import We from "@mui/material/ListItemText";
|
|
27
|
-
import { makeAutoObservable as je } from "mobx";
|
|
28
|
-
import { addSeconds as Fe } from "date-fns/addSeconds";
|
|
29
|
-
import { differenceInCalendarMonths as Ye } from "date-fns/differenceInCalendarMonths";
|
|
30
|
-
import { endOfMonth as q } from "date-fns/endOfMonth";
|
|
31
|
-
import { subMonths as Pe } from "date-fns/subMonths";
|
|
32
|
-
const Et = () => {
|
|
33
|
-
const { isInitialized: o, appDataStore: t } = Se(), [r, a] = J(!1);
|
|
34
|
-
return K(() => {
|
|
35
|
-
o && t.clientInsightProfile?.is_enabled && a(!0);
|
|
36
|
-
}, [o, t.clientInsightProfile]), r;
|
|
37
|
-
}, ee = ({ categoryGuid: o, topLevelCategoryGuid: t }) => {
|
|
38
|
-
const { categories: r } = _e(), { getCategoryName: a } = Q(), n = a(o);
|
|
39
|
-
return /* @__PURE__ */ f(T, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
40
|
-
/* @__PURE__ */ s(
|
|
41
|
-
A,
|
|
42
|
-
{
|
|
43
|
-
"aria-label": Ie(r.category_icon_label_aria, n),
|
|
44
|
-
mb: 4,
|
|
45
|
-
role: "img",
|
|
46
|
-
children: /* @__PURE__ */ s(Re, { categoryGuid: t })
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ s(S, { variant: "Body", children: n })
|
|
50
|
-
] });
|
|
51
|
-
}, Xe = ({
|
|
52
|
-
categoryGuids: { guid: o, topLevelGuid: t },
|
|
53
|
-
hoveredAreaData: r,
|
|
54
|
-
cursorPosition: a,
|
|
55
|
-
chartContainerRef: n
|
|
56
|
-
}) => {
|
|
57
|
-
const i = U(), c = ve(null), [h, g] = J({ x: a.x, y: a.y });
|
|
58
|
-
if (K(() => {
|
|
59
|
-
(() => {
|
|
60
|
-
const u = c.current, x = n.current;
|
|
61
|
-
if (!u || !x) return;
|
|
62
|
-
const y = u.getBoundingClientRect(), C = x.getBoundingClientRect();
|
|
63
|
-
let p = a.x, v = a.y;
|
|
64
|
-
p + y.width * 2 > C.right ? p = a.x - y.width : p - y.width < C.left && (p = a.x), v + y.height * 2 > C.bottom && (v = a.y - y.height), g({ x: p, y: v });
|
|
65
|
-
})();
|
|
66
|
-
}, [a, n]), !r) return null;
|
|
67
|
-
const b = r.reduce((d, u) => d + u.y, 0);
|
|
68
|
-
return /* @__PURE__ */ s(
|
|
69
|
-
Le,
|
|
70
|
-
{
|
|
71
|
-
ref: c,
|
|
72
|
-
sx: {
|
|
73
|
-
position: "absolute",
|
|
74
|
-
top: h.y,
|
|
75
|
-
left: h.x,
|
|
76
|
-
width: 250,
|
|
77
|
-
pointerEvents: "none"
|
|
78
|
-
},
|
|
79
|
-
children: /* @__PURE__ */ f(Ae, { children: [
|
|
80
|
-
/* @__PURE__ */ f(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
81
|
-
/* @__PURE__ */ s(ee, { categoryGuid: o, topLevelCategoryGuid: t }),
|
|
82
|
-
/* @__PURE__ */ s(S, { variant: "Small", children: `${r.length}-month total` }),
|
|
83
|
-
/* @__PURE__ */ s(O, { amount: b, bold: !0, formatString: "0,0", variant: "body2" })
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
|
|
86
|
-
/* @__PURE__ */ s(X, { container: !0, children: r.map((d, u) => /* @__PURE__ */ f(M.Fragment, { children: [
|
|
87
|
-
u > 0 && u % 3 === 0 && /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
|
|
88
|
-
/* @__PURE__ */ s(X, { item: !0, xs: 4, children: /* @__PURE__ */ f(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
89
|
-
/* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "XSmall", children: d.x }),
|
|
90
|
-
/* @__PURE__ */ s(
|
|
91
|
-
O,
|
|
92
|
-
{
|
|
93
|
-
amount: d.y,
|
|
94
|
-
bold: !0,
|
|
95
|
-
formatString: "0,0",
|
|
96
|
-
variant: "Body"
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
] }) })
|
|
100
|
-
] }, u)) })
|
|
101
|
-
] })
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}, ze = De(Xe), Ve = ({
|
|
105
|
-
categoryGuids: { guid: o, topLevelGuid: t },
|
|
106
|
-
itemData: { dataIndex: r },
|
|
107
|
-
series: a,
|
|
108
|
-
xData: n
|
|
109
|
-
}) => {
|
|
110
|
-
const i = we(), c = a.data[r], h = n[r];
|
|
111
|
-
return c === void 0 || !h ? null : /* @__PURE__ */ s(He, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ f(ke, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
112
|
-
/* @__PURE__ */ s(ee, { categoryGuid: o, topLevelCategoryGuid: t }),
|
|
113
|
-
/* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h, I.MONTH_SHORT_YEAR) }),
|
|
114
|
-
/* @__PURE__ */ s(O, { amount: String(c), bold: !0, formatString: "0,0", variant: "Body" })
|
|
115
|
-
] }) }) });
|
|
116
|
-
}, qe = ({
|
|
117
|
-
sx: o,
|
|
118
|
-
categoryGuids: t,
|
|
119
|
-
hoveredLegend: r,
|
|
120
|
-
legendRef: a,
|
|
121
|
-
onHoverLegend: n,
|
|
122
|
-
onClickLegend: i
|
|
123
|
-
}) => {
|
|
124
|
-
const { isMobile: c } = Z(), { getCategoryName: h } = Q();
|
|
125
|
-
return /* @__PURE__ */ s(
|
|
126
|
-
T,
|
|
127
|
-
{
|
|
128
|
-
direction: "row",
|
|
129
|
-
flexWrap: "wrap",
|
|
130
|
-
gap: c ? 2 : 6,
|
|
131
|
-
justifyContent: "start",
|
|
132
|
-
ref: a,
|
|
133
|
-
sx: o,
|
|
134
|
-
children: t.map(({ guid: g, top_level_guid: b }) => {
|
|
135
|
-
const d = r === g, u = L[g], x = L[b], y = u ?? x ?? L.default, C = y + "33";
|
|
136
|
-
return /* @__PURE__ */ f(
|
|
137
|
-
Ge,
|
|
138
|
-
{
|
|
139
|
-
onClick: () => i(g),
|
|
140
|
-
onMouseEnter: () => n(g),
|
|
141
|
-
onMouseLeave: () => n(null),
|
|
142
|
-
sx: {
|
|
143
|
-
color: "text.primary",
|
|
144
|
-
fontWeight: "normal",
|
|
145
|
-
display: "flex",
|
|
146
|
-
justifyContent: "center",
|
|
147
|
-
alignItems: "center",
|
|
148
|
-
paddingX: 8,
|
|
149
|
-
paddingY: 4,
|
|
150
|
-
borderRadius: 1,
|
|
151
|
-
opacity: d ? 1 : 0.7
|
|
152
|
-
},
|
|
153
|
-
children: [
|
|
154
|
-
/* @__PURE__ */ s(
|
|
155
|
-
A,
|
|
156
|
-
{
|
|
157
|
-
sx: {
|
|
158
|
-
width: 16,
|
|
159
|
-
height: 16,
|
|
160
|
-
marginRight: c ? 5 : 10,
|
|
161
|
-
borderRadius: "2px",
|
|
162
|
-
backgroundColor: r ? d ? y : C : y
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
),
|
|
166
|
-
/* @__PURE__ */ s(S, { variant: "Body", children: h(g) })
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
g
|
|
170
|
-
);
|
|
171
|
-
})
|
|
172
|
-
}
|
|
173
|
-
);
|
|
174
|
-
}, kt = ({
|
|
175
|
-
onHoverArea: o,
|
|
176
|
-
onHoverPoint: t,
|
|
177
|
-
onHoverLegend: r,
|
|
178
|
-
onClickLegend: a,
|
|
179
|
-
stackedDatasets: n,
|
|
180
|
-
unstackedDatasets: i = [],
|
|
181
|
-
availableHeight: c = 0,
|
|
182
|
-
minimumHeight: h = 350
|
|
183
|
-
}) => {
|
|
184
|
-
const g = U(), { isMobile: b } = Z(), [d, { height: u }] = Te(), x = M.useRef(null), [y, C] = M.useState(0);
|
|
185
|
-
M.useEffect(() => {
|
|
186
|
-
const e = Math.max(c - u, h);
|
|
187
|
-
C(e);
|
|
188
|
-
}, [c, u]);
|
|
189
|
-
const [p, v] = M.useState(null), [te, w] = M.useState({
|
|
190
|
-
hoveredSeriesId: null,
|
|
191
|
-
hoveredAreaData: null,
|
|
192
|
-
isAreaHovered: !1,
|
|
193
|
-
cursorPos: { x: 0, y: 0 }
|
|
194
|
-
}), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered: oe, cursorPos: H } = te, W = oe && D && $, j = !W, G = [...n, ...i], re = G[0]?.dataset.length ?? 0, N = G.flatMap((e) => e.dataset.map((l) => l.x)), ae = G.flatMap((e) => e.dataset.map((l) => l.y)), ne = n[0]?.dataset?.map(
|
|
195
|
-
(e, l) => n.reduce((m, _) => m + _.dataset[l]?.y || 0, 0)
|
|
196
|
-
) ?? [0], se = Math.max(...ne), ie = Math.max(
|
|
197
|
-
...i.flatMap((e) => e.dataset.map((l) => l.y))
|
|
198
|
-
), le = Math.floor(Math.min(...ae) / 100) * 100, ce = Math.ceil(Math.max(se, ie) / 100) * 100, E = n.map((e, l) => ({
|
|
199
|
-
id: `stacked-${l}`,
|
|
200
|
-
guid: e.category_guid,
|
|
201
|
-
top_level_guid: e.top_level_category_guid,
|
|
202
|
-
area: !0,
|
|
203
|
-
color: n[l].category_color ?? g.palette.primary.main,
|
|
204
|
-
data: e.dataset.map((m) => m.y),
|
|
205
|
-
label: n[l].category_name,
|
|
206
|
-
stack: "total",
|
|
207
|
-
type: "line",
|
|
208
|
-
highlightScope: { highlight: "item" },
|
|
209
|
-
valueFormatter: (m) => z(m, "0,0")
|
|
210
|
-
})), F = i.map((e, l) => ({
|
|
211
|
-
id: `unstacked-${l}`,
|
|
212
|
-
guid: e.category_guid,
|
|
213
|
-
top_level_guid: e.top_level_category_guid,
|
|
214
|
-
area: !1,
|
|
215
|
-
color: e.category_color,
|
|
216
|
-
data: e.dataset.map((m) => m.y),
|
|
217
|
-
label: e.category_name,
|
|
218
|
-
type: "line",
|
|
219
|
-
valueFormatter: (m) => z(m, "0,0")
|
|
220
|
-
})), Y = [...E, ...F], de = [
|
|
221
|
-
...E.map(({ guid: e, top_level_guid: l }) => ({
|
|
222
|
-
guid: e,
|
|
223
|
-
top_level_guid: l
|
|
224
|
-
})),
|
|
225
|
-
...F.map(({ guid: e, top_level_guid: l }) => ({
|
|
226
|
-
guid: e,
|
|
227
|
-
top_level_guid: l
|
|
228
|
-
}))
|
|
229
|
-
], k = (e) => {
|
|
230
|
-
const m = e.startsWith("stacked-") ? n[parseInt(e.split("-")[1])] : i[parseInt(e.split("-")[1])];
|
|
231
|
-
return {
|
|
232
|
-
guid: m?.category_guid,
|
|
233
|
-
topLevelGuid: m?.top_level_category_guid
|
|
234
|
-
};
|
|
235
|
-
}, ue = (e) => {
|
|
236
|
-
v(e), r?.(e ?? "");
|
|
237
|
-
}, me = (e) => {
|
|
238
|
-
a?.(e ?? "");
|
|
239
|
-
}, ge = () => {
|
|
240
|
-
const e = k(String(D)).guid;
|
|
241
|
-
e && a?.(e);
|
|
242
|
-
}, he = (e) => {
|
|
243
|
-
const l = String(e?.seriesId), m = k(l).guid, _ = Y.find((B) => B.id === l), fe = _ && e?.dataIndex !== void 0, xe = _ && e?.dataIndex === void 0;
|
|
244
|
-
if (fe)
|
|
245
|
-
w({
|
|
246
|
-
hoveredSeriesId: l,
|
|
247
|
-
hoveredAreaData: null,
|
|
248
|
-
isAreaHovered: !1,
|
|
249
|
-
cursorPos: H
|
|
250
|
-
}), t?.(m);
|
|
251
|
-
else if (xe) {
|
|
252
|
-
const B = _?.data.map((be, Ce) => ({
|
|
253
|
-
x: N[Ce],
|
|
254
|
-
y: be
|
|
255
|
-
})) ?? [];
|
|
256
|
-
w({
|
|
257
|
-
hoveredSeriesId: l,
|
|
258
|
-
hoveredAreaData: B,
|
|
259
|
-
isAreaHovered: !0,
|
|
260
|
-
cursorPos: H
|
|
261
|
-
}), o?.(m);
|
|
262
|
-
} else
|
|
263
|
-
w({
|
|
264
|
-
hoveredSeriesId: null,
|
|
265
|
-
hoveredAreaData: null,
|
|
266
|
-
isAreaHovered: !1,
|
|
267
|
-
cursorPos: H
|
|
268
|
-
});
|
|
269
|
-
}, pe = (e) => {
|
|
270
|
-
const l = e.currentTarget.getBoundingClientRect();
|
|
271
|
-
w((m) => ({
|
|
272
|
-
...m,
|
|
273
|
-
cursorPos: {
|
|
274
|
-
x: e.clientX - l.left,
|
|
275
|
-
y: e.clientY - l.top
|
|
276
|
-
}
|
|
277
|
-
}));
|
|
278
|
-
}, ye = {
|
|
279
|
-
p: 4,
|
|
280
|
-
"& .MuiBarLabel-root": {
|
|
281
|
-
fontSize: 10,
|
|
282
|
-
fontWeight: 600
|
|
283
|
-
},
|
|
284
|
-
"& .MuiAreaElement-root": {
|
|
285
|
-
opacity: 0.4,
|
|
286
|
-
transition: "opacity 0.3s ease"
|
|
287
|
-
},
|
|
288
|
-
"& .MuiAreaElement-root:hover": {
|
|
289
|
-
opacity: 1
|
|
290
|
-
},
|
|
291
|
-
'& [class*="MuiLineElement-series-unstacked-"]': {
|
|
292
|
-
strokeWidth: 3
|
|
293
|
-
},
|
|
294
|
-
...p && E.reduce((e, l, m) => {
|
|
295
|
-
const _ = `.MuiAreaElement-series-stacked-${m}`;
|
|
296
|
-
return e[_] = {
|
|
297
|
-
opacity: E[m].guid === p ? 0.9 : 0.2
|
|
298
|
-
}, e;
|
|
299
|
-
}, {})
|
|
300
|
-
};
|
|
301
|
-
return /* @__PURE__ */ s(A, { onMouseMove: pe, ref: x, style: { position: "relative" }, children: /* @__PURE__ */ f(
|
|
302
|
-
T,
|
|
303
|
-
{
|
|
304
|
-
direction: { xs: "column", md: "column" },
|
|
305
|
-
spacing: { xs: 0, md: 4 },
|
|
306
|
-
sx: { width: "100%", position: "relative" },
|
|
307
|
-
children: [
|
|
308
|
-
/* @__PURE__ */ s(
|
|
309
|
-
Me,
|
|
310
|
-
{
|
|
311
|
-
height: y,
|
|
312
|
-
margin: { bottom: 50 },
|
|
313
|
-
onAreaClick: ge,
|
|
314
|
-
onHighlightChange: he,
|
|
315
|
-
series: Y,
|
|
316
|
-
skipAnimation: !0,
|
|
317
|
-
slotProps: {
|
|
318
|
-
legend: {
|
|
319
|
-
hidden: !0
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
slots: {
|
|
323
|
-
itemContent: (e) => j && D ? /* @__PURE__ */ s(
|
|
324
|
-
Ve,
|
|
325
|
-
{
|
|
326
|
-
categoryGuids: k(D),
|
|
327
|
-
xData: N,
|
|
328
|
-
...e
|
|
329
|
-
}
|
|
330
|
-
) : null
|
|
331
|
-
},
|
|
332
|
-
sx: ye,
|
|
333
|
-
tooltip: {
|
|
334
|
-
trigger: j ? "item" : "none"
|
|
335
|
-
},
|
|
336
|
-
xAxis: [
|
|
337
|
-
{
|
|
338
|
-
data: N,
|
|
339
|
-
scaleType: "time",
|
|
340
|
-
valueFormatter: (e) => R(e, I.MONTH_SHORT_YEAR),
|
|
341
|
-
tickNumber: re
|
|
342
|
-
// How many ticks to show on the x-axis
|
|
343
|
-
}
|
|
344
|
-
],
|
|
345
|
-
yAxis: [
|
|
346
|
-
{
|
|
347
|
-
min: le,
|
|
348
|
-
max: ce || 100
|
|
349
|
-
}
|
|
350
|
-
]
|
|
351
|
-
}
|
|
352
|
-
),
|
|
353
|
-
/* @__PURE__ */ s(
|
|
354
|
-
qe,
|
|
355
|
-
{
|
|
356
|
-
categoryGuids: de,
|
|
357
|
-
hoveredLegend: p,
|
|
358
|
-
legendRef: d,
|
|
359
|
-
onClickLegend: me,
|
|
360
|
-
onHoverLegend: ue,
|
|
361
|
-
sx: { px: b ? 0 : 24 }
|
|
362
|
-
}
|
|
363
|
-
),
|
|
364
|
-
W && /* @__PURE__ */ s(
|
|
365
|
-
ze,
|
|
366
|
-
{
|
|
367
|
-
categoryGuids: k(D),
|
|
368
|
-
chartContainerRef: x,
|
|
369
|
-
cursorPosition: H,
|
|
370
|
-
hoveredAreaData: $.map((e) => ({
|
|
371
|
-
...e,
|
|
372
|
-
x: R(e.x, I.MONTH_SHORT_YEAR)
|
|
373
|
-
}))
|
|
374
|
-
}
|
|
375
|
-
)
|
|
376
|
-
]
|
|
377
|
-
}
|
|
378
|
-
) });
|
|
379
|
-
}, Gt = ({
|
|
380
|
-
onClick: o,
|
|
381
|
-
leftIcon: t,
|
|
382
|
-
rightIcon: r,
|
|
383
|
-
title: a,
|
|
384
|
-
subtitle: n,
|
|
385
|
-
rightContent: i,
|
|
386
|
-
titleBold: c = !0,
|
|
387
|
-
rightContentBold: h = !0
|
|
388
|
-
}) => {
|
|
389
|
-
const g = /* @__PURE__ */ f(M.Fragment, { children: [
|
|
390
|
-
t && /* @__PURE__ */ s(V, { sx: { ml: 0 }, children: t }),
|
|
391
|
-
/* @__PURE__ */ s(We, { children: /* @__PURE__ */ f(
|
|
392
|
-
T,
|
|
393
|
-
{
|
|
394
|
-
sx: {
|
|
395
|
-
alignItems: "center",
|
|
396
|
-
flexDirection: "row",
|
|
397
|
-
marginLeft: 12
|
|
398
|
-
},
|
|
399
|
-
children: [
|
|
400
|
-
/* @__PURE__ */ f(T, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
401
|
-
/* @__PURE__ */ s(S, { bold: c, variant: "body1", children: a }),
|
|
402
|
-
n && /* @__PURE__ */ s(S, { variant: "caption", children: n })
|
|
403
|
-
] }),
|
|
404
|
-
/* @__PURE__ */ f(T, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
|
|
405
|
-
i && /* @__PURE__ */ s(S, { bold: h, display: "flex", variant: "body1", children: i }),
|
|
406
|
-
r && /* @__PURE__ */ s(V, { children: r })
|
|
407
|
-
] })
|
|
408
|
-
]
|
|
409
|
-
}
|
|
410
|
-
) })
|
|
411
|
-
] });
|
|
412
|
-
return /* @__PURE__ */ s(Oe, { sx: { bgcolor: "background.paper" }, children: o ? /* @__PURE__ */ s(
|
|
413
|
-
$e,
|
|
414
|
-
{
|
|
415
|
-
onClick: o,
|
|
416
|
-
sx: {
|
|
417
|
-
py: 14
|
|
418
|
-
},
|
|
419
|
-
children: g
|
|
420
|
-
}
|
|
421
|
-
) : /* @__PURE__ */ s(
|
|
422
|
-
T,
|
|
423
|
-
{
|
|
424
|
-
sx: {
|
|
425
|
-
py: 14,
|
|
426
|
-
px: 24,
|
|
427
|
-
width: "100%",
|
|
428
|
-
flexDirection: "row",
|
|
429
|
-
alignItems: "center"
|
|
430
|
-
},
|
|
431
|
-
children: g
|
|
432
|
-
}
|
|
433
|
-
) });
|
|
434
|
-
}, Je = (o) => L[o] ?? L.default, Ke = (o) => Be[o];
|
|
435
|
-
function Qe(o, t) {
|
|
436
|
-
const r = [], a = new Date(o);
|
|
437
|
-
for (; a <= t; ) {
|
|
438
|
-
const n = a.getFullYear(), i = String(a.getMonth() + 1).padStart(2, "0");
|
|
439
|
-
r.push(+`${n}${i}`), a.setMonth(a.getMonth() + 1);
|
|
440
|
-
}
|
|
441
|
-
return r;
|
|
442
|
-
}
|
|
443
|
-
const Ue = (o) => o.reduce((r, a) => {
|
|
444
|
-
const n = {
|
|
445
|
-
top_level_category_guid: a.top_level_category_guid,
|
|
446
|
-
category_guid: a.category_guid,
|
|
447
|
-
amount: a.total,
|
|
448
|
-
year_month: a.year_month
|
|
449
|
-
}, { top_level_category_guid: i, category_guid: c } = n;
|
|
450
|
-
return r[c] || (r[c] = []), r[c].push(n), i !== c && (r[i] || (r[i] = []), r[i].push(n)), r;
|
|
451
|
-
}, {}), Nt = (o, t, r) => {
|
|
452
|
-
const a = Ue(o), n = Qe(t, r);
|
|
453
|
-
return Object.entries(a).map(([c, h]) => {
|
|
454
|
-
const g = h[0].top_level_category_guid, b = n.map((d) => {
|
|
455
|
-
const u = h.filter((p) => p.year_month === d).reduce((p, v) => p + Math.abs(v.amount), 0), x = Number(String(d).slice(0, 4)), y = Number(String(d).slice(4));
|
|
456
|
-
return { x: new Date(x, y - 1), y: u };
|
|
457
|
-
}).sort((d, u) => d.x.getTime() - u.x.getTime());
|
|
458
|
-
return {
|
|
459
|
-
top_level_category_guid: g,
|
|
460
|
-
category_guid: c,
|
|
461
|
-
category_name: Ke(c),
|
|
462
|
-
category_color: Je(g),
|
|
463
|
-
dataset: b
|
|
464
|
-
};
|
|
465
|
-
});
|
|
466
|
-
}, Bt = (o, t) => {
|
|
467
|
-
const r = typeof o == "string" ? parseFloat(o.replace(/[^0-9.-]+/g, "")) : o, a = typeof t == "string" ? parseFloat(t.replace(/[^0-9.-]+/g, "")) : t;
|
|
468
|
-
return (r || 0) - (a || 0);
|
|
469
|
-
}, Ze = (o, t) => {
|
|
470
|
-
const r = o.subCategories.filter((i) => i.currentAmount !== 0), a = o.totalMonthlyAmounts.slice(-t), n = (i) => i.substring(0, 3) + " " + i.slice(-4);
|
|
471
|
-
return a.map((i) => {
|
|
472
|
-
const c = n(i.label), h = r.map((d) => {
|
|
473
|
-
const u = d.monthlyAmounts.slice(-t).find((x) => n(x.label) === c);
|
|
474
|
-
return {
|
|
475
|
-
label: d.name,
|
|
476
|
-
amount: Math.abs(u?.amount || 0),
|
|
477
|
-
header: c
|
|
478
|
-
};
|
|
479
|
-
}), g = o.monthlyAmounts.slice(-t).find((d) => n(d.label) === c);
|
|
480
|
-
return [{
|
|
481
|
-
label: o.name,
|
|
482
|
-
amount: Math.abs(g?.amount || 0),
|
|
483
|
-
header: c
|
|
484
|
-
}, ...h].sort((d, u) => u.amount - d.amount);
|
|
485
|
-
});
|
|
486
|
-
}, et = (o, t) => {
|
|
487
|
-
const r = o ? o.totalMonthlyAmounts.slice(-t).map((n) => ({
|
|
488
|
-
x: n.label.substring(0, 3),
|
|
489
|
-
y: Math.abs(n.amount)
|
|
490
|
-
})) : [], a = o ? Ze(o, t) : [];
|
|
491
|
-
return { monthlyAmounts: r, tooltipLabels: a };
|
|
492
|
-
}, tt = (o) => o.slice().filter(
|
|
493
|
-
(t) => t.totalAmount !== 0 && t.isTransfer === !1 && t.guid !== Ne.INVESTMENTS
|
|
494
|
-
).sort((t, r) => Math.abs(r.totalAmount) - Math.abs(t.totalAmount));
|
|
495
|
-
class Ot {
|
|
496
|
-
globalStore;
|
|
497
|
-
selectedCategoryData = null;
|
|
498
|
-
selectedDateRange;
|
|
499
|
-
visibleListLength = 5;
|
|
500
|
-
constructor(t) {
|
|
501
|
-
this.globalStore = t, this.selectedDateRange = {
|
|
502
|
-
start: Fe(q(Pe(/* @__PURE__ */ new Date(), 6)), 1),
|
|
503
|
-
end: q(/* @__PURE__ */ new Date())
|
|
504
|
-
}, je(this);
|
|
505
|
-
}
|
|
506
|
-
setSelectedCategoryData = (t) => {
|
|
507
|
-
this.selectedCategoryData = t;
|
|
508
|
-
};
|
|
509
|
-
setSelectedDateRange = (t) => {
|
|
510
|
-
this.selectedDateRange = t;
|
|
511
|
-
};
|
|
512
|
-
setVisibleListLength = (t) => {
|
|
513
|
-
this.visibleListLength = t;
|
|
514
|
-
};
|
|
515
|
-
get sortedDetailedCategoriesWithTransactions() {
|
|
516
|
-
return tt(
|
|
517
|
-
this.globalStore.categoryStore.detailedCategoriesWithTransactions
|
|
518
|
-
);
|
|
519
|
-
}
|
|
520
|
-
get selectedDateRangeMonthCount() {
|
|
521
|
-
return Ye(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
522
|
-
}
|
|
523
|
-
get selectedDateRangeMonthRange() {
|
|
524
|
-
const t = R(this.selectedDateRange.start, I.MONTH_LONG), r = R(this.selectedDateRange.end, I.MONTH_LONG);
|
|
525
|
-
return `${t} - ${r}`;
|
|
526
|
-
}
|
|
527
|
-
get visibleCategories() {
|
|
528
|
-
return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
|
|
529
|
-
}
|
|
530
|
-
get collapsedCategories() {
|
|
531
|
-
return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
|
|
532
|
-
}
|
|
533
|
-
get categoryDetailsChartData() {
|
|
534
|
-
return et(
|
|
535
|
-
this.selectedCategoryData,
|
|
536
|
-
this.selectedDateRangeMonthCount
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
export {
|
|
541
|
-
Gt as L,
|
|
542
|
-
kt as S,
|
|
543
|
-
Ot as T,
|
|
544
|
-
Bt as a,
|
|
545
|
-
Nt as g,
|
|
546
|
-
Et as u
|
|
547
|
-
};
|
package/dist/hooks-DcS6DyRl.mjs
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import s from "react";
|
|
2
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
const a = s.createContext(null), b = ({
|
|
4
|
-
children: e,
|
|
5
|
-
globalStore: t,
|
|
6
|
-
onError: r,
|
|
7
|
-
onEvent: l,
|
|
8
|
-
onPageView: u
|
|
9
|
-
}) => (t.onError = r, /* @__PURE__ */ n(
|
|
10
|
-
a.Provider,
|
|
11
|
-
{
|
|
12
|
-
value: {
|
|
13
|
-
globalStore: t,
|
|
14
|
-
onError: r,
|
|
15
|
-
onEvent: l,
|
|
16
|
-
onPageView: u,
|
|
17
|
-
children: e
|
|
18
|
-
},
|
|
19
|
-
children: e
|
|
20
|
-
}
|
|
21
|
-
)), S = s.createContext(null), C = ({ children: e, availableHeight: t, availableWidth: r }) => /* @__PURE__ */ n(
|
|
22
|
-
S.Provider,
|
|
23
|
-
{
|
|
24
|
-
value: {
|
|
25
|
-
availableHeight: t,
|
|
26
|
-
availableWidth: r,
|
|
27
|
-
children: e
|
|
28
|
-
},
|
|
29
|
-
children: e
|
|
30
|
-
}
|
|
31
|
-
), o = (e = "useGlobalStore") => {
|
|
32
|
-
const t = s.useContext(a);
|
|
33
|
-
if (!t)
|
|
34
|
-
throw new Error(`${e}() must be used within the GlobalDataContext`);
|
|
35
|
-
return t;
|
|
36
|
-
}, d = () => o("useAccountStore").globalStore.accountStore, p = () => o("useAppConfig").globalStore.appDataStore.appConfig, h = () => o("useAnalyticsStore").globalStore.analyticsStore, x = () => o("useBudgetsStore").globalStore.budgetsStore, f = () => o("useCashflowStore").globalStore.cashflowStore, w = () => o("useCategoryStore").globalStore.categoryStore, G = () => o("useConnectStore").globalStore.connectStore, v = () => o("useDebtsStore").globalStore.debtsStore, y = () => o("useFinstrongStore").globalStore.finstrongStore, W = () => o("useGlobalStore").globalStore, m = () => o("useGlobalUiStore").globalStore.globalUiStore, E = () => o("globalCopyStore").globalStore.copyStore.copy, P = () => o("useGoalStore").globalStore.goalStore, A = () => o("useHelpStore").globalStore.helpStore, D = () => o("useHoldingStore").globalStore.holdingStore, T = () => o("useMerchantStore").globalStore.merchantStore, U = () => o("useNetWorthStore").globalStore.netWorthStore, H = () => o("useNotificationStore").globalStore.notificationStore, N = () => o("useRecurringTransactionsStore").globalStore.recurringTransactionsStore, B = () => o("useSettingsStore").globalStore.settingsStore, R = () => o("useTransactionStore").globalStore.transactionStore, V = () => o("useTrendsStore").globalStore.trendsStore, j = () => o("useUserStore").globalStore.userStore, F = () => ({ onError: o().onError }), M = () => ({ onEvent: o().onEvent }), $ = () => ({ onPageView: o().onPageView }), c = (e = "useWidgetContainerContext") => {
|
|
37
|
-
const t = s.useContext(S);
|
|
38
|
-
if (!t)
|
|
39
|
-
throw new Error(`${e}() must be used within the WidgetContainerContext`);
|
|
40
|
-
return t;
|
|
41
|
-
}, k = () => c();
|
|
42
|
-
export {
|
|
43
|
-
$ as A,
|
|
44
|
-
b as B,
|
|
45
|
-
S as C,
|
|
46
|
-
a as G,
|
|
47
|
-
C as W,
|
|
48
|
-
m as a,
|
|
49
|
-
T as b,
|
|
50
|
-
d as c,
|
|
51
|
-
G as d,
|
|
52
|
-
M as e,
|
|
53
|
-
R as f,
|
|
54
|
-
x as g,
|
|
55
|
-
N as h,
|
|
56
|
-
h as i,
|
|
57
|
-
P as j,
|
|
58
|
-
w as k,
|
|
59
|
-
W as l,
|
|
60
|
-
p as m,
|
|
61
|
-
H as n,
|
|
62
|
-
j as o,
|
|
63
|
-
k as p,
|
|
64
|
-
U as q,
|
|
65
|
-
B as r,
|
|
66
|
-
D as s,
|
|
67
|
-
f as t,
|
|
68
|
-
E as u,
|
|
69
|
-
V as v,
|
|
70
|
-
y as w,
|
|
71
|
-
v as x,
|
|
72
|
-
F as y,
|
|
73
|
-
A as z
|
|
74
|
-
};
|