@mx-cartographer/experiences 7.7.1 → 7.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,14 +3,13 @@ import h, { useEffect as ie, useState as oe } from "react";
|
|
|
3
3
|
import { observer as U } from "mobx-react-lite";
|
|
4
4
|
import N from "@mui/material/Stack";
|
|
5
5
|
import ne from "@mui/material/Button";
|
|
6
|
-
import be from "@
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { L as
|
|
6
|
+
import { CategoryIcon as be, MerchantLogo as Pe, P as _e, Text as ue, H3 as Be } from "@mxenabled/mxui";
|
|
7
|
+
import { Icon as Ve, Close as Ge, ChevronLeft as ke, ChevronRight as Te } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as ze } from "./Loader-DUaFpDGv.mjs";
|
|
9
9
|
import Q from "@mui/material/Box";
|
|
10
10
|
import re from "@mui/material/IconButton";
|
|
11
|
-
import { alpha as
|
|
12
|
-
import { useInView as
|
|
13
|
-
import { CategoryIcon as ke, MerchantLogo as ze, P as _e, Text as ue } from "@mxenabled/mxui";
|
|
11
|
+
import { alpha as f, useTheme as H } from "@mui/material/styles";
|
|
12
|
+
import { useInView as fe } from "react-intersection-observer";
|
|
14
13
|
import { b as Ue } from "./Category-CevNQ03n.mjs";
|
|
15
14
|
import Ke from "@mui/material/styles/useTheme";
|
|
16
15
|
import { b as Fe } from "./Localization-2MODESHW.mjs";
|
|
@@ -72,27 +71,27 @@ const se = {
|
|
|
72
71
|
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
73
72
|
MonthlySpendComparison: "MonthlySpendComparison",
|
|
74
73
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
75
|
-
},
|
|
74
|
+
}, O = window?.app?.clientConfig?.microwidget_instance_id || "", Ce = {
|
|
76
75
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
77
|
-
},
|
|
76
|
+
}, Oe = (t) => `on${t}Click`, ye = (t) => `on${t}View`, We = (t) => `on${t}ViewFirstTime`, ce = (t) => t.replace(/([a-z])([A-Z])/g, "$1 $2"), et = () => Object.values(se).reduce(
|
|
78
77
|
(t, e) => ({
|
|
79
78
|
...t,
|
|
80
|
-
[
|
|
81
|
-
action:
|
|
82
|
-
category:
|
|
79
|
+
[Oe(e)]: {
|
|
80
|
+
action: P.MICRO_BEAT_CLICKED,
|
|
81
|
+
category: b.BEAT_INTERACTION,
|
|
83
82
|
label: ce(e),
|
|
84
|
-
value:
|
|
83
|
+
value: O
|
|
85
84
|
}
|
|
86
85
|
}),
|
|
87
86
|
{}
|
|
88
87
|
), tt = () => Object.values(se).reduce(
|
|
89
88
|
(t, e) => ({
|
|
90
89
|
...t,
|
|
91
|
-
[
|
|
92
|
-
action:
|
|
93
|
-
category:
|
|
90
|
+
[ye(e)]: {
|
|
91
|
+
action: P.MICRO_BEAT_DISPLAYED,
|
|
92
|
+
category: b.BEAT_INTERACTION,
|
|
94
93
|
label: ce(e),
|
|
95
|
-
value:
|
|
94
|
+
value: O
|
|
96
95
|
}
|
|
97
96
|
}),
|
|
98
97
|
{}
|
|
@@ -100,22 +99,22 @@ const se = {
|
|
|
100
99
|
(t, e) => ({
|
|
101
100
|
...t,
|
|
102
101
|
[We(e)]: {
|
|
103
|
-
action:
|
|
104
|
-
category:
|
|
102
|
+
action: P.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
103
|
+
category: b.BEAT_INTERACTION,
|
|
105
104
|
label: ce(e),
|
|
106
|
-
value:
|
|
105
|
+
value: O
|
|
107
106
|
}
|
|
108
107
|
}),
|
|
109
108
|
{}
|
|
110
|
-
),
|
|
109
|
+
), x = {
|
|
111
110
|
CARD: "Card",
|
|
112
111
|
CAROUSEL_CONTROL: "Carousel Control",
|
|
113
112
|
MICRO_WIDGET: "Micro Widget",
|
|
114
113
|
VIEW_MORE: "View More"
|
|
115
|
-
},
|
|
114
|
+
}, b = {
|
|
116
115
|
MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
|
|
117
116
|
BEAT_INTERACTION: "Beat Interaction"
|
|
118
|
-
},
|
|
117
|
+
}, y = {
|
|
119
118
|
ON_CAROUSEL_BACK_CLICK: "onCarouselBackClick",
|
|
120
119
|
ON_CAROUSEL_BACK_SWIPE: "onCarouselBackSwipe",
|
|
121
120
|
ON_CAROUSEL_FORWARD_CLICK: "onCarouselForwardClick",
|
|
@@ -124,7 +123,7 @@ const se = {
|
|
|
124
123
|
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
125
124
|
}, Ne = {
|
|
126
125
|
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
127
|
-
},
|
|
126
|
+
}, P = {
|
|
128
127
|
CONTROL_BACKWARD: "Control Backward",
|
|
129
128
|
CONTROL_FORWARD: "Control Forward",
|
|
130
129
|
MICRO_BEAT_CLICKED: "Micro Beat Clicked",
|
|
@@ -136,72 +135,72 @@ const se = {
|
|
|
136
135
|
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
137
136
|
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
138
137
|
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
139
|
-
},
|
|
138
|
+
}, Ee = {
|
|
140
139
|
[k.MICRO_WIDGET_CAROUSEL]: {
|
|
141
|
-
label:
|
|
140
|
+
label: x.MICRO_WIDGET,
|
|
142
141
|
name: k.MICRO_WIDGET_CAROUSEL,
|
|
143
142
|
path: Ce.INSIGHTS_MICRO_WIDGET,
|
|
144
|
-
value:
|
|
143
|
+
value: O
|
|
145
144
|
},
|
|
146
145
|
// zero state
|
|
147
146
|
[k.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
148
|
-
label:
|
|
147
|
+
label: x.MICRO_WIDGET,
|
|
149
148
|
name: k.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
150
149
|
path: Ce.INSIGHTS_MICRO_WIDGET,
|
|
151
|
-
value:
|
|
150
|
+
value: O
|
|
152
151
|
},
|
|
153
152
|
// no relevant cards
|
|
154
153
|
[k.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
155
|
-
label:
|
|
154
|
+
label: x.MICRO_WIDGET,
|
|
156
155
|
name: k.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
157
156
|
path: "/micro-widget",
|
|
158
|
-
value:
|
|
157
|
+
value: O
|
|
159
158
|
}
|
|
160
|
-
},
|
|
159
|
+
}, ge = {
|
|
161
160
|
// carousel control interaction events - clicks and swipes
|
|
162
|
-
[
|
|
163
|
-
action:
|
|
164
|
-
category:
|
|
165
|
-
label:
|
|
166
|
-
value:
|
|
161
|
+
[y.ON_CAROUSEL_BACK_CLICK]: {
|
|
162
|
+
action: P.CONTROL_BACKWARD,
|
|
163
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
164
|
+
label: x.CAROUSEL_CONTROL,
|
|
165
|
+
value: O
|
|
167
166
|
},
|
|
168
|
-
[
|
|
169
|
-
action:
|
|
170
|
-
category:
|
|
171
|
-
label:
|
|
172
|
-
value:
|
|
167
|
+
[y.ON_CAROUSEL_FORWARD_CLICK]: {
|
|
168
|
+
action: P.CONTROL_FORWARD,
|
|
169
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
170
|
+
label: x.CAROUSEL_CONTROL,
|
|
171
|
+
value: O
|
|
173
172
|
},
|
|
174
|
-
[
|
|
175
|
-
action:
|
|
176
|
-
category:
|
|
177
|
-
label:
|
|
178
|
-
value:
|
|
173
|
+
[y.ON_CAROUSEL_BACK_SWIPE]: {
|
|
174
|
+
action: P.SWIPE_BACKWARD,
|
|
175
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
176
|
+
label: x.CAROUSEL_CONTROL,
|
|
177
|
+
value: O
|
|
179
178
|
},
|
|
180
|
-
[
|
|
181
|
-
action:
|
|
182
|
-
category:
|
|
183
|
-
label:
|
|
184
|
-
value:
|
|
179
|
+
[y.ON_CAROUSEL_FORWARD_SWIPE]: {
|
|
180
|
+
action: P.SWIPE_FORWARD,
|
|
181
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
182
|
+
label: x.CAROUSEL_CONTROL,
|
|
183
|
+
value: O
|
|
185
184
|
},
|
|
186
185
|
// read more card events
|
|
187
|
-
[
|
|
188
|
-
action:
|
|
189
|
-
category:
|
|
190
|
-
label:
|
|
191
|
-
value:
|
|
186
|
+
[y.ON_VIEW_MORE_CLICKED]: {
|
|
187
|
+
action: P.MICRO_BEAT_CLICKED,
|
|
188
|
+
category: b.BEAT_INTERACTION,
|
|
189
|
+
label: x.VIEW_MORE,
|
|
190
|
+
value: O
|
|
192
191
|
},
|
|
193
192
|
[Ne.ON_VIEW_MORE_VIEWED]: {
|
|
194
|
-
action:
|
|
195
|
-
category:
|
|
196
|
-
label:
|
|
197
|
-
value:
|
|
193
|
+
action: P.MICRO_BEAT_DISPLAYED,
|
|
194
|
+
category: b.BEAT_INTERACTION,
|
|
195
|
+
label: x.VIEW_MORE,
|
|
196
|
+
value: O
|
|
198
197
|
},
|
|
199
198
|
...et(),
|
|
200
199
|
...tt(),
|
|
201
200
|
...ot()
|
|
202
|
-
}, Ie = async (t, e) => !e || !
|
|
201
|
+
}, Ie = async (t, e) => !e || !ge[t] ? null : e.sendAnalyticEvent(ge[t]).then((o) => o).catch((o) => {
|
|
203
202
|
throw o;
|
|
204
|
-
}), Ae = async (t, e) => !e || !
|
|
203
|
+
}), Ae = async (t, e) => !e || !Ee[t] ? null : e.sendAnalyticsPageview(Ee[t]).then((o) => o).catch((o) => {
|
|
205
204
|
throw o;
|
|
206
205
|
});
|
|
207
206
|
class it {
|
|
@@ -212,13 +211,13 @@ class it {
|
|
|
212
211
|
ae(this);
|
|
213
212
|
}
|
|
214
213
|
initialize = async (e, o, n) => {
|
|
215
|
-
this.onAnalyticEvent = (r,
|
|
216
|
-
Ie(r,
|
|
217
|
-
throw
|
|
214
|
+
this.onAnalyticEvent = (r, a) => {
|
|
215
|
+
Ie(r, a).then((s) => s).catch((s) => {
|
|
216
|
+
throw s.status === 401 && n(), s;
|
|
218
217
|
});
|
|
219
|
-
}, this.onAnalyticPageView = (r,
|
|
220
|
-
Ae(r,
|
|
221
|
-
throw
|
|
218
|
+
}, this.onAnalyticPageView = (r, a) => {
|
|
219
|
+
Ae(r, a).then((s) => s).catch((s) => {
|
|
220
|
+
throw s.status === 401 && n(), s;
|
|
222
221
|
});
|
|
223
222
|
}, this.beatApi = new he(e, o);
|
|
224
223
|
};
|
|
@@ -254,7 +253,7 @@ const $ = h.createContext(null), rt = ({
|
|
|
254
253
|
children: n
|
|
255
254
|
}) => /* @__PURE__ */ i($.Provider, { value: { onEvent: t, onPageview: e, store: o, children: n }, children: n }), at = ({ beat: t }) => {
|
|
256
255
|
const { primary_category_guid: e, category_guids: o } = t, n = e || o?.[0] || Ue.UNCATEGORIZED;
|
|
257
|
-
return /* @__PURE__ */ i(
|
|
256
|
+
return /* @__PURE__ */ i(be, { categoryGuid: n, size: 32, sx: { minWidth: 32 } });
|
|
258
257
|
}, R = ({
|
|
259
258
|
bgColor: t,
|
|
260
259
|
name: e,
|
|
@@ -268,12 +267,12 @@ const $ = h.createContext(null), rt = ({
|
|
|
268
267
|
height: 32
|
|
269
268
|
},
|
|
270
269
|
variant: "rounded",
|
|
271
|
-
children: /* @__PURE__ */ i(
|
|
270
|
+
children: /* @__PURE__ */ i(Ve, { color: o, fill: !0, name: e, size: 20 })
|
|
272
271
|
}
|
|
273
272
|
), st = ({ beat: t }) => {
|
|
274
273
|
const { category_guids: e, merchant_guids: o, primary_category_guid: n, primary_merchant_guid: r } = t;
|
|
275
274
|
return /* @__PURE__ */ i(
|
|
276
|
-
|
|
275
|
+
Pe,
|
|
277
276
|
{
|
|
278
277
|
categoryGuid: n || e && e[0] || "",
|
|
279
278
|
merchantGuid: r || o[0],
|
|
@@ -295,37 +294,37 @@ const $ = h.createContext(null), rt = ({
|
|
|
295
294
|
return !n.length || !r.length ? "primary" : n[0].amount > r[0].amount ? "error" : n[0].amount < r[0].amount ? "success" : "primary";
|
|
296
295
|
}, dt = ({ beat: t }) => {
|
|
297
296
|
const e = Ke(), o = lt(t.data_series), n = e.palette[o].main;
|
|
298
|
-
return /* @__PURE__ */ i(R, { bgColor:
|
|
297
|
+
return /* @__PURE__ */ i(R, { bgColor: f(n, 0.15), iconColor: o, name: "bar_chart" });
|
|
299
298
|
}, _t = {
|
|
300
|
-
0: (t, e) => /* @__PURE__ */ i(R, { bgColor:
|
|
299
|
+
0: (t, e) => /* @__PURE__ */ i(R, { bgColor: f(e.palette.primary.main, 0.15), name: "error" }),
|
|
301
300
|
1: (t) => /* @__PURE__ */ i(at, { beat: t }),
|
|
302
301
|
2: (t) => /* @__PURE__ */ i(st, { beat: t }),
|
|
303
302
|
3: (t) => /* @__PURE__ */ i(dt, { beat: t }),
|
|
304
303
|
4: (t, e) => /* @__PURE__ */ i(
|
|
305
304
|
R,
|
|
306
305
|
{
|
|
307
|
-
bgColor:
|
|
306
|
+
bgColor: f(e.palette.secondary.main, 0.15),
|
|
308
307
|
iconColor: "secondary",
|
|
309
308
|
name: "info"
|
|
310
309
|
}
|
|
311
310
|
),
|
|
312
|
-
5: (t, e) => /* @__PURE__ */ i(R, { bgColor:
|
|
311
|
+
5: (t, e) => /* @__PURE__ */ i(R, { bgColor: f(e.palette.primary.main, 0.15), name: "campaign" }),
|
|
313
312
|
// TODO: Waiting for the backend to accommodate icon types 6, 7, 8, and 9
|
|
314
313
|
6: (t, e) => /* @__PURE__ */ i(
|
|
315
314
|
R,
|
|
316
315
|
{
|
|
317
|
-
bgColor:
|
|
316
|
+
bgColor: f(e.palette.success.main, 0.15),
|
|
318
317
|
iconColor: "success",
|
|
319
318
|
name: "check_circle"
|
|
320
319
|
}
|
|
321
320
|
),
|
|
322
|
-
7: (t, e) => /* @__PURE__ */ i(R, { bgColor:
|
|
323
|
-
8: (t, e) => /* @__PURE__ */ i(R, { bgColor:
|
|
324
|
-
9: (t, e) => /* @__PURE__ */ i(R, { bgColor:
|
|
321
|
+
7: (t, e) => /* @__PURE__ */ i(R, { bgColor: f(e.palette.primary.main, 0.15), name: "today" }),
|
|
322
|
+
8: (t, e) => /* @__PURE__ */ i(R, { bgColor: f(e.palette.primary.main, 0.15), name: "calendar_clock" }),
|
|
323
|
+
9: (t, e) => /* @__PURE__ */ i(R, { bgColor: f(e.palette.primary.main, 0.15), name: "celebration" })
|
|
325
324
|
}, ut = ({ beat: t }) => {
|
|
326
325
|
const e = H(), { icon_type: o } = t, n = o != null ? _t[o] : null;
|
|
327
|
-
return n ? n(t, e) : /* @__PURE__ */ i(R, { bgColor:
|
|
328
|
-
},
|
|
326
|
+
return n ? n(t, e) : /* @__PURE__ */ i(R, { bgColor: f(e.palette.primary.main, 0.15), name: "error" });
|
|
327
|
+
}, B = () => {
|
|
329
328
|
const t = h.useContext($);
|
|
330
329
|
if (!t)
|
|
331
330
|
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
@@ -356,27 +355,28 @@ const $ = h.createContext(null), rt = ({
|
|
|
356
355
|
function({
|
|
357
356
|
ariaLabel: e,
|
|
358
357
|
cardSx: o,
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
closeAriaLabel: n,
|
|
359
|
+
description: r,
|
|
360
|
+
icon: a,
|
|
361
361
|
isActiveCard: s,
|
|
362
|
-
hasCardEffect:
|
|
363
|
-
heightOverrides:
|
|
362
|
+
hasCardEffect: p = !1,
|
|
363
|
+
heightOverrides: m,
|
|
364
364
|
onClose: C,
|
|
365
|
-
onCardClick:
|
|
366
|
-
onPrimaryAction:
|
|
367
|
-
onSecondaryAction:
|
|
368
|
-
primaryActionText:
|
|
369
|
-
secondaryActionText:
|
|
370
|
-
title:
|
|
371
|
-
variant:
|
|
372
|
-
widthOverrides:
|
|
373
|
-
...
|
|
374
|
-
},
|
|
375
|
-
const
|
|
365
|
+
onCardClick: _,
|
|
366
|
+
onPrimaryAction: c,
|
|
367
|
+
onSecondaryAction: d,
|
|
368
|
+
primaryActionText: l,
|
|
369
|
+
secondaryActionText: g,
|
|
370
|
+
title: E,
|
|
371
|
+
variant: A,
|
|
372
|
+
widthOverrides: I,
|
|
373
|
+
...D
|
|
374
|
+
}, V) {
|
|
375
|
+
const S = !!(c && l), T = !!(d && g), M = p ? Ze : Q, w = /* @__PURE__ */ L(Se, { children: [
|
|
376
376
|
C && /* @__PURE__ */ i(
|
|
377
377
|
re,
|
|
378
378
|
{
|
|
379
|
-
"aria-label":
|
|
379
|
+
"aria-label": n,
|
|
380
380
|
onClick: (u) => {
|
|
381
381
|
u.stopPropagation(), C?.();
|
|
382
382
|
},
|
|
@@ -387,18 +387,18 @@ const $ = h.createContext(null), rt = ({
|
|
|
387
387
|
u.stopPropagation();
|
|
388
388
|
},
|
|
389
389
|
sx: { minHeight: 40, minWidth: 40, position: "absolute", right: 4, top: 4 },
|
|
390
|
-
children: /* @__PURE__ */ i(
|
|
390
|
+
children: /* @__PURE__ */ i(Ge, {})
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
/* @__PURE__ */ L(N, { sx: { gap: 6, height: "100%", justifyContent: "space-between" }, children: [
|
|
394
394
|
/* @__PURE__ */ L(N, { sx: { flexDirection: "row", gap: 12 }, children: [
|
|
395
|
-
|
|
395
|
+
a && a,
|
|
396
396
|
/* @__PURE__ */ L(N, { sx: { gap: 6 }, children: [
|
|
397
|
-
/* @__PURE__ */ i(N, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: /* @__PURE__ */ i(_e, { bold: !0, sx: { lineHeight: "16px" }, variant: "body1", children:
|
|
397
|
+
/* @__PURE__ */ i(N, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: /* @__PURE__ */ i(_e, { bold: !0, sx: { lineHeight: "16px" }, variant: "body1", children: E }) }),
|
|
398
398
|
/* @__PURE__ */ i(
|
|
399
399
|
_e,
|
|
400
400
|
{
|
|
401
|
-
dangerouslySetInnerHTML: { __html:
|
|
401
|
+
dangerouslySetInnerHTML: { __html: r },
|
|
402
402
|
sx: {
|
|
403
403
|
display: "-webkit-box",
|
|
404
404
|
overflow: "hidden",
|
|
@@ -419,14 +419,14 @@ const $ = h.createContext(null), rt = ({
|
|
|
419
419
|
flexDirection: "row",
|
|
420
420
|
height: 28,
|
|
421
421
|
pb: 4,
|
|
422
|
-
pl:
|
|
422
|
+
pl: a ? 36 : 0
|
|
423
423
|
},
|
|
424
424
|
children: [
|
|
425
425
|
S && /* @__PURE__ */ i(
|
|
426
426
|
ne,
|
|
427
427
|
{
|
|
428
428
|
onClick: (u) => {
|
|
429
|
-
u.stopPropagation(),
|
|
429
|
+
u.stopPropagation(), c?.();
|
|
430
430
|
},
|
|
431
431
|
onMouseDown: (u) => {
|
|
432
432
|
u.stopPropagation();
|
|
@@ -435,16 +435,16 @@ const $ = h.createContext(null), rt = ({
|
|
|
435
435
|
u.stopPropagation();
|
|
436
436
|
},
|
|
437
437
|
size: "small",
|
|
438
|
-
sx: { px:
|
|
438
|
+
sx: { px: a ? 8 : 0 },
|
|
439
439
|
variant: "text",
|
|
440
|
-
children: /* @__PURE__ */ i(ue, { bold: !0, variant: "body2", children:
|
|
440
|
+
children: /* @__PURE__ */ i(ue, { bold: !0, variant: "body2", children: l })
|
|
441
441
|
}
|
|
442
442
|
),
|
|
443
|
-
|
|
443
|
+
T && /* @__PURE__ */ i(
|
|
444
444
|
ne,
|
|
445
445
|
{
|
|
446
446
|
onClick: (u) => {
|
|
447
|
-
u.stopPropagation(),
|
|
447
|
+
u.stopPropagation(), d?.();
|
|
448
448
|
},
|
|
449
449
|
onMouseDown: (u) => {
|
|
450
450
|
u.stopPropagation();
|
|
@@ -455,7 +455,7 @@ const $ = h.createContext(null), rt = ({
|
|
|
455
455
|
size: "small",
|
|
456
456
|
sx: { px: 8 },
|
|
457
457
|
variant: "text",
|
|
458
|
-
children: /* @__PURE__ */ i(ue, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children:
|
|
458
|
+
children: /* @__PURE__ */ i(ue, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children: g })
|
|
459
459
|
}
|
|
460
460
|
)
|
|
461
461
|
]
|
|
@@ -468,27 +468,27 @@ const $ = h.createContext(null), rt = ({
|
|
|
468
468
|
{
|
|
469
469
|
"aria-hidden": !s,
|
|
470
470
|
"aria-label": e,
|
|
471
|
-
ref:
|
|
471
|
+
ref: V,
|
|
472
472
|
role: "group",
|
|
473
473
|
sx: {
|
|
474
474
|
backgroundColor: "background.paper",
|
|
475
|
-
height:
|
|
476
|
-
minWidth:
|
|
475
|
+
height: m ? "100%" : 124,
|
|
476
|
+
minWidth: I ? `${I}px` : "100%",
|
|
477
477
|
position: "relative",
|
|
478
478
|
...o
|
|
479
479
|
},
|
|
480
|
-
tabIndex:
|
|
481
|
-
variant:
|
|
482
|
-
...
|
|
483
|
-
children:
|
|
480
|
+
tabIndex: _ || !s ? -1 : 0,
|
|
481
|
+
variant: A,
|
|
482
|
+
...D,
|
|
483
|
+
children: _ ? /* @__PURE__ */ i(
|
|
484
484
|
Qe,
|
|
485
485
|
{
|
|
486
|
-
onClick:
|
|
486
|
+
onClick: _,
|
|
487
487
|
sx: {
|
|
488
488
|
pb: 8,
|
|
489
489
|
pt: 16,
|
|
490
490
|
px: 16,
|
|
491
|
-
height:
|
|
491
|
+
height: m ? "100%" : 124
|
|
492
492
|
},
|
|
493
493
|
children: w
|
|
494
494
|
}
|
|
@@ -496,55 +496,55 @@ const $ = h.createContext(null), rt = ({
|
|
|
496
496
|
}
|
|
497
497
|
);
|
|
498
498
|
}
|
|
499
|
-
), q = Ct,
|
|
499
|
+
), q = Ct, Et = ({
|
|
500
500
|
ariaLabel: t,
|
|
501
501
|
beat: e,
|
|
502
502
|
index: o,
|
|
503
503
|
isActiveCard: n,
|
|
504
504
|
onCardClick: r,
|
|
505
|
-
posthog:
|
|
506
|
-
widthOverrides:
|
|
507
|
-
variant:
|
|
508
|
-
showIcon:
|
|
509
|
-
heightOverrides:
|
|
505
|
+
posthog: a,
|
|
506
|
+
widthOverrides: s,
|
|
507
|
+
variant: p,
|
|
508
|
+
showIcon: m,
|
|
509
|
+
heightOverrides: C
|
|
510
510
|
}) => {
|
|
511
|
-
const { ref:
|
|
511
|
+
const { ref: _, inView: c } = fe({
|
|
512
512
|
threshold: we
|
|
513
|
-
}), { cardsCopy: d } =
|
|
513
|
+
}), { cardsCopy: d } = B(), { onEvent: l } = j(), { updateBeat: g, updateOffer: E } = pt();
|
|
514
514
|
ie(() => {
|
|
515
|
-
c && (e.has_been_displayed ? l(
|
|
515
|
+
c && (e.has_been_displayed ? l(ye(e.template)) : (e.guid.startsWith("OFR") ? E({
|
|
516
516
|
...e,
|
|
517
517
|
has_been_displayed: !0
|
|
518
|
-
}) :
|
|
518
|
+
}) : g({
|
|
519
519
|
...e,
|
|
520
520
|
has_been_displayed: !0
|
|
521
521
|
}), l(We(e.template))));
|
|
522
522
|
}, [c]), ie(() => {
|
|
523
523
|
if (c && e)
|
|
524
524
|
if (e.template === "MarketingOffer") {
|
|
525
|
-
const
|
|
526
|
-
|
|
525
|
+
const I = e;
|
|
526
|
+
a?.capture("viewed_messaging_insight", {
|
|
527
527
|
template: e.template,
|
|
528
|
-
campaign_guid:
|
|
529
|
-
campaign_name:
|
|
528
|
+
campaign_guid: I.campaign_guid,
|
|
529
|
+
campaign_name: I.pulse_campaign_name
|
|
530
530
|
});
|
|
531
531
|
} else
|
|
532
|
-
|
|
532
|
+
a?.capture("viewed_insight", {
|
|
533
533
|
beat_guid: e.guid,
|
|
534
534
|
template: e.template,
|
|
535
535
|
position: o
|
|
536
536
|
});
|
|
537
537
|
}, [e, o, c]);
|
|
538
|
-
const
|
|
539
|
-
if (r && r(e), l(
|
|
540
|
-
const
|
|
541
|
-
|
|
538
|
+
const A = () => {
|
|
539
|
+
if (r && r(e), l(Oe(e.template)), e.template === "MarketingOffer") {
|
|
540
|
+
const I = e;
|
|
541
|
+
a?.capture("clicked_messaging_insight", {
|
|
542
542
|
template: e.template,
|
|
543
|
-
campaign_guid:
|
|
544
|
-
campaign_name:
|
|
543
|
+
campaign_guid: I.campaign_guid,
|
|
544
|
+
campaign_name: I.pulse_campaign_name
|
|
545
545
|
});
|
|
546
546
|
} else
|
|
547
|
-
|
|
547
|
+
a?.capture("clicked_insight", {
|
|
548
548
|
beat_guid: e.guid,
|
|
549
549
|
template: e.template,
|
|
550
550
|
position: o
|
|
@@ -560,29 +560,29 @@ const $ = h.createContext(null), rt = ({
|
|
|
560
560
|
},
|
|
561
561
|
description: e?.html_micro_description && e?.html_micro_description.length > 0 ? e.html_micro_description : e.html_description || "",
|
|
562
562
|
hasCardEffect: !0,
|
|
563
|
-
heightOverrides:
|
|
564
|
-
icon:
|
|
563
|
+
heightOverrides: C,
|
|
564
|
+
icon: m && /* @__PURE__ */ i(ut, { beat: e }),
|
|
565
565
|
isActiveCard: n,
|
|
566
|
-
onCardClick:
|
|
567
|
-
onPrimaryAction:
|
|
566
|
+
onCardClick: A,
|
|
567
|
+
onPrimaryAction: A,
|
|
568
568
|
primaryActionText: e.micro_call_to_action || d.micro_card_cta,
|
|
569
|
-
ref:
|
|
569
|
+
ref: _,
|
|
570
570
|
title: e.micro_title && e.micro_title.length > 0 ? e.micro_title : e.title,
|
|
571
|
-
variant:
|
|
572
|
-
widthOverrides:
|
|
571
|
+
variant: p,
|
|
572
|
+
widthOverrides: s
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
|
-
},
|
|
575
|
+
}, gt = ({
|
|
576
576
|
currentBeatIndex: t,
|
|
577
577
|
numBeats: e,
|
|
578
578
|
onNextClick: o,
|
|
579
579
|
onPreviousClick: n,
|
|
580
580
|
scrollRightBoundary: r,
|
|
581
|
-
scrollX:
|
|
582
|
-
shouldApplyDotAnimation:
|
|
583
|
-
visibleCardsCount:
|
|
581
|
+
scrollX: a,
|
|
582
|
+
shouldApplyDotAnimation: s = !1,
|
|
583
|
+
visibleCardsCount: p = 1
|
|
584
584
|
}) => {
|
|
585
|
-
const
|
|
585
|
+
const m = H(), { carouselCopy: C } = B(), _ = Math.floor(a) > r || t - p + 1 === 0, c = a < 0 || e - 1 === t, d = m.palette.grey[500], l = m.palette.primary.main;
|
|
586
586
|
return /* @__PURE__ */ L(
|
|
587
587
|
N,
|
|
588
588
|
{
|
|
@@ -601,32 +601,32 @@ const $ = h.createContext(null), rt = ({
|
|
|
601
601
|
/* @__PURE__ */ i(
|
|
602
602
|
re,
|
|
603
603
|
{
|
|
604
|
-
"aria-disabled":
|
|
605
|
-
"aria-label":
|
|
606
|
-
disabled:
|
|
604
|
+
"aria-disabled": _,
|
|
605
|
+
"aria-label": C.previous_insight_cta_aria,
|
|
606
|
+
disabled: _,
|
|
607
607
|
onClick: n,
|
|
608
608
|
children: /* @__PURE__ */ i(
|
|
609
|
-
|
|
609
|
+
ke,
|
|
610
610
|
{
|
|
611
611
|
style: {
|
|
612
|
-
color:
|
|
612
|
+
color: _ ? d : l
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
)
|
|
616
616
|
}
|
|
617
617
|
),
|
|
618
|
-
Array.from({ length: e }).map((
|
|
619
|
-
const
|
|
618
|
+
Array.from({ length: e }).map((g, E) => {
|
|
619
|
+
const A = E === t;
|
|
620
620
|
return /* @__PURE__ */ i(
|
|
621
621
|
Q,
|
|
622
622
|
{
|
|
623
623
|
className: "mx-insights-micro-carousel-dots",
|
|
624
624
|
sx: {
|
|
625
|
-
bgcolor:
|
|
625
|
+
bgcolor: A ? l : d,
|
|
626
626
|
height: 8,
|
|
627
627
|
mr: 8,
|
|
628
628
|
// existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
|
|
629
|
-
...
|
|
629
|
+
...s ? {
|
|
630
630
|
borderRadius: "4px",
|
|
631
631
|
transformOrigin: "center",
|
|
632
632
|
transition: "all 0.5s ease-out",
|
|
@@ -635,21 +635,21 @@ const $ = h.createContext(null), rt = ({
|
|
|
635
635
|
borderRadius: "50%",
|
|
636
636
|
p: 0
|
|
637
637
|
},
|
|
638
|
-
width:
|
|
638
|
+
width: A && s ? 24 : 8
|
|
639
639
|
}
|
|
640
640
|
},
|
|
641
|
-
`carousel-button-${
|
|
641
|
+
`carousel-button-${E}`
|
|
642
642
|
);
|
|
643
643
|
}),
|
|
644
644
|
/* @__PURE__ */ i(
|
|
645
645
|
re,
|
|
646
646
|
{
|
|
647
647
|
"aria-disabled": c,
|
|
648
|
-
"aria-label":
|
|
648
|
+
"aria-label": C.next_insight_cta_aria,
|
|
649
649
|
disabled: c,
|
|
650
650
|
onClick: o,
|
|
651
651
|
children: /* @__PURE__ */ i(
|
|
652
|
-
|
|
652
|
+
Te,
|
|
653
653
|
{
|
|
654
654
|
style: {
|
|
655
655
|
color: c ? d : l
|
|
@@ -667,35 +667,35 @@ const $ = h.createContext(null), rt = ({
|
|
|
667
667
|
cardWidth: o,
|
|
668
668
|
showCTAColocatedWithText: n,
|
|
669
669
|
heightOverrides: r,
|
|
670
|
-
onCardClick:
|
|
671
|
-
posthog:
|
|
672
|
-
showIcon:
|
|
673
|
-
variant:
|
|
670
|
+
onCardClick: a,
|
|
671
|
+
posthog: s,
|
|
672
|
+
showIcon: p,
|
|
673
|
+
variant: m
|
|
674
674
|
}) => {
|
|
675
|
-
const { carouselCopy:
|
|
675
|
+
const { carouselCopy: C } = B(), _ = {
|
|
676
676
|
showCTAColocatedWithText: n,
|
|
677
677
|
heightOverrides: r,
|
|
678
|
-
posthog:
|
|
679
|
-
showIcon:
|
|
680
|
-
variant:
|
|
678
|
+
posthog: s,
|
|
679
|
+
showIcon: p,
|
|
680
|
+
variant: m
|
|
681
681
|
};
|
|
682
682
|
return /* @__PURE__ */ L(Se, { children: [
|
|
683
683
|
e.map((c, d) => {
|
|
684
|
-
const l = d + 1,
|
|
685
|
-
|
|
684
|
+
const l = d + 1, g = e.length + 1, E = Fe(
|
|
685
|
+
C.card_position_in_carousel_aria,
|
|
686
686
|
l.toString(),
|
|
687
|
-
|
|
688
|
-
),
|
|
687
|
+
g.toString()
|
|
688
|
+
), A = c.micro_title && c.micro_title.length > 0, I = c.micro_description && c.micro_description.length > 0, D = A ? c.micro_title : c.title, V = I ? c.micro_description : c.description;
|
|
689
689
|
return /* @__PURE__ */ i(
|
|
690
|
-
|
|
690
|
+
Et,
|
|
691
691
|
{
|
|
692
|
-
ariaLabel: `${
|
|
692
|
+
ariaLabel: `${E}: ${D}, ${V}`,
|
|
693
693
|
beat: c,
|
|
694
694
|
index: d,
|
|
695
695
|
isActiveCard: d === t,
|
|
696
|
-
onCardClick:
|
|
696
|
+
onCardClick: a,
|
|
697
697
|
widthOverrides: o || void 0,
|
|
698
|
-
...
|
|
698
|
+
..._
|
|
699
699
|
},
|
|
700
700
|
`${c.guid} ${d}`
|
|
701
701
|
);
|
|
@@ -704,9 +704,9 @@ const $ = h.createContext(null), rt = ({
|
|
|
704
704
|
Nt,
|
|
705
705
|
{
|
|
706
706
|
isActiveCard: t === e.length,
|
|
707
|
-
onCardClick:
|
|
707
|
+
onCardClick: a,
|
|
708
708
|
widthOverrides: o || void 0,
|
|
709
|
-
...
|
|
709
|
+
..._
|
|
710
710
|
}
|
|
711
711
|
)
|
|
712
712
|
] });
|
|
@@ -716,17 +716,17 @@ const $ = h.createContext(null), rt = ({
|
|
|
716
716
|
beats: o = [],
|
|
717
717
|
showCTAColocatedWithText: n,
|
|
718
718
|
heightOverrides: r,
|
|
719
|
-
onCardClick:
|
|
720
|
-
posthog:
|
|
721
|
-
showCarouselControls:
|
|
722
|
-
showIcon:
|
|
723
|
-
showWithMargin:
|
|
724
|
-
variant:
|
|
719
|
+
onCardClick: a,
|
|
720
|
+
posthog: s,
|
|
721
|
+
showCarouselControls: p,
|
|
722
|
+
showIcon: m,
|
|
723
|
+
showWithMargin: C = !0,
|
|
724
|
+
variant: _,
|
|
725
725
|
widthOverrides: c,
|
|
726
726
|
visibleCardsCount: d = 1
|
|
727
727
|
// Default to 1 card visible
|
|
728
728
|
}) => {
|
|
729
|
-
const l = h.useRef(null),
|
|
729
|
+
const l = h.useRef(null), g = h.useRef(null), [E, A] = h.useState(0), [I, D] = h.useState(null), [V, S] = h.useState(null), [T, M] = h.useState(null), { carouselCopy: w } = B(), { onEvent: u } = j();
|
|
730
730
|
h.useEffect(() => {
|
|
731
731
|
if (l.current && !e) {
|
|
732
732
|
const W = l.current.offsetWidth, K = 8;
|
|
@@ -739,7 +739,7 @@ const $ = h.createContext(null), rt = ({
|
|
|
739
739
|
M(z);
|
|
740
740
|
}
|
|
741
741
|
}, [d, l.current?.offsetWidth]), h.useEffect(() => {
|
|
742
|
-
const W =
|
|
742
|
+
const W = g.current?.offsetWidth;
|
|
743
743
|
if (typeof W == "number" && e) {
|
|
744
744
|
const K = (F) => {
|
|
745
745
|
const de = [
|
|
@@ -753,42 +753,42 @@ const $ = h.createContext(null), rt = ({
|
|
|
753
753
|
};
|
|
754
754
|
M(K(W));
|
|
755
755
|
const z = () => {
|
|
756
|
-
const F =
|
|
756
|
+
const F = g.current?.offsetWidth;
|
|
757
757
|
typeof F == "number" && M(K(F));
|
|
758
758
|
};
|
|
759
759
|
return window.addEventListener("resize", z), () => {
|
|
760
760
|
window.removeEventListener("resize", z);
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
}, [e,
|
|
763
|
+
}, [e, g]);
|
|
764
764
|
const Y = () => {
|
|
765
|
-
u(
|
|
766
|
-
left:
|
|
765
|
+
u(y.ON_CAROUSEL_FORWARD_CLICK, t), l.current && T && l.current.scrollTo({
|
|
766
|
+
left: E + T + 8,
|
|
767
767
|
top: 0,
|
|
768
768
|
behavior: "smooth"
|
|
769
769
|
});
|
|
770
770
|
}, X = () => {
|
|
771
|
-
u(
|
|
772
|
-
left: Math.max(0,
|
|
771
|
+
u(y.ON_CAROUSEL_BACK_CLICK, t), l.current && T && l.current.scrollTo({
|
|
772
|
+
left: Math.max(0, E - (T + 8)),
|
|
773
773
|
top: 0,
|
|
774
774
|
behavior: "smooth"
|
|
775
775
|
});
|
|
776
776
|
}, J = () => {
|
|
777
|
-
l.current &&
|
|
777
|
+
l.current && A(l.current.scrollLeft);
|
|
778
778
|
}, ee = () => {
|
|
779
|
-
if (!V || !
|
|
780
|
-
V -
|
|
779
|
+
if (!V || !I) return;
|
|
780
|
+
V - I > mt ? u(y.ON_CAROUSEL_FORWARD_SWIPE, t) : u(y.ON_CAROUSEL_BACK_SWIPE, t);
|
|
781
781
|
}, te = (W) => {
|
|
782
|
-
|
|
782
|
+
D(W.targetTouches[0].clientX);
|
|
783
783
|
}, Z = (W) => {
|
|
784
|
-
|
|
785
|
-
},
|
|
784
|
+
D(null), S(W.targetTouches[0].clientX);
|
|
785
|
+
}, v = T ? Math.round(E / (T + 8)) : 0, ve = l.current ? l.current.scrollWidth - l.current.offsetWidth : 0;
|
|
786
786
|
return /* @__PURE__ */ L(
|
|
787
787
|
N,
|
|
788
788
|
{
|
|
789
789
|
"aria-label": w.carousel_title,
|
|
790
790
|
"aria-roledescription": "carousel",
|
|
791
|
-
ref:
|
|
791
|
+
ref: g,
|
|
792
792
|
role: "group/region",
|
|
793
793
|
sx: {
|
|
794
794
|
alignItems: "center",
|
|
@@ -812,7 +812,7 @@ const $ = h.createContext(null), rt = ({
|
|
|
812
812
|
gap: 8,
|
|
813
813
|
listStyleType: "none",
|
|
814
814
|
m: 0,
|
|
815
|
-
maxWidth:
|
|
815
|
+
maxWidth: C ? "calc(100% - 32px)" : "100%",
|
|
816
816
|
overflowX: "auto",
|
|
817
817
|
overflowY: "hidden",
|
|
818
818
|
p: 0,
|
|
@@ -826,28 +826,28 @@ const $ = h.createContext(null), rt = ({
|
|
|
826
826
|
children: /* @__PURE__ */ i(
|
|
827
827
|
It,
|
|
828
828
|
{
|
|
829
|
-
activeCardIndex:
|
|
829
|
+
activeCardIndex: v,
|
|
830
830
|
beats: o,
|
|
831
|
-
cardWidth:
|
|
831
|
+
cardWidth: T,
|
|
832
832
|
heightOverrides: r,
|
|
833
|
-
onCardClick:
|
|
834
|
-
posthog:
|
|
833
|
+
onCardClick: a,
|
|
834
|
+
posthog: s,
|
|
835
835
|
showCTAColocatedWithText: n,
|
|
836
|
-
showIcon:
|
|
837
|
-
variant:
|
|
836
|
+
showIcon: m,
|
|
837
|
+
variant: _
|
|
838
838
|
}
|
|
839
839
|
)
|
|
840
840
|
}
|
|
841
841
|
),
|
|
842
|
-
|
|
843
|
-
|
|
842
|
+
p && /* @__PURE__ */ i(
|
|
843
|
+
gt,
|
|
844
844
|
{
|
|
845
|
-
currentBeatIndex:
|
|
845
|
+
currentBeatIndex: v + d - 1,
|
|
846
846
|
numBeats: o.length + 1,
|
|
847
847
|
onNextClick: Y,
|
|
848
848
|
onPreviousClick: X,
|
|
849
849
|
scrollRightBoundary: ve,
|
|
850
|
-
scrollX:
|
|
850
|
+
scrollX: E,
|
|
851
851
|
shouldApplyDotAnimation: e,
|
|
852
852
|
visibleCardsCount: d
|
|
853
853
|
}
|
|
@@ -855,14 +855,14 @@ const $ = h.createContext(null), rt = ({
|
|
|
855
855
|
]
|
|
856
856
|
}
|
|
857
857
|
);
|
|
858
|
-
}, St = U(At),
|
|
858
|
+
}, St = U(At), Tt = ({
|
|
859
859
|
analyticsMetadata: t,
|
|
860
860
|
onCardClick: e,
|
|
861
861
|
posthog: o,
|
|
862
862
|
widthOverrides: n
|
|
863
863
|
}) => {
|
|
864
|
-
const { carouselCopy: r } =
|
|
865
|
-
|
|
864
|
+
const { carouselCopy: r } = B(), { onEvent: a } = j(), s = () => {
|
|
865
|
+
a && (a(y.ON_VIEW_MORE_CLICKED, t), e(), o?.capture("clicked_view_more"));
|
|
866
866
|
};
|
|
867
867
|
return r ? /* @__PURE__ */ L(
|
|
868
868
|
N,
|
|
@@ -872,45 +872,31 @@ const $ = h.createContext(null), rt = ({
|
|
|
872
872
|
justifyContent: "space-between",
|
|
873
873
|
spacing: 2,
|
|
874
874
|
sx: {
|
|
875
|
-
|
|
875
|
+
p: 16,
|
|
876
|
+
pb: 8,
|
|
876
877
|
width: n || void 0
|
|
877
878
|
},
|
|
878
879
|
children: [
|
|
879
|
-
/* @__PURE__ */ i(
|
|
880
|
-
be,
|
|
881
|
-
{
|
|
882
|
-
sx: (_) => ({
|
|
883
|
-
color: _.palette.primary.main,
|
|
884
|
-
fontSize: 18,
|
|
885
|
-
fontWeight: 700,
|
|
886
|
-
lineHeight: "24px"
|
|
887
|
-
}),
|
|
888
|
-
variant: "h3",
|
|
889
|
-
children: r.carousel_title
|
|
890
|
-
}
|
|
891
|
-
),
|
|
880
|
+
/* @__PURE__ */ i(Be, { children: r.carousel_title }),
|
|
892
881
|
/* @__PURE__ */ i(
|
|
893
882
|
ne,
|
|
894
883
|
{
|
|
895
|
-
endIcon: /* @__PURE__ */ i(
|
|
896
|
-
onClick:
|
|
884
|
+
endIcon: /* @__PURE__ */ i(Te, { size: 20 }),
|
|
885
|
+
onClick: s,
|
|
897
886
|
size: "small",
|
|
898
|
-
sx: (_) => ({
|
|
899
|
-
color: _.palette.primary.main
|
|
900
|
-
}),
|
|
901
887
|
variant: "text",
|
|
902
888
|
children: r.view_all_insights_in_full_feed_cta_aria
|
|
903
889
|
}
|
|
904
890
|
)
|
|
905
891
|
]
|
|
906
892
|
}
|
|
907
|
-
) : /* @__PURE__ */ i(
|
|
908
|
-
},
|
|
893
|
+
) : /* @__PURE__ */ i(ze, {});
|
|
894
|
+
}, ft = U(Tt), Rt = ({
|
|
909
895
|
heightOverrides: t,
|
|
910
896
|
widthOverrides: e,
|
|
911
897
|
children: o
|
|
912
898
|
}) => {
|
|
913
|
-
const { carouselCopy: n } =
|
|
899
|
+
const { carouselCopy: n } = B();
|
|
914
900
|
return /* @__PURE__ */ i(
|
|
915
901
|
Q,
|
|
916
902
|
{
|
|
@@ -932,14 +918,14 @@ const $ = h.createContext(null), rt = ({
|
|
|
932
918
|
onCardClick: o,
|
|
933
919
|
posthog: n,
|
|
934
920
|
showIcon: r,
|
|
935
|
-
variant:
|
|
921
|
+
variant: a
|
|
936
922
|
}) => {
|
|
937
|
-
const { cardsCopy:
|
|
923
|
+
const { cardsCopy: s } = B(), p = H(), { onEvent: m } = j(), { onPageview: C } = Me();
|
|
938
924
|
h.useEffect(() => {
|
|
939
|
-
|
|
925
|
+
C(k.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
940
926
|
}, []);
|
|
941
|
-
const
|
|
942
|
-
o && o(),
|
|
927
|
+
const _ = () => {
|
|
928
|
+
o && o(), m(y.ON_NO_RELEVANT_INSIGHTS_CLICKED), n?.capture("clicked_insight", {
|
|
943
929
|
template: "no_relevant_insights"
|
|
944
930
|
});
|
|
945
931
|
};
|
|
@@ -950,27 +936,27 @@ const $ = h.createContext(null), rt = ({
|
|
|
950
936
|
cardSx: {
|
|
951
937
|
borderRadius: 2
|
|
952
938
|
},
|
|
953
|
-
description:
|
|
939
|
+
description: s.no_relevant_insights_card_description,
|
|
954
940
|
hasCardEffect: !0,
|
|
955
941
|
heightOverrides: e,
|
|
956
|
-
icon: r && /* @__PURE__ */ i(R, { bgColor:
|
|
957
|
-
onCardClick:
|
|
958
|
-
onPrimaryAction:
|
|
959
|
-
primaryActionText:
|
|
960
|
-
title:
|
|
961
|
-
variant:
|
|
942
|
+
icon: r && /* @__PURE__ */ i(R, { bgColor: f(p.palette.primary.main, 0.15), name: "lightbulb" }),
|
|
943
|
+
onCardClick: _,
|
|
944
|
+
onPrimaryAction: _,
|
|
945
|
+
primaryActionText: s.micro_card_cta,
|
|
946
|
+
title: s.no_relevant_insights_card_title,
|
|
947
|
+
variant: a
|
|
962
948
|
}
|
|
963
949
|
);
|
|
964
|
-
},
|
|
950
|
+
}, qt = U(Le), De = ({
|
|
965
951
|
ariaLabel: t,
|
|
966
952
|
heightOverrides: e,
|
|
967
953
|
onCardClick: o,
|
|
968
954
|
showIcon: n,
|
|
969
955
|
variant: r
|
|
970
956
|
}) => {
|
|
971
|
-
const { onPageview:
|
|
957
|
+
const { onPageview: a } = Me(), { zeroStateCopy: s } = B(), p = H();
|
|
972
958
|
return h.useEffect(() => {
|
|
973
|
-
|
|
959
|
+
a(k.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
974
960
|
}, []), /* @__PURE__ */ i(
|
|
975
961
|
q,
|
|
976
962
|
{
|
|
@@ -978,16 +964,16 @@ const $ = h.createContext(null), rt = ({
|
|
|
978
964
|
cardSx: {
|
|
979
965
|
borderRadius: 2
|
|
980
966
|
},
|
|
981
|
-
description:
|
|
967
|
+
description: s.carousel_zero_state_description,
|
|
982
968
|
hasCardEffect: !0,
|
|
983
969
|
heightOverrides: e,
|
|
984
|
-
icon: n && /* @__PURE__ */ i(R, { bgColor:
|
|
970
|
+
icon: n && /* @__PURE__ */ i(R, { bgColor: f(p.palette.primary.main, 0.15), name: "lightbulb" }),
|
|
985
971
|
onCardClick: o,
|
|
986
|
-
title:
|
|
972
|
+
title: s.carousel_zero_state_title,
|
|
987
973
|
variant: r
|
|
988
974
|
}
|
|
989
975
|
);
|
|
990
|
-
},
|
|
976
|
+
}, Jt = U(De), Ot = () => /* @__PURE__ */ i(
|
|
991
977
|
Q,
|
|
992
978
|
{
|
|
993
979
|
sx: {
|
|
@@ -999,70 +985,70 @@ const $ = h.createContext(null), rt = ({
|
|
|
999
985
|
},
|
|
1000
986
|
children: /* @__PURE__ */ i(He, {})
|
|
1001
987
|
}
|
|
1002
|
-
), G = new nt(),
|
|
988
|
+
), G = new nt(), yt = ({
|
|
1003
989
|
allowSingleCardPeeking: t,
|
|
1004
990
|
areBeatsLoading: e,
|
|
1005
991
|
beats: o = [],
|
|
1006
992
|
// This also determines the length of the carousel controls (beat.length + 1)
|
|
1007
993
|
showCTAColocatedWithText: n = !0,
|
|
1008
994
|
endpoint: r = "/",
|
|
1009
|
-
heightOverrides:
|
|
1010
|
-
logOutUser:
|
|
1011
|
-
onCardClick:
|
|
995
|
+
heightOverrides: a,
|
|
996
|
+
logOutUser: s,
|
|
997
|
+
onCardClick: p = () => {
|
|
1012
998
|
},
|
|
1013
|
-
onEvent:
|
|
999
|
+
onEvent: m = () => {
|
|
1014
1000
|
},
|
|
1015
|
-
onPageview:
|
|
1001
|
+
onPageview: C = () => {
|
|
1016
1002
|
},
|
|
1017
|
-
posthog:
|
|
1003
|
+
posthog: _,
|
|
1018
1004
|
showBorder: c = !0,
|
|
1019
1005
|
showCarouselControls: d,
|
|
1020
1006
|
showHeader: l,
|
|
1021
|
-
showIcon:
|
|
1022
|
-
showWithMargin:
|
|
1023
|
-
token:
|
|
1024
|
-
userHasFullInsightFeedBeats:
|
|
1025
|
-
variant:
|
|
1007
|
+
showIcon: g,
|
|
1008
|
+
showWithMargin: E = !0,
|
|
1009
|
+
token: A = "",
|
|
1010
|
+
userHasFullInsightFeedBeats: I,
|
|
1011
|
+
variant: D,
|
|
1026
1012
|
visibleCardsCount: V = 1,
|
|
1027
1013
|
widthOverrides: S
|
|
1028
1014
|
}) => {
|
|
1029
|
-
const [
|
|
1015
|
+
const [T, M] = oe("STANDARD"), [w, u] = oe(!1), [Y, X] = oe(!1), J = je([m], G), ee = Ye([C], G);
|
|
1030
1016
|
Xe({
|
|
1031
1017
|
widgetName: "InsightsMicroWidget",
|
|
1032
1018
|
isLoaded: w
|
|
1033
1019
|
}), h.useEffect(() => {
|
|
1034
|
-
!G.isInitialized && !Y && (G.initialize(r,
|
|
1035
|
-
}, [r,
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1020
|
+
!G.isInitialized && !Y && (G.initialize(r, A, s).catch(() => X(!1)), X(!0));
|
|
1021
|
+
}, [r, A, s, G.isInitialized, Y]), h.useEffect(() => {
|
|
1022
|
+
const v = window.innerHeight;
|
|
1023
|
+
v < 180 ? M("STANDARD") : v >= 180 && v < 200 ? M("LARGE") : v >= 200 && v < 248 ? M("XLARGE") : v >= 248 && M("XXLARGE");
|
|
1038
1024
|
}, [window.innerHeight]), h.useEffect(() => {
|
|
1039
1025
|
u(!e && G.isInitialized);
|
|
1040
1026
|
}, [e, G.isInitialized]);
|
|
1041
1027
|
const te = {
|
|
1042
1028
|
showCTAColocatedWithText: n,
|
|
1043
|
-
heightOverrides:
|
|
1044
|
-
onCardClick:
|
|
1045
|
-
posthog:
|
|
1046
|
-
showIcon:
|
|
1047
|
-
showWithMargin:
|
|
1029
|
+
heightOverrides: a,
|
|
1030
|
+
onCardClick: p,
|
|
1031
|
+
posthog: _,
|
|
1032
|
+
showIcon: g,
|
|
1033
|
+
showWithMargin: E,
|
|
1048
1034
|
widthOverrides: S
|
|
1049
1035
|
}, Z = {
|
|
1050
|
-
carouselSize:
|
|
1051
|
-
variant:
|
|
1036
|
+
carouselSize: T,
|
|
1037
|
+
variant: D,
|
|
1052
1038
|
showCTAColocatedWithText: n,
|
|
1053
|
-
heightOverrides:
|
|
1054
|
-
onCardClick:
|
|
1055
|
-
posthog:
|
|
1056
|
-
showIcon:
|
|
1039
|
+
heightOverrides: a,
|
|
1040
|
+
onCardClick: p,
|
|
1041
|
+
posthog: _,
|
|
1042
|
+
showIcon: g
|
|
1057
1043
|
};
|
|
1058
|
-
return /* @__PURE__ */ i(rt, { onEvent: J, onPageview: ee, store: G, children: /* @__PURE__ */ L(Rt, { heightOverrides:
|
|
1059
|
-
!w && /* @__PURE__ */ i(
|
|
1044
|
+
return /* @__PURE__ */ i(rt, { onEvent: J, onPageview: ee, store: G, children: /* @__PURE__ */ L(Rt, { heightOverrides: a, widthOverrides: S, children: [
|
|
1045
|
+
!w && /* @__PURE__ */ i(Ot, {}),
|
|
1060
1046
|
w && l && /* @__PURE__ */ i(
|
|
1061
|
-
|
|
1047
|
+
ft,
|
|
1062
1048
|
{
|
|
1063
1049
|
analyticsMetadata: me,
|
|
1064
|
-
onCardClick:
|
|
1065
|
-
posthog:
|
|
1050
|
+
onCardClick: p,
|
|
1051
|
+
posthog: _,
|
|
1066
1052
|
widthOverrides: S
|
|
1067
1053
|
}
|
|
1068
1054
|
),
|
|
@@ -1073,7 +1059,7 @@ const $ = h.createContext(null), rt = ({
|
|
|
1073
1059
|
analyticsMetadata: me,
|
|
1074
1060
|
beats: o,
|
|
1075
1061
|
showCarouselControls: d,
|
|
1076
|
-
variant: c ?
|
|
1062
|
+
variant: c ? D : void 0,
|
|
1077
1063
|
visibleCardsCount: V,
|
|
1078
1064
|
...te
|
|
1079
1065
|
}
|
|
@@ -1083,42 +1069,42 @@ const $ = h.createContext(null), rt = ({
|
|
|
1083
1069
|
{
|
|
1084
1070
|
sx: {
|
|
1085
1071
|
alignItems: "center",
|
|
1086
|
-
height:
|
|
1072
|
+
height: a,
|
|
1087
1073
|
width: S || "100%"
|
|
1088
1074
|
},
|
|
1089
1075
|
children: /* @__PURE__ */ i(
|
|
1090
1076
|
N,
|
|
1091
1077
|
{
|
|
1092
1078
|
sx: {
|
|
1093
|
-
height: `calc(${ht[
|
|
1094
|
-
width:
|
|
1079
|
+
height: `calc(${ht[T]}px - 44px)`,
|
|
1080
|
+
width: E ? `calc(${S}px - 32px)` : "100%"
|
|
1095
1081
|
},
|
|
1096
|
-
children:
|
|
1082
|
+
children: I ? /* @__PURE__ */ i(Le, { ...Z }) : /* @__PURE__ */ i(De, { ...Z })
|
|
1097
1083
|
}
|
|
1098
1084
|
)
|
|
1099
1085
|
}
|
|
1100
1086
|
)
|
|
1101
1087
|
] }) });
|
|
1102
|
-
},
|
|
1088
|
+
}, eo = U(yt), Wt = ({
|
|
1103
1089
|
ariaLabel: t,
|
|
1104
1090
|
heightOverrides: e,
|
|
1105
1091
|
isActiveCard: o,
|
|
1106
1092
|
onCardClick: n,
|
|
1107
1093
|
posthog: r,
|
|
1108
|
-
widthOverrides:
|
|
1109
|
-
showIcon:
|
|
1110
|
-
variant:
|
|
1094
|
+
widthOverrides: a,
|
|
1095
|
+
showIcon: s,
|
|
1096
|
+
variant: p
|
|
1111
1097
|
}) => {
|
|
1112
|
-
const
|
|
1098
|
+
const m = H(), { ref: C, inView: _ } = fe({
|
|
1113
1099
|
threshold: we
|
|
1114
|
-
}), { cardsCopy: c } =
|
|
1100
|
+
}), { cardsCopy: c } = B(), { onEvent: d } = j();
|
|
1115
1101
|
ie(() => {
|
|
1116
|
-
|
|
1102
|
+
_ && (d(Ne.ON_VIEW_MORE_VIEWED), r?.capture("viewed_insight", {
|
|
1117
1103
|
template: "view_more_card"
|
|
1118
1104
|
}));
|
|
1119
|
-
}, [
|
|
1105
|
+
}, [_]);
|
|
1120
1106
|
const l = () => {
|
|
1121
|
-
n && n(), d(
|
|
1107
|
+
n && n(), d(y.ON_VIEW_MORE_CLICKED), r?.capture("clicked_insight", {
|
|
1122
1108
|
template: "view_more_card"
|
|
1123
1109
|
});
|
|
1124
1110
|
};
|
|
@@ -1133,29 +1119,29 @@ const $ = h.createContext(null), rt = ({
|
|
|
1133
1119
|
description: c.view_more_card_description,
|
|
1134
1120
|
hasCardEffect: !0,
|
|
1135
1121
|
heightOverrides: e,
|
|
1136
|
-
icon:
|
|
1122
|
+
icon: s && /* @__PURE__ */ i(R, { bgColor: f(m.palette.primary.main, 0.15), name: "show_chart" }),
|
|
1137
1123
|
isActiveCard: o,
|
|
1138
1124
|
onCardClick: l,
|
|
1139
1125
|
onPrimaryAction: l,
|
|
1140
1126
|
primaryActionText: c.micro_card_cta,
|
|
1141
|
-
ref:
|
|
1127
|
+
ref: C,
|
|
1142
1128
|
title: c.view_more_card_title,
|
|
1143
|
-
variant:
|
|
1144
|
-
widthOverrides:
|
|
1129
|
+
variant: p,
|
|
1130
|
+
widthOverrides: a
|
|
1145
1131
|
}
|
|
1146
1132
|
);
|
|
1147
1133
|
}, Nt = U(Wt);
|
|
1148
1134
|
export {
|
|
1149
1135
|
nt as A,
|
|
1150
|
-
|
|
1136
|
+
ft as C,
|
|
1151
1137
|
rt as I,
|
|
1152
1138
|
St as M,
|
|
1153
|
-
|
|
1139
|
+
qt as N,
|
|
1154
1140
|
me as T,
|
|
1155
1141
|
Nt as V,
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1142
|
+
Jt as Z,
|
|
1143
|
+
Et as a,
|
|
1144
|
+
eo as b,
|
|
1159
1145
|
dt as c,
|
|
1160
1146
|
q as d
|
|
1161
1147
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as u, C as s, a as c, b as v, I as C, M as R, d as H, c as M, N as F, V, Z as k } from "../ViewMoreMicroCard-
|
|
1
|
+
import { A as u, C as s, a as c, b as v, I as C, M as R, d as H, c as M, N as F, V, Z as k } from "../ViewMoreMicroCard-qXK-0-Rl.mjs";
|
|
2
2
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
3
3
|
const a = ({
|
|
4
4
|
color: i = "currentColor",
|
package/dist/trends/index.es.js
CHANGED
|
@@ -29,7 +29,7 @@ import { c as Et, i as Dt, d as Mt, e as At, b as tt, g as ot, f as Pe } from ".
|
|
|
29
29
|
import Rt from "@mui/material/ToggleButton";
|
|
30
30
|
import kt from "@mui/material/ToggleButtonGroup";
|
|
31
31
|
import { DataGridPro as Ht } from "@mui/x-data-grid-pro";
|
|
32
|
-
import { T as V, b as Nt } from "../ViewMoreMicroCard-
|
|
32
|
+
import { T as V, b as Nt } from "../ViewMoreMicroCard-qXK-0-Rl.mjs";
|
|
33
33
|
import { parseISO as nt } from "date-fns/parseISO";
|
|
34
34
|
import { H as Re } from "../HeaderCell-DjuifqHJ.mjs";
|
|
35
35
|
import { A as w, W as st } from "../WidgetContainer-CrK6tyHr.mjs";
|