@mx-cartographer/experiences 9.7.48 → 9.7.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/core/constants/Help.d.ts +4 -27
- package/dist/core/constants/Help.es.js +46 -15
- package/dist/core/constants/Help.es.js.map +1 -1
- package/dist/core/types/Help.d.ts +13 -0
- package/dist/core/utils/HelpUtil.es.js +7 -7
- package/dist/core/utils/HelpUtil.es.js.map +1 -1
- package/dist/help/components/Help.es.js +30 -29
- package/dist/help/components/Help.es.js.map +1 -1
- package/dist/help/components/content/ContentItem.es.js +24 -23
- package/dist/help/components/content/ContentItem.es.js.map +1 -1
- package/dist/help/components/content/section/General.es.js +37 -32
- package/dist/help/components/content/section/General.es.js.map +1 -1
- package/dist/help/components/content/section/LoginIssues.es.js +10 -7
- package/dist/help/components/content/section/LoginIssues.es.js.map +1 -1
- package/dist/help/components/content/section/index.es.js +24 -24
- package/dist/help/components/requestsupport/HelpByCategoryList.es.js +24 -20
- package/dist/help/components/requestsupport/HelpByCategoryList.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionDetails.es.js +186 -159
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,218 +1,245 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import { DATE_FORMATS_INTL as
|
|
3
|
-
import { useAppConfig as
|
|
4
|
-
import { TransactionType as
|
|
5
|
-
import { fromUnixUTC as
|
|
6
|
-
import { formatCurrency as
|
|
7
|
-
import { ANALYTICS_EVENTS as
|
|
8
|
-
import { isFeatureEnabled as
|
|
9
|
-
import { isTransferTransaction as
|
|
10
|
-
import
|
|
11
|
-
import { BottomActions as m, DEFAULT_BOTTOM_ACTIONS as
|
|
12
|
-
import { resolveInsightRender as
|
|
13
|
-
import { isContactSupportCtaDisabled as
|
|
14
|
-
import { actionBlocksKey as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { EmbeddedCard as
|
|
19
|
-
import { AddMerchantBudgetAction as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import { getEmbeddedInstanceSlotByBeatTemplates as
|
|
32
|
-
import
|
|
33
|
-
import { observer as
|
|
34
|
-
import
|
|
35
|
-
import { MerchantLogo as
|
|
36
|
-
import { endOfMonth as
|
|
37
|
-
import { isBefore as
|
|
38
|
-
import { startOfMonth as
|
|
39
|
-
import
|
|
40
|
-
import { jsx as t, jsxs as
|
|
41
|
-
import { useTheme as
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
import { buildDynamicCopy as V } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { DATE_FORMATS_INTL as pe, formatDate as ge } from "../../../core/constants/DateFormats.es.js";
|
|
3
|
+
import { useAppConfig as fe, useCategoryStore as he, useEvent as _e, useGlobalCopyStore as Te, useGlobalUiStore as ye, useTransactionStore as Se, useUserStore as be } from "../../../common/context/hooks.es.js";
|
|
4
|
+
import { TransactionType as Ce } from "../../../core/types/Transaction.es.js";
|
|
5
|
+
import { fromUnixUTC as De } from "../../../core/utils/DateUtil.es.js";
|
|
6
|
+
import { formatCurrency as W } from "../../../core/utils/NumberFormatting.es.js";
|
|
7
|
+
import { ANALYTICS_EVENTS as ve } from "../../../common/constants/Analytics.es.js";
|
|
8
|
+
import { isFeatureEnabled as Ae } from "../../../core/utils/UserUtils.es.js";
|
|
9
|
+
import { isTransferTransaction as xe } from "../../../core/utils/TransactionUtils.es.js";
|
|
10
|
+
import Ie from "../../../common/components/Loader.es.js";
|
|
11
|
+
import { BottomActions as m, DEFAULT_BOTTOM_ACTIONS as Le, DEFAULT_TOP_ACTIONS as we, TopActions as h } from "../../constants/Actions.es.js";
|
|
12
|
+
import { resolveInsightRender as Ee } from "../../../insights-v2/resolveInsightRender.es.js";
|
|
13
|
+
import { isContactSupportCtaDisabled as Oe } from "../../../insights-v2/actionBlocks/ContactSupportActionBlock.es.js";
|
|
14
|
+
import { actionBlocksKey as Me } from "../../../insights-v2/mappings/actionBlocksKey.es.js";
|
|
15
|
+
import Ne from "../../../insights-v2/components/InsightErrorCard.es.js";
|
|
16
|
+
import Be from "../../../insights-v2/components/CompactInsightCard.es.js";
|
|
17
|
+
import ke from "../../../insights/components/shared/ChartTransactionWithDrillDown.es.js";
|
|
18
|
+
import { EmbeddedCard as Fe } from "../../../insights/components/shared/InsightsCard/EmbeddedCard.es.js";
|
|
19
|
+
import { AddMerchantBudgetAction as Re } from "./transactiondetails/actions/AddMerchantBudgetAction.es.js";
|
|
20
|
+
import Ge from "./transactiondetails/actions/CategoryAction.es.js";
|
|
21
|
+
import Pe from "./transactiondetails/actions/DateAction.es.js";
|
|
22
|
+
import Ue from "./transactiondetails/actions/DeleteAction.es.js";
|
|
23
|
+
import Ve from "./transactiondetails/actions/DeleteLogoAction.es.js";
|
|
24
|
+
import We from "./transactiondetails/actions/ExcludeAction.es.js";
|
|
25
|
+
import He from "./transactiondetails/actions/MemoAction.es.js";
|
|
26
|
+
import je from "./transactiondetails/actions/SplitAction.es.js";
|
|
27
|
+
import ze from "./transactiondetails/actions/TagsAction.es.js";
|
|
28
|
+
import Xe from "./transactiondetails/Description.es.js";
|
|
29
|
+
import qe from "./transactiondetails/FlagTransaction.es.js";
|
|
30
|
+
import Ke from "./transactiondetails/TransactionDetailsView.es.js";
|
|
31
|
+
import { getEmbeddedInstanceSlotByBeatTemplates as Ye } from "./getEmbeddedInstanceSlotByBeatTemplates.es.js";
|
|
32
|
+
import s, { useMemo as H } from "react";
|
|
33
|
+
import { observer as $e } from "mobx-react-lite";
|
|
34
|
+
import c from "@mui/material/Stack";
|
|
35
|
+
import { MerchantLogo as j, P as Ze, Text as _ } from "@mxenabled/mxui";
|
|
36
|
+
import { endOfMonth as Je } from "date-fns/endOfMonth";
|
|
37
|
+
import { isBefore as Qe } from "date-fns/isBefore";
|
|
38
|
+
import { startOfMonth as z } from "date-fns/startOfMonth";
|
|
39
|
+
import X from "@mui/material/Paper";
|
|
40
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
41
|
+
import { useTheme as et } from "@mui/material/styles";
|
|
42
|
+
import q from "@mui/material/Box";
|
|
43
|
+
import K from "@mui/material/Divider";
|
|
44
|
+
import Y from "@mui/material/List";
|
|
45
|
+
import tt from "@mui/material/Alert";
|
|
46
|
+
import rt from "@mui/material/Snackbar";
|
|
47
|
+
var v = 64, ot = 8, $ = {
|
|
48
|
+
fontWeight: 700,
|
|
49
|
+
letterSpacing: "0.27px",
|
|
50
|
+
textTransform: "uppercase"
|
|
51
|
+
}, it = ({ bottomActions: T = Le, canFlagTransaction: Z = !0, topActions: A = we, transaction: e, shouldShowEmbeddedCard: x = !0, onContactSupport: I }) => {
|
|
52
|
+
const { onEvent: J } = _e(), { config: Q } = fe(), { isCopyLoaded: ee } = ye(), { userFeatures: te } = be(), { accounts: re, common: oe, insights_feed: d } = Te(), { detailedCategories: L } = he(), { alert: w, associatedBeats: E, detailedTransactions: O, cachedStartDate: M, loadEmbeddedInstanceTransactions: ie, setAlert: N } = Se(), [ae, B] = s.useState(!1), [k, F] = s.useState(!1), [ne, se] = s.useState(!1), de = et(), le = e?.number && e.number.length > 4, R = e?.number ? le ? e.number : `••••${e.number}` : void 0, G = e?.transaction_type === Ce.CREDIT, P = xe(e) && !!e.institutionName, a = s.useMemo(() => E.find((r) => r.associated_transaction_guid === e.guid), [E, e]), y = x ? Ee(a) : "legacy", S = y === "v2" ? a?.insights_payload : void 0, o = x && y === "legacy" ? Ye(oe, a) : null, me = (r) => {
|
|
53
|
+
r.block === Me.CONTACT_SUPPORT_ACTION_BLOCK && I?.();
|
|
54
|
+
}, [l, b] = s.useState(o ? o.dataSeries.length - 1 : 0);
|
|
55
|
+
s.useEffect(() => J(ve.TRANSACTION_DETAILS_VIEW, { transaction_guid: e.guid }), []), s.useEffect(() => {
|
|
56
|
+
if (!o || o.dataSeries.length === 0) return;
|
|
57
|
+
const { date: r } = o.dataSeries[l], i = z(r);
|
|
58
|
+
Qe(i, M) && (F(!0), ie(i).finally(() => {
|
|
55
59
|
F(!1);
|
|
56
60
|
}));
|
|
57
61
|
}, [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
l,
|
|
63
|
+
o,
|
|
64
|
+
M
|
|
61
65
|
]);
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
return
|
|
67
|
-
category:
|
|
68
|
-
percentageAmount: i === 0 ? 0 : Math.round(Math.abs(
|
|
69
|
-
changetype:
|
|
66
|
+
const C = T.includes(m.MerchantBudget) && !e?.merchant_guid ? T.filter((r) => r !== m.MerchantBudget) : T, D = H(() => {
|
|
67
|
+
if (o) {
|
|
68
|
+
const r = L.find((f) => f.guid === e.top_level_category_guid), i = a?.payload?.average_amount ?? 0, p = e.amount;
|
|
69
|
+
let g = d.general.increased_text;
|
|
70
|
+
return p - i < 0 && (g = d.general.decreased_text), {
|
|
71
|
+
category: r,
|
|
72
|
+
percentageAmount: i === 0 ? 0 : Math.round(Math.abs(p - i) / i * 100),
|
|
73
|
+
changetype: g
|
|
70
74
|
};
|
|
71
75
|
}
|
|
72
76
|
return null;
|
|
73
|
-
}, [
|
|
74
|
-
if (!
|
|
75
|
-
const { guid:
|
|
76
|
-
return
|
|
77
|
-
const
|
|
78
|
-
return
|
|
77
|
+
}, [o, L]), ce = H(() => {
|
|
78
|
+
if (!o?.dataSeries?.length) return [];
|
|
79
|
+
const { guid: r, date: i } = o.dataSeries[l], p = z(i), g = Je(i);
|
|
80
|
+
return O.filter((f) => {
|
|
81
|
+
const U = De(f.date);
|
|
82
|
+
return U >= p && U <= g && f.guid === r;
|
|
79
83
|
});
|
|
80
84
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
l,
|
|
86
|
+
o,
|
|
87
|
+
O,
|
|
84
88
|
k
|
|
85
89
|
]);
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
return /* @__PURE__ */
|
|
90
|
+
if (!ee) return /* @__PURE__ */ t(Ie, {});
|
|
91
|
+
const u = Ae(te, "MX_TXN_DETAILS_VIEW_ONLY"), ue = de.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
92
|
+
return /* @__PURE__ */ n(q, {
|
|
89
93
|
className: "mx-txn-transaction-details",
|
|
90
94
|
width: "100%",
|
|
91
95
|
children: [
|
|
92
|
-
e && /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
96
|
+
e && /* @__PURE__ */ n(c, { children: [
|
|
97
|
+
/* @__PURE__ */ n(c, {
|
|
94
98
|
gap: 12,
|
|
95
99
|
p: 24,
|
|
96
100
|
children: [
|
|
97
|
-
/* @__PURE__ */ t(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
/* @__PURE__ */ t(q, {
|
|
102
|
+
sx: {
|
|
103
|
+
bgcolor: "background.paper",
|
|
104
|
+
borderRadius: `${ot}px`,
|
|
105
|
+
height: v,
|
|
106
|
+
overflow: "hidden",
|
|
107
|
+
width: v
|
|
108
|
+
},
|
|
109
|
+
children: /* @__PURE__ */ t(j, {
|
|
101
110
|
categoryGuid: e.top_level_category_guid || "",
|
|
102
111
|
merchantGuid: e.merchant_guid || "",
|
|
103
|
-
size:
|
|
112
|
+
size: v
|
|
104
113
|
})
|
|
105
114
|
}),
|
|
106
|
-
/* @__PURE__ */ t(
|
|
107
|
-
displayValue:
|
|
115
|
+
/* @__PURE__ */ t(Xe, {
|
|
116
|
+
displayValue: P ? e.institutionName : void 0,
|
|
108
117
|
transaction: e,
|
|
109
|
-
viewOnly:
|
|
118
|
+
viewOnly: u || P
|
|
110
119
|
}),
|
|
111
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ n(c, {
|
|
112
121
|
direction: "row",
|
|
113
122
|
justifyContent: "space-between",
|
|
114
123
|
sx: { minHeight: 44 },
|
|
115
|
-
children: [/* @__PURE__ */
|
|
116
|
-
color:
|
|
124
|
+
children: [/* @__PURE__ */ n(Ze, {
|
|
125
|
+
color: G ? "success.main" : "text.primary",
|
|
117
126
|
variant: "h1",
|
|
118
|
-
children: [
|
|
119
|
-
}), !
|
|
127
|
+
children: [G ? "+" : "", W(e.amount, "0,0.00")]
|
|
128
|
+
}), !u && Z && /* @__PURE__ */ t(qe, { transaction: e })]
|
|
120
129
|
}),
|
|
121
|
-
|
|
130
|
+
S && /* @__PURE__ */ t(Be, {
|
|
122
131
|
beat: a,
|
|
123
|
-
isCtaDisabled:
|
|
124
|
-
onCtaClick:
|
|
125
|
-
payload:
|
|
132
|
+
isCtaDisabled: Oe(S.primary_cta?.block, Q, I),
|
|
133
|
+
onCtaClick: me,
|
|
134
|
+
payload: S
|
|
126
135
|
}),
|
|
127
|
-
|
|
136
|
+
y === "error" && a && /* @__PURE__ */ t(Ne, {
|
|
128
137
|
beat: a,
|
|
129
138
|
variant: "plain"
|
|
130
139
|
}),
|
|
131
|
-
|
|
132
|
-
callToAction:
|
|
133
|
-
description:
|
|
134
|
-
instanceSlot:
|
|
140
|
+
o?.instanceSlot && /* @__PURE__ */ t(Fe, {
|
|
141
|
+
callToAction: o.callToAction,
|
|
142
|
+
description: V(d.general.embedded_description, D.changetype, /* @__PURE__ */ t("strong", { children: D.percentageAmount })),
|
|
143
|
+
instanceSlot: o.instanceSlot,
|
|
135
144
|
onCtaClick: () => {
|
|
136
|
-
|
|
145
|
+
B(!0);
|
|
137
146
|
},
|
|
138
147
|
title: a.html_micro_title
|
|
139
148
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ n(c, {
|
|
141
150
|
sx: {
|
|
142
|
-
bgcolor:
|
|
151
|
+
bgcolor: ue,
|
|
143
152
|
borderRadius: "4px",
|
|
144
153
|
gap: 4,
|
|
145
154
|
p: 8
|
|
146
155
|
},
|
|
147
|
-
children: [/* @__PURE__ */ t(
|
|
156
|
+
children: [/* @__PURE__ */ t(_, {
|
|
148
157
|
bold: !0,
|
|
149
|
-
children:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
children: e.account
|
|
159
|
+
}), /* @__PURE__ */ n(c, {
|
|
160
|
+
alignItems: "baseline",
|
|
161
|
+
"data-testid": "account-feed-line",
|
|
162
|
+
direction: "row",
|
|
163
|
+
gap: 4,
|
|
164
|
+
sx: { overflow: "hidden" },
|
|
165
|
+
children: [/* @__PURE__ */ t(_, {
|
|
166
|
+
color: "text.secondary",
|
|
167
|
+
sx: {
|
|
168
|
+
...$,
|
|
169
|
+
minWidth: 0
|
|
170
|
+
},
|
|
171
|
+
truncate: !0,
|
|
172
|
+
variant: "tiny",
|
|
173
|
+
children: e.feed_description
|
|
174
|
+
}), R && /* @__PURE__ */ t(_, {
|
|
175
|
+
color: "text.secondary",
|
|
176
|
+
sx: {
|
|
177
|
+
...$,
|
|
178
|
+
flexShrink: 0
|
|
179
|
+
},
|
|
180
|
+
variant: "tiny",
|
|
181
|
+
children: R
|
|
182
|
+
})]
|
|
156
183
|
})]
|
|
157
184
|
})
|
|
158
185
|
]
|
|
159
186
|
}),
|
|
160
|
-
/* @__PURE__ */ t(
|
|
187
|
+
/* @__PURE__ */ t(X, {
|
|
161
188
|
square: !0,
|
|
162
189
|
sx: { boxShadow: "none" },
|
|
163
|
-
children:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
/* @__PURE__ */ t(
|
|
190
|
+
children: u ? /* @__PURE__ */ t(Ke, { transaction: e }) : /* @__PURE__ */ t(Y, { children: A.map((r, i) => /* @__PURE__ */ n(s.Fragment, { children: [
|
|
191
|
+
r === h.Category && /* @__PURE__ */ t(Ge, { transaction: e }),
|
|
192
|
+
r === h.Date && /* @__PURE__ */ t(Pe, { transaction: e }),
|
|
193
|
+
r === h.Memo && /* @__PURE__ */ t(He, { transaction: e }),
|
|
194
|
+
r === h.Tags && /* @__PURE__ */ t(ze, { transaction: e }),
|
|
195
|
+
/* @__PURE__ */ t(K, {
|
|
169
196
|
component: "li",
|
|
170
|
-
variant: i <
|
|
197
|
+
variant: i < A.length - 1 ? "inset" : "fullWidth"
|
|
171
198
|
})
|
|
172
|
-
] },
|
|
199
|
+
] }, r)) })
|
|
173
200
|
}),
|
|
174
|
-
!
|
|
201
|
+
!u && C.length > 0 && /* @__PURE__ */ n(s.Fragment, { children: [/* @__PURE__ */ t(_, {
|
|
175
202
|
bold: !0,
|
|
176
203
|
mb: 8,
|
|
177
204
|
ml: 26,
|
|
178
205
|
mt: 16,
|
|
179
206
|
variant: "body1",
|
|
180
|
-
children:
|
|
181
|
-
}), /* @__PURE__ */ t(
|
|
207
|
+
children: re.actions
|
|
208
|
+
}), /* @__PURE__ */ t(X, {
|
|
182
209
|
square: !0,
|
|
183
210
|
sx: { boxShadow: "none" },
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
/* @__PURE__ */ t(
|
|
211
|
+
children: /* @__PURE__ */ n(Y, { children: [C.map((r, i) => /* @__PURE__ */ n(s.Fragment, { children: [
|
|
212
|
+
r === m.MerchantBudget && /* @__PURE__ */ t(Re, { transaction: e }),
|
|
213
|
+
r === m.SplitTransaction && /* @__PURE__ */ t(je, { transaction: e }),
|
|
214
|
+
r === m.HideTransaction && /* @__PURE__ */ t(We, { transaction: e }),
|
|
215
|
+
r === m.MerchantLogo && /* @__PURE__ */ t(Ve, { transaction: e }),
|
|
216
|
+
/* @__PURE__ */ t(K, {
|
|
190
217
|
component: "li",
|
|
191
|
-
variant: i <
|
|
218
|
+
variant: i < C.length - 1 ? "inset" : "fullWidth"
|
|
192
219
|
})
|
|
193
|
-
] },
|
|
220
|
+
] }, r)), e.is_manual && !e.parent_guid && !e.has_been_split && /* @__PURE__ */ t(Ue, { transaction: e })] })
|
|
194
221
|
})] })
|
|
195
222
|
] }),
|
|
196
|
-
a &&
|
|
197
|
-
ariaLabel:
|
|
223
|
+
a && o && /* @__PURE__ */ t(ke, {
|
|
224
|
+
ariaLabel: ge(o?.dataSeries[l]?.date, pe.MONTH),
|
|
198
225
|
barChartProps: {
|
|
199
226
|
amounts: {
|
|
200
227
|
average: a.payload.average_amount,
|
|
201
|
-
formattedAverage:
|
|
228
|
+
formattedAverage: W(a.payload.average_amount, "0,0")
|
|
202
229
|
},
|
|
203
|
-
color:
|
|
204
|
-
data:
|
|
230
|
+
color: D.category?.color || "",
|
|
231
|
+
data: o.chartData,
|
|
205
232
|
margin: {
|
|
206
233
|
bottom: 10,
|
|
207
234
|
left: 24,
|
|
208
235
|
right: 24,
|
|
209
236
|
top: 20
|
|
210
237
|
},
|
|
211
|
-
monthlyAmountLabel:
|
|
212
|
-
onBarClick: (
|
|
213
|
-
|
|
238
|
+
monthlyAmountLabel: d.general.monthly_amount,
|
|
239
|
+
onBarClick: (r) => {
|
|
240
|
+
b(r);
|
|
214
241
|
},
|
|
215
|
-
trendAmountLabel:
|
|
242
|
+
trendAmountLabel: d.general.trend,
|
|
216
243
|
legendPosition: "top"
|
|
217
244
|
},
|
|
218
245
|
beat: {
|
|
@@ -223,43 +250,43 @@ var et = ({ bottomActions: _ = Ae, canFlagTransaction: K = !0, topActions: v = v
|
|
|
223
250
|
description: e.description ?? ""
|
|
224
251
|
}
|
|
225
252
|
},
|
|
226
|
-
data:
|
|
227
|
-
defaultSelectedIndex:
|
|
228
|
-
icon: /* @__PURE__ */ t(
|
|
253
|
+
data: o.chartData,
|
|
254
|
+
defaultSelectedIndex: l,
|
|
255
|
+
icon: /* @__PURE__ */ t(j, {
|
|
229
256
|
alt: e.description ?? "",
|
|
230
257
|
categoryGuid: e.category_guid ?? "",
|
|
231
258
|
merchantGuid: e.merchant_guid ?? "",
|
|
232
259
|
size: 16
|
|
233
260
|
}),
|
|
234
|
-
isOpen:
|
|
261
|
+
isOpen: ae,
|
|
235
262
|
onClose: () => {
|
|
236
|
-
|
|
263
|
+
B(!1), b(o.dataSeries.length - 1);
|
|
237
264
|
},
|
|
238
|
-
onTabChange: (
|
|
239
|
-
|
|
265
|
+
onTabChange: (r) => {
|
|
266
|
+
b(r);
|
|
240
267
|
},
|
|
241
|
-
tipSection:
|
|
242
|
-
message:
|
|
243
|
-
onDismiss: () =>
|
|
268
|
+
tipSection: ne ? void 0 : {
|
|
269
|
+
message: V(d.general.tip_section_message, /* @__PURE__ */ t("strong", { children: d.general.tip_section_title }), /* @__PURE__ */ t("strong", { children: a.primary_transaction?.description })),
|
|
270
|
+
onDismiss: () => se(!0)
|
|
244
271
|
},
|
|
245
|
-
title:
|
|
272
|
+
title: d.general.transaction_history_title,
|
|
246
273
|
transactionListProps: {
|
|
247
274
|
showLoader: k,
|
|
248
275
|
showInsights: !0,
|
|
249
|
-
transaction:
|
|
276
|
+
transaction: ce
|
|
250
277
|
}
|
|
251
278
|
}),
|
|
252
|
-
/* @__PURE__ */ t(
|
|
279
|
+
/* @__PURE__ */ t(rt, {
|
|
253
280
|
anchorOrigin: {
|
|
254
281
|
vertical: "bottom",
|
|
255
282
|
horizontal: "right"
|
|
256
283
|
},
|
|
257
284
|
autoHideDuration: 3500,
|
|
258
|
-
onClose: () =>
|
|
285
|
+
onClose: () => N(""),
|
|
259
286
|
open: !!w,
|
|
260
|
-
children: /* @__PURE__ */ t(
|
|
287
|
+
children: /* @__PURE__ */ t(tt, {
|
|
261
288
|
closeText: "",
|
|
262
|
-
onClose: () =>
|
|
289
|
+
onClose: () => N(""),
|
|
263
290
|
severity: "success",
|
|
264
291
|
variant: "filled",
|
|
265
292
|
children: w
|
|
@@ -267,9 +294,9 @@ var et = ({ bottomActions: _ = Ae, canFlagTransaction: K = !0, topActions: v = v
|
|
|
267
294
|
})
|
|
268
295
|
]
|
|
269
296
|
});
|
|
270
|
-
},
|
|
297
|
+
}, Zt = $e(it);
|
|
271
298
|
export {
|
|
272
|
-
|
|
299
|
+
Zt as default
|
|
273
300
|
};
|
|
274
301
|
|
|
275
302
|
//# sourceMappingURL=TransactionDetails.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useAppConfig,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { type PrimaryCTA, Transaction, TransactionType } from '../../../core'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks`, whose chart blocks\n// reach back into transactions code — the circular-import/TDZ trap `actionBlocksKey.ts` documents.\nimport { isContactSupportCtaDisabled } from '../../../insights-v2/actionBlocks/ContactSupportActionBlock'\nimport CompactInsightCard from '../../../insights-v2/components/CompactInsightCard'\nimport InsightErrorCard from '../../../insights-v2/components/InsightErrorCard'\nimport { actionBlocksKey } from '../../../insights-v2/mappings/actionBlocksKey'\nimport { resolveInsightRender } from '../../../insights-v2/resolveInsightRender'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isTransferTransaction } from '../../../core/utils/TransactionUtils'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n shouldShowEmbeddedCard?: boolean\n /**\n * Opens the host's contact-support flow when the embedded insight card's CTA is\n * `contact_support_block`. This module cannot import the help module (hosts that don't ship the\n * Help widget stub the import — pulse's webpack `IgnorePlugin`), so the host supplies it. Without\n * it, or with the client's `enable_support_requests` off, the CTA renders disabled.\n */\n onContactSupport?: () => void\n}\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n shouldShowEmbeddedCard = true,\n onContactSupport,\n}) => {\n const { onEvent } = useEvent()\n const { config } = useAppConfig()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n\n const isCredit = transaction?.transaction_type === TransactionType.CREDIT\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n // Insights 2.0 (insights_v2.2.md §8.3, §10.1): branch on the beat the widget already matched from\n // its associated-beats fetch (which carries `widget_type=embedded`). `v2` renders the compact card\n // from the held envelope and `error` the error card, both in the slot above the account block;\n // only `legacy` runs the per-template switch below. There is deliberately no fetch on open.\n const insightRender = shouldShowEmbeddedCard ? resolveInsightRender(beat) : 'legacy'\n const v2Payload = insightRender === 'v2' ? beat?.insights_payload : undefined\n\n const embeddedData =\n shouldShowEmbeddedCard && insightRender === 'legacy'\n ? getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n : null\n\n // `contact_support_block` hands off to the host's flow (see `onContactSupport`). The card itself\n // never opens anything; `isContactSupportCtaDisabled` keeps the CTA inert when it cannot be honoured.\n const handleV2CtaClick = (cta: PrimaryCTA) => {\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n onContactSupport?.()\n }\n }\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={12} p={24}>\n <Paper elevation={2} sx={{ width: 64 }}>\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={64}\n />\n </Paper>\n\n <Description\n displayValue={showInstitution ? transaction.institutionName : undefined}\n transaction={transaction}\n viewOnly={shouldShowViewOnlyMode || showInstitution}\n />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={isCredit ? 'success.main' : 'text.primary'} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {v2Payload && (\n <CompactInsightCard\n beat={beat}\n isCtaDisabled={isContactSupportCtaDisabled(\n v2Payload.primary_cta?.block,\n config,\n onContactSupport,\n )}\n onCtaClick={handleV2CtaClick}\n payload={v2Payload}\n />\n )}\n {insightRender === 'error' && beat && <InsightErrorCard beat={beat} variant=\"plain\" />}\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, p: 8 }}>\n <Text bold={true}>\n {`${transaction.account}\n ${\n showFullNumber\n ? transaction.number\n : '\\u2022'.repeat(4).concat(transaction.number ?? '')\n }`}\n </Text>\n <Text bold={true} truncate={true} variant=\"tiny\">\n {transaction.feed_description}\n </Text>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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kB"}
|
|
1
|
+
{"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useAppConfig,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { type PrimaryCTA, Transaction, TransactionType } from '../../../core'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks`, whose chart blocks\n// reach back into transactions code — the circular-import/TDZ trap `actionBlocksKey.ts` documents.\nimport { isContactSupportCtaDisabled } from '../../../insights-v2/actionBlocks/ContactSupportActionBlock'\nimport CompactInsightCard from '../../../insights-v2/components/CompactInsightCard'\nimport InsightErrorCard from '../../../insights-v2/components/InsightErrorCard'\nimport { actionBlocksKey } from '../../../insights-v2/mappings/actionBlocksKey'\nimport { resolveInsightRender } from '../../../insights-v2/resolveInsightRender'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isTransferTransaction } from '../../../core/utils/TransactionUtils'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n shouldShowEmbeddedCard?: boolean\n /**\n * Opens the host's contact-support flow when the embedded insight card's CTA is\n * `contact_support_block`. This module cannot import the help module (hosts that don't ship the\n * Help widget stub the import — pulse's webpack `IgnorePlugin`), so the host supplies it. Without\n * it, or with the client's `enable_support_requests` off, the CTA renders disabled.\n */\n onContactSupport?: () => void\n}\n\nconst LOGO_SIZE = 64\n// Fixed per Figma; the theme's shape.borderRadius is client-configurable.\nconst LOGO_RADIUS = 8\n\n// Account feed line per Figma: 9/12 bold 700, uppercase, 0.27px tracking.\nconst FEED_LINE_SX = {\n fontWeight: 700,\n letterSpacing: '0.27px',\n textTransform: 'uppercase',\n} as const\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n shouldShowEmbeddedCard = true,\n onContactSupport,\n}) => {\n const { onEvent } = useEvent()\n const { config } = useAppConfig()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n const maskedNumber = transaction?.number\n ? showFullNumber\n ? transaction.number\n : `\\u2022\\u2022\\u2022\\u2022${transaction.number}`\n : undefined\n\n const isCredit = transaction?.transaction_type === TransactionType.CREDIT\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n // Insights 2.0 (insights_v2.2.md §8.3, §10.1): branch on the beat the widget already matched from\n // its associated-beats fetch (which carries `widget_type=embedded`). `v2` renders the compact card\n // from the held envelope and `error` the error card, both in the slot above the account block;\n // only `legacy` runs the per-template switch below. There is deliberately no fetch on open.\n const insightRender = shouldShowEmbeddedCard ? resolveInsightRender(beat) : 'legacy'\n const v2Payload = insightRender === 'v2' ? beat?.insights_payload : undefined\n\n const embeddedData =\n shouldShowEmbeddedCard && insightRender === 'legacy'\n ? getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n : null\n\n // `contact_support_block` hands off to the host's flow (see `onContactSupport`). The card itself\n // never opens anything; `isContactSupportCtaDisabled` keeps the CTA inert when it cannot be honoured.\n const handleV2CtaClick = (cta: PrimaryCTA) => {\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n onContactSupport?.()\n }\n }\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={12} p={24}>\n <Box\n sx={{\n bgcolor: 'background.paper',\n borderRadius: `${LOGO_RADIUS}px`,\n height: LOGO_SIZE,\n overflow: 'hidden',\n width: LOGO_SIZE,\n }}\n >\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={LOGO_SIZE}\n />\n </Box>\n\n <Description\n displayValue={showInstitution ? transaction.institutionName : undefined}\n transaction={transaction}\n viewOnly={shouldShowViewOnlyMode || showInstitution}\n />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={isCredit ? 'success.main' : 'text.primary'} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {v2Payload && (\n <CompactInsightCard\n beat={beat}\n isCtaDisabled={isContactSupportCtaDisabled(\n v2Payload.primary_cta?.block,\n config,\n onContactSupport,\n )}\n onCtaClick={handleV2CtaClick}\n payload={v2Payload}\n />\n )}\n {insightRender === 'error' && beat && <InsightErrorCard beat={beat} variant=\"plain\" />}\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, p: 8 }}>\n <Text bold={true}>{transaction.account}</Text>\n <Stack\n alignItems=\"baseline\"\n data-testid=\"account-feed-line\"\n direction=\"row\"\n gap={4}\n sx={{ overflow: 'hidden' }}\n >\n <Text\n color=\"text.secondary\"\n sx={{ ...FEED_LINE_SX, minWidth: 0 }}\n truncate={true}\n variant=\"tiny\"\n >\n {transaction.feed_description}\n </Text>\n {maskedNumber && (\n <Text\n color=\"text.secondary\"\n sx={{ ...FEED_LINE_SX, flexShrink: 0 }}\n variant=\"tiny\"\n >\n {maskedNumber}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAM,IAAY,IAEZ,KAAc,GAGd,IAAe;AAAA,EACnB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AACjB,GAEM,KAAA,CAAyD,EAC7D,eAAA,IAAgB,IAChB,oBAAA,IAAqB,IACrB,YAAA,IAAa,IACb,aAAA,GACA,wBAAA,IAAyB,IACzB,kBAAA,EAAA,MACI;AACJ,QAAM,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,QAAA,EAAA,IAAW,GAAa,GAC1B,EAAE,cAAA,GAAA,IAAiB,GAAiB,GACpC,EAAE,cAAA,GAAA,IAAiB,GAAa,GAChC,EAAE,UAAU,IAAM,QAAQ,IAAY,eAAe,EAAA,IAAiB,GAAmB,GAEzF,EAAE,oBAAA,EAAA,IAAuB,GAAiB,GAC1C,EACJ,OAAA,GACA,iBAAA,GACA,sBAAA,GACA,iBAAA,GACA,kCAAA,IACA,UAAA,EAAA,IACE,GAAoB,GAElB,CAAC,IAAgC,CAAA,IAAqC,EAAM,SAAS,EAAK,GAE1F,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,EAAK,GAChD,CAAC,IAAiB,EAAA,IAAsB,EAAM,SAAS,EAAK,GAC5D,KAAQ,GAAS,GAEjB,KAAiB,GAAa,UAAU,EAAY,OAAO,SAAS,GACpE,IAAe,GAAa,SAC9B,KACE,EAAY,SACZ,OAA2B,EAAY,MAAA,KACzC,QAEE,IAAW,GAAa,qBAAqB,GAAgB,QAE7D,IAAkB,GAAsB,CAAW,KAAK,EAAQ,EAAY,iBAE5E,IAAO,EAAM,QAAA,MAC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