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