@mx-cartographer/experiences 7.0.33 → 7.0.34
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
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
2
|
-
import u, { useState as
|
|
2
|
+
import u, { useState as te, useEffect as oe } from "react";
|
|
3
3
|
import { observer as P } from "mobx-react-lite";
|
|
4
4
|
import be from "@mui/material/CssBaseline";
|
|
5
|
-
import { useTheme as
|
|
5
|
+
import { useTheme as Me, ThemeProvider as Ue } from "@mui/material/styles";
|
|
6
6
|
import ze from "@mui/material/Link";
|
|
7
7
|
import K from "@mui/material/Stack";
|
|
8
|
-
import
|
|
9
|
-
import { ChevronLeft as Ke, ChevronRight as
|
|
8
|
+
import pe from "@mui/material/Typography";
|
|
9
|
+
import { ChevronLeft as Ke, ChevronRight as Ae } from "@mxenabled/mx-icons";
|
|
10
10
|
import { L as $e } from "./Loader-DUaFpDGv.mjs";
|
|
11
11
|
import U from "@mui/material/Box";
|
|
12
|
-
import
|
|
13
|
-
import { useInView as
|
|
14
|
-
import { P as Ye, CategoryIcon as je, useTokens as
|
|
15
|
-
import
|
|
12
|
+
import _e from "@mui/material/IconButton";
|
|
13
|
+
import { useInView as Oe } from "react-intersection-observer";
|
|
14
|
+
import { P as Ye, CategoryIcon as je, useTokens as Te, MerchantLogo as Xe, Icon as ie } from "@mxenabled/mxui";
|
|
15
|
+
import de from "@mui/material/styles/useTheme";
|
|
16
16
|
import { b as Qe } from "./Category-CevNQ03n.mjs";
|
|
17
17
|
import { css as qe } from "@mxenabled/cssinjs";
|
|
18
18
|
import { b as Je } from "./Localization-2MODESHW.mjs";
|
|
19
19
|
import et from "@mui/material/CircularProgress";
|
|
20
|
-
import { makeAutoObservable as
|
|
21
|
-
import { G as
|
|
22
|
-
import { B as
|
|
20
|
+
import { makeAutoObservable as he, runInAction as We } from "mobx";
|
|
21
|
+
import { G as Ce, a as tt, u as it, b as ot } from "./useCombineEvents-BUDIR1ba.mjs";
|
|
22
|
+
import { B as fe } from "./BeatApi-DhJpgCLz.mjs";
|
|
23
23
|
import rt from "@mui/material/Card";
|
|
24
24
|
import lt from "@mui/material/CardActions";
|
|
25
25
|
import nt from "@mui/material/CardContent";
|
|
26
26
|
import at from "@mui/material/CardHeader";
|
|
27
|
-
const
|
|
27
|
+
const me = {
|
|
28
28
|
featureVersion: "spendVsIncomeTrends"
|
|
29
29
|
};
|
|
30
30
|
class ct {
|
|
31
|
-
copyApi = new
|
|
31
|
+
copyApi = new Ce("/", "");
|
|
32
32
|
copyObject = {};
|
|
33
33
|
namespace = "experiences";
|
|
34
34
|
translationKey = "micro_insights";
|
|
35
35
|
constructor() {
|
|
36
|
-
|
|
36
|
+
he(this);
|
|
37
37
|
}
|
|
38
38
|
// NOTE: Not sure if this is special case, but other stores have this deprecation todo
|
|
39
39
|
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
40
40
|
// TODO: Remove this function
|
|
41
41
|
initialize = async (o, t) => {
|
|
42
|
-
this.copyApi = new
|
|
42
|
+
this.copyApi = new Ce(o, t), await this.loadCopy();
|
|
43
43
|
};
|
|
44
44
|
loadCopy = async () => {
|
|
45
45
|
const o = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
46
|
-
|
|
46
|
+
We(() => {
|
|
47
47
|
this.copyObject = o[this.translationKey];
|
|
48
48
|
});
|
|
49
49
|
};
|
|
@@ -57,7 +57,7 @@ class ct {
|
|
|
57
57
|
return this.copyObject.zero_state;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const Ee = {
|
|
61
61
|
BillAmountNotStandard: "BillAmountNotStandard",
|
|
62
62
|
CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
|
|
63
63
|
DuplicatePaymentV2: "DuplicatePaymentV2",
|
|
@@ -74,37 +74,37 @@ const de = {
|
|
|
74
74
|
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
75
75
|
MonthlySpendComparison: "MonthlySpendComparison",
|
|
76
76
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
77
|
-
}, S = window?.app?.clientConfig?.microwidget_instance_id || "",
|
|
77
|
+
}, S = window?.app?.clientConfig?.microwidget_instance_id || "", ge = {
|
|
78
78
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
79
|
-
},
|
|
79
|
+
}, we = (i) => `on${i}Click`, xe = (i) => `on${i}View`, De = (i) => `on${i}ViewFirstTime`, ue = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), st = () => Object.values(Ee).reduce(
|
|
80
80
|
(i, o) => ({
|
|
81
81
|
...i,
|
|
82
|
-
[
|
|
82
|
+
[we(o)]: {
|
|
83
83
|
action: x.MICRO_BEAT_CLICKED,
|
|
84
84
|
category: w.BEAT_INTERACTION,
|
|
85
|
-
label:
|
|
85
|
+
label: ue(o),
|
|
86
86
|
value: S
|
|
87
87
|
}
|
|
88
88
|
}),
|
|
89
89
|
{}
|
|
90
|
-
), dt = () => Object.values(
|
|
90
|
+
), dt = () => Object.values(Ee).reduce(
|
|
91
91
|
(i, o) => ({
|
|
92
92
|
...i,
|
|
93
|
-
[
|
|
93
|
+
[xe(o)]: {
|
|
94
94
|
action: x.MICRO_BEAT_DISPLAYED,
|
|
95
95
|
category: w.BEAT_INTERACTION,
|
|
96
|
-
label:
|
|
96
|
+
label: ue(o),
|
|
97
97
|
value: S
|
|
98
98
|
}
|
|
99
99
|
}),
|
|
100
100
|
{}
|
|
101
|
-
), ht = () => Object.values(
|
|
101
|
+
), ht = () => Object.values(Ee).reduce(
|
|
102
102
|
(i, o) => ({
|
|
103
103
|
...i,
|
|
104
|
-
[
|
|
104
|
+
[De(o)]: {
|
|
105
105
|
action: x.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
106
106
|
category: w.BEAT_INTERACTION,
|
|
107
|
-
label:
|
|
107
|
+
label: ue(o),
|
|
108
108
|
value: S
|
|
109
109
|
}
|
|
110
110
|
}),
|
|
@@ -124,7 +124,7 @@ const de = {
|
|
|
124
124
|
ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
|
|
125
125
|
ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
|
|
126
126
|
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
127
|
-
},
|
|
127
|
+
}, Le = {
|
|
128
128
|
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
129
129
|
}, x = {
|
|
130
130
|
CONTROL_BACKWARD: "Control Backward",
|
|
@@ -134,32 +134,32 @@ const de = {
|
|
|
134
134
|
MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
|
|
135
135
|
SWIPE_BACKWARD: "Swipe Backward",
|
|
136
136
|
SWIPE_FORWARD: "Swipe Forward"
|
|
137
|
-
},
|
|
137
|
+
}, k = {
|
|
138
138
|
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
139
139
|
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
140
140
|
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
141
141
|
}, Re = {
|
|
142
|
-
[
|
|
142
|
+
[k.MICRO_WIDGET_CAROUSEL]: {
|
|
143
143
|
label: W.MICRO_WIDGET,
|
|
144
|
-
name:
|
|
145
|
-
path:
|
|
144
|
+
name: k.MICRO_WIDGET_CAROUSEL,
|
|
145
|
+
path: ge.INSIGHTS_MICRO_WIDGET,
|
|
146
146
|
value: S
|
|
147
147
|
},
|
|
148
148
|
// zero state
|
|
149
|
-
[
|
|
149
|
+
[k.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
150
150
|
label: W.MICRO_WIDGET,
|
|
151
|
-
name:
|
|
152
|
-
path:
|
|
151
|
+
name: k.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
152
|
+
path: ge.INSIGHTS_MICRO_WIDGET,
|
|
153
153
|
value: S
|
|
154
154
|
},
|
|
155
155
|
// no relevant cards
|
|
156
|
-
[
|
|
156
|
+
[k.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
157
157
|
label: W.MICRO_WIDGET,
|
|
158
|
-
name:
|
|
158
|
+
name: k.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
159
159
|
path: "/micro-widget",
|
|
160
160
|
value: S
|
|
161
161
|
}
|
|
162
|
-
},
|
|
162
|
+
}, Ie = {
|
|
163
163
|
// carousel control interaction events - clicks and swipes
|
|
164
164
|
[M.ON_CAROUSEL_BACK_CLICK]: {
|
|
165
165
|
action: x.CONTROL_BACKWARD,
|
|
@@ -192,7 +192,7 @@ const de = {
|
|
|
192
192
|
label: W.VIEW_MORE,
|
|
193
193
|
value: S
|
|
194
194
|
},
|
|
195
|
-
[
|
|
195
|
+
[Le.ON_VIEW_MORE_VIEWED]: {
|
|
196
196
|
action: x.MICRO_BEAT_DISPLAYED,
|
|
197
197
|
category: w.BEAT_INTERACTION,
|
|
198
198
|
label: W.VIEW_MORE,
|
|
@@ -201,28 +201,28 @@ const de = {
|
|
|
201
201
|
...st(),
|
|
202
202
|
...dt(),
|
|
203
203
|
...ht()
|
|
204
|
-
},
|
|
204
|
+
}, ye = async (i, o) => !o || !Ie[i] ? null : o.sendAnalyticEvent(Ie[i]).then((t) => t).catch((t) => {
|
|
205
205
|
throw t;
|
|
206
|
-
}),
|
|
206
|
+
}), ve = async (i, o) => !o || !Re[i] ? null : o.sendAnalyticsPageview(Re[i]).then((t) => t).catch((t) => {
|
|
207
207
|
throw t;
|
|
208
208
|
});
|
|
209
209
|
class Et {
|
|
210
|
-
onAnalyticEvent =
|
|
211
|
-
onAnalyticPageView =
|
|
212
|
-
beatApi = new
|
|
210
|
+
onAnalyticEvent = ye;
|
|
211
|
+
onAnalyticPageView = ve;
|
|
212
|
+
beatApi = new fe("/", "");
|
|
213
213
|
constructor() {
|
|
214
|
-
|
|
214
|
+
he(this);
|
|
215
215
|
}
|
|
216
216
|
initialize = async (o, t, r) => {
|
|
217
217
|
this.onAnalyticEvent = (l, n) => {
|
|
218
|
-
|
|
218
|
+
ye(l, n).then((a) => a).catch((a) => {
|
|
219
219
|
throw a.status === 401 && r(), a;
|
|
220
220
|
});
|
|
221
221
|
}, this.onAnalyticPageView = (l, n) => {
|
|
222
|
-
|
|
222
|
+
ve(l, n).then((a) => a).catch((a) => {
|
|
223
223
|
throw a.status === 401 && r(), a;
|
|
224
224
|
});
|
|
225
|
-
}, this.beatApi = new
|
|
225
|
+
}, this.beatApi = new fe(o, t);
|
|
226
226
|
};
|
|
227
227
|
updateBeat = async (o) => {
|
|
228
228
|
this.beatApi.updateBeat(o);
|
|
@@ -239,12 +239,12 @@ class ut {
|
|
|
239
239
|
token = "";
|
|
240
240
|
isInitialized = !1;
|
|
241
241
|
constructor() {
|
|
242
|
-
this.copyStore = new ct(), this.insightsMicroWidgetStore = new Et(),
|
|
242
|
+
this.copyStore = new ct(), this.insightsMicroWidgetStore = new Et(), he(this);
|
|
243
243
|
}
|
|
244
244
|
initialize = async (o, t, r) => {
|
|
245
245
|
await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, r);
|
|
246
246
|
const l = await tt(o, t, "1.0.0", "Micro Insights Carousel");
|
|
247
|
-
|
|
247
|
+
We(() => {
|
|
248
248
|
this.session = l, this.isInitialized = !0;
|
|
249
249
|
});
|
|
250
250
|
};
|
|
@@ -254,7 +254,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
254
254
|
onPageview: o,
|
|
255
255
|
store: t,
|
|
256
256
|
children: r
|
|
257
|
-
}) => /* @__PURE__ */ e($.Provider, { value: { onEvent: i, onPageview: o, store: t, children: r }, children: r }),
|
|
257
|
+
}) => /* @__PURE__ */ e($.Provider, { value: { onEvent: i, onPageview: o, store: t, children: r }, children: r }), re = u.forwardRef(
|
|
258
258
|
function({
|
|
259
259
|
actionText: o,
|
|
260
260
|
ariaLabel: t,
|
|
@@ -272,8 +272,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
272
272
|
title: m,
|
|
273
273
|
variant: c,
|
|
274
274
|
widthOverrides: E
|
|
275
|
-
},
|
|
276
|
-
const y =
|
|
275
|
+
}, g) {
|
|
276
|
+
const y = de(), [D, O] = u.useState(!1), { cardStyle: v, linkTextStyle: B } = f, z = c ? v : { border: "none", boxShadow: "none", ...v }, R = /* @__PURE__ */ e(
|
|
277
277
|
Ye,
|
|
278
278
|
{
|
|
279
279
|
className: "mx-micro-card-description",
|
|
@@ -306,7 +306,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
306
306
|
"aria-label": t,
|
|
307
307
|
"aria-labelledby": "divButton",
|
|
308
308
|
"aria-roledescription": "slide",
|
|
309
|
-
ref:
|
|
309
|
+
ref: g,
|
|
310
310
|
role: "group",
|
|
311
311
|
sx: {
|
|
312
312
|
height: "100%",
|
|
@@ -322,7 +322,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
322
322
|
onClick: () => _(),
|
|
323
323
|
onKeyDown: () => O(!1),
|
|
324
324
|
onKeyUp: () => O(!0),
|
|
325
|
-
ref:
|
|
325
|
+
ref: g,
|
|
326
326
|
role: "button",
|
|
327
327
|
sx: {
|
|
328
328
|
border: D ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
|
|
@@ -360,13 +360,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
360
360
|
at,
|
|
361
361
|
{
|
|
362
362
|
avatar: C && a,
|
|
363
|
-
subheader: p &&
|
|
363
|
+
subheader: p && R,
|
|
364
364
|
sx: { color: h.headerColor, p: 0 },
|
|
365
365
|
title: m,
|
|
366
366
|
titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
|
|
367
367
|
}
|
|
368
368
|
),
|
|
369
|
-
/* @__PURE__ */ e(nt, { sx: { p: 0 }, children: !p &&
|
|
369
|
+
/* @__PURE__ */ e(nt, { sx: { p: 0 }, children: !p && R }),
|
|
370
370
|
!!o && /* @__PURE__ */ e(
|
|
371
371
|
lt,
|
|
372
372
|
{
|
|
@@ -383,7 +383,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
383
383
|
fontWeight: "bold",
|
|
384
384
|
px: 28,
|
|
385
385
|
fontFamily: L.typography.fontFamily,
|
|
386
|
-
...
|
|
386
|
+
...B
|
|
387
387
|
}),
|
|
388
388
|
children: o
|
|
389
389
|
}
|
|
@@ -401,12 +401,12 @@ const $ = u.createContext(null), pt = ({
|
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
403
|
), _t = ({ beat: i }) => {
|
|
404
|
-
const [o, t] =
|
|
405
|
-
return
|
|
404
|
+
const [o, t] = te(Qe.UNCATEGORIZED);
|
|
405
|
+
return oe(() => {
|
|
406
406
|
i.primary_category_guid ? t(i.primary_category_guid) : i.category_guids?.length && t(i.category_guids[0]);
|
|
407
407
|
}, []), /* @__PURE__ */ e(je, { categoryGuid: o, size: 16, sx: { minWidth: 16 } });
|
|
408
408
|
}, Ct = ({ beat: i }) => {
|
|
409
|
-
const o =
|
|
409
|
+
const o = Te(), t = ft(o);
|
|
410
410
|
return /* @__PURE__ */ e(
|
|
411
411
|
Xe,
|
|
412
412
|
{
|
|
@@ -421,7 +421,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
421
421
|
"& .kyper-categoryicon": {
|
|
422
422
|
display: "flex"
|
|
423
423
|
}
|
|
424
|
-
}), mt = P(Ct),
|
|
424
|
+
}), mt = P(Ct), gt = ({
|
|
425
425
|
color: i = "currentColor",
|
|
426
426
|
height: o,
|
|
427
427
|
size: t = 16,
|
|
@@ -447,18 +447,18 @@ const $ = u.createContext(null), pt = ({
|
|
|
447
447
|
}
|
|
448
448
|
)
|
|
449
449
|
}
|
|
450
|
-
),
|
|
450
|
+
), Rt = (i) => i ? i.data ? i.data.map((o) => {
|
|
451
451
|
const t = {};
|
|
452
452
|
return i.names?.map((r, l) => {
|
|
453
453
|
t[r] = o[l];
|
|
454
454
|
}), t;
|
|
455
455
|
}) : [] : [], It = (i, o) => {
|
|
456
|
-
const t =
|
|
456
|
+
const t = Rt(i), r = t.length / 2, l = t.slice(0, r), n = t.slice(r);
|
|
457
457
|
return !l.length || !n.length ? o.Color.Primary300 : l[0].amount > n[0].amount ? o.Color.Error300 : l[0].amount < n[0].amount ? o.Color.Success300 : o.Color.Primary300;
|
|
458
458
|
}, yt = ({ beat: i }) => {
|
|
459
|
-
const o =
|
|
460
|
-
return /* @__PURE__ */ e(
|
|
461
|
-
},
|
|
459
|
+
const o = Te(), t = It(i.data_series, o);
|
|
460
|
+
return /* @__PURE__ */ e(ie, { name: "bar_chart", sx: { color: t } });
|
|
461
|
+
}, Ne = () => /* @__PURE__ */ I("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
462
462
|
/* @__PURE__ */ e(
|
|
463
463
|
"path",
|
|
464
464
|
{
|
|
@@ -1239,10 +1239,10 @@ const $ = u.createContext(null), pt = ({
|
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
] })
|
|
1242
|
-
] }),
|
|
1243
|
-
const l =
|
|
1244
|
-
return r === 0 ? /* @__PURE__ */ e(
|
|
1245
|
-
|
|
1242
|
+
] }), Se = ({ beat: i, clientColorScheme: o, color: t, type: r }) => {
|
|
1243
|
+
const l = de(), n = o?.primary_300 ? o.primary_300 : l.palette.primary.main;
|
|
1244
|
+
return r === 0 ? /* @__PURE__ */ e(ie, { fill: !0, name: "error", sx: { color: t || n } }) : r === 1 && i ? /* @__PURE__ */ e(_t, { beat: i }) : r === 2 && i ? /* @__PURE__ */ e(mt, { beat: i }) : r === 3 && i ? /* @__PURE__ */ e(yt, { beat: i }) : r === 5 && i ? /* @__PURE__ */ e(ie, { name: "campaign" }) : /* @__PURE__ */ e(
|
|
1245
|
+
ie,
|
|
1246
1246
|
{
|
|
1247
1247
|
fill: !0,
|
|
1248
1248
|
name: "info",
|
|
@@ -1251,7 +1251,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
);
|
|
1254
|
-
},
|
|
1254
|
+
}, F = () => {
|
|
1255
1255
|
const i = u.useContext($);
|
|
1256
1256
|
if (!i)
|
|
1257
1257
|
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
@@ -1268,17 +1268,17 @@ const $ = u.createContext(null), pt = ({
|
|
|
1268
1268
|
if (!i)
|
|
1269
1269
|
throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
|
|
1270
1270
|
return { onEvent: i.onEvent };
|
|
1271
|
-
},
|
|
1271
|
+
}, Ve = () => {
|
|
1272
1272
|
const i = u.useContext($);
|
|
1273
1273
|
if (!i)
|
|
1274
1274
|
throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
|
|
1275
1275
|
return { onPageview: i.onPageview };
|
|
1276
|
-
},
|
|
1276
|
+
}, He = {
|
|
1277
1277
|
LARGE: 180,
|
|
1278
1278
|
STANDARD: 154,
|
|
1279
1279
|
XLARGE: 200,
|
|
1280
1280
|
XXLARGE: 248
|
|
1281
|
-
}, St = 50,
|
|
1281
|
+
}, St = 50, ke = 1, Mt = ({
|
|
1282
1282
|
ariaLabel: i,
|
|
1283
1283
|
backgroundColor: o,
|
|
1284
1284
|
beat: t,
|
|
@@ -1293,18 +1293,18 @@ const $ = u.createContext(null), pt = ({
|
|
|
1293
1293
|
variant: f,
|
|
1294
1294
|
widthOverrides: h
|
|
1295
1295
|
}) => {
|
|
1296
|
-
const { ref: m, inView: c } =
|
|
1297
|
-
threshold:
|
|
1298
|
-
}), { cardsCopy: E } =
|
|
1299
|
-
|
|
1300
|
-
c && (t.has_been_displayed ?
|
|
1296
|
+
const { ref: m, inView: c } = Oe({
|
|
1297
|
+
threshold: ke
|
|
1298
|
+
}), { cardsCopy: E } = F(), { onEvent: g } = Y(), { updateBeat: y, updateOffer: D } = vt();
|
|
1299
|
+
oe(() => {
|
|
1300
|
+
c && (t.has_been_displayed ? g(xe(t.template)) : (t.guid.startsWith("OFR") ? D({
|
|
1301
1301
|
...t,
|
|
1302
1302
|
has_been_displayed: !0
|
|
1303
1303
|
}) : y({
|
|
1304
1304
|
...t,
|
|
1305
1305
|
has_been_displayed: !0
|
|
1306
|
-
}),
|
|
1307
|
-
}, [c]),
|
|
1306
|
+
}), g(De(t.template))));
|
|
1307
|
+
}, [c]), oe(() => {
|
|
1308
1308
|
if (c && t)
|
|
1309
1309
|
if (t.template === "MarketingOffer") {
|
|
1310
1310
|
const v = t;
|
|
@@ -1321,7 +1321,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1321
1321
|
});
|
|
1322
1322
|
}, [t, a, c]);
|
|
1323
1323
|
const O = () => {
|
|
1324
|
-
if (p && p(t),
|
|
1324
|
+
if (p && p(t), g(we(t.template)), t.template === "MarketingOffer") {
|
|
1325
1325
|
const v = t;
|
|
1326
1326
|
_?.capture("clicked_messaging_insight", {
|
|
1327
1327
|
template: t.template,
|
|
@@ -1336,7 +1336,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1336
1336
|
});
|
|
1337
1337
|
};
|
|
1338
1338
|
return /* @__PURE__ */ e(
|
|
1339
|
-
|
|
1339
|
+
re,
|
|
1340
1340
|
{
|
|
1341
1341
|
actionText: t.micro_call_to_action || E.micro_card_cta,
|
|
1342
1342
|
ariaLabel: i,
|
|
@@ -1344,8 +1344,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1344
1344
|
description: t?.html_micro_description && t?.html_micro_description.length > 0 ? t.html_micro_description : t.html_description,
|
|
1345
1345
|
fontColors: { buttonColor: r?.primary_300 },
|
|
1346
1346
|
heightOverrides: n,
|
|
1347
|
-
icon:
|
|
1348
|
-
|
|
1347
|
+
icon: Se && /* @__PURE__ */ e(
|
|
1348
|
+
Se,
|
|
1349
1349
|
{
|
|
1350
1350
|
beat: t,
|
|
1351
1351
|
clientColorScheme: r,
|
|
@@ -1375,7 +1375,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1375
1375
|
shouldApplyNewAnimation: d = !1,
|
|
1376
1376
|
visibleCardsCount: p = 1
|
|
1377
1377
|
}) => {
|
|
1378
|
-
const _ =
|
|
1378
|
+
const _ = Me(), { carouselCopy: C } = F(), f = Math.floor(a) > n || o - p + 1 === 0, h = a < 0 || t - 1 === o, m = _.palette.grey[500], c = i?.primary_300 ?? _.palette.primary.main;
|
|
1379
1379
|
return /* @__PURE__ */ I(
|
|
1380
1380
|
K,
|
|
1381
1381
|
{
|
|
@@ -1392,7 +1392,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1392
1392
|
},
|
|
1393
1393
|
children: [
|
|
1394
1394
|
/* @__PURE__ */ e(
|
|
1395
|
-
|
|
1395
|
+
_e,
|
|
1396
1396
|
{
|
|
1397
1397
|
"aria-disabled": f,
|
|
1398
1398
|
"aria-label": C.previous_insight_cta_aria,
|
|
@@ -1408,8 +1408,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1408
1408
|
)
|
|
1409
1409
|
}
|
|
1410
1410
|
),
|
|
1411
|
-
Array.from({ length: t }).map((E,
|
|
1412
|
-
const y =
|
|
1411
|
+
Array.from({ length: t }).map((E, g) => {
|
|
1412
|
+
const y = g === o;
|
|
1413
1413
|
return /* @__PURE__ */ e(
|
|
1414
1414
|
U,
|
|
1415
1415
|
{
|
|
@@ -1431,18 +1431,18 @@ const $ = u.createContext(null), pt = ({
|
|
|
1431
1431
|
width: y && d ? 24 : 8
|
|
1432
1432
|
}
|
|
1433
1433
|
},
|
|
1434
|
-
`carousel-button-${
|
|
1434
|
+
`carousel-button-${g}`
|
|
1435
1435
|
);
|
|
1436
1436
|
}),
|
|
1437
1437
|
/* @__PURE__ */ e(
|
|
1438
|
-
|
|
1438
|
+
_e,
|
|
1439
1439
|
{
|
|
1440
1440
|
"aria-disabled": h,
|
|
1441
1441
|
"aria-label": C.next_insight_cta_aria,
|
|
1442
1442
|
disabled: h,
|
|
1443
1443
|
onClick: r,
|
|
1444
1444
|
children: /* @__PURE__ */ e(
|
|
1445
|
-
|
|
1445
|
+
Ae,
|
|
1446
1446
|
{
|
|
1447
1447
|
style: {
|
|
1448
1448
|
color: h ? m : c
|
|
@@ -1472,77 +1472,77 @@ const $ = u.createContext(null), pt = ({
|
|
|
1472
1472
|
visibleCardsCount: c = 1
|
|
1473
1473
|
// Default to 1 card visible
|
|
1474
1474
|
}) => {
|
|
1475
|
-
const E = u.useRef(null),
|
|
1475
|
+
const E = u.useRef(null), g = u.useRef(null), [y, D] = u.useState(0), [O, v] = u.useState(null), [B, z] = u.useState(null), [R, L] = u.useState(null), [le, G] = u.useState(p), { carouselCopy: N } = F(), { onEvent: b } = Y();
|
|
1476
1476
|
u.useEffect(() => {
|
|
1477
1477
|
if (E.current && !o) {
|
|
1478
1478
|
const s = E.current.offsetWidth, A = 8;
|
|
1479
1479
|
let V;
|
|
1480
1480
|
if (c > 1) {
|
|
1481
|
-
const
|
|
1482
|
-
V = (s -
|
|
1481
|
+
const J = (s - (c - 1) * A) / c / 3;
|
|
1482
|
+
V = (s - J - (c - 1) * A) / c;
|
|
1483
1483
|
} else
|
|
1484
1484
|
V = s;
|
|
1485
1485
|
L(V);
|
|
1486
1486
|
}
|
|
1487
1487
|
}, [c, E.current?.offsetWidth]), u.useEffect(() => {
|
|
1488
|
-
const s =
|
|
1488
|
+
const s = g.current?.offsetWidth;
|
|
1489
1489
|
if (typeof s == "number" && o) {
|
|
1490
1490
|
const A = (Z) => {
|
|
1491
1491
|
G(!0);
|
|
1492
|
-
const
|
|
1492
|
+
const ee = [
|
|
1493
1493
|
{ maxWidth: 375, cardWidth: 268 },
|
|
1494
1494
|
{ maxWidth: 444, cardWidth: 300 },
|
|
1495
1495
|
{ maxWidth: 599, cardWidth: 350 },
|
|
1496
1496
|
{ maxWidth: 749, cardWidth: 450 },
|
|
1497
1497
|
{ maxWidth: 900, cardWidth: 600 }
|
|
1498
|
-
].find((
|
|
1499
|
-
return
|
|
1498
|
+
].find((se) => Z <= se.maxWidth);
|
|
1499
|
+
return ee ? ee.cardWidth : 750;
|
|
1500
1500
|
};
|
|
1501
1501
|
L(A(s));
|
|
1502
1502
|
const V = () => {
|
|
1503
|
-
const Z =
|
|
1503
|
+
const Z = g.current?.offsetWidth;
|
|
1504
1504
|
typeof Z == "number" && L(A(Z));
|
|
1505
1505
|
};
|
|
1506
1506
|
return window.addEventListener("resize", V), () => {
|
|
1507
1507
|
window.removeEventListener("resize", V);
|
|
1508
1508
|
};
|
|
1509
1509
|
}
|
|
1510
|
-
}, [o,
|
|
1511
|
-
const
|
|
1512
|
-
b(M.ON_CAROUSEL_FORWARD_CLICK, i), E.current &&
|
|
1513
|
-
left: y +
|
|
1510
|
+
}, [o, g]);
|
|
1511
|
+
const j = () => {
|
|
1512
|
+
b(M.ON_CAROUSEL_FORWARD_CLICK, i), E.current && R && E.current.scrollTo({
|
|
1513
|
+
left: y + R + 8,
|
|
1514
1514
|
top: 0,
|
|
1515
1515
|
behavior: "smooth"
|
|
1516
1516
|
});
|
|
1517
|
-
},
|
|
1518
|
-
b(M.ON_CAROUSEL_BACK_CLICK, i), E.current &&
|
|
1519
|
-
left: Math.max(0, y - (
|
|
1517
|
+
}, X = () => {
|
|
1518
|
+
b(M.ON_CAROUSEL_BACK_CLICK, i), E.current && R && E.current.scrollTo({
|
|
1519
|
+
left: Math.max(0, y - (R + 8)),
|
|
1520
1520
|
top: 0,
|
|
1521
1521
|
behavior: "smooth"
|
|
1522
1522
|
});
|
|
1523
|
-
},
|
|
1523
|
+
}, ne = () => {
|
|
1524
1524
|
E.current && D(E.current.scrollLeft);
|
|
1525
|
-
},
|
|
1526
|
-
if (!
|
|
1527
|
-
|
|
1528
|
-
},
|
|
1525
|
+
}, ae = () => {
|
|
1526
|
+
if (!B || !O) return;
|
|
1527
|
+
B - O > St ? b(M.ON_CAROUSEL_FORWARD_SWIPE, i) : b(M.ON_CAROUSEL_BACK_SWIPE, i);
|
|
1528
|
+
}, Q = (s) => {
|
|
1529
1529
|
v(s.targetTouches[0].clientX);
|
|
1530
|
-
},
|
|
1530
|
+
}, q = (s) => {
|
|
1531
1531
|
v(null), z(s.targetTouches[0].clientX);
|
|
1532
|
-
},
|
|
1532
|
+
}, T = {
|
|
1533
1533
|
clientColorScheme: r,
|
|
1534
1534
|
showCTAColocatedWithText: l,
|
|
1535
1535
|
heightOverrides: n,
|
|
1536
1536
|
posthog: d,
|
|
1537
1537
|
showIcon: C,
|
|
1538
1538
|
variant: h
|
|
1539
|
-
},
|
|
1539
|
+
}, ce = R ? Math.round(y / (R + 8)) : 0, Ze = E.current ? E.current.scrollWidth - E.current.offsetWidth : 0;
|
|
1540
1540
|
return /* @__PURE__ */ I(
|
|
1541
1541
|
K,
|
|
1542
1542
|
{
|
|
1543
|
-
"aria-label":
|
|
1543
|
+
"aria-label": N.carousel_title,
|
|
1544
1544
|
"aria-roledescription": "carousel",
|
|
1545
|
-
ref:
|
|
1545
|
+
ref: g,
|
|
1546
1546
|
role: "group/region",
|
|
1547
1547
|
sx: {
|
|
1548
1548
|
alignItems: "center",
|
|
@@ -1555,10 +1555,10 @@ const $ = u.createContext(null), pt = ({
|
|
|
1555
1555
|
K,
|
|
1556
1556
|
{
|
|
1557
1557
|
direction: "row",
|
|
1558
|
-
onScroll:
|
|
1559
|
-
onTouchEnd:
|
|
1560
|
-
onTouchMove:
|
|
1561
|
-
onTouchStart:
|
|
1558
|
+
onScroll: ne,
|
|
1559
|
+
onTouchEnd: ae,
|
|
1560
|
+
onTouchMove: Q,
|
|
1561
|
+
onTouchStart: q,
|
|
1562
1562
|
ref: E,
|
|
1563
1563
|
sx: {
|
|
1564
1564
|
alignItems: "center",
|
|
@@ -1579,21 +1579,21 @@ const $ = u.createContext(null), pt = ({
|
|
|
1579
1579
|
},
|
|
1580
1580
|
children: [
|
|
1581
1581
|
t.map((s, A) => {
|
|
1582
|
-
const V = A + 1, Z = t.length + 1,
|
|
1583
|
-
|
|
1582
|
+
const V = A + 1, Z = t.length + 1, J = Je(
|
|
1583
|
+
N.card_position_in_carousel_aria,
|
|
1584
1584
|
V.toString(),
|
|
1585
1585
|
Z.toString()
|
|
1586
|
-
),
|
|
1586
|
+
), ee = s.micro_title && s.micro_title.length > 0, se = s.micro_description && s.micro_description.length > 0, Pe = ee ? s.micro_title : s.title, Ge = se ? s.micro_description : s.description;
|
|
1587
1587
|
return /* @__PURE__ */ e(
|
|
1588
1588
|
Mt,
|
|
1589
1589
|
{
|
|
1590
|
-
ariaLabel: `${
|
|
1590
|
+
ariaLabel: `${J}: ${Pe}, ${Ge}`,
|
|
1591
1591
|
beat: s,
|
|
1592
1592
|
index: A,
|
|
1593
|
-
isActiveCard: A ===
|
|
1593
|
+
isActiveCard: A === ce,
|
|
1594
1594
|
onCardClick: a,
|
|
1595
|
-
widthOverrides:
|
|
1596
|
-
...
|
|
1595
|
+
widthOverrides: R || void 0,
|
|
1596
|
+
...T
|
|
1597
1597
|
},
|
|
1598
1598
|
`${s.guid} ${A}`
|
|
1599
1599
|
);
|
|
@@ -1601,10 +1601,10 @@ const $ = u.createContext(null), pt = ({
|
|
|
1601
1601
|
/* @__PURE__ */ e(
|
|
1602
1602
|
Vt,
|
|
1603
1603
|
{
|
|
1604
|
-
isActiveCard:
|
|
1604
|
+
isActiveCard: ce === t.length,
|
|
1605
1605
|
onCardClick: a,
|
|
1606
|
-
widthOverrides:
|
|
1607
|
-
...
|
|
1606
|
+
widthOverrides: R || void 0,
|
|
1607
|
+
...T
|
|
1608
1608
|
}
|
|
1609
1609
|
)
|
|
1610
1610
|
]
|
|
@@ -1614,13 +1614,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
1614
1614
|
At,
|
|
1615
1615
|
{
|
|
1616
1616
|
clientColorScheme: r,
|
|
1617
|
-
currentBeatIndex:
|
|
1617
|
+
currentBeatIndex: ce + c - 1,
|
|
1618
1618
|
numBeats: t.length + 1,
|
|
1619
|
-
onNextClick:
|
|
1620
|
-
onPreviousClick:
|
|
1619
|
+
onNextClick: j,
|
|
1620
|
+
onPreviousClick: X,
|
|
1621
1621
|
scrollRightBoundary: Ze,
|
|
1622
1622
|
scrollX: y,
|
|
1623
|
-
shouldApplyNewAnimation:
|
|
1623
|
+
shouldApplyNewAnimation: le,
|
|
1624
1624
|
visibleCardsCount: c
|
|
1625
1625
|
}
|
|
1626
1626
|
)
|
|
@@ -1634,7 +1634,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1634
1634
|
posthog: r,
|
|
1635
1635
|
widthOverrides: l
|
|
1636
1636
|
}) => {
|
|
1637
|
-
const { carouselCopy: n } =
|
|
1637
|
+
const { carouselCopy: n } = F(), { onEvent: a } = Y(), d = () => {
|
|
1638
1638
|
a && (a(M.ON_VIEW_MORE_CLICKED, i), t(), r?.capture("clicked_view_more"));
|
|
1639
1639
|
};
|
|
1640
1640
|
return n ? /* @__PURE__ */ I(
|
|
@@ -1650,7 +1650,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1650
1650
|
},
|
|
1651
1651
|
children: [
|
|
1652
1652
|
/* @__PURE__ */ e(
|
|
1653
|
-
|
|
1653
|
+
pe,
|
|
1654
1654
|
{
|
|
1655
1655
|
sx: {
|
|
1656
1656
|
fontSize: 18,
|
|
@@ -1678,7 +1678,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1678
1678
|
underline: "none",
|
|
1679
1679
|
children: [
|
|
1680
1680
|
/* @__PURE__ */ e(
|
|
1681
|
-
|
|
1681
|
+
pe,
|
|
1682
1682
|
{
|
|
1683
1683
|
sx: {
|
|
1684
1684
|
color: o?.primary_300,
|
|
@@ -1690,7 +1690,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1690
1690
|
children: n.view_all_insights_in_full_feed_cta_aria
|
|
1691
1691
|
}
|
|
1692
1692
|
),
|
|
1693
|
-
/* @__PURE__ */ e(
|
|
1693
|
+
/* @__PURE__ */ e(Ae, { sx: { color: o?.primary_300, ml: "8px" } })
|
|
1694
1694
|
]
|
|
1695
1695
|
}
|
|
1696
1696
|
)
|
|
@@ -1702,7 +1702,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1702
1702
|
widthOverrides: o,
|
|
1703
1703
|
children: t
|
|
1704
1704
|
}) => {
|
|
1705
|
-
const { carouselCopy: r } =
|
|
1705
|
+
const { carouselCopy: r } = F();
|
|
1706
1706
|
return /* @__PURE__ */ e(
|
|
1707
1707
|
U,
|
|
1708
1708
|
{
|
|
@@ -1718,7 +1718,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1718
1718
|
children: t
|
|
1719
1719
|
}
|
|
1720
1720
|
);
|
|
1721
|
-
},
|
|
1721
|
+
}, Fe = ({
|
|
1722
1722
|
ariaLabel: i,
|
|
1723
1723
|
carouselSize: o,
|
|
1724
1724
|
clientColorScheme: t,
|
|
@@ -1730,9 +1730,9 @@ const $ = u.createContext(null), pt = ({
|
|
|
1730
1730
|
variant: p,
|
|
1731
1731
|
widthOverrides: _
|
|
1732
1732
|
}) => {
|
|
1733
|
-
const { cardsCopy: C } =
|
|
1733
|
+
const { cardsCopy: C } = F(), { onEvent: f } = Y(), { onPageview: h } = Ve();
|
|
1734
1734
|
u.useEffect(() => {
|
|
1735
|
-
h(
|
|
1735
|
+
h(k.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1736
1736
|
}, []);
|
|
1737
1737
|
const m = () => {
|
|
1738
1738
|
l && l(), f(M.ON_NO_RELEVANT_INSIGHTS_CLICKED), n?.capture("clicked_insight", {
|
|
@@ -1740,14 +1740,14 @@ const $ = u.createContext(null), pt = ({
|
|
|
1740
1740
|
});
|
|
1741
1741
|
};
|
|
1742
1742
|
return /* @__PURE__ */ e(
|
|
1743
|
-
|
|
1743
|
+
re,
|
|
1744
1744
|
{
|
|
1745
1745
|
actionText: C.micro_card_cta,
|
|
1746
1746
|
ariaLabel: i,
|
|
1747
1747
|
description: C.no_relevant_insights_card_description,
|
|
1748
1748
|
fontColors: { buttonColor: t?.primary_300 },
|
|
1749
1749
|
heightOverrides: r,
|
|
1750
|
-
icon: /* @__PURE__ */ e(
|
|
1750
|
+
icon: /* @__PURE__ */ e(Ne, {}),
|
|
1751
1751
|
isZeroState: !0,
|
|
1752
1752
|
onCardClick: m,
|
|
1753
1753
|
posthog: n,
|
|
@@ -1755,7 +1755,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1755
1755
|
style: {
|
|
1756
1756
|
cardStyle: {
|
|
1757
1757
|
card: {
|
|
1758
|
-
height: `calc(${
|
|
1758
|
+
height: `calc(${He[o]}px - 44px)`,
|
|
1759
1759
|
m: "0 auto",
|
|
1760
1760
|
width: d ? "calc(100% - 32px)" : "100%"
|
|
1761
1761
|
},
|
|
@@ -1772,7 +1772,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1772
1772
|
widthOverrides: _
|
|
1773
1773
|
}
|
|
1774
1774
|
);
|
|
1775
|
-
}, ci = P(
|
|
1775
|
+
}, ci = P(Fe), Be = ({
|
|
1776
1776
|
ariaLabel: i,
|
|
1777
1777
|
carouselSize: o,
|
|
1778
1778
|
heightOverrides: t,
|
|
@@ -1783,16 +1783,16 @@ const $ = u.createContext(null), pt = ({
|
|
|
1783
1783
|
variant: d,
|
|
1784
1784
|
widthOverrides: p
|
|
1785
1785
|
}) => {
|
|
1786
|
-
const { onPageview: _ } =
|
|
1786
|
+
const { onPageview: _ } = Ve(), { zeroStateCopy: C } = F();
|
|
1787
1787
|
return u.useEffect(() => {
|
|
1788
|
-
_(
|
|
1788
|
+
_(k.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1789
1789
|
}, []), /* @__PURE__ */ e(
|
|
1790
|
-
|
|
1790
|
+
re,
|
|
1791
1791
|
{
|
|
1792
1792
|
ariaLabel: i,
|
|
1793
1793
|
description: C.carousel_zero_state_description,
|
|
1794
1794
|
heightOverrides: t,
|
|
1795
|
-
icon: /* @__PURE__ */ e(
|
|
1795
|
+
icon: /* @__PURE__ */ e(Ne, {}),
|
|
1796
1796
|
isZeroState: !0,
|
|
1797
1797
|
onCardClick: r,
|
|
1798
1798
|
posthog: l,
|
|
@@ -1800,7 +1800,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1800
1800
|
style: {
|
|
1801
1801
|
cardStyle: {
|
|
1802
1802
|
card: {
|
|
1803
|
-
height: `calc(${
|
|
1803
|
+
height: `calc(${He[o]}px - 44px)`,
|
|
1804
1804
|
m: "0 auto",
|
|
1805
1805
|
width: a ? "calc(100% - 32px)" : "100%"
|
|
1806
1806
|
},
|
|
@@ -1814,7 +1814,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1814
1814
|
widthOverrides: p
|
|
1815
1815
|
}
|
|
1816
1816
|
);
|
|
1817
|
-
}, si = P(
|
|
1817
|
+
}, si = P(Be), Dt = () => /* @__PURE__ */ e(
|
|
1818
1818
|
U,
|
|
1819
1819
|
{
|
|
1820
1820
|
sx: {
|
|
@@ -1826,7 +1826,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1826
1826
|
},
|
|
1827
1827
|
children: /* @__PURE__ */ e(et, {})
|
|
1828
1828
|
}
|
|
1829
|
-
),
|
|
1829
|
+
), H = new ut(), Lt = ({
|
|
1830
1830
|
allowSingleCardPeeking: i,
|
|
1831
1831
|
areBeatsLoading: o,
|
|
1832
1832
|
beats: t = [],
|
|
@@ -1848,70 +1848,70 @@ const $ = u.createContext(null), pt = ({
|
|
|
1848
1848
|
showBorder: m = !0,
|
|
1849
1849
|
showCarouselControls: c,
|
|
1850
1850
|
showHeader: E,
|
|
1851
|
-
showIcon:
|
|
1851
|
+
showIcon: g,
|
|
1852
1852
|
showWithMargin: y = !0,
|
|
1853
1853
|
token: D = "",
|
|
1854
1854
|
useDarkMode: O,
|
|
1855
1855
|
userHasFullInsightFeedBeats: v,
|
|
1856
|
-
variant:
|
|
1856
|
+
variant: B,
|
|
1857
1857
|
visibleCardsCount: z = 1,
|
|
1858
|
-
widthOverrides:
|
|
1858
|
+
widthOverrides: R
|
|
1859
1859
|
}) => {
|
|
1860
|
-
const L =
|
|
1860
|
+
const L = Me(), [le, G] = te("STANDARD"), [N, b] = te(!1), [j, X] = te(!1), ne = it([_], H), ae = ot([C], H);
|
|
1861
1861
|
u.useEffect(() => {
|
|
1862
|
-
|
|
1863
|
-
}, [n, D, d,
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1862
|
+
!H.isInitialized && !j && (H.initialize(n, D, d).catch(() => X(!1)), X(!0));
|
|
1863
|
+
}, [n, D, d, H.isInitialized, j]), u.useEffect(() => {
|
|
1864
|
+
const T = window.innerHeight;
|
|
1865
|
+
T < 180 ? G("STANDARD") : T >= 180 && T < 200 ? G("LARGE") : T >= 200 && T < 248 ? G("XLARGE") : T >= 248 && G("XXLARGE");
|
|
1866
1866
|
}, [window.innerHeight]), u.useEffect(() => {
|
|
1867
|
-
b(!o &&
|
|
1868
|
-
}, [o,
|
|
1869
|
-
const
|
|
1867
|
+
b(!o && H.isInitialized);
|
|
1868
|
+
}, [o, H.isInitialized]);
|
|
1869
|
+
const Q = {
|
|
1870
1870
|
showCTAColocatedWithText: l,
|
|
1871
1871
|
heightOverrides: a,
|
|
1872
1872
|
onCardClick: p,
|
|
1873
1873
|
posthog: f,
|
|
1874
|
-
showIcon:
|
|
1874
|
+
showIcon: g,
|
|
1875
1875
|
showWithMargin: y,
|
|
1876
1876
|
useDarkMode: O,
|
|
1877
|
-
widthOverrides:
|
|
1878
|
-
},
|
|
1879
|
-
carouselSize:
|
|
1880
|
-
variant:
|
|
1881
|
-
...
|
|
1877
|
+
widthOverrides: R
|
|
1878
|
+
}, q = {
|
|
1879
|
+
carouselSize: le,
|
|
1880
|
+
variant: B,
|
|
1881
|
+
...Q
|
|
1882
1882
|
};
|
|
1883
1883
|
return (
|
|
1884
1884
|
// The Theme provider must wrap the component so that the styles don't break when imported into other applications.
|
|
1885
1885
|
/* @__PURE__ */ I(Ue, { theme: L, children: [
|
|
1886
1886
|
/* @__PURE__ */ e(be, {}),
|
|
1887
|
-
/* @__PURE__ */ e(pt, { onEvent:
|
|
1888
|
-
|
|
1889
|
-
|
|
1887
|
+
/* @__PURE__ */ e(pt, { onEvent: ne, onPageview: ae, store: H, children: /* @__PURE__ */ I(xt, { heightOverrides: a, widthOverrides: R, children: [
|
|
1888
|
+
!N && /* @__PURE__ */ e(Dt, {}),
|
|
1889
|
+
N && E && /* @__PURE__ */ e(
|
|
1890
1890
|
wt,
|
|
1891
1891
|
{
|
|
1892
|
-
analyticsMetadata:
|
|
1892
|
+
analyticsMetadata: me,
|
|
1893
1893
|
clientColorScheme: r,
|
|
1894
1894
|
onCardClick: p,
|
|
1895
1895
|
posthog: f,
|
|
1896
|
-
widthOverrides:
|
|
1896
|
+
widthOverrides: R
|
|
1897
1897
|
}
|
|
1898
1898
|
),
|
|
1899
|
-
|
|
1899
|
+
N && !!t.length && /* @__PURE__ */ e(
|
|
1900
1900
|
Tt,
|
|
1901
1901
|
{
|
|
1902
1902
|
allowSingleCardPeeking: i,
|
|
1903
|
-
analyticsMetadata:
|
|
1903
|
+
analyticsMetadata: me,
|
|
1904
1904
|
beats: t,
|
|
1905
1905
|
clientColorScheme: r,
|
|
1906
1906
|
shouldApplyNewAnimation: h,
|
|
1907
1907
|
showCarouselControls: c,
|
|
1908
|
-
variant: m ?
|
|
1908
|
+
variant: m ? B : void 0,
|
|
1909
1909
|
visibleCardsCount: z,
|
|
1910
|
-
...
|
|
1910
|
+
...Q
|
|
1911
1911
|
}
|
|
1912
1912
|
),
|
|
1913
|
-
|
|
1914
|
-
|
|
1913
|
+
N && !t.length && v && /* @__PURE__ */ e(Fe, { clientColorScheme: r, ...q }),
|
|
1914
|
+
N && !t.length && !v && /* @__PURE__ */ e(Be, { ...q })
|
|
1915
1915
|
] }) })
|
|
1916
1916
|
] })
|
|
1917
1917
|
);
|
|
@@ -1926,11 +1926,11 @@ const $ = u.createContext(null), pt = ({
|
|
|
1926
1926
|
variant: d,
|
|
1927
1927
|
widthOverrides: p
|
|
1928
1928
|
}) => {
|
|
1929
|
-
const _ =
|
|
1930
|
-
threshold:
|
|
1931
|
-
}), { cardsCopy: h } =
|
|
1932
|
-
|
|
1933
|
-
f && (m(
|
|
1929
|
+
const _ = de(), { ref: C, inView: f } = Oe({
|
|
1930
|
+
threshold: ke
|
|
1931
|
+
}), { cardsCopy: h } = F(), { onEvent: m } = Y();
|
|
1932
|
+
oe(() => {
|
|
1933
|
+
f && (m(Le.ON_VIEW_MORE_VIEWED), n?.capture("viewed_insight", {
|
|
1934
1934
|
template: "view_more_card"
|
|
1935
1935
|
}));
|
|
1936
1936
|
}, [f]);
|
|
@@ -1940,14 +1940,14 @@ const $ = u.createContext(null), pt = ({
|
|
|
1940
1940
|
});
|
|
1941
1941
|
};
|
|
1942
1942
|
return /* @__PURE__ */ e(
|
|
1943
|
-
|
|
1943
|
+
re,
|
|
1944
1944
|
{
|
|
1945
1945
|
actionText: h.micro_card_cta,
|
|
1946
1946
|
ariaLabel: o,
|
|
1947
1947
|
description: h.view_more_card_description,
|
|
1948
1948
|
fontColors: { buttonColor: t?.primary_300 },
|
|
1949
1949
|
heightOverrides: r,
|
|
1950
|
-
icon: /* @__PURE__ */ e(
|
|
1950
|
+
icon: /* @__PURE__ */ e(gt, { color: t?.primary_300 ?? _.palette.primary.main }),
|
|
1951
1951
|
isActiveCard: i,
|
|
1952
1952
|
onCardClick: c,
|
|
1953
1953
|
posthog: n,
|
|
@@ -1966,12 +1966,12 @@ export {
|
|
|
1966
1966
|
pt as I,
|
|
1967
1967
|
Tt as M,
|
|
1968
1968
|
ci as N,
|
|
1969
|
-
|
|
1969
|
+
me as T,
|
|
1970
1970
|
Vt as V,
|
|
1971
1971
|
si as Z,
|
|
1972
|
-
|
|
1972
|
+
re as a,
|
|
1973
1973
|
di as b,
|
|
1974
|
-
|
|
1974
|
+
gt as c,
|
|
1975
1975
|
yt as d,
|
|
1976
|
-
|
|
1976
|
+
Ne as e
|
|
1977
1977
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-
|
|
1
|
+
import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-B-3SFewe.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as AppStore,
|
|
4
4
|
e as BeatCard,
|
package/dist/trends/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ import { C as st } from "../CurrencyText-YUhH2caW.mjs";
|
|
|
20
20
|
import { c as Me } from "../Category-CevNQ03n.mjs";
|
|
21
21
|
import { b as rt } from "../Localization-2MODESHW.mjs";
|
|
22
22
|
import { H as be } from "../HeaderCell-DjuifqHJ.mjs";
|
|
23
|
-
import { T as A, b as at } from "../ViewMoreMicroCard-
|
|
23
|
+
import { T as A, b as at } from "../ViewMoreMicroCard-B-3SFewe.mjs";
|
|
24
24
|
import { A as y, W as Ae } from "../WidgetContainer-CPBhSP3k.mjs";
|
|
25
25
|
import { a as Re, T as ke } from "../TransactionDetails-BafSm7_T.mjs";
|
|
26
26
|
import { D as fe } from "../Drawer-kEE73B87.mjs";
|