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