@mx-cartographer/experiences 6.26.18-alpha.mega4 → 6.26.18-alpha.sms1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/common/context/hooks.d.ts +13 -13
  2. package/dist/help/components/content/section/index.d.ts +15 -15
  3. package/dist/index.d.ts +22 -0
  4. package/dist/index.es.js +30335 -0
  5. package/dist/index.es.js.map +1 -0
  6. package/package.json +3 -155
  7. package/dist/Account-DM32_5k9.mjs +0 -30
  8. package/dist/AccountDetailsContent-B_qRSB8l.mjs +0 -677
  9. package/dist/AccountDetailsHeader-CAm6ADMq.mjs +0 -119
  10. package/dist/AccountFields-Bb4pds0q.mjs +0 -135
  11. package/dist/AccountListItem-G7iAesaO.mjs +0 -90
  12. package/dist/AccountStore-RSanus_m.mjs +0 -230
  13. package/dist/Accounts-BfAQRG8R.mjs +0 -9
  14. package/dist/BeatApi-DLu87ijw.mjs +0 -21
  15. package/dist/BeatStore-By4aGoRM.mjs +0 -81
  16. package/dist/BudgetUtil-DcqclhiQ.mjs +0 -101
  17. package/dist/CashflowStore-D9Dpuz7X.mjs +0 -91
  18. package/dist/Category-5S6uwuXz.mjs +0 -301
  19. package/dist/CategorySelectorDrawer-DgrePTRg.mjs +0 -397
  20. package/dist/CategoryStore-B5EW6I1d.mjs +0 -183
  21. package/dist/CategoryUtil-DRyruNgi.mjs +0 -78
  22. package/dist/ConnectDrawer-DPnfeIfn.mjs +0 -508
  23. package/dist/ConnectionsDrawer-BCzpuNsK.mjs +0 -52
  24. package/dist/CurrencyInput-DzsPiUsU.mjs +0 -83
  25. package/dist/CurrencyText-YUhH2caW.mjs +0 -20
  26. package/dist/DateUtil-BcuH7ErC.mjs +0 -48
  27. package/dist/DebtsStore-C6VcBnpG.mjs +0 -60
  28. package/dist/Dialog-CWW597AF.mjs +0 -123
  29. package/dist/Donut-1UMNcG67.mjs +0 -57
  30. package/dist/Drawer-kEE73B87.mjs +0 -113
  31. package/dist/EmptyState-Dcb-o2tl.mjs +0 -55
  32. package/dist/Fetch-CkFKy79O.mjs +0 -116
  33. package/dist/FinstrongStore-mkALvztw.mjs +0 -101
  34. package/dist/GoalStore-DyCr4wNc.mjs +0 -263
  35. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  36. package/dist/Help-DhcC-C05.mjs +0 -320
  37. package/dist/Help-toqAK5eD.mjs +0 -3173
  38. package/dist/IconBacking-B9oC6uL2.mjs +0 -39
  39. package/dist/InvestmentUtil-jOyOgzIB.mjs +0 -134
  40. package/dist/LineChart-CQWu5KoO.mjs +0 -403
  41. package/dist/ListItemAction-Df3OPMOW.mjs +0 -69
  42. package/dist/Loader-Dp1P2gNw.mjs +0 -14
  43. package/dist/Localization-2MODESHW.mjs +0 -30
  44. package/dist/ManageIncome-BVt_XQbo.mjs +0 -535
  45. package/dist/MerchantStore-DVH-QOf0.mjs +0 -37
  46. package/dist/MicroWidgetContainer-DaLW43tE.mjs +0 -45
  47. package/dist/MiniWidgetContainer-BcNPxZt2.mjs +0 -39
  48. package/dist/NetWorthStore-DE8CQBMM.mjs +0 -150
  49. package/dist/Notification-AMGWM1Al.mjs +0 -78
  50. package/dist/NotificationSettings-CPZN0l8X.mjs +0 -667
  51. package/dist/NotificationStore-DHtSGySy.mjs +0 -67
  52. package/dist/NumberFormatting-CtWHhyBX.mjs +0 -40
  53. package/dist/OriginalBalanceAction-s9sUxofR.mjs +0 -115
  54. package/dist/RecurringSettings-DIEsympT.mjs +0 -57
  55. package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +0 -263
  56. package/dist/RepeatingTransaction-BPWfaB3f.mjs +0 -282
  57. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  58. package/dist/SettingsStore-CE7jDVFL.mjs +0 -265
  59. package/dist/SingleSegmentDonut-BgbLgwHi.mjs +0 -69
  60. package/dist/SpendingData-ByFCw95X.mjs +0 -53
  61. package/dist/StatusBar-BK_uYHAB.mjs +0 -30
  62. package/dist/TabContentContainer-j01JYR_7.mjs +0 -21
  63. package/dist/Transaction-C-5-Iuab.mjs +0 -312
  64. package/dist/TransactionApi-DbbcjI2L.mjs +0 -86
  65. package/dist/TransactionDetails-B5qfs9Zh.mjs +0 -1283
  66. package/dist/TransactionStore-BWi6_2Ny.mjs +0 -669
  67. package/dist/TrendsStore-Borh98aN.mjs +0 -448
  68. package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +0 -1959
  69. package/dist/WidgetContainer-CmGNZW0M.mjs +0 -548
  70. package/dist/accounts/index.es.js +0 -752
  71. package/dist/analytics/index.es.js +0 -171
  72. package/dist/budgets/index.es.js +0 -1070
  73. package/dist/cashflow/index.es.js +0 -1098
  74. package/dist/categories/index.es.js +0 -9
  75. package/dist/common/index.es.js +0 -1451
  76. package/dist/dashboard/index.es.js +0 -181
  77. package/dist/debts/index.es.js +0 -1460
  78. package/dist/exportTransactionsToCSV-j4g8bdVZ.mjs +0 -47
  79. package/dist/finstrong/index.es.js +0 -1455
  80. package/dist/goals/index.es.js +0 -1209
  81. package/dist/help/index.es.js +0 -14
  82. package/dist/hooks-ClhFlg78.mjs +0 -71
  83. package/dist/insights/index.d.ts +0 -1
  84. package/dist/insights/index.es.js +0 -4
  85. package/dist/investments/index.es.js +0 -1638
  86. package/dist/merchants/index.es.js +0 -79
  87. package/dist/microinsights/index.es.js +0 -16
  88. package/dist/networth/index.es.js +0 -542
  89. package/dist/notifications/index.es.js +0 -192
  90. package/dist/recurringtransactions/index.es.js +0 -879
  91. package/dist/settings/index.es.js +0 -879
  92. package/dist/spending/index.es.js +0 -570
  93. package/dist/transactions/index.es.js +0 -587
  94. package/dist/trends/index.es.js +0 -1103
  95. package/dist/useCombineEvents-DaDBSR_1.mjs +0 -92
  96. package/dist/useDimensions-27p2evRx.mjs +0 -36
  97. package/dist/useScreenSize-B6JyS_Lj.mjs +0 -36
@@ -1,1283 +0,0 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import d from "react";
3
- import { observer as b } from "mobx-react-lite";
4
- import { useVirtualizer as ve } from "@tanstack/react-virtual";
5
- import E from "@mui/material/Box";
6
- import te from "@mui/material/Divider";
7
- import ne from "@mui/material/List";
8
- import { MerchantLogo as me, Icon as f, Text as T, useTokens as Z, CategoryIcon as ye, CategoryIconVariants as we, IconWeight as k, P as oe, H1 as Ce, TextField as pe } from "@mxenabled/mxui";
9
- import F from "@mui/material/ListItemAvatar";
10
- import K from "@mui/material/ListItemText";
11
- import C from "@mui/material/Stack";
12
- import { T as Le, L as Re, O as g, C as ke, b as Pe } from "./Transaction-C-5-Iuab.mjs";
13
- import { G as Ge, n as v, u as N, g as w, k as fe, a as Me } from "./hooks-ClhFlg78.mjs";
14
- import { f as J } from "./NumberFormatting-CtWHhyBX.mjs";
15
- import Ke from "@mui/icons-material/ReceiptOutlined";
16
- import { fromUnixTime as W } from "date-fns/fromUnixTime";
17
- import { isSameDay as be } from "date-fns/isSameDay";
18
- import { h as $e } from "./DateUtil-BcuH7ErC.mjs";
19
- import { L as Ae } from "./Loader-Dp1P2gNw.mjs";
20
- import { A as G } from "./WidgetContainer-CmGNZW0M.mjs";
21
- import Q from "@mui/material/Paper";
22
- import ie from "@mui/material/Button";
23
- import Fe from "@mui/material/FormGroup";
24
- import q from "@mui/material/IconButton";
25
- import Ie from "@mui/material/TextField";
26
- import He from "@mui/icons-material/FlagOutlined";
27
- import ze from "@mui/material/ToggleButton";
28
- import Ne from "@mui/material/styles/useTheme";
29
- import X from "@mui/material/Avatar";
30
- import H from "@mui/material/ListItem";
31
- import z from "@mui/material/ListItemButton";
32
- import B from "@mui/material/ListItemIcon";
33
- import { a as xe } from "./CategorySelectorDrawer-DgrePTRg.mjs";
34
- import { a as U, f as Be, D as Ue } from "./Dialog-CWW597AF.mjs";
35
- import { b as ae } from "./Localization-2MODESHW.mjs";
36
- import { getUnixTime as Xe } from "date-fns/getUnixTime";
37
- import { D as se } from "./Drawer-kEE73B87.mjs";
38
- import Ve from "@mui/icons-material/HighlightOff";
39
- import We from "@mui/icons-material/Search";
40
- import ge from "@mui/material/InputAdornment";
41
- import re from "@mui/icons-material/DeleteOutlined";
42
- import Ye from "@mui/icons-material/Edit";
43
- import je from "@mui/material/Checkbox";
44
- import ue from "@mui/icons-material/Cancel";
45
- import _e from "@mui/material/Grid";
46
- import qe from "@mui/icons-material/ChevronRight";
47
- import { C as Ze } from "./CurrencyInput-DzsPiUsU.mjs";
48
- import Je from "@mui/material/Switch";
49
- var j = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(j || {}), ee = /* @__PURE__ */ ((t) => (t[t.SplitTransaction = 0] = "SplitTransaction", t[t.HideTransaction = 1] = "HideTransaction", t[t.MerchantLogo = 2] = "MerchantLogo", t))(ee || {});
50
- const Qe = [
51
- 0,
52
- 1,
53
- 2,
54
- 3
55
- /* Tags */
56
- ], et = [
57
- 0,
58
- 1,
59
- 2
60
- /* MerchantLogo */
61
- ], M = () => {
62
- if (!d.useContext(Ge))
63
- throw new Error("useTransactionsUiStore() must be used within the GlobalDataContext");
64
- return v().uiStore;
65
- };
66
- function tt() {
67
- return window.opener && window.opener.location ? window.opener.location.toString() : document.referrer;
68
- }
69
- function nt(t) {
70
- const o = tt().replace(/([^:]+:\/\/[^\/]+).*/, "$1"), n = window.parent || window.opener || !1;
71
- return n && n.postMessage && o ? (n.postMessage(t, o), !0) : !1;
72
- }
73
- function at(t) {
74
- return nt({
75
- metadata: { beat_guid: t },
76
- mx: !0,
77
- type: "mx/moneyDashboard/insightOnTransaction"
78
- });
79
- }
80
- const rt = ({ transaction: t, onClick: o }) => {
81
- const { associatedBeats: n } = v(), { expandedSplits: s } = M(), { transactions: r } = N(), { showInsights: a } = M(), i = t.transaction_type === Le.CREDIT, l = d.useMemo(() => n.find((_) => _.associated_transaction_guid === t.guid), [n, t]);
82
- return (
83
- //TODO: implement common/components/ListItemRow.tsx
84
- /* @__PURE__ */ c(
85
- Re,
86
- {
87
- clickEventName: g.ON_TRANSACTION_LIST_ITEM_CLICK,
88
- onClick: o ? () => o(t.guid) : void 0,
89
- children: [
90
- /* @__PURE__ */ e(F, { children: t.parent_guid && s.includes(t.parent_guid) ? /* @__PURE__ */ e(d.Fragment, {}) : /* @__PURE__ */ e(
91
- me,
92
- {
93
- categoryGuid: t.top_level_category_guid || "",
94
- merchantGuid: t.merchant_guid || ""
95
- }
96
- ) }),
97
- /* @__PURE__ */ e(
98
- K,
99
- {
100
- disableTypography: !0,
101
- secondary: /* @__PURE__ */ c(C, { direction: "row", justifyContent: "space-between", children: [
102
- /* @__PURE__ */ c(C, { alignItems: "center", direction: "row", gap: 4, children: [
103
- t.is_flagged && /* @__PURE__ */ e(f, { fill: !0, name: "flag", size: 16, sx: { color: "warning.dark" } }),
104
- t.is_hidden && /* @__PURE__ */ e(f, { name: "visibility_off", size: 16 }),
105
- t.has_been_split && /* @__PURE__ */ e(f, { name: "call_split", size: 16 }),
106
- /* @__PURE__ */ e(T, { variant: "XSmall", children: t.has_been_split ? r.split_transaction_category_label : t.category })
107
- ] }),
108
- l && a && /* @__PURE__ */ e(
109
- T,
110
- {
111
- bold: !0,
112
- color: "action.active",
113
- onClick: (_) => {
114
- _.stopPropagation(), _.preventDefault(), at(l.guid);
115
- },
116
- variant: "XSmall",
117
- children: l.short_title
118
- }
119
- )
120
- ] }),
121
- children: /* @__PURE__ */ c(C, { direction: "row", justifyContent: "space-between", sx: { gap: 8 }, children: [
122
- /* @__PURE__ */ c(T, { bold: !0, variant: "Body", children: [
123
- t.is_hidden && r.hide_trnx_cancel_hidden_note,
124
- t.payee || t.description || t.feed_description
125
- ] }),
126
- /* @__PURE__ */ c(
127
- T,
128
- {
129
- bold: !0,
130
- color: i ? "success.main" : "text.primary",
131
- sx: { flexShrink: 0 },
132
- variant: "Body",
133
- children: [
134
- i ? "+" : "",
135
- J(t.amount, "0,0.00")
136
- ]
137
- }
138
- )
139
- ] })
140
- }
141
- )
142
- ]
143
- }
144
- )
145
- );
146
- }, ot = b(rt), it = ({
147
- bgcolor: t = "background.default",
148
- children: o
149
- }) => /* @__PURE__ */ e(E, { display: "inline-block", pb: 4, pl: 24, pt: 4, sx: { bgcolor: t, width: "100%" }, children: /* @__PURE__ */ e(T, { bold: !0, variant: "XSmall", children: o }) }), st = ({ showIcon: t = !0, showSubtitle: o = !0 }) => {
150
- const n = Z(), { transactions: s } = N();
151
- return /* @__PURE__ */ c(C, { alignItems: "center", gap: n.Spacing.Small, height: "auto", mt: n.Spacing.Large, children: [
152
- t && /* @__PURE__ */ e(Ke, { color: "secondary", sx: { fontSize: 32 } }),
153
- /* @__PURE__ */ e(T, { bold: !0, color: "secondary", variant: "Small", children: s.zero_state_no_transactions }),
154
- o && /* @__PURE__ */ e(T, { color: "secondary", variant: "XSmall", children: s.zero_state_there_are_no_transactions })
155
- ] });
156
- }, lt = b(st), he = (t, o) => {
157
- const n = W(o[t].date), s = W(o[t - 1]?.date);
158
- return !be(n, s);
159
- }, ct = (t, o) => {
160
- const n = W(o[t].date), s = W(o[t + 1]?.date);
161
- return be(n, s);
162
- }, Te = 65, Se = 34, dt = ({
163
- bgcolor: t,
164
- height: o = "calc(100dvh - 36px)",
165
- loader: n = /* @__PURE__ */ e(Ae, { label: "Loading", size: 40 }),
166
- onClick: s,
167
- showInsights: r = !1,
168
- showLoader: a = !1,
169
- showHiddenTransactions: i = !1,
170
- width: l = "100%",
171
- zeroState: _ = /* @__PURE__ */ e(lt, {})
172
- }) => {
173
- const { isLoading: u, sortedTransactions: p } = v(), m = d.useMemo(() => i ? p : p.filter((x) => !x.is_hidden), [p, i]), { clearExpandedSplits: S, setShowInsights: A, toggleSplit: h } = M(), { onEvent: I } = w(), y = (x) => {
174
- const P = m.find((V) => V.guid === x);
175
- if (P?.has_been_split) {
176
- h(P.guid);
177
- return;
178
- }
179
- I(G.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
180
- account_guid: P?.account_guid,
181
- transaction_guid: x
182
- }), s?.(x);
183
- }, L = d.useRef(null), R = ve({
184
- count: m.length,
185
- getScrollElement: () => L.current,
186
- estimateSize: (x) => Te + (he(x, m) ? Se : 0),
187
- overscan: 5
188
- });
189
- return d.useEffect(() => R.measure(), [m]), d.useEffect(() => A(r), [r]), d.useEffect(() => () => S(), []), /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(E, { height: o, overflow: "auto", ref: L, width: l, children: /* @__PURE__ */ c(
190
- E,
191
- {
192
- height: (
193
- // set the height to auto when there are no transactions so the zero state isn't set to 0
194
- R.getVirtualItems().length === 0 ? "auto" : R.getTotalSize()
195
- ),
196
- position: "relative",
197
- width: "100%",
198
- children: [
199
- (u || a) && n,
200
- !u && !a && R.getVirtualItems().length === 0 && _,
201
- !u && !a && R.getVirtualItems().length > 0 && R.getVirtualItems().map((x) => {
202
- const P = m[x.index], V = he(x.index, m), le = ct(x.index, m), ce = Te + (V ? Se : 0);
203
- return /* @__PURE__ */ c(
204
- E,
205
- {
206
- sx: {
207
- height: ce,
208
- position: "absolute",
209
- transform: `translateY(${x.start}px)`,
210
- width: "100%"
211
- },
212
- children: [
213
- V && /* @__PURE__ */ e(it, { bgcolor: t, children: $e(P.date) }),
214
- /* @__PURE__ */ e(ot, { onClick: y, transaction: P }),
215
- /* @__PURE__ */ e(te, { sx: { ml: le ? 24 : 0 } })
216
- ]
217
- },
218
- P.guid
219
- );
220
- })
221
- ]
222
- }
223
- ) }) });
224
- }, Mn = b(dt), _t = ({ transaction: t }) => {
225
- const { addOrUpdateTransactionRule: o, updateTransaction: n } = v(), { categories: s } = fe(), { onEvent: r } = w(), { setShouldDisableDrawerScroll: a, updateManualTransaction: i } = M(), { transactions: l } = N(), [_, u] = d.useState(!1), [p, m] = d.useState(""), S = async (y) => {
226
- await n({ ...t, category_guid: p }), y && await o(p, t), m(""), r(G.TRANSACTION_DETAILS_CLICK_CATEGORY, {
227
- transaction_guid: t.guid
228
- });
229
- }, A = (y) => {
230
- if (t.is_manual && !t.guid) {
231
- const L = s.find((R) => R.guid === y);
232
- i({
233
- ...t,
234
- category: L?.name,
235
- category_guid: y,
236
- top_level_category_guid: L?.parent_guid || y
237
- });
238
- } else
239
- m(y);
240
- h();
241
- }, h = () => {
242
- u(!1), a(!1);
243
- }, I = d.useMemo(
244
- () => s.find((y) => y.guid === p),
245
- [p]
246
- );
247
- return /* @__PURE__ */ c(d.Fragment, { children: [
248
- /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
249
- z,
250
- {
251
- onClick: () => {
252
- r(g.ON_TRANSACTION_CATEGORY_CLICK), u(!0);
253
- },
254
- children: [
255
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(
256
- ye,
257
- {
258
- categoryGuid: t.top_level_category_guid,
259
- size: 24,
260
- sx: { color: "text.primary" },
261
- variant: we.Transparent
262
- }
263
- ) }) }),
264
- /* @__PURE__ */ e(
265
- K,
266
- {
267
- primary: "Category",
268
- primaryTypographyProps: { variant: "XSmall" },
269
- secondary: /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.category ?? l.actions_select_a_category })
270
- }
271
- ),
272
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: k.Dark }) })
273
- ]
274
- }
275
- ) }),
276
- /* @__PURE__ */ e(
277
- xe,
278
- {
279
- initialSelected: t.category_guid,
280
- onClose: h,
281
- onSelect: A,
282
- showDrawer: _,
283
- title: l.actions_select_a_category
284
- }
285
- ),
286
- /* @__PURE__ */ e(
287
- U,
288
- {
289
- copy: {
290
- title: ae(
291
- l.actions_apply_to_all_transaction_types,
292
- t.description
293
- )
294
- },
295
- isOpen: !!p,
296
- onClose: () => m(""),
297
- onPrimaryAction: () => S(!0),
298
- onSecondaryAction: () => S(!1),
299
- primaryText: l.actions_apply_to_all,
300
- secondaryText: l.actions_this_time_only,
301
- children: /* @__PURE__ */ e(oe, { variant: "Paragraph", children: ae(
302
- l.actions_all_past_and_future,
303
- t.description,
304
- I?.name
305
- ) })
306
- }
307
- )
308
- ] });
309
- }, ut = ({ transaction: t }) => {
310
- const o = Z(), { onEvent: n } = w(), { updateTransaction: s } = v(), { updateManualTransaction: r } = M(), { common: a, transactions: i } = N(), [l, _] = d.useState(!1), [u, p] = d.useState(t.date), m = (A) => {
311
- p(Xe(A));
312
- }, S = async () => {
313
- if (t.is_manual && !t.guid) {
314
- r({ ...t, date: u }), _(!1);
315
- return;
316
- }
317
- await s({ ...t, date: u }), n(G.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), _(!1);
318
- };
319
- return /* @__PURE__ */ c(E, { className: "mx-txn-date-action", children: [
320
- /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
321
- z,
322
- {
323
- onClick: () => {
324
- n(g.ON_TRANSACTION_DATE_CLICK), _(!0);
325
- },
326
- children: [
327
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "calendar_month", sx: { color: "text.primary" }, weight: k.Dark }) }) }),
328
- /* @__PURE__ */ e(
329
- K,
330
- {
331
- primary: i.date_title,
332
- primaryTypographyProps: { variant: "XSmall" },
333
- secondary: /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: Be(W(t.date), Ue.YEAR_MONTH_DAY) })
334
- }
335
- ),
336
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: k.Dark }) })
337
- ]
338
- }
339
- ) }),
340
- /* @__PURE__ */ e(
341
- se,
342
- {
343
- ariaLabelClose: a.close_aria,
344
- isOpen: l,
345
- onClose: () => _(!1),
346
- onPrimaryAction: S,
347
- primaryText: a.save_button,
348
- secondaryText: a.cancel_button,
349
- title: i.date_edit_title,
350
- children: /* @__PURE__ */ e(C, { alignItems: "center", mt: o.Spacing.XXLarge, children: /* @__PURE__ */ e(
351
- ke,
352
- {
353
- beginDate: W(u),
354
- copy: {
355
- nextAria: i.date_next_aria,
356
- prevAria: i.date_prev_aria,
357
- today: a.date_range_picker.today
358
- },
359
- onDateSelected: m,
360
- selectionType: Pe.Single
361
- }
362
- ) })
363
- }
364
- )
365
- ] });
366
- }, mt = ({ transaction: t }) => {
367
- const { onEvent: o } = w(), { removeTransaction: n } = v(), { setShouldDisableDrawerScroll: s } = M(), { common: r, transactions: a } = N(), [i, l] = d.useState(!1), _ = async () => {
368
- await n(t.guid), o(g.ON_TRANSACTION_DELETE_DELETED);
369
- };
370
- return /* @__PURE__ */ c(E, { className: "mx-txn-delete", children: [
371
- t && /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
372
- z,
373
- {
374
- onClick: () => {
375
- o(g.ON_TRANSACTION_DELETE_CLICK), s(!0), l(!0);
376
- },
377
- children: [
378
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { variant: "rounded", children: /* @__PURE__ */ e(re, { color: "secondary", fontSize: "small" }) }) }),
379
- /* @__PURE__ */ e(
380
- K,
381
- {
382
- primary: a.manual_transaction_delete_title,
383
- secondary: a.manual_transaction_delete_subtitle
384
- }
385
- ),
386
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(re, {}) })
387
- ]
388
- }
389
- ) }),
390
- /* @__PURE__ */ e(
391
- U,
392
- {
393
- copy: { title: a.manual_transaction_delete_title },
394
- isOpen: i,
395
- onClose: () => {
396
- s(!1), l(!1);
397
- },
398
- onPrimaryAction: _,
399
- onSecondaryAction: () => o(g.ON_TRANSACTION_DELETE_CANCEL),
400
- primaryText: r.delete_button,
401
- secondaryText: r.cancel_button,
402
- children: /* @__PURE__ */ e(T, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: a.manual_transaction_delete_description })
403
- }
404
- )
405
- ] });
406
- }, pt = b(mt), gt = ({ transaction: t }) => {
407
- const { onEvent: o } = w(), { updateTransaction: n } = v(), { setShouldDisableDrawerScroll: s } = M(), { common: r, transactions: a } = N(), [i, l] = d.useState(!1), _ = async () => {
408
- await n({ ...t, merchant_guid: "" }), o(G.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
409
- transaction_guid: t.guid
410
- });
411
- };
412
- return /* @__PURE__ */ c(E, { className: "mx-txn-delete-logo", children: [
413
- t && /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
414
- z,
415
- {
416
- onClick: () => {
417
- o(g.ON_TRANSACTION_DELETE_LOGO_CLICK), l(!0);
418
- },
419
- children: [
420
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "delete", sx: { color: "text.primary" }, weight: k.Dark }) }) }),
421
- /* @__PURE__ */ e(K, { primary: a.merchant_logo_title, secondary: a.merchant_logo_desc }),
422
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: k.Dark }) })
423
- ]
424
- }
425
- ) }),
426
- /* @__PURE__ */ c(
427
- U,
428
- {
429
- copy: { title: a.merchant_logo_modal_title },
430
- isOpen: i,
431
- onClose: () => {
432
- s(!1), l(!1);
433
- },
434
- onPrimaryAction: _,
435
- onSecondaryAction: () => o(g.ON_TRANSACTION_DELETE_LOGO_CANCEL),
436
- primaryText: r.delete_button,
437
- secondaryText: r.cancel_button,
438
- title: a.merchant_logo_modal_title,
439
- children: [
440
- /* @__PURE__ */ e(T, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: a.merchant_logo_modal_desc }),
441
- /* @__PURE__ */ e(T, { bold: !0, sx: { whiteSpace: "normal" }, variant: "Paragraph", children: ` ${a.merchant_logo_modal_desc_bold}` })
442
- ]
443
- }
444
- )
445
- ] });
446
- }, ht = b(gt), Tt = ({ transaction: t }) => {
447
- const { onEvent: o } = w(), { updateTransaction: n } = v(), { setShouldDisableDrawerScroll: s } = M(), { common: r, transactions: a } = N(), [i, l] = d.useState(!1), _ = t.is_hidden, u = async () => {
448
- await n({ ...t, is_hidden: !t.is_hidden }), o(
449
- _ ? g.ON_TRANSACTION_UNHIDDEN : g.ON_TRANSACTION_HIDDEN
450
- );
451
- };
452
- return /* @__PURE__ */ c(E, { className: "mx-txn-hide-transaction", children: [
453
- t && /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
454
- z,
455
- {
456
- "aria-checked": _,
457
- onClick: () => {
458
- o(
459
- _ ? g.ON_TRANSACTION_UNHIDE_CLICK : g.ON_TRANSACTION_HIDE_CLICK
460
- ), o(
461
- _ ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
462
- {
463
- transaction_guid: t.guid
464
- }
465
- ), l(!0);
466
- },
467
- role: "switch",
468
- children: [
469
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { sx: { bgcolor: "border.light" }, variant: "rounded", children: _ ? /* @__PURE__ */ e(
470
- f,
471
- {
472
- name: "visibilityOff",
473
- sx: { color: "text.primary" },
474
- weight: k.Dark
475
- }
476
- ) : /* @__PURE__ */ e(f, { name: "visibility", sx: { color: "text.primary" }, weight: k.Dark }) }) }),
477
- /* @__PURE__ */ e(
478
- K,
479
- {
480
- primary: _ ? a.hide_trnx_subtitle_unhide_trnx : a.hide_trnx_subtitle_hide_trnx,
481
- secondary: _ ? a.hide_trnx_desc_unhiding : a.hide_trnx_desc_hiding
482
- }
483
- ),
484
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
485
- Je,
486
- {
487
- checked: _,
488
- id: "hide-transaction",
489
- name: "hide-transaction",
490
- tabIndex: -1
491
- }
492
- ) })
493
- ]
494
- }
495
- ) }),
496
- /* @__PURE__ */ e(
497
- U,
498
- {
499
- copy: {
500
- title: _ ? a.hide_trnx_subtitle_unhide_trnx : a.hide_trnx_subtitle_hide_trnx
501
- },
502
- isOpen: i,
503
- onClose: () => {
504
- s(!1), l(!1);
505
- },
506
- onPrimaryAction: u,
507
- onSecondaryAction: () => o(
508
- _ ? g.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : g.ON_TRANSACTION_HIDE_CANCEL_CLICK
509
- ),
510
- primaryText: _ ? r.unhide_button : r.hide_button,
511
- secondaryText: r.cancel_button,
512
- children: /* @__PURE__ */ e(T, { truncate: !1, variant: "Paragraph", children: _ ? a.hide_trnx_desc_unhiding : a.hide_trnx_desc_hiding })
513
- }
514
- )
515
- ] });
516
- }, St = b(Tt), Oe = ({ transaction: t }) => {
517
- const { amount: o, description: n, isIncome: s, merchant_guid: r, payee: a, top_level_category_guid: i } = t;
518
- return /* @__PURE__ */ c(C, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
519
- /* @__PURE__ */ e(
520
- me,
521
- {
522
- categoryGuid: i || "",
523
- merchantGuid: r || "",
524
- size: 64
525
- }
526
- ),
527
- /* @__PURE__ */ c(C, { overflow: "hidden'", children: [
528
- /* @__PURE__ */ e(T, { bold: !0, mb: 4, truncate: !0, variant: "Body", children: n || a }),
529
- /* @__PURE__ */ c(Ce, { color: s ? "success.main" : "text.primary", truncate: !0, children: [
530
- s ? "+" : "",
531
- J(o, "0,0.00")
532
- ] })
533
- ] })
534
- ] });
535
- }, yt = ({ transaction: t }) => {
536
- const { onEvent: o } = w(), { updateTransaction: n } = v(), { updateManualTransaction: s } = M(), { common: r, transactions: a } = N(), [i, l] = d.useState(!1), [_, u] = d.useState("");
537
- d.useEffect(() => {
538
- i && u(t.memo ? t.memo : "");
539
- }, [i]);
540
- const p = async () => {
541
- if (t.is_manual && !t.guid) {
542
- s({ ...t, memo: _ }), l(!1);
543
- return;
544
- }
545
- await n({ ...t, memo: _ }), o(G.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), l(!1);
546
- };
547
- return /* @__PURE__ */ c("div", { className: "mx-txn-memo-action", children: [
548
- /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
549
- z,
550
- {
551
- onClick: () => {
552
- o(g.ON_TRANSACTION_MEMO_CLICK), l(!0);
553
- },
554
- children: [
555
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "article", sx: { color: "text.primary" }, weight: k.Dark }) }) }),
556
- /* @__PURE__ */ e(
557
- K,
558
- {
559
- primary: a.memo_title,
560
- primaryTypographyProps: { variant: "XSmall" },
561
- secondary: /* @__PURE__ */ e(
562
- T,
563
- {
564
- bold: !0,
565
- sx: { overflowWrap: "break-word", whiteSpace: "wrap" },
566
- variant: "Body",
567
- children: t.memo ? t.memo : a.memo_desc
568
- }
569
- )
570
- }
571
- ),
572
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: k.Dark }) })
573
- ]
574
- }
575
- ) }),
576
- /* @__PURE__ */ c(
577
- se,
578
- {
579
- ariaLabelClose: r.close_aria,
580
- isOpen: i,
581
- onClose: () => l(!1),
582
- onPrimaryAction: p,
583
- title: a.memo_title,
584
- children: [
585
- /* @__PURE__ */ e(Oe, { transaction: t }),
586
- /* @__PURE__ */ e(
587
- Ie,
588
- {
589
- "aria-label": a.memo_desc_aria,
590
- focused: !0,
591
- fullWidth: !0,
592
- multiline: !0,
593
- name: "memo",
594
- onChange: (m) => u(m.target.value),
595
- placeholder: a.memo_desc,
596
- rows: 4,
597
- sx: { px: 16 },
598
- value: _
599
- }
600
- )
601
- ]
602
- }
603
- )
604
- ] });
605
- }, Ct = b(yt), ft = ({
606
- index: t,
607
- onDeleteRow: o,
608
- onCategoryChanged: n,
609
- onUpdateAmount: s,
610
- split: r
611
- }) => {
612
- const a = Z(), { onEvent: i } = w(), { transactions: l } = N(), [_, u] = d.useState(`${r.amount}`), [p, m] = d.useState(!1), S = t === 0, A = (h) => {
613
- isNaN(Number(h)) || (u(h), s(t, Number(h)));
614
- };
615
- return /* @__PURE__ */ c(
616
- E,
617
- {
618
- bgcolor: "background.paper",
619
- className: "mx-txn-split-manager-row",
620
- pb: a.Spacing.Tiny,
621
- px: a.Spacing.XSmall,
622
- children: [
623
- /* @__PURE__ */ c(_e, { alignItems: S ? "center" : "start", container: !0, children: [
624
- /* @__PURE__ */ e(_e, { item: !0, xs: 7, children: /* @__PURE__ */ c(C, { alignItems: "start", children: [
625
- /* @__PURE__ */ e(
626
- ie,
627
- {
628
- endIcon: /* @__PURE__ */ e(qe, {}),
629
- onClick: () => m(!0),
630
- startIcon: /* @__PURE__ */ e(ye, { categoryGuid: r.top_level_category_guid }),
631
- sx: { px: a.Spacing.Small, py: a.Spacing.XSmall },
632
- children: r.category
633
- }
634
- ),
635
- /* @__PURE__ */ e(E, { children: !r.category_guid && /* @__PURE__ */ c(
636
- C,
637
- {
638
- color: "error.main",
639
- direction: "row",
640
- gap: a.Spacing.XSmall,
641
- p: a.Spacing.Small,
642
- children: [
643
- /* @__PURE__ */ e(ue, { sx: { fontSize: a.FontSize.Body } }),
644
- /* @__PURE__ */ e(T, { variant: "Small", children: l.split_transaction_errors_select_category })
645
- ]
646
- }
647
- ) })
648
- ] }) }),
649
- /* @__PURE__ */ e(_e, { item: !0, xs: 5, children: S ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(T, { children: J(r.amount, "0,0.00") }) }) : /* @__PURE__ */ c(C, { alignItems: "start", children: [
650
- /* @__PURE__ */ c(C, { alignItems: "start", direction: "row", gap: a.Spacing.XSmall, children: [
651
- /* @__PURE__ */ e(
652
- Ze,
653
- {
654
- amount: _,
655
- "aria-label": l.split_transaction_edit_split_amount,
656
- inputProps: {
657
- noValidate: !0
658
- },
659
- name: "split-amount-input",
660
- setAmount: A,
661
- sx: {
662
- ".MuiOutlinedInput-input": { p: a.Spacing.Small }
663
- },
664
- type: "number"
665
- }
666
- ),
667
- /* @__PURE__ */ e(
668
- q,
669
- {
670
- "aria-label": l.split_transaction_delete_split_btn,
671
- color: "secondary",
672
- onClick: () => {
673
- i(g.ON_TRANSACTION_SPLIT_DELETE_CLICK), o(t);
674
- },
675
- sx: { w: 44, h: 44 },
676
- children: /* @__PURE__ */ e(re, {})
677
- }
678
- )
679
- ] }),
680
- !_ && /* @__PURE__ */ c(
681
- C,
682
- {
683
- color: "error.main",
684
- direction: "row",
685
- gap: a.Spacing.XSmall,
686
- py: a.Spacing.Small,
687
- children: [
688
- /* @__PURE__ */ e(ue, { sx: { fontSize: a.FontSize.Body } }),
689
- /* @__PURE__ */ e(T, { variant: "Small", children: l.split_transaction_errors_enter_an_amount })
690
- ]
691
- }
692
- )
693
- ] }) })
694
- ] }),
695
- /* @__PURE__ */ e(
696
- xe,
697
- {
698
- initialSelected: r.category_guid,
699
- onClose: () => m(!1),
700
- onSelect: (h) => {
701
- n(t, h), m(!1);
702
- },
703
- showDrawer: p,
704
- title: l.actions_select_a_category
705
- }
706
- )
707
- ]
708
- }
709
- );
710
- }, bt = b(ft), At = ({
711
- onAddSplit: t,
712
- onCategoryChanged: o,
713
- onDeleteSplit: n,
714
- onUpdateAmount: s,
715
- splits: r,
716
- transaction: a
717
- }) => {
718
- const i = Z(), { transactions: l } = N(), { onEvent: _ } = w(), [u, p] = d.useState("");
719
- return d.useEffect(() => {
720
- p(r.length <= 1 ? l.split_transaction_errors_min_splits : ""), p(
721
- r[0].amount < 0 ? ae(
722
- l.split_transaction_errors_totals_must_equal_amount,
723
- J(a.amount, "0,0.00")
724
- ) : ""
725
- );
726
- }, [r]), /* @__PURE__ */ c(E, { className: "mx-txn-split-manager", children: [
727
- r.map((m, S) => /* @__PURE__ */ e(
728
- bt,
729
- {
730
- index: S,
731
- onCategoryChanged: o,
732
- onDeleteRow: n,
733
- onUpdateAmount: s,
734
- split: m
735
- },
736
- S
737
- )),
738
- u && /* @__PURE__ */ c(
739
- C,
740
- {
741
- color: "error.main",
742
- direction: "row",
743
- gap: i.Spacing.XSmall,
744
- p: i.Spacing.Medium,
745
- children: [
746
- /* @__PURE__ */ e(ue, { sx: { fontSize: i.FontSize.Body } }),
747
- /* @__PURE__ */ e(T, { variant: "Small", children: u })
748
- ]
749
- }
750
- ),
751
- /* @__PURE__ */ e(E, { p: i.Spacing.Medium, children: /* @__PURE__ */ e(
752
- ie,
753
- {
754
- "aria-label": l.split_transaction_add_split_btn,
755
- onClick: () => {
756
- _(g.ON_TRANSACTION_SPLIT_ADD_CLICK), t();
757
- },
758
- children: l.split_transaction_add_split_btn
759
- }
760
- ) })
761
- ] });
762
- }, It = b(At), Nt = ({ transaction: t }) => {
763
- const { onEvent: o } = w(), { splitTransaction: n, unSplitTransaction: s } = v(), { common: r, transactions: a } = N(), { setShouldDisableDrawerScroll: i } = M(), { categories: l } = fe(), _ = {
764
- ...t,
765
- amount: t.amount - 1,
766
- guid: "",
767
- has_been_split: !1,
768
- parent_guid: t.guid
769
- }, u = {
770
- ...t,
771
- amount: 1,
772
- category_guid: void 0,
773
- category: a.split_transaction_select_category_btn,
774
- guid: "",
775
- has_been_split: !1,
776
- parent_guid: t.guid,
777
- top_level_category_guid: void 0
778
- }, [p, m] = d.useState(!1), [S, A] = d.useState(!1), [h, I] = d.useState([]), y = () => {
779
- const O = [...h];
780
- O.push({ ...u }), O[0].amount -= 1, I(O);
781
- }, L = (O) => {
782
- if (O > 0) {
783
- const $ = h[O], D = [...h];
784
- D.splice(O, 1), D[0].amount += $.amount, I(D);
785
- }
786
- }, R = (O, $) => {
787
- const D = [...h];
788
- D[O].amount = $, D[0].amount = t.amount - D.reduce(
789
- (Y, de, Ee) => Y + (Ee !== 0 ? de.amount : 0),
790
- 0
791
- ), I(D);
792
- }, x = (O, $) => {
793
- const D = [...h], Y = l.find((de) => de.guid === $);
794
- Y && (D[O] = {
795
- ...D[O],
796
- category_guid: $,
797
- category: Y.name,
798
- top_level_category_guid: Y.parent_guid || $
799
- }, I(D));
800
- }, P = () => {
801
- if (t.parent_guid || t.has_been_split) {
802
- A(!0);
803
- return;
804
- }
805
- I([{ ..._ }, { ...u }]), o(G.TRANSACTION_DETAILS_CLICK_SPLIT, {
806
- transaction_guid: t.guid
807
- }), m(!0);
808
- }, V = async () => {
809
- o(g.ON_TRANSACTION_SPLIT_SAVE_CLICK), await n({ ...t, has_been_split: !0 }, h), m(!1);
810
- }, le = async () => {
811
- o(g.ON_TRANSACTION_SPLIT_CANCEL_CLICK), I([{ ..._ }, { ...u }]), m(!1);
812
- }, ce = async () => {
813
- o(G.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
814
- transaction_guid: t.guid
815
- });
816
- const O = t.parent_guid ?? t.guid;
817
- await s(O);
818
- }, De = d.useMemo(() => {
819
- const O = h.some((D) => !D.category_guid), $ = h.some((D) => D.amount <= 0);
820
- return O || $;
821
- }, [h]);
822
- return /* @__PURE__ */ c(d.Fragment, { children: [
823
- t && /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(z, { onClick: P, children: [
824
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "call_split", sx: { color: "text.primary" }, weight: k.Dark }) }) }),
825
- /* @__PURE__ */ e(
826
- K,
827
- {
828
- primary: t.has_been_split || t.parent_guid ? a.split_transaction_unsplit_title : a.split_transaction_title,
829
- secondary: t.has_been_split || t.parent_guid ? a.split_transaction_unsplit_subtitle : a.split_transaction_desc
830
- }
831
- ),
832
- /* @__PURE__ */ e(B, { children: t.has_been_split || t.parent_guid ? /* @__PURE__ */ e(f, { name: "delete", weight: k.Dark }) : /* @__PURE__ */ e(f, { name: "chevron_right", weight: k.Dark }) })
833
- ] }) }),
834
- /* @__PURE__ */ c(
835
- se,
836
- {
837
- ariaLabelClose: r.close_aria,
838
- isOpen: p,
839
- isPrimaryDisabled: De,
840
- onClose: le,
841
- onPrimaryAction: V,
842
- primaryText: r.save_button,
843
- secondaryText: r.cancel_button,
844
- title: a.split_transaction_title,
845
- children: [
846
- /* @__PURE__ */ e(Oe, { transaction: t }),
847
- /* @__PURE__ */ e(
848
- It,
849
- {
850
- onAddSplit: y,
851
- onCategoryChanged: x,
852
- onDeleteSplit: L,
853
- onUpdateAmount: R,
854
- splits: h,
855
- transaction: t
856
- }
857
- )
858
- ]
859
- }
860
- ),
861
- /* @__PURE__ */ e(
862
- U,
863
- {
864
- copy: { title: a.split_transaction_unsplit_title },
865
- isOpen: S,
866
- onClose: () => {
867
- i(!1), A(!1);
868
- },
869
- onPrimaryAction: ce,
870
- onSecondaryAction: () => {
871
- o(g.ON_TRANSACTION_UNSPLIT_CANCEL);
872
- },
873
- primaryText: r.delete_button,
874
- secondaryText: r.cancel_button,
875
- children: /* @__PURE__ */ e(oe, { variant: "Paragraph", children: ae(
876
- a.split_transaction_unsplit_description,
877
- t.description
878
- ) })
879
- }
880
- )
881
- ] });
882
- }, xt = b(Nt), Ot = () => {
883
- const t = Ne(), { onEvent: o } = w(), { addTag: n } = v(), { transactions: s } = N(), [r, a] = d.useState(!1), [i, l] = d.useState(""), [_, u] = d.useState(""), p = d.useRef(null);
884
- d.useEffect(() => {
885
- r && p?.current?.focus();
886
- }, [r]);
887
- const m = () => {
888
- o(
889
- r ? g.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : g.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
890
- ), r || l(""), a(!r);
891
- }, S = async () => {
892
- o(g.ON_TRANSACTION_TAGS_TAG_ADDED), await n(i), a(!1);
893
- };
894
- return d.useEffect(() => {
895
- u(i.length > 40 ? s.tags_error_name_must_be_40_chars : "");
896
- }, [i]), /* @__PURE__ */ c(E, { className: "mx-txn-tag-manager-header", children: [
897
- /* @__PURE__ */ c(
898
- C,
899
- {
900
- alignItems: "center",
901
- bgcolor: t.palette.background.default,
902
- direction: "row",
903
- justifyContent: "space-between",
904
- px: 24,
905
- py: 16,
906
- children: [
907
- /* @__PURE__ */ e(T, { bold: !0, children: s.tags_your_tags }),
908
- /* @__PURE__ */ e(
909
- ie,
910
- {
911
- "aria-expanded": r,
912
- "aria-label": s.tags_add_tag_btn_aria,
913
- onClick: m,
914
- children: s.tags_add_tag_btn
915
- }
916
- )
917
- ]
918
- }
919
- ),
920
- /* @__PURE__ */ c(
921
- U,
922
- {
923
- copy: { title: s.tags_add_tag_btn },
924
- isOpen: r,
925
- onClose: () => a(!1),
926
- onPrimaryAction: S,
927
- onSecondaryAction: () => a(!1),
928
- children: [
929
- /* @__PURE__ */ e(
930
- pe,
931
- {
932
- "aria-label": s.tags_placeholder,
933
- name: "add-tag",
934
- onChange: (A) => l(A.target.value),
935
- placeholder: s.tags_placeholder,
936
- sx: { width: "100%" },
937
- value: i
938
- }
939
- ),
940
- /* @__PURE__ */ e(oe, { id: "add-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: _ })
941
- ]
942
- }
943
- )
944
- ] });
945
- }, Dt = b(Ot), Et = ({ onSearchValueChanged: t, searchValue: o }) => {
946
- const { common: n, transactions: s } = N(), r = Z(), a = /* @__PURE__ */ e(
947
- q,
948
- {
949
- "aria-label": s.tags_cancel_search || "Search",
950
- onClick: () => t(""),
951
- children: /* @__PURE__ */ e(Ve, {})
952
- }
953
- );
954
- return /* @__PURE__ */ e(E, { className: "mx-txn-tag-manager-search", px: r.Spacing.Large, py: r.Spacing.Medium, children: /* @__PURE__ */ e(
955
- pe,
956
- {
957
- InputProps: {
958
- startAdornment: /* @__PURE__ */ e(ge, { position: "start", children: /* @__PURE__ */ e(We, { color: "disabled" }) }),
959
- endAdornment: /* @__PURE__ */ e(ge, { position: "end", sx: { padding: 0 }, children: o ? a : null })
960
- },
961
- "aria-label": n.search_aria,
962
- name: "search",
963
- onChange: (i) => t(i.target.value),
964
- placeholder: n.search_placeholder,
965
- sx: { bgcolor: "background.paper", width: "100%" },
966
- value: o
967
- }
968
- ) });
969
- }, vt = b(Et), wt = ({ onTagChecked: t, selectedTags: o, tag: n }) => {
970
- const { onEvent: s } = w(), { removeTag: r, updateTag: a } = v(), { common: i, transactions: l } = N(), [_, u] = d.useState(!1), [p, m] = d.useState(!1), [S, A] = d.useState(""), [h, I] = d.useState(""), y = async () => {
971
- s(g.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), n && await a({ ...n, name: S }), u(!1);
972
- }, L = async () => {
973
- s(g.ON_TRANSACTION_TAGS_TAG_DELETED), await r(n.guid), m(!1);
974
- };
975
- d.useEffect(() => {
976
- I(S.length > 40 ? l.tags_error_name_must_be_40_chars : "");
977
- }, [S]);
978
- const R = () => {
979
- s(g.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), A(n.name), u(!0);
980
- }, x = () => {
981
- s(g.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), m(!0);
982
- };
983
- return /* @__PURE__ */ c(
984
- H,
985
- {
986
- className: "mx-txn-transaction-manager-row",
987
- disableGutters: !0,
988
- disablePadding: !0,
989
- secondaryAction: !n.is_default_tag && /* @__PURE__ */ c(C, { direction: "row", children: [
990
- /* @__PURE__ */ e(
991
- q,
992
- {
993
- "aria-label": `Edit ${n.name} tag`,
994
- color: "secondary",
995
- onClick: R,
996
- children: /* @__PURE__ */ e(Ye, { color: "secondary" })
997
- }
998
- ),
999
- /* @__PURE__ */ e(
1000
- q,
1001
- {
1002
- "aria-label": `Delete ${n.name} tag`,
1003
- color: "secondary",
1004
- onClick: x,
1005
- children: /* @__PURE__ */ e(re, { color: "secondary" })
1006
- }
1007
- )
1008
- ] }),
1009
- children: [
1010
- /* @__PURE__ */ c(
1011
- z,
1012
- {
1013
- "aria-checked": o.includes(n.guid),
1014
- onClick: () => t(n.guid),
1015
- role: "checkbox",
1016
- children: [
1017
- /* @__PURE__ */ e(B, { sx: { ml: 0 }, children: /* @__PURE__ */ e(je, { checked: o.includes(n.guid), edge: "start", tabIndex: -1 }) }),
1018
- /* @__PURE__ */ e(K, { children: n.name })
1019
- ]
1020
- }
1021
- ),
1022
- /* @__PURE__ */ c(
1023
- U,
1024
- {
1025
- copy: { title: "Update tag name" },
1026
- isOpen: _,
1027
- onClose: () => u(!1),
1028
- onPrimaryAction: y,
1029
- onSecondaryAction: () => u(!1),
1030
- children: [
1031
- /* @__PURE__ */ e(
1032
- pe,
1033
- {
1034
- "aria-describedby": h ? "update-tag-error" : void 0,
1035
- "aria-label": l.tags_update_the_tag_name,
1036
- name: "update-tag",
1037
- onChange: (P) => A(P.target.value),
1038
- placeholder: "Tag name",
1039
- sx: { width: "100%" },
1040
- value: S
1041
- }
1042
- ),
1043
- /* @__PURE__ */ e(oe, { id: "update-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: h })
1044
- ]
1045
- }
1046
- ),
1047
- /* @__PURE__ */ e(
1048
- U,
1049
- {
1050
- copy: { title: l.tags_delete_title },
1051
- isOpen: p,
1052
- onClose: () => m(!1),
1053
- onPrimaryAction: L,
1054
- onSecondaryAction: () => s(g.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
1055
- primaryText: i.delete_button,
1056
- secondaryText: i.cancel_button,
1057
- children: /* @__PURE__ */ e(T, { truncate: !1, children: l.tags_deleting_this_tag_will_remove_it })
1058
- }
1059
- )
1060
- ]
1061
- }
1062
- );
1063
- }, Lt = b(wt), Rt = ({ selectedTags: t, onTagChecked: o }) => {
1064
- const { tags: n } = v(), [s, r] = d.useState(""), a = n.filter(
1065
- (i) => i.name.toLowerCase().includes(s.toLowerCase())
1066
- );
1067
- return /* @__PURE__ */ c("div", { className: "mx-txn-tag-manager", children: [
1068
- /* @__PURE__ */ e(
1069
- vt,
1070
- {
1071
- onSearchValueChanged: (i) => r(i),
1072
- searchValue: s
1073
- }
1074
- ),
1075
- /* @__PURE__ */ e(Dt, {}),
1076
- /* @__PURE__ */ e(Q, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ne, { children: a.map((i) => /* @__PURE__ */ c(d.Fragment, { children: [
1077
- /* @__PURE__ */ e(Lt, { onTagChecked: o, selectedTags: t, tag: i }),
1078
- /* @__PURE__ */ e(te, { sx: { ml: 24 } })
1079
- ] }, i.guid)) }) })
1080
- ] });
1081
- }, kt = b(Rt), Pt = ({ transaction: t }) => {
1082
- const { onEvent: o } = w(), { tags: n, updateTaggings: s, updateTransaction: r } = v(), { common: a, transactions: i } = N(), { updateManualTransaction: l } = M(), [_, u] = d.useState(!1), [p, m] = d.useState(t.tags);
1083
- d.useEffect(() => {
1084
- m(t.tags);
1085
- }, [_, t]);
1086
- const S = (I) => {
1087
- const y = [...p], L = p.indexOf(I);
1088
- L >= 0 ? y.splice(L, 1) : y.push(I), m(y);
1089
- }, A = async () => {
1090
- if (t.is_manual && !t.guid) {
1091
- l({ ...t, tags: p }), u(!1);
1092
- return;
1093
- }
1094
- await s(p, t.guid), await r({ ...t, tags: p }), o(G.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), u(!1);
1095
- }, h = d.useMemo(
1096
- () => t.tags.map(
1097
- (I, y, L) => `${n.find((R) => R.guid === I)?.name}${y < L.length - 1 ? " / " : ""}`
1098
- ),
1099
- [n, t]
1100
- );
1101
- return /* @__PURE__ */ c(d.Fragment, { children: [
1102
- /* @__PURE__ */ e(H, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
1103
- z,
1104
- {
1105
- onClick: () => {
1106
- o(g.ON_TRANSACTION_TAGS_CLICK), u(!0);
1107
- },
1108
- children: [
1109
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(X, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "local_offer", sx: { color: "text.primary" }, weight: k.Dark }) }) }),
1110
- /* @__PURE__ */ e(
1111
- K,
1112
- {
1113
- primary: i.tags_title,
1114
- primaryTypographyProps: { variant: "XSmall" },
1115
- secondary: /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.tags?.length > 0 ? h : i.tags_desc })
1116
- }
1117
- ),
1118
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: k.Dark }) })
1119
- ]
1120
- }
1121
- ) }),
1122
- /* @__PURE__ */ e(
1123
- se,
1124
- {
1125
- ariaLabelClose: a.close_aria,
1126
- isOpen: _,
1127
- onClose: () => u(!1),
1128
- onPrimaryAction: A,
1129
- primaryText: a.save_button,
1130
- secondaryText: a.cancel_button,
1131
- title: i.tags_title,
1132
- children: /* @__PURE__ */ e(kt, { onTagChecked: S, selectedTags: p })
1133
- }
1134
- )
1135
- ] });
1136
- }, Gt = b(Pt), Mt = ({ transaction: t }) => {
1137
- const { updateTransaction: o } = v(), { common: n, transactions: s } = N(), { onEvent: r } = w(), [a, i] = d.useState(!1), [l, _] = d.useState(""), u = d.useRef(null);
1138
- d.useEffect(() => {
1139
- a && (_(t.description), u?.current?.focus());
1140
- }, [a]);
1141
- const p = async () => {
1142
- r(G.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
1143
- transaction_guid: t.guid
1144
- }), await o({ ...t, description: l }), i(!1);
1145
- };
1146
- return /* @__PURE__ */ e(E, { className: "mx-txn-transaction-description", children: a ? /* @__PURE__ */ c(Fe, { row: !0, children: [
1147
- /* @__PURE__ */ e(
1148
- Ie,
1149
- {
1150
- "aria-label": s.description_add_a_subcategory,
1151
- name: "add-subcategory",
1152
- onChange: (m) => _(m.target.value),
1153
- ref: u,
1154
- sx: {
1155
- backgroundColor: "background.paper",
1156
- ".MuiOutlinedInput-root": { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
1157
- ".MuiOutlinedInput-input": { p: 11 },
1158
- width: 250
1159
- },
1160
- value: l
1161
- }
1162
- ),
1163
- /* @__PURE__ */ e(
1164
- ie,
1165
- {
1166
- disabled: !l,
1167
- onClick: p,
1168
- sx: { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 },
1169
- variant: "outlined",
1170
- children: n.save_button
1171
- }
1172
- )
1173
- ] }) : /* @__PURE__ */ c(C, { alignItems: "center", direction: "row", gap: 4, children: [
1174
- /* @__PURE__ */ e(T, { bold: !0, children: t.description }),
1175
- /* @__PURE__ */ e(
1176
- q,
1177
- {
1178
- "aria-label": s.description_edit_transaction_name,
1179
- onClick: () => {
1180
- i(!0), r(g.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK);
1181
- },
1182
- sx: { color: "action.active" },
1183
- children: /* @__PURE__ */ e(f, { name: "create", size: 22 })
1184
- }
1185
- )
1186
- ] }) });
1187
- }, Kt = b(Mt), $t = ({ transaction: t }) => {
1188
- const { updateTransaction: o } = v(), { transactions: n } = N(), { onEvent: s } = w(), r = Ne(), a = async () => {
1189
- s(G.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await o({ ...t, is_flagged: !t.is_flagged });
1190
- };
1191
- return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
1192
- ze,
1193
- {
1194
- "aria-label": n.flag_btn_aria,
1195
- "aria-pressed": t.is_flagged,
1196
- color: "warning",
1197
- onClick: a,
1198
- selected: t.is_flagged,
1199
- sx: {
1200
- borderRadius: 6,
1201
- color: r.palette.secondary.main,
1202
- "&.Mui-selected": {
1203
- color: r.palette.common.white,
1204
- backgroundColor: r.palette.warning.dark,
1205
- ":hover": {
1206
- color: r.palette.common.white,
1207
- backgroundColor: r.palette.warning.main
1208
- }
1209
- },
1210
- ":hover": {
1211
- color: r.palette.warning.contrastText,
1212
- backgroundColor: r.palette.warning.light
1213
- }
1214
- },
1215
- value: "flagged",
1216
- children: /* @__PURE__ */ e(He, { color: "inherit" })
1217
- }
1218
- ) });
1219
- }, Ft = b($t), Ht = ({
1220
- bottomActions: t = et,
1221
- topActions: o = Qe,
1222
- transaction: n
1223
- }) => {
1224
- const { isCopyLoaded: s } = Me(), r = n?.number && n.number.length > 4, { onEvent: a } = w();
1225
- return d.useEffect(
1226
- () => a(G.TRANSACTION_DETAILS_VIEW, { transaction_guid: n.guid }),
1227
- []
1228
- ), s ? /* @__PURE__ */ e(E, { className: "mx-txn-transaction-details", width: "100%", children: n && /* @__PURE__ */ c(C, { children: [
1229
- /* @__PURE__ */ c(C, { gap: 12, p: 24, children: [
1230
- /* @__PURE__ */ e(Q, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
1231
- me,
1232
- {
1233
- categoryGuid: n.top_level_category_guid || "",
1234
- merchantGuid: n.merchant_guid || "",
1235
- size: 64
1236
- }
1237
- ) }),
1238
- /* @__PURE__ */ e(Kt, { transaction: n }),
1239
- /* @__PURE__ */ c(C, { direction: "row", justifyContent: "space-between", children: [
1240
- /* @__PURE__ */ c(Ce, { color: n.isIncome ? "success.main" : "text.primary", children: [
1241
- n.isIncome ? "+" : "",
1242
- J(n.amount, "0,0.00")
1243
- ] }),
1244
- /* @__PURE__ */ e(Ft, { transaction: n })
1245
- ] }),
1246
- /* @__PURE__ */ c(C, { bgcolor: "background.highlight", borderRadius: "12px", gap: 4, p: 8, children: [
1247
- /* @__PURE__ */ e(T, { bold: !0, children: `${n.account}
1248
- ${r ? n.number : "•".repeat(4).concat(n.number ?? "")}` }),
1249
- /* @__PURE__ */ e(T, { bold: !0, color: "secondary", variant: "Tiny", children: n.feed_description })
1250
- ] })
1251
- ] }),
1252
- /* @__PURE__ */ e(Q, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ne, { children: o.map((i, l) => /* @__PURE__ */ c(d.Fragment, { children: [
1253
- i === j.Category && /* @__PURE__ */ e(_t, { transaction: n }),
1254
- i === j.Date && /* @__PURE__ */ e(ut, { transaction: n }),
1255
- i === j.Memo && /* @__PURE__ */ e(Ct, { transaction: n }),
1256
- i === j.Tags && /* @__PURE__ */ e(Gt, { transaction: n }),
1257
- /* @__PURE__ */ e(te, { variant: l < o.length - 1 ? "inset" : "fullWidth" })
1258
- ] }, i)) }) }),
1259
- /* @__PURE__ */ e(T, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "Body", children: "Actions" }),
1260
- /* @__PURE__ */ e(Q, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ c(ne, { children: [
1261
- t.map((i, l) => /* @__PURE__ */ c(d.Fragment, { children: [
1262
- i === ee.SplitTransaction && /* @__PURE__ */ e(xt, { transaction: n }),
1263
- i === ee.HideTransaction && /* @__PURE__ */ e(St, { transaction: n }),
1264
- i === ee.MerchantLogo && /* @__PURE__ */ e(ht, { transaction: n }),
1265
- /* @__PURE__ */ e(te, { variant: l < t.length - 1 ? "inset" : "fullWidth" })
1266
- ] }, i)),
1267
- n.is_manual && !n.parent_guid && !n.has_been_split && /* @__PURE__ */ e(pt, { transaction: n })
1268
- ] }) })
1269
- ] }) }) : /* @__PURE__ */ e(Ae, {});
1270
- }, Kn = b(Ht);
1271
- export {
1272
- ee as B,
1273
- _t as C,
1274
- ut as D,
1275
- Ct as M,
1276
- it as S,
1277
- Mn as T,
1278
- Kn as a,
1279
- ot as b,
1280
- Gt as c,
1281
- j as d,
1282
- M as u
1283
- };