@mx-cartographer/experiences 7.2.26 → 7.2.28
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 +8 -0
- package/dist/{ViewMoreMicroCard-fhN3PWos.mjs → ViewMoreMicroCard-1Cqpu3wU.mjs} +445 -449
- package/dist/microinsights/carousel/CarouselControls.d.ts +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/interfaces.d.ts +0 -1
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { ChevronLeft as
|
|
8
|
-
import { L as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useTheme as
|
|
12
|
-
import { useInView as
|
|
13
|
-
import { P as
|
|
14
|
-
import
|
|
15
|
-
import { b as
|
|
16
|
-
import { css as
|
|
17
|
-
import { b as
|
|
18
|
-
import
|
|
19
|
-
import { makeAutoObservable as
|
|
20
|
-
import { G as
|
|
21
|
-
import { B as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import _, { useState as J, useEffect as te } from "react";
|
|
3
|
+
import { observer as P } from "mobx-react-lite";
|
|
4
|
+
import Fe from "@mui/material/Button";
|
|
5
|
+
import z from "@mui/material/Stack";
|
|
6
|
+
import Be from "@mui/material/Typography";
|
|
7
|
+
import { ChevronLeft as Ze, ChevronRight as Ie } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as Pe } from "./Loader-DUaFpDGv.mjs";
|
|
9
|
+
import G from "@mui/material/Box";
|
|
10
|
+
import he from "@mui/material/IconButton";
|
|
11
|
+
import { useTheme as Ge } from "@mui/material/styles";
|
|
12
|
+
import { useInView as ye } from "react-intersection-observer";
|
|
13
|
+
import { P as be, CategoryIcon as Ue, useTokens as ve, MerchantLogo as ze, Icon as ee } from "@mxenabled/mxui";
|
|
14
|
+
import ae from "@mui/material/styles/useTheme";
|
|
15
|
+
import { b as Ke } from "./Category-CevNQ03n.mjs";
|
|
16
|
+
import { css as $e } from "@mxenabled/cssinjs";
|
|
17
|
+
import { b as Ye } from "./Localization-2MODESHW.mjs";
|
|
18
|
+
import je from "@mui/material/CircularProgress";
|
|
19
|
+
import { makeAutoObservable as ce, runInAction as Se } from "mobx";
|
|
20
|
+
import { G as Ee, a as Xe, u as Qe, b as qe } from "./useCombineEvents-CRwX-qWE.mjs";
|
|
21
|
+
import { B as ue } from "./BeatApi-De2IaqH2.mjs";
|
|
22
|
+
import Je from "@mui/material/Card";
|
|
23
|
+
import et from "@mui/material/CardActions";
|
|
24
|
+
import tt from "@mui/material/CardContent";
|
|
25
|
+
import it from "@mui/material/CardHeader";
|
|
26
|
+
const pe = {
|
|
27
27
|
featureVersion: "spendVsIncomeTrends"
|
|
28
28
|
};
|
|
29
|
-
class
|
|
30
|
-
copyApi = new
|
|
29
|
+
class ot {
|
|
30
|
+
copyApi = new Ee("/", "");
|
|
31
31
|
copyObject = {};
|
|
32
32
|
namespace = "experiences";
|
|
33
33
|
translationKey = "micro_insights";
|
|
34
34
|
constructor() {
|
|
35
|
-
|
|
35
|
+
ce(this);
|
|
36
36
|
}
|
|
37
37
|
// NOTE: Not sure if this is special case, but other stores have this deprecation todo
|
|
38
38
|
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
39
39
|
// TODO: Remove this function
|
|
40
40
|
initialize = async (o, t) => {
|
|
41
|
-
this.copyApi = new
|
|
41
|
+
this.copyApi = new Ee(o, t), await this.loadCopy();
|
|
42
42
|
};
|
|
43
43
|
loadCopy = async () => {
|
|
44
44
|
const o = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
45
|
-
|
|
45
|
+
Se(() => {
|
|
46
46
|
this.copyObject = o[this.translationKey];
|
|
47
47
|
});
|
|
48
48
|
};
|
|
@@ -56,7 +56,7 @@ class nt {
|
|
|
56
56
|
return this.copyObject.zero_state;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const de = {
|
|
60
60
|
BillAmountNotStandard: "BillAmountNotStandard",
|
|
61
61
|
CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
|
|
62
62
|
DuplicatePaymentV2: "DuplicatePaymentV2",
|
|
@@ -73,47 +73,47 @@ const he = {
|
|
|
73
73
|
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
74
74
|
MonthlySpendComparison: "MonthlySpendComparison",
|
|
75
75
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
76
|
-
}, S = window?.app?.clientConfig?.microwidget_instance_id || "",
|
|
76
|
+
}, S = window?.app?.clientConfig?.microwidget_instance_id || "", _e = {
|
|
77
77
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
78
|
-
},
|
|
78
|
+
}, Me = (i) => `on${i}Click`, Ae = (i) => `on${i}View`, Oe = (i) => `on${i}ViewFirstTime`, se = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), rt = () => Object.values(de).reduce(
|
|
79
79
|
(i, o) => ({
|
|
80
80
|
...i,
|
|
81
|
-
[
|
|
82
|
-
action:
|
|
83
|
-
category:
|
|
84
|
-
label:
|
|
81
|
+
[Me(o)]: {
|
|
82
|
+
action: L.MICRO_BEAT_CLICKED,
|
|
83
|
+
category: D.BEAT_INTERACTION,
|
|
84
|
+
label: se(o),
|
|
85
85
|
value: S
|
|
86
86
|
}
|
|
87
87
|
}),
|
|
88
88
|
{}
|
|
89
|
-
),
|
|
89
|
+
), lt = () => Object.values(de).reduce(
|
|
90
90
|
(i, o) => ({
|
|
91
91
|
...i,
|
|
92
|
-
[
|
|
93
|
-
action:
|
|
94
|
-
category:
|
|
95
|
-
label:
|
|
92
|
+
[Ae(o)]: {
|
|
93
|
+
action: L.MICRO_BEAT_DISPLAYED,
|
|
94
|
+
category: D.BEAT_INTERACTION,
|
|
95
|
+
label: se(o),
|
|
96
96
|
value: S
|
|
97
97
|
}
|
|
98
98
|
}),
|
|
99
99
|
{}
|
|
100
|
-
),
|
|
100
|
+
), nt = () => Object.values(de).reduce(
|
|
101
101
|
(i, o) => ({
|
|
102
102
|
...i,
|
|
103
|
-
[
|
|
104
|
-
action:
|
|
105
|
-
category:
|
|
106
|
-
label:
|
|
103
|
+
[Oe(o)]: {
|
|
104
|
+
action: L.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
105
|
+
category: D.BEAT_INTERACTION,
|
|
106
|
+
label: se(o),
|
|
107
107
|
value: S
|
|
108
108
|
}
|
|
109
109
|
}),
|
|
110
110
|
{}
|
|
111
|
-
),
|
|
111
|
+
), x = {
|
|
112
112
|
CARD: "Card",
|
|
113
113
|
CAROUSEL_CONTROL: "Carousel Control",
|
|
114
114
|
MICRO_WIDGET: "Micro Widget",
|
|
115
115
|
VIEW_MORE: "View More"
|
|
116
|
-
},
|
|
116
|
+
}, D = {
|
|
117
117
|
MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
|
|
118
118
|
BEAT_INTERACTION: "Beat Interaction"
|
|
119
119
|
}, M = {
|
|
@@ -123,9 +123,9 @@ const he = {
|
|
|
123
123
|
ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
|
|
124
124
|
ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
|
|
125
125
|
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
126
|
-
},
|
|
126
|
+
}, Te = {
|
|
127
127
|
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
128
|
-
},
|
|
128
|
+
}, L = {
|
|
129
129
|
CONTROL_BACKWARD: "Control Backward",
|
|
130
130
|
CONTROL_FORWARD: "Control Forward",
|
|
131
131
|
MICRO_BEAT_CLICKED: "Micro Beat Clicked",
|
|
@@ -133,95 +133,95 @@ const he = {
|
|
|
133
133
|
MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
|
|
134
134
|
SWIPE_BACKWARD: "Swipe Backward",
|
|
135
135
|
SWIPE_FORWARD: "Swipe Forward"
|
|
136
|
-
},
|
|
136
|
+
}, F = {
|
|
137
137
|
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
138
138
|
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
139
139
|
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
140
|
-
},
|
|
141
|
-
[
|
|
142
|
-
label:
|
|
143
|
-
name:
|
|
144
|
-
path:
|
|
140
|
+
}, Ce = {
|
|
141
|
+
[F.MICRO_WIDGET_CAROUSEL]: {
|
|
142
|
+
label: x.MICRO_WIDGET,
|
|
143
|
+
name: F.MICRO_WIDGET_CAROUSEL,
|
|
144
|
+
path: _e.INSIGHTS_MICRO_WIDGET,
|
|
145
145
|
value: S
|
|
146
146
|
},
|
|
147
147
|
// zero state
|
|
148
|
-
[
|
|
149
|
-
label:
|
|
150
|
-
name:
|
|
151
|
-
path:
|
|
148
|
+
[F.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
149
|
+
label: x.MICRO_WIDGET,
|
|
150
|
+
name: F.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
151
|
+
path: _e.INSIGHTS_MICRO_WIDGET,
|
|
152
152
|
value: S
|
|
153
153
|
},
|
|
154
154
|
// no relevant cards
|
|
155
|
-
[
|
|
156
|
-
label:
|
|
157
|
-
name:
|
|
155
|
+
[F.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
156
|
+
label: x.MICRO_WIDGET,
|
|
157
|
+
name: F.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
158
158
|
path: "/micro-widget",
|
|
159
159
|
value: S
|
|
160
160
|
}
|
|
161
|
-
},
|
|
161
|
+
}, fe = {
|
|
162
162
|
// carousel control interaction events - clicks and swipes
|
|
163
163
|
[M.ON_CAROUSEL_BACK_CLICK]: {
|
|
164
|
-
action:
|
|
165
|
-
category:
|
|
166
|
-
label:
|
|
164
|
+
action: L.CONTROL_BACKWARD,
|
|
165
|
+
category: D.MICRO_WIDGET_INTERACTION,
|
|
166
|
+
label: x.CAROUSEL_CONTROL,
|
|
167
167
|
value: S
|
|
168
168
|
},
|
|
169
169
|
[M.ON_CAROUSEL_FORWARD_CLICK]: {
|
|
170
|
-
action:
|
|
171
|
-
category:
|
|
172
|
-
label:
|
|
170
|
+
action: L.CONTROL_FORWARD,
|
|
171
|
+
category: D.MICRO_WIDGET_INTERACTION,
|
|
172
|
+
label: x.CAROUSEL_CONTROL,
|
|
173
173
|
value: S
|
|
174
174
|
},
|
|
175
175
|
[M.ON_CAROUSEL_BACK_SWIPE]: {
|
|
176
|
-
action:
|
|
177
|
-
category:
|
|
178
|
-
label:
|
|
176
|
+
action: L.SWIPE_BACKWARD,
|
|
177
|
+
category: D.MICRO_WIDGET_INTERACTION,
|
|
178
|
+
label: x.CAROUSEL_CONTROL,
|
|
179
179
|
value: S
|
|
180
180
|
},
|
|
181
181
|
[M.ON_CAROUSEL_FORWARD_SWIPE]: {
|
|
182
|
-
action:
|
|
183
|
-
category:
|
|
184
|
-
label:
|
|
182
|
+
action: L.SWIPE_FORWARD,
|
|
183
|
+
category: D.MICRO_WIDGET_INTERACTION,
|
|
184
|
+
label: x.CAROUSEL_CONTROL,
|
|
185
185
|
value: S
|
|
186
186
|
},
|
|
187
187
|
// read more card events
|
|
188
188
|
[M.ON_VIEW_MORE_CLICKED]: {
|
|
189
|
-
action:
|
|
190
|
-
category:
|
|
191
|
-
label:
|
|
189
|
+
action: L.MICRO_BEAT_CLICKED,
|
|
190
|
+
category: D.BEAT_INTERACTION,
|
|
191
|
+
label: x.VIEW_MORE,
|
|
192
192
|
value: S
|
|
193
193
|
},
|
|
194
|
-
[
|
|
195
|
-
action:
|
|
196
|
-
category:
|
|
197
|
-
label:
|
|
194
|
+
[Te.ON_VIEW_MORE_VIEWED]: {
|
|
195
|
+
action: L.MICRO_BEAT_DISPLAYED,
|
|
196
|
+
category: D.BEAT_INTERACTION,
|
|
197
|
+
label: x.VIEW_MORE,
|
|
198
198
|
value: S
|
|
199
199
|
},
|
|
200
|
-
...
|
|
201
|
-
...
|
|
202
|
-
...
|
|
203
|
-
},
|
|
200
|
+
...rt(),
|
|
201
|
+
...lt(),
|
|
202
|
+
...nt()
|
|
203
|
+
}, me = async (i, o) => !o || !fe[i] ? null : o.sendAnalyticEvent(fe[i]).then((t) => t).catch((t) => {
|
|
204
204
|
throw t;
|
|
205
|
-
}),
|
|
205
|
+
}), Re = async (i, o) => !o || !Ce[i] ? null : o.sendAnalyticsPageview(Ce[i]).then((t) => t).catch((t) => {
|
|
206
206
|
throw t;
|
|
207
207
|
});
|
|
208
|
-
class
|
|
209
|
-
onAnalyticEvent =
|
|
210
|
-
onAnalyticPageView =
|
|
211
|
-
beatApi = new
|
|
208
|
+
class at {
|
|
209
|
+
onAnalyticEvent = me;
|
|
210
|
+
onAnalyticPageView = Re;
|
|
211
|
+
beatApi = new ue("/", "");
|
|
212
212
|
constructor() {
|
|
213
|
-
|
|
213
|
+
ce(this);
|
|
214
214
|
}
|
|
215
215
|
initialize = async (o, t, r) => {
|
|
216
216
|
this.onAnalyticEvent = (n, l) => {
|
|
217
|
-
|
|
217
|
+
me(n, l).then((a) => a).catch((a) => {
|
|
218
218
|
throw a.status === 401 && r(), a;
|
|
219
219
|
});
|
|
220
220
|
}, this.onAnalyticPageView = (n, l) => {
|
|
221
|
-
|
|
221
|
+
Re(n, l).then((a) => a).catch((a) => {
|
|
222
222
|
throw a.status === 401 && r(), a;
|
|
223
223
|
});
|
|
224
|
-
}, this.beatApi = new
|
|
224
|
+
}, this.beatApi = new ue(o, t);
|
|
225
225
|
};
|
|
226
226
|
updateBeat = async (o) => {
|
|
227
227
|
this.beatApi.updateBeat(o);
|
|
@@ -230,7 +230,7 @@ class dt {
|
|
|
230
230
|
this.beatApi.updateOffer(o);
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
-
class
|
|
233
|
+
class ct {
|
|
234
234
|
copyStore;
|
|
235
235
|
endpoint = "/";
|
|
236
236
|
insightsMicroWidgetStore;
|
|
@@ -238,22 +238,22 @@ class ht {
|
|
|
238
238
|
token = "";
|
|
239
239
|
isInitialized = !1;
|
|
240
240
|
constructor() {
|
|
241
|
-
this.copyStore = new
|
|
241
|
+
this.copyStore = new ot(), this.insightsMicroWidgetStore = new at(), ce(this);
|
|
242
242
|
}
|
|
243
243
|
initialize = async (o, t, r) => {
|
|
244
244
|
await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, r);
|
|
245
|
-
const n = await
|
|
246
|
-
|
|
245
|
+
const n = await Xe(o, t, "1.0.0", "Micro Insights Carousel");
|
|
246
|
+
Se(() => {
|
|
247
247
|
this.session = n, this.isInitialized = !0;
|
|
248
248
|
});
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
|
-
const
|
|
251
|
+
const K = _.createContext(null), dt = ({
|
|
252
252
|
onEvent: i,
|
|
253
253
|
onPageview: o,
|
|
254
254
|
store: t,
|
|
255
255
|
children: r
|
|
256
|
-
}) => /* @__PURE__ */ e(
|
|
256
|
+
}) => /* @__PURE__ */ e(K.Provider, { value: { onEvent: i, onPageview: o, store: t, children: r }, children: r }), ie = _.forwardRef(
|
|
257
257
|
function({
|
|
258
258
|
actionText: o,
|
|
259
259
|
ariaLabel: t,
|
|
@@ -261,30 +261,30 @@ const $ = u.createContext(null), Et = ({
|
|
|
261
261
|
description: n,
|
|
262
262
|
heightOverrides: l,
|
|
263
263
|
icon: a,
|
|
264
|
-
isActiveCard:
|
|
265
|
-
isZeroState:
|
|
266
|
-
onCardClick:
|
|
264
|
+
isActiveCard: E,
|
|
265
|
+
isZeroState: u,
|
|
266
|
+
onCardClick: p = () => {
|
|
267
267
|
},
|
|
268
268
|
showIcon: C,
|
|
269
269
|
style: f = {},
|
|
270
|
-
fontColors:
|
|
271
|
-
title:
|
|
270
|
+
fontColors: s = {},
|
|
271
|
+
title: d,
|
|
272
272
|
variant: c,
|
|
273
|
-
widthOverrides:
|
|
274
|
-
},
|
|
275
|
-
const
|
|
276
|
-
|
|
273
|
+
widthOverrides: y
|
|
274
|
+
}, m) {
|
|
275
|
+
const v = ae(), [V, A] = _.useState(!1), { cardStyle: R, linkTextStyle: b } = f, g = c ? R : { border: "none", boxShadow: "none", ...R }, N = /* @__PURE__ */ e(
|
|
276
|
+
be,
|
|
277
277
|
{
|
|
278
278
|
className: "mx-micro-card-description",
|
|
279
|
-
color:
|
|
279
|
+
color: s.textColor ? "undefined" : "text.primary",
|
|
280
280
|
sx: {
|
|
281
281
|
display: "-webkit-box",
|
|
282
282
|
fontSize: 13,
|
|
283
283
|
letterSpacing: 0.48,
|
|
284
284
|
lineHeight: "20px",
|
|
285
285
|
overflow: "hidden",
|
|
286
|
-
pl:
|
|
287
|
-
pr:
|
|
286
|
+
pl: u ? 0 : 28,
|
|
287
|
+
pr: u ? 0 : 8,
|
|
288
288
|
WebkitBoxOrient: "vertical",
|
|
289
289
|
WebkitLineClamp: 2,
|
|
290
290
|
wordWrap: "break-word"
|
|
@@ -293,44 +293,44 @@ const $ = u.createContext(null), Et = ({
|
|
|
293
293
|
"span",
|
|
294
294
|
{
|
|
295
295
|
dangerouslySetInnerHTML: { __html: n },
|
|
296
|
-
style: { fontFamily:
|
|
296
|
+
style: { fontFamily: v.typography.fontFamily }
|
|
297
297
|
}
|
|
298
298
|
)
|
|
299
299
|
}
|
|
300
300
|
);
|
|
301
301
|
return /* @__PURE__ */ e(
|
|
302
|
-
|
|
302
|
+
G,
|
|
303
303
|
{
|
|
304
|
-
"aria-hidden": !
|
|
304
|
+
"aria-hidden": !E,
|
|
305
305
|
"aria-label": t,
|
|
306
306
|
"aria-labelledby": "divButton",
|
|
307
307
|
"aria-roledescription": "slide",
|
|
308
|
-
ref:
|
|
308
|
+
ref: m,
|
|
309
309
|
role: "group",
|
|
310
310
|
sx: {
|
|
311
311
|
height: "100%",
|
|
312
|
-
minWidth:
|
|
313
|
-
fontFamily:
|
|
312
|
+
minWidth: y ? `${y}px` : "100%",
|
|
313
|
+
fontFamily: v.typography.fontFamily
|
|
314
314
|
},
|
|
315
315
|
children: /* @__PURE__ */ e(
|
|
316
|
-
|
|
316
|
+
G,
|
|
317
317
|
{
|
|
318
|
-
"aria-hidden": !
|
|
318
|
+
"aria-hidden": !E,
|
|
319
319
|
"aria-label": t,
|
|
320
320
|
id: "divButton",
|
|
321
|
-
onClick: () =>
|
|
322
|
-
onKeyDown: () =>
|
|
323
|
-
onKeyUp: () =>
|
|
324
|
-
ref:
|
|
321
|
+
onClick: () => p(),
|
|
322
|
+
onKeyDown: () => A(!1),
|
|
323
|
+
onKeyUp: () => A(!0),
|
|
324
|
+
ref: m,
|
|
325
325
|
role: "button",
|
|
326
326
|
sx: {
|
|
327
|
-
border:
|
|
327
|
+
border: V ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
|
|
328
328
|
borderRadius: "8px",
|
|
329
329
|
height: "100%"
|
|
330
330
|
},
|
|
331
|
-
tabIndex:
|
|
331
|
+
tabIndex: E ? 0 : -1,
|
|
332
332
|
children: /* @__PURE__ */ e(
|
|
333
|
-
|
|
333
|
+
Je,
|
|
334
334
|
{
|
|
335
335
|
"aria-roledescription": "slide",
|
|
336
336
|
className: "mx-micro-card",
|
|
@@ -341,15 +341,15 @@ const $ = u.createContext(null), Et = ({
|
|
|
341
341
|
cursor: "pointer",
|
|
342
342
|
height: l ? "100%" : 124,
|
|
343
343
|
p: 16,
|
|
344
|
-
...
|
|
344
|
+
...g,
|
|
345
345
|
"& .MuiCardHeader-avatar": {
|
|
346
|
-
color:
|
|
346
|
+
color: s.iconColor,
|
|
347
347
|
mr: "8px"
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
350
|
variant: c,
|
|
351
|
-
children: /* @__PURE__ */
|
|
352
|
-
|
|
351
|
+
children: /* @__PURE__ */ I(
|
|
352
|
+
z,
|
|
353
353
|
{
|
|
354
354
|
sx: {
|
|
355
355
|
alignItems: "space-between",
|
|
@@ -357,33 +357,33 @@ const $ = u.createContext(null), Et = ({
|
|
|
357
357
|
},
|
|
358
358
|
children: [
|
|
359
359
|
/* @__PURE__ */ e(
|
|
360
|
-
|
|
360
|
+
it,
|
|
361
361
|
{
|
|
362
362
|
avatar: C && a,
|
|
363
|
-
subheader:
|
|
364
|
-
sx: { color:
|
|
365
|
-
title:
|
|
363
|
+
subheader: u && N,
|
|
364
|
+
sx: { color: s.headerColor, p: 0 },
|
|
365
|
+
title: d,
|
|
366
366
|
titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
|
|
367
367
|
}
|
|
368
368
|
),
|
|
369
|
-
/* @__PURE__ */ e(
|
|
369
|
+
/* @__PURE__ */ e(tt, { sx: { p: 0 }, children: !u && N }),
|
|
370
370
|
!!o && /* @__PURE__ */ e(
|
|
371
|
-
|
|
371
|
+
et,
|
|
372
372
|
{
|
|
373
373
|
sx: {
|
|
374
374
|
mt: "auto",
|
|
375
375
|
p: 0
|
|
376
376
|
},
|
|
377
377
|
children: /* @__PURE__ */ e(
|
|
378
|
-
|
|
378
|
+
G,
|
|
379
379
|
{
|
|
380
|
-
sx: (
|
|
381
|
-
color:
|
|
380
|
+
sx: (O) => ({
|
|
381
|
+
color: s.buttonColor ? s.buttonColor : O.palette.primary.main,
|
|
382
382
|
fontSize: 14,
|
|
383
383
|
fontWeight: "bold",
|
|
384
384
|
px: 28,
|
|
385
|
-
fontFamily:
|
|
386
|
-
...
|
|
385
|
+
fontFamily: O.typography.fontFamily,
|
|
386
|
+
...b
|
|
387
387
|
}),
|
|
388
388
|
children: o
|
|
389
389
|
}
|
|
@@ -400,15 +400,15 @@ const $ = u.createContext(null), Et = ({
|
|
|
400
400
|
}
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
|
-
),
|
|
404
|
-
const [o, t] =
|
|
405
|
-
return
|
|
403
|
+
), st = ({ beat: i }) => {
|
|
404
|
+
const [o, t] = J(Ke.UNCATEGORIZED);
|
|
405
|
+
return te(() => {
|
|
406
406
|
i.primary_category_guid ? t(i.primary_category_guid) : i.category_guids?.length && t(i.category_guids[0]);
|
|
407
|
-
}, []), /* @__PURE__ */ e(
|
|
408
|
-
},
|
|
409
|
-
const o =
|
|
407
|
+
}, []), /* @__PURE__ */ e(Ue, { categoryGuid: o, size: 16, sx: { minWidth: 16 } });
|
|
408
|
+
}, ht = ({ beat: i }) => {
|
|
409
|
+
const o = ve(), t = Et(o);
|
|
410
410
|
return /* @__PURE__ */ e(
|
|
411
|
-
|
|
411
|
+
ze,
|
|
412
412
|
{
|
|
413
413
|
categoryGuid: i.primary_category_guid || i.category_guids && i.category_guids[0] || "",
|
|
414
414
|
className: t,
|
|
@@ -416,12 +416,12 @@ const $ = u.createContext(null), Et = ({
|
|
|
416
416
|
size: 16
|
|
417
417
|
}
|
|
418
418
|
);
|
|
419
|
-
},
|
|
419
|
+
}, Et = (i) => $e({
|
|
420
420
|
marginTop: i.Spacing.XTiny,
|
|
421
421
|
"& .kyper-categoryicon": {
|
|
422
422
|
display: "flex"
|
|
423
423
|
}
|
|
424
|
-
}),
|
|
424
|
+
}), ut = P(ht), pt = ({
|
|
425
425
|
color: i = "currentColor",
|
|
426
426
|
height: o,
|
|
427
427
|
size: t = 16,
|
|
@@ -447,18 +447,18 @@ const $ = u.createContext(null), Et = ({
|
|
|
447
447
|
}
|
|
448
448
|
)
|
|
449
449
|
}
|
|
450
|
-
),
|
|
450
|
+
), _t = (i) => i ? i.data ? i.data.map((o) => {
|
|
451
451
|
const t = {};
|
|
452
452
|
return i.names?.map((r, n) => {
|
|
453
453
|
t[r] = o[n];
|
|
454
454
|
}), t;
|
|
455
|
-
}) : [] : [],
|
|
456
|
-
const t =
|
|
455
|
+
}) : [] : [], Ct = (i, o) => {
|
|
456
|
+
const t = _t(i), r = t.length / 2, n = t.slice(0, r), l = t.slice(r);
|
|
457
457
|
return !n.length || !l.length ? o.Color.Primary300 : n[0].amount > l[0].amount ? o.Color.Error300 : n[0].amount < l[0].amount ? o.Color.Success300 : o.Color.Primary300;
|
|
458
|
-
},
|
|
459
|
-
const o =
|
|
460
|
-
return /* @__PURE__ */ e(
|
|
461
|
-
},
|
|
458
|
+
}, ft = ({ beat: i }) => {
|
|
459
|
+
const o = ve(), t = Ct(i.data_series, o);
|
|
460
|
+
return /* @__PURE__ */ e(ee, { name: "bar_chart", sx: { color: t } });
|
|
461
|
+
}, We = () => /* @__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
|
{
|
|
@@ -702,7 +702,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
702
702
|
fillRule: "evenodd"
|
|
703
703
|
}
|
|
704
704
|
),
|
|
705
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ I("g", { filter: "url(#filter0_d_1565_98011)", children: [
|
|
706
706
|
/* @__PURE__ */ e("mask", { height: "22", id: "mask1_1565_98011", maskUnits: "userSpaceOnUse", width: "17", x: "16", y: "12", children: /* @__PURE__ */ e(
|
|
707
707
|
"path",
|
|
708
708
|
{
|
|
@@ -958,10 +958,10 @@ const $ = u.createContext(null), Et = ({
|
|
|
958
958
|
),
|
|
959
959
|
/* @__PURE__ */ e("path", { d: "M17.9668 31.5737H19.4947", stroke: "#E4E8EE", strokeWidth: "0.264005" })
|
|
960
960
|
] }),
|
|
961
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ I("g", { filter: "url(#filter1_d_1565_98011)", children: [
|
|
962
962
|
/* @__PURE__ */ e("circle", { cx: "15.0441", cy: "16.0441", fill: "#CDD3DD", r: "15.0441" }),
|
|
963
963
|
/* @__PURE__ */ e("mask", { height: "30", id: "mask2_1565_98011", maskUnits: "userSpaceOnUse", width: "30", x: "0", y: "1", children: /* @__PURE__ */ e("circle", { cx: "15.0435", cy: "16.0445", fill: "#F8F9FB", r: "14.3951" }) }),
|
|
964
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ I("g", { mask: "url(#mask2_1565_98011)", children: [
|
|
965
965
|
/* @__PURE__ */ e("rect", { fill: "white", height: "31.1359", transform: "translate(0 0.162598)", width: "31.0101" }),
|
|
966
966
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "4.52002" }),
|
|
967
967
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "17.1758" }),
|
|
@@ -1151,8 +1151,8 @@ const $ = u.createContext(null), Et = ({
|
|
|
1151
1151
|
fill: "#CDD3DD"
|
|
1152
1152
|
}
|
|
1153
1153
|
),
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ I("defs", { children: [
|
|
1155
|
+
/* @__PURE__ */ I(
|
|
1156
1156
|
"filter",
|
|
1157
1157
|
{
|
|
1158
1158
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1195,7 +1195,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1195
1195
|
]
|
|
1196
1196
|
}
|
|
1197
1197
|
),
|
|
1198
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ I(
|
|
1199
1199
|
"filter",
|
|
1200
1200
|
{
|
|
1201
1201
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1239,10 +1239,10 @@ const $ = u.createContext(null), Et = ({
|
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
] })
|
|
1242
|
-
] }),
|
|
1243
|
-
const n =
|
|
1244
|
-
return r === 0 ? /* @__PURE__ */ e(
|
|
1245
|
-
|
|
1242
|
+
] }), ge = ({ beat: i, clientColorScheme: o, color: t, type: r }) => {
|
|
1243
|
+
const n = ae(), l = o?.primary_300 ? o.primary_300 : n.palette.primary.main;
|
|
1244
|
+
return r === 0 ? /* @__PURE__ */ e(ee, { fill: !0, name: "error", sx: { color: t || l } }) : r === 1 && i ? /* @__PURE__ */ e(st, { beat: i }) : r === 2 && i ? /* @__PURE__ */ e(ut, { beat: i }) : r === 3 && i ? /* @__PURE__ */ e(ft, { beat: i }) : r === 5 && i ? /* @__PURE__ */ e(ee, { name: "campaign" }) : /* @__PURE__ */ e(
|
|
1245
|
+
ee,
|
|
1246
1246
|
{
|
|
1247
1247
|
fill: !0,
|
|
1248
1248
|
name: "info",
|
|
@@ -1251,34 +1251,34 @@ const $ = u.createContext(null), Et = ({
|
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
);
|
|
1254
|
-
},
|
|
1255
|
-
const i =
|
|
1254
|
+
}, B = () => {
|
|
1255
|
+
const i = _.useContext(K);
|
|
1256
1256
|
if (!i)
|
|
1257
1257
|
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
1258
1258
|
return i.store.copyStore;
|
|
1259
|
-
},
|
|
1260
|
-
const i =
|
|
1259
|
+
}, mt = () => {
|
|
1260
|
+
const i = _.useContext(K);
|
|
1261
1261
|
if (!i?.store?.insightsMicroWidgetStore)
|
|
1262
1262
|
throw new Error(
|
|
1263
1263
|
"useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
|
|
1264
1264
|
);
|
|
1265
1265
|
return i.store.insightsMicroWidgetStore;
|
|
1266
|
-
},
|
|
1267
|
-
const i =
|
|
1266
|
+
}, $ = () => {
|
|
1267
|
+
const i = _.useContext(K);
|
|
1268
1268
|
if (!i)
|
|
1269
1269
|
throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
|
|
1270
1270
|
return { onEvent: i.onEvent };
|
|
1271
|
-
},
|
|
1272
|
-
const i =
|
|
1271
|
+
}, we = () => {
|
|
1272
|
+
const i = _.useContext(K);
|
|
1273
1273
|
if (!i)
|
|
1274
1274
|
throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
|
|
1275
1275
|
return { onPageview: i.onPageview };
|
|
1276
|
-
},
|
|
1276
|
+
}, xe = {
|
|
1277
1277
|
LARGE: 180,
|
|
1278
1278
|
STANDARD: 154,
|
|
1279
1279
|
XLARGE: 200,
|
|
1280
1280
|
XXLARGE: 248
|
|
1281
|
-
},
|
|
1281
|
+
}, Rt = 50, De = 1, gt = ({
|
|
1282
1282
|
ariaLabel: i,
|
|
1283
1283
|
backgroundColor: o,
|
|
1284
1284
|
beat: t,
|
|
@@ -1286,66 +1286,66 @@ const $ = u.createContext(null), Et = ({
|
|
|
1286
1286
|
showCTAColocatedWithText: n = !0,
|
|
1287
1287
|
heightOverrides: l,
|
|
1288
1288
|
index: a,
|
|
1289
|
-
isActiveCard:
|
|
1290
|
-
onCardClick:
|
|
1291
|
-
posthog:
|
|
1289
|
+
isActiveCard: E,
|
|
1290
|
+
onCardClick: u,
|
|
1291
|
+
posthog: p,
|
|
1292
1292
|
showIcon: C,
|
|
1293
1293
|
variant: f,
|
|
1294
|
-
widthOverrides:
|
|
1294
|
+
widthOverrides: s
|
|
1295
1295
|
}) => {
|
|
1296
|
-
const { ref:
|
|
1297
|
-
threshold:
|
|
1298
|
-
}), { cardsCopy:
|
|
1299
|
-
|
|
1300
|
-
c && (t.has_been_displayed ?
|
|
1296
|
+
const { ref: d, inView: c } = ye({
|
|
1297
|
+
threshold: De
|
|
1298
|
+
}), { cardsCopy: y } = B(), { onEvent: m } = $(), { updateBeat: v, updateOffer: V } = mt();
|
|
1299
|
+
te(() => {
|
|
1300
|
+
c && (t.has_been_displayed ? m(Ae(t.template)) : (t.guid.startsWith("OFR") ? V({
|
|
1301
1301
|
...t,
|
|
1302
1302
|
has_been_displayed: !0
|
|
1303
|
-
}) :
|
|
1303
|
+
}) : v({
|
|
1304
1304
|
...t,
|
|
1305
1305
|
has_been_displayed: !0
|
|
1306
|
-
}),
|
|
1307
|
-
}, [c]),
|
|
1306
|
+
}), m(Oe(t.template))));
|
|
1307
|
+
}, [c]), te(() => {
|
|
1308
1308
|
if (c && t)
|
|
1309
1309
|
if (t.template === "MarketingOffer") {
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1310
|
+
const R = t;
|
|
1311
|
+
p?.capture("viewed_messaging_insight", {
|
|
1312
1312
|
template: t.template,
|
|
1313
|
-
campaign_guid:
|
|
1314
|
-
campaign_name:
|
|
1313
|
+
campaign_guid: R.campaign_guid,
|
|
1314
|
+
campaign_name: R.pulse_campaign_name
|
|
1315
1315
|
});
|
|
1316
1316
|
} else
|
|
1317
|
-
|
|
1317
|
+
p?.capture("viewed_insight", {
|
|
1318
1318
|
beat_guid: t.guid,
|
|
1319
1319
|
template: t.template,
|
|
1320
1320
|
position: a
|
|
1321
1321
|
});
|
|
1322
1322
|
}, [t, a, c]);
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1323
|
+
const A = () => {
|
|
1324
|
+
if (u && u(t), m(Me(t.template)), t.template === "MarketingOffer") {
|
|
1325
|
+
const R = t;
|
|
1326
|
+
p?.capture("clicked_messaging_insight", {
|
|
1327
1327
|
template: t.template,
|
|
1328
|
-
campaign_guid:
|
|
1329
|
-
campaign_name:
|
|
1328
|
+
campaign_guid: R.campaign_guid,
|
|
1329
|
+
campaign_name: R.pulse_campaign_name
|
|
1330
1330
|
});
|
|
1331
1331
|
} else
|
|
1332
|
-
|
|
1332
|
+
p?.capture("clicked_insight", {
|
|
1333
1333
|
beat_guid: t.guid,
|
|
1334
1334
|
template: t.template,
|
|
1335
1335
|
position: a
|
|
1336
1336
|
});
|
|
1337
1337
|
};
|
|
1338
1338
|
return /* @__PURE__ */ e(
|
|
1339
|
-
|
|
1339
|
+
ie,
|
|
1340
1340
|
{
|
|
1341
|
-
actionText: t.micro_call_to_action ||
|
|
1341
|
+
actionText: t.micro_call_to_action || y.micro_card_cta,
|
|
1342
1342
|
ariaLabel: i,
|
|
1343
1343
|
backgroundColor: o,
|
|
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: l,
|
|
1347
|
-
icon:
|
|
1348
|
-
|
|
1347
|
+
icon: ge && /* @__PURE__ */ e(
|
|
1348
|
+
ge,
|
|
1349
1349
|
{
|
|
1350
1350
|
beat: t,
|
|
1351
1351
|
clientColorScheme: r,
|
|
@@ -1353,18 +1353,18 @@ const $ = u.createContext(null), Et = ({
|
|
|
1353
1353
|
type: t?.icon_type
|
|
1354
1354
|
}
|
|
1355
1355
|
),
|
|
1356
|
-
isActiveCard:
|
|
1357
|
-
onCardClick:
|
|
1358
|
-
posthog:
|
|
1359
|
-
ref:
|
|
1356
|
+
isActiveCard: E,
|
|
1357
|
+
onCardClick: A,
|
|
1358
|
+
posthog: p,
|
|
1359
|
+
ref: d,
|
|
1360
1360
|
showCTAColocatedWithText: n,
|
|
1361
1361
|
showIcon: C,
|
|
1362
1362
|
title: t.micro_title && t.micro_title.length > 0 ? t.micro_title : t.title,
|
|
1363
1363
|
variant: f,
|
|
1364
|
-
widthOverrides:
|
|
1364
|
+
widthOverrides: s
|
|
1365
1365
|
}
|
|
1366
1366
|
);
|
|
1367
|
-
},
|
|
1367
|
+
}, It = ({
|
|
1368
1368
|
clientColorScheme: i,
|
|
1369
1369
|
currentBeatIndex: o,
|
|
1370
1370
|
numBeats: t,
|
|
@@ -1372,12 +1372,12 @@ const $ = u.createContext(null), Et = ({
|
|
|
1372
1372
|
onPreviousClick: n,
|
|
1373
1373
|
scrollRightBoundary: l,
|
|
1374
1374
|
scrollX: a,
|
|
1375
|
-
|
|
1376
|
-
visibleCardsCount:
|
|
1375
|
+
shouldApplyDotAnimation: E = !1,
|
|
1376
|
+
visibleCardsCount: u = 1
|
|
1377
1377
|
}) => {
|
|
1378
|
-
const
|
|
1379
|
-
return /* @__PURE__ */
|
|
1380
|
-
|
|
1378
|
+
const p = Ge(), { carouselCopy: C } = B(), f = Math.floor(a) > l || o - u + 1 === 0, s = a < 0 || t - 1 === o, d = p.palette.grey[500], c = i?.primary_300 ?? p.palette.primary.main;
|
|
1379
|
+
return /* @__PURE__ */ I(
|
|
1380
|
+
z,
|
|
1381
1381
|
{
|
|
1382
1382
|
direction: "row",
|
|
1383
1383
|
sx: {
|
|
@@ -1392,34 +1392,34 @@ const $ = u.createContext(null), Et = ({
|
|
|
1392
1392
|
},
|
|
1393
1393
|
children: [
|
|
1394
1394
|
/* @__PURE__ */ e(
|
|
1395
|
-
|
|
1395
|
+
he,
|
|
1396
1396
|
{
|
|
1397
1397
|
"aria-disabled": f,
|
|
1398
1398
|
"aria-label": C.previous_insight_cta_aria,
|
|
1399
1399
|
disabled: f,
|
|
1400
1400
|
onClick: n,
|
|
1401
1401
|
children: /* @__PURE__ */ e(
|
|
1402
|
-
|
|
1402
|
+
Ze,
|
|
1403
1403
|
{
|
|
1404
1404
|
style: {
|
|
1405
|
-
color: f ?
|
|
1405
|
+
color: f ? d : c
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
)
|
|
1409
1409
|
}
|
|
1410
1410
|
),
|
|
1411
|
-
Array.from({ length: t }).map((
|
|
1412
|
-
const
|
|
1411
|
+
Array.from({ length: t }).map((y, m) => {
|
|
1412
|
+
const v = m === o;
|
|
1413
1413
|
return /* @__PURE__ */ e(
|
|
1414
|
-
|
|
1414
|
+
G,
|
|
1415
1415
|
{
|
|
1416
1416
|
className: "mx-insights-micro-carousel-dots",
|
|
1417
1417
|
sx: {
|
|
1418
|
-
bgcolor:
|
|
1418
|
+
bgcolor: v ? c : d,
|
|
1419
1419
|
height: 8,
|
|
1420
1420
|
mr: 8,
|
|
1421
1421
|
// existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
|
|
1422
|
-
...
|
|
1422
|
+
...E ? {
|
|
1423
1423
|
borderRadius: "4px",
|
|
1424
1424
|
transformOrigin: "center",
|
|
1425
1425
|
transition: "all 0.5s ease-out",
|
|
@@ -1428,24 +1428,24 @@ const $ = u.createContext(null), Et = ({
|
|
|
1428
1428
|
borderRadius: "50%",
|
|
1429
1429
|
p: 0
|
|
1430
1430
|
},
|
|
1431
|
-
width:
|
|
1431
|
+
width: v && E ? 24 : 8
|
|
1432
1432
|
}
|
|
1433
1433
|
},
|
|
1434
|
-
`carousel-button-${
|
|
1434
|
+
`carousel-button-${m}`
|
|
1435
1435
|
);
|
|
1436
1436
|
}),
|
|
1437
1437
|
/* @__PURE__ */ e(
|
|
1438
|
-
|
|
1438
|
+
he,
|
|
1439
1439
|
{
|
|
1440
|
-
"aria-disabled":
|
|
1440
|
+
"aria-disabled": s,
|
|
1441
1441
|
"aria-label": C.next_insight_cta_aria,
|
|
1442
|
-
disabled:
|
|
1442
|
+
disabled: s,
|
|
1443
1443
|
onClick: r,
|
|
1444
1444
|
children: /* @__PURE__ */ e(
|
|
1445
|
-
|
|
1445
|
+
Ie,
|
|
1446
1446
|
{
|
|
1447
1447
|
style: {
|
|
1448
|
-
color:
|
|
1448
|
+
color: s ? d : c
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
1451
|
)
|
|
@@ -1454,7 +1454,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1454
1454
|
]
|
|
1455
1455
|
}
|
|
1456
1456
|
);
|
|
1457
|
-
},
|
|
1457
|
+
}, yt = ({
|
|
1458
1458
|
analyticsMetadata: i,
|
|
1459
1459
|
allowSingleCardPeeking: o = !1,
|
|
1460
1460
|
beats: t = [],
|
|
@@ -1462,111 +1462,109 @@ const $ = u.createContext(null), Et = ({
|
|
|
1462
1462
|
showCTAColocatedWithText: n,
|
|
1463
1463
|
heightOverrides: l,
|
|
1464
1464
|
onCardClick: a,
|
|
1465
|
-
posthog:
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
visibleCardsCount: c = 1
|
|
1465
|
+
posthog: E,
|
|
1466
|
+
showCarouselControls: u,
|
|
1467
|
+
showIcon: p,
|
|
1468
|
+
showWithMargin: C = !0,
|
|
1469
|
+
variant: f,
|
|
1470
|
+
widthOverrides: s,
|
|
1471
|
+
visibleCardsCount: d = 1
|
|
1473
1472
|
// Default to 1 card visible
|
|
1474
1473
|
}) => {
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
let
|
|
1480
|
-
if (
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1474
|
+
const c = _.useRef(null), y = _.useRef(null), [m, v] = _.useState(0), [V, A] = _.useState(null), [R, b] = _.useState(null), [g, N] = _.useState(null), { carouselCopy: O } = B(), { onEvent: T } = $();
|
|
1475
|
+
_.useEffect(() => {
|
|
1476
|
+
if (c.current && !o) {
|
|
1477
|
+
const h = c.current.offsetWidth, w = 8;
|
|
1478
|
+
let H;
|
|
1479
|
+
if (d > 1) {
|
|
1480
|
+
const Q = (h - (d - 1) * w) / d / 3;
|
|
1481
|
+
H = (h - Q - (d - 1) * w) / d;
|
|
1483
1482
|
} else
|
|
1484
|
-
|
|
1485
|
-
|
|
1483
|
+
H = h;
|
|
1484
|
+
N(H);
|
|
1486
1485
|
}
|
|
1487
|
-
}, [
|
|
1488
|
-
const
|
|
1489
|
-
if (typeof
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1492
|
-
const ee = [
|
|
1486
|
+
}, [d, c.current?.offsetWidth]), _.useEffect(() => {
|
|
1487
|
+
const h = y.current?.offsetWidth;
|
|
1488
|
+
if (typeof h == "number" && o) {
|
|
1489
|
+
const w = (Z) => {
|
|
1490
|
+
const q = [
|
|
1493
1491
|
{ maxWidth: 375, cardWidth: 268 },
|
|
1494
1492
|
{ maxWidth: 444, cardWidth: 300 },
|
|
1495
1493
|
{ maxWidth: 599, cardWidth: 350 },
|
|
1496
1494
|
{ maxWidth: 749, cardWidth: 450 },
|
|
1497
1495
|
{ maxWidth: 900, cardWidth: 600 }
|
|
1498
|
-
].find((
|
|
1499
|
-
return
|
|
1496
|
+
].find((ne) => Z <= ne.maxWidth);
|
|
1497
|
+
return q ? q.cardWidth : 750;
|
|
1500
1498
|
};
|
|
1501
|
-
|
|
1502
|
-
const
|
|
1503
|
-
const
|
|
1504
|
-
typeof
|
|
1499
|
+
N(w(h));
|
|
1500
|
+
const H = () => {
|
|
1501
|
+
const Z = y.current?.offsetWidth;
|
|
1502
|
+
typeof Z == "number" && N(w(Z));
|
|
1505
1503
|
};
|
|
1506
|
-
return window.addEventListener("resize",
|
|
1507
|
-
window.removeEventListener("resize",
|
|
1504
|
+
return window.addEventListener("resize", H), () => {
|
|
1505
|
+
window.removeEventListener("resize", H);
|
|
1508
1506
|
};
|
|
1509
1507
|
}
|
|
1510
|
-
}, [o,
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1513
|
-
left:
|
|
1508
|
+
}, [o, y]);
|
|
1509
|
+
const oe = () => {
|
|
1510
|
+
T(M.ON_CAROUSEL_FORWARD_CLICK, i), c.current && g && c.current.scrollTo({
|
|
1511
|
+
left: m + g + 8,
|
|
1514
1512
|
top: 0,
|
|
1515
1513
|
behavior: "smooth"
|
|
1516
1514
|
});
|
|
1517
|
-
},
|
|
1518
|
-
|
|
1519
|
-
left: Math.max(0,
|
|
1515
|
+
}, Y = () => {
|
|
1516
|
+
T(M.ON_CAROUSEL_BACK_CLICK, i), c.current && g && c.current.scrollTo({
|
|
1517
|
+
left: Math.max(0, m - (g + 8)),
|
|
1520
1518
|
top: 0,
|
|
1521
1519
|
behavior: "smooth"
|
|
1522
1520
|
});
|
|
1523
|
-
},
|
|
1524
|
-
|
|
1525
|
-
},
|
|
1526
|
-
if (!
|
|
1527
|
-
|
|
1528
|
-
},
|
|
1529
|
-
|
|
1530
|
-
},
|
|
1531
|
-
|
|
1532
|
-
},
|
|
1521
|
+
}, j = () => {
|
|
1522
|
+
c.current && v(c.current.scrollLeft);
|
|
1523
|
+
}, re = () => {
|
|
1524
|
+
if (!R || !V) return;
|
|
1525
|
+
R - V > Rt ? T(M.ON_CAROUSEL_FORWARD_SWIPE, i) : T(M.ON_CAROUSEL_BACK_SWIPE, i);
|
|
1526
|
+
}, le = (h) => {
|
|
1527
|
+
A(h.targetTouches[0].clientX);
|
|
1528
|
+
}, X = (h) => {
|
|
1529
|
+
A(null), b(h.targetTouches[0].clientX);
|
|
1530
|
+
}, U = {
|
|
1533
1531
|
clientColorScheme: r,
|
|
1534
1532
|
showCTAColocatedWithText: n,
|
|
1535
1533
|
heightOverrides: l,
|
|
1536
|
-
posthog:
|
|
1537
|
-
showIcon:
|
|
1538
|
-
variant:
|
|
1539
|
-
},
|
|
1540
|
-
return /* @__PURE__ */
|
|
1541
|
-
|
|
1534
|
+
posthog: E,
|
|
1535
|
+
showIcon: p,
|
|
1536
|
+
variant: f
|
|
1537
|
+
}, W = g ? Math.round(m / (g + 8)) : 0, Ne = c.current ? c.current.scrollWidth - c.current.offsetWidth : 0;
|
|
1538
|
+
return /* @__PURE__ */ I(
|
|
1539
|
+
z,
|
|
1542
1540
|
{
|
|
1543
|
-
"aria-label":
|
|
1541
|
+
"aria-label": O.carousel_title,
|
|
1544
1542
|
"aria-roledescription": "carousel",
|
|
1545
|
-
ref:
|
|
1543
|
+
ref: y,
|
|
1546
1544
|
role: "group/region",
|
|
1547
1545
|
sx: {
|
|
1548
1546
|
alignItems: "center",
|
|
1549
1547
|
boxSizing: "border-box",
|
|
1550
1548
|
height: l,
|
|
1551
|
-
width:
|
|
1549
|
+
width: s || "100%"
|
|
1552
1550
|
},
|
|
1553
1551
|
children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
|
|
1552
|
+
/* @__PURE__ */ I(
|
|
1553
|
+
z,
|
|
1556
1554
|
{
|
|
1557
1555
|
direction: "row",
|
|
1558
|
-
onScroll:
|
|
1559
|
-
onTouchEnd:
|
|
1560
|
-
onTouchMove:
|
|
1561
|
-
onTouchStart:
|
|
1562
|
-
ref:
|
|
1556
|
+
onScroll: j,
|
|
1557
|
+
onTouchEnd: re,
|
|
1558
|
+
onTouchMove: le,
|
|
1559
|
+
onTouchStart: X,
|
|
1560
|
+
ref: c,
|
|
1563
1561
|
sx: {
|
|
1564
1562
|
alignItems: "center",
|
|
1565
1563
|
height: l && "100%",
|
|
1566
1564
|
gap: 8,
|
|
1567
1565
|
listStyleType: "none",
|
|
1568
1566
|
m: 0,
|
|
1569
|
-
maxWidth:
|
|
1567
|
+
maxWidth: C ? "calc(100% - 32px)" : "100%",
|
|
1570
1568
|
overflowX: "auto",
|
|
1571
1569
|
overflowY: "hidden",
|
|
1572
1570
|
p: 0,
|
|
@@ -1578,67 +1576,67 @@ const $ = u.createContext(null), Et = ({
|
|
|
1578
1576
|
}
|
|
1579
1577
|
},
|
|
1580
1578
|
children: [
|
|
1581
|
-
t.map((
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
),
|
|
1579
|
+
t.map((h, w) => {
|
|
1580
|
+
const H = w + 1, Z = t.length + 1, Q = Ye(
|
|
1581
|
+
O.card_position_in_carousel_aria,
|
|
1582
|
+
H.toString(),
|
|
1583
|
+
Z.toString()
|
|
1584
|
+
), q = h.micro_title && h.micro_title.length > 0, ne = h.micro_description && h.micro_description.length > 0, He = q ? h.micro_title : h.title, ke = ne ? h.micro_description : h.description;
|
|
1587
1585
|
return /* @__PURE__ */ e(
|
|
1588
|
-
|
|
1586
|
+
gt,
|
|
1589
1587
|
{
|
|
1590
|
-
ariaLabel: `${
|
|
1591
|
-
beat:
|
|
1592
|
-
index:
|
|
1593
|
-
isActiveCard:
|
|
1588
|
+
ariaLabel: `${Q}: ${He}, ${ke}`,
|
|
1589
|
+
beat: h,
|
|
1590
|
+
index: w,
|
|
1591
|
+
isActiveCard: w === W,
|
|
1594
1592
|
onCardClick: a,
|
|
1595
1593
|
widthOverrides: g || void 0,
|
|
1596
|
-
...
|
|
1594
|
+
...U
|
|
1597
1595
|
},
|
|
1598
|
-
`${
|
|
1596
|
+
`${h.guid} ${w}`
|
|
1599
1597
|
);
|
|
1600
1598
|
}),
|
|
1601
1599
|
/* @__PURE__ */ e(
|
|
1602
|
-
|
|
1600
|
+
wt,
|
|
1603
1601
|
{
|
|
1604
|
-
isActiveCard:
|
|
1602
|
+
isActiveCard: W === t.length,
|
|
1605
1603
|
onCardClick: a,
|
|
1606
1604
|
widthOverrides: g || void 0,
|
|
1607
|
-
...
|
|
1605
|
+
...U
|
|
1608
1606
|
}
|
|
1609
1607
|
)
|
|
1610
1608
|
]
|
|
1611
1609
|
}
|
|
1612
1610
|
),
|
|
1613
|
-
|
|
1614
|
-
|
|
1611
|
+
u && /* @__PURE__ */ e(
|
|
1612
|
+
It,
|
|
1615
1613
|
{
|
|
1616
1614
|
clientColorScheme: r,
|
|
1617
|
-
currentBeatIndex:
|
|
1615
|
+
currentBeatIndex: W + d - 1,
|
|
1618
1616
|
numBeats: t.length + 1,
|
|
1619
|
-
onNextClick:
|
|
1620
|
-
onPreviousClick:
|
|
1621
|
-
scrollRightBoundary:
|
|
1622
|
-
scrollX:
|
|
1623
|
-
|
|
1624
|
-
visibleCardsCount:
|
|
1617
|
+
onNextClick: oe,
|
|
1618
|
+
onPreviousClick: Y,
|
|
1619
|
+
scrollRightBoundary: Ne,
|
|
1620
|
+
scrollX: m,
|
|
1621
|
+
shouldApplyDotAnimation: o,
|
|
1622
|
+
visibleCardsCount: d
|
|
1625
1623
|
}
|
|
1626
1624
|
)
|
|
1627
1625
|
]
|
|
1628
1626
|
}
|
|
1629
1627
|
);
|
|
1630
|
-
},
|
|
1628
|
+
}, vt = P(yt), St = ({
|
|
1631
1629
|
analyticsMetadata: i,
|
|
1632
1630
|
clientColorScheme: o,
|
|
1633
1631
|
onCardClick: t,
|
|
1634
1632
|
posthog: r,
|
|
1635
1633
|
widthOverrides: n
|
|
1636
1634
|
}) => {
|
|
1637
|
-
const { carouselCopy: l } =
|
|
1635
|
+
const { carouselCopy: l } = B(), { onEvent: a } = $(), E = () => {
|
|
1638
1636
|
a && (a(M.ON_VIEW_MORE_CLICKED, i), t(), r?.capture("clicked_view_more"));
|
|
1639
1637
|
};
|
|
1640
|
-
return l ? /* @__PURE__ */
|
|
1641
|
-
|
|
1638
|
+
return l ? /* @__PURE__ */ I(
|
|
1639
|
+
z,
|
|
1642
1640
|
{
|
|
1643
1641
|
alignItems: "center",
|
|
1644
1642
|
direction: "row",
|
|
@@ -1650,7 +1648,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1650
1648
|
},
|
|
1651
1649
|
children: [
|
|
1652
1650
|
/* @__PURE__ */ e(
|
|
1653
|
-
|
|
1651
|
+
Be,
|
|
1654
1652
|
{
|
|
1655
1653
|
sx: {
|
|
1656
1654
|
color: o?.primary_300,
|
|
@@ -1663,10 +1661,10 @@ const $ = u.createContext(null), Et = ({
|
|
|
1663
1661
|
}
|
|
1664
1662
|
),
|
|
1665
1663
|
/* @__PURE__ */ e(
|
|
1666
|
-
|
|
1664
|
+
Fe,
|
|
1667
1665
|
{
|
|
1668
|
-
endIcon: /* @__PURE__ */ e(
|
|
1669
|
-
onClick:
|
|
1666
|
+
endIcon: /* @__PURE__ */ e(Ie, { size: 20 }),
|
|
1667
|
+
onClick: E,
|
|
1670
1668
|
size: "small",
|
|
1671
1669
|
sx: {
|
|
1672
1670
|
color: o?.primary_300
|
|
@@ -1677,15 +1675,15 @@ const $ = u.createContext(null), Et = ({
|
|
|
1677
1675
|
)
|
|
1678
1676
|
]
|
|
1679
1677
|
}
|
|
1680
|
-
) : /* @__PURE__ */ e(
|
|
1681
|
-
},
|
|
1678
|
+
) : /* @__PURE__ */ e(Pe, {});
|
|
1679
|
+
}, Mt = P(St), At = ({
|
|
1682
1680
|
heightOverrides: i,
|
|
1683
1681
|
widthOverrides: o,
|
|
1684
1682
|
children: t
|
|
1685
1683
|
}) => {
|
|
1686
|
-
const { carouselCopy: r } =
|
|
1684
|
+
const { carouselCopy: r } = B();
|
|
1687
1685
|
return /* @__PURE__ */ e(
|
|
1688
|
-
|
|
1686
|
+
G,
|
|
1689
1687
|
{
|
|
1690
1688
|
"aria-label": r?.carousel_title,
|
|
1691
1689
|
"aria-roledescription": "carousel",
|
|
@@ -1699,7 +1697,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1699
1697
|
children: t
|
|
1700
1698
|
}
|
|
1701
1699
|
);
|
|
1702
|
-
},
|
|
1700
|
+
}, Le = ({
|
|
1703
1701
|
ariaLabel: i,
|
|
1704
1702
|
carouselSize: o,
|
|
1705
1703
|
clientColorScheme: t,
|
|
@@ -1707,38 +1705,38 @@ const $ = u.createContext(null), Et = ({
|
|
|
1707
1705
|
onCardClick: n,
|
|
1708
1706
|
posthog: l,
|
|
1709
1707
|
showIcon: a,
|
|
1710
|
-
showWithMargin:
|
|
1711
|
-
variant:
|
|
1712
|
-
widthOverrides:
|
|
1708
|
+
showWithMargin: E,
|
|
1709
|
+
variant: u,
|
|
1710
|
+
widthOverrides: p
|
|
1713
1711
|
}) => {
|
|
1714
|
-
const { cardsCopy: C } =
|
|
1715
|
-
|
|
1716
|
-
|
|
1712
|
+
const { cardsCopy: C } = B(), { onEvent: f } = $(), { onPageview: s } = we();
|
|
1713
|
+
_.useEffect(() => {
|
|
1714
|
+
s(F.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1717
1715
|
}, []);
|
|
1718
|
-
const
|
|
1716
|
+
const d = () => {
|
|
1719
1717
|
n && n(), f(M.ON_NO_RELEVANT_INSIGHTS_CLICKED), l?.capture("clicked_insight", {
|
|
1720
1718
|
template: "no_relevant_insights"
|
|
1721
1719
|
});
|
|
1722
1720
|
};
|
|
1723
1721
|
return /* @__PURE__ */ e(
|
|
1724
|
-
|
|
1722
|
+
ie,
|
|
1725
1723
|
{
|
|
1726
1724
|
actionText: C.micro_card_cta,
|
|
1727
1725
|
ariaLabel: i,
|
|
1728
1726
|
description: C.no_relevant_insights_card_description,
|
|
1729
1727
|
fontColors: { buttonColor: t?.primary_300 },
|
|
1730
1728
|
heightOverrides: r,
|
|
1731
|
-
icon: /* @__PURE__ */ e(
|
|
1729
|
+
icon: /* @__PURE__ */ e(We, {}),
|
|
1732
1730
|
isZeroState: !0,
|
|
1733
|
-
onCardClick:
|
|
1731
|
+
onCardClick: d,
|
|
1734
1732
|
posthog: l,
|
|
1735
1733
|
showIcon: a,
|
|
1736
1734
|
style: {
|
|
1737
1735
|
cardStyle: {
|
|
1738
1736
|
card: {
|
|
1739
|
-
height: `calc(${
|
|
1737
|
+
height: `calc(${xe[o]}px - 44px)`,
|
|
1740
1738
|
m: "0 auto",
|
|
1741
|
-
width:
|
|
1739
|
+
width: E ? "calc(100% - 32px)" : "100%"
|
|
1742
1740
|
},
|
|
1743
1741
|
description: {
|
|
1744
1742
|
WebkitLineClamp: 4
|
|
@@ -1749,11 +1747,11 @@ const $ = u.createContext(null), Et = ({
|
|
|
1749
1747
|
}
|
|
1750
1748
|
},
|
|
1751
1749
|
title: C.no_relevant_insights_card_title,
|
|
1752
|
-
variant:
|
|
1753
|
-
widthOverrides:
|
|
1750
|
+
variant: u,
|
|
1751
|
+
widthOverrides: p
|
|
1754
1752
|
}
|
|
1755
1753
|
);
|
|
1756
|
-
},
|
|
1754
|
+
}, ii = P(Le), Ve = ({
|
|
1757
1755
|
ariaLabel: i,
|
|
1758
1756
|
carouselSize: o,
|
|
1759
1757
|
heightOverrides: t,
|
|
@@ -1761,19 +1759,19 @@ const $ = u.createContext(null), Et = ({
|
|
|
1761
1759
|
posthog: n,
|
|
1762
1760
|
showIcon: l,
|
|
1763
1761
|
showWithMargin: a,
|
|
1764
|
-
variant:
|
|
1765
|
-
widthOverrides:
|
|
1762
|
+
variant: E,
|
|
1763
|
+
widthOverrides: u
|
|
1766
1764
|
}) => {
|
|
1767
|
-
const { onPageview:
|
|
1768
|
-
return
|
|
1769
|
-
|
|
1765
|
+
const { onPageview: p } = we(), { zeroStateCopy: C } = B();
|
|
1766
|
+
return _.useEffect(() => {
|
|
1767
|
+
p(F.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1770
1768
|
}, []), /* @__PURE__ */ e(
|
|
1771
|
-
|
|
1769
|
+
ie,
|
|
1772
1770
|
{
|
|
1773
1771
|
ariaLabel: i,
|
|
1774
1772
|
description: C.carousel_zero_state_description,
|
|
1775
1773
|
heightOverrides: t,
|
|
1776
|
-
icon: /* @__PURE__ */ e(
|
|
1774
|
+
icon: /* @__PURE__ */ e(We, {}),
|
|
1777
1775
|
isZeroState: !0,
|
|
1778
1776
|
onCardClick: r,
|
|
1779
1777
|
posthog: n,
|
|
@@ -1781,7 +1779,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1781
1779
|
style: {
|
|
1782
1780
|
cardStyle: {
|
|
1783
1781
|
card: {
|
|
1784
|
-
height: `calc(${
|
|
1782
|
+
height: `calc(${xe[o]}px - 44px)`,
|
|
1785
1783
|
m: "0 auto",
|
|
1786
1784
|
width: a ? "calc(100% - 32px)" : "100%"
|
|
1787
1785
|
},
|
|
@@ -1791,12 +1789,12 @@ const $ = u.createContext(null), Et = ({
|
|
|
1791
1789
|
}
|
|
1792
1790
|
},
|
|
1793
1791
|
title: C.carousel_zero_state_title,
|
|
1794
|
-
variant:
|
|
1795
|
-
widthOverrides:
|
|
1792
|
+
variant: E,
|
|
1793
|
+
widthOverrides: u
|
|
1796
1794
|
}
|
|
1797
1795
|
);
|
|
1798
|
-
},
|
|
1799
|
-
|
|
1796
|
+
}, oi = P(Ve), Ot = () => /* @__PURE__ */ e(
|
|
1797
|
+
G,
|
|
1800
1798
|
{
|
|
1801
1799
|
sx: {
|
|
1802
1800
|
alignItems: "center",
|
|
@@ -1805,9 +1803,9 @@ const $ = u.createContext(null), Et = ({
|
|
|
1805
1803
|
justifyContent: "center",
|
|
1806
1804
|
width: "100%"
|
|
1807
1805
|
},
|
|
1808
|
-
children: /* @__PURE__ */ e(
|
|
1806
|
+
children: /* @__PURE__ */ e(je, {})
|
|
1809
1807
|
}
|
|
1810
|
-
),
|
|
1808
|
+
), k = new ct(), Tt = ({
|
|
1811
1809
|
allowSingleCardPeeking: i,
|
|
1812
1810
|
areBeatsLoading: o,
|
|
1813
1811
|
beats: t = [],
|
|
@@ -1817,80 +1815,78 @@ const $ = u.createContext(null), Et = ({
|
|
|
1817
1815
|
showCTAColocatedWithText: n = !0,
|
|
1818
1816
|
endpoint: l = "/",
|
|
1819
1817
|
heightOverrides: a,
|
|
1820
|
-
logOutUser:
|
|
1821
|
-
onCardClick:
|
|
1818
|
+
logOutUser: E,
|
|
1819
|
+
onCardClick: u = () => {
|
|
1822
1820
|
},
|
|
1823
|
-
onEvent:
|
|
1821
|
+
onEvent: p = () => {
|
|
1824
1822
|
},
|
|
1825
1823
|
onPageview: C = () => {
|
|
1826
1824
|
},
|
|
1827
1825
|
posthog: f,
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
visibleCardsCount: z = 1,
|
|
1826
|
+
showBorder: s = !0,
|
|
1827
|
+
showCarouselControls: d,
|
|
1828
|
+
showHeader: c,
|
|
1829
|
+
showIcon: y,
|
|
1830
|
+
showWithMargin: m = !0,
|
|
1831
|
+
token: v = "",
|
|
1832
|
+
useDarkMode: V,
|
|
1833
|
+
userHasFullInsightFeedBeats: A,
|
|
1834
|
+
variant: R,
|
|
1835
|
+
visibleCardsCount: b = 1,
|
|
1839
1836
|
widthOverrides: g
|
|
1840
1837
|
}) => {
|
|
1841
|
-
const [
|
|
1842
|
-
|
|
1843
|
-
!
|
|
1844
|
-
}, [l,
|
|
1845
|
-
const
|
|
1846
|
-
|
|
1847
|
-
}, [window.innerHeight]),
|
|
1848
|
-
|
|
1849
|
-
}, [o,
|
|
1850
|
-
const
|
|
1838
|
+
const [N, O] = J("STANDARD"), [T, oe] = J(!1), [Y, j] = J(!1), re = Qe([p], k), le = qe([C], k);
|
|
1839
|
+
_.useEffect(() => {
|
|
1840
|
+
!k.isInitialized && !Y && (k.initialize(l, v, E).catch(() => j(!1)), j(!0));
|
|
1841
|
+
}, [l, v, E, k.isInitialized, Y]), _.useEffect(() => {
|
|
1842
|
+
const W = window.innerHeight;
|
|
1843
|
+
W < 180 ? O("STANDARD") : W >= 180 && W < 200 ? O("LARGE") : W >= 200 && W < 248 ? O("XLARGE") : W >= 248 && O("XXLARGE");
|
|
1844
|
+
}, [window.innerHeight]), _.useEffect(() => {
|
|
1845
|
+
oe(!o && k.isInitialized);
|
|
1846
|
+
}, [o, k.isInitialized]);
|
|
1847
|
+
const X = {
|
|
1851
1848
|
showCTAColocatedWithText: n,
|
|
1852
1849
|
heightOverrides: a,
|
|
1853
|
-
onCardClick:
|
|
1850
|
+
onCardClick: u,
|
|
1854
1851
|
posthog: f,
|
|
1855
|
-
showIcon:
|
|
1856
|
-
showWithMargin:
|
|
1857
|
-
useDarkMode:
|
|
1852
|
+
showIcon: y,
|
|
1853
|
+
showWithMargin: m,
|
|
1854
|
+
useDarkMode: V,
|
|
1858
1855
|
widthOverrides: g
|
|
1859
|
-
},
|
|
1860
|
-
carouselSize:
|
|
1861
|
-
variant:
|
|
1862
|
-
...
|
|
1856
|
+
}, U = {
|
|
1857
|
+
carouselSize: N,
|
|
1858
|
+
variant: R,
|
|
1859
|
+
...X
|
|
1863
1860
|
};
|
|
1864
|
-
return /* @__PURE__ */ e(
|
|
1865
|
-
!
|
|
1866
|
-
|
|
1867
|
-
|
|
1861
|
+
return /* @__PURE__ */ e(dt, { onEvent: re, onPageview: le, store: k, children: /* @__PURE__ */ I(At, { heightOverrides: a, widthOverrides: g, children: [
|
|
1862
|
+
!T && /* @__PURE__ */ e(Ot, {}),
|
|
1863
|
+
T && c && /* @__PURE__ */ e(
|
|
1864
|
+
Mt,
|
|
1868
1865
|
{
|
|
1869
|
-
analyticsMetadata:
|
|
1866
|
+
analyticsMetadata: pe,
|
|
1870
1867
|
clientColorScheme: r,
|
|
1871
|
-
onCardClick:
|
|
1868
|
+
onCardClick: u,
|
|
1872
1869
|
posthog: f,
|
|
1873
1870
|
widthOverrides: g
|
|
1874
1871
|
}
|
|
1875
1872
|
),
|
|
1876
|
-
|
|
1877
|
-
|
|
1873
|
+
T && !!t.length && /* @__PURE__ */ e(
|
|
1874
|
+
vt,
|
|
1878
1875
|
{
|
|
1879
1876
|
allowSingleCardPeeking: i,
|
|
1880
|
-
analyticsMetadata:
|
|
1877
|
+
analyticsMetadata: pe,
|
|
1881
1878
|
beats: t,
|
|
1882
1879
|
clientColorScheme: r,
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
...Q
|
|
1880
|
+
showCarouselControls: d,
|
|
1881
|
+
variant: s ? R : void 0,
|
|
1882
|
+
visibleCardsCount: b,
|
|
1883
|
+
...X
|
|
1888
1884
|
}
|
|
1889
1885
|
),
|
|
1890
|
-
|
|
1891
|
-
|
|
1886
|
+
T && !t.length && A && /* @__PURE__ */ e(Le, { clientColorScheme: r, ...U }),
|
|
1887
|
+
T && !t.length && !A && /* @__PURE__ */ e(Ve, { ...U })
|
|
1892
1888
|
] }) });
|
|
1893
|
-
},
|
|
1889
|
+
}, ri = P(Tt), Wt = ({
|
|
1894
1890
|
isActiveCard: i,
|
|
1895
1891
|
ariaLabel: o,
|
|
1896
1892
|
clientColorScheme: t,
|
|
@@ -1898,55 +1894,55 @@ const $ = u.createContext(null), Et = ({
|
|
|
1898
1894
|
onCardClick: n,
|
|
1899
1895
|
posthog: l,
|
|
1900
1896
|
showIcon: a,
|
|
1901
|
-
variant:
|
|
1902
|
-
widthOverrides:
|
|
1897
|
+
variant: E,
|
|
1898
|
+
widthOverrides: u
|
|
1903
1899
|
}) => {
|
|
1904
|
-
const
|
|
1905
|
-
threshold:
|
|
1906
|
-
}), { cardsCopy:
|
|
1907
|
-
|
|
1908
|
-
f && (
|
|
1900
|
+
const p = ae(), { ref: C, inView: f } = ye({
|
|
1901
|
+
threshold: De
|
|
1902
|
+
}), { cardsCopy: s } = B(), { onEvent: d } = $();
|
|
1903
|
+
te(() => {
|
|
1904
|
+
f && (d(Te.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
|
|
1909
1905
|
template: "view_more_card"
|
|
1910
1906
|
}));
|
|
1911
1907
|
}, [f]);
|
|
1912
1908
|
const c = () => {
|
|
1913
|
-
n && n(),
|
|
1909
|
+
n && n(), d(M.ON_VIEW_MORE_CLICKED), l?.capture("clicked_insight", {
|
|
1914
1910
|
template: "view_more_card"
|
|
1915
1911
|
});
|
|
1916
1912
|
};
|
|
1917
1913
|
return /* @__PURE__ */ e(
|
|
1918
|
-
|
|
1914
|
+
ie,
|
|
1919
1915
|
{
|
|
1920
|
-
actionText:
|
|
1916
|
+
actionText: s.micro_card_cta,
|
|
1921
1917
|
ariaLabel: o,
|
|
1922
|
-
description:
|
|
1918
|
+
description: s.view_more_card_description,
|
|
1923
1919
|
fontColors: { buttonColor: t?.primary_300 },
|
|
1924
1920
|
heightOverrides: r,
|
|
1925
|
-
icon: /* @__PURE__ */ e(
|
|
1921
|
+
icon: /* @__PURE__ */ e(pt, { color: t?.primary_300 ?? p.palette.primary.main }),
|
|
1926
1922
|
isActiveCard: i,
|
|
1927
1923
|
onCardClick: c,
|
|
1928
1924
|
posthog: l,
|
|
1929
1925
|
ref: C,
|
|
1930
1926
|
showIcon: a,
|
|
1931
|
-
title:
|
|
1932
|
-
variant:
|
|
1933
|
-
widthOverrides:
|
|
1927
|
+
title: s.view_more_card_title,
|
|
1928
|
+
variant: E,
|
|
1929
|
+
widthOverrides: u
|
|
1934
1930
|
}
|
|
1935
1931
|
);
|
|
1936
|
-
},
|
|
1932
|
+
}, wt = P(Wt);
|
|
1937
1933
|
export {
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1934
|
+
ct as A,
|
|
1935
|
+
gt as B,
|
|
1936
|
+
Mt as C,
|
|
1937
|
+
dt as I,
|
|
1938
|
+
vt as M,
|
|
1939
|
+
ii as N,
|
|
1940
|
+
pe as T,
|
|
1941
|
+
wt as V,
|
|
1942
|
+
oi as Z,
|
|
1943
|
+
ie as a,
|
|
1944
|
+
ri as b,
|
|
1945
|
+
pt as c,
|
|
1946
|
+
ft as d,
|
|
1947
|
+
We as e
|
|
1952
1948
|
};
|