fansunited-widgets-cdn 0.0.85 → 0.0.86-RC2
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/chunks/Alert-CuOsmojH.js +149 -0
- package/chunks/AspectRatio-D3Sgxj7p.js +125 -0
- package/chunks/Avatar-BTsEKfhc.js +186 -0
- package/chunks/Button-BV7YIFkS.js +858 -0
- package/chunks/Card-DRIT0wtY.js +129 -0
- package/chunks/CardContent-CD-WZh1l.js +60 -0
- package/chunks/ChevronRight-BrCKlr3T.js +11 -0
- package/chunks/Chip-6HLNTHMI.js +281 -0
- package/chunks/ClassicQuizWrapper-t04e9_6c.js +4883 -0
- package/chunks/CollectLeadForm-DtmR2Vuf-B_3JkHJC.js +1560 -0
- package/chunks/CollectLeadWrapper-CVAVswua.js +1294 -0
- package/chunks/DialogActions-C5kAgHal.js +45 -0
- package/chunks/DialogContent-MIXff4nd.js +60 -0
- package/chunks/EitherOrById-CAo8gPjm.js +1496 -0
- package/chunks/EitherOrPreviewWrapper-DFi2bviS.js +47 -0
- package/chunks/Error-DhQL89pn-BwTV1meb.js +418 -0
- package/chunks/EventGameWrapper-BxyLL3eA.js +7633 -0
- package/chunks/Grid-Dpv_ZL23.js +279 -0
- package/chunks/IconButton-Lt9Xks7c.js +207 -0
- package/chunks/Link-DLuj1USf.js +228 -0
- package/chunks/List-DLPlZGTP.js +397 -0
- package/chunks/ListItemDecorator-CE2eQLip.js +1882 -0
- package/chunks/MatchPredictionContainer-Ct6gXvLw.js +751 -0
- package/chunks/MatchQuizWrapper-Fu6RfWVn.js +11046 -0
- package/chunks/ModalDialog-Ci3hulZA.js +619 -0
- package/chunks/NotFoundSkeleton-BYJTzYJR-Be3R34nS.js +2764 -0
- package/chunks/OverlayLeadAfterCollection-DnqztPJ5-CpELr0AC.js +896 -0
- package/chunks/OverlayScoreStateSkeleton-C9FUhcnd-DMFELrvA.js +146 -0
- package/chunks/PersonalityQuizWrapper-MpUK4n3Y.js +34374 -0
- package/chunks/PlayerOfTheMatch-D4vuR7pz.js +1406 -0
- package/chunks/PollWrapper-CzKj8xxE.js +4198 -0
- package/chunks/Portal-BWqqFvVm-TuHZWjxn.js +12717 -0
- package/chunks/Portal-DA1mxzSo.js +41 -0
- package/chunks/PreviewQuizById-WWS_LyJR.js +4864 -0
- package/chunks/Select-p_cHpLhi.js +3418 -0
- package/chunks/Sheet-BaCzogZK.js +167 -0
- package/chunks/Snackbar-DHxnbCA3.js +358 -0
- package/chunks/Stack-Dgf2LXN0.js +117 -0
- package/chunks/Tabs-CSu_cWNi.js +784 -0
- package/chunks/TeamNextMatchPrediction-C7HilNqW.js +6 -0
- package/chunks/Tutorial-DFNZxmAx.js +427 -0
- package/chunks/createLucideIcon-B6NxpYkb.js +79 -0
- package/chunks/createSvgIcon-7h7XC877.js +119 -0
- package/chunks/createSvgIcon-DVA0KIUd.js +2490 -0
- package/chunks/dataAttributeParser-CF9vxaVN.js +28 -0
- package/chunks/default-quiz-bg-CTzaADn7.js +4 -0
- package/chunks/getReactElementRef-BD-S8A24.js +25 -0
- package/chunks/index-24AwmTVJ.js +85 -0
- package/chunks/index-3vJS8JzK.js +63 -0
- package/chunks/index-BSD7mvEU.js +57 -0
- package/chunks/index-BU6iona7.js +57 -0
- package/chunks/index-BqCHiyI6.js +59 -0
- package/chunks/index-C5qRf4TV.js +20 -0
- package/chunks/index-C9MpfjqV.js +35 -0
- package/chunks/index-CMmQs5A5.js +56 -0
- package/chunks/index-CicEY2Jv.js +5 -0
- package/chunks/index-DNeawo0R.js +17 -0
- package/chunks/index-DePIySlY.js +29 -0
- package/chunks/index-DoRYU_1L.js +41 -0
- package/chunks/index-DvgG9XJj.js +20 -0
- package/chunks/index-QpZE-92Y.js +33 -0
- package/chunks/index-rgFj976B.js +17 -0
- package/chunks/index-tzsdMoo-.js +16 -0
- package/chunks/index.es-CHqz6mjo.js +6162 -0
- package/chunks/init-BEkECL0v.js +32 -0
- package/chunks/main-XP7dqk6g.js +39843 -0
- package/chunks/resolveProps-BfYZubfk.js +37 -0
- package/chunks/users-D_xgC4iQ.js +16 -0
- package/chunks/variantColorInheritance-DI3wUohX.js +28 -0
- package/fu-widgets-loader.es.js +73 -0
- package/fu-widgets-loader.js +1 -0
- package/fu-widgets.es.js +4 -0
- package/fu-widgets.iife.js +621 -682
- package/manifest.json +84 -0
- package/package.json +9 -2
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { G as w, F as ee, r as u, v as oe, _ as L, Q as re, w as r, Z as ne, x as g, y, j as m, z as h, D as te } from "./main-XP7dqk6g.js";
|
|
2
|
+
import { b as R, c as ae, a as se, i as ie } from "./Button-BV7YIFkS.js";
|
|
3
|
+
function le(o) {
|
|
4
|
+
return ee("MuiLink", o);
|
|
5
|
+
}
|
|
6
|
+
const I = w("MuiLink", ["root", "disabled", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "focusVisible", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "underlineNone", "underlineHover", "underlineAlways", "h1", "h2", "h3", "h4", "title-lg", "title-md", "title-sm", "body-lg", "body-md", "body-sm", "body-xs", "startDecorator", "endDecorator"]), ce = ["color", "textColor", "variant"], de = ["children", "disabled", "onBlur", "onFocus", "level", "overlay", "underline", "endDecorator", "startDecorator", "component", "slots", "slotProps"], ue = (o) => {
|
|
7
|
+
const {
|
|
8
|
+
level: e,
|
|
9
|
+
color: t,
|
|
10
|
+
variant: n,
|
|
11
|
+
underline: a,
|
|
12
|
+
focusVisible: s,
|
|
13
|
+
disabled: i
|
|
14
|
+
} = o, l = {
|
|
15
|
+
root: ["root", t && `color${h(t)}`, i && "disabled", s && "focusVisible", e, a && `underline${h(a)}`, n && `variant${h(n)}`],
|
|
16
|
+
startDecorator: ["startDecorator"],
|
|
17
|
+
endDecorator: ["endDecorator"]
|
|
18
|
+
};
|
|
19
|
+
return te(l, le, {});
|
|
20
|
+
}, pe = y("span", {
|
|
21
|
+
name: "JoyLink",
|
|
22
|
+
slot: "StartDecorator",
|
|
23
|
+
overridesResolver: (o, e) => e.startDecorator
|
|
24
|
+
})(({
|
|
25
|
+
ownerState: o
|
|
26
|
+
}) => {
|
|
27
|
+
var e;
|
|
28
|
+
return r({
|
|
29
|
+
display: "inline-flex",
|
|
30
|
+
marginInlineEnd: "clamp(4px, var(--Link-gap, 0.375em), 0.75rem)"
|
|
31
|
+
}, typeof o.startDecorator != "string" && (o.alignItems === "flex-start" || ((e = o.sx) == null ? void 0 : e.alignItems) === "flex-start") && {
|
|
32
|
+
marginTop: "2px"
|
|
33
|
+
// this makes the alignment perfect in most cases
|
|
34
|
+
});
|
|
35
|
+
}), ve = y("span", {
|
|
36
|
+
name: "JoyLink",
|
|
37
|
+
slot: "endDecorator",
|
|
38
|
+
overridesResolver: (o, e) => e.endDecorator
|
|
39
|
+
})(({
|
|
40
|
+
ownerState: o
|
|
41
|
+
}) => {
|
|
42
|
+
var e;
|
|
43
|
+
return r({
|
|
44
|
+
display: "inline-flex",
|
|
45
|
+
marginInlineStart: "clamp(4px, var(--Link-gap, 0.25em), 0.5rem)"
|
|
46
|
+
}, typeof o.startDecorator != "string" && (o.alignItems === "flex-start" || ((e = o.sx) == null ? void 0 : e.alignItems) === "flex-start") && {
|
|
47
|
+
marginTop: "2px"
|
|
48
|
+
// this makes the alignment perfect in most cases
|
|
49
|
+
});
|
|
50
|
+
}), me = y("a", {
|
|
51
|
+
name: "JoyLink",
|
|
52
|
+
slot: "Root",
|
|
53
|
+
overridesResolver: (o, e) => e.root
|
|
54
|
+
})(({
|
|
55
|
+
theme: o,
|
|
56
|
+
ownerState: e
|
|
57
|
+
}) => {
|
|
58
|
+
var t, n, a, s, i, l, c;
|
|
59
|
+
return [r({
|
|
60
|
+
"--Icon-fontSize": "1.25em",
|
|
61
|
+
"--Icon-color": "currentColor",
|
|
62
|
+
"--CircularProgress-size": "1.25em",
|
|
63
|
+
"--CircularProgress-thickness": "3px"
|
|
64
|
+
}, e.level && e.level !== "inherit" && o.typography[e.level], e.level === "inherit" && {
|
|
65
|
+
font: "inherit"
|
|
66
|
+
}, e.underline === "none" && {
|
|
67
|
+
textDecoration: "none"
|
|
68
|
+
}, e.underline === "hover" && {
|
|
69
|
+
textDecoration: "none",
|
|
70
|
+
"&:hover": {
|
|
71
|
+
"@media (hover: hover)": {
|
|
72
|
+
textDecorationLine: "underline"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, e.underline === "always" && {
|
|
76
|
+
textDecoration: "underline"
|
|
77
|
+
}, e.startDecorator && {
|
|
78
|
+
verticalAlign: "bottom"
|
|
79
|
+
// to make the link align with the parent's content
|
|
80
|
+
}, {
|
|
81
|
+
textDecorationThickness: "max(0.08em, 1px)",
|
|
82
|
+
// steal from https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/#css-reset-additions
|
|
83
|
+
textUnderlineOffset: "0.15em",
|
|
84
|
+
// steal from https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/#css-reset-additions
|
|
85
|
+
display: "inline-flex",
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
WebkitTapHighlightColor: "transparent",
|
|
88
|
+
backgroundColor: "transparent",
|
|
89
|
+
// Reset default value
|
|
90
|
+
// We disable the focus ring for mouse, touch and keyboard users.
|
|
91
|
+
outline: 0,
|
|
92
|
+
border: 0,
|
|
93
|
+
margin: 0,
|
|
94
|
+
// Remove the margin in Safari
|
|
95
|
+
borderRadius: o.vars.radius.xs,
|
|
96
|
+
padding: 0,
|
|
97
|
+
// Remove the padding in Firefox
|
|
98
|
+
cursor: "pointer",
|
|
99
|
+
textDecorationColor: `var(--variant-outlinedBorder, rgba(${(t = o.vars.palette[e.color]) == null ? void 0 : t.mainChannel} / var(--Link-underlineOpacity, 0.72)))`
|
|
100
|
+
}, e.variant ? r({
|
|
101
|
+
paddingBlock: "min(0.1em, 4px)",
|
|
102
|
+
paddingInline: "0.25em"
|
|
103
|
+
}, !e.nesting && {
|
|
104
|
+
marginInline: "-0.25em"
|
|
105
|
+
}) : {
|
|
106
|
+
color: `var(--variant-plainColor, rgba(${(n = o.vars.palette[e.color]) == null ? void 0 : n.mainChannel} / 1))`,
|
|
107
|
+
[`&.${I.disabled}`]: {
|
|
108
|
+
pointerEvents: "none",
|
|
109
|
+
color: `var(--variant-plainDisabledColor, rgba(${(a = o.vars.palette[e.color]) == null ? void 0 : a.mainChannel} / 0.6))`
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
userSelect: e.component === "button" ? "none" : void 0,
|
|
113
|
+
MozAppearance: "none",
|
|
114
|
+
// Reset
|
|
115
|
+
WebkitAppearance: "none",
|
|
116
|
+
// Reset
|
|
117
|
+
"&::-moz-focus-inner": {
|
|
118
|
+
borderStyle: "none"
|
|
119
|
+
// Remove Firefox dotted outline.
|
|
120
|
+
}
|
|
121
|
+
}, e.overlay ? {
|
|
122
|
+
position: "initial",
|
|
123
|
+
"&::after": {
|
|
124
|
+
content: '""',
|
|
125
|
+
display: "block",
|
|
126
|
+
position: "absolute",
|
|
127
|
+
top: 0,
|
|
128
|
+
left: 0,
|
|
129
|
+
bottom: 0,
|
|
130
|
+
right: 0,
|
|
131
|
+
borderRadius: "var(--unstable_actionRadius, inherit)",
|
|
132
|
+
margin: "var(--unstable_actionMargin)"
|
|
133
|
+
},
|
|
134
|
+
[`${o.focus.selector}`]: {
|
|
135
|
+
"&::after": o.focus.default
|
|
136
|
+
}
|
|
137
|
+
} : {
|
|
138
|
+
position: "relative",
|
|
139
|
+
[o.focus.selector]: o.focus.default
|
|
140
|
+
}), e.variant && r({}, (s = o.variants[e.variant]) == null ? void 0 : s[e.color], {
|
|
141
|
+
"&:hover": {
|
|
142
|
+
"@media (hover: hover)": (i = o.variants[`${e.variant}Hover`]) == null ? void 0 : i[e.color]
|
|
143
|
+
},
|
|
144
|
+
"&:active": (l = o.variants[`${e.variant}Active`]) == null ? void 0 : l[e.color],
|
|
145
|
+
[`&.${I.disabled}`]: (c = o.variants[`${e.variant}Disabled`]) == null ? void 0 : c[e.color]
|
|
146
|
+
})];
|
|
147
|
+
}), be = /* @__PURE__ */ u.forwardRef(function(e, t) {
|
|
148
|
+
const n = oe({
|
|
149
|
+
props: e,
|
|
150
|
+
name: "JoyLink"
|
|
151
|
+
}), {
|
|
152
|
+
color: a = "primary",
|
|
153
|
+
textColor: s,
|
|
154
|
+
variant: i
|
|
155
|
+
} = n, l = L(n, ce), c = u.useContext(R), F = u.useContext(ae), f = re(r({}, l, {
|
|
156
|
+
color: s
|
|
157
|
+
})), {
|
|
158
|
+
children: p,
|
|
159
|
+
disabled: T = !1,
|
|
160
|
+
onBlur: D,
|
|
161
|
+
onFocus: $,
|
|
162
|
+
level: V = "body-md",
|
|
163
|
+
overlay: B = !1,
|
|
164
|
+
underline: E = "hover",
|
|
165
|
+
endDecorator: C,
|
|
166
|
+
startDecorator: k,
|
|
167
|
+
component: j,
|
|
168
|
+
slots: z = {},
|
|
169
|
+
slotProps: N = {}
|
|
170
|
+
} = f, A = L(f, de), M = c || F ? e.level || "inherit" : V, {
|
|
171
|
+
isFocusVisibleRef: P,
|
|
172
|
+
onBlur: U,
|
|
173
|
+
onFocus: J,
|
|
174
|
+
ref: W
|
|
175
|
+
} = se(), [H, _] = u.useState(!1), O = ne(t, W), G = (d) => {
|
|
176
|
+
U(d), P.current === !1 && _(!1), D && D(d);
|
|
177
|
+
}, Q = (d) => {
|
|
178
|
+
J(d), P.current === !0 && _(!0), $ && $(d);
|
|
179
|
+
}, v = r({}, f, {
|
|
180
|
+
color: a,
|
|
181
|
+
disabled: T,
|
|
182
|
+
focusVisible: H,
|
|
183
|
+
underline: E,
|
|
184
|
+
variant: i,
|
|
185
|
+
level: M,
|
|
186
|
+
overlay: B,
|
|
187
|
+
nesting: c
|
|
188
|
+
}), x = ue(v), b = r({}, A, {
|
|
189
|
+
component: j,
|
|
190
|
+
slots: z,
|
|
191
|
+
slotProps: N
|
|
192
|
+
}), [Z, q] = g("root", {
|
|
193
|
+
additionalProps: {
|
|
194
|
+
onBlur: G,
|
|
195
|
+
onFocus: Q
|
|
196
|
+
},
|
|
197
|
+
ref: O,
|
|
198
|
+
className: x.root,
|
|
199
|
+
elementType: me,
|
|
200
|
+
externalForwardedProps: b,
|
|
201
|
+
ownerState: v
|
|
202
|
+
}), [K, X] = g("startDecorator", {
|
|
203
|
+
className: x.startDecorator,
|
|
204
|
+
elementType: pe,
|
|
205
|
+
externalForwardedProps: b,
|
|
206
|
+
ownerState: v
|
|
207
|
+
}), [Y, S] = g("endDecorator", {
|
|
208
|
+
className: x.endDecorator,
|
|
209
|
+
elementType: ve,
|
|
210
|
+
externalForwardedProps: b,
|
|
211
|
+
ownerState: v
|
|
212
|
+
});
|
|
213
|
+
return /* @__PURE__ */ m.jsx(R.Provider, {
|
|
214
|
+
value: !0,
|
|
215
|
+
children: /* @__PURE__ */ m.jsxs(Z, r({}, q, {
|
|
216
|
+
children: [k && /* @__PURE__ */ m.jsx(K, r({}, X, {
|
|
217
|
+
children: k
|
|
218
|
+
})), ie(p, ["Skeleton"]) ? /* @__PURE__ */ u.cloneElement(p, {
|
|
219
|
+
variant: p.props.variant || "inline"
|
|
220
|
+
}) : p, C && /* @__PURE__ */ m.jsx(Y, r({}, S, {
|
|
221
|
+
children: C
|
|
222
|
+
}))]
|
|
223
|
+
}))
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
export {
|
|
227
|
+
be as L
|
|
228
|
+
};
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { u as W, j as e, B as o, r as d, a as J, l as K, L as H, C as tt, t as N } from "./main-XP7dqk6g.js";
|
|
2
|
+
import { M as et, E as st } from "./EitherOrById-CAo8gPjm.js";
|
|
3
|
+
import nt from "./PollWrapper-CzKj8xxE.js";
|
|
4
|
+
import it from "./ClassicQuizWrapper-t04e9_6c.js";
|
|
5
|
+
import rt from "./PersonalityQuizWrapper-MpUK4n3Y.js";
|
|
6
|
+
import { d as at } from "./default-quiz-bg-CTzaADn7.js";
|
|
7
|
+
import { u as Y } from "./index-24AwmTVJ.js";
|
|
8
|
+
import { C as ot } from "./Card-DRIT0wtY.js";
|
|
9
|
+
import { C as F } from "./Tutorial-DFNZxmAx.js";
|
|
10
|
+
import { C as lt } from "./CardContent-CD-WZh1l.js";
|
|
11
|
+
import { C as ct } from "./Chip-6HLNTHMI.js";
|
|
12
|
+
import { T as C, B as ut } from "./Button-BV7YIFkS.js";
|
|
13
|
+
import { S as dt } from "./Stack-Dgf2LXN0.js";
|
|
14
|
+
import { U as pt } from "./users-D_xgC4iQ.js";
|
|
15
|
+
import { u as G } from "./Select-p_cHpLhi.js";
|
|
16
|
+
import mt from "./MatchQuizWrapper-Fu6RfWVn.js";
|
|
17
|
+
import { G as V } from "./Grid-Dpv_ZL23.js";
|
|
18
|
+
import { M as gt, a as xt } from "./ModalDialog-Ci3hulZA.js";
|
|
19
|
+
const ft = (s) => typeof s == "object" && s !== null && "alternativeTitle" in s && "questionsCount" in s, ht = (s) => typeof s == "object" && s !== null && "winningCondition" in s && "lives" in s, bt = (s) => typeof s == "object" && s !== null && "time" in s && "preferencesEnabled" in s && "maxAttempts" in s, yt = (s) => typeof s == "object" && s !== null && "options" in s && "totalVotes" in s, Ct = (s) => typeof s == "object" && s !== null && "fixtures" in s && "predictionsCutoff" in s, It = (s) => typeof s == "object" && s !== null && "templateId" in s, k = (s) => {
|
|
20
|
+
const t = s.entityModel;
|
|
21
|
+
if (!t) return null;
|
|
22
|
+
const i = {
|
|
23
|
+
title: "",
|
|
24
|
+
description: "",
|
|
25
|
+
images: {},
|
|
26
|
+
branding: {},
|
|
27
|
+
participationCount: 0,
|
|
28
|
+
time: null,
|
|
29
|
+
status: null
|
|
30
|
+
};
|
|
31
|
+
return ft(t) ? {
|
|
32
|
+
...i,
|
|
33
|
+
title: t.title,
|
|
34
|
+
description: t.description,
|
|
35
|
+
images: t.images,
|
|
36
|
+
branding: t.branding,
|
|
37
|
+
participationCount: t.participationCount,
|
|
38
|
+
time: t.time,
|
|
39
|
+
status: t.status
|
|
40
|
+
} : bt(t) ? {
|
|
41
|
+
...i,
|
|
42
|
+
title: t.title,
|
|
43
|
+
description: t.description,
|
|
44
|
+
images: t.images,
|
|
45
|
+
branding: t.branding || void 0,
|
|
46
|
+
participationCount: t.participationCount,
|
|
47
|
+
time: t.time,
|
|
48
|
+
status: t.status
|
|
49
|
+
} : ht(t) ? {
|
|
50
|
+
...i,
|
|
51
|
+
title: t.title,
|
|
52
|
+
description: t.description,
|
|
53
|
+
images: t.images,
|
|
54
|
+
branding: t.branding,
|
|
55
|
+
participationCount: 0,
|
|
56
|
+
// EitherOr might not have this
|
|
57
|
+
time: t.time,
|
|
58
|
+
status: t.status
|
|
59
|
+
} : yt(t) ? {
|
|
60
|
+
...i,
|
|
61
|
+
title: t.title,
|
|
62
|
+
description: t.description,
|
|
63
|
+
images: t.images,
|
|
64
|
+
branding: t.branding,
|
|
65
|
+
participationCount: t.totalVotes,
|
|
66
|
+
time: null,
|
|
67
|
+
status: t.status
|
|
68
|
+
} : Ct(t) ? {
|
|
69
|
+
...i,
|
|
70
|
+
title: t.title,
|
|
71
|
+
description: t.description,
|
|
72
|
+
images: t.images,
|
|
73
|
+
branding: t.branding,
|
|
74
|
+
participationCount: t.participantsCount,
|
|
75
|
+
time: null,
|
|
76
|
+
status: t.status
|
|
77
|
+
} : It(t) ? {
|
|
78
|
+
...i,
|
|
79
|
+
title: t.name,
|
|
80
|
+
description: t.description,
|
|
81
|
+
images: t.images,
|
|
82
|
+
branding: t.branding,
|
|
83
|
+
participationCount: 0,
|
|
84
|
+
time: null,
|
|
85
|
+
status: t.status
|
|
86
|
+
} : i;
|
|
87
|
+
}, jt = ({ branding: s }) => {
|
|
88
|
+
const { t } = W(), i = G(), x = Y(i.breakpoints.down("md"));
|
|
89
|
+
if (!(s != null && s.images)) return null;
|
|
90
|
+
const r = x ? s.images.mobileLogo || s.images.mainLogo : s.images.mainLogo || s.images.mobileLogo;
|
|
91
|
+
return r ? /* @__PURE__ */ e.jsxs(
|
|
92
|
+
o,
|
|
93
|
+
{
|
|
94
|
+
sx: {
|
|
95
|
+
display: { xs: "flex", md: "none" },
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
gap: 1,
|
|
98
|
+
mt: 2,
|
|
99
|
+
p: 1,
|
|
100
|
+
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
101
|
+
borderRadius: "sm",
|
|
102
|
+
backdropFilter: "blur(4px)"
|
|
103
|
+
},
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ e.jsx(C, { level: "body-xs", textColor: "rgba(255, 255, 255, 0.8)", sx: { fontSize: "0.7rem" }, children: t("potm.sponsored_by", { defaultValue: "Sponsored by:" }) }),
|
|
106
|
+
/* @__PURE__ */ e.jsx(
|
|
107
|
+
o,
|
|
108
|
+
{
|
|
109
|
+
sx: {
|
|
110
|
+
height: 24,
|
|
111
|
+
"& img": {
|
|
112
|
+
height: "100%",
|
|
113
|
+
objectFit: "contain"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
children: /* @__PURE__ */ e.jsx("img", { src: r, alt: "Sponsor" })
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
) : null;
|
|
122
|
+
}, St = ({ item: s, classicQuizUrl: t, personalityQuizUrl: i, eitherOrUrl: x, pollUrl: r, matchQuizUrl: T, onItemClick: w }) => {
|
|
123
|
+
var c, M, Q, j, U, S;
|
|
124
|
+
const { t: p } = W(), E = G(), f = Y(E.breakpoints.down("md")), n = k(s), I = (m) => {
|
|
125
|
+
let l;
|
|
126
|
+
switch (m.entityType) {
|
|
127
|
+
case "CLASSIC_QUIZ":
|
|
128
|
+
l = t;
|
|
129
|
+
break;
|
|
130
|
+
case "PERSONALITY_QUIZ":
|
|
131
|
+
l = i;
|
|
132
|
+
break;
|
|
133
|
+
case "EITHER_OR":
|
|
134
|
+
l = x;
|
|
135
|
+
break;
|
|
136
|
+
case "POLL":
|
|
137
|
+
l = r;
|
|
138
|
+
break;
|
|
139
|
+
case "MATCH_QUIZ":
|
|
140
|
+
l = T;
|
|
141
|
+
break;
|
|
142
|
+
default:
|
|
143
|
+
return "#";
|
|
144
|
+
}
|
|
145
|
+
return l && l.includes("{CONTENT_ID}") ? l.replace("{CONTENT_ID}", m.entityId) : `${l}`;
|
|
146
|
+
}, _ = (m) => {
|
|
147
|
+
switch (m.entityType) {
|
|
148
|
+
case "CLASSIC_QUIZ":
|
|
149
|
+
return p("quizzes.label", { count: 1 });
|
|
150
|
+
case "PERSONALITY_QUIZ":
|
|
151
|
+
return p("personalityQuiz.label", { count: 1 });
|
|
152
|
+
case "EITHER_OR":
|
|
153
|
+
return p("eitherOr.label", { count: 1 });
|
|
154
|
+
case "POLL":
|
|
155
|
+
return p("polls.label", { count: 1 });
|
|
156
|
+
case "MATCH_QUIZ":
|
|
157
|
+
return p("matchQuiz.label", { count: 1 });
|
|
158
|
+
default:
|
|
159
|
+
return "";
|
|
160
|
+
}
|
|
161
|
+
}, P = () => {
|
|
162
|
+
(() => {
|
|
163
|
+
switch (s.entityType) {
|
|
164
|
+
case "CLASSIC_QUIZ":
|
|
165
|
+
return !!t;
|
|
166
|
+
case "PERSONALITY_QUIZ":
|
|
167
|
+
return !!i;
|
|
168
|
+
case "EITHER_OR":
|
|
169
|
+
return !!x;
|
|
170
|
+
case "POLL":
|
|
171
|
+
return !!r;
|
|
172
|
+
case "MATCH_QUIZ":
|
|
173
|
+
return !!T;
|
|
174
|
+
default:
|
|
175
|
+
return !1;
|
|
176
|
+
}
|
|
177
|
+
})() ? window.location.href = I(s) : w && w(s);
|
|
178
|
+
};
|
|
179
|
+
return n ? /* @__PURE__ */ e.jsxs(
|
|
180
|
+
ot,
|
|
181
|
+
{
|
|
182
|
+
sx: {
|
|
183
|
+
minHeight: 350,
|
|
184
|
+
cursor: "pointer",
|
|
185
|
+
transition: "transform 0.2s, box-shadow 0.2s",
|
|
186
|
+
"&:hover": {
|
|
187
|
+
transform: "translateY(-4px)",
|
|
188
|
+
boxShadow: "md"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
onClick: P,
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(
|
|
194
|
+
"img",
|
|
195
|
+
{
|
|
196
|
+
src: ((c = n.images) == null ? void 0 : c.cover) || ((M = n.images) == null ? void 0 : M.main) || at,
|
|
197
|
+
alt: n.title,
|
|
198
|
+
loading: "lazy",
|
|
199
|
+
style: { transition: "transform 0.4s ease-out" }
|
|
200
|
+
}
|
|
201
|
+
) }),
|
|
202
|
+
/* @__PURE__ */ e.jsx(
|
|
203
|
+
F,
|
|
204
|
+
{
|
|
205
|
+
sx: {
|
|
206
|
+
background: "linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0.7) 25%, rgba(0,0,0,0) 40%)"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ e.jsxs(lt, { sx: { justifyContent: "flex-end", gap: 0 }, children: [
|
|
211
|
+
/* @__PURE__ */ e.jsxs(o, { sx: { display: "flex", alignItems: "flex-end", justifyContent: "space-between", gap: 2 }, children: [
|
|
212
|
+
/* @__PURE__ */ e.jsxs(o, { children: [
|
|
213
|
+
/* @__PURE__ */ e.jsxs(o, { sx: { display: "flex", gap: 1, alignItems: "center", mb: 1 }, children: [
|
|
214
|
+
/* @__PURE__ */ e.jsx(o, { children: /* @__PURE__ */ e.jsx(ct, { size: "sm", color: "neutral", variant: "soft", children: /* @__PURE__ */ e.jsx(C, { level: "body-xs", children: _(s) }) }) }),
|
|
215
|
+
/* @__PURE__ */ e.jsx(dt, { direction: "row", spacing: 1, sx: { color: "neutral.300" }, children: n.participationCount > 0 && /* @__PURE__ */ e.jsx(o, { children: /* @__PURE__ */ e.jsx(C, { level: "body-sm", textColor: "white", startDecorator: /* @__PURE__ */ e.jsx(pt, { size: 16, color: "white" }), children: n.participationCount }) }) })
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ e.jsx(
|
|
218
|
+
C,
|
|
219
|
+
{
|
|
220
|
+
level: "h3",
|
|
221
|
+
textColor: "#fff",
|
|
222
|
+
sx: {
|
|
223
|
+
textShadow: "0 2px 4px rgba(0,0,0,0.4)",
|
|
224
|
+
flex: 1
|
|
225
|
+
},
|
|
226
|
+
children: n.title
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
] }),
|
|
230
|
+
(((j = (Q = n.branding) == null ? void 0 : Q.images) == null ? void 0 : j.mainLogo) || ((S = (U = n.branding) == null ? void 0 : U.images) == null ? void 0 : S.mobileLogo)) && /* @__PURE__ */ e.jsxs(
|
|
231
|
+
o,
|
|
232
|
+
{
|
|
233
|
+
sx: {
|
|
234
|
+
display: { xs: "none", md: "flex" },
|
|
235
|
+
flexDirection: "column",
|
|
236
|
+
alignItems: "flex-end",
|
|
237
|
+
gap: 0.5,
|
|
238
|
+
maxWidth: 120,
|
|
239
|
+
flexShrink: 0
|
|
240
|
+
},
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ e.jsx(
|
|
243
|
+
C,
|
|
244
|
+
{
|
|
245
|
+
level: "body-xs",
|
|
246
|
+
textColor: "rgba(255, 255, 255, 0.7)",
|
|
247
|
+
sx: {
|
|
248
|
+
fontSize: "0.7rem",
|
|
249
|
+
textShadow: "0 1px 2px rgba(0,0,0,0.4)"
|
|
250
|
+
},
|
|
251
|
+
children: p("potm.sponsored_by", { defaultValue: "Sponsored by:" })
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
/* @__PURE__ */ e.jsx(
|
|
255
|
+
o,
|
|
256
|
+
{
|
|
257
|
+
sx: {
|
|
258
|
+
"& img": {
|
|
259
|
+
height: "100%",
|
|
260
|
+
objectFit: "contain",
|
|
261
|
+
maxWidth: "100%"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
children: /* @__PURE__ */ e.jsx(
|
|
265
|
+
"img",
|
|
266
|
+
{
|
|
267
|
+
src: f ? n.branding.images.mobileLogo || n.branding.images.mainLogo : n.branding.images.mainLogo || n.branding.images.mobileLogo,
|
|
268
|
+
alt: "Sponsor"
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ e.jsx(jt, { branding: n.branding })
|
|
278
|
+
] })
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
) : null;
|
|
282
|
+
}, Lt = /* @__PURE__ */ new Set(["ACTIVE", "OPEN"]), Nt = ({ contentId: s, itemsCount: t = 10, itemsPerRow: i = 2, widgetMode: x = H.LOAD_MORE }) => {
|
|
283
|
+
const [r, T] = d.useState([]), [w, p] = d.useState(1), [E, f] = d.useState(!0), [n, I] = d.useState(!1), [_, P] = d.useState(!1), [c, M] = d.useState(null), [Q, j] = d.useState(!1), U = J(), { classicQuizUrl: S, personalityQuizUrl: m, eitherOrUrl: l, pollUrl: v, matchQuizUrl: z } = K(), A = !!(S || m || l || v || z), L = x === H.LIMITED, q = d.useCallback((u) => {
|
|
284
|
+
var h;
|
|
285
|
+
const a = (h = k(u)) == null ? void 0 : h.status;
|
|
286
|
+
return a && Lt.has(a);
|
|
287
|
+
}, []), R = async () => {
|
|
288
|
+
var Z;
|
|
289
|
+
I(!0);
|
|
290
|
+
const u = new Set(r.map((g) => g.entityId));
|
|
291
|
+
let a = [], h = w, B = 0;
|
|
292
|
+
if (L && t - r.length <= 0) {
|
|
293
|
+
f(!1), I(!1);
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
try {
|
|
297
|
+
const g = L ? Math.min(t - r.length, 10) : t;
|
|
298
|
+
for (; a.length < g && B < 3 && E; ) {
|
|
299
|
+
const O = await U.lists.getListContent(s, {
|
|
300
|
+
limit: 50,
|
|
301
|
+
page: h
|
|
302
|
+
});
|
|
303
|
+
if (!((Z = O.data) != null && Z.length)) {
|
|
304
|
+
f(!1);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
const b = O.data.filter((y) => !u.has(y.entityId) && q(y));
|
|
308
|
+
if (L) {
|
|
309
|
+
const y = t - r.length - a.length;
|
|
310
|
+
a = [...a, ...b.slice(0, y)];
|
|
311
|
+
} else {
|
|
312
|
+
const y = g - a.length;
|
|
313
|
+
a = [...a, ...b.slice(0, y)];
|
|
314
|
+
}
|
|
315
|
+
h++, B++;
|
|
316
|
+
}
|
|
317
|
+
a.length === 0 ? f(!1) : (T((O) => {
|
|
318
|
+
const b = [...O, ...a];
|
|
319
|
+
return L && b.length >= t ? (f(!1), b.slice(0, t)) : b;
|
|
320
|
+
}), p(h));
|
|
321
|
+
} catch (g) {
|
|
322
|
+
console.warn("Error fetching content:", g), P(!0);
|
|
323
|
+
} finally {
|
|
324
|
+
I(!1);
|
|
325
|
+
}
|
|
326
|
+
}, X = (u) => {
|
|
327
|
+
A || (M(u), j(!0));
|
|
328
|
+
}, $ = () => {
|
|
329
|
+
if (!c) return null;
|
|
330
|
+
switch (c.entityType) {
|
|
331
|
+
case "CLASSIC_QUIZ":
|
|
332
|
+
return /* @__PURE__ */ e.jsx(it, { initialQuizId: c.entityId });
|
|
333
|
+
case "PERSONALITY_QUIZ":
|
|
334
|
+
return /* @__PURE__ */ e.jsx(rt, { personalityQuizId: c.entityId });
|
|
335
|
+
case "POLL":
|
|
336
|
+
return /* @__PURE__ */ e.jsx(nt, { pollId: c.entityId });
|
|
337
|
+
case "EITHER_OR":
|
|
338
|
+
return /* @__PURE__ */ e.jsx(st, { initialGameId: c.entityId });
|
|
339
|
+
case "MATCH_QUIZ":
|
|
340
|
+
return /* @__PURE__ */ e.jsx(
|
|
341
|
+
mt,
|
|
342
|
+
{
|
|
343
|
+
matchQuizId: c.entityId,
|
|
344
|
+
matchQuizConfig: { showPredictionDetails: !0, showCountdown: !0, showTeamLabels: !0, showPoints: !0 }
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
default:
|
|
348
|
+
return /* @__PURE__ */ e.jsx(o, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ e.jsx(C, { level: "body-md", children: N("content.messages.unsupportedContentType", { type: c.entityType }) }) });
|
|
349
|
+
}
|
|
350
|
+
}, D = {
|
|
351
|
+
xs: 12,
|
|
352
|
+
// Full width on mobile
|
|
353
|
+
md: 12 / i
|
|
354
|
+
// Configurable on desktop
|
|
355
|
+
};
|
|
356
|
+
return d.useEffect(() => {
|
|
357
|
+
R();
|
|
358
|
+
}, [s]), _ ? /* @__PURE__ */ e.jsx(e.Fragment, {}) : !n && r.length === 0 ? /* @__PURE__ */ e.jsx(e.Fragment, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
359
|
+
/* @__PURE__ */ e.jsxs(o, { children: [
|
|
360
|
+
/* @__PURE__ */ e.jsx(V, { container: !0, spacing: 1, sx: { mb: 2 }, children: r.map((u) => k(u) ? /* @__PURE__ */ e.jsx(V, { xs: D.xs, md: D.md, children: /* @__PURE__ */ e.jsx(
|
|
361
|
+
St,
|
|
362
|
+
{
|
|
363
|
+
item: u,
|
|
364
|
+
classicQuizUrl: S,
|
|
365
|
+
personalityQuizUrl: m,
|
|
366
|
+
eitherOrUrl: l,
|
|
367
|
+
pollUrl: v,
|
|
368
|
+
matchQuizUrl: z,
|
|
369
|
+
hasExternalUrls: A,
|
|
370
|
+
onItemClick: X
|
|
371
|
+
}
|
|
372
|
+
) }, u.entityId) : null) }),
|
|
373
|
+
n && /* @__PURE__ */ e.jsx(o, { sx: { display: "flex", justifyContent: "center", p: 4 }, children: /* @__PURE__ */ e.jsx(tt, {}) }),
|
|
374
|
+
E && !n && // Show load more button based on widget mode
|
|
375
|
+
(L ? r.length < t : !0) && /* @__PURE__ */ e.jsx(o, { sx: { display: "flex", justifyContent: "center", mt: 2 }, children: /* @__PURE__ */ e.jsx(ut, { onClick: R, variant: "soft", children: N("content.buttons.loadMore") }) })
|
|
376
|
+
] }),
|
|
377
|
+
/* @__PURE__ */ e.jsx(gt, { open: Q, onClose: () => j(!1), children: /* @__PURE__ */ e.jsxs(
|
|
378
|
+
xt,
|
|
379
|
+
{
|
|
380
|
+
sx: {
|
|
381
|
+
maxWidth: "95vw",
|
|
382
|
+
maxHeight: "95vh",
|
|
383
|
+
overflowY: "auto",
|
|
384
|
+
overflowX: "hidden",
|
|
385
|
+
p: 0
|
|
386
|
+
},
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ e.jsx(et, {}),
|
|
389
|
+
$()
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
) })
|
|
393
|
+
] });
|
|
394
|
+
};
|
|
395
|
+
export {
|
|
396
|
+
Nt as default
|
|
397
|
+
};
|