@mx-cartographer/experiences 7.0.20-alpha.mm9 → 7.0.20-alpha.sms1
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 +4 -0
- package/dist/{Account-BtpQBGaq.mjs → Account-BW3-oYEs.mjs} +1 -1
- package/dist/{AccountDetailsContent-BYHpjgb_.mjs → AccountDetailsContent-BzD6CDIm.mjs} +8 -8
- package/dist/{AccountDetailsHeader-DDDaJtyh.mjs → AccountDetailsHeader-Eb3WvBGm.mjs} +5 -5
- package/dist/{AccountFields-CBDfD65k.mjs → AccountFields-CIz-r3gP.mjs} +2 -2
- package/dist/{AccountListItem-DWhL24fc.mjs → AccountListItem-B-ZjJ4Gp.mjs} +3 -3
- package/dist/{AccountStore-BHP_4JLu.mjs → AccountStore-BaMynkQT.mjs} +26 -26
- package/dist/{Accounts-DNedOuU0.mjs → Accounts-CA-nqAjT.mjs} +1 -1
- package/dist/{BeatApi-DNuwwlOB.mjs → BeatApi-DLu87ijw.mjs} +3 -3
- package/dist/{BeatStore-Uwew6sh1.mjs → BeatStore-By4aGoRM.mjs} +17 -17
- package/dist/{BudgetUtil-CohNTVGV.mjs → BudgetUtil-CeSLAcsl.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-Ct4atnde.mjs → CategorySelectorDrawer-BJ9jlCyt.mjs} +1 -1
- package/dist/{CategoryStore-DhKc215B.mjs → CategoryStore-BOyzQjQp.mjs} +4 -4
- package/dist/{ConnectDrawer-Dxz730Md.mjs → ConnectDrawer-phFH6OHt.mjs} +1 -1
- package/dist/{ConnectionsDrawer-ClbV2gtO.mjs → ConnectionsDrawer-ihxkAi1P.mjs} +2 -2
- package/dist/{CurrencyInput-MpPSmgfC.mjs → CurrencyInput-bEx2Mbd0.mjs} +1 -1
- package/dist/{DebtsStore-D3qRzdT6.mjs → DebtsStore-VkyMADzd.mjs} +1 -1
- package/dist/{ExportCsvAction-ChlujJNt.mjs → ExportCsvAction-CbMfQ2Wa.mjs} +3 -3
- package/dist/{Fetch-yZxbEdaR.mjs → Fetch-CkFKy79O.mjs} +12 -13
- package/dist/{FinstrongStore-B9M8MY75.mjs → FinstrongStore-mkALvztw.mjs} +4 -4
- package/dist/{GoalStore-DMO-3HaE.mjs → GoalStore-eSOkI6uE.mjs} +14 -14
- package/dist/{Help-DqZFM1_7.mjs → Help-KAAMEubC.mjs} +1 -1
- package/dist/{LineChart-Bb8PUelo.mjs → LineChart-BWWmmJxV.mjs} +1 -1
- package/dist/{ListItemAction-CEcYtksA.mjs → ListItemAction-DNZZ5fSa.mjs} +1 -1
- package/dist/{ManageIncome-D43OrNVi.mjs → ManageIncome-DcKHpJ9V.mjs} +4 -4
- package/dist/MerchantStore-DVH-QOf0.mjs +37 -0
- package/dist/{MicroWidgetContainer-B_t9Hcqj.mjs → MicroWidgetContainer-Dxz8uBN9.mjs} +1 -1
- package/dist/{MiniWidgetContainer-7L-PQOO5.mjs → MiniWidgetContainer-CTyjmE1h.mjs} +1 -1
- package/dist/{NetWorthStore-DAz1fp8r.mjs → NetWorthStore-B6xF9eGH.mjs} +2 -2
- package/dist/{NotificationSettings-B5SZ5MQx.mjs → NotificationSettings-Dhf_u5o-.mjs} +2 -2
- package/dist/{NotificationStore-ShAPgDXO.mjs → NotificationStore-DHtSGySy.mjs} +4 -8
- package/dist/{OriginalBalanceAction-C3dw1SIj.mjs → OriginalBalanceAction-DepsKiJz.mjs} +3 -3
- package/dist/{RecurringSettings-CFA5irXc.mjs → RecurringSettings-C9r4s1Cz.mjs} +3 -3
- package/dist/{RecurringTransactionsStore-BiqkWPUS.mjs → RecurringTransactionsStore-D62XJtdL.mjs} +16 -20
- package/dist/{SettingsStore-CZOVuZh5.mjs → SettingsStore-B4gi6oOw.mjs} +29 -33
- package/dist/{TransactionApi-p23gEG4v.mjs → TransactionApi-DbbcjI2L.mjs} +29 -29
- package/dist/{TransactionDetails-B1wrtzF6.mjs → TransactionDetails-bja6hKJk.mjs} +5 -5
- package/dist/{TransactionStore-HCxd-BtG.mjs → TransactionStore-0tLtBEIC.mjs} +25 -29
- package/dist/{TrendsStore-DuFDxFpW.mjs → TrendsStore-WrHxzdbQ.mjs} +1 -1
- package/dist/{User-DJS1Cgkz.mjs → User-Dq9Qj764.mjs} +1 -1
- package/dist/{ViewMoreMicroCard-D3l6Jdyz.mjs → ViewMoreMicroCard-BFZShKxm.mjs} +234 -229
- package/dist/{WidgetContainer-b5b3R-TE.mjs → WidgetContainer-CdBs9WOZ.mjs} +2 -2
- package/dist/accounts/api/AccountApi.d.ts +2 -2
- package/dist/accounts/index.es.js +12 -12
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/api/BudgetsApi.d.ts +2 -2
- package/dist/budgets/index.es.js +10 -10
- package/dist/cashflow/api/CashflowApi.d.ts +2 -3
- package/dist/cashflow/index.es.js +10 -10
- package/dist/categories/index.es.js +2 -2
- package/dist/common/api/AnalyticsApi.d.ts +2 -2
- package/dist/common/api/AppDataApi.d.ts +2 -2
- package/dist/common/api/BeatApi.d.ts +2 -2
- package/dist/common/api/CategoryApi.d.ts +3 -2
- package/dist/common/api/GlobalCopyApi.d.ts +1 -2
- package/dist/common/api/LocalizedCopyApi.d.ts +1 -2
- package/dist/common/api/NotificationApi.d.ts +2 -2
- package/dist/common/api/ScheduledPaymentsApi.d.ts +2 -3
- package/dist/common/api/UserApi.d.ts +2 -2
- package/dist/common/context/GlobalDataProvider.d.ts +2 -3
- package/dist/common/context/hooks.d.ts +1 -4
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +268 -271
- package/dist/common/stores/GlobalStore.d.ts +2 -3
- package/dist/common/types/index.d.ts +0 -1
- package/dist/common/utils/Fetch.d.ts +1 -3
- package/dist/common/utils/Theme.d.ts +22 -22
- package/dist/dashboard/index.es.js +2 -2
- package/dist/debts/index.es.js +9 -9
- package/dist/{exportTransactionsToCSV-BNkzaLjs.mjs → exportTransactionsToCSV-BDlt8u0n.mjs} +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +1 -2
- package/dist/finstrong/index.es.js +7 -7
- package/dist/goals/api/GoalApi.d.ts +2 -3
- package/dist/goals/index.es.js +11 -11
- package/dist/help/api/HelpApi.d.ts +2 -2
- package/dist/help/index.es.js +3 -3
- package/dist/hooks-DkUqN6JE.mjs +71 -0
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/api/HoldingApi.d.ts +2 -3
- package/dist/investments/index.es.js +3 -3
- package/dist/merchants/api/MerchantApi.d.ts +1 -2
- package/dist/merchants/index.es.js +2 -2
- package/dist/microinsights/context/InsightsMicroWidgetDataProvider.d.ts +1 -2
- package/dist/microinsights/context/hooks.d.ts +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +7 -7
- package/dist/notifications/index.es.js +5 -5
- package/dist/recurringtransactions/api/RepeatingTransactionsApi.d.ts +2 -2
- package/dist/recurringtransactions/index.es.js +10 -10
- package/dist/settings/api/SettingsApi.d.ts +2 -3
- package/dist/settings/index.es.js +7 -7
- package/dist/spending/index.es.js +4 -4
- package/dist/transactions/api/TransactionApi.d.ts +2 -3
- package/dist/transactions/index.es.js +14 -14
- package/dist/trends/index.es.js +10 -10
- package/dist/{useCombineEvents-DOl5hNlY.mjs → useCombineEvents-DaDBSR_1.mjs} +29 -29
- package/package.json +1 -1
- package/dist/MerchantStore-CbWE5TJ3.mjs +0 -37
- package/dist/common/types/Handlers.d.ts +0 -2
- package/dist/hooks-0WZgSDp7.mjs +0 -74
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import u, { useState as ae, useEffect as ee } from "react";
|
|
3
|
-
import { observer as
|
|
3
|
+
import { observer as P } from "mobx-react-lite";
|
|
4
4
|
import be from "@mui/material/CssBaseline";
|
|
5
|
-
import { useTheme as
|
|
5
|
+
import { useTheme as Se, ThemeProvider as Ue } from "@mui/material/styles";
|
|
6
6
|
import ze from "@mui/material/Link";
|
|
7
7
|
import K from "@mui/material/Stack";
|
|
8
|
-
import
|
|
9
|
-
import { ChevronLeft as Ke, ChevronRight as
|
|
8
|
+
import ue from "@mui/material/Typography";
|
|
9
|
+
import { ChevronLeft as Ke, ChevronRight as Me } from "@mxenabled/mx-icons";
|
|
10
10
|
import { L as $e } from "./Loader-DUaFpDGv.mjs";
|
|
11
11
|
import U from "@mui/material/Box";
|
|
12
|
-
import
|
|
13
|
-
import { useInView as
|
|
14
|
-
import { P as Ye, CategoryIcon as je, useTokens as
|
|
15
|
-
import
|
|
12
|
+
import pe from "@mui/material/IconButton";
|
|
13
|
+
import { useInView as Ae } from "react-intersection-observer";
|
|
14
|
+
import { P as Ye, CategoryIcon as je, useTokens as Oe, MerchantLogo as Xe, Icon as J } from "@mxenabled/mxui";
|
|
15
|
+
import ce from "@mui/material/styles/useTheme";
|
|
16
16
|
import { b as Qe } from "./Category-CevNQ03n.mjs";
|
|
17
17
|
import { css as qe } from "@mxenabled/cssinjs";
|
|
18
18
|
import { b as Je } from "./Localization-2MODESHW.mjs";
|
|
19
19
|
import et from "@mui/material/CircularProgress";
|
|
20
|
-
import { makeAutoObservable as
|
|
21
|
-
import { G as
|
|
22
|
-
import { B as
|
|
20
|
+
import { makeAutoObservable as se, runInAction as Te } from "mobx";
|
|
21
|
+
import { G as _e, a as tt, u as it, b as ot } from "./useCombineEvents-DaDBSR_1.mjs";
|
|
22
|
+
import { B as Ce } from "./BeatApi-DLu87ijw.mjs";
|
|
23
23
|
import rt from "@mui/material/Card";
|
|
24
24
|
import lt from "@mui/material/CardActions";
|
|
25
25
|
import nt from "@mui/material/CardContent";
|
|
26
26
|
import at from "@mui/material/CardHeader";
|
|
27
|
-
const
|
|
27
|
+
const fe = {
|
|
28
28
|
featureVersion: "spendVsIncomeTrends"
|
|
29
29
|
};
|
|
30
30
|
class ct {
|
|
31
|
-
copyApi = new
|
|
31
|
+
copyApi = new _e("/", "");
|
|
32
32
|
copyObject = {};
|
|
33
33
|
namespace = "experiences";
|
|
34
34
|
translationKey = "micro_insights";
|
|
35
35
|
constructor() {
|
|
36
|
-
|
|
36
|
+
se(this);
|
|
37
37
|
}
|
|
38
|
-
// NOTE: Not sure if this is special case, but other stores have this deprecation todo
|
|
39
|
-
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
40
|
-
// TODO: Remove this function
|
|
41
38
|
initialize = async (o, t) => {
|
|
42
|
-
this.copyApi = new
|
|
39
|
+
this.copyApi = new _e(o, t), await this.loadCopy();
|
|
43
40
|
};
|
|
44
41
|
loadCopy = async () => {
|
|
45
42
|
const o = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
@@ -74,26 +71,26 @@ const de = {
|
|
|
74
71
|
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
75
72
|
MonthlySpendComparison: "MonthlySpendComparison",
|
|
76
73
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
77
|
-
}, S = window?.app?.clientConfig?.microwidget_instance_id || "",
|
|
74
|
+
}, S = window?.app?.clientConfig?.microwidget_instance_id || "", me = {
|
|
78
75
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
79
|
-
}, We = (i) => `on${i}Click`, we = (i) => `on${i}View`, xe = (i) => `on${i}ViewFirstTime`,
|
|
76
|
+
}, We = (i) => `on${i}Click`, we = (i) => `on${i}View`, xe = (i) => `on${i}ViewFirstTime`, he = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), st = () => Object.values(de).reduce(
|
|
80
77
|
(i, o) => ({
|
|
81
78
|
...i,
|
|
82
79
|
[We(o)]: {
|
|
83
|
-
action:
|
|
84
|
-
category:
|
|
85
|
-
label:
|
|
80
|
+
action: x.MICRO_BEAT_CLICKED,
|
|
81
|
+
category: w.BEAT_INTERACTION,
|
|
82
|
+
label: he(o),
|
|
86
83
|
value: S
|
|
87
84
|
}
|
|
88
85
|
}),
|
|
89
86
|
{}
|
|
90
|
-
),
|
|
87
|
+
), dt = () => Object.values(de).reduce(
|
|
91
88
|
(i, o) => ({
|
|
92
89
|
...i,
|
|
93
90
|
[we(o)]: {
|
|
94
|
-
action:
|
|
95
|
-
category:
|
|
96
|
-
label:
|
|
91
|
+
action: x.MICRO_BEAT_DISPLAYED,
|
|
92
|
+
category: w.BEAT_INTERACTION,
|
|
93
|
+
label: he(o),
|
|
97
94
|
value: S
|
|
98
95
|
}
|
|
99
96
|
}),
|
|
@@ -102,19 +99,19 @@ const de = {
|
|
|
102
99
|
(i, o) => ({
|
|
103
100
|
...i,
|
|
104
101
|
[xe(o)]: {
|
|
105
|
-
action:
|
|
106
|
-
category:
|
|
107
|
-
label:
|
|
102
|
+
action: x.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
103
|
+
category: w.BEAT_INTERACTION,
|
|
104
|
+
label: he(o),
|
|
108
105
|
value: S
|
|
109
106
|
}
|
|
110
107
|
}),
|
|
111
108
|
{}
|
|
112
|
-
),
|
|
109
|
+
), W = {
|
|
113
110
|
CARD: "Card",
|
|
114
111
|
CAROUSEL_CONTROL: "Carousel Control",
|
|
115
112
|
MICRO_WIDGET: "Micro Widget",
|
|
116
113
|
VIEW_MORE: "View More"
|
|
117
|
-
},
|
|
114
|
+
}, w = {
|
|
118
115
|
MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
|
|
119
116
|
BEAT_INTERACTION: "Beat Interaction"
|
|
120
117
|
}, M = {
|
|
@@ -126,7 +123,7 @@ const de = {
|
|
|
126
123
|
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
127
124
|
}, De = {
|
|
128
125
|
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
129
|
-
},
|
|
126
|
+
}, x = {
|
|
130
127
|
CONTROL_BACKWARD: "Control Backward",
|
|
131
128
|
CONTROL_FORWARD: "Control Forward",
|
|
132
129
|
MICRO_BEAT_CLICKED: "Micro Beat Clicked",
|
|
@@ -134,95 +131,95 @@ const de = {
|
|
|
134
131
|
MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
|
|
135
132
|
SWIPE_BACKWARD: "Swipe Backward",
|
|
136
133
|
SWIPE_FORWARD: "Swipe Forward"
|
|
137
|
-
},
|
|
134
|
+
}, H = {
|
|
138
135
|
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
139
136
|
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
140
137
|
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
141
|
-
},
|
|
142
|
-
[
|
|
143
|
-
label:
|
|
144
|
-
name:
|
|
145
|
-
path:
|
|
138
|
+
}, Re = {
|
|
139
|
+
[H.MICRO_WIDGET_CAROUSEL]: {
|
|
140
|
+
label: W.MICRO_WIDGET,
|
|
141
|
+
name: H.MICRO_WIDGET_CAROUSEL,
|
|
142
|
+
path: me.INSIGHTS_MICRO_WIDGET,
|
|
146
143
|
value: S
|
|
147
144
|
},
|
|
148
145
|
// zero state
|
|
149
|
-
[
|
|
150
|
-
label:
|
|
151
|
-
name:
|
|
152
|
-
path:
|
|
146
|
+
[H.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
147
|
+
label: W.MICRO_WIDGET,
|
|
148
|
+
name: H.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
149
|
+
path: me.INSIGHTS_MICRO_WIDGET,
|
|
153
150
|
value: S
|
|
154
151
|
},
|
|
155
152
|
// no relevant cards
|
|
156
|
-
[
|
|
157
|
-
label:
|
|
158
|
-
name:
|
|
153
|
+
[H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
154
|
+
label: W.MICRO_WIDGET,
|
|
155
|
+
name: H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
159
156
|
path: "/micro-widget",
|
|
160
157
|
value: S
|
|
161
158
|
}
|
|
162
|
-
},
|
|
159
|
+
}, ge = {
|
|
163
160
|
// carousel control interaction events - clicks and swipes
|
|
164
161
|
[M.ON_CAROUSEL_BACK_CLICK]: {
|
|
165
|
-
action:
|
|
166
|
-
category:
|
|
167
|
-
label:
|
|
162
|
+
action: x.CONTROL_BACKWARD,
|
|
163
|
+
category: w.MICRO_WIDGET_INTERACTION,
|
|
164
|
+
label: W.CAROUSEL_CONTROL,
|
|
168
165
|
value: S
|
|
169
166
|
},
|
|
170
167
|
[M.ON_CAROUSEL_FORWARD_CLICK]: {
|
|
171
|
-
action:
|
|
172
|
-
category:
|
|
173
|
-
label:
|
|
168
|
+
action: x.CONTROL_FORWARD,
|
|
169
|
+
category: w.MICRO_WIDGET_INTERACTION,
|
|
170
|
+
label: W.CAROUSEL_CONTROL,
|
|
174
171
|
value: S
|
|
175
172
|
},
|
|
176
173
|
[M.ON_CAROUSEL_BACK_SWIPE]: {
|
|
177
|
-
action:
|
|
178
|
-
category:
|
|
179
|
-
label:
|
|
174
|
+
action: x.SWIPE_BACKWARD,
|
|
175
|
+
category: w.MICRO_WIDGET_INTERACTION,
|
|
176
|
+
label: W.CAROUSEL_CONTROL,
|
|
180
177
|
value: S
|
|
181
178
|
},
|
|
182
179
|
[M.ON_CAROUSEL_FORWARD_SWIPE]: {
|
|
183
|
-
action:
|
|
184
|
-
category:
|
|
185
|
-
label:
|
|
180
|
+
action: x.SWIPE_FORWARD,
|
|
181
|
+
category: w.MICRO_WIDGET_INTERACTION,
|
|
182
|
+
label: W.CAROUSEL_CONTROL,
|
|
186
183
|
value: S
|
|
187
184
|
},
|
|
188
185
|
// read more card events
|
|
189
186
|
[M.ON_VIEW_MORE_CLICKED]: {
|
|
190
|
-
action:
|
|
191
|
-
category:
|
|
192
|
-
label:
|
|
187
|
+
action: x.MICRO_BEAT_CLICKED,
|
|
188
|
+
category: w.BEAT_INTERACTION,
|
|
189
|
+
label: W.VIEW_MORE,
|
|
193
190
|
value: S
|
|
194
191
|
},
|
|
195
192
|
[De.ON_VIEW_MORE_VIEWED]: {
|
|
196
|
-
action:
|
|
197
|
-
category:
|
|
198
|
-
label:
|
|
193
|
+
action: x.MICRO_BEAT_DISPLAYED,
|
|
194
|
+
category: w.BEAT_INTERACTION,
|
|
195
|
+
label: W.VIEW_MORE,
|
|
199
196
|
value: S
|
|
200
197
|
},
|
|
201
|
-
...dt(),
|
|
202
198
|
...st(),
|
|
199
|
+
...dt(),
|
|
203
200
|
...ht()
|
|
204
|
-
},
|
|
201
|
+
}, Ie = async (i, o) => !o || !ge[i] ? null : o.sendAnalyticEvent(ge[i]).then((t) => t).catch((t) => {
|
|
205
202
|
throw t;
|
|
206
|
-
}),
|
|
203
|
+
}), ye = async (i, o) => !o || !Re[i] ? null : o.sendAnalyticsPageview(Re[i]).then((t) => t).catch((t) => {
|
|
207
204
|
throw t;
|
|
208
205
|
});
|
|
209
206
|
class Et {
|
|
210
|
-
onAnalyticEvent =
|
|
211
|
-
onAnalyticPageView =
|
|
212
|
-
beatApi = new
|
|
207
|
+
onAnalyticEvent = Ie;
|
|
208
|
+
onAnalyticPageView = ye;
|
|
209
|
+
beatApi = new Ce("/", "");
|
|
213
210
|
constructor() {
|
|
214
|
-
|
|
211
|
+
se(this);
|
|
215
212
|
}
|
|
216
213
|
initialize = async (o, t, r) => {
|
|
217
214
|
this.onAnalyticEvent = (l, n) => {
|
|
218
|
-
|
|
215
|
+
Ie(l, n).then((a) => a).catch((a) => {
|
|
219
216
|
throw a.status === 401 && r(), a;
|
|
220
217
|
});
|
|
221
218
|
}, this.onAnalyticPageView = (l, n) => {
|
|
222
|
-
|
|
219
|
+
ye(l, n).then((a) => a).catch((a) => {
|
|
223
220
|
throw a.status === 401 && r(), a;
|
|
224
221
|
});
|
|
225
|
-
}, this.beatApi = new
|
|
222
|
+
}, this.beatApi = new Ce(o, t);
|
|
226
223
|
};
|
|
227
224
|
updateBeat = async (o) => {
|
|
228
225
|
this.beatApi.updateBeat(o);
|
|
@@ -239,7 +236,7 @@ class ut {
|
|
|
239
236
|
token = "";
|
|
240
237
|
isInitialized = !1;
|
|
241
238
|
constructor() {
|
|
242
|
-
this.copyStore = new ct(), this.insightsMicroWidgetStore = new Et(),
|
|
239
|
+
this.copyStore = new ct(), this.insightsMicroWidgetStore = new Et(), se(this);
|
|
243
240
|
}
|
|
244
241
|
initialize = async (o, t, r) => {
|
|
245
242
|
await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, r);
|
|
@@ -262,7 +259,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
262
259
|
description: l,
|
|
263
260
|
heightOverrides: n,
|
|
264
261
|
icon: a,
|
|
265
|
-
isActiveCard:
|
|
262
|
+
isActiveCard: d,
|
|
266
263
|
isZeroState: p,
|
|
267
264
|
onCardClick: _ = () => {
|
|
268
265
|
},
|
|
@@ -273,7 +270,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
273
270
|
variant: c,
|
|
274
271
|
widthOverrides: E
|
|
275
272
|
}, R) {
|
|
276
|
-
const
|
|
273
|
+
const y = ce(), [D, O] = u.useState(!1), { cardStyle: v, linkTextStyle: F } = f, z = c ? v : { border: "none", boxShadow: "none", ...v }, g = /* @__PURE__ */ e(
|
|
277
274
|
Ye,
|
|
278
275
|
{
|
|
279
276
|
className: "mx-micro-card-description",
|
|
@@ -290,13 +287,19 @@ const $ = u.createContext(null), pt = ({
|
|
|
290
287
|
WebkitLineClamp: 2,
|
|
291
288
|
wordWrap: "break-word"
|
|
292
289
|
},
|
|
293
|
-
children: l && /* @__PURE__ */ e(
|
|
290
|
+
children: l && /* @__PURE__ */ e(
|
|
291
|
+
"span",
|
|
292
|
+
{
|
|
293
|
+
dangerouslySetInnerHTML: { __html: l },
|
|
294
|
+
style: { fontFamily: y.typography.fontFamily }
|
|
295
|
+
}
|
|
296
|
+
)
|
|
294
297
|
}
|
|
295
298
|
);
|
|
296
299
|
return /* @__PURE__ */ e(
|
|
297
300
|
U,
|
|
298
301
|
{
|
|
299
|
-
"aria-hidden": !
|
|
302
|
+
"aria-hidden": !d,
|
|
300
303
|
"aria-label": t,
|
|
301
304
|
"aria-labelledby": "divButton",
|
|
302
305
|
"aria-roledescription": "slide",
|
|
@@ -304,12 +307,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
304
307
|
role: "group",
|
|
305
308
|
sx: {
|
|
306
309
|
height: "100%",
|
|
307
|
-
minWidth: E ? `${E}px` : "100%"
|
|
310
|
+
minWidth: E ? `${E}px` : "100%",
|
|
311
|
+
fontFamily: y.typography.fontFamily
|
|
308
312
|
},
|
|
309
313
|
children: /* @__PURE__ */ e(
|
|
310
314
|
U,
|
|
311
315
|
{
|
|
312
|
-
"aria-hidden": !
|
|
316
|
+
"aria-hidden": !d,
|
|
313
317
|
"aria-label": t,
|
|
314
318
|
id: "divButton",
|
|
315
319
|
onClick: () => _(),
|
|
@@ -318,11 +322,11 @@ const $ = u.createContext(null), pt = ({
|
|
|
318
322
|
ref: R,
|
|
319
323
|
role: "button",
|
|
320
324
|
sx: {
|
|
321
|
-
border:
|
|
325
|
+
border: D ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
|
|
322
326
|
borderRadius: "8px",
|
|
323
327
|
height: "100%"
|
|
324
328
|
},
|
|
325
|
-
tabIndex:
|
|
329
|
+
tabIndex: d ? 0 : -1,
|
|
326
330
|
children: /* @__PURE__ */ e(
|
|
327
331
|
rt,
|
|
328
332
|
{
|
|
@@ -334,14 +338,14 @@ const $ = u.createContext(null), pt = ({
|
|
|
334
338
|
cursor: "pointer",
|
|
335
339
|
height: n ? "100%" : 124,
|
|
336
340
|
p: 16,
|
|
337
|
-
...
|
|
341
|
+
...z,
|
|
338
342
|
"& .MuiCardHeader-avatar": {
|
|
339
343
|
color: h.iconColor,
|
|
340
344
|
mr: "8px"
|
|
341
345
|
}
|
|
342
346
|
},
|
|
343
347
|
variant: c,
|
|
344
|
-
children: /* @__PURE__ */
|
|
348
|
+
children: /* @__PURE__ */ I(
|
|
345
349
|
K,
|
|
346
350
|
{
|
|
347
351
|
sx: {
|
|
@@ -353,13 +357,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
353
357
|
at,
|
|
354
358
|
{
|
|
355
359
|
avatar: C && a,
|
|
356
|
-
subheader: p &&
|
|
360
|
+
subheader: p && g,
|
|
357
361
|
sx: { color: h.headerColor, p: 0 },
|
|
358
362
|
title: m,
|
|
359
363
|
titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
|
|
360
364
|
}
|
|
361
365
|
),
|
|
362
|
-
/* @__PURE__ */ e(nt, { sx: { p: 0 }, children: !p &&
|
|
366
|
+
/* @__PURE__ */ e(nt, { sx: { p: 0 }, children: !p && g }),
|
|
363
367
|
!!o && /* @__PURE__ */ e(
|
|
364
368
|
lt,
|
|
365
369
|
{
|
|
@@ -370,13 +374,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
370
374
|
children: /* @__PURE__ */ e(
|
|
371
375
|
U,
|
|
372
376
|
{
|
|
373
|
-
sx: (
|
|
374
|
-
color: h.buttonColor ? h.buttonColor :
|
|
375
|
-
// TODO: Per Cameron the theme package in @mxenabled/mxui will be getting a big update and this will be theme.palette.primary_main
|
|
377
|
+
sx: (L) => ({
|
|
378
|
+
color: h.buttonColor ? h.buttonColor : L.palette.primary.main,
|
|
376
379
|
fontSize: 14,
|
|
377
380
|
fontWeight: "bold",
|
|
378
381
|
px: 28,
|
|
379
|
-
|
|
382
|
+
fontFamily: L.typography.fontFamily,
|
|
383
|
+
...F
|
|
380
384
|
}),
|
|
381
385
|
children: o
|
|
382
386
|
}
|
|
@@ -399,7 +403,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
399
403
|
i.primary_category_guid ? t(i.primary_category_guid) : i.category_guids?.length && t(i.category_guids[0]);
|
|
400
404
|
}, []), /* @__PURE__ */ e(je, { categoryGuid: o, size: 16, sx: { minWidth: 16 } });
|
|
401
405
|
}, Ct = ({ beat: i }) => {
|
|
402
|
-
const o =
|
|
406
|
+
const o = Oe(), t = ft(o);
|
|
403
407
|
return /* @__PURE__ */ e(
|
|
404
408
|
Xe,
|
|
405
409
|
{
|
|
@@ -414,7 +418,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
414
418
|
"& .kyper-categoryicon": {
|
|
415
419
|
display: "flex"
|
|
416
420
|
}
|
|
417
|
-
}), mt =
|
|
421
|
+
}), mt = P(Ct), Rt = ({
|
|
418
422
|
color: i = "currentColor",
|
|
419
423
|
height: o,
|
|
420
424
|
size: t = 16,
|
|
@@ -449,9 +453,9 @@ const $ = u.createContext(null), pt = ({
|
|
|
449
453
|
const t = gt(i), r = t.length / 2, l = t.slice(0, r), n = t.slice(r);
|
|
450
454
|
return !l.length || !n.length ? o.Color.Primary300 : l[0].amount > n[0].amount ? o.Color.Error300 : l[0].amount < n[0].amount ? o.Color.Success300 : o.Color.Primary300;
|
|
451
455
|
}, yt = ({ beat: i }) => {
|
|
452
|
-
const o =
|
|
456
|
+
const o = Oe(), t = It(i.data_series, o);
|
|
453
457
|
return /* @__PURE__ */ e(J, { name: "bar_chart", sx: { color: t } });
|
|
454
|
-
}, Le = () => /* @__PURE__ */
|
|
458
|
+
}, Le = () => /* @__PURE__ */ I("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
455
459
|
/* @__PURE__ */ e(
|
|
456
460
|
"path",
|
|
457
461
|
{
|
|
@@ -695,7 +699,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
695
699
|
fillRule: "evenodd"
|
|
696
700
|
}
|
|
697
701
|
),
|
|
698
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ I("g", { filter: "url(#filter0_d_1565_98011)", children: [
|
|
699
703
|
/* @__PURE__ */ e("mask", { height: "22", id: "mask1_1565_98011", maskUnits: "userSpaceOnUse", width: "17", x: "16", y: "12", children: /* @__PURE__ */ e(
|
|
700
704
|
"path",
|
|
701
705
|
{
|
|
@@ -951,10 +955,10 @@ const $ = u.createContext(null), pt = ({
|
|
|
951
955
|
),
|
|
952
956
|
/* @__PURE__ */ e("path", { d: "M17.9668 31.5737H19.4947", stroke: "#E4E8EE", strokeWidth: "0.264005" })
|
|
953
957
|
] }),
|
|
954
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ I("g", { filter: "url(#filter1_d_1565_98011)", children: [
|
|
955
959
|
/* @__PURE__ */ e("circle", { cx: "15.0441", cy: "16.0441", fill: "#CDD3DD", r: "15.0441" }),
|
|
956
960
|
/* @__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" }) }),
|
|
957
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ I("g", { mask: "url(#mask2_1565_98011)", children: [
|
|
958
962
|
/* @__PURE__ */ e("rect", { fill: "white", height: "31.1359", transform: "translate(0 0.162598)", width: "31.0101" }),
|
|
959
963
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "4.52002" }),
|
|
960
964
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "17.1758" }),
|
|
@@ -1144,8 +1148,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1144
1148
|
fill: "#CDD3DD"
|
|
1145
1149
|
}
|
|
1146
1150
|
),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ I("defs", { children: [
|
|
1152
|
+
/* @__PURE__ */ I(
|
|
1149
1153
|
"filter",
|
|
1150
1154
|
{
|
|
1151
1155
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1188,7 +1192,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1188
1192
|
]
|
|
1189
1193
|
}
|
|
1190
1194
|
),
|
|
1191
|
-
/* @__PURE__ */
|
|
1195
|
+
/* @__PURE__ */ I(
|
|
1192
1196
|
"filter",
|
|
1193
1197
|
{
|
|
1194
1198
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1232,8 +1236,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1232
1236
|
}
|
|
1233
1237
|
)
|
|
1234
1238
|
] })
|
|
1235
|
-
] }),
|
|
1236
|
-
const l =
|
|
1239
|
+
] }), ve = ({ beat: i, clientColorScheme: o, color: t, type: r }) => {
|
|
1240
|
+
const l = ce(), n = o?.primary_300 ? o.primary_300 : l.palette.primary.main;
|
|
1237
1241
|
return r === 0 ? /* @__PURE__ */ e(J, { fill: !0, name: "error", sx: { color: t || n } }) : r === 1 && i ? /* @__PURE__ */ e(_t, { beat: i }) : r === 2 && i ? /* @__PURE__ */ e(mt, { beat: i }) : r === 3 && i ? /* @__PURE__ */ e(yt, { beat: i }) : r === 5 && i ? /* @__PURE__ */ e(J, { name: "campaign" }) : /* @__PURE__ */ e(
|
|
1238
1242
|
J,
|
|
1239
1243
|
{
|
|
@@ -1244,7 +1248,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1244
1248
|
}
|
|
1245
1249
|
}
|
|
1246
1250
|
);
|
|
1247
|
-
},
|
|
1251
|
+
}, k = () => {
|
|
1248
1252
|
const i = u.useContext($);
|
|
1249
1253
|
if (!i)
|
|
1250
1254
|
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
@@ -1279,18 +1283,18 @@ const $ = u.createContext(null), pt = ({
|
|
|
1279
1283
|
showCTAColocatedWithText: l = !0,
|
|
1280
1284
|
heightOverrides: n,
|
|
1281
1285
|
index: a,
|
|
1282
|
-
isActiveCard:
|
|
1286
|
+
isActiveCard: d,
|
|
1283
1287
|
onCardClick: p,
|
|
1284
1288
|
posthog: _,
|
|
1285
1289
|
showIcon: C,
|
|
1286
1290
|
variant: f,
|
|
1287
1291
|
widthOverrides: h
|
|
1288
1292
|
}) => {
|
|
1289
|
-
const { ref: m, inView: c } =
|
|
1293
|
+
const { ref: m, inView: c } = Ae({
|
|
1290
1294
|
threshold: He
|
|
1291
|
-
}), { cardsCopy: E } =
|
|
1295
|
+
}), { cardsCopy: E } = k(), { onEvent: R } = Y(), { updateBeat: y, updateOffer: D } = vt();
|
|
1292
1296
|
ee(() => {
|
|
1293
|
-
c && (t.has_been_displayed ? R(we(t.template)) : (t.guid.startsWith("OFR") ?
|
|
1297
|
+
c && (t.has_been_displayed ? R(we(t.template)) : (t.guid.startsWith("OFR") ? D({
|
|
1294
1298
|
...t,
|
|
1295
1299
|
has_been_displayed: !0
|
|
1296
1300
|
}) : y({
|
|
@@ -1313,7 +1317,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1313
1317
|
position: a
|
|
1314
1318
|
});
|
|
1315
1319
|
}, [t, a, c]);
|
|
1316
|
-
const
|
|
1320
|
+
const O = () => {
|
|
1317
1321
|
if (p && p(t), R(We(t.template)), t.template === "MarketingOffer") {
|
|
1318
1322
|
const v = t;
|
|
1319
1323
|
_?.capture("clicked_messaging_insight", {
|
|
@@ -1337,8 +1341,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1337
1341
|
description: t?.html_micro_description && t?.html_micro_description.length > 0 ? t.html_micro_description : t.html_description,
|
|
1338
1342
|
fontColors: { buttonColor: r?.primary_300 },
|
|
1339
1343
|
heightOverrides: n,
|
|
1340
|
-
icon:
|
|
1341
|
-
|
|
1344
|
+
icon: ve && /* @__PURE__ */ e(
|
|
1345
|
+
ve,
|
|
1342
1346
|
{
|
|
1343
1347
|
beat: t,
|
|
1344
1348
|
clientColorScheme: r,
|
|
@@ -1346,8 +1350,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1346
1350
|
type: t?.icon_type
|
|
1347
1351
|
}
|
|
1348
1352
|
),
|
|
1349
|
-
isActiveCard:
|
|
1350
|
-
onCardClick:
|
|
1353
|
+
isActiveCard: d,
|
|
1354
|
+
onCardClick: O,
|
|
1351
1355
|
posthog: _,
|
|
1352
1356
|
ref: m,
|
|
1353
1357
|
showCTAColocatedWithText: l,
|
|
@@ -1365,11 +1369,11 @@ const $ = u.createContext(null), pt = ({
|
|
|
1365
1369
|
onPreviousClick: l,
|
|
1366
1370
|
scrollRightBoundary: n,
|
|
1367
1371
|
scrollX: a,
|
|
1368
|
-
shouldApplyNewAnimation:
|
|
1372
|
+
shouldApplyNewAnimation: d = !1,
|
|
1369
1373
|
visibleCardsCount: p = 1
|
|
1370
1374
|
}) => {
|
|
1371
|
-
const _ =
|
|
1372
|
-
return /* @__PURE__ */
|
|
1375
|
+
const _ = Se(), { carouselCopy: C } = k(), f = Math.floor(a) > n || o - p + 1 === 0, h = a < 0 || t - 1 === o, m = _.palette.grey[500], c = i?.primary_300 ?? _.palette.primary.main;
|
|
1376
|
+
return /* @__PURE__ */ I(
|
|
1373
1377
|
K,
|
|
1374
1378
|
{
|
|
1375
1379
|
direction: "row",
|
|
@@ -1385,7 +1389,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1385
1389
|
},
|
|
1386
1390
|
children: [
|
|
1387
1391
|
/* @__PURE__ */ e(
|
|
1388
|
-
|
|
1392
|
+
pe,
|
|
1389
1393
|
{
|
|
1390
1394
|
"aria-disabled": f,
|
|
1391
1395
|
"aria-label": C.previous_insight_cta_aria,
|
|
@@ -1412,7 +1416,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1412
1416
|
height: 8,
|
|
1413
1417
|
mr: 8,
|
|
1414
1418
|
// existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
|
|
1415
|
-
...
|
|
1419
|
+
...d ? {
|
|
1416
1420
|
borderRadius: "4px",
|
|
1417
1421
|
transformOrigin: "center",
|
|
1418
1422
|
transition: "all 0.5s ease-out",
|
|
@@ -1421,21 +1425,21 @@ const $ = u.createContext(null), pt = ({
|
|
|
1421
1425
|
borderRadius: "50%",
|
|
1422
1426
|
p: 0
|
|
1423
1427
|
},
|
|
1424
|
-
width: y &&
|
|
1428
|
+
width: y && d ? 24 : 8
|
|
1425
1429
|
}
|
|
1426
1430
|
},
|
|
1427
1431
|
`carousel-button-${R}`
|
|
1428
1432
|
);
|
|
1429
1433
|
}),
|
|
1430
1434
|
/* @__PURE__ */ e(
|
|
1431
|
-
|
|
1435
|
+
pe,
|
|
1432
1436
|
{
|
|
1433
1437
|
"aria-disabled": h,
|
|
1434
1438
|
"aria-label": C.next_insight_cta_aria,
|
|
1435
1439
|
disabled: h,
|
|
1436
1440
|
onClick: r,
|
|
1437
1441
|
children: /* @__PURE__ */ e(
|
|
1438
|
-
|
|
1442
|
+
Me,
|
|
1439
1443
|
{
|
|
1440
1444
|
style: {
|
|
1441
1445
|
color: h ? m : c
|
|
@@ -1455,7 +1459,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1455
1459
|
showCTAColocatedWithText: l,
|
|
1456
1460
|
heightOverrides: n,
|
|
1457
1461
|
onCardClick: a,
|
|
1458
|
-
posthog:
|
|
1462
|
+
posthog: d,
|
|
1459
1463
|
shouldApplyNewAnimation: p = !1,
|
|
1460
1464
|
showCarouselControls: _,
|
|
1461
1465
|
showIcon: C,
|
|
@@ -1465,22 +1469,22 @@ const $ = u.createContext(null), pt = ({
|
|
|
1465
1469
|
visibleCardsCount: c = 1
|
|
1466
1470
|
// Default to 1 card visible
|
|
1467
1471
|
}) => {
|
|
1468
|
-
const E = u.useRef(null), R = u.useRef(null), [y,
|
|
1472
|
+
const E = u.useRef(null), R = u.useRef(null), [y, D] = u.useState(0), [O, v] = u.useState(null), [F, z] = u.useState(null), [g, L] = u.useState(null), [ie, G] = u.useState(p), { carouselCopy: B } = k(), { onEvent: b } = Y();
|
|
1469
1473
|
u.useEffect(() => {
|
|
1470
1474
|
if (E.current && !o) {
|
|
1471
|
-
const
|
|
1472
|
-
let
|
|
1475
|
+
const s = E.current.offsetWidth, A = 8;
|
|
1476
|
+
let V;
|
|
1473
1477
|
if (c > 1) {
|
|
1474
|
-
const Q = (
|
|
1475
|
-
|
|
1478
|
+
const Q = (s - (c - 1) * A) / c / 3;
|
|
1479
|
+
V = (s - Q - (c - 1) * A) / c;
|
|
1476
1480
|
} else
|
|
1477
|
-
|
|
1478
|
-
|
|
1481
|
+
V = s;
|
|
1482
|
+
L(V);
|
|
1479
1483
|
}
|
|
1480
1484
|
}, [c, E.current?.offsetWidth]), u.useEffect(() => {
|
|
1481
|
-
const
|
|
1482
|
-
if (typeof
|
|
1483
|
-
const A = (
|
|
1485
|
+
const s = R.current?.offsetWidth;
|
|
1486
|
+
if (typeof s == "number" && o) {
|
|
1487
|
+
const A = (Z) => {
|
|
1484
1488
|
G(!0);
|
|
1485
1489
|
const q = [
|
|
1486
1490
|
{ maxWidth: 375, cardWidth: 268 },
|
|
@@ -1488,52 +1492,52 @@ const $ = u.createContext(null), pt = ({
|
|
|
1488
1492
|
{ maxWidth: 599, cardWidth: 350 },
|
|
1489
1493
|
{ maxWidth: 749, cardWidth: 450 },
|
|
1490
1494
|
{ maxWidth: 900, cardWidth: 600 }
|
|
1491
|
-
].find((ne) =>
|
|
1495
|
+
].find((ne) => Z <= ne.maxWidth);
|
|
1492
1496
|
return q ? q.cardWidth : 750;
|
|
1493
1497
|
};
|
|
1494
|
-
|
|
1495
|
-
const
|
|
1496
|
-
const
|
|
1497
|
-
typeof
|
|
1498
|
+
L(A(s));
|
|
1499
|
+
const V = () => {
|
|
1500
|
+
const Z = R.current?.offsetWidth;
|
|
1501
|
+
typeof Z == "number" && L(A(Z));
|
|
1498
1502
|
};
|
|
1499
|
-
return window.addEventListener("resize",
|
|
1500
|
-
window.removeEventListener("resize",
|
|
1503
|
+
return window.addEventListener("resize", V), () => {
|
|
1504
|
+
window.removeEventListener("resize", V);
|
|
1501
1505
|
};
|
|
1502
1506
|
}
|
|
1503
1507
|
}, [o, R]);
|
|
1504
1508
|
const oe = () => {
|
|
1505
|
-
b(M.ON_CAROUSEL_FORWARD_CLICK, i), E.current &&
|
|
1506
|
-
left: y +
|
|
1509
|
+
b(M.ON_CAROUSEL_FORWARD_CLICK, i), E.current && g && E.current.scrollTo({
|
|
1510
|
+
left: y + g + 8,
|
|
1507
1511
|
top: 0,
|
|
1508
1512
|
behavior: "smooth"
|
|
1509
1513
|
});
|
|
1510
1514
|
}, re = () => {
|
|
1511
|
-
b(M.ON_CAROUSEL_BACK_CLICK, i), E.current &&
|
|
1512
|
-
left: Math.max(0, y - (
|
|
1515
|
+
b(M.ON_CAROUSEL_BACK_CLICK, i), E.current && g && E.current.scrollTo({
|
|
1516
|
+
left: Math.max(0, y - (g + 8)),
|
|
1513
1517
|
top: 0,
|
|
1514
1518
|
behavior: "smooth"
|
|
1515
1519
|
});
|
|
1516
1520
|
}, j = () => {
|
|
1517
|
-
E.current &&
|
|
1521
|
+
E.current && D(E.current.scrollLeft);
|
|
1518
1522
|
}, X = () => {
|
|
1519
|
-
if (!
|
|
1520
|
-
|
|
1521
|
-
},
|
|
1522
|
-
v(
|
|
1523
|
-
}, Be = (
|
|
1524
|
-
v(null),
|
|
1525
|
-
},
|
|
1523
|
+
if (!F || !O) return;
|
|
1524
|
+
F - O > St ? b(M.ON_CAROUSEL_FORWARD_SWIPE, i) : b(M.ON_CAROUSEL_BACK_SWIPE, i);
|
|
1525
|
+
}, N = (s) => {
|
|
1526
|
+
v(s.targetTouches[0].clientX);
|
|
1527
|
+
}, Be = (s) => {
|
|
1528
|
+
v(null), z(s.targetTouches[0].clientX);
|
|
1529
|
+
}, Ee = {
|
|
1526
1530
|
clientColorScheme: r,
|
|
1527
1531
|
showCTAColocatedWithText: l,
|
|
1528
1532
|
heightOverrides: n,
|
|
1529
|
-
posthog:
|
|
1533
|
+
posthog: d,
|
|
1530
1534
|
showIcon: C,
|
|
1531
1535
|
variant: h
|
|
1532
|
-
}, le =
|
|
1533
|
-
return /* @__PURE__ */
|
|
1536
|
+
}, le = g ? Math.round(y / (g + 8)) : 0, Ze = E.current ? E.current.scrollWidth - E.current.offsetWidth : 0;
|
|
1537
|
+
return /* @__PURE__ */ I(
|
|
1534
1538
|
K,
|
|
1535
1539
|
{
|
|
1536
|
-
"aria-label":
|
|
1540
|
+
"aria-label": B.carousel_title,
|
|
1537
1541
|
"aria-roledescription": "carousel",
|
|
1538
1542
|
ref: R,
|
|
1539
1543
|
role: "group/region",
|
|
@@ -1544,13 +1548,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
1544
1548
|
width: m || "100%"
|
|
1545
1549
|
},
|
|
1546
1550
|
children: [
|
|
1547
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ I(
|
|
1548
1552
|
K,
|
|
1549
1553
|
{
|
|
1550
1554
|
direction: "row",
|
|
1551
1555
|
onScroll: j,
|
|
1552
1556
|
onTouchEnd: X,
|
|
1553
|
-
onTouchMove:
|
|
1557
|
+
onTouchMove: N,
|
|
1554
1558
|
onTouchStart: Be,
|
|
1555
1559
|
ref: E,
|
|
1556
1560
|
sx: {
|
|
@@ -1571,24 +1575,24 @@ const $ = u.createContext(null), pt = ({
|
|
|
1571
1575
|
}
|
|
1572
1576
|
},
|
|
1573
1577
|
children: [
|
|
1574
|
-
t.map((
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
), q =
|
|
1578
|
+
t.map((s, A) => {
|
|
1579
|
+
const V = A + 1, Z = t.length + 1, Q = Je(
|
|
1580
|
+
B.card_position_in_carousel_aria,
|
|
1581
|
+
V.toString(),
|
|
1582
|
+
Z.toString()
|
|
1583
|
+
), q = s.micro_title && s.micro_title.length > 0, ne = s.micro_description && s.micro_description.length > 0, Pe = q ? s.micro_title : s.title, Ge = ne ? s.micro_description : s.description;
|
|
1580
1584
|
return /* @__PURE__ */ e(
|
|
1581
1585
|
Mt,
|
|
1582
1586
|
{
|
|
1583
1587
|
ariaLabel: `${Q}: ${Pe}, ${Ge}`,
|
|
1584
|
-
beat:
|
|
1588
|
+
beat: s,
|
|
1585
1589
|
index: A,
|
|
1586
1590
|
isActiveCard: A === le,
|
|
1587
1591
|
onCardClick: a,
|
|
1588
|
-
widthOverrides:
|
|
1589
|
-
...
|
|
1592
|
+
widthOverrides: g || void 0,
|
|
1593
|
+
...Ee
|
|
1590
1594
|
},
|
|
1591
|
-
`${
|
|
1595
|
+
`${s.guid} ${A}`
|
|
1592
1596
|
);
|
|
1593
1597
|
}),
|
|
1594
1598
|
/* @__PURE__ */ e(
|
|
@@ -1596,8 +1600,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1596
1600
|
{
|
|
1597
1601
|
isActiveCard: le === t.length,
|
|
1598
1602
|
onCardClick: a,
|
|
1599
|
-
widthOverrides:
|
|
1600
|
-
...
|
|
1603
|
+
widthOverrides: g || void 0,
|
|
1604
|
+
...Ee
|
|
1601
1605
|
}
|
|
1602
1606
|
)
|
|
1603
1607
|
]
|
|
@@ -1620,17 +1624,17 @@ const $ = u.createContext(null), pt = ({
|
|
|
1620
1624
|
]
|
|
1621
1625
|
}
|
|
1622
1626
|
);
|
|
1623
|
-
}, Tt =
|
|
1627
|
+
}, Tt = P(Ot), Wt = ({
|
|
1624
1628
|
analyticsMetadata: i,
|
|
1625
1629
|
clientColorScheme: o,
|
|
1626
1630
|
onCardClick: t,
|
|
1627
1631
|
posthog: r,
|
|
1628
1632
|
widthOverrides: l
|
|
1629
1633
|
}) => {
|
|
1630
|
-
const { carouselCopy: n } =
|
|
1634
|
+
const { carouselCopy: n } = k(), { onEvent: a } = Y(), d = () => {
|
|
1631
1635
|
a && (a(M.ON_VIEW_MORE_CLICKED, i), t(), r?.capture("clicked_view_more"));
|
|
1632
1636
|
};
|
|
1633
|
-
return n ? /* @__PURE__ */
|
|
1637
|
+
return n ? /* @__PURE__ */ I(
|
|
1634
1638
|
K,
|
|
1635
1639
|
{
|
|
1636
1640
|
alignItems: "center",
|
|
@@ -1643,7 +1647,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1643
1647
|
},
|
|
1644
1648
|
children: [
|
|
1645
1649
|
/* @__PURE__ */ e(
|
|
1646
|
-
|
|
1650
|
+
ue,
|
|
1647
1651
|
{
|
|
1648
1652
|
sx: {
|
|
1649
1653
|
fontSize: 18,
|
|
@@ -1654,10 +1658,10 @@ const $ = u.createContext(null), pt = ({
|
|
|
1654
1658
|
children: n.carousel_title
|
|
1655
1659
|
}
|
|
1656
1660
|
),
|
|
1657
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ I(
|
|
1658
1662
|
ze,
|
|
1659
1663
|
{
|
|
1660
|
-
onClick:
|
|
1664
|
+
onClick: d,
|
|
1661
1665
|
sx: {
|
|
1662
1666
|
display: "flex",
|
|
1663
1667
|
alignItems: "center",
|
|
@@ -1671,7 +1675,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1671
1675
|
underline: "none",
|
|
1672
1676
|
children: [
|
|
1673
1677
|
/* @__PURE__ */ e(
|
|
1674
|
-
|
|
1678
|
+
ue,
|
|
1675
1679
|
{
|
|
1676
1680
|
sx: {
|
|
1677
1681
|
color: o?.primary_300,
|
|
@@ -1683,19 +1687,19 @@ const $ = u.createContext(null), pt = ({
|
|
|
1683
1687
|
children: n.view_all_insights_in_full_feed_cta_aria
|
|
1684
1688
|
}
|
|
1685
1689
|
),
|
|
1686
|
-
/* @__PURE__ */ e(
|
|
1690
|
+
/* @__PURE__ */ e(Me, { sx: { color: o?.primary_300, ml: "8px" } })
|
|
1687
1691
|
]
|
|
1688
1692
|
}
|
|
1689
1693
|
)
|
|
1690
1694
|
]
|
|
1691
1695
|
}
|
|
1692
1696
|
) : /* @__PURE__ */ e($e, {});
|
|
1693
|
-
}, wt =
|
|
1697
|
+
}, wt = P(Wt), xt = ({
|
|
1694
1698
|
heightOverrides: i,
|
|
1695
1699
|
widthOverrides: o,
|
|
1696
1700
|
children: t
|
|
1697
1701
|
}) => {
|
|
1698
|
-
const { carouselCopy: r } =
|
|
1702
|
+
const { carouselCopy: r } = k();
|
|
1699
1703
|
return /* @__PURE__ */ e(
|
|
1700
1704
|
U,
|
|
1701
1705
|
{
|
|
@@ -1706,6 +1710,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1706
1710
|
boxSizing: "border-box",
|
|
1707
1711
|
height: i ? void 0 : "100%",
|
|
1708
1712
|
m: "0 auto",
|
|
1713
|
+
touchAction: "pan-y",
|
|
1709
1714
|
width: o ? void 0 : "100%"
|
|
1710
1715
|
},
|
|
1711
1716
|
children: t
|
|
@@ -1719,13 +1724,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
1719
1724
|
onCardClick: l,
|
|
1720
1725
|
posthog: n,
|
|
1721
1726
|
showIcon: a,
|
|
1722
|
-
showWithMargin:
|
|
1727
|
+
showWithMargin: d,
|
|
1723
1728
|
variant: p,
|
|
1724
1729
|
widthOverrides: _
|
|
1725
1730
|
}) => {
|
|
1726
|
-
const { cardsCopy: C } =
|
|
1731
|
+
const { cardsCopy: C } = k(), { onEvent: f } = Y(), { onPageview: h } = Ne();
|
|
1727
1732
|
u.useEffect(() => {
|
|
1728
|
-
h(
|
|
1733
|
+
h(H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1729
1734
|
}, []);
|
|
1730
1735
|
const m = () => {
|
|
1731
1736
|
l && l(), f(M.ON_NO_RELEVANT_INSIGHTS_CLICKED), n?.capture("clicked_insight", {
|
|
@@ -1750,7 +1755,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1750
1755
|
card: {
|
|
1751
1756
|
height: `calc(${Ve[o]}px - 44px)`,
|
|
1752
1757
|
m: "0 auto",
|
|
1753
|
-
width:
|
|
1758
|
+
width: d ? "calc(100% - 32px)" : "100%"
|
|
1754
1759
|
},
|
|
1755
1760
|
description: {
|
|
1756
1761
|
WebkitLineClamp: 4
|
|
@@ -1765,7 +1770,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1765
1770
|
widthOverrides: _
|
|
1766
1771
|
}
|
|
1767
1772
|
);
|
|
1768
|
-
}, ci =
|
|
1773
|
+
}, ci = P(ke), Fe = ({
|
|
1769
1774
|
ariaLabel: i,
|
|
1770
1775
|
carouselSize: o,
|
|
1771
1776
|
heightOverrides: t,
|
|
@@ -1773,12 +1778,12 @@ const $ = u.createContext(null), pt = ({
|
|
|
1773
1778
|
posthog: l,
|
|
1774
1779
|
showIcon: n,
|
|
1775
1780
|
showWithMargin: a,
|
|
1776
|
-
variant:
|
|
1781
|
+
variant: d,
|
|
1777
1782
|
widthOverrides: p
|
|
1778
1783
|
}) => {
|
|
1779
|
-
const { onPageview: _ } = Ne(), { zeroStateCopy: C } =
|
|
1784
|
+
const { onPageview: _ } = Ne(), { zeroStateCopy: C } = k();
|
|
1780
1785
|
return u.useEffect(() => {
|
|
1781
|
-
_(
|
|
1786
|
+
_(H.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1782
1787
|
}, []), /* @__PURE__ */ e(
|
|
1783
1788
|
te,
|
|
1784
1789
|
{
|
|
@@ -1803,11 +1808,11 @@ const $ = u.createContext(null), pt = ({
|
|
|
1803
1808
|
}
|
|
1804
1809
|
},
|
|
1805
1810
|
title: C.carousel_zero_state_title,
|
|
1806
|
-
variant:
|
|
1811
|
+
variant: d,
|
|
1807
1812
|
widthOverrides: p
|
|
1808
1813
|
}
|
|
1809
1814
|
);
|
|
1810
|
-
},
|
|
1815
|
+
}, si = P(Fe), Dt = () => /* @__PURE__ */ e(
|
|
1811
1816
|
U,
|
|
1812
1817
|
{
|
|
1813
1818
|
sx: {
|
|
@@ -1819,7 +1824,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1819
1824
|
},
|
|
1820
1825
|
children: /* @__PURE__ */ e(et, {})
|
|
1821
1826
|
}
|
|
1822
|
-
),
|
|
1827
|
+
), T = new ut(), Lt = ({
|
|
1823
1828
|
allowSingleCardPeeking: i,
|
|
1824
1829
|
areBeatsLoading: o,
|
|
1825
1830
|
beats: t = [],
|
|
@@ -1829,7 +1834,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1829
1834
|
showCTAColocatedWithText: l = !0,
|
|
1830
1835
|
endpoint: n = "/",
|
|
1831
1836
|
heightOverrides: a,
|
|
1832
|
-
logOutUser:
|
|
1837
|
+
logOutUser: d,
|
|
1833
1838
|
onCardClick: p = () => {
|
|
1834
1839
|
},
|
|
1835
1840
|
onEvent: _ = () => {
|
|
@@ -1843,22 +1848,22 @@ const $ = u.createContext(null), pt = ({
|
|
|
1843
1848
|
showHeader: E,
|
|
1844
1849
|
showIcon: R,
|
|
1845
1850
|
showWithMargin: y = !0,
|
|
1846
|
-
token:
|
|
1847
|
-
useDarkMode:
|
|
1851
|
+
token: D = "",
|
|
1852
|
+
useDarkMode: O,
|
|
1848
1853
|
userHasFullInsightFeedBeats: v,
|
|
1849
|
-
variant:
|
|
1850
|
-
visibleCardsCount:
|
|
1851
|
-
widthOverrides:
|
|
1854
|
+
variant: F,
|
|
1855
|
+
visibleCardsCount: z = 1,
|
|
1856
|
+
widthOverrides: g
|
|
1852
1857
|
}) => {
|
|
1853
|
-
const
|
|
1858
|
+
const L = Se(), [ie, G] = ae("STANDARD"), [B, b] = ae(!1), oe = it([_], T), re = ot([C], T);
|
|
1854
1859
|
u.useEffect(() => {
|
|
1855
|
-
|
|
1856
|
-
}, [n,
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1860
|
+
T.isInitialized || T.initialize(n, D, d);
|
|
1861
|
+
}, [n, D, d, T.isInitialized]), u.useEffect(() => {
|
|
1862
|
+
const N = window.innerHeight;
|
|
1863
|
+
N < 180 ? G("STANDARD") : N >= 180 && N < 200 ? G("LARGE") : N >= 200 && N < 248 ? G("XLARGE") : N >= 248 && G("XXLARGE");
|
|
1859
1864
|
}, [window.innerHeight]), u.useEffect(() => {
|
|
1860
|
-
b(!o &&
|
|
1861
|
-
}, [o,
|
|
1865
|
+
b(!o && T.isInitialized);
|
|
1866
|
+
}, [o, T.isInitialized]);
|
|
1862
1867
|
const j = {
|
|
1863
1868
|
showCTAColocatedWithText: l,
|
|
1864
1869
|
heightOverrides: a,
|
|
@@ -1866,49 +1871,49 @@ const $ = u.createContext(null), pt = ({
|
|
|
1866
1871
|
posthog: f,
|
|
1867
1872
|
showIcon: R,
|
|
1868
1873
|
showWithMargin: y,
|
|
1869
|
-
useDarkMode:
|
|
1870
|
-
widthOverrides:
|
|
1874
|
+
useDarkMode: O,
|
|
1875
|
+
widthOverrides: g
|
|
1871
1876
|
}, X = {
|
|
1872
1877
|
carouselSize: ie,
|
|
1873
|
-
variant:
|
|
1878
|
+
variant: F,
|
|
1874
1879
|
...j
|
|
1875
1880
|
};
|
|
1876
1881
|
return (
|
|
1877
1882
|
// The Theme provider must wrap the component so that the styles don't break when imported into other applications.
|
|
1878
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ I(Ue, { theme: L, children: [
|
|
1879
1884
|
/* @__PURE__ */ e(be, {}),
|
|
1880
|
-
/* @__PURE__ */ e(pt, { onEvent: oe, onPageview: re, store:
|
|
1881
|
-
(o || !
|
|
1882
|
-
|
|
1885
|
+
/* @__PURE__ */ e(pt, { onEvent: oe, onPageview: re, store: T, children: /* @__PURE__ */ I(xt, { heightOverrides: a, widthOverrides: g, children: [
|
|
1886
|
+
(o || !T.isInitialized) && /* @__PURE__ */ e(Dt, {}),
|
|
1887
|
+
B && E && /* @__PURE__ */ e(
|
|
1883
1888
|
wt,
|
|
1884
1889
|
{
|
|
1885
|
-
analyticsMetadata:
|
|
1890
|
+
analyticsMetadata: fe,
|
|
1886
1891
|
clientColorScheme: r,
|
|
1887
1892
|
onCardClick: p,
|
|
1888
1893
|
posthog: f,
|
|
1889
|
-
widthOverrides:
|
|
1894
|
+
widthOverrides: g
|
|
1890
1895
|
}
|
|
1891
1896
|
),
|
|
1892
|
-
|
|
1897
|
+
B && !!t.length && /* @__PURE__ */ e(
|
|
1893
1898
|
Tt,
|
|
1894
1899
|
{
|
|
1895
1900
|
allowSingleCardPeeking: i,
|
|
1896
|
-
analyticsMetadata:
|
|
1901
|
+
analyticsMetadata: fe,
|
|
1897
1902
|
beats: t,
|
|
1898
1903
|
clientColorScheme: r,
|
|
1899
1904
|
shouldApplyNewAnimation: h,
|
|
1900
1905
|
showCarouselControls: c,
|
|
1901
|
-
variant: m ?
|
|
1902
|
-
visibleCardsCount:
|
|
1906
|
+
variant: m ? F : void 0,
|
|
1907
|
+
visibleCardsCount: z,
|
|
1903
1908
|
...j
|
|
1904
1909
|
}
|
|
1905
1910
|
),
|
|
1906
|
-
|
|
1907
|
-
|
|
1911
|
+
B && !t.length && v && /* @__PURE__ */ e(ke, { clientColorScheme: r, ...X }),
|
|
1912
|
+
B && !t.length && !v && /* @__PURE__ */ e(Fe, { ...X })
|
|
1908
1913
|
] }) })
|
|
1909
1914
|
] })
|
|
1910
1915
|
);
|
|
1911
|
-
},
|
|
1916
|
+
}, di = P(Lt), Nt = ({
|
|
1912
1917
|
isActiveCard: i,
|
|
1913
1918
|
ariaLabel: o,
|
|
1914
1919
|
clientColorScheme: t,
|
|
@@ -1916,12 +1921,12 @@ const $ = u.createContext(null), pt = ({
|
|
|
1916
1921
|
onCardClick: l,
|
|
1917
1922
|
posthog: n,
|
|
1918
1923
|
showIcon: a,
|
|
1919
|
-
variant:
|
|
1924
|
+
variant: d,
|
|
1920
1925
|
widthOverrides: p
|
|
1921
1926
|
}) => {
|
|
1922
|
-
const _ =
|
|
1927
|
+
const _ = ce(), { ref: C, inView: f } = Ae({
|
|
1923
1928
|
threshold: He
|
|
1924
|
-
}), { cardsCopy: h } =
|
|
1929
|
+
}), { cardsCopy: h } = k(), { onEvent: m } = Y();
|
|
1925
1930
|
ee(() => {
|
|
1926
1931
|
f && (m(De.ON_VIEW_MORE_VIEWED), n?.capture("viewed_insight", {
|
|
1927
1932
|
template: "view_more_card"
|
|
@@ -1947,11 +1952,11 @@ const $ = u.createContext(null), pt = ({
|
|
|
1947
1952
|
ref: C,
|
|
1948
1953
|
showIcon: a,
|
|
1949
1954
|
title: h.view_more_card_title,
|
|
1950
|
-
variant:
|
|
1955
|
+
variant: d,
|
|
1951
1956
|
widthOverrides: p
|
|
1952
1957
|
}
|
|
1953
1958
|
);
|
|
1954
|
-
}, Vt =
|
|
1959
|
+
}, Vt = P(Nt);
|
|
1955
1960
|
export {
|
|
1956
1961
|
ut as A,
|
|
1957
1962
|
Mt as B,
|
|
@@ -1959,11 +1964,11 @@ export {
|
|
|
1959
1964
|
pt as I,
|
|
1960
1965
|
Tt as M,
|
|
1961
1966
|
ci as N,
|
|
1962
|
-
|
|
1967
|
+
fe as T,
|
|
1963
1968
|
Vt as V,
|
|
1964
|
-
|
|
1969
|
+
si as Z,
|
|
1965
1970
|
te as a,
|
|
1966
|
-
|
|
1971
|
+
di as b,
|
|
1967
1972
|
Rt as c,
|
|
1968
1973
|
yt as d,
|
|
1969
1974
|
Le as e
|