@mx-cartographer/experiences 7.6.18 → 7.6.19-alpha.mega1

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