@mx-cartographer/experiences 7.1.5 → 7.2.1-alpha.san1
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 +4 -0
- package/dist/{Account-8IUM_CLv.mjs → Account-CpRTVIHg.mjs} +1 -1
- package/dist/{AccountDetailsContent-CuZSSAEc.mjs → AccountDetailsContent-JfTu_amk.mjs} +10 -10
- package/dist/{AccountDetailsHeader-BZBsIKdF.mjs → AccountDetailsHeader-D5XdFMtT.mjs} +8 -8
- package/dist/{AccountFields-BD_0GT68.mjs → AccountFields-DOLjKu5l.mjs} +5 -5
- package/dist/{AccountListItem-CllIBCao.mjs → AccountListItem-CTT5m4qx.mjs} +4 -4
- package/dist/{AccountStore-BL0FE1QL.mjs → AccountStore-CKHyaGMR.mjs} +46 -29
- package/dist/{Accounts-Bvc9TJaO.mjs → Accounts-D0BmvNxn.mjs} +1 -1
- package/dist/{BudgetUtil-psfk-Amb.mjs → BudgetUtil-D2Jcp-E-.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-BmenK5bu.mjs → CategorySelectorDrawer-DomNyubP.mjs} +3 -3
- package/dist/{CategoryStore-BCcpI3oJ.mjs → CategoryStore-C1IfDPCE.mjs} +1 -1
- package/dist/{CategoryUtil-BR3H5i6n.mjs → CategoryUtil-DUM8NuGO.mjs} +1 -1
- package/dist/{ConnectDrawer-CPTXh70j.mjs → ConnectDrawer--gJHyp-S.mjs} +2 -2
- package/dist/{ConnectionsDrawer-Dkb4vBmt.mjs → ConnectionsDrawer-DabiwV9L.mjs} +3 -3
- package/dist/{CurrencyInput-C4xNRL2W.mjs → CurrencyInput-CC5cwVit.mjs} +1 -1
- package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
- package/dist/{DebtsStore-D4grpB4m.mjs → DebtsStore-9aR2sTJQ.mjs} +1 -1
- package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
- package/dist/Drawer-BEtCk82g.mjs +163 -0
- package/dist/{ExportCsvAction-CBJAfyAw.mjs → ExportCsvAction-Um-CDa4C.mjs} +3 -3
- package/dist/FinstrongStore-CjErZ73K.mjs +432 -0
- package/dist/{GoalStore-B5MZzPLZ.mjs → GoalStore-CiBKZvTg.mjs} +3 -3
- package/dist/{Help-CzBAsKA2.mjs → Help-BZ8pIkkR.mjs} +2 -2
- package/dist/{LineChart-B35qvXik.mjs → LineChart-ClUGPuYX.mjs} +3 -3
- package/dist/{ListItemAction-DSrYDGAP.mjs → ListItemAction-DGaxy7oz.mjs} +10 -10
- package/dist/{ManageIncome-DUuT-yMV.mjs → ManageIncome-BaNgfwr5.mjs} +34 -32
- package/dist/{MicroWidgetContainer-C4QQHfD7.mjs → MicroWidgetContainer-C3iV1FBR.mjs} +1 -1
- package/dist/{MiniWidgetContainer-DTQdRK-3.mjs → MiniWidgetContainer-LtXXgZ6H.mjs} +1 -1
- package/dist/{NetWorthStore-Do1Gk8Te.mjs → NetWorthStore-MnpP5KEc.mjs} +2 -2
- package/dist/{NotificationSettings-BuShgjn6.mjs → NotificationSettings-Ckx8tgQj.mjs} +5 -5
- package/dist/{OriginalBalanceAction-BsxcvNEF.mjs → OriginalBalanceAction-CGZDUsCc.mjs} +3 -3
- package/dist/{RecurringSettings-BVOt46uV.mjs → RecurringSettings-DE4T4yQy.mjs} +4 -4
- package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-CngsRZ3K.mjs} +45 -44
- package/dist/{RecurringTransactionsStore-DrzS1LmF.mjs → RecurringTransactionsStore-C4RVULF8.mjs} +1 -1
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
- package/dist/SpendingLegend-D24CEkL3.mjs +170 -0
- package/dist/{TransactionDetails-_cXLXTd3.mjs → TransactionDetails-DRlrltGq.mjs} +11 -8
- package/dist/{TransactionStore-B-Tq_YFE.mjs → TransactionStore-BHTdiLRW.mjs} +90 -86
- package/dist/{TrendsStore-ZZ8X36lJ.mjs → TrendsStore-DL3Vuh71.mjs} +14 -14
- package/dist/{User-DaJAQ09j.mjs → User-BthIKO4w.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-664i7l19.mjs → ViewMoreMicroCard-C5yQiaed.mjs} +507 -480
- package/dist/{WidgetContainer-DtPnPQZY.mjs → WidgetContainer-DJA1bxLn.mjs} +4 -4
- package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
- package/dist/accounts/index.es.js +14 -14
- package/dist/accounts/stores/AccountStore.d.ts +3 -0
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +12 -12
- package/dist/cashflow/index.es.js +11 -11
- package/dist/categories/index.es.js +2 -2
- package/dist/common/components/Select.d.ts +4 -2
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Footer.d.ts +17 -0
- package/dist/common/index.es.js +33 -33
- package/dist/common/types/Finstrong.d.ts +50 -0
- package/dist/common/types/Widgets.d.ts +2 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/localization/FinstrongCopy.d.ts +58 -1
- package/dist/dashboard/index.es.js +2 -2
- package/dist/debts/index.es.js +11 -11
- package/dist/{exportTransactionsToCSV-D8TTNrrE.mjs → exportTransactionsToCSV-XqdHNe2V.mjs} +2 -2
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
- package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
- package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +5 -2
- package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +6 -3
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +12 -0
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +5 -2
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
- package/dist/finstrong/components/ProgressBar.d.ts +15 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +6 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
- package/dist/finstrong/components/StatusChip.d.ts +5 -0
- package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +11 -0
- package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
- package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
- package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
- package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
- package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
- package/dist/finstrong/components/shared/TransactionList.d.ts +15 -0
- package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
- package/dist/finstrong/constants/index.d.ts +8 -0
- package/dist/finstrong/index.es.js +2903 -1005
- package/dist/finstrong/stores/FinstrongStore.d.ts +9 -1
- package/dist/finstrong/util/finstrongUtils.d.ts +60 -1
- package/dist/goals/index.es.js +14 -14
- package/dist/help/index.es.js +3 -3
- package/dist/{hooks-CE2TKk4a.mjs → hooks-CBST3rkm.mjs} +3 -3
- package/dist/investments/index.es.js +4 -4
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/components/beaticons/BeatIcon.d.ts +2 -0
- package/dist/microinsights/components/carouselheader/CarouselHeader.d.ts +2 -1
- package/dist/microinsights/components/microBeatCarousel/CarouselControls.d.ts +2 -0
- package/dist/microinsights/index.d.ts +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/interfaces.d.ts +4 -0
- package/dist/networth/index.es.js +34 -34
- package/dist/notifications/index.es.js +4 -4
- package/dist/recurringtransactions/index.es.js +13 -13
- package/dist/settings/index.es.js +8 -8
- package/dist/spending/index.es.js +222 -373
- package/dist/transactions/index.es.js +15 -15
- package/dist/transactions/stores/TransactionStore.d.ts +2 -2
- package/dist/trends/index.es.js +16 -16
- package/dist/{useAccountDisplayName-BXGkZN5B.mjs → useAccountDisplayName-DH1CuQ9R.mjs} +2 -2
- package/dist/{useInsightsEnabled-DSnpkUq0.mjs → useInsightsEnabled-jdvS1ppf.mjs} +1 -1
- package/package.json +1 -1
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/finstrong/utils/Finstrong.d.ts +0 -6
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { b } from "./CategoryUtil-DUM8NuGO.mjs";
|
|
2
|
+
import { b as m } from "./Category-CevNQ03n.mjs";
|
|
3
|
+
import { jsx as d, jsxs as x } from "react/jsx-runtime";
|
|
4
|
+
import T from "react";
|
|
5
|
+
import { observer as E } from "mobx-react-lite";
|
|
6
|
+
import h from "@mui/material/Stack";
|
|
7
|
+
import { CategoryIcon as I, CategoryIconVariants as M, Text as p } from "@mxenabled/mxui";
|
|
8
|
+
import N from "@mui/material/Button";
|
|
9
|
+
import { useTheme as v } from "@mui/material";
|
|
10
|
+
import { D as G } from "./Donut-1UMNcG67.mjs";
|
|
11
|
+
import { u as w } from "./hooks-CBST3rkm.mjs";
|
|
12
|
+
import { u as O } from "./useScreenSize-B6JyS_Lj.mjs";
|
|
13
|
+
import { f as D } from "./NumberFormatting-Buh7u8Oi.mjs";
|
|
14
|
+
import j from "@mui/material/Box";
|
|
15
|
+
const C = 5, k = (a, l, g) => g.reduce((e, r) => {
|
|
16
|
+
if (r.total > 0) {
|
|
17
|
+
const n = a.find((o) => o.guid === r.category_guid);
|
|
18
|
+
if (!n) return e;
|
|
19
|
+
const u = n.parent_guid ?? n.guid, t = a.find((o) => o.guid === u);
|
|
20
|
+
if (!t) return e;
|
|
21
|
+
const i = {
|
|
22
|
+
guid: n.guid,
|
|
23
|
+
name: n.guid === u ? `General ${n.name}` : n.name,
|
|
24
|
+
color: b(t.guid, l),
|
|
25
|
+
amount: r.total
|
|
26
|
+
}, c = e.find((o) => o.guid === u);
|
|
27
|
+
c ? (c.amount += r.total, c.categoryTotals?.push(i)) : e.push({
|
|
28
|
+
guid: u,
|
|
29
|
+
name: t.name,
|
|
30
|
+
color: b(t.guid, l),
|
|
31
|
+
categoryTotals: [i],
|
|
32
|
+
amount: r.total
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return e;
|
|
36
|
+
}, []), L = (a, l, g, e) => {
|
|
37
|
+
const r = k(a, g, e), n = r.filter(
|
|
38
|
+
(o) => o.guid !== m.INCOME && o.guid !== m.INVESTMENTS && o.guid !== m.TRANSFER
|
|
39
|
+
).sort((o, s) => s.amount - o.amount), u = n.reduce(
|
|
40
|
+
(o, s) => o + s.amount,
|
|
41
|
+
0
|
|
42
|
+
), t = n.length > C ? C : n.length, i = n.slice(0, t), c = i.map((o) => ({
|
|
43
|
+
id: o.guid,
|
|
44
|
+
color: b(o.guid, g),
|
|
45
|
+
label: o.name,
|
|
46
|
+
value: o.amount / u * 100
|
|
47
|
+
}));
|
|
48
|
+
if (n.length > 5) {
|
|
49
|
+
const o = n.slice(C, r.length), s = o.reduce(
|
|
50
|
+
(f, y) => f + y.amount,
|
|
51
|
+
0
|
|
52
|
+
);
|
|
53
|
+
i.push({
|
|
54
|
+
guid: "other",
|
|
55
|
+
color: g.palette.categories.others || "",
|
|
56
|
+
name: l.saving_goal_other,
|
|
57
|
+
categoryTotals: o,
|
|
58
|
+
amount: s
|
|
59
|
+
}), c.push({
|
|
60
|
+
id: "other",
|
|
61
|
+
color: g.palette.categories.others || "",
|
|
62
|
+
label: l.saving_goal_other,
|
|
63
|
+
value: s / u * 100
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
categoryData: i,
|
|
68
|
+
donutData: c,
|
|
69
|
+
totalAmount: u
|
|
70
|
+
};
|
|
71
|
+
}, Q = (a, l, g) => {
|
|
72
|
+
const e = a.filter(
|
|
73
|
+
(t) => t.guid === m.INCOME || t.parent_guid === m.INCOME
|
|
74
|
+
), r = l.filter((t) => e.some((i) => i.guid === t.category_guid)).sort((t, i) => t.total - i.total).map((t, i) => ({
|
|
75
|
+
guid: t.category_guid,
|
|
76
|
+
name: a.find((c) => c.guid === t.category_guid)?.name,
|
|
77
|
+
color: g[i],
|
|
78
|
+
categoryTotals: [],
|
|
79
|
+
amount: Math.abs(t.total)
|
|
80
|
+
})), n = r.reduce(
|
|
81
|
+
(t, i) => t + i.amount,
|
|
82
|
+
0
|
|
83
|
+
), u = r.map((t) => ({
|
|
84
|
+
id: t.guid,
|
|
85
|
+
color: t.color,
|
|
86
|
+
label: t.name,
|
|
87
|
+
value: t.amount / n * 100
|
|
88
|
+
}));
|
|
89
|
+
return {
|
|
90
|
+
categoryData: r,
|
|
91
|
+
donutData: u,
|
|
92
|
+
totalAmount: n
|
|
93
|
+
};
|
|
94
|
+
}, A = ({
|
|
95
|
+
data: a,
|
|
96
|
+
isIncome: l = !1,
|
|
97
|
+
onSelected: g,
|
|
98
|
+
onViewTransactions: e,
|
|
99
|
+
selectedId: r,
|
|
100
|
+
size: n = 150,
|
|
101
|
+
totalLabel: u,
|
|
102
|
+
variant: t = "mini"
|
|
103
|
+
}) => {
|
|
104
|
+
const { spending: i } = w(), c = v(), { isTablet: o } = O(), s = T.useMemo(
|
|
105
|
+
() => r ? a.categoryData.find((_) => _.guid === r) : void 0,
|
|
106
|
+
[r]
|
|
107
|
+
), f = T.useMemo(() => a.donutData.length > 0 ? a.donutData : [{ id: "0", color: c.palette.divider, value: 100 }], [a, c]), y = () => {
|
|
108
|
+
e?.(r);
|
|
109
|
+
}, S = o ? 32 : 48;
|
|
110
|
+
return /* @__PURE__ */ d(G, { data: f, onClick: g, selectedId: r, size: n, children: /* @__PURE__ */ d(h, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ x(h, { alignItems: "center", justifyContent: "center", minHeight: n, minWidth: n, children: [
|
|
111
|
+
s && /* @__PURE__ */ x(
|
|
112
|
+
h,
|
|
113
|
+
{
|
|
114
|
+
alignItems: "center",
|
|
115
|
+
gap: t === "mini" ? 0 : 8,
|
|
116
|
+
mb: t === "mini" ? 0 : 8,
|
|
117
|
+
mt: t === "mini" ? 0 : -16,
|
|
118
|
+
sx: t === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ d(
|
|
121
|
+
I,
|
|
122
|
+
{
|
|
123
|
+
categoryGuid: l ? m.INCOME : s.guid,
|
|
124
|
+
size: t === "mini" ? 24 : S,
|
|
125
|
+
variant: M.Transparent
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ d(p, { color: "secondary", noWrap: !0, variant: t === "mini" ? "Tiny" : "Body", children: s ? s.name : u })
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
!s && t === "full" && /* @__PURE__ */ d(p, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: u }),
|
|
133
|
+
/* @__PURE__ */ d(p, { variant: t === "mini" ? "H2" : "H1", children: s ? D(s.amount, "0,0") : D(a.totalAmount, "0,0") }),
|
|
134
|
+
!s && t === "mini" && /* @__PURE__ */ d(p, { color: "secondary", noWrap: !0, variant: "Tiny", children: u }),
|
|
135
|
+
t === "full" && /* @__PURE__ */ d(
|
|
136
|
+
N,
|
|
137
|
+
{
|
|
138
|
+
"aria-label": `View ${s?.name || ""} Transactions`,
|
|
139
|
+
disabled: a.categoryData.length === 0,
|
|
140
|
+
onClick: y,
|
|
141
|
+
sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
|
|
142
|
+
variant: "text",
|
|
143
|
+
children: i.view_transactions
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
] }) }) });
|
|
147
|
+
}, U = E(A), Z = ({ data: a, onSelected: l, selectedId: g }) => /* @__PURE__ */ d(h, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: a.categoryData.map((e) => /* @__PURE__ */ x(
|
|
148
|
+
h,
|
|
149
|
+
{
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
"aria-label": e.name,
|
|
152
|
+
"aria-selected": e.guid === g,
|
|
153
|
+
direction: "row",
|
|
154
|
+
gap: 8,
|
|
155
|
+
onClick: () => l(e.guid),
|
|
156
|
+
role: "button",
|
|
157
|
+
sx: { cursor: "pointer" },
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ d(j, { borderRadius: 4, height: 8, sx: { backgroundColor: e.color }, width: 8 }),
|
|
160
|
+
/* @__PURE__ */ d(p, { bold: e.guid === g, variant: "XSmall", children: e.name })
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
e.guid
|
|
164
|
+
)) });
|
|
165
|
+
export {
|
|
166
|
+
U as S,
|
|
167
|
+
Q as a,
|
|
168
|
+
Z as b,
|
|
169
|
+
L as g
|
|
170
|
+
};
|
|
@@ -9,15 +9,15 @@ import { MerchantLogo as pe, Icon as S, Text as T, useTokens as ee, CategoryIcon
|
|
|
9
9
|
import B from "@mui/material/ListItemAvatar";
|
|
10
10
|
import M from "@mui/material/ListItemText";
|
|
11
11
|
import f from "@mui/material/Stack";
|
|
12
|
-
import { T as Pe, L as Ge, O as h, C as Me, b as Ke, i as $e } from "./User-
|
|
13
|
-
import { G as Be, h as v, u as A, g as L, m as xe, b as Fe, o as He } from "./hooks-
|
|
12
|
+
import { T as Pe, L as Ge, O as h, C as Me, b as Ke, i as $e } from "./User-BthIKO4w.mjs";
|
|
13
|
+
import { G as Be, h as v, u as A, g as L, m as xe, b as Fe, o as He } from "./hooks-CBST3rkm.mjs";
|
|
14
14
|
import { f as te } from "./NumberFormatting-Buh7u8Oi.mjs";
|
|
15
15
|
import { Receipt as ze, Delete as oe, ChevronRight as Ue, Cancel as ie, Search as Xe, Edit as Ve, Flag as We } from "@mxenabled/mx-icons";
|
|
16
16
|
import { fromUnixTime as W } from "date-fns/fromUnixTime";
|
|
17
17
|
import { isSameDay as Ne } from "date-fns/isSameDay";
|
|
18
|
-
import { h as Ye } from "./DateUtil-
|
|
18
|
+
import { h as Ye } from "./DateUtil-CBdcsyuk.mjs";
|
|
19
19
|
import { L as Ie } from "./Loader-DUaFpDGv.mjs";
|
|
20
|
-
import { A as P } from "./WidgetContainer-
|
|
20
|
+
import { A as P } from "./WidgetContainer-DJA1bxLn.mjs";
|
|
21
21
|
import ne from "@mui/material/Paper";
|
|
22
22
|
import ce from "@mui/material/Button";
|
|
23
23
|
import je from "@mui/material/FormGroup";
|
|
@@ -27,17 +27,17 @@ import qe from "@mui/material/ToggleButton";
|
|
|
27
27
|
import ve from "@mui/material/styles/useTheme";
|
|
28
28
|
import z from "@mui/material/Avatar";
|
|
29
29
|
import F from "@mui/material/ListItem";
|
|
30
|
-
import {
|
|
30
|
+
import { D as V, f as Ee, a as Oe } from "./Dialog-BPTr3qHE.mjs";
|
|
31
31
|
import U from "@mui/material/ListItemButton";
|
|
32
32
|
import X from "@mui/material/ListItemIcon";
|
|
33
|
-
import { a as we } from "./CategorySelectorDrawer-
|
|
33
|
+
import { a as we } from "./CategorySelectorDrawer-DomNyubP.mjs";
|
|
34
34
|
import { b as se } from "./Localization-2MODESHW.mjs";
|
|
35
35
|
import { getUnixTime as Ze } from "date-fns/getUnixTime";
|
|
36
|
-
import { D as de } from "./Drawer-
|
|
36
|
+
import { D as de } from "./Drawer-BEtCk82g.mjs";
|
|
37
37
|
import ye from "@mui/material/InputAdornment";
|
|
38
38
|
import Je from "@mui/material/Checkbox";
|
|
39
39
|
import ge from "@mui/material/Grid";
|
|
40
|
-
import { C as Qe } from "./CurrencyInput-
|
|
40
|
+
import { C as Qe } from "./CurrencyInput-CC5cwVit.mjs";
|
|
41
41
|
import et from "@mui/material/Switch";
|
|
42
42
|
var q = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(q || {}), re = /* @__PURE__ */ ((t) => (t[t.SplitTransaction = 0] = "SplitTransaction", t[t.HideTransaction = 1] = "HideTransaction", t[t.MerchantLogo = 2] = "MerchantLogo", t))(re || {});
|
|
43
43
|
const tt = [
|
|
@@ -1329,9 +1329,12 @@ export {
|
|
|
1329
1329
|
bt as M,
|
|
1330
1330
|
lt as S,
|
|
1331
1331
|
Ra as T,
|
|
1332
|
+
dt as Z,
|
|
1332
1333
|
ka as a,
|
|
1333
1334
|
st as b,
|
|
1334
1335
|
Kt as c,
|
|
1335
1336
|
q as d,
|
|
1337
|
+
_t as h,
|
|
1338
|
+
Se as s,
|
|
1336
1339
|
G as u
|
|
1337
1340
|
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import P from "@mui/material/Box";
|
|
3
|
+
import U from "@mui/material/FormControlLabel";
|
|
4
|
+
import K from "@mui/material/Radio";
|
|
5
|
+
import V from "@mui/material/styles/useTheme";
|
|
6
|
+
import v from "@mui/material/Tooltip";
|
|
7
7
|
import { makeAutoObservable as y, runInAction as d } from "mobx";
|
|
8
8
|
import { endOfToday as D } from "date-fns/endOfToday";
|
|
9
|
-
import { formatISO as
|
|
10
|
-
import { fromUnixTime as
|
|
11
|
-
import { getUnixTime as
|
|
12
|
-
import { isBefore as
|
|
9
|
+
import { formatISO as B } from "date-fns/formatISO";
|
|
10
|
+
import { fromUnixTime as h } from "date-fns/fromUnixTime";
|
|
11
|
+
import { getUnixTime as u } from "date-fns/getUnixTime";
|
|
12
|
+
import { isBefore as Y } from "date-fns/isBefore";
|
|
13
13
|
import { startOfMonth as R } from "date-fns/startOfMonth";
|
|
14
|
-
import { startOfToday as
|
|
15
|
-
import { subDays as
|
|
16
|
-
import { O as n, a as
|
|
14
|
+
import { startOfToday as b } from "date-fns/startOfToday";
|
|
15
|
+
import { subDays as F } from "date-fns/subDays";
|
|
16
|
+
import { O as n, a as G, T as w } from "./User-BthIKO4w.mjs";
|
|
17
17
|
import { T as p } from "./TransactionApi-B3Tksf7L.mjs";
|
|
18
18
|
import { b as W } from "./Category-CevNQ03n.mjs";
|
|
19
|
-
import { f as z } from "./exportTransactionsToCSV-
|
|
19
|
+
import { f as z } from "./exportTransactionsToCSV-XqdHNe2V.mjs";
|
|
20
20
|
import { format as k } from "date-fns/format";
|
|
21
|
-
import { f as g,
|
|
21
|
+
import { f as g, a as O, O as $ } from "./Dialog-BPTr3qHE.mjs";
|
|
22
22
|
import { endOfMonth as X } from "date-fns/endOfMonth";
|
|
23
23
|
import { B as f } from "./BeatApi-DhJpgCLz.mjs";
|
|
24
24
|
const j = ({
|
|
25
|
-
checked:
|
|
25
|
+
checked: S = !1,
|
|
26
26
|
label: t,
|
|
27
27
|
sx: a = {},
|
|
28
28
|
tooltip: e = "",
|
|
29
|
-
value:
|
|
29
|
+
value: c
|
|
30
30
|
}) => {
|
|
31
|
-
const _ =
|
|
31
|
+
const _ = V(), i = _.palette.mode === "light" ? _.palette.grey[400] : _.palette.grey[700], A = S ? _.palette.action.active : i;
|
|
32
32
|
return /* @__PURE__ */ C(
|
|
33
|
-
|
|
33
|
+
P,
|
|
34
34
|
{
|
|
35
35
|
bgcolor: "background.paper",
|
|
36
|
-
border: `${
|
|
37
|
-
borderColor:
|
|
36
|
+
border: `${S ? 3 : 1}px solid`,
|
|
37
|
+
borderColor: A,
|
|
38
38
|
borderRadius: 2,
|
|
39
39
|
mt: -2,
|
|
40
40
|
mx: 8,
|
|
41
41
|
pr: 8,
|
|
42
42
|
py: 4,
|
|
43
43
|
sx: { "&:hover": { borderColor: _.palette.action.active }, ...a },
|
|
44
|
-
children: /* @__PURE__ */ C(
|
|
45
|
-
|
|
44
|
+
children: /* @__PURE__ */ C(v, { title: e, children: /* @__PURE__ */ C(
|
|
45
|
+
U,
|
|
46
46
|
{
|
|
47
47
|
control: /* @__PURE__ */ C(
|
|
48
|
-
|
|
48
|
+
K,
|
|
49
49
|
{
|
|
50
50
|
disableRipple: !0,
|
|
51
51
|
sx: { "&.Mui-checked": { color: _.palette.action.active } }
|
|
@@ -54,12 +54,12 @@ const j = ({
|
|
|
54
54
|
label: t,
|
|
55
55
|
labelPlacement: "start",
|
|
56
56
|
sx: { ml: 0, pl: 8 },
|
|
57
|
-
value:
|
|
57
|
+
value: c
|
|
58
58
|
}
|
|
59
59
|
) })
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
}, ft = j,
|
|
62
|
+
}, ft = j, x = {
|
|
63
63
|
ASC: "ASC",
|
|
64
64
|
DESC: "DESC",
|
|
65
65
|
DIRECTION: {
|
|
@@ -322,73 +322,73 @@ const j = ({
|
|
|
322
322
|
category: o.TRANSACTIONS_WIDGET,
|
|
323
323
|
label: r.DELETE_TRANSACTION
|
|
324
324
|
}
|
|
325
|
-
}, Z = async (
|
|
325
|
+
}, Z = async (S, t) => !t || !m[S] ? null : t.sendAnalyticEvent(m[S]), L = {
|
|
326
326
|
FLAG: "flag",
|
|
327
327
|
DATE: "date",
|
|
328
328
|
PAYEE: "payee",
|
|
329
329
|
CATEGORY: "category",
|
|
330
330
|
ACCOUNT: "account",
|
|
331
331
|
AMOUNT: "amount"
|
|
332
|
-
}, q = (
|
|
333
|
-
const
|
|
332
|
+
}, q = (S, t, a, e = []) => {
|
|
333
|
+
const c = t.reduce((A, s) => ({ ...A, [s.guid]: s }), {}), _ = a.reduce((A, s) => ({ ...A, [s.guid]: s }), {}), i = e.reduce((A, s) => {
|
|
334
334
|
const { transaction_guid: l, tag_guid: I } = s;
|
|
335
|
-
if (!
|
|
335
|
+
if (!A[l])
|
|
336
336
|
return {
|
|
337
|
-
...
|
|
337
|
+
...A,
|
|
338
338
|
[l]: [I]
|
|
339
339
|
};
|
|
340
|
-
const E = [...
|
|
340
|
+
const E = [...A[l], I];
|
|
341
341
|
return {
|
|
342
|
-
...
|
|
342
|
+
...A,
|
|
343
343
|
[l]: E
|
|
344
344
|
};
|
|
345
345
|
}, {});
|
|
346
|
-
return
|
|
347
|
-
const s = A
|
|
346
|
+
return S.map((A) => {
|
|
347
|
+
const s = c[A.account_guid], l = A.category_guid ? _[A.category_guid] : null, I = i[A.guid] ?? [];
|
|
348
348
|
return {
|
|
349
|
-
...
|
|
349
|
+
...A,
|
|
350
350
|
account: s?.user_name || "Unknown",
|
|
351
351
|
accountIsClosed: s?.is_closed,
|
|
352
352
|
accountIsHidden: s?.is_hidden,
|
|
353
353
|
category: l?.name || "Uncategorized",
|
|
354
|
-
isIncome:
|
|
355
|
-
isPending:
|
|
354
|
+
isIncome: A.top_level_category_guid === W.INCOME,
|
|
355
|
+
isPending: A.feed_status === G.PENDING,
|
|
356
356
|
number: s?.account_number || "",
|
|
357
|
-
payee:
|
|
357
|
+
payee: A.description,
|
|
358
358
|
tags: I
|
|
359
359
|
};
|
|
360
360
|
});
|
|
361
|
-
}, J = "uncategorized", Q = (
|
|
362
|
-
const i = tt(
|
|
361
|
+
}, J = "uncategorized", Q = (S, t, a, e, c, _) => {
|
|
362
|
+
const i = tt(S, c, _), A = at(i, a, e);
|
|
363
363
|
return t.forEach((s) => {
|
|
364
|
-
const l =
|
|
365
|
-
|
|
366
|
-
}),
|
|
367
|
-
}, tt = (
|
|
364
|
+
const l = A.findIndex((E) => E.guid === s), I = _.filter((E) => E.parent_guid === s);
|
|
365
|
+
A.splice(l + 1, 0, ...I);
|
|
366
|
+
}), A;
|
|
367
|
+
}, tt = (S, t, a) => {
|
|
368
368
|
const {
|
|
369
369
|
accounts: e = [],
|
|
370
|
-
dateRange:
|
|
370
|
+
dateRange: c = { start: R(b()), end: D() },
|
|
371
371
|
custom: _ = () => !0,
|
|
372
372
|
searchTerm: i = "",
|
|
373
|
-
showSplits:
|
|
374
|
-
} =
|
|
375
|
-
return a.filter((s) =>
|
|
373
|
+
showSplits: A = !1
|
|
374
|
+
} = S;
|
|
375
|
+
return a.filter((s) => A ? !s.has_been_split : !s.parent_guid).filter((s) => !!e.find((l) => l === s.account_guid)).filter((s) => s.date >= u(c.start) && s.date <= u(c.end)).filter(_).filter((s) => {
|
|
376
376
|
if (i === J && s.has_been_split)
|
|
377
377
|
return !1;
|
|
378
378
|
if (/^spl/i.test(i) && (s.has_been_split || s.parent_guid))
|
|
379
379
|
return !0;
|
|
380
380
|
const I = s.tags.some(
|
|
381
|
-
(
|
|
382
|
-
), E =
|
|
383
|
-
return
|
|
381
|
+
(M) => N(i, t.find((H) => H.guid === M)?.name)
|
|
382
|
+
), E = h(s.date);
|
|
383
|
+
return N(i, s.payee) || N(i, s.feed_description) || N(i, s.category) || N(i, g(E, O.MONTH)) || N(i, g(E, O.DAY)) || N(i, g(E, O.FULL_MONTH_DAY)) || N(i, g(E, O.MONTH_DAY_YEAR)) || N(i, k(E, $)) || N(i, s.account) || N(i, `${s.amount}`) || N(i, s.memo) || I;
|
|
384
384
|
});
|
|
385
|
-
}, at = (
|
|
386
|
-
const _ = t, i = (e[_] || "") > (
|
|
387
|
-
let
|
|
388
|
-
return (t === L.DATE || t === L.AMOUNT) && (
|
|
389
|
-
}),
|
|
390
|
-
const a =
|
|
391
|
-
return a.every((
|
|
385
|
+
}, at = (S, t, a) => [...S].sort((e, c) => {
|
|
386
|
+
const _ = t, i = (e[_] || "") > (c[_] || "");
|
|
387
|
+
let A = i ? -1 : 1, s = i ? 1 : -1;
|
|
388
|
+
return (t === L.DATE || t === L.AMOUNT) && (A = i ? 1 : -1, s = i ? -1 : 1), a === x.ASC ? A : s;
|
|
389
|
+
}), N = (S, t) => {
|
|
390
|
+
const a = S.toLowerCase().split(" "), e = t?.toString().toLowerCase() ?? "";
|
|
391
|
+
return a.every((c) => e.indexOf(c) > -1);
|
|
392
392
|
}, et = {
|
|
393
393
|
account_guid: "",
|
|
394
394
|
amount: 0,
|
|
@@ -397,7 +397,7 @@ const j = ({
|
|
|
397
397
|
description: "",
|
|
398
398
|
duplicate: !1,
|
|
399
399
|
feed_description: "",
|
|
400
|
-
feed_status:
|
|
400
|
+
feed_status: G.POSTED,
|
|
401
401
|
feed_transaction_date: 0,
|
|
402
402
|
has_been_split: !1,
|
|
403
403
|
has_been_viewed: !1,
|
|
@@ -410,7 +410,7 @@ const j = ({
|
|
|
410
410
|
is_subscription: !1,
|
|
411
411
|
is_void: !1,
|
|
412
412
|
revision: 1,
|
|
413
|
-
transaction_type:
|
|
413
|
+
transaction_type: w.DEBIT,
|
|
414
414
|
user_guid: "",
|
|
415
415
|
is_duplicate: !1,
|
|
416
416
|
feed_transacted_at: 0,
|
|
@@ -449,7 +449,7 @@ class it {
|
|
|
449
449
|
this.height = t, this.width = a;
|
|
450
450
|
};
|
|
451
451
|
toggleSplit = (t) => {
|
|
452
|
-
const a = [...this.expandedSplits], e = this.expandedSplits.findIndex((
|
|
452
|
+
const a = [...this.expandedSplits], e = this.expandedSplits.findIndex((c) => c === t);
|
|
453
453
|
e >= 0 ? a.splice(e, 1) : a.push(t), this.expandedSplits = a;
|
|
454
454
|
};
|
|
455
455
|
clearExpandedSplits = () => {
|
|
@@ -465,12 +465,12 @@ class mt {
|
|
|
465
465
|
api = new p("/", "");
|
|
466
466
|
beatApi = new f("/", "");
|
|
467
467
|
associatedBeats = [];
|
|
468
|
-
cachedStartDate =
|
|
468
|
+
cachedStartDate = F(b(), 90);
|
|
469
469
|
filter = {};
|
|
470
470
|
isLoading = !0;
|
|
471
471
|
rawTransactions = [];
|
|
472
472
|
sortColumn = L.DATE;
|
|
473
|
-
sortDirection =
|
|
473
|
+
sortDirection = x.DESC;
|
|
474
474
|
taggings = [];
|
|
475
475
|
tags = [];
|
|
476
476
|
transactionRules = [];
|
|
@@ -525,7 +525,7 @@ class mt {
|
|
|
525
525
|
};
|
|
526
526
|
addOrUpdateTransactionRule = async (t, a) => {
|
|
527
527
|
const e = this.transactionRules.find(
|
|
528
|
-
(
|
|
528
|
+
(c) => c.guid === a.user_transaction_rule_guid
|
|
529
529
|
);
|
|
530
530
|
e ? await this.api.updateTransactionRule({
|
|
531
531
|
...e,
|
|
@@ -539,7 +539,11 @@ class mt {
|
|
|
539
539
|
};
|
|
540
540
|
addTransaction = async (t) => {
|
|
541
541
|
const a = await this.api.addTransaction(t);
|
|
542
|
-
|
|
542
|
+
if (a) {
|
|
543
|
+
d(() => this.rawTransactions = [a, ...this.transactions]);
|
|
544
|
+
const e = a.transaction_type === w.CREDIT ? a.amount : -a.amount;
|
|
545
|
+
this.globalStore.accountStore.updateAccountBalance(a.account_guid, e);
|
|
546
|
+
}
|
|
543
547
|
};
|
|
544
548
|
augmentTransactions = (t) => q(
|
|
545
549
|
t,
|
|
@@ -549,8 +553,8 @@ class mt {
|
|
|
549
553
|
);
|
|
550
554
|
getTransactionData = () => ({});
|
|
551
555
|
loadAssociatedBeats = async (t, a) => {
|
|
552
|
-
const e = t ?
|
|
553
|
-
d(() => this.associatedBeats =
|
|
556
|
+
const e = t ? B(t, { representation: "date" }) : void 0, c = a ?? await this.beatApi.getBeatsWithAssociatedTransaction(e);
|
|
557
|
+
d(() => this.associatedBeats = c);
|
|
554
558
|
};
|
|
555
559
|
loadTags = async () => {
|
|
556
560
|
const t = await this.api.getTags();
|
|
@@ -567,12 +571,12 @@ class mt {
|
|
|
567
571
|
loadTransactions = async (t = this.cachedStartDate, a = D(), e) => {
|
|
568
572
|
this.setIsLoading(!0), this.rawTransactions = [];
|
|
569
573
|
try {
|
|
570
|
-
const
|
|
574
|
+
const c = e ?? await this.api.getTransactionsByDateRange(u(t), u(a));
|
|
571
575
|
d(() => {
|
|
572
|
-
this.rawTransactions =
|
|
576
|
+
this.rawTransactions = c;
|
|
573
577
|
});
|
|
574
|
-
} catch (
|
|
575
|
-
console.error(`Error occurred while loading transactions: ${
|
|
578
|
+
} catch (c) {
|
|
579
|
+
console.error(`Error occurred while loading transactions: ${c}`);
|
|
576
580
|
}
|
|
577
581
|
this.setIsLoading(!1);
|
|
578
582
|
};
|
|
@@ -580,7 +584,7 @@ class mt {
|
|
|
580
584
|
loadTransactionsByDateRange = async (t, a) => {
|
|
581
585
|
console.warn("DEPRECATED: loadTransactionsByDateRange will be removed"), this.setFilter({
|
|
582
586
|
...this.filter,
|
|
583
|
-
dateRange: { start:
|
|
587
|
+
dateRange: { start: h(a), end: h(t) }
|
|
584
588
|
});
|
|
585
589
|
};
|
|
586
590
|
modifyTransactionByAccountGuid = (t, a) => {
|
|
@@ -603,7 +607,7 @@ class mt {
|
|
|
603
607
|
}
|
|
604
608
|
};
|
|
605
609
|
setFilter = (t) => {
|
|
606
|
-
this.filter = t, t.dateRange &&
|
|
610
|
+
this.filter = t, t.dateRange && Y(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start, D()).then(() => {
|
|
607
611
|
t.dateRange && (this.cachedStartDate = t.dateRange.start);
|
|
608
612
|
});
|
|
609
613
|
};
|
|
@@ -612,10 +616,10 @@ class mt {
|
|
|
612
616
|
this.sortColumn = t, this.sortDirection = a;
|
|
613
617
|
};
|
|
614
618
|
splitTransaction = async (t, a) => {
|
|
615
|
-
const e = await this.api.updateTransaction(t),
|
|
619
|
+
const e = await this.api.updateTransaction(t), c = [];
|
|
616
620
|
for (let i = 0; i < a.length; i++) {
|
|
617
|
-
const
|
|
618
|
-
|
|
621
|
+
const A = await this.api.addTransaction(a[i]);
|
|
622
|
+
c.push(A);
|
|
619
623
|
}
|
|
620
624
|
const _ = this.transactions.findIndex((i) => i.guid === t.guid);
|
|
621
625
|
_ >= 0 && d(
|
|
@@ -623,7 +627,7 @@ class mt {
|
|
|
623
627
|
...this.transactions.slice(0, _),
|
|
624
628
|
e,
|
|
625
629
|
...this.transactions.slice(_ + 1),
|
|
626
|
-
...
|
|
630
|
+
...c
|
|
627
631
|
]
|
|
628
632
|
);
|
|
629
633
|
};
|
|
@@ -632,22 +636,22 @@ class mt {
|
|
|
632
636
|
await this.api.removeTransactionSplit(t);
|
|
633
637
|
const e = [...this.transactions];
|
|
634
638
|
a.forEach((i) => {
|
|
635
|
-
const
|
|
636
|
-
|
|
639
|
+
const A = e.findIndex((s) => s.guid === i.guid);
|
|
640
|
+
A >= 0 && e.splice(A, 1);
|
|
637
641
|
});
|
|
638
|
-
const
|
|
639
|
-
_.has_been_split = !1,
|
|
642
|
+
const c = e.findIndex((i) => i.guid === t), _ = e[c];
|
|
643
|
+
_.has_been_split = !1, c >= 0 && d(
|
|
640
644
|
() => this.rawTransactions = [
|
|
641
|
-
...e.slice(0,
|
|
645
|
+
...e.slice(0, c),
|
|
642
646
|
_,
|
|
643
|
-
...e.slice(
|
|
647
|
+
...e.slice(c + 1)
|
|
644
648
|
]
|
|
645
649
|
);
|
|
646
650
|
};
|
|
647
651
|
updateTaggings = async (t, a) => {
|
|
648
|
-
const e = this.taggings.filter((i) => i.transaction_guid === a),
|
|
652
|
+
const e = this.taggings.filter((i) => i.transaction_guid === a), c = new Set(e.map((i) => i.tag_guid)), _ = new Set(t);
|
|
649
653
|
for (const i of t)
|
|
650
|
-
|
|
654
|
+
c.has(i) || await this.addTagging(i, a);
|
|
651
655
|
for (const i of e)
|
|
652
656
|
_.has(i.tag_guid) || await this.removeTagging(i.guid);
|
|
653
657
|
await this.loadTaggings();
|
|
@@ -656,7 +660,7 @@ class mt {
|
|
|
656
660
|
await this.api.updateTag(t), await this.loadTags();
|
|
657
661
|
};
|
|
658
662
|
updateTransaction = async (t) => {
|
|
659
|
-
const a = await this.api.updateTransaction(t), e = this.transactions.findIndex((
|
|
663
|
+
const a = await this.api.updateTransaction(t), e = this.transactions.findIndex((c) => c.guid === t.guid);
|
|
660
664
|
e >= 0 && d(
|
|
661
665
|
() => this.rawTransactions = [
|
|
662
666
|
...this.transactions.slice(0, e),
|