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