fansunited-frontend-components 0.0.99 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/Betslip.js +2 -2
  2. package/ChanceGame.js +496 -505
  3. package/ClassicQuizPlay.js +2 -2
  4. package/CollectLead.js +405 -1163
  5. package/CompetitionStatistics.js +2 -2
  6. package/CompetitorCard.js +445 -425
  7. package/Discussion.js +2 -2
  8. package/EitherOrPlay.js +2 -2
  9. package/EventCard.js +648 -593
  10. package/EventGamePlay.js +2 -2
  11. package/Leaderboard.js +142 -132
  12. package/List.js +675 -713
  13. package/MatchQuizPlay.js +2 -2
  14. package/Odds.js +1 -1
  15. package/PersonalityQuizPlay.js +2 -2
  16. package/PickThePair.js +925 -1824
  17. package/PlayerOfTheMatch.js +2106 -2223
  18. package/PollVote.js +2 -2
  19. package/Predictor.js +4209 -18629
  20. package/Standings.js +497 -486
  21. package/TopX.js +3223 -16958
  22. package/chunks/{ChanceGameEmbedVariant-DM9eLG5s.js → ChanceGameEmbedVariant-z8XYzgDW.js} +1 -1
  23. package/chunks/PickOneOfX-IvE4OvyT.js +3146 -0
  24. package/chunks/index-BNl8scz6.js +4 -0
  25. package/chunks/index-CSa2JU4m.js +4 -0
  26. package/chunks/index-Cd1dg0KI.js +4 -0
  27. package/chunks/index-Cei2fzi7.js +4 -0
  28. package/chunks/index-Cxb4wEJU.js +4 -0
  29. package/chunks/index-DqQtGqBF.js +4 -0
  30. package/chunks/index-w1LGN5dz.js +4 -0
  31. package/chunks/main-07vzblS8.js +2091 -0
  32. package/chunks/main-C7X4dM_P.js +4827 -0
  33. package/chunks/main-D_QDfmAw.js +6417 -0
  34. package/chunks/{main-CzfWaEQP.js → main-DdL0UekL.js} +1931 -2025
  35. package/chunks/main-DmBfwyb4.js +2992 -0
  36. package/chunks/main-LEE8n2cG.js +3117 -0
  37. package/chunks/{main-DxvBjXsd.js → main-P2WNvBZE.js} +473 -444
  38. package/chunks/{main-DiBlJBNb.js → main-WkCv5Rjl.js} +668 -694
  39. package/chunks/predictionsHelpers-D8j0Y78z.js +10065 -0
  40. package/chunks/{withVersionStamp-BsLyhvNA.js → withVersionStamp-BPvy9XSs.js} +1 -1
  41. package/package.json +2 -6
  42. package/withVersionStamp.d.ts.map +1 -1
  43. package/chunks/CheckCircle-I1FktW5Y.js +0 -13
  44. package/chunks/Person-CXRqyF4E.js +0 -11
  45. package/chunks/PickOneOfX-DET4ZhjV.js +0 -3117
  46. package/chunks/Search-CIXthh0D.js +0 -17
  47. package/chunks/TimerOutlined-D-WA_vpE.js +0 -8
  48. package/chunks/WorkspacePremiumOutlined-DUXVgJlF.js +0 -136
  49. package/chunks/chevrons-right-HWKW2c4I.js +0 -45
  50. package/chunks/createLucideIcon-YBRjY5Kl.js +0 -79
  51. package/chunks/index-BENM3N_w.js +0 -4
  52. package/chunks/index-BRxAV693.js +0 -4
  53. package/chunks/index-BXYTsvIX.js +0 -4
  54. package/chunks/index-C0ilols1.js +0 -4
  55. package/chunks/index-D7VhczXH.js +0 -4
  56. package/chunks/index-DKwvdw9t.js +0 -4
  57. package/chunks/index-DZN-AITW.js +0 -4
  58. package/chunks/main-B2sDRFF4.js +0 -2184
  59. package/chunks/main-DFNl3g_U.js +0 -4910
  60. package/chunks/main-DLwnvntz.js +0 -4020
  61. package/chunks/main-S8_NDSiY.js +0 -3209
  62. package/chunks/main-lBgr8Liq.js +0 -6571
@@ -0,0 +1,4827 @@
1
+ import { jsx as t, jsxs as x, Fragment as Q } from "@emotion/react/jsx-runtime";
2
+ import { useDisableCache as hn, useIsMobile as oe, useInternalTheme as be, DirectionalIcon as Lt, useConstantContext as xn, useIsExtraSmall as ht, bidiIsolate as Xe, ConstantsContext as Qi, useColors as Pe, useImageVariant as Me, WidgetTemplate as de, hexToRgb as xt, useIsLarge as Hi, defaultBgVertical as qe, defaultBg as _e, useIsRtl as eo, useSpacingScale as to, useBorderSize as no, useImageBackgroundGradient as Mt, useBrandingModelProperties as Ft, stripHtmlTags as dt, usePhysicalImagePosition as io, fontFamilyOf as oo, sanitizeBackgroundUrl as ro, useConsents as ao, getRelatedInfoPageId as co, ChanceGameEmbed as Rn, extractSdkError as lo } from "fansunited-frontend-core";
3
+ import Ye, { useState as N, useEffect as Be, useRef as Ae, useId as vn, useLayoutEffect as an, createContext as so, useCallback as Ht, useMemo as ft } from "react";
4
+ import { C as An } from "./ChanceGameEmbedVariant-z8XYzgDW.js";
5
+ import { EventGameModel as uo, EventGamePredictionRequestBody as fo } from "fansunited-sdk-esm/models";
6
+ import { space as u, radius as ze, BODY_FONT as Te, baseButton as pe, Modal as mo, ButtonSpinner as Ot, baseBody as ae, StandardSkeleton as Oi, ConsentPanel as Ze, ConsentCta as Ut, PresentedBy as he, AdditionalCTA as $t, SplitScoreStateSkeleton as go, GameLeaderboard as ho, baseHeading as cn, Rules as Bt, NotFound as xo, StandardApiErrorSkeleton as vo, SplitApiErrorSkeleton as po, OverlayApiErrorSkeleton as yo, OverlaySkeleton as bo, SplitSkeleton as Co, StandardLeadAfterCollection as So, SplitLeadAfterCollection as ko, OverlayLeadAfterCollection as wo, OverlayScoreStateSkeleton as Po, Spinner as Io, Notification as pt, WidgetPortal as Go } from "fansunited-frontend-core/ui/emotion";
7
+ import { css as n, keyframes as pn } from "@emotion/react";
8
+ import { useTranslation as ie } from "react-i18next";
9
+ import { EventGameOutcomeTypeEnum as H } from "fansunited-sdk-esm/enums";
10
+ import { KeyboardArrowLeftIcon as To, KeyboardArrowRightIcon as Do, SvgIcon as Ui, UnfoldIcon as Eo, CloseIcon as Ro, CheckCircleIcon as Ao, WarningIcon as Lo, InfoIcon as $o } from "fansunited-frontend-core/ui/icons";
11
+ import { createPortal as Bo } from "react-dom";
12
+ import { ChevronLeft as zo, ChevronRight as Mo } from "fansunited-frontend-core/ui/icons/lucide";
13
+ const Fo = (e, i, o) => {
14
+ const [r, c] = N(null), [f, d] = N(null), l = hn(), a = async () => {
15
+ try {
16
+ const s = await i.eventGame.getGameById(e, l);
17
+ if (c(s), o && s.fixtures) {
18
+ const y = s.fixtures.map(
19
+ (h) => ({
20
+ id: h.id,
21
+ points: h.points || 0
22
+ })
23
+ );
24
+ d(y);
25
+ } else
26
+ d([]);
27
+ } catch (s) {
28
+ console.warn(s), c(new uo()), d([]);
29
+ }
30
+ };
31
+ return Be(() => (a(), () => {
32
+ c(null), d(null);
33
+ }), [e, i, o, l]), { game: r, points: f };
34
+ }, Ho = (e, i) => {
35
+ const [o, r] = N(void 0), [c, f] = N(!1), [d, l] = N(!1), [a, s] = N(""), y = hn(), h = async () => {
36
+ var g, b, p;
37
+ let v = "";
38
+ try {
39
+ v = (await i.profile.getOwn().getInfo()).id;
40
+ } catch (C) {
41
+ if (i.helpers.getSDKConfiguration().errorHandlingMode === "standard") {
42
+ const R = C;
43
+ if (R.error.code === 401 || R.error.code === 403) {
44
+ f(!0), r(null);
45
+ return;
46
+ }
47
+ l(!0), s(R.error.message), r(null);
48
+ return;
49
+ }
50
+ const T = C;
51
+ if (T.data.error.code === 401 || T.data.error.code === 403) {
52
+ f(!0), r(null);
53
+ return;
54
+ }
55
+ l(!0), s(T.data.error.message), r(null);
56
+ return;
57
+ }
58
+ try {
59
+ const C = await i.eventGame.getGamePredictionsForUser(
60
+ e,
61
+ v,
62
+ void 0,
63
+ y
64
+ );
65
+ if (C.data.length === 0) {
66
+ r(null);
67
+ return;
68
+ }
69
+ r(C.data[0]);
70
+ } catch (C) {
71
+ r(null), f(!1), l(!0), s(((b = (g = C == null ? void 0 : C.data) == null ? void 0 : g.error) == null ? void 0 : b.message) || ((p = C == null ? void 0 : C.error) == null ? void 0 : p.message) || "");
72
+ }
73
+ };
74
+ return Be(() => (h(), () => {
75
+ r(void 0), f(!1), l(!1), s("");
76
+ }), [e, i, y]), {
77
+ myPrediction: o,
78
+ setMyPrediction: r,
79
+ isUnauthorized: c,
80
+ isApiError: d,
81
+ apiErrorMessage: a,
82
+ setIsUnauthorized: f,
83
+ setIsApiError: l,
84
+ setApiErrorMessage: s
85
+ };
86
+ }, Ln = {
87
+ display: "flex",
88
+ width: "100%",
89
+ borderRadius: "var(--fu-ucrc-radius-md)",
90
+ border: "var(--fu-ucrc-border-size) solid var(--fu-ucrc-eg-card-border, var(--fu-ucrc-secondary-container))",
91
+ overflow: "hidden",
92
+ background: "var(--fu-ucrc-surface)",
93
+ minHeight: "250px"
94
+ }, $n = {
95
+ row: n({ ...Ln, flexDirection: "row" }),
96
+ column: n({ ...Ln, flexDirection: "column" })
97
+ }, De = ({ children: e, brandingBorderColor: i }) => {
98
+ const o = oe();
99
+ return /* @__PURE__ */ t(
100
+ "div",
101
+ {
102
+ css: o ? $n.column : $n.row,
103
+ style: i ? { "--fu-ucrc-eg-card-border": i } : void 0,
104
+ children: e
105
+ }
106
+ );
107
+ }, E = {
108
+ fontPrimary: "var(--fu-ucrc-font-primary)",
109
+ fontSecondary: "var(--fu-ucrc-font-secondary)",
110
+ fontBody: "var(--fu-ucrc-font-body)",
111
+ text: "var(--fu-ucrc-text-primary)",
112
+ textSecondary: "var(--fu-ucrc-text-secondary)",
113
+ textIcon: "var(--fu-ucrc-palette-text-icon)",
114
+ softBg: "var(--fu-ucrc-neutral-soft-bg)",
115
+ border: "var(--fu-ucrc-neutral-outlined-border)",
116
+ hoverBg: "var(--fu-ucrc-neutral-plain-hover-bg)",
117
+ // Per instance, from `primaryVars`; the theme primary outside a fixture.
118
+ primary: "var(--fu-ucrc-eg-primary, var(--fu-ucrc-primary-plain-color))",
119
+ onPrimary: "var(--fu-ucrc-primary-on-primary)",
120
+ focus: "var(--fu-ucrc-focus-visible)",
121
+ shadow: "rgba(var(--fu-ucrc-shadow-channel) / var(--fu-ucrc-shadow-opacity))"
122
+ }, Oo = (e) => e ? { "--fu-ucrc-eg-primary": e } : {}, yn = `var(--fu-ucrc-shadow-ring), 0px 1px 2px 0px ${E.shadow}`, re = {
123
+ surface: "var(--fu-ucrc-eg-l-surface)",
124
+ popup: "var(--fu-ucrc-eg-l-popup)",
125
+ border: "var(--fu-ucrc-eg-l-border)",
126
+ color: "var(--fu-ucrc-eg-l-color)",
127
+ hoverBg: "var(--fu-ucrc-eg-l-hover-bg)",
128
+ activeBg: "var(--fu-ucrc-eg-l-active-bg)",
129
+ text: "var(--fu-ucrc-eg-l-text)"
130
+ }, Uo = () => {
131
+ const e = be().colorSchemes.light, i = e.palette;
132
+ return {
133
+ "--fu-ucrc-eg-l-surface": i.background.surface,
134
+ "--fu-ucrc-eg-l-popup": i.background.popup,
135
+ "--fu-ucrc-eg-l-border": i.neutral.outlinedBorder,
136
+ "--fu-ucrc-eg-l-color": i.neutral.outlinedColor,
137
+ "--fu-ucrc-eg-l-hover-bg": i.neutral.outlinedHoverBg,
138
+ "--fu-ucrc-eg-l-active-bg": i.neutral.plainActiveBg,
139
+ "--fu-ucrc-eg-l-text": e.textColor
140
+ };
141
+ }, ut = { margin: 0, lineHeight: 1.5 }, Vo = { margin: 0, lineHeight: 1.33334, letterSpacing: "-0.025em" }, Wo = (e) => ({
142
+ width: e ? "48px" : "64px",
143
+ height: e ? "48px" : "64px",
144
+ backgroundColor: E.softBg,
145
+ display: "flex",
146
+ alignItems: "center",
147
+ justifyContent: "center",
148
+ overflow: "hidden",
149
+ padding: e ? u("xs") : u("sm"),
150
+ // A spacing token, as before.
151
+ borderRadius: u("sm"),
152
+ boxShadow: "0 5px 15px 0 rgba(49, 84, 139, .1)",
153
+ flexShrink: 0,
154
+ transition: "all 0.2s ease-in-out",
155
+ "&:hover": { backgroundColor: E.hoverBg }
156
+ }), No = (e) => ({ backgroundColor: e, "&:hover": { backgroundColor: e } }), zt = "var(--fu-ucrc-eg-step-icon)", jo = (e) => n({
157
+ boxSizing: "border-box",
158
+ position: "relative",
159
+ display: "inline-flex",
160
+ alignItems: "center",
161
+ justifyContent: "center",
162
+ minWidth: e,
163
+ minHeight: e,
164
+ margin: 0,
165
+ paddingBlock: 0,
166
+ paddingInline: "2px",
167
+ border: "none",
168
+ borderColor: E.border,
169
+ borderRadius: ze("sm"),
170
+ backgroundColor: "transparent",
171
+ color: zt,
172
+ font: "inherit",
173
+ lineHeight: "normal",
174
+ cursor: "pointer",
175
+ WebkitTapHighlightColor: "transparent",
176
+ "&:focus-visible": { outline: `2px solid ${E.focus}`, outlineOffset: "2px" },
177
+ "&:hover": { backgroundColor: E.hoverBg, color: zt },
178
+ "&:active": { backgroundColor: "var(--fu-ucrc-neutral-plain-active-bg)" },
179
+ "&:disabled": {
180
+ pointerEvents: "none",
181
+ cursor: "default",
182
+ color: "var(--fu-ucrc-neutral-plain-disabled-color)"
183
+ }
184
+ }), Bn = (e, i, o) => n({
185
+ boxSizing: "border-box",
186
+ display: "flex",
187
+ position: "relative",
188
+ minWidth: `calc(${i}em / ${e})`,
189
+ maxWidth: `calc(${o}em / ${e})`,
190
+ minHeight: `calc(2.25em / ${e})`,
191
+ paddingBlock: u("xs"),
192
+ paddingInline: u("sm"),
193
+ border: "none",
194
+ borderRadius: ze("sm"),
195
+ outline: "none",
196
+ backgroundColor: E.softBg,
197
+ color: E.text,
198
+ fontFamily: E.fontPrimary,
199
+ fontWeight: 600,
200
+ fontSize: `${e}em`,
201
+ lineHeight: 1.5,
202
+ textAlign: "center",
203
+ boxShadow: yn,
204
+ cursor: "text",
205
+ "&:focus-within": { outline: `2px solid ${E.primary}`, outlineOffset: "2px" }
206
+ }), qo = (e) => n({
207
+ flex: 1,
208
+ minWidth: 0,
209
+ margin: 0,
210
+ padding: 0,
211
+ border: "none",
212
+ outline: 0,
213
+ color: "inherit",
214
+ backgroundColor: "transparent",
215
+ fontFamily: E.fontPrimary,
216
+ fontSize: `${e}em`,
217
+ fontStyle: "inherit",
218
+ fontWeight: 600,
219
+ lineHeight: "inherit",
220
+ textAlign: "center",
221
+ textOverflow: "ellipsis",
222
+ "&::placeholder": { color: "inherit", opacity: 0.64 }
223
+ }), zn = (e) => ({
224
+ root: n({
225
+ display: "flex",
226
+ alignItems: "center",
227
+ justifyContent: "center",
228
+ gap: e ? u("md") : u("lg"),
229
+ paddingTop: e ? u("xs") : u("sm")
230
+ }),
231
+ button: jo(e ? "28px" : "32px"),
232
+ field: e ? Bn(1.5, 3.5, 5) : Bn(2, 4.5, 6),
233
+ input: qo(e ? 0.75 : 1)
234
+ }), Je = { mobile: zn(!0), desktop: zn(!1) }, _o = {
235
+ row: n({ display: "flex", flexDirection: "row", alignItems: "center", gap: u("sm") })
236
+ }, Yo = (e) => {
237
+ const o = oe() ? "mobile" : "desktop", r = be(), [c, f] = N(e.prediction), d = Ae(null), l = e.minValue !== void 0 ? e.minValue : -1 / 0, a = e.maxValue !== void 0 ? e.maxValue : 1 / 0, s = {
238
+ "--fu-ucrc-eg-step-icon": r.mode === "dark" || e.isOverlayVariant ? "#FFFFFF" : E.text
239
+ }, y = (v) => {
240
+ const g = v ? Math.min(c + 1, a) : Math.max(c - 1, l);
241
+ d.current && (d.current.value = String(g)), f(g), e.onChange(g);
242
+ }, h = (v) => {
243
+ const g = v.target.value;
244
+ if (g === "" || !/^\d+$/.test(g))
245
+ return;
246
+ const b = parseInt(g, 10);
247
+ f(b), e.onChange(b);
248
+ };
249
+ return /* @__PURE__ */ t("div", { css: Je[o].root, style: s, children: /* @__PURE__ */ x("div", { css: _o.row, children: [
250
+ /* @__PURE__ */ t(
251
+ "button",
252
+ {
253
+ type: "button",
254
+ css: Je[o].button,
255
+ onClick: () => y(!1),
256
+ disabled: c <= l,
257
+ children: /* @__PURE__ */ t(Lt, { children: /* @__PURE__ */ t(To, { size: "1.25em", color: zt }) })
258
+ }
259
+ ),
260
+ /* @__PURE__ */ t(
261
+ "div",
262
+ {
263
+ css: Je[o].field,
264
+ onClick: (v) => {
265
+ var g;
266
+ v.target !== d.current && ((g = d.current) == null || g.focus());
267
+ },
268
+ children: /* @__PURE__ */ t("input", { ref: d, dir: "ltr", css: Je[o].input, value: c, onChange: h })
269
+ }
270
+ ),
271
+ /* @__PURE__ */ t(
272
+ "button",
273
+ {
274
+ type: "button",
275
+ css: Je[o].button,
276
+ onClick: () => y(!0),
277
+ disabled: c >= a,
278
+ children: /* @__PURE__ */ t(Lt, { children: /* @__PURE__ */ t(Do, { size: "1.25em", color: zt }) })
279
+ }
280
+ )
281
+ ] }) });
282
+ };
283
+ /** @license Material Icons - Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0). Copyright Google LLC. */
284
+ const Vi = Ye.forwardRef((e, i) => /* @__PURE__ */ t(Ui, { ref: i, "data-testid": "HelpOutlineIcon", ...e, children: /* @__PURE__ */ t("path", { d: "M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4" }) }));
285
+ Vi.displayName = "HelpOutlineIcon";
286
+ const Wi = 10, Xo = 100, Zo = n({
287
+ position: "absolute",
288
+ margin: 0,
289
+ maxWidth: "280px",
290
+ padding: u("xs"),
291
+ border: `1px solid ${E.border}`,
292
+ borderRadius: ze("sm"),
293
+ backgroundColor: E.softBg,
294
+ color: E.text,
295
+ fontFamily: E.fontBody,
296
+ fontSize: "0.875em",
297
+ lineHeight: 1.5,
298
+ wordWrap: "break-word",
299
+ boxShadow: `var(--fu-ucrc-shadow-ring), 0px 1px 2px 0px ${E.shadow}, 0px 2px 4px 0px ${E.shadow}`,
300
+ // Bridges the gap, so the pointer can move from the anchor onto the tooltip.
301
+ "&::before": {
302
+ content: '""',
303
+ display: "block",
304
+ position: "absolute",
305
+ width: "100%",
306
+ height: `${Wi}px`,
307
+ bottom: 0,
308
+ transform: "translateY(100%)"
309
+ }
310
+ }), Ko = (e, i) => {
311
+ const o = e.getBoundingClientRect(), r = i.getBoundingClientRect(), c = i.offsetParent, f = c == null ? void 0 : c.getBoundingClientRect(), d = ((f == null ? void 0 : f.left) ?? 0) + ((c == null ? void 0 : c.clientLeft) ?? 0), l = d + ((c == null ? void 0 : c.clientWidth) ?? document.documentElement.clientWidth), a = ((f == null ? void 0 : f.top) ?? 0) + ((c == null ? void 0 : c.clientTop) ?? 0) + ((c == null ? void 0 : c.clientHeight) ?? window.innerHeight);
312
+ let s = 0, y = document.documentElement.clientWidth;
313
+ for (let S = i.parentNode; S; S = S instanceof ShadowRoot ? S.host : S.parentNode) {
314
+ if (!(S instanceof HTMLElement) || !/(auto|scroll|hidden|clip)/.test(getComputedStyle(S).overflowX)) continue;
315
+ const T = S.getBoundingClientRect();
316
+ s = Math.max(s, T.left + S.clientLeft), y = Math.min(y, T.left + S.clientLeft + S.clientWidth);
317
+ }
318
+ const h = o.left, v = o.right - r.width, g = (S) => S >= s && S + r.width <= y, b = g(h) || !g(v);
319
+ let p = b ? h : v;
320
+ p = Math.max(s, Math.min(p, y - r.width)), p = Math.max(o.left - r.width, Math.min(p, o.right));
321
+ const C = o.top - Wi;
322
+ return {
323
+ side: b ? "left" : "right",
324
+ x: b ? Math.round(p - d) : -Math.round(l - (p + r.width)),
325
+ y: -Math.round(a - C)
326
+ };
327
+ }, Mn = ({ title: e, children: i, open: o, onClose: r }) => {
328
+ const c = vn(), f = Ae(null), d = Ae(null), l = Ae(void 0), [a, s] = N(!1), [y, h] = N(null), v = o ?? a;
329
+ Be(() => () => clearTimeout(l.current), []), an(() => {
330
+ if (!v) {
331
+ h(null);
332
+ return;
333
+ }
334
+ const S = () => {
335
+ f.current && d.current && h(Ko(f.current, d.current));
336
+ };
337
+ S();
338
+ const T = typeof ResizeObserver > "u" ? null : new ResizeObserver(S);
339
+ return d.current && (T == null || T.observe(d.current)), window.addEventListener("resize", S), () => {
340
+ T == null || T.disconnect(), window.removeEventListener("resize", S);
341
+ };
342
+ }, [v]), Be(() => {
343
+ if (!v) return;
344
+ const S = (T) => {
345
+ T.key === "Escape" && (r ? r() : s(!1));
346
+ };
347
+ return document.addEventListener("keydown", S), () => document.removeEventListener("keydown", S);
348
+ }, [v, r]);
349
+ const g = () => {
350
+ clearTimeout(l.current), l.current = setTimeout(() => s(!0), Xo);
351
+ }, b = () => {
352
+ clearTimeout(l.current), l.current = setTimeout(() => s(!1), 0);
353
+ }, p = () => clearTimeout(l.current), C = o === void 0;
354
+ return /* @__PURE__ */ x(Q, { children: [
355
+ Ye.cloneElement(i, {
356
+ ref: f,
357
+ "aria-describedby": v ? c : void 0,
358
+ ...C ? { onMouseEnter: g, onMouseLeave: b } : null
359
+ }),
360
+ v && /* @__PURE__ */ t(
361
+ "div",
362
+ {
363
+ ref: d,
364
+ id: c,
365
+ role: "tooltip",
366
+ css: Zo,
367
+ style: y ? { [y.side]: 0, bottom: 0, transform: `translate(${y.x}px, ${y.y}px)` } : { left: 0, bottom: 0, visibility: "hidden" },
368
+ onMouseEnter: C ? p : void 0,
369
+ onMouseLeave: C ? b : void 0,
370
+ children: e
371
+ }
372
+ )
373
+ ] });
374
+ }, bn = so({
375
+ points: []
376
+ }), Nt = ({ points: e, children: i }) => /* @__PURE__ */ t(
377
+ bn.Provider,
378
+ {
379
+ value: {
380
+ points: e
381
+ },
382
+ children: i
383
+ }
384
+ ), Qe = {
385
+ badge: n({
386
+ display: "flex",
387
+ alignItems: "center",
388
+ justifyContent: "center",
389
+ gap: u("xs"),
390
+ minWidth: "56px",
391
+ padding: `${u("xs")} ${u("sm")}`,
392
+ border: `1px solid ${E.border}`,
393
+ borderRadius: ze("md"),
394
+ backgroundColor: E.softBg,
395
+ color: E.text,
396
+ cursor: "default",
397
+ transition: "all 0.2s ease-in-out",
398
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
399
+ zIndex: 10,
400
+ "&:hover": {
401
+ backgroundColor: E.hoverBg,
402
+ transform: "scale(1.05)",
403
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.2)"
404
+ }
405
+ }),
406
+ points: n(ut, { fontFamily: E.fontPrimary, fontWeight: 700, fontSize: "0.875em", lineHeight: 1, color: E.text }),
407
+ pts: n(ut, {
408
+ display: "block",
409
+ fontFamily: E.fontSecondary,
410
+ fontWeight: 500,
411
+ fontSize: "0.75em",
412
+ lineHeight: 1,
413
+ color: E.textSecondary,
414
+ opacity: 0.9
415
+ }),
416
+ // Joy's md plain IconButton under the sx.
417
+ help: n({
418
+ boxSizing: "border-box",
419
+ position: "relative",
420
+ display: "flex",
421
+ alignItems: "center",
422
+ justifyContent: "center",
423
+ width: "32px",
424
+ height: "32px",
425
+ minWidth: "32px",
426
+ minHeight: "32px",
427
+ margin: 0,
428
+ padding: 0,
429
+ border: "none",
430
+ borderRadius: "50%",
431
+ backgroundColor: "transparent",
432
+ color: E.text,
433
+ font: "inherit",
434
+ lineHeight: "normal",
435
+ cursor: "pointer",
436
+ transition: "all 0.2s ease-in-out",
437
+ zIndex: 10,
438
+ WebkitTapHighlightColor: "transparent",
439
+ "&:focus-visible": { outline: `2px solid ${E.focus}`, outlineOffset: "2px" },
440
+ "@media (hover: hover)": { "&:hover": { color: "var(--fu-ucrc-neutral-plain-hover-color)" } },
441
+ "&:active": { backgroundColor: "var(--fu-ucrc-neutral-plain-active-bg)" },
442
+ "&:hover": { backgroundColor: "transparent", transform: "scale(1.1)" }
443
+ }),
444
+ text: n(ut, { fontFamily: E.fontSecondary, fontSize: "0.875em", lineHeight: 1.3, color: E.text })
445
+ }, Jo = (e) => {
446
+ const { t: i } = ie(), o = oe(), [r, c] = N(!1), { points: f } = xn(bn), d = f.find((a) => a.id === e.fixtureId);
447
+ if (!d)
448
+ return null;
449
+ const l = /* @__PURE__ */ t("p", { css: Qe.text, children: i("eventGame.points.earnPointsForCorrect", { points: d.points }) });
450
+ return o || e.isSplitVariant ? /* @__PURE__ */ t(Mn, { title: l, open: r, onClose: () => c(!1), children: /* @__PURE__ */ t("button", { type: "button", css: Qe.help, onClick: () => c(!r), children: /* @__PURE__ */ t(Vi, { size: "1em", color: E.text }) }) }) : /* @__PURE__ */ t(Mn, { title: l, children: /* @__PURE__ */ x("div", { css: Qe.badge, children: [
451
+ /* @__PURE__ */ t("p", { css: Qe.points, children: d.points }),
452
+ /* @__PURE__ */ t("span", { css: Qe.pts, children: i("eventGame.points.pts") })
453
+ ] }) });
454
+ }, yt = (e, i) => n(Vo, {
455
+ fontFamily: E.fontPrimary,
456
+ fontWeight: 600,
457
+ fontSize: e ? "1.125em" : "1.25em",
458
+ lineHeight: 1.2,
459
+ color: E.text,
460
+ textAlign: i ? "left" : "center",
461
+ unicodeBidi: "plaintext"
462
+ }), Qo = {
463
+ desktop: { center: yt(!1, !1), left: yt(!1, !0) },
464
+ mobile: { center: yt(!0, !1), left: yt(!0, !0) }
465
+ }, bt = {
466
+ root: n({ display: "flex", flexDirection: "column", alignItems: "center" }),
467
+ header: n({
468
+ display: "flex",
469
+ alignItems: "center",
470
+ justifyContent: "space-between",
471
+ width: "100%",
472
+ gap: u("sm")
473
+ }),
474
+ spacer: n({ flex: 1 }),
475
+ end: n({ flex: 1, display: "flex", justifyContent: "flex-end" })
476
+ }, Cn = (e) => {
477
+ const i = oe(), o = ht(), { points: r } = xn(bn), c = e.useExtraSmallLayout !== void 0 ? e.useExtraSmallLayout : o;
478
+ return /* @__PURE__ */ x("div", { css: bt.root, style: Oo(e.brandingPrimaryColor), children: [
479
+ /* @__PURE__ */ x("div", { css: bt.header, children: [
480
+ c ? null : /* @__PURE__ */ t("div", { css: bt.spacer }),
481
+ /* @__PURE__ */ t("h3", { css: Qo[i ? "mobile" : "desktop"][c ? "left" : "center"], children: e.question }),
482
+ /* @__PURE__ */ t("div", { css: bt.end, children: e.showPoints !== !1 && r.length > 0 && /* @__PURE__ */ t(
483
+ Jo,
484
+ {
485
+ fixtureId: e.fixtureId,
486
+ brandingPrimaryColor: e.brandingPrimaryColor,
487
+ isSplitVariant: e.isSplitVariant
488
+ }
489
+ ) })
490
+ ] }),
491
+ e.children
492
+ ] });
493
+ }, Fn = (e) => n(ut, {
494
+ fontFamily: E.fontSecondary,
495
+ fontSize: e ? "0.875em" : "0.9375em",
496
+ color: E.textSecondary,
497
+ textAlign: "center",
498
+ marginTop: u("xs"),
499
+ marginBottom: u("xs")
500
+ }), er = { mobile: Fn(!0), desktop: Fn(!1) }, Vt = (e) => {
501
+ var f, d;
502
+ const { t: i } = ie(), o = oe(), c = (() => {
503
+ if (!e.validOutcomes) return null;
504
+ const { min: l, max: a } = e.validOutcomes, s = l != null, y = a != null;
505
+ return s && y ? i("eventGame.fixtures.numberRangeDescription", { min: Xe(l), max: Xe(a) }) : s ? i("eventGame.fixtures.numberMinDescription", { min: Xe(l) }) : y ? i("eventGame.fixtures.numberMaxDescription", { max: Xe(a) }) : null;
506
+ })();
507
+ return /* @__PURE__ */ x(
508
+ Cn,
509
+ {
510
+ question: e.question,
511
+ fixtureId: e.fixtureId,
512
+ brandingPrimaryColor: e.brandingPrimaryColor,
513
+ isSplitVariant: e.isSplitVariant,
514
+ useExtraSmallLayout: e.useExtraSmallLayout,
515
+ showPoints: e.showPoints,
516
+ children: [
517
+ c && /* @__PURE__ */ t("p", { css: er[o ? "mobile" : "desktop"], children: c }),
518
+ /* @__PURE__ */ t(
519
+ Yo,
520
+ {
521
+ onChange: e.onChange,
522
+ prediction: e.prediction,
523
+ minValue: ((f = e.validOutcomes) == null ? void 0 : f.min) ?? void 0,
524
+ maxValue: ((d = e.validOutcomes) == null ? void 0 : d.max) ?? void 0,
525
+ isOverlayVariant: e.isOverlayVariant
526
+ }
527
+ )
528
+ ]
529
+ }
530
+ );
531
+ }, Hn = (e) => {
532
+ const i = { ...Wo(e), color: E.textSecondary, cursor: "pointer" }, o = (r) => n(i, No(r), { color: "white" });
533
+ return {
534
+ root: n({
535
+ display: "flex",
536
+ alignItems: "center",
537
+ justifyContent: "center",
538
+ gap: e ? u("xl") : u("2xl"),
539
+ paddingTop: e ? u("md") : u("lg")
540
+ }),
541
+ icon: n(i),
542
+ yes: o("var(--fu-ucrc-success-plain-color)"),
543
+ no: o("var(--fu-ucrc-danger-plain-color)"),
544
+ label: n(ut, {
545
+ fontFamily: E.fontSecondary,
546
+ color: E.text,
547
+ fontSize: e ? "0.875em" : "1em",
548
+ fontWeight: 600,
549
+ textAlign: "center"
550
+ })
551
+ };
552
+ }, et = { mobile: Hn(!0), desktop: Hn(!1) }, tr = {
553
+ option: n({ display: "flex", flexDirection: "column", alignItems: "center", gap: u("sm") })
554
+ }, nr = "M7 22H4C3.46957 22 2.96086 21.7893 2.58579 21.4142C2.21071 21.0391 2 20.5304 2 20V13C2 12.4696 2.21071 11.9609 2.58579 11.5858C2.96086 11.2107 3.46957 11 4 11H7M14 9V5C14 4.20435 13.6839 3.44129 13.1213 2.87868C12.5587 2.31607 11.7956 2 11 2L7 11V22H18.28C18.7623 22.0055 19.2304 21.8364 19.5979 21.524C19.9654 21.2116 20.2077 20.7769 20.28 20.3L21.66 11.3C21.7035 11.0134 21.6842 10.7207 21.6033 10.4423C21.5225 10.1638 21.3821 9.90629 21.1919 9.68751C21.0016 9.46873 20.7661 9.29393 20.5016 9.17522C20.2371 9.0565 19.9499 8.99672 19.66 9H14Z", ir = "M17 2H20C20.5304 2 21.0391 2.21071 21.4142 2.58579C21.7893 2.96086 22 3.46957 22 4V11C22 11.5304 21.7893 12.0391 21.4142 12.4142C21.0391 12.7893 20.5304 13 20 13H17M10 15V19C10 19.7956 10.3161 20.5587 10.8787 21.1213C11.4413 21.6839 12.2044 22 13 22L17 13V2H5.72C5.23766 1.99448 4.76962 2.16361 4.40206 2.47596C4.03451 2.78831 3.79232 3.22305 3.72 3.7L2.34 12.7C2.29648 12.9866 2.31583 13.2793 2.39668 13.5577C2.47753 13.8362 2.61793 14.0937 2.80816 14.3125C2.99839 14.5313 3.23394 14.7061 3.49843 14.8248C3.76291 14.9435 4.05011 15.0033 4.34 15H10Z", or = (e) => {
555
+ const { t: i } = ie(), o = oe(), r = o ? "mobile" : "desktop", [c, f] = N(e.prediction), d = (a) => {
556
+ f(a), e.onSelectionChange(a);
557
+ }, l = (a, s, y) => {
558
+ const h = c === a;
559
+ return /* @__PURE__ */ x("div", { css: tr.option, children: [
560
+ /* @__PURE__ */ t(
561
+ "div",
562
+ {
563
+ css: h ? a ? et[r].yes : et[r].no : et[r].icon,
564
+ onClick: () => d(a),
565
+ children: /* @__PURE__ */ t(
566
+ "svg",
567
+ {
568
+ width: o ? "20" : "24",
569
+ height: o ? "20" : "24",
570
+ viewBox: "0 0 24 24",
571
+ fill: "none",
572
+ xmlns: "http://www.w3.org/2000/svg",
573
+ children: /* @__PURE__ */ t("path", { d: s, stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
574
+ }
575
+ )
576
+ }
577
+ ),
578
+ /* @__PURE__ */ t("p", { css: et[r].label, children: y })
579
+ ] });
580
+ };
581
+ return /* @__PURE__ */ x("div", { css: et[r].root, children: [
582
+ l(!0, nr, i("eventGame.fixtures.yes")),
583
+ l(!1, ir, i("eventGame.fixtures.no"))
584
+ ] });
585
+ }, Wt = (e) => /* @__PURE__ */ t(
586
+ Cn,
587
+ {
588
+ question: e.question,
589
+ fixtureId: e.fixtureId,
590
+ brandingPrimaryColor: e.brandingPrimaryColor,
591
+ isSplitVariant: e.isSplitVariant,
592
+ useExtraSmallLayout: e.useExtraSmallLayout,
593
+ showPoints: e.showPoints,
594
+ children: /* @__PURE__ */ t(or, { onSelectionChange: e.onSelectionChange, prediction: e.prediction })
595
+ }
596
+ ), On = 4, Un = (e) => {
597
+ const i = (r) => `calc(${r}em / ${e})`, o = {
598
+ display: "flex",
599
+ alignItems: "center",
600
+ marginInlineStart: i(0.5),
601
+ marginInlineEnd: i(-0.1875)
602
+ };
603
+ return {
604
+ root: n({
605
+ boxSizing: "border-box",
606
+ display: "flex",
607
+ position: "relative",
608
+ alignItems: "center",
609
+ minWidth: 0,
610
+ minHeight: i(2.25),
611
+ paddingBlock: `calc(${0.25 / e}em - 1px)`,
612
+ paddingInline: i(0.75),
613
+ border: `1px solid ${re.border}`,
614
+ borderRadius: ze("md"),
615
+ backgroundColor: re.surface,
616
+ color: re.color,
617
+ fontFamily: E.fontSecondary,
618
+ fontSize: `${e}em`,
619
+ lineHeight: 1.5,
620
+ boxShadow: yn,
621
+ cursor: "pointer",
622
+ "&:hover": { backgroundColor: re.hoverBg }
623
+ }),
624
+ indicator: n(o, { color: E.textIcon }),
625
+ indicatorOpen: n(o),
626
+ list: n({
627
+ position: "absolute",
628
+ zIndex: 1300,
629
+ boxSizing: "border-box",
630
+ display: "flex",
631
+ flexDirection: "column",
632
+ minWidth: "max-content",
633
+ maxHeight: e === 1 ? "300px" : "200px",
634
+ overflow: "auto",
635
+ outline: 0,
636
+ margin: 0,
637
+ paddingBlock: "0.375em",
638
+ paddingInline: 0,
639
+ listStyle: "none",
640
+ fontFamily: Te,
641
+ fontSize: "1em",
642
+ lineHeight: 1.5,
643
+ color: "var(--fu-ucrc-neutral-outlined-color)",
644
+ backgroundColor: re.popup,
645
+ border: `1px solid ${re.border}`,
646
+ borderRadius: ze("sm"),
647
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
648
+ }),
649
+ option: n({
650
+ boxSizing: "border-box",
651
+ position: "relative",
652
+ display: "flex",
653
+ alignItems: "center",
654
+ alignSelf: "stretch",
655
+ flex: "none",
656
+ minInlineSize: 0,
657
+ gap: i(0.625),
658
+ minBlockSize: i(2.25),
659
+ paddingBlock: i(0.25),
660
+ paddingInline: i(0.75),
661
+ border: "1px solid transparent",
662
+ fontFamily: E.fontSecondary,
663
+ fontSize: `${e}em`,
664
+ lineHeight: "inherit",
665
+ color: re.color,
666
+ backgroundColor: re.popup,
667
+ cursor: "pointer",
668
+ unicodeBidi: "plaintext",
669
+ WebkitTapHighlightColor: "transparent",
670
+ "&:hover": { backgroundColor: re.hoverBg },
671
+ "&[aria-selected='true']": { backgroundColor: re.activeBg },
672
+ "&[aria-selected='true']:hover": { backgroundColor: re.hoverBg },
673
+ // Joy's offset var was unresolved, so its 2px fallback drew the ring outside the option.
674
+ "&:focus-visible": { outline: `2px solid ${E.focus}`, outlineOffset: "2px", zIndex: 1 }
675
+ })
676
+ };
677
+ }, tt = { mobile: Un(0.875), desktop: Un(1) }, Vn = {
678
+ display: "flex",
679
+ alignItems: "center",
680
+ alignSelf: "stretch",
681
+ flex: 1,
682
+ margin: 0,
683
+ padding: 0,
684
+ border: 0,
685
+ outline: 0,
686
+ background: "none",
687
+ color: "inherit",
688
+ fontFamily: "inherit",
689
+ fontSize: "inherit",
690
+ lineHeight: "normal",
691
+ whiteSpace: "nowrap",
692
+ overflow: "hidden",
693
+ cursor: "pointer",
694
+ unicodeBidi: "plaintext",
695
+ // Covers the whole field, so a press anywhere on it (the indicator too) opens the list.
696
+ "&::before": { content: '""', display: "block", position: "absolute", inset: "-1px" }
697
+ }, Wn = {
698
+ button: n(Vn),
699
+ placeholder: n(Vn, { opacity: 0.64 })
700
+ }, Nn = (e) => {
701
+ const i = window.devicePixelRatio || 1;
702
+ return Math.round(e * i) / i;
703
+ }, rr = (e, i) => {
704
+ const o = e.getBoundingClientRect(), r = i.offsetParent, f = !r || r === document.body || r === document.documentElement ? null : r.getBoundingClientRect(), d = f ? f.left + r.clientLeft - r.scrollLeft : -window.scrollX, l = f ? f.top + r.clientTop - r.scrollTop : -window.scrollY, a = i.offsetHeight, s = document.documentElement.clientHeight, y = o.bottom + On, h = o.top - On - a, v = y + a > s && h >= 0 ? h : y, g = document.documentElement.clientWidth - Math.max(o.width, i.offsetWidth), b = Math.max(0, Math.min(o.left, g));
705
+ return { x: Nn(b - d), y: Nn(v - l), width: o.width };
706
+ }, ar = (e) => {
707
+ const { options: i, value: o } = e, r = vn(), c = e.mobile ? "mobile" : "desktop", { shadowRootElement: f } = xn(Qi), d = Ae(null), l = Ae(null), a = Ae(null), [s, y] = N(!1), [h, v] = N(-1), [g, b] = N(null), p = Ae({ text: "", at: 0 }), C = o === null ? -1 : i.indexOf(o), S = i.length - 1, T = (k = "start") => {
708
+ v(C >= 0 ? C : k === "start" ? 0 : S), y(!0);
709
+ }, R = (k) => {
710
+ var A;
711
+ y(!1), v(-1), k && ((A = l.current) == null || A.focus());
712
+ }, D = (k) => {
713
+ k >= 0 && e.onChange(i[k]), R(!0);
714
+ };
715
+ an(() => {
716
+ if (!s) {
717
+ b(null);
718
+ return;
719
+ }
720
+ const k = () => {
721
+ d.current && a.current && b(rr(d.current, a.current));
722
+ };
723
+ return k(), window.addEventListener("resize", k), window.addEventListener("scroll", k, !0), () => {
724
+ window.removeEventListener("resize", k), window.removeEventListener("scroll", k, !0);
725
+ };
726
+ }, [s]), an(() => {
727
+ const k = a.current, A = k == null ? void 0 : k.children[h];
728
+ if (!s || !g || !k || !A) return;
729
+ A.focus({ preventScroll: !0 });
730
+ const L = k.getBoundingClientRect(), O = A.getBoundingClientRect();
731
+ O.top < L.top ? k.scrollTop -= L.top - O.top : O.bottom > L.bottom && (k.scrollTop += O.bottom - L.bottom);
732
+ }, [s, g !== null, h]), Be(() => {
733
+ s || (p.current = { text: "", at: 0 });
734
+ }, [s]);
735
+ const q = (k) => {
736
+ const A = {
737
+ ArrowDown: () => h >= S ? 0 : h + 1,
738
+ ArrowUp: () => h <= 0 ? S : h - 1,
739
+ Home: () => 0,
740
+ End: () => S,
741
+ PageDown: () => Math.min(h + 5, S),
742
+ PageUp: () => Math.max(h - 5, 0)
743
+ };
744
+ if (A[k.key])
745
+ k.preventDefault(), v(A[k.key]());
746
+ else if (k.key === "Enter" || k.key === " ")
747
+ k.preventDefault(), D(h);
748
+ else if (k.key === "Escape")
749
+ k.preventDefault(), R(!0);
750
+ else if (k.key.length === 1 && !k.ctrlKey && !k.metaKey && !k.altKey) {
751
+ const L = Date.now(), O = (L - p.current.at < 500 ? p.current.text : "") + k.key.toLowerCase();
752
+ p.current = { text: O, at: L };
753
+ const le = O.length > 1 ? h : h + 1;
754
+ for (let se = 0; se < i.length; se++) {
755
+ const ce = (le + se) % i.length;
756
+ if (i[ce].toLowerCase().startsWith(O)) {
757
+ v(ce);
758
+ break;
759
+ }
760
+ }
761
+ }
762
+ }, Y = `${r}listbox`;
763
+ return /* @__PURE__ */ x("div", { ref: d, css: tt[c].root, children: [
764
+ /* @__PURE__ */ t(
765
+ "button",
766
+ {
767
+ ref: l,
768
+ type: "button",
769
+ role: "combobox",
770
+ "aria-expanded": s,
771
+ "aria-controls": Y,
772
+ css: C < 0 ? Wn.placeholder : Wn.button,
773
+ onClick: () => s ? R(!0) : T(),
774
+ onKeyDown: (k) => {
775
+ s || k.key !== "ArrowDown" && k.key !== "ArrowUp" || (k.preventDefault(), T(k.key === "ArrowDown" ? "start" : "end"));
776
+ },
777
+ children: C >= 0 ? i[C] : e.placeholder
778
+ }
779
+ ),
780
+ /* @__PURE__ */ t("span", { css: s ? tt[c].indicatorOpen : tt[c].indicator, children: /* @__PURE__ */ t(Eo, {}) }),
781
+ s && Bo(
782
+ /* @__PURE__ */ t(
783
+ "ul",
784
+ {
785
+ ref: a,
786
+ id: Y,
787
+ role: "listbox",
788
+ css: tt[c].list,
789
+ style: {
790
+ ...e.vars,
791
+ // eslint-disable-next-line no-restricted-syntax -- measured in px: physical by design
792
+ left: 0,
793
+ top: 0,
794
+ ...g ? { width: `${g.width}px`, transform: `translate(${g.x}px, ${g.y}px)` } : { visibility: "hidden" }
795
+ },
796
+ onKeyDown: q,
797
+ onBlur: (k) => {
798
+ var L;
799
+ const A = k.relatedTarget;
800
+ A && ((L = a.current) != null && L.contains(A) || A === l.current) || R(!1);
801
+ },
802
+ children: i.map((k, A) => /* @__PURE__ */ t(
803
+ "li",
804
+ {
805
+ role: "option",
806
+ "aria-selected": A === C,
807
+ tabIndex: A === h ? 0 : -1,
808
+ css: tt[c].option,
809
+ onClick: () => D(A),
810
+ children: k
811
+ },
812
+ A
813
+ ))
814
+ }
815
+ ),
816
+ f ?? document.body
817
+ )
818
+ ] });
819
+ }, cr = (e) => {
820
+ const i = (r) => `calc(${r}em / ${e})`, o = {
821
+ WebkitBoxShadow: `0 0 0 1000px ${re.surface} inset !important`,
822
+ WebkitTextFillColor: `${re.color} !important`
823
+ };
824
+ return {
825
+ root: n({
826
+ boxSizing: "border-box",
827
+ display: "flex",
828
+ position: "relative",
829
+ minWidth: 0,
830
+ minHeight: i(2.25),
831
+ paddingInline: i(0.75),
832
+ border: `1px solid ${re.border}`,
833
+ borderRadius: ze("md"),
834
+ outline: "none",
835
+ backgroundColor: re.surface,
836
+ color: re.color,
837
+ fontFamily: E.fontSecondary,
838
+ fontSize: `${e}em`,
839
+ lineHeight: 1.5,
840
+ boxShadow: yn,
841
+ cursor: "text",
842
+ "&:hover": { backgroundColor: re.hoverBg },
843
+ "&:focus-within": { backgroundColor: re.surface, outline: `2px solid ${E.primary}`, outlineOffset: "2px" },
844
+ "& input:-webkit-autofill": { ...o, caretColor: re.color, borderRadius: ze("md") },
845
+ "& input:-webkit-autofill:hover, & input:-webkit-autofill:focus, & input:-webkit-autofill:active": o,
846
+ "& input:autofill": { backgroundColor: `${re.surface} !important`, color: `${re.color} !important` }
847
+ }),
848
+ input: n({
849
+ flex: 1,
850
+ minWidth: 0,
851
+ margin: 0,
852
+ padding: 0,
853
+ border: "none",
854
+ outline: 0,
855
+ color: "inherit",
856
+ backgroundColor: "transparent",
857
+ font: "inherit",
858
+ textOverflow: "ellipsis",
859
+ "&::placeholder": { color: "inherit", opacity: 0.64 },
860
+ "&:-webkit-autofill": { paddingInline: i(0.75), marginInline: i(-0.75) }
861
+ })
862
+ };
863
+ }, jn = {
864
+ borderRadius: ze("sm"),
865
+ flex: 1,
866
+ padding: u("xs"),
867
+ gap: u("xs"),
868
+ backgroundColor: "#FFFFFF",
869
+ boxShadow: "none",
870
+ cursor: "pointer",
871
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
872
+ transform: "scale(1)",
873
+ display: "flex",
874
+ flexDirection: "column",
875
+ "--fu-ucrc-eg-option-text": re.text,
876
+ "&:hover": { transform: "scale(1.02)" },
877
+ "&:active": { transform: "scale(0.98)" }
878
+ }, qn = (e) => {
879
+ const i = { width: "100%", maxWidth: e ? "100%" : "500px" };
880
+ return {
881
+ root: n({
882
+ display: "flex",
883
+ alignItems: "center",
884
+ justifyContent: "center",
885
+ width: "100%",
886
+ paddingTop: e ? u("md") : u("lg")
887
+ }),
888
+ box: n(i),
889
+ // Rows of two, and the row layout, stack on mobile.
890
+ pair: n({ display: "flex", flexDirection: e ? "column" : "row", gap: "16px" }),
891
+ row: n({ display: "flex", flexWrap: "wrap", flexDirection: e ? "column" : "row", gap: "16px" }),
892
+ field: cr(e ? 0.875 : 1)
893
+ };
894
+ }, Oe = { mobile: qn(!0), desktop: qn(!1) }, nt = {
895
+ column: n({ display: "flex", flexDirection: "column", gap: "16px" }),
896
+ card: n(jn),
897
+ picked: n(jn, {
898
+ backgroundColor: E.primary,
899
+ boxShadow: `inset 0 0 0 var(--fu-ucrc-border-size) ${E.primary}`,
900
+ "--fu-ucrc-eg-option-text": E.onPrimary
901
+ }),
902
+ label: n({
903
+ margin: 0,
904
+ marginBlock: "auto",
905
+ fontFamily: E.fontPrimary,
906
+ fontWeight: 500,
907
+ fontSize: "0.935em",
908
+ lineHeight: "16px",
909
+ letterSpacing: "0.46px",
910
+ textAlign: "center",
911
+ color: "var(--fu-ucrc-eg-option-text)",
912
+ paddingInline: u("2xs"),
913
+ unicodeBidi: "plaintext"
914
+ })
915
+ }, lr = (e) => {
916
+ const { t: i } = ie(), o = oe(), r = o ? "mobile" : "desktop", c = Uo(), [f, d] = N(e.prediction || ""), l = (g) => {
917
+ d(g), e.onTextChange(g);
918
+ }, s = e.validOutcomes ? typeof e.validOutcomes == "object" && "options" in e.validOutcomes ? e.validOutcomes.options : Array.isArray(e.validOutcomes) ? e.validOutcomes : null : null, y = s && s.length > 0, h = (g, b) => /* @__PURE__ */ t("div", { css: f === g ? nt.picked : nt.card, onClick: () => l(g), children: /* @__PURE__ */ t("p", { css: nt.label, children: g }) }, b), v = () => {
919
+ if (!s || !e.optionsLayout) return null;
920
+ if (e.optionsLayout === "twoByTwo") {
921
+ const g = [];
922
+ for (let b = 0; b < s.length; b += 2) g.push(s.slice(b, b + 2));
923
+ return /* @__PURE__ */ t("div", { css: nt.column, children: g.map((b, p) => /* @__PURE__ */ t("div", { css: Oe[r].pair, children: b.map(h) }, `row-${p}`)) });
924
+ }
925
+ return e.optionsLayout === "column" ? /* @__PURE__ */ t("div", { css: nt.column, children: s.map(h) }) : /* @__PURE__ */ t("div", { css: Oe[r].row, children: s.map(h) });
926
+ };
927
+ return /* @__PURE__ */ t("div", { css: Oe[r].root, style: c, children: y ? /* @__PURE__ */ t("div", { css: Oe[r].box, children: e.optionsLayout ? v() : /* @__PURE__ */ t(
928
+ ar,
929
+ {
930
+ options: s,
931
+ value: f || null,
932
+ onChange: l,
933
+ placeholder: i("eventGame.fixtures.textSelectPlaceholder"),
934
+ mobile: o,
935
+ vars: c
936
+ }
937
+ ) }) : /* @__PURE__ */ t("div", { css: Oe[r].box, children: /* @__PURE__ */ t(
938
+ "div",
939
+ {
940
+ css: Oe[r].field.root,
941
+ onClick: (g) => {
942
+ const b = g.currentTarget.firstElementChild;
943
+ g.target !== b && (b == null || b.focus());
944
+ },
945
+ children: /* @__PURE__ */ t(
946
+ "input",
947
+ {
948
+ css: Oe[r].field.input,
949
+ value: f,
950
+ onChange: (g) => l(g.target.value),
951
+ placeholder: i("eventGame.fixtures.textInputPlaceholder")
952
+ }
953
+ )
954
+ }
955
+ ) }) });
956
+ }, He = (e) => /* @__PURE__ */ t(
957
+ Cn,
958
+ {
959
+ question: e.question,
960
+ fixtureId: e.fixtureId,
961
+ brandingPrimaryColor: e.brandingPrimaryColor,
962
+ isSplitVariant: e.isSplitVariant,
963
+ useExtraSmallLayout: e.useExtraSmallLayout,
964
+ showPoints: e.showPoints,
965
+ children: /* @__PURE__ */ t(
966
+ lr,
967
+ {
968
+ onTextChange: e.onTextChange,
969
+ prediction: e.prediction,
970
+ validOutcomes: e.validOutcomes,
971
+ optionsLayout: e.optionsLayout
972
+ }
973
+ )
974
+ }
975
+ ), sr = "var(--fu-ucrc-primary-plain-color)", dr = "var(--fu-ucrc-primary-outlined-border)", ln = "var(--fu-ucrc-outline-enabled-border)", _n = {
976
+ width: "32px",
977
+ height: "32px",
978
+ borderRadius: "var(--fu-ucrc-radius-full)",
979
+ borderWidth: "1px",
980
+ borderStyle: "solid",
981
+ display: "flex",
982
+ alignItems: "center",
983
+ justifyContent: "center",
984
+ transition: "background-color 0.3s ease"
985
+ }, $e = {
986
+ root: n({
987
+ display: "flex",
988
+ alignItems: "center",
989
+ justifyContent: "center",
990
+ paddingBlock: "var(--fu-ucrc-space-xs)",
991
+ width: "100%",
992
+ zIndex: 1
993
+ }),
994
+ mobile: n({ display: "flex", alignItems: "center", justifyContent: "center", width: "100%" }),
995
+ mobileLine: n({ flex: 1, height: "3px", backgroundColor: ln, borderRadius: "1px" }),
996
+ mobileCircle: n({ ..._n, marginInline: "12px" }),
997
+ circle: n({ ..._n, position: "relative" }),
998
+ // Px, as before.
999
+ number: n({ margin: 0, fontFamily: Te, fontSize: "14px", fontWeight: 600, lineHeight: 1 }),
1000
+ line: n({ width: "32px", height: "3px", transition: "background-color 0.3s ease", borderRadius: "2px" })
1001
+ }, Sn = (e) => {
1002
+ const i = oe(), o = e.brandingPrimaryColor || sr, r = e.brandingPrimaryColor || dr, c = () => /* @__PURE__ */ x("div", { css: $e.mobile, children: [
1003
+ /* @__PURE__ */ t("div", { css: $e.mobileLine }),
1004
+ /* @__PURE__ */ t("div", { css: $e.mobileCircle, style: { backgroundColor: o, borderColor: r }, children: /* @__PURE__ */ t("p", { css: $e.number, style: { color: "#FFFFFF" }, children: e.currentStep }) }),
1005
+ /* @__PURE__ */ t("div", { css: $e.mobileLine })
1006
+ ] }), f = () => {
1007
+ const d = e.totalSteps || e.eventGame.fixtures.length, l = [];
1008
+ for (let a = 0; a < d; a++) {
1009
+ const s = a + 1, [y, h, v] = s < e.currentStep ? [o, r, "#FFFFFF"] : s === e.currentStep ? [o, r, "var(--fu-ucrc-primary-on-primary)"] : ["var(--fu-ucrc-neutral-soft-bg)", ln, "var(--fu-ucrc-text-color)"];
1010
+ l.push(
1011
+ /* @__PURE__ */ t("div", { css: $e.circle, style: { backgroundColor: y, borderColor: h }, children: /* @__PURE__ */ t("p", { css: $e.number, style: { color: v }, children: s }) }, `step-${s}`)
1012
+ ), a < d - 1 && l.push(
1013
+ /* @__PURE__ */ t(
1014
+ "div",
1015
+ {
1016
+ css: $e.line,
1017
+ style: { backgroundColor: s < e.currentStep ? o : ln }
1018
+ },
1019
+ `line-${s}`
1020
+ )
1021
+ );
1022
+ }
1023
+ return l;
1024
+ };
1025
+ return /* @__PURE__ */ t("div", { css: $e.root, children: i || e.isSplitVariant ? c() : f() });
1026
+ }, jt = "var(--fu-ucrc-font-primary)", Yn = (e) => ({
1027
+ root: n({
1028
+ display: "flex",
1029
+ flexDirection: "column",
1030
+ alignItems: "center",
1031
+ gap: "var(--fu-ucrc-space-sm)",
1032
+ paddingTop: e ? 0 : "var(--fu-ucrc-space-md)",
1033
+ paddingInline: "var(--fu-ucrc-space-md)",
1034
+ zIndex: 1
1035
+ }),
1036
+ title: n({
1037
+ margin: 0,
1038
+ fontFamily: jt,
1039
+ fontWeight: 500,
1040
+ fontSize: e ? "1.125em" : "1.25em",
1041
+ lineHeight: 1.2,
1042
+ color: "var(--fu-ucrc-text-primary)",
1043
+ textAlign: "center"
1044
+ }),
1045
+ row: n({
1046
+ display: "flex",
1047
+ alignItems: "center",
1048
+ justifyContent: "center",
1049
+ gap: e ? "var(--fu-ucrc-space-xs)" : "var(--fu-ucrc-space-sm)"
1050
+ }),
1051
+ unit: n({
1052
+ display: "flex",
1053
+ alignItems: "center",
1054
+ justifyContent: "center",
1055
+ gap: "var(--fu-ucrc-space-2xs)",
1056
+ backgroundColor: "var(--fu-ucrc-neutral-soft-bg)",
1057
+ borderRadius: "var(--fu-ucrc-radius-sm)",
1058
+ minWidth: e ? "var(--fu-ucrc-space-2xl)" : "var(--fu-ucrc-space-3xl)",
1059
+ paddingInline: e ? "var(--fu-ucrc-space-2xs)" : "var(--fu-ucrc-space-xs)",
1060
+ paddingBlock: e ? "var(--fu-ucrc-space-3xs)" : "var(--fu-ucrc-space-2xs)"
1061
+ }),
1062
+ value: n({
1063
+ margin: 0,
1064
+ lineHeight: 1.5,
1065
+ fontFamily: jt,
1066
+ fontWeight: 500,
1067
+ fontSize: e ? "1em" : "1.5em",
1068
+ color: "var(--fu-ucrc-text-primary)"
1069
+ }),
1070
+ label: n({
1071
+ margin: 0,
1072
+ lineHeight: 1.5,
1073
+ fontFamily: "var(--fu-ucrc-font-secondary)",
1074
+ fontWeight: 400,
1075
+ fontSize: e ? "0.625em" : "0.75em",
1076
+ color: "var(--fu-ucrc-text-secondary)"
1077
+ }),
1078
+ separator: n({
1079
+ margin: 0,
1080
+ lineHeight: 1.5,
1081
+ fontFamily: jt,
1082
+ fontWeight: 400,
1083
+ fontSize: e ? "1em" : "1.25em",
1084
+ color: "var(--fu-ucrc-text-secondary)",
1085
+ display: "flex",
1086
+ alignItems: "center",
1087
+ justifyContent: "center",
1088
+ width: "auto",
1089
+ flexShrink: 0
1090
+ })
1091
+ }), Ue = { regular: Yn(!1), compact: Yn(!0) }, kn = (e) => {
1092
+ const { t: i } = ie(), r = oe() || e.isSplitVariant ? "compact" : "regular", [c, f] = N({
1093
+ days: 0,
1094
+ hours: 0,
1095
+ minutes: 0,
1096
+ seconds: 0,
1097
+ total: 0
1098
+ }), d = Ht(() => {
1099
+ const s = (/* @__PURE__ */ new Date()).getTime(), h = new Date(e.predictionsCutoffTime).getTime() - s;
1100
+ if (h <= 0)
1101
+ return { days: 0, hours: 0, minutes: 0, seconds: 0, total: 0 };
1102
+ const v = Math.floor(h / (1e3 * 60 * 60 * 24)), g = Math.floor(h % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), b = Math.floor(h % (1e3 * 60 * 60) / (1e3 * 60)), p = Math.floor(h % (1e3 * 60) / 1e3);
1103
+ return { days: v, hours: g, minutes: b, seconds: p, total: h };
1104
+ }, [e.predictionsCutoffTime]);
1105
+ if (Be(() => {
1106
+ const s = () => f(d());
1107
+ s();
1108
+ const y = setInterval(s, 1e3);
1109
+ return () => clearInterval(y);
1110
+ }, [d]), c.total <= 0)
1111
+ return null;
1112
+ const l = (s, y) => /* @__PURE__ */ x("div", { css: Ue[r].unit, children: [
1113
+ /* @__PURE__ */ t("p", { css: Ue[r].value, children: s.toString().padStart(2, "0") }),
1114
+ /* @__PURE__ */ t("p", { css: Ue[r].label, children: y })
1115
+ ] }), a = /* @__PURE__ */ t("p", { css: Ue[r].separator, children: ":" });
1116
+ return /* @__PURE__ */ x("div", { css: Ue[r].root, children: [
1117
+ /* @__PURE__ */ t("p", { css: Ue[r].title, children: i("eventGame.countdown.participationTimeLeft") }),
1118
+ /* @__PURE__ */ x("div", { css: Ue[r].row, children: [
1119
+ c.days > 0 && /* @__PURE__ */ x(Q, { children: [
1120
+ l(c.days, i("eventGame.countdown.daysShort")),
1121
+ a
1122
+ ] }),
1123
+ (c.days > 0 || c.hours > 0) && /* @__PURE__ */ x(Q, { children: [
1124
+ l(c.hours, i("eventGame.countdown.hoursShort")),
1125
+ a
1126
+ ] }),
1127
+ l(c.minutes, i("eventGame.countdown.minutesShort")),
1128
+ a,
1129
+ l(c.seconds, i("eventGame.countdown.secondsShort"))
1130
+ ] })
1131
+ ] });
1132
+ }, qt = "1px solid var(--fu-ucrc-outline-enabled-border)", _t = "var(--fu-ucrc-neutral-outlined-border)", Ct = "var(--fu-ucrc-radius-md)", St = "var(--fu-ucrc-text-primary)", ur = "0.375em 0.5em", Xn = {
1133
+ display: "flex",
1134
+ alignItems: "center",
1135
+ flexWrap: "wrap"
1136
+ }, Ee = {
1137
+ container: n({ display: "flex", flexDirection: "column", gap: "var(--fu-ucrc-space-sm)", width: "100%" }),
1138
+ title: n({
1139
+ margin: 0,
1140
+ marginBottom: "var(--fu-ucrc-space-sm)",
1141
+ fontFamily: "var(--fu-ucrc-font-primary)",
1142
+ fontWeight: 600,
1143
+ fontSize: "1em",
1144
+ lineHeight: "1.25em",
1145
+ color: St,
1146
+ textAlign: "center"
1147
+ }),
1148
+ // Joy Sheet: plain neutral on background.surface.
1149
+ tableContainer: n({
1150
+ position: "relative",
1151
+ overflowX: "auto",
1152
+ borderRadius: Ct,
1153
+ border: qt,
1154
+ backgroundColor: "var(--fu-ucrc-bg-surface)",
1155
+ color: "var(--fu-ucrc-neutral-plain-color)",
1156
+ fontFamily: Te,
1157
+ fontSize: "1em",
1158
+ lineHeight: 1.5
1159
+ }),
1160
+ // Joy Table: outlined, size sm, borderAxis bothBetween, no row hover.
1161
+ table: n({
1162
+ boxSizing: "border-box",
1163
+ tableLayout: "fixed",
1164
+ width: "100%",
1165
+ borderSpacing: 0,
1166
+ borderCollapse: "separate",
1167
+ border: `1px solid ${_t}`,
1168
+ borderRadius: Ct,
1169
+ fontFamily: Te,
1170
+ fontSize: "1em",
1171
+ fontWeight: 500,
1172
+ lineHeight: 1.5,
1173
+ color: "var(--fu-ucrc-neutral-outlined-color)",
1174
+ backgroundColor: "var(--fu-ucrc-surface-variant)",
1175
+ cursor: "default",
1176
+ "& th, & td": { height: "32px", padding: ur, borderColor: _t, verticalAlign: "middle" },
1177
+ "& th": {
1178
+ textAlign: "start",
1179
+ overflow: "hidden",
1180
+ textOverflow: "ellipsis",
1181
+ whiteSpace: "nowrap",
1182
+ backgroundColor: "var(--fu-ucrc-surface-variant)",
1183
+ fontFamily: "var(--fu-ucrc-font-primary)",
1184
+ fontWeight: 600,
1185
+ color: St,
1186
+ borderBottom: `2px solid ${_t}`
1187
+ },
1188
+ "& th:first-of-type": { borderTopLeftRadius: Ct, fontSize: "0.75em" },
1189
+ "& th:last-of-type": { borderTopRightRadius: Ct },
1190
+ "& tr > :not(:first-of-type)": { borderLeftWidth: "1px", borderLeftStyle: "solid" },
1191
+ "& td": { borderBottom: qt },
1192
+ "& tr:last-child > td": { borderBottom: "none" },
1193
+ // Second column: the edit buttons.
1194
+ "& tr > :last-of-type": { textAlign: "center", width: "30px" },
1195
+ "& td:first-of-type": { width: "calc(100% - 30px)" }
1196
+ }),
1197
+ predictionContent: n({ ...Xn, gap: "var(--fu-ucrc-space-sm)" }),
1198
+ predictionContentCompact: n({ ...Xn, gap: "var(--fu-ucrc-space-2xs)" }),
1199
+ questionText: n({
1200
+ margin: 0,
1201
+ marginBottom: "2px",
1202
+ fontFamily: "var(--fu-ucrc-font-secondary)",
1203
+ fontWeight: 400,
1204
+ fontSize: "1em",
1205
+ lineHeight: "1em",
1206
+ color: "var(--fu-ucrc-text-secondary)",
1207
+ unicodeBidi: "plaintext"
1208
+ }),
1209
+ predictionBox: n({
1210
+ display: "flex",
1211
+ alignItems: "center",
1212
+ gap: "var(--fu-ucrc-space-xs)",
1213
+ fontSize: "0.75em",
1214
+ padding: "2px 6px",
1215
+ minHeight: "20px",
1216
+ borderRadius: "var(--fu-ucrc-radius-sm)",
1217
+ border: qt,
1218
+ backgroundColor: "var(--fu-ucrc-neutral-soft-bg)",
1219
+ width: "fit-content"
1220
+ }),
1221
+ // A Typography inside the table: the box's font size and the table's line-height.
1222
+ selectionText: n({
1223
+ margin: 0,
1224
+ fontFamily: "var(--fu-ucrc-font-primary)",
1225
+ fontWeight: 500,
1226
+ color: St,
1227
+ unicodeBidi: "plaintext"
1228
+ }),
1229
+ // Joy IconButton plain sm; Joy's own hover colour wins over the sx one, the svg keeps its own.
1230
+ editIconButton: n({
1231
+ boxSizing: "border-box",
1232
+ display: "inline-flex",
1233
+ alignItems: "center",
1234
+ justifyContent: "center",
1235
+ position: "relative",
1236
+ margin: 0,
1237
+ padding: "4px",
1238
+ minHeight: "24px",
1239
+ minWidth: "24px",
1240
+ fontFamily: Te,
1241
+ fontSize: "inherit",
1242
+ fontWeight: "inherit",
1243
+ color: St,
1244
+ backgroundColor: "transparent",
1245
+ border: "none",
1246
+ borderRadius: "var(--fu-ucrc-radius-sm)",
1247
+ cursor: "pointer",
1248
+ transition: "all 0.2s ease",
1249
+ WebkitTapHighlightColor: "transparent",
1250
+ "@media (hover: hover)": {
1251
+ "&:hover": { color: "var(--fu-ucrc-neutral-plain-hover-color)" }
1252
+ },
1253
+ "&:hover": { backgroundColor: "var(--fu-ucrc-eg-edit-hover)" },
1254
+ "&:focus-visible": { outline: "2px solid var(--fu-ucrc-focus-visible)", outlineOffset: "2px" }
1255
+ })
1256
+ };
1257
+ /** @license Material Icons - Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0). Copyright Google LLC. */
1258
+ const Ni = Ye.forwardRef((e, i) => /* @__PURE__ */ t(Ui, { ref: i, "data-testid": "EditIcon", ...e, children: /* @__PURE__ */ t("path", { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z" }) }));
1259
+ Ni.displayName = "EditIcon";
1260
+ const Zn = "rgba(var(--fu-ucrc-shadow-channel) / var(--fu-ucrc-shadow-opacity))", mt = "1.25em", Kn = {
1261
+ position: "absolute",
1262
+ top: "50%",
1263
+ left: "50%",
1264
+ transform: "translate(-50%, -50%)",
1265
+ boxSizing: "border-box",
1266
+ display: "flex",
1267
+ flexDirection: "column",
1268
+ gap: "0.75em 1em",
1269
+ width: "100%",
1270
+ minWidth: `min(calc(100vw - 2 * ${mt}), 300px)`,
1271
+ overflow: "auto",
1272
+ border: "1px solid var(--fu-ucrc-neutral-outlined-border)",
1273
+ borderRadius: "var(--fu-ucrc-radius-md)",
1274
+ outline: 0,
1275
+ boxShadow: `var(--fu-ucrc-shadow-ring), 0px 2px 8px -2px ${Zn}, 0px 6px 12px -2px ${Zn}`,
1276
+ backgroundColor: "var(--fu-ucrc-surface)",
1277
+ color: "var(--fu-ucrc-neutral-outlined-color)",
1278
+ fontFamily: Te,
1279
+ fontSize: "1em",
1280
+ fontWeight: 400,
1281
+ lineHeight: 1.5
1282
+ }, fr = `max(calc(var(--fu-ucrc-radius-md) - 1px - ${mt}), min(calc(${mt} / 2), calc((var(--fu-ucrc-radius-md) - 1px) / 2)))`, Jn = {
1283
+ ...pe,
1284
+ padding: "0.375em 1em",
1285
+ borderRadius: fr,
1286
+ fontFamily: Te
1287
+ }, Ve = {
1288
+ dialog: n({ ...Kn, maxWidth: "600px", maxHeight: "80vh", padding: "24px" }),
1289
+ mobileDialog: n({ ...Kn, maxWidth: "90vw", maxHeight: "90vh", padding: "16px" }),
1290
+ // Joy IconButton with the widget's overrides; the icon keeps Joy's text.icon grey.
1291
+ closeButton: n({
1292
+ position: "absolute",
1293
+ top: "var(--fu-ucrc-space-sm)",
1294
+ right: "var(--fu-ucrc-space-sm)",
1295
+ zIndex: 1e3,
1296
+ boxSizing: "border-box",
1297
+ display: "flex",
1298
+ alignItems: "center",
1299
+ justifyContent: "center",
1300
+ width: "32px",
1301
+ height: "32px",
1302
+ minWidth: "32px",
1303
+ minHeight: "32px",
1304
+ margin: 0,
1305
+ padding: 0,
1306
+ border: "none",
1307
+ borderRadius: "50%",
1308
+ backgroundColor: "transparent",
1309
+ color: "var(--fu-ucrc-text-secondary)",
1310
+ fontFamily: Te,
1311
+ fontSize: "inherit",
1312
+ fontWeight: "inherit",
1313
+ cursor: "pointer",
1314
+ transition: "all 0.2s ease-in-out",
1315
+ WebkitTapHighlightColor: "transparent",
1316
+ "--fu-ucrc-eg-close-icon": "var(--fu-ucrc-palette-text-icon)",
1317
+ "&:hover": {
1318
+ backgroundColor: "var(--fu-ucrc-eg-close-hover)",
1319
+ color: "var(--fu-ucrc-text-primary)",
1320
+ transform: "scale(1.05)",
1321
+ "--fu-ucrc-eg-close-icon": "currentColor"
1322
+ },
1323
+ "&:focus-visible": {
1324
+ outline: "2px solid var(--fu-ucrc-focus-visible)",
1325
+ outlineOffset: "2px",
1326
+ "--fu-ucrc-eg-close-icon": "currentColor"
1327
+ }
1328
+ }),
1329
+ // Joy DialogContent with the sx gap and bottom padding: the fixtures inherit its tertiary colour and body font.
1330
+ content: n({
1331
+ display: "flex",
1332
+ flexDirection: "column",
1333
+ flex: "9999 1 0%",
1334
+ zIndex: 1,
1335
+ gap: "var(--fu-ucrc-space-md)",
1336
+ paddingBottom: "var(--fu-ucrc-space-lg)",
1337
+ overflow: "auto",
1338
+ color: "var(--fu-ucrc-palette-text-tertiary)"
1339
+ }),
1340
+ actions: n({
1341
+ display: "flex",
1342
+ alignItems: "center",
1343
+ flexDirection: "row-reverse",
1344
+ zIndex: 1,
1345
+ gap: `calc(0.625 * ${mt})`,
1346
+ paddingTop: `calc(0.75 * ${mt})`
1347
+ }),
1348
+ saveButton: n({
1349
+ ...Jn,
1350
+ color: "#FFF",
1351
+ backgroundColor: "var(--fu-ucrc-eg-save-bg)",
1352
+ "&:active": { backgroundColor: "var(--fu-ucrc-primary-solid-active-bg)" },
1353
+ "&:hover": { backgroundColor: "var(--fu-ucrc-eg-save-bg)", opacity: 0.8 },
1354
+ "&:disabled": {
1355
+ ...pe["&:disabled"],
1356
+ color: "transparent",
1357
+ backgroundColor: "var(--fu-ucrc-neutral-soft-bg)"
1358
+ }
1359
+ }),
1360
+ closeActionButton: n({
1361
+ ...Jn,
1362
+ border: "1px solid var(--fu-ucrc-secondary-container)",
1363
+ color: "var(--fu-ucrc-secondary-container)",
1364
+ backgroundColor: "transparent",
1365
+ "&:hover": {
1366
+ borderColor: "var(--fu-ucrc-text-primary)",
1367
+ color: "var(--fu-ucrc-text-primary)",
1368
+ backgroundColor: "var(--fu-ucrc-surface-variant)"
1369
+ },
1370
+ "&:disabled": {
1371
+ ...pe["&:disabled"],
1372
+ borderColor: "var(--fu-ucrc-secondary-container)",
1373
+ color: "var(--fu-ucrc-secondary-container)",
1374
+ opacity: 0.5
1375
+ }
1376
+ })
1377
+ }, wn = (e) => {
1378
+ const i = (/* @__PURE__ */ new Date()).getTime(), o = new Date(e).getTime();
1379
+ return i > o;
1380
+ }, vt = (e, i) => {
1381
+ let o = e;
1382
+ return (i == null ? void 0 : i.min) !== null && (i == null ? void 0 : i.min) !== void 0 && (o = Math.max(o, i.min)), (i == null ? void 0 : i.max) !== null && (i == null ? void 0 : i.max) !== void 0 && (o = Math.min(o, i.max)), o;
1383
+ }, mr = (e) => {
1384
+ const { t: i } = ie(), o = Pe(), r = oe(), [c, f] = N(!1), d = {
1385
+ "--fu-ucrc-eg-save-bg": e.brandingPrimaryColor || "var(--fu-ucrc-primary-plain-color)",
1386
+ "--fu-ucrc-eg-close-hover": `${o.textSecondary}15`
1387
+ }, l = e.prediction.fixtures.find(
1388
+ (h) => h.id === e.fixture.id
1389
+ ), a = (h) => {
1390
+ const v = { ...e.prediction }, g = v.fixtures.findIndex(
1391
+ (b) => b.id === e.fixture.id
1392
+ );
1393
+ g !== -1 && (v.fixtures[g] = {
1394
+ ...v.fixtures[g],
1395
+ prediction: h
1396
+ }), e.onPredictionUpdate(v);
1397
+ }, s = async () => {
1398
+ if (f(!0), e.fixture.outcomeType === H.NUMBER) {
1399
+ const h = e.fixture.validOutcomes;
1400
+ if (l && typeof l.prediction == "number") {
1401
+ const v = vt(
1402
+ l.prediction,
1403
+ h
1404
+ );
1405
+ v !== l.prediction && a(v);
1406
+ }
1407
+ }
1408
+ try {
1409
+ (await e.play() || e.view !== "score") && e.onClose();
1410
+ } finally {
1411
+ f(!1);
1412
+ }
1413
+ }, y = () => {
1414
+ const h = e.fixture.outcomeType;
1415
+ if (h === H.NUMBER) {
1416
+ const v = l == null ? void 0 : l.prediction, g = e.fixture.validOutcomes;
1417
+ return /* @__PURE__ */ t(
1418
+ Vt,
1419
+ {
1420
+ fixtureId: e.fixture.id,
1421
+ prediction: v,
1422
+ onChange: (b) => {
1423
+ a(b);
1424
+ },
1425
+ question: e.fixture.question,
1426
+ validOutcomes: g || null,
1427
+ showPoints: !1,
1428
+ isOverlayVariant: e.isOverlayVariant,
1429
+ brandingPrimaryColor: e.brandingPrimaryColor
1430
+ }
1431
+ );
1432
+ }
1433
+ if (h === H.BOOLEAN) {
1434
+ const v = l == null ? void 0 : l.prediction;
1435
+ return /* @__PURE__ */ t(
1436
+ Wt,
1437
+ {
1438
+ fixtureId: e.fixture.id,
1439
+ onSelectionChange: (g) => {
1440
+ a(g);
1441
+ },
1442
+ prediction: v,
1443
+ question: e.fixture.question,
1444
+ showPoints: !1,
1445
+ brandingPrimaryColor: e.brandingPrimaryColor
1446
+ }
1447
+ );
1448
+ }
1449
+ if (h === H.FREE_INPUT) {
1450
+ const v = l == null ? void 0 : l.prediction;
1451
+ return /* @__PURE__ */ t(
1452
+ He,
1453
+ {
1454
+ fixtureId: e.fixture.id,
1455
+ question: e.fixture.question,
1456
+ prediction: v || null,
1457
+ validOutcomes: null,
1458
+ onTextChange: (g) => {
1459
+ a(g);
1460
+ },
1461
+ showPoints: !1,
1462
+ brandingPrimaryColor: e.brandingPrimaryColor
1463
+ }
1464
+ );
1465
+ }
1466
+ if (h === H.ENUM) {
1467
+ const v = l == null ? void 0 : l.prediction;
1468
+ return /* @__PURE__ */ t(
1469
+ He,
1470
+ {
1471
+ fixtureId: e.fixture.id,
1472
+ question: e.fixture.question,
1473
+ prediction: v || null,
1474
+ validOutcomes: e.fixture.validOutcomes,
1475
+ onTextChange: (g) => {
1476
+ a(g);
1477
+ },
1478
+ showPoints: !1,
1479
+ brandingPrimaryColor: e.brandingPrimaryColor
1480
+ }
1481
+ );
1482
+ }
1483
+ return null;
1484
+ };
1485
+ return /* @__PURE__ */ t(mo, { open: e.isOpen, onClose: e.onClose, children: /* @__PURE__ */ x("div", { role: "dialog", "aria-modal": "true", tabIndex: -1, css: r ? Ve.mobileDialog : Ve.dialog, style: d, children: [
1486
+ /* @__PURE__ */ t("button", { type: "button", css: Ve.closeButton, onClick: e.onClose, children: /* @__PURE__ */ t(Ro, { size: "1.25em", color: "var(--fu-ucrc-eg-close-icon)" }) }),
1487
+ /* @__PURE__ */ t("div", { css: Ve.content, children: y() }),
1488
+ e.view === "score" && /* @__PURE__ */ x("div", { css: Ve.actions, children: [
1489
+ /* @__PURE__ */ x("button", { type: "button", css: Ve.saveButton, onClick: s, disabled: c, children: [
1490
+ c && /* @__PURE__ */ t(Ot, { size: 20, thickness: 2 }),
1491
+ i("eventGame.buttons.save")
1492
+ ] }),
1493
+ /* @__PURE__ */ t("button", { type: "button", css: Ve.closeActionButton, onClick: e.onClose, disabled: c, children: i("eventGame.buttons.close") })
1494
+ ] })
1495
+ ] }) });
1496
+ }, Ke = (e) => {
1497
+ const { t: i } = ie(), o = Pe(), r = oe(), [c, f] = N(!1), [d, l] = N(null), a = (v) => {
1498
+ l(e.fixtures[v]), f(!0);
1499
+ }, s = () => {
1500
+ if (e.view === "play" && d && d.outcomeType === H.NUMBER) {
1501
+ const v = d.validOutcomes, g = e.prediction.fixtures.find((b) => b.id === d.id);
1502
+ if (g && typeof g.prediction == "number") {
1503
+ const b = vt(g.prediction, v);
1504
+ if (b !== g.prediction) {
1505
+ const p = { ...e.prediction }, C = p.fixtures.findIndex((S) => S.id === d.id);
1506
+ C !== -1 && (p.fixtures[C] = {
1507
+ ...p.fixtures[C],
1508
+ prediction: b
1509
+ }, e.onPredictionUpdate(p));
1510
+ }
1511
+ }
1512
+ }
1513
+ f(!1), l(null);
1514
+ }, y = (v) => {
1515
+ e.onPredictionUpdate(v);
1516
+ }, h = (v) => {
1517
+ var p;
1518
+ const g = (p = e.prediction.fixtures) == null ? void 0 : p.find((C) => C.id === v.id);
1519
+ if (!g) return null;
1520
+ const b = v.outcomeType === H.BOOLEAN ? g.prediction === !0 ? i("eventGame.fixtures.yes") : i("eventGame.fixtures.no") : g.prediction;
1521
+ return /* @__PURE__ */ t("div", { css: Ee.predictionBox, children: /* @__PURE__ */ t("p", { css: Ee.selectionText, children: b }) });
1522
+ };
1523
+ return /* @__PURE__ */ x("div", { css: Ee.container, children: [
1524
+ /* @__PURE__ */ t("p", { css: Ee.title, children: i("eventGame.summary.title") }),
1525
+ /* @__PURE__ */ t(
1526
+ "div",
1527
+ {
1528
+ css: Ee.tableContainer,
1529
+ style: { "--fu-ucrc-eg-edit-hover": `${o.textPrimary}15` },
1530
+ children: /* @__PURE__ */ x("table", { css: Ee.table, children: [
1531
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ x("tr", { children: [
1532
+ /* @__PURE__ */ t("th", { children: i("eventGame.summary.prediction") }),
1533
+ /* @__PURE__ */ t("th", {})
1534
+ ] }) }),
1535
+ /* @__PURE__ */ t("tbody", { children: e.fixtures.map((v, g) => /* @__PURE__ */ x("tr", { children: [
1536
+ /* @__PURE__ */ t("td", { children: /* @__PURE__ */ x("div", { css: r || e.isSplitVariant ? Ee.predictionContentCompact : Ee.predictionContent, children: [
1537
+ /* @__PURE__ */ t("p", { css: Ee.questionText, children: v.question }),
1538
+ h(v)
1539
+ ] }) }),
1540
+ /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("button", { type: "button", css: Ee.editIconButton, onClick: () => a(g), children: /* @__PURE__ */ t(Ni, { size: "1em", color: "var(--fu-ucrc-text-primary)" }) }) })
1541
+ ] }, `${v.id}-${g}`)) })
1542
+ ] })
1543
+ }
1544
+ ),
1545
+ d && /* @__PURE__ */ t(
1546
+ mr,
1547
+ {
1548
+ isOpen: c,
1549
+ onClose: s,
1550
+ fixture: d,
1551
+ prediction: e.prediction,
1552
+ onPredictionUpdate: y,
1553
+ play: e.play,
1554
+ view: e.view,
1555
+ isOverlayVariant: e.isOverlayVariant,
1556
+ brandingPrimaryColor: e.brandingPrimaryColor
1557
+ }
1558
+ )
1559
+ ] });
1560
+ }, gt = (e) => `var(--fu-ucrc-egs-${e})`, gr = gt("text"), hr = gt("secondary"), ji = gt("primary"), sn = "var(--fu-ucrc-primary-on-primary)", Qn = "var(--fu-ucrc-danger-plain-color)", dn = "var(--fu-ucrc-font-primary)", We = { display: "flex", flexDirection: "column" }, kt = { display: "flex", alignItems: "center", gap: u("lg") }, xr = pn({
1561
+ "0%": { opacity: 1, transform: "scale(1)" },
1562
+ "50%": { opacity: 0.7, transform: "scale(1.1)" },
1563
+ "100%": { opacity: 1, transform: "scale(1)" }
1564
+ }), qi = {
1565
+ ...pe,
1566
+ alignSelf: "center",
1567
+ paddingBlock: "10px",
1568
+ paddingInline: "16px",
1569
+ borderRadius: "var(--fu-ucrc-radius-xl)",
1570
+ fontSize: "0.9375em",
1571
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
1572
+ transform: "scale(1)",
1573
+ "&:active": { transform: "scale(0.98)" }
1574
+ }, ei = {
1575
+ ...ae,
1576
+ fontFamily: dn,
1577
+ fontWeight: 500,
1578
+ fontSize: "0.9375em",
1579
+ lineHeight: "24px",
1580
+ letterSpacing: "0.46px",
1581
+ textTransform: "uppercase",
1582
+ gap: "8px",
1583
+ display: "flex",
1584
+ alignItems: "center"
1585
+ }, ti = {
1586
+ ...qi,
1587
+ backgroundColor: ji,
1588
+ color: sn,
1589
+ "&:hover": { transform: "scale(1.02)" },
1590
+ // Joy's loading state disabled the button.
1591
+ "&:disabled": { ...pe["&:disabled"], opacity: "12%" }
1592
+ }, W = {
1593
+ area: n({ ...We, padding: u("md") }),
1594
+ areaMobile: n({ ...We, padding: u("sm") }),
1595
+ question: n({ ...We, gap: u("md") }),
1596
+ questionXs: n({ ...We, gap: u("lg") }),
1597
+ content: n({
1598
+ ...We,
1599
+ borderRadius: "var(--fu-ucrc-radius-md)",
1600
+ padding: u("md"),
1601
+ gap: u("md"),
1602
+ backgroundColor: gt("content-bg"),
1603
+ backdropFilter: "blur(4px)",
1604
+ position: "relative",
1605
+ zIndex: 2
1606
+ }),
1607
+ pagination: n({ ...We, alignItems: "center", gap: u("md") }),
1608
+ navigation: n({ display: "flex", gap: u("md"), justifyContent: "center", alignItems: "center" }),
1609
+ back: n({
1610
+ ...qi,
1611
+ border: `1px solid ${ji}`,
1612
+ backgroundColor: "transparent",
1613
+ color: sn,
1614
+ "&:hover": { backgroundColor: gt("back-hover"), transform: "scale(1.02)" }
1615
+ }),
1616
+ // No colour in the old sx: Joy's body-md paints text.secondary.
1617
+ backLabel: n({ ...ei, color: "var(--fu-ucrc-palette-text-secondary)" }),
1618
+ next: n({ ...ti, cursor: "pointer", opacity: "1" }),
1619
+ // Until a pick is made Next stays enabled, but is a dimmed no-op.
1620
+ nextIdle: n({ ...ti, cursor: "not-allowed", opacity: "0.5" }),
1621
+ nextLabel: n({ ...ei, color: sn }),
1622
+ gameState: n({
1623
+ ...We,
1624
+ alignItems: "center",
1625
+ justifyContent: "center",
1626
+ textAlign: "center",
1627
+ padding: `${u("xs")} ${u("sm")}`,
1628
+ gap: u("3xs")
1629
+ }),
1630
+ stateTitle: n({
1631
+ ...ae,
1632
+ fontFamily: dn,
1633
+ fontSize: "1.5em",
1634
+ fontWeight: 700,
1635
+ color: gr,
1636
+ lineHeight: 1.3
1637
+ }),
1638
+ stateDescription: n({
1639
+ ...ae,
1640
+ fontFamily: dn,
1641
+ fontSize: "1.25em",
1642
+ letterSpacing: "0.15px",
1643
+ fontWeight: 400,
1644
+ color: hr,
1645
+ lineHeight: 1.4,
1646
+ opacity: "60%"
1647
+ }),
1648
+ liveRow: n({ display: "flex", alignItems: "center", gap: u("xs"), marginTop: u("xs") }),
1649
+ liveDot: n({
1650
+ width: "12px",
1651
+ height: "12px",
1652
+ borderRadius: "50%",
1653
+ backgroundColor: Qn,
1654
+ animation: `${xr} 2s infinite`
1655
+ }),
1656
+ liveText: n({
1657
+ ...ae,
1658
+ fontFamily: "var(--fu-ucrc-font-secondary)",
1659
+ fontSize: "0.875em",
1660
+ color: Qn,
1661
+ fontWeight: 600,
1662
+ textTransform: "uppercase",
1663
+ letterSpacing: "0.5px"
1664
+ }),
1665
+ closedHeader: n({
1666
+ display: "flex",
1667
+ alignItems: "center",
1668
+ justifyContent: "center",
1669
+ gap: u("sm"),
1670
+ flexWrap: "wrap"
1671
+ })
1672
+ }, Yt = {
1673
+ row: {
1674
+ logo: n({ ...kt, flexDirection: "row", justifyContent: "space-between" }),
1675
+ end: n({ ...kt, flexDirection: "row", justifyContent: "flex-end" })
1676
+ },
1677
+ xs: {
1678
+ logo: n({ ...kt, flexDirection: "column", justifyContent: "space-between" }),
1679
+ end: n({ ...kt, flexDirection: "column", justifyContent: "flex-end" })
1680
+ }
1681
+ }, vr = (e) => {
1682
+ var Ce, ye, xe, Se, w, K, ne;
1683
+ const [i, o] = Ye.useState(1), { t: r } = ie(), c = oe(), f = ht(), d = Pe(), l = ((Ce = e.eventGame.branding) == null ? void 0 : Ce.colors) || null, a = c ? ((xe = (ye = e.eventGame.branding) == null ? void 0 : ye.images) == null ? void 0 : xe.mobileLogo) || ((w = (Se = e.eventGame.branding) == null ? void 0 : Se.images) == null ? void 0 : w.mainLogo) || "" : ((ne = (K = e.eventGame.branding) == null ? void 0 : K.images) == null ? void 0 : ne.mainLogo) || "", s = e.imagePosition || "left", y = Me(
1684
+ {
1685
+ images: e.eventGame.images,
1686
+ imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
1687
+ },
1688
+ de.STANDARD
1689
+ ), h = f || c && !!y, v = (l == null ? void 0 : l.contentColor) || d.textColor, g = (l == null ? void 0 : l.secondaryColor) || d.textColor, b = xt((l == null ? void 0 : l.backgroundColor) || d.surfaceVariant || ""), p = (l == null ? void 0 : l.primaryColor) || d.palette.primary.plainColor, C = {
1690
+ "--fu-ucrc-egs-text": v,
1691
+ "--fu-ucrc-egs-secondary": g,
1692
+ "--fu-ucrc-egs-primary": p,
1693
+ "--fu-ucrc-egs-content-bg": `rgba(${b ? b.replace(/[^\d,]/g, "") : ""}, 0.5)`,
1694
+ "--fu-ucrc-egs-back-hover": `${p}10`
1695
+ }, S = h ? "xs" : "row", T = (m, P) => {
1696
+ var $, _, U, I;
1697
+ return /* @__PURE__ */ t(
1698
+ he,
1699
+ {
1700
+ brandingLogo: a,
1701
+ textColor: m,
1702
+ label: null,
1703
+ flexDirection: P,
1704
+ primaryUrl: (_ = ($ = e.eventGame.branding) == null ? void 0 : $.urls) == null ? void 0 : _.primaryUrl,
1705
+ secondaryUrl: (I = (U = e.eventGame.branding) == null ? void 0 : U.urls) == null ? void 0 : I.secondaryUrl
1706
+ }
1707
+ );
1708
+ }, { setPrediction: R } = e, D = Ht(
1709
+ (m, P) => {
1710
+ R(($) => {
1711
+ const _ = { ...$ }, U = _.fixtures.find(
1712
+ (I) => I.id === m
1713
+ );
1714
+ return U && (U.prediction = P), _;
1715
+ });
1716
+ },
1717
+ [R]
1718
+ ), z = e.eventGame.fixtures.length + 1, q = e.eventGame.status === "OPEN" && wn(e.eventGame.predictionsCutoff || ""), Y = () => {
1719
+ var P, $;
1720
+ const m = e.eventGame.fixtures[i - 1];
1721
+ if (m && m.outcomeType === H.NUMBER) {
1722
+ const _ = m.validOutcomes, U = ($ = (P = e.prediction) == null ? void 0 : P.fixtures) == null ? void 0 : $.find(
1723
+ (I) => I.id === m.id
1724
+ );
1725
+ if (U && typeof U.prediction == "number") {
1726
+ const I = vt(
1727
+ U.prediction,
1728
+ _
1729
+ );
1730
+ I !== U.prediction && D(m.id, I);
1731
+ }
1732
+ }
1733
+ i < z ? o(i + 1) : e.play();
1734
+ }, k = (m) => {
1735
+ o(m + 1);
1736
+ }, A = () => {
1737
+ var $, _;
1738
+ if (i === z) return !0;
1739
+ const m = e.eventGame.fixtures[i - 1];
1740
+ if (!m) return !1;
1741
+ const P = (_ = ($ = e.prediction) == null ? void 0 : $.fixtures) == null ? void 0 : _.find(
1742
+ (U) => U.id === m.id
1743
+ );
1744
+ return P ? P.prediction !== null : !1;
1745
+ }, L = () => {
1746
+ i > 1 && o(i - 1);
1747
+ }, O = (m) => /* @__PURE__ */ t("div", { css: c ? W.areaMobile : W.area, style: C, children: /* @__PURE__ */ x("div", { css: h ? W.questionXs : W.question, children: [
1748
+ /* @__PURE__ */ t("div", { css: W.content, children: /* @__PURE__ */ t("div", { css: W.gameState, children: m }) }),
1749
+ /* @__PURE__ */ t("div", { css: Yt[S].logo, children: T(v) })
1750
+ ] }) }), le = () => O(
1751
+ /* @__PURE__ */ x(Q, { children: [
1752
+ /* @__PURE__ */ t("p", { css: W.stateTitle, children: r("eventGame.states.pending.title") }),
1753
+ /* @__PURE__ */ t("p", { css: W.stateDescription, children: r("eventGame.states.pending.description") })
1754
+ ] })
1755
+ ), se = () => O(
1756
+ /* @__PURE__ */ x(Q, { children: [
1757
+ /* @__PURE__ */ x("div", { css: W.liveRow, children: [
1758
+ /* @__PURE__ */ t("div", { css: W.liveDot }),
1759
+ /* @__PURE__ */ t("p", { css: W.liveText, children: r("eventGame.states.live.indicator") })
1760
+ ] }),
1761
+ /* @__PURE__ */ t("p", { css: W.stateDescription, children: r("eventGame.states.live.description") })
1762
+ ] })
1763
+ ), ce = () => O(
1764
+ /* @__PURE__ */ x(Q, { children: [
1765
+ /* @__PURE__ */ t("div", { css: W.closedHeader, children: /* @__PURE__ */ t("p", { css: W.stateTitle, children: r("eventGame.states.closed.title") }) }),
1766
+ /* @__PURE__ */ t("p", { css: W.stateDescription, children: r("eventGame.states.closed.description") })
1767
+ ] })
1768
+ ), me = () => /* @__PURE__ */ x("div", { css: W.gameState, children: [
1769
+ /* @__PURE__ */ t("p", { css: W.stateTitle, children: r("eventGame.states.open.title") }),
1770
+ /* @__PURE__ */ t("p", { css: W.stateDescription, children: r("eventGame.states.open.description") })
1771
+ ] }), j = () => {
1772
+ const m = A();
1773
+ return /* @__PURE__ */ x(Q, { children: [
1774
+ e.showCountdown && e.eventGame.status === "OPEN" && /* @__PURE__ */ t(
1775
+ kn,
1776
+ {
1777
+ predictionsCutoffTime: e.eventGame.predictionsCutoff || ""
1778
+ }
1779
+ ),
1780
+ /* @__PURE__ */ t("div", { css: c ? W.areaMobile : W.area, style: C, children: /* @__PURE__ */ x("div", { css: h ? W.questionXs : W.question, children: [
1781
+ !q && /* @__PURE__ */ t("div", { css: W.pagination, children: /* @__PURE__ */ t(
1782
+ Sn,
1783
+ {
1784
+ eventGame: e.eventGame,
1785
+ currentStep: i,
1786
+ totalSteps: z,
1787
+ brandingPrimaryColor: l == null ? void 0 : l.primaryColor
1788
+ }
1789
+ ) }),
1790
+ i === z ? /* @__PURE__ */ t(
1791
+ Ke,
1792
+ {
1793
+ fixtures: e.eventGame.fixtures,
1794
+ prediction: e.prediction,
1795
+ onEditPrediction: k,
1796
+ onPredictionUpdate: e.setPrediction,
1797
+ view: "play",
1798
+ play: async () => e.play(),
1799
+ brandingPrimaryColor: l == null ? void 0 : l.primaryColor
1800
+ }
1801
+ ) : /* @__PURE__ */ t("div", { css: W.content, children: ue() }),
1802
+ /* @__PURE__ */ x("div", { css: Yt[S][a ? "logo" : "end"], children: [
1803
+ !h && T(v, "row"),
1804
+ /* @__PURE__ */ x("div", { css: W.navigation, children: [
1805
+ i > 1 && i < z && /* @__PURE__ */ t("button", { type: "button", css: W.back, onClick: L, children: /* @__PURE__ */ t("p", { css: W.backLabel, children: r("eventGame.buttons.back") }) }),
1806
+ !q && /* @__PURE__ */ x(
1807
+ "button",
1808
+ {
1809
+ type: "button",
1810
+ css: m ? W.next : W.nextIdle,
1811
+ onClick: m ? Y : void 0,
1812
+ disabled: e.isPlaying,
1813
+ children: [
1814
+ /* @__PURE__ */ t("p", { css: W.nextLabel, children: i === z ? e.hasAfterConsents ? r("eventGame.buttons.continue") : r("eventGame.buttons.play") : r("eventGame.buttons.next") }),
1815
+ e.isPlaying && /* @__PURE__ */ t(Ot, { size: 20, thickness: 3 })
1816
+ ]
1817
+ }
1818
+ )
1819
+ ] }),
1820
+ h && T(v)
1821
+ ] })
1822
+ ] }) })
1823
+ ] });
1824
+ }, B = () => {
1825
+ switch (e.eventGame.status) {
1826
+ case "PENDING":
1827
+ return le();
1828
+ case "LIVE":
1829
+ return se();
1830
+ case "CLOSED":
1831
+ return ce();
1832
+ default:
1833
+ return j();
1834
+ }
1835
+ }, te = ft(() => e.eventGame.fixtures[i - 1], [e.eventGame.fixtures, i]), ue = () => {
1836
+ var P, $, _, U, I, M, X, ke;
1837
+ const m = te;
1838
+ if (q)
1839
+ return me();
1840
+ if (m)
1841
+ switch (m.outcomeType) {
1842
+ case H.BOOLEAN: {
1843
+ const G = ($ = (P = e.prediction) == null ? void 0 : P.fixtures) == null ? void 0 : $.find(
1844
+ (J) => J.id === m.id
1845
+ );
1846
+ return /* @__PURE__ */ t(
1847
+ Wt,
1848
+ {
1849
+ prediction: typeof (G == null ? void 0 : G.prediction) == "boolean" ? G.prediction : null,
1850
+ onSelectionChange: (J) => D(m.id, J),
1851
+ useExtraSmallLayout: h,
1852
+ question: m.question,
1853
+ fixtureId: m.id,
1854
+ brandingPrimaryColor: l == null ? void 0 : l.primaryColor
1855
+ },
1856
+ `${m.outcomeType}-${m.id}`
1857
+ );
1858
+ }
1859
+ case H.NUMBER: {
1860
+ const G = (U = (_ = e.prediction) == null ? void 0 : _.fixtures) == null ? void 0 : U.find(
1861
+ (Le) => Le.id === m.id
1862
+ ), J = m.validOutcomes;
1863
+ return /* @__PURE__ */ t(
1864
+ Vt,
1865
+ {
1866
+ prediction: typeof (G == null ? void 0 : G.prediction) == "number" ? G.prediction : 0,
1867
+ onChange: (Le) => D(m.id, Le),
1868
+ useExtraSmallLayout: h,
1869
+ question: m.question,
1870
+ validOutcomes: J,
1871
+ fixtureId: m.id,
1872
+ brandingPrimaryColor: l == null ? void 0 : l.primaryColor
1873
+ },
1874
+ `${m.outcomeType}-${m.id}`
1875
+ );
1876
+ }
1877
+ case H.FREE_INPUT: {
1878
+ const G = (M = (I = e.prediction) == null ? void 0 : I.fixtures) == null ? void 0 : M.find(
1879
+ (J) => J.id === m.id
1880
+ );
1881
+ return /* @__PURE__ */ t(
1882
+ He,
1883
+ {
1884
+ question: m.question,
1885
+ prediction: typeof (G == null ? void 0 : G.prediction) == "string" ? G.prediction : null,
1886
+ validOutcomes: null,
1887
+ onTextChange: (J) => D(m.id, J),
1888
+ useExtraSmallLayout: h,
1889
+ fixtureId: m.id,
1890
+ brandingPrimaryColor: l == null ? void 0 : l.primaryColor
1891
+ },
1892
+ `${m.outcomeType}-${m.id}`
1893
+ );
1894
+ }
1895
+ case H.ENUM: {
1896
+ const G = (ke = (X = e.prediction) == null ? void 0 : X.fixtures) == null ? void 0 : ke.find(
1897
+ (J) => J.id === m.id
1898
+ );
1899
+ return /* @__PURE__ */ t(
1900
+ He,
1901
+ {
1902
+ question: m.question,
1903
+ prediction: typeof (G == null ? void 0 : G.prediction) == "string" ? G.prediction : null,
1904
+ validOutcomes: m.validOutcomes,
1905
+ onTextChange: (J) => D(m.id, J),
1906
+ useExtraSmallLayout: h,
1907
+ fixtureId: m.id,
1908
+ optionsLayout: e.optionsLayout,
1909
+ brandingPrimaryColor: l == null ? void 0 : l.primaryColor
1910
+ },
1911
+ `${m.id}-${i}`
1912
+ );
1913
+ }
1914
+ default:
1915
+ return /* @__PURE__ */ t(Q, {});
1916
+ }
1917
+ }, fe = () => {
1918
+ var m, P, $;
1919
+ return /* @__PURE__ */ t("div", { css: c ? W.areaMobile : W.area, style: C, children: /* @__PURE__ */ x("div", { css: h ? W.questionXs : W.question, children: [
1920
+ /* @__PURE__ */ t("div", { css: W.content, children: /* @__PURE__ */ t(
1921
+ Ze,
1922
+ {
1923
+ consents: e.consents,
1924
+ primaryColor: p,
1925
+ textColor: v,
1926
+ brandingUrls: (m = e.eventGame.branding) == null ? void 0 : m.urls,
1927
+ align: "center"
1928
+ }
1929
+ ) }),
1930
+ /* @__PURE__ */ x("div", { css: Yt[S][a ? "logo" : "end"], children: [
1931
+ a && T(v),
1932
+ /* @__PURE__ */ t("div", { css: W.navigation, children: /* @__PURE__ */ t(
1933
+ Ut,
1934
+ {
1935
+ onClick: e.startPredicting,
1936
+ label: (($ = (P = e.consents) == null ? void 0 : P.labels) == null ? void 0 : $.ctaLabel) || r("eventGame.buttons.start"),
1937
+ isSubmitting: e.isSubmitting,
1938
+ primaryColor: p,
1939
+ showArrow: !1
1940
+ }
1941
+ ) })
1942
+ ] })
1943
+ ] }) });
1944
+ };
1945
+ return /* @__PURE__ */ t(De, { brandingBorderColor: (l == null ? void 0 : l.borderColor) || null, children: /* @__PURE__ */ t(
1946
+ Oi,
1947
+ {
1948
+ entity: { ...e.eventGame, labels: null },
1949
+ headline: r("eventGame.headline"),
1950
+ finalImage: y,
1951
+ imagePosition: s,
1952
+ rulesDisplay: e.rulesDisplay,
1953
+ children: e.applyConsentGate ? fe() : B()
1954
+ }
1955
+ ) });
1956
+ }, pr = { success: "success", error: "danger", info: "primary" }, un = { margin: 0, fontFamily: "var(--fu-ucrc-font-secondary)", lineHeight: 1.5 }, ni = (e, i) => n({
1957
+ display: "flex",
1958
+ alignItems: "center",
1959
+ gap: i ? "calc(8em / 12)" : "calc(8em / 14)",
1960
+ padding: i ? "1em" : "calc(12em / 14)",
1961
+ fontSize: i ? "0.75em" : "0.875em",
1962
+ fontFamily: "var(--fu-ucrc-font-body)",
1963
+ lineHeight: 1.5,
1964
+ borderRadius: "var(--fu-ucrc-radius-sm)",
1965
+ color: `var(--fu-ucrc-${e}-soft-color)`,
1966
+ backgroundColor: `var(--fu-ucrc-${e}-soft-bg)`,
1967
+ "--Icon-fontSize": i ? "1em" : "1.25em"
1968
+ }), yr = (e) => n({ ...un, fontSize: "0.875em", fontWeight: 700, color: `rgb(var(--fu-ucrc-${e}-main-channel))` }), Xt = Object.fromEntries(
1969
+ Object.entries(pr).map(([e, i]) => [
1970
+ e,
1971
+ { root: ni(i, !1), mobileRoot: ni(i, !0), title: yr(i) }
1972
+ ])
1973
+ ), wt = {
1974
+ icon: n({ display: "flex", flexShrink: 0 }),
1975
+ body: n({ display: "flex", flexDirection: "column", fontSize: "1.5em" }),
1976
+ message: n({ ...un, fontSize: "0.675em", color: "var(--fu-ucrc-palette-text-tertiary)" }),
1977
+ // Joy body-xs: weight 500.
1978
+ description: n({ ...un, fontSize: "0.6em", fontWeight: 500, color: "var(--fu-ucrc-palette-text-tertiary)" })
1979
+ }, Pn = ({ variant: e, title: i, message: o, description: r }) => {
1980
+ const c = be(), f = oe(), d = e === "success" ? /* @__PURE__ */ t(Ao, {}) : e === "error" ? /* @__PURE__ */ t(Lo, { color: c.colorSchemes.light.palette.danger.plainColor }) : /* @__PURE__ */ t($o, {});
1981
+ return /* @__PURE__ */ x("div", { role: "alert", css: f ? Xt[e].mobileRoot : Xt[e].root, children: [
1982
+ /* @__PURE__ */ t("span", { css: wt.icon, children: d }),
1983
+ /* @__PURE__ */ x("div", { css: wt.body, children: [
1984
+ i && /* @__PURE__ */ t("p", { css: Xt[e].title, children: i }),
1985
+ o && /* @__PURE__ */ t("p", { css: wt.message, children: o }),
1986
+ r && /* @__PURE__ */ t("p", { css: wt.description, children: r })
1987
+ ] })
1988
+ ] });
1989
+ }, it = { display: "flex", flexDirection: "column" }, ii = { display: "flex", justifyContent: "center", alignItems: "center" }, Pt = { display: "flex", flexDirection: "row", alignItems: "center", gap: u("md") }, oi = {
1990
+ ...pe,
1991
+ ...ii,
1992
+ flexDirection: "row",
1993
+ gap: "8px",
1994
+ borderRadius: "var(--fu-ucrc-radius-xl)",
1995
+ border: "var(--fu-ucrc-border-size) solid var(--fu-ucrc-secondary-container)",
1996
+ backgroundColor: "var(--fu-ucrc-secondary-container)",
1997
+ // Joy's solidColor (common.white) is not in the theme snapshot.
1998
+ color: "var(--fu-ucrc-primary-solid-color, #fff)",
1999
+ "&:hover": { opacity: 0.9 },
2000
+ "& > div": { ...ii, gap: "8px" }
2001
+ }, ri = {
2002
+ ...ae,
2003
+ color: "var(--fu-ucrc-egs-ss-secondary)",
2004
+ fontFamily: "var(--fu-ucrc-font-primary)",
2005
+ fontStyle: "normal",
2006
+ fontWeight: 500,
2007
+ lineHeight: "22px",
2008
+ letterSpacing: "0.46px",
2009
+ textTransform: "uppercase"
2010
+ }, we = {
2011
+ area: n({ ...it, padding: u("md") }),
2012
+ areaMobile: n({ ...it, padding: u("sm") }),
2013
+ question: n({ ...it, gap: u("md") }),
2014
+ questionMobile: n({ ...it, gap: u("lg") }),
2015
+ content: n({ ...it, borderRadius: "var(--fu-ucrc-radius-md)", gap: u("md") }),
2016
+ chanceGame: n({ padding: u("md") }),
2017
+ footer: n({ ...Pt, paddingInline: u("md"), justifyContent: "flex-start" }),
2018
+ footerMobile: n({ ...Pt, paddingInline: u("sm"), justifyContent: "flex-start" }),
2019
+ footerSpread: n({ ...Pt, paddingInline: u("md"), justifyContent: "space-between" }),
2020
+ footerSpreadMobile: n({ ...Pt, paddingInline: u("sm"), justifyContent: "space-between" }),
2021
+ additionalCta: n({
2022
+ ...oi,
2023
+ paddingBlock: u("sm"),
2024
+ paddingInline: u("md"),
2025
+ "& p": { ...ri, fontSize: "0.8125em" }
2026
+ }),
2027
+ additionalCtaMobile: n({
2028
+ ...oi,
2029
+ paddingBlock: u("xs"),
2030
+ paddingInline: u("sm"),
2031
+ "& p": { ...ri, fontSize: "0.75em" }
2032
+ })
2033
+ }, br = (e) => {
2034
+ var p, C, S, T, R, D, z;
2035
+ const i = Pe(), o = oe(), r = Me(
2036
+ {
2037
+ images: e.eventGame.images,
2038
+ imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
2039
+ },
2040
+ de.STANDARD
2041
+ ), { t: c } = ie(), f = o ? ((C = (p = e.eventGame.branding) == null ? void 0 : p.images) == null ? void 0 : C.mobileLogo) || ((T = (S = e.eventGame.branding) == null ? void 0 : S.images) == null ? void 0 : T.mainLogo) || "" : ((D = (R = e.eventGame.branding) == null ? void 0 : R.images) == null ? void 0 : D.mainLogo) || "", d = ((z = e.eventGame.branding) == null ? void 0 : z.colors) || null, l = e.imagePosition || "left", a = e.eventGame.status === "OPEN", s = (q) => {
2042
+ console.log(`Edit prediction for fixture at index: ${q}`);
2043
+ }, y = (d == null ? void 0 : d.contentColor) || i.textColor, v = { "--fu-ucrc-egs-ss-secondary": (d == null ? void 0 : d.secondaryColor) || i.textSecondary }, g = !!f && !!e.additionalCTA, b = () => /* @__PURE__ */ x(Q, { children: [
2044
+ e.isUnauthorized ? /* @__PURE__ */ t(
2045
+ Pn,
2046
+ {
2047
+ variant: "error",
2048
+ title: c("common.authentication.accessRequired"),
2049
+ message: c("common.authentication.invalidOrMissingAuth")
2050
+ }
2051
+ ) : /* @__PURE__ */ t("div", { css: o ? we.areaMobile : we.area, children: /* @__PURE__ */ t("div", { css: o ? we.questionMobile : we.question, children: /* @__PURE__ */ t("div", { css: we.content, children: a ? /* @__PURE__ */ t(
2052
+ Ke,
2053
+ {
2054
+ fixtures: e.eventGame.fixtures,
2055
+ prediction: e.prediction,
2056
+ onEditPrediction: s,
2057
+ onPredictionUpdate: e.onPredictionUpdate,
2058
+ play: e.play,
2059
+ view: "score",
2060
+ brandingPrimaryColor: d == null ? void 0 : d.primaryColor
2061
+ }
2062
+ ) : null }) }) }),
2063
+ e.chanceGameContent && /* @__PURE__ */ t("div", { css: we.chanceGame, children: e.chanceGameContent }),
2064
+ (f || e.additionalCTA) && /* @__PURE__ */ x(
2065
+ "div",
2066
+ {
2067
+ css: o ? g ? we.footerSpreadMobile : we.footerMobile : g ? we.footerSpread : we.footer,
2068
+ style: v,
2069
+ children: [
2070
+ /* @__PURE__ */ t(
2071
+ he,
2072
+ {
2073
+ brandingLogo: f,
2074
+ textColor: y,
2075
+ label: null
2076
+ }
2077
+ ),
2078
+ /* @__PURE__ */ t(
2079
+ $t,
2080
+ {
2081
+ additionalCTA: e.additionalCTA,
2082
+ css: o ? we.additionalCtaMobile : we.additionalCta
2083
+ }
2084
+ )
2085
+ ]
2086
+ }
2087
+ )
2088
+ ] });
2089
+ return /* @__PURE__ */ t(De, { brandingBorderColor: (d == null ? void 0 : d.borderColor) || null, children: /* @__PURE__ */ t(
2090
+ Oi,
2091
+ {
2092
+ entity: { ...e.eventGame, labels: null },
2093
+ headline: c("eventGame.headline"),
2094
+ finalImage: r,
2095
+ imagePosition: l,
2096
+ rulesDisplay: e.rulesDisplay,
2097
+ children: b()
2098
+ }
2099
+ ) });
2100
+ }, ai = "var(--fu-ucrc-secondary-container)", ci = (e) => n(pe, {
2101
+ display: "flex",
2102
+ paddingBlock: u(e ? "xs" : "sm"),
2103
+ paddingInline: u(e ? "sm" : "md"),
2104
+ flexDirection: "row",
2105
+ justifyContent: "center",
2106
+ alignItems: "center",
2107
+ gap: "8px",
2108
+ borderRadius: "var(--fu-ucrc-radius-xl)",
2109
+ backgroundColor: ai,
2110
+ border: `var(--fu-ucrc-border-size) solid ${ai}`,
2111
+ color: "#fff",
2112
+ "&:hover": { opacity: 0.9 },
2113
+ fontSize: e ? "0.75em" : "0.8125em",
2114
+ textTransform: "uppercase",
2115
+ "& > div": { display: "flex", justifyContent: "center", alignItems: "center", gap: "8px" },
2116
+ "& p": {
2117
+ margin: 0,
2118
+ color: "var(--fu-ucrc-eg-split-secondary)",
2119
+ fontFamily: "var(--fu-ucrc-font-primary)",
2120
+ fontSize: `calc(1em / ${e ? 0.75 : 0.8125})`,
2121
+ fontStyle: "normal",
2122
+ fontWeight: 500,
2123
+ lineHeight: "22px",
2124
+ letterSpacing: "0.46px",
2125
+ textTransform: "uppercase"
2126
+ }
2127
+ }), li = { display: "flex", justifyContent: "center", alignItems: "center" }, si = { display: "flex", flexDirection: "column", justifyContent: "center" }, Ne = {
2128
+ questionAreaContent: n({
2129
+ padding: u("lg"),
2130
+ display: "flex",
2131
+ flexDirection: "column",
2132
+ justifyContent: "center",
2133
+ gap: u("lg"),
2134
+ flex: 1,
2135
+ height: "100%"
2136
+ }),
2137
+ // Translucent panel, from the branding background.
2138
+ panel: n({
2139
+ padding: u("lg"),
2140
+ gap: u("lg"),
2141
+ display: "flex",
2142
+ flexDirection: "column",
2143
+ backdropFilter: "blur(4px)",
2144
+ backgroundColor: "var(--fu-ucrc-eg-split-bg)",
2145
+ borderRadius: "var(--fu-ucrc-radius-sm)",
2146
+ position: "relative",
2147
+ overflow: "visible"
2148
+ }),
2149
+ ctaWrapper: {
2150
+ mobile: n(li, { padding: u("sm") }),
2151
+ desktop: n(li, { padding: u("md") })
2152
+ },
2153
+ additional: { mobile: ci(!0), desktop: ci(!1) },
2154
+ alertArea: {
2155
+ stacked: n(si, { flex: 1, width: "100%", minWidth: "100%", maxWidth: "100%" }),
2156
+ side: n(si, { flex: "0 0 50%", width: "50%", minWidth: "50%", maxWidth: "50%" })
2157
+ },
2158
+ alertWrapper: n({ padding: u("lg") })
2159
+ }, Cr = (e) => {
2160
+ var S, T, R, D, z, q, Y, k, A, L, O, le, se, ce, me;
2161
+ const { t: i } = ie(), o = Pe(), r = oe(), c = Hi(), f = be(), d = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : r ? qe : _e, l = Me(
2162
+ {
2163
+ images: e.eventGame.images,
2164
+ imagePlaceholder: d
2165
+ },
2166
+ de.SPLIT
2167
+ ), a = r ? ((T = (S = e.eventGame.branding) == null ? void 0 : S.images) == null ? void 0 : T.mobileLogo) || ((D = (R = e.eventGame.branding) == null ? void 0 : R.images) == null ? void 0 : D.mainLogo) || "" : ((q = (z = e.eventGame.branding) == null ? void 0 : z.images) == null ? void 0 : q.mainLogo) || "", s = ((Y = e.eventGame.branding) == null ? void 0 : Y.colors) || null, y = (s == null ? void 0 : s.backgroundColor) || o.surfaceVariant, h = (s == null ? void 0 : s.contentColor) || o.textColor, v = {
2168
+ "--fu-ucrc-eg-split-bg": `rgba(${y ? xt(y || "").replace(/[^\d,]/g, "") : ""}, 0.5)`,
2169
+ "--fu-ucrc-eg-split-secondary": (s == null ? void 0 : s.secondaryColor) || o.textSecondary
2170
+ }, g = e.eventGame.status === "OPEN" && e.prediction && e.onPredictionUpdate, b = (j) => {
2171
+ console.log(`Edit prediction for fixture at index: ${j}`);
2172
+ }, p = c ? null : /* @__PURE__ */ t(
2173
+ he,
2174
+ {
2175
+ brandingLogo: a,
2176
+ textColor: (s == null ? void 0 : s.contentColor) || f.colorSchemes.dark.textColor,
2177
+ label: null,
2178
+ primaryUrl: (A = (k = e.eventGame.branding) == null ? void 0 : k.urls) == null ? void 0 : A.primaryUrl,
2179
+ secondaryUrl: (O = (L = e.eventGame.branding) == null ? void 0 : L.urls) == null ? void 0 : O.secondaryUrl
2180
+ }
2181
+ ), C = r ? "mobile" : "desktop";
2182
+ return /* @__PURE__ */ t(De, { brandingBorderColor: (s == null ? void 0 : s.borderColor) || null, children: /* @__PURE__ */ t(
2183
+ go,
2184
+ {
2185
+ entity: { ...e.eventGame, labels: null },
2186
+ headline: i("eventGame.headline"),
2187
+ finalImage: l,
2188
+ brandingContent: p,
2189
+ isTabulated: !1,
2190
+ alwaysShowImage: !0,
2191
+ rulesDisplay: e.rulesDisplay,
2192
+ children: e.isUnauthorized ? /* @__PURE__ */ t("div", { css: r ? Ne.alertArea.stacked : Ne.alertArea.side, children: /* @__PURE__ */ t("div", { css: Ne.alertWrapper, children: /* @__PURE__ */ t(
2193
+ Pn,
2194
+ {
2195
+ variant: "error",
2196
+ title: i("common.authentication.accessRequired"),
2197
+ message: i("common.authentication.invalidOrMissingAuth")
2198
+ }
2199
+ ) }) }) : /* @__PURE__ */ x("div", { css: Ne.questionAreaContent, style: v, children: [
2200
+ /* @__PURE__ */ t("div", { css: Ne.panel, children: g ? /* @__PURE__ */ t(
2201
+ Ke,
2202
+ {
2203
+ fixtures: e.eventGame.fixtures,
2204
+ prediction: e.prediction,
2205
+ onEditPrediction: b,
2206
+ onPredictionUpdate: e.onPredictionUpdate,
2207
+ play: e.play,
2208
+ view: "score",
2209
+ isSplitVariant: !0,
2210
+ brandingPrimaryColor: s == null ? void 0 : s.primaryColor
2211
+ }
2212
+ ) : null }),
2213
+ e.additionalCTA && /* @__PURE__ */ t("div", { css: Ne.ctaWrapper[C], children: /* @__PURE__ */ t($t, { additionalCTA: e.additionalCTA, css: Ne.additional[C] }) }),
2214
+ e.chanceGameContent,
2215
+ c && /* @__PURE__ */ t(
2216
+ he,
2217
+ {
2218
+ brandingLogo: a,
2219
+ textColor: h,
2220
+ label: null,
2221
+ primaryUrl: (se = (le = e.eventGame.branding) == null ? void 0 : le.urls) == null ? void 0 : se.primaryUrl,
2222
+ secondaryUrl: (me = (ce = e.eventGame.branding) == null ? void 0 : ce.urls) == null ? void 0 : me.secondaryUrl
2223
+ }
2224
+ )
2225
+ ] })
2226
+ }
2227
+ ) });
2228
+ }, Sr = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_929_1048'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%3e%3crect%20width='24'%20height='24'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_929_1048)'%3e%3cpath%20d='M12%2020.6254L5.20005%2016.9254V11.1254L1.36255%209.01289L12%203.21289L22.65%209.01464V16.7504H20.775V10.0504L18.8%2011.1254V16.9254L12%2020.6254ZM12%2012.6754L18.75%209.01289L12%205.36289L5.26255%209.01289L12%2012.6754ZM12%2018.4879L16.925%2015.8296V12.1129L12%2014.8254L7.07505%2012.1129V15.8296L12%2018.4879Z'%20fill='%23212121'/%3e%3c/g%3e%3c/svg%3e", kr = "data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_929_504'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='25'%20height='24'%3e%3crect%20x='0.5'%20width='24'%20height='24'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_929_504)'%3e%3cpath%20d='M9.6875%206H11.5625V4.125H9.6875V6ZM13.4375%206V4.125H15.3125V6H13.4375ZM9.6875%2013.5V11.625H11.5625V13.5H9.6875ZM17.1875%209.75V7.875H19.0625V9.75H17.1875ZM17.1875%2013.5V11.625H19.0625V13.5H17.1875ZM13.4375%2013.5V11.625H15.3125V13.5H13.4375ZM17.1875%206V4.125H19.0625V6H17.1875ZM11.5625%207.875V6H13.4375V7.875H11.5625ZM5.9375%2019.825V4.125H7.8125V6H9.6875V7.875H7.8125V9.75H9.6875V11.625H7.8125V19.825H5.9375ZM15.3125%2011.625V9.75H17.1875V11.625H15.3125ZM11.5625%2011.625V9.75H13.4375V11.625H11.5625ZM9.6875%209.75V7.875H11.5625V9.75H9.6875ZM13.4375%209.75V7.875H15.3125V9.75H13.4375ZM15.3125%207.875V6H17.1875V7.875H15.3125Z'%20fill='%23212121'/%3e%3c/g%3e%3c/svg%3e", Zt = (e) => typeof e == "number" ? `${e * 8}px` : e, wr = (e = {}) => {
2229
+ const i = {};
2230
+ e.display !== void 0 && (i.display = e.display), e.flexDirection !== void 0 && (i.flexDirection = e.flexDirection);
2231
+ const o = e.pt ?? e.py ?? e.p, r = e.pb ?? e.py ?? e.p, c = e.px ?? e.p;
2232
+ return o !== void 0 && (i.paddingTop = Zt(o)), r !== void 0 && (i.paddingBottom = Zt(r)), c !== void 0 && (i.paddingInline = Zt(c)), i;
2233
+ }, Ge = (e) => `var(--fu-ucrc-eg-fgw-${e})`, st = Ge("text-primary"), di = Ge("text-secondary"), _i = Ge("outline"), Yi = Ge("chip-bg"), Dt = "var(--fu-ucrc-font-primary)", fn = "var(--fu-ucrc-font-secondary)", Et = "var(--fu-ucrc-radius-md)", Ie = (e) => `var(--fu-ucrc-space-${e})`, ui = {
2234
+ boxSizing: "border-box",
2235
+ position: "relative",
2236
+ display: "flex",
2237
+ flexDirection: "column",
2238
+ justifyContent: "center",
2239
+ alignItems: "center",
2240
+ alignSelf: "stretch",
2241
+ flex: "1 1 0%",
2242
+ gap: "6px",
2243
+ minWidth: 0,
2244
+ minHeight: "36px",
2245
+ margin: 0,
2246
+ padding: "4px 16px",
2247
+ font: "inherit",
2248
+ textAlign: "initial",
2249
+ textDecoration: "none",
2250
+ color: "var(--fu-ucrc-neutral-plain-color)",
2251
+ backgroundColor: "transparent",
2252
+ border: "1px solid transparent",
2253
+ borderBottomColor: Ge("tab-line"),
2254
+ borderRadius: 0,
2255
+ opacity: 0.6,
2256
+ cursor: "pointer",
2257
+ WebkitTapHighlightColor: "transparent",
2258
+ "&:focus-visible": { outline: "2px solid var(--fu-ucrc-focus-visible)", outlineOffset: "2px", zIndex: 1 }
2259
+ }, fi = {
2260
+ display: "flex",
2261
+ width: "24px",
2262
+ height: "24px",
2263
+ justifyContent: "center",
2264
+ alignItems: "center"
2265
+ }, Kt = { ...ae, fontFamily: fn, fontSize: "1em", fontStyle: "normal", lineHeight: "20px", letterSpacing: "0.15px" }, mi = {
2266
+ display: "flex",
2267
+ alignItems: "center",
2268
+ gap: Ie("xs"),
2269
+ padding: "2px 6px",
2270
+ minHeight: "20px",
2271
+ borderRadius: Et,
2272
+ border: `1px solid ${_i}`,
2273
+ backgroundColor: Yi,
2274
+ width: "fit-content"
2275
+ }, gi = {
2276
+ ...ae,
2277
+ fontFamily: Dt,
2278
+ fontWeight: 500,
2279
+ color: st,
2280
+ unicodeBidi: "plaintext"
2281
+ }, F = {
2282
+ root: n({ width: "100%" }),
2283
+ // Joy's Tabs: body font, 1.5 line height and the neutral colour the panels inherit.
2284
+ tabs: n({
2285
+ position: "relative",
2286
+ display: "flex",
2287
+ flexDirection: "column",
2288
+ width: "100%",
2289
+ fontFamily: Te,
2290
+ fontSize: "1em",
2291
+ lineHeight: 1.5,
2292
+ color: "var(--fu-ucrc-neutral-plain-color)",
2293
+ borderRadius: Et,
2294
+ backgroundColor: "transparent"
2295
+ }),
2296
+ list: n({
2297
+ position: "relative",
2298
+ zIndex: 1,
2299
+ boxSizing: "border-box",
2300
+ display: "flex",
2301
+ flexDirection: "row",
2302
+ margin: 0,
2303
+ padding: "0 0 1px",
2304
+ // Joy's divider: the neutral channel at 20% (16% in dark mode).
2305
+ boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.2)",
2306
+ ".dark &": { boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.16)" }
2307
+ }),
2308
+ // Joy's unselected hover rule out-ranks a plain :hover; the old sx matched it.
2309
+ tabOff: n(ui, {
2310
+ "&:hover": { backgroundColor: Ge("tint"), color: "var(--fu-ucrc-neutral-plain-hover-color)" },
2311
+ "&:active": { backgroundColor: "var(--fu-ucrc-neutral-plain-active-bg)" }
2312
+ }),
2313
+ tabOn: n(ui, {
2314
+ backgroundColor: Ge("tint"),
2315
+ borderBottom: `3px solid ${Ge("primary")}`,
2316
+ opacity: 1,
2317
+ marginBottom: "-1px"
2318
+ }),
2319
+ tabInner: n({
2320
+ display: "flex",
2321
+ padding: "12px 16px",
2322
+ justifyContent: "center",
2323
+ alignItems: "center",
2324
+ gap: "8px",
2325
+ width: "100%"
2326
+ }),
2327
+ tabIcon: n(fi),
2328
+ tabIconInverted: n(fi, { filter: "brightness(0) invert(1)" }),
2329
+ tabLabel: n({
2330
+ ...ae,
2331
+ color: di,
2332
+ fontFamily: Dt,
2333
+ fontSize: "1em",
2334
+ fontStyle: "normal",
2335
+ fontWeight: 500,
2336
+ lineHeight: "24px",
2337
+ letterSpacing: "0.4px",
2338
+ textTransform: "uppercase"
2339
+ }),
2340
+ // Joy's TabPanel: 16px padding, hidden with display none unless the sx set a display.
2341
+ panel: n({
2342
+ flexGrow: 1,
2343
+ padding: "16px",
2344
+ fontFamily: Te,
2345
+ lineHeight: 1.5,
2346
+ color: "var(--fu-ucrc-neutral-plain-color)"
2347
+ }),
2348
+ panelHidden: n({
2349
+ display: "none",
2350
+ flexGrow: 1,
2351
+ padding: "16px",
2352
+ fontFamily: Te,
2353
+ lineHeight: 1.5,
2354
+ color: "var(--fu-ucrc-neutral-plain-color)"
2355
+ }),
2356
+ list2: n({
2357
+ display: "flex",
2358
+ flexDirection: "column",
2359
+ justifyContent: "center",
2360
+ alignItems: "center",
2361
+ gap: "16px",
2362
+ alignSelf: "stretch"
2363
+ }),
2364
+ card: n({
2365
+ borderRadius: Et,
2366
+ padding: Ie("md"),
2367
+ display: "flex",
2368
+ flexDirection: "column",
2369
+ alignItems: "center",
2370
+ alignSelf: "stretch",
2371
+ gap: Ie("md"),
2372
+ backdropFilter: "blur(4px)",
2373
+ position: "relative",
2374
+ "&::before": {
2375
+ content: '""',
2376
+ position: "absolute",
2377
+ top: 0,
2378
+ left: 0,
2379
+ right: 0,
2380
+ bottom: 0,
2381
+ backgroundColor: Ge("content-bg"),
2382
+ opacity: 0.5,
2383
+ borderRadius: "inherit",
2384
+ zIndex: 0,
2385
+ backdropFilter: "blur(4px)"
2386
+ },
2387
+ "& > *": { position: "relative", zIndex: 1 }
2388
+ }),
2389
+ single: n({ display: "flex", flexDirection: "column", alignItems: "flex-start", gap: "12px", alignSelf: "stretch" }),
2390
+ fixtureRow: n({ display: "flex", justifyContent: "space-between", alignItems: "center", alignSelf: "stretch" }),
2391
+ fixtureTitle: n({
2392
+ ...ae,
2393
+ color: st,
2394
+ fontFamily: Dt,
2395
+ fontSize: "1.25em",
2396
+ fontStyle: "normal",
2397
+ fontWeight: 500,
2398
+ lineHeight: "120%",
2399
+ letterSpacing: "0.15px",
2400
+ flex: 1,
2401
+ unicodeBidi: "plaintext"
2402
+ }),
2403
+ pointsBadge: n({
2404
+ display: "flex",
2405
+ alignItems: "center",
2406
+ gap: Ie("xs"),
2407
+ padding: `${Ie("xs")} ${Ie("sm")}`,
2408
+ borderRadius: Et,
2409
+ backgroundColor: Yi
2410
+ }),
2411
+ pointsText: n({ ...ae, color: st, fontFamily: fn, fontSize: "0.875em", fontWeight: 600 }),
2412
+ block: n({ alignSelf: "stretch", display: "flex", flexDirection: "column", gap: Ie("xs") }),
2413
+ row: n({ display: "flex", alignItems: "center", gap: Ie("xs") }),
2414
+ yourRight: n(Kt, { color: Ge("correct"), fontWeight: 700 }),
2415
+ yourWrong: n(Kt, { color: Ge("wrong"), fontWeight: 600 }),
2416
+ plainLabel: n(Kt, { color: st, fontWeight: 600 }),
2417
+ divider: n({ width: "100%", height: "1px", backgroundColor: _i }),
2418
+ earnedRow: n({ display: "flex", justifyContent: "flex-start", alignItems: "center", alignSelf: "stretch" }),
2419
+ chipPrediction: n(mi, { fontSize: "0.875em" }),
2420
+ chipResult: n(mi, { fontSize: "0.75em" }),
2421
+ chipText: n(gi, { fontSize: "0.875em" }),
2422
+ chipTextXs: n(gi, { fontSize: "0.75em" }),
2423
+ empty: n({
2424
+ display: "flex",
2425
+ flexDirection: "column",
2426
+ justifyContent: "center",
2427
+ alignItems: "center",
2428
+ gap: Ie("lg"),
2429
+ alignSelf: "stretch",
2430
+ minHeight: "200px",
2431
+ textAlign: "center",
2432
+ paddingBlock: Ie("xl")
2433
+ }),
2434
+ emptyInner: n({ display: "flex", flexDirection: "column", gap: Ie("xs"), alignItems: "center" }),
2435
+ emptyTitle: n({
2436
+ ...ae,
2437
+ color: st,
2438
+ fontFamily: Dt,
2439
+ fontSize: "1.25em",
2440
+ fontWeight: 600,
2441
+ lineHeight: "1.2"
2442
+ }),
2443
+ emptyDescription: n({
2444
+ ...ae,
2445
+ color: di,
2446
+ fontFamily: fn,
2447
+ fontSize: "1em",
2448
+ fontWeight: 400,
2449
+ lineHeight: "1.4"
2450
+ })
2451
+ }, In = ({
2452
+ prediction: e,
2453
+ game: i,
2454
+ resultsTabPanelSxProps: o,
2455
+ isOverlayVariant: r,
2456
+ children: c,
2457
+ brandingColors: f
2458
+ }) => {
2459
+ const [d, l] = N(0), [a, s] = N(0), y = Ae([]), h = vn(), v = eo(), g = be(), b = Pe(), { t: p } = ie(), C = oe(), S = ht(), T = g.colorSchemes.dark, R = r ? T : b, D = f != null && f.backgroundColor || r ? T.surfaceVariant : b.surfaceVariant, z = {
2460
+ "--fu-ucrc-eg-fgw-text-primary": R.textPrimary,
2461
+ "--fu-ucrc-eg-fgw-text-secondary": R.textSecondary,
2462
+ "--fu-ucrc-eg-fgw-tab-line": R.secondaryContainer,
2463
+ "--fu-ucrc-eg-fgw-content-bg": D,
2464
+ "--fu-ucrc-eg-fgw-outline": R.outlineEnabledBorder,
2465
+ "--fu-ucrc-eg-fgw-chip-bg": R.palette.neutral.softBg,
2466
+ "--fu-ucrc-eg-fgw-primary": (f == null ? void 0 : f.primaryColor) || R.textPrimary,
2467
+ "--fu-ucrc-eg-fgw-tint": r ? "#FAFAFA14" : "#2121210A",
2468
+ "--fu-ucrc-eg-fgw-correct": R.palette.success.plainColor,
2469
+ "--fu-ucrc-eg-fgw-wrong": R.palette.danger.plainColor
2470
+ }, q = (j, B) => B === H.BOOLEAN ? p(j === !0 ? "eventGame.fixtures.yes" : "eventGame.fixtures.no") : B === H.NUMBER || B === H.ENUM || B === H.FREE_INPUT ? j : null, Y = (j, B) => {
2471
+ const te = q(j, B);
2472
+ return te === null ? null : /* @__PURE__ */ t("div", { css: F.chipPrediction, children: /* @__PURE__ */ t("p", { css: F.chipText, children: te }) });
2473
+ }, k = (j, B) => {
2474
+ const te = q(j, B);
2475
+ return te === null ? null : /* @__PURE__ */ t("div", { css: F.chipResult, children: /* @__PURE__ */ t("p", { css: S ? F.chipTextXs : F.chipText, children: te }) });
2476
+ }, A = (j) => {
2477
+ var ye;
2478
+ const B = i.fixtures.find((xe) => xe.id === j), te = (ye = e == null ? void 0 : e.fixtures) == null ? void 0 : ye.find((xe) => xe.id === j);
2479
+ if (!B || !te) return null;
2480
+ const ue = te.correct === !0, fe = te.points, Ce = fe != null;
2481
+ return /* @__PURE__ */ t("div", { css: F.card, children: /* @__PURE__ */ x("div", { css: F.single, children: [
2482
+ /* @__PURE__ */ x("div", { css: F.fixtureRow, children: [
2483
+ /* @__PURE__ */ t("p", { css: F.fixtureTitle, children: B.question }),
2484
+ !S && Ce && /* @__PURE__ */ t("div", { css: F.pointsBadge, children: /* @__PURE__ */ x("p", { css: F.pointsText, children: [
2485
+ Xe(fe),
2486
+ " ",
2487
+ p("eventGame.points.pts")
2488
+ ] }) })
2489
+ ] }),
2490
+ /* @__PURE__ */ x("div", { css: F.block, children: [
2491
+ /* @__PURE__ */ x("div", { css: F.row, children: [
2492
+ /* @__PURE__ */ t("p", { css: ue ? F.yourRight : F.yourWrong, children: p("eventGame.yourPrediction") }),
2493
+ Y(te.prediction, B.outcomeType)
2494
+ ] }),
2495
+ !ue && B.outcome !== null && B.outcome !== void 0 && /* @__PURE__ */ x("div", { css: F.row, children: [
2496
+ /* @__PURE__ */ t("p", { css: F.plainLabel, children: p("eventGame.correctPrediction") }),
2497
+ k(B.outcome, B.outcomeType)
2498
+ ] })
2499
+ ] }),
2500
+ S && Ce && fe > 0 && /* @__PURE__ */ x(Q, { children: [
2501
+ /* @__PURE__ */ t("div", { css: F.divider }),
2502
+ /* @__PURE__ */ t("div", { css: F.earnedRow, children: /* @__PURE__ */ x("p", { css: F.plainLabel, children: [
2503
+ p("eventGame.earnedPoints"),
2504
+ ": ",
2505
+ fe
2506
+ ] }) })
2507
+ ] })
2508
+ ] }) }, `user-prediction-${j}`);
2509
+ }, L = (j) => {
2510
+ var te;
2511
+ const B = (j + 2) % 2;
2512
+ s(B), (te = y.current[B]) == null || te.focus();
2513
+ }, O = (j) => {
2514
+ const B = v ? "ArrowLeft" : "ArrowRight", te = v ? "ArrowRight" : "ArrowLeft", ue = { [B]: a + 1, [te]: a - 1, Home: 0, End: 1 }[j.key];
2515
+ ue !== void 0 && (j.preventDefault(), L(ue));
2516
+ }, le = r || g.mode == "dark", se = [
2517
+ { icon: kr, alt: "results-icon", label: p("eventGame.leaderboard.title") },
2518
+ { icon: Sr, alt: "predictions-icon", label: p("eventGame.predictions") }
2519
+ ], ce = {
2520
+ ...wr(o),
2521
+ fontSize: S ? "0.625em" : C ? "0.75em" : "1em",
2522
+ // Read by LeaderboardComponent to keep Joy's rem-sized table.
2523
+ "--fu-ucrc-eg-panel-scale": S ? 0.625 : C ? 0.75 : 1
2524
+ }, me = {
2525
+ overflowY: "auto",
2526
+ maxHeight: C ? "auto" : "450px",
2527
+ fontSize: S ? "0.75em" : "1em"
2528
+ };
2529
+ return /* @__PURE__ */ t("div", { css: F.root, style: z, children: /* @__PURE__ */ x("div", { css: F.tabs, children: [
2530
+ /* @__PURE__ */ t(
2531
+ "div",
2532
+ {
2533
+ role: "tablist",
2534
+ "aria-orientation": "horizontal",
2535
+ css: F.list,
2536
+ style: { fontSize: C ? "0.75em" : "1em" },
2537
+ onKeyDown: O,
2538
+ children: se.map((j, B) => /* @__PURE__ */ t(
2539
+ "button",
2540
+ {
2541
+ ref: (te) => {
2542
+ y.current[B] = te;
2543
+ },
2544
+ type: "button",
2545
+ role: "tab",
2546
+ id: `${h}-tab-${B}`,
2547
+ "aria-selected": B === d,
2548
+ "aria-controls": `${h}-panel-${B}`,
2549
+ tabIndex: B === a ? 0 : -1,
2550
+ css: B === d ? F.tabOn : F.tabOff,
2551
+ onFocus: () => s(B),
2552
+ onClick: () => {
2553
+ l(B), L(B);
2554
+ },
2555
+ children: /* @__PURE__ */ x("div", { css: F.tabInner, children: [
2556
+ /* @__PURE__ */ t("img", { src: j.icon, alt: j.alt, css: le ? F.tabIconInverted : F.tabIcon }),
2557
+ /* @__PURE__ */ t("p", { css: F.tabLabel, children: j.label })
2558
+ ] })
2559
+ },
2560
+ B
2561
+ ))
2562
+ }
2563
+ ),
2564
+ /* @__PURE__ */ t(
2565
+ "div",
2566
+ {
2567
+ role: "tabpanel",
2568
+ id: `${h}-panel-0`,
2569
+ "aria-labelledby": `${h}-tab-0`,
2570
+ hidden: d !== 0,
2571
+ css: d === 0 ? F.panel : F.panelHidden,
2572
+ style: ce,
2573
+ children: d === 0 && c
2574
+ }
2575
+ ),
2576
+ /* @__PURE__ */ t(
2577
+ "div",
2578
+ {
2579
+ role: "tabpanel",
2580
+ id: `${h}-panel-1`,
2581
+ "aria-labelledby": `${h}-tab-1`,
2582
+ hidden: d !== 1,
2583
+ css: d === 1 ? F.panel : F.panelHidden,
2584
+ style: me,
2585
+ children: d === 1 && /* @__PURE__ */ t("div", { css: F.list2, children: e != null && e.fixtures && e.fixtures.length > 0 ? i.fixtures.map((j) => A(j.id)) : /* @__PURE__ */ t("div", { css: F.empty, children: /* @__PURE__ */ x("div", { css: F.emptyInner, children: [
2586
+ /* @__PURE__ */ t("p", { css: F.emptyTitle, children: p("eventGame.noPredictions.title") }),
2587
+ /* @__PURE__ */ t("p", { css: F.emptyDescription, children: p("eventGame.noPredictions.description") })
2588
+ ] }) }) })
2589
+ }
2590
+ )
2591
+ ] }) });
2592
+ }, hi = (e) => e === null ? null : Xe(e), Gn = ({
2593
+ leaderboard: e,
2594
+ userRanking: i,
2595
+ brandingColors: o,
2596
+ showHeading: r,
2597
+ isSplitVariant: c,
2598
+ loading: f = !1
2599
+ }) => {
2600
+ const { t: d } = ie();
2601
+ return /* @__PURE__ */ t(
2602
+ ho,
2603
+ {
2604
+ rows: (e == null ? void 0 : e.map((l) => {
2605
+ var a, s, y;
2606
+ return {
2607
+ profileId: l.profileId,
2608
+ position: l.position,
2609
+ name: ((a = l.profileModel) == null ? void 0 : a.nickname) || ((s = l.profileModel) == null ? void 0 : s.name),
2610
+ avatar: (y = l.profileModel) == null ? void 0 : y.avatar,
2611
+ points: hi(l.totalPoints)
2612
+ };
2613
+ })) ?? null,
2614
+ user: i && { position: i.position, points: hi(i.totalPoints) },
2615
+ loading: f,
2616
+ spinnerMargin: "80px",
2617
+ labels: {
2618
+ title: d("eventGame.leaderboard.title"),
2619
+ position: d("eventGame.leaderboard.position"),
2620
+ name: d("eventGame.leaderboard.name"),
2621
+ points: d("eventGame.leaderboard.points"),
2622
+ you: d("eventGame.leaderboard.you"),
2623
+ empty: d("eventGame.leaderboard.noLeaderboardAvailable")
2624
+ },
2625
+ brandingColors: o,
2626
+ showHeading: r,
2627
+ isSplitVariant: c,
2628
+ panelScaleVar: "--fu-ucrc-eg-panel-scale",
2629
+ plainEmptyMessage: !0
2630
+ }
2631
+ );
2632
+ }, ot = (e) => `var(--fu-ucrc-neutral-${e})`, rt = (e) => `var(--fu-ucrc-eg-pg-${e})`, xi = {
2633
+ boxSizing: "border-box",
2634
+ position: "relative",
2635
+ display: "inline-flex",
2636
+ alignItems: "center",
2637
+ justifyContent: "center",
2638
+ minWidth: "32px",
2639
+ minHeight: "32px",
2640
+ margin: 0,
2641
+ padding: "0 4px",
2642
+ border: "none",
2643
+ borderRadius: "8px",
2644
+ font: "inherit",
2645
+ fontWeight: 400,
2646
+ lineHeight: "normal",
2647
+ textDecoration: "none",
2648
+ cursor: "pointer",
2649
+ WebkitTapHighlightColor: "transparent",
2650
+ backgroundColor: "transparent",
2651
+ color: ot("plain-color"),
2652
+ "&:focus-visible": { outline: "2px solid var(--fu-ucrc-focus-visible)", outlineOffset: "2px" },
2653
+ "@media (hover: hover)": {
2654
+ "&:hover": { backgroundColor: ot("plain-hover-bg"), color: ot("plain-hover-color") }
2655
+ },
2656
+ "&:active": { backgroundColor: ot("plain-active-bg") },
2657
+ "&:disabled": { pointerEvents: "none", cursor: "default", color: ot("plain-disabled-color") }
2658
+ }, Pr = {
2659
+ color: rt("text"),
2660
+ "&:hover": { backgroundColor: rt("solid-bg"), color: rt("text") },
2661
+ "&:active": { backgroundColor: rt("active-bg") },
2662
+ "&:disabled": { backgroundColor: "transparent", color: rt("disabled"), opacity: 0.5 }
2663
+ }, at = {
2664
+ root: n({ display: "flex", gap: "4px", alignItems: "center" }),
2665
+ plain: n(xi),
2666
+ overlay: n(xi, Pr)
2667
+ }, Tn = ({
2668
+ hasNextPage: e,
2669
+ hasPreviousPage: i,
2670
+ onNextPage: o,
2671
+ onPreviousPage: r,
2672
+ isOverlayVariant: c = !1,
2673
+ justifyContent: f = "flex-start"
2674
+ }) => {
2675
+ const l = be().colorSchemes.dark, a = {
2676
+ justifyContent: f,
2677
+ ...c && {
2678
+ "--fu-ucrc-eg-pg-text": l.textColor,
2679
+ "--fu-ucrc-eg-pg-disabled": l.textDisabled,
2680
+ "--fu-ucrc-eg-pg-solid-bg": l.palette.neutral.solidBg,
2681
+ "--fu-ucrc-eg-pg-active-bg": l.palette.neutral.plainActiveBg
2682
+ }
2683
+ };
2684
+ return /* @__PURE__ */ x("div", { css: at.root, style: a, children: [
2685
+ /* @__PURE__ */ t("button", { type: "button", css: c ? at.overlay : at.plain, onClick: r, disabled: !i, children: /* @__PURE__ */ t(Lt, { children: /* @__PURE__ */ t(zo, { size: 20 }) }) }),
2686
+ /* @__PURE__ */ t("button", { type: "button", css: c ? at.overlay : at.plain, onClick: o, disabled: !e, children: /* @__PURE__ */ t(Lt, { children: /* @__PURE__ */ t(Mo, { size: 20 }) }) })
2687
+ ] });
2688
+ }, Dn = (e, i) => {
2689
+ const [o, r] = N(
2690
+ null
2691
+ ), c = hn(), [f, d] = N(!1), [l, a] = N(!1), [s, y] = N(
2692
+ null
2693
+ ), [h, v] = N([]), [g, b] = N(null), [p, C] = N(!1), S = async (D = null, z) => {
2694
+ try {
2695
+ C(!0);
2696
+ const q = {
2697
+ limit: 10,
2698
+ ...D && { startAfter: D }
2699
+ }, Y = await i.eventGame.getRankings(e, q, c);
2700
+ if (Y.data.length === 0) {
2701
+ r([]), b(null);
2702
+ return;
2703
+ }
2704
+ const k = z !== void 0 ? z : h;
2705
+ r(Y.data), b({
2706
+ itemsPerPage: Y.meta.pagination.itemsPerPage,
2707
+ nextPageStartsAfter: Y.meta.pagination.nextPageStartsAfter,
2708
+ hasNextPage: Y.meta.pagination.nextPageStartsAfter !== null,
2709
+ hasPreviousPage: k.length > 0
2710
+ });
2711
+ } catch {
2712
+ a(!0);
2713
+ } finally {
2714
+ C(!1);
2715
+ }
2716
+ }, T = () => {
2717
+ if (g != null && g.nextPageStartsAfter) {
2718
+ const D = [
2719
+ ...h,
2720
+ s
2721
+ ];
2722
+ v(D), y(g.nextPageStartsAfter), S(g.nextPageStartsAfter, D);
2723
+ }
2724
+ }, R = () => {
2725
+ if (h.length > 0) {
2726
+ const D = [...h], z = D.pop() || null;
2727
+ v(D), y(z), S(z, D);
2728
+ }
2729
+ };
2730
+ return Be(() => (S(), () => {
2731
+ r(null), d(!1), a(!1), b(null), y(null), v([]);
2732
+ }), [e, i, c]), {
2733
+ rankings: o,
2734
+ pagination: g,
2735
+ loading: p,
2736
+ isUnauthorized: f,
2737
+ isApiError: l,
2738
+ setRankings: r,
2739
+ setIsUnauthorized: d,
2740
+ setIsApiError: a,
2741
+ goToNextPage: T,
2742
+ goToPreviousPage: R
2743
+ };
2744
+ }, Xi = "var(--fu-ucrc-eg-ofg-secondary)", vi = {
2745
+ display: "flex",
2746
+ flexDirection: "column",
2747
+ justifyContent: "space-between",
2748
+ gap: "40px",
2749
+ border: "var(--fu-ucrc-eg-ofg-border)",
2750
+ overflow: "hidden",
2751
+ backgroundImage: "var(--fu-ucrc-eg-ofg-image)",
2752
+ backgroundPosition: "center",
2753
+ backgroundSize: "cover",
2754
+ position: "relative",
2755
+ borderRadius: "var(--fu-ucrc-radius-md)",
2756
+ minHeight: "250px",
2757
+ "&::before": {
2758
+ content: '""',
2759
+ position: "absolute",
2760
+ background: "var(--fu-ucrc-eg-ofg-gradient)",
2761
+ top: 0,
2762
+ left: 0,
2763
+ right: 0,
2764
+ bottom: 0,
2765
+ borderRadius: "inherit",
2766
+ zIndex: 0
2767
+ }
2768
+ }, pi = { display: "flex", alignItems: "center", gap: u("3xs") }, yi = {
2769
+ ...ae,
2770
+ fontWeight: 500,
2771
+ lineHeight: "166%",
2772
+ letterSpacing: "1px",
2773
+ color: Xi,
2774
+ opacity: "70%",
2775
+ textTransform: "uppercase",
2776
+ fontFamily: "var(--fu-ucrc-font-secondary)",
2777
+ fontSize: "0.75em"
2778
+ }, bi = {
2779
+ ...cn,
2780
+ fontWeight: 700,
2781
+ lineHeight: "133%",
2782
+ letterSpacing: "0px",
2783
+ fontSize: "1.5em",
2784
+ color: "var(--fu-ucrc-eg-ofg-title)",
2785
+ fontFamily: "var(--fu-ucrc-font-primary)",
2786
+ unicodeBidi: "plaintext"
2787
+ }, Ci = {
2788
+ ...ae,
2789
+ fontWeight: 400,
2790
+ lineHeight: "140%",
2791
+ letterSpacing: "0.15px",
2792
+ fontSize: "1.25em",
2793
+ color: Xi,
2794
+ opacity: "70%",
2795
+ fontFamily: "var(--fu-ucrc-font-primary)",
2796
+ unicodeBidi: "plaintext"
2797
+ }, ge = {
2798
+ card: n(vi, { padding: u("xl") }),
2799
+ // The tab panel pads this one.
2800
+ cardWithDetails: n(vi),
2801
+ main: n({ display: "flex", flexDirection: "column", gap: u("md") }),
2802
+ headlineSection: n({ display: "flex", justifyContent: "space-between", flex: "1 0 0", alignSelf: "stretch" }),
2803
+ headlineContent: n({
2804
+ display: "flex",
2805
+ flexDirection: "column",
2806
+ alignItems: "flex-start",
2807
+ flex: "1 0 0",
2808
+ gap: u("md")
2809
+ }),
2810
+ headlineInner: n({ zIndex: 10 }),
2811
+ kickerRow: n(pi, { justifyContent: "flex-start" }),
2812
+ kickerRowMobile: n(pi, { justifyContent: "center" }),
2813
+ kicker: n(yi, { textAlign: "left" }),
2814
+ kickerMobile: n(yi, { textAlign: "center" }),
2815
+ texts: n({ display: "flex", flexDirection: "column", gap: u("3xs") }),
2816
+ title: n(bi, { textAlign: "left" }),
2817
+ titleMobile: n(bi, { textAlign: "center" }),
2818
+ description: n(Ci, { textAlign: "left" }),
2819
+ descriptionMobile: n(Ci, { textAlign: "center" }),
2820
+ section: n({ display: "flex", flexDirection: "column", gap: u("md") }),
2821
+ // A blurred panel over the artwork; the tint is already half transparent, then halved again.
2822
+ backdrop: n({
2823
+ borderRadius: "var(--fu-ucrc-radius-md)",
2824
+ padding: u("md"),
2825
+ display: "flex",
2826
+ flexDirection: "column",
2827
+ gap: u("md"),
2828
+ backdropFilter: "blur(4px)",
2829
+ position: "relative",
2830
+ "&::before": {
2831
+ content: '""',
2832
+ position: "absolute",
2833
+ top: 0,
2834
+ left: 0,
2835
+ right: 0,
2836
+ bottom: 0,
2837
+ backgroundColor: "var(--fu-ucrc-eg-ofg-bg)",
2838
+ opacity: 0.5,
2839
+ borderRadius: "inherit",
2840
+ zIndex: 0
2841
+ },
2842
+ "& > *": { position: "relative", zIndex: 1 }
2843
+ })
2844
+ }, Ir = (e) => {
2845
+ const i = to(), o = be(), r = Pe(), c = no().size, { t: f } = ie(), d = oe(), l = Mt(
2846
+ de.OVERLAY
2847
+ ), { brandingImage: a, brandingColors: s, brandingLogo: y } = Ft(e.game.branding || null), h = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : d ? qe : _e, v = Me(
2848
+ { images: e.game.images, imagePlaceholder: h },
2849
+ de.OVERLAY
2850
+ ), b = {
2851
+ "--fu-ucrc-eg-ofg-image": `url("${a || v}")`,
2852
+ "--fu-ucrc-eg-ofg-gradient": l,
2853
+ "--fu-ucrc-eg-ofg-border": s != null && s.borderColor ? `${c} solid ${s.borderColor}` : "none",
2854
+ "--fu-ucrc-eg-ofg-secondary": (s == null ? void 0 : s.secondaryColor) || r.textColor,
2855
+ "--fu-ucrc-eg-ofg-title": o.colorSchemes.dark.textColor,
2856
+ "--fu-ucrc-eg-ofg-bg": `rgba(${xt((s == null ? void 0 : s.backgroundColor) || r.surfaceVariant)}, 0.5)`
2857
+ }, { rankings: p, pagination: C, loading: S, goToNextPage: T, goToPreviousPage: R } = Dn(e.game.id, e.sdk), D = () => /* @__PURE__ */ x("div", { css: ge.main, children: [
2858
+ /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t("div", { css: ge.headlineSection, children: /* @__PURE__ */ t("div", { css: ge.headlineContent, children: /* @__PURE__ */ x("div", { css: ge.headlineInner, children: [
2859
+ /* @__PURE__ */ x("div", { css: d ? ge.kickerRowMobile : ge.kickerRow, children: [
2860
+ /* @__PURE__ */ t("p", { css: d ? ge.kickerMobile : ge.kicker, children: f("eventGame.headline") }),
2861
+ /* @__PURE__ */ t(
2862
+ Bt,
2863
+ {
2864
+ rules: e.game.rules || "",
2865
+ rulesDisplay: e.rulesDisplay,
2866
+ isOverlayVariant: !0
2867
+ }
2868
+ )
2869
+ ] }),
2870
+ /* @__PURE__ */ x("div", { css: ge.texts, children: [
2871
+ /* @__PURE__ */ t("h4", { css: d ? ge.titleMobile : ge.title, children: e.game.title }),
2872
+ e.game.description && /* @__PURE__ */ t("p", { css: d ? ge.descriptionMobile : ge.description, children: dt(e.game.description) })
2873
+ ] })
2874
+ ] }) }) }) }),
2875
+ /* @__PURE__ */ x("div", { css: ge.section, children: [
2876
+ /* @__PURE__ */ x("div", { css: ge.backdrop, children: [
2877
+ /* @__PURE__ */ t(
2878
+ Gn,
2879
+ {
2880
+ leaderboard: p,
2881
+ userRanking: e.prediction,
2882
+ brandingColors: s,
2883
+ showHeading: !e.showPredictionDetails,
2884
+ isSplitVariant: !1,
2885
+ loading: S
2886
+ }
2887
+ ),
2888
+ C && (C.hasNextPage || C.hasPreviousPage) && /* @__PURE__ */ t(
2889
+ Tn,
2890
+ {
2891
+ hasNextPage: C.hasNextPage,
2892
+ hasPreviousPage: C.hasPreviousPage,
2893
+ onNextPage: T,
2894
+ onPreviousPage: R,
2895
+ isOverlayVariant: !0,
2896
+ justifyContent: "flex-end"
2897
+ }
2898
+ )
2899
+ ] }),
2900
+ /* @__PURE__ */ t(
2901
+ he,
2902
+ {
2903
+ brandingLogo: y,
2904
+ textColor: o.colorSchemes.dark.textColor,
2905
+ label: null
2906
+ }
2907
+ )
2908
+ ] })
2909
+ ] });
2910
+ return e.showPredictionDetails ? /* @__PURE__ */ t("div", { css: ge.cardWithDetails, style: b, children: /* @__PURE__ */ t(
2911
+ In,
2912
+ {
2913
+ prediction: e.prediction,
2914
+ game: e.game,
2915
+ isOverlayVariant: !0,
2916
+ brandingColors: s,
2917
+ resultsTabPanelSxProps: {
2918
+ py: i.lg,
2919
+ px: i.xl
2920
+ },
2921
+ children: D()
2922
+ }
2923
+ ) }) : /* @__PURE__ */ t("div", { css: ge.card, style: b, children: D() });
2924
+ }, Gr = () => {
2925
+ const { t: e } = ie();
2926
+ return /* @__PURE__ */ t(De, { brandingBorderColor: null, children: /* @__PURE__ */ t(xo, { title: e("eventGame.eventGameNotFound"), message: e("eventGame.eventGameNotFoundDescription") }) });
2927
+ }, Tr = (e) => {
2928
+ var f, d, l, a, s, y, h;
2929
+ const { t: i } = ie(), o = oe(), r = ((f = e.eventGame.branding) == null ? void 0 : f.colors) || null, c = o ? ((l = (d = e.eventGame.branding) == null ? void 0 : d.images) == null ? void 0 : l.mobileLogo) || ((s = (a = e.eventGame.branding) == null ? void 0 : a.images) == null ? void 0 : s.mainLogo) || "" : ((h = (y = e.eventGame.branding) == null ? void 0 : y.images) == null ? void 0 : h.mainLogo) || "";
2930
+ return /* @__PURE__ */ t(De, { brandingBorderColor: (r == null ? void 0 : r.borderColor) || null, children: /* @__PURE__ */ t(
2931
+ vo,
2932
+ {
2933
+ entity: { ...e.eventGame, labels: null },
2934
+ headline: i("eventGame.headline"),
2935
+ tryAgainButtonText: i("eventGame.buttons.tryAgain"),
2936
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2937
+ imagePosition: e.imagePosition || "left",
2938
+ isApiError: e.isApiError,
2939
+ apiErrorMessage: e.apiErrorMessage,
2940
+ toggleTryAgain: e.toggleTryAgain,
2941
+ renderPresentedBy: (v) => /* @__PURE__ */ t(
2942
+ he,
2943
+ {
2944
+ brandingLogo: c,
2945
+ textColor: v,
2946
+ label: null
2947
+ }
2948
+ )
2949
+ }
2950
+ ) });
2951
+ }, Dr = (e) => {
2952
+ var f, d, l, a, s, y, h;
2953
+ const { t: i } = ie(), o = oe(), r = ((f = e.eventGame.branding) == null ? void 0 : f.colors) || null, c = o ? ((l = (d = e.eventGame.branding) == null ? void 0 : d.images) == null ? void 0 : l.mobileLogo) || ((s = (a = e.eventGame.branding) == null ? void 0 : a.images) == null ? void 0 : s.mainLogo) || "" : ((h = (y = e.eventGame.branding) == null ? void 0 : y.images) == null ? void 0 : h.mainLogo) || "";
2954
+ return /* @__PURE__ */ t(De, { brandingBorderColor: (r == null ? void 0 : r.borderColor) || null, children: /* @__PURE__ */ t(
2955
+ po,
2956
+ {
2957
+ entity: { ...e.eventGame, labels: null },
2958
+ headline: i("eventGame.headline"),
2959
+ tryAgainButtonText: i("eventGame.buttons.tryAgain"),
2960
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2961
+ isApiError: e.isApiError,
2962
+ apiErrorMessage: e.apiErrorMessage,
2963
+ toggleTryAgain: e.toggleTryAgain,
2964
+ renderPresentedBy: (v) => /* @__PURE__ */ t(
2965
+ he,
2966
+ {
2967
+ brandingLogo: c,
2968
+ textColor: v,
2969
+ label: null
2970
+ }
2971
+ )
2972
+ }
2973
+ ) });
2974
+ }, Er = (e) => {
2975
+ const { t: i } = ie(), o = oe(), { brandingLogo: r } = Ft(
2976
+ e.eventGame.branding || null
2977
+ ), c = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : o ? qe : _e;
2978
+ return /* @__PURE__ */ t(
2979
+ yo,
2980
+ {
2981
+ entity: { ...e.eventGame, labels: null },
2982
+ headline: i("eventGame.headline"),
2983
+ tryAgainButtonText: i("eventGame.buttons.tryAgain"),
2984
+ defaultImagePlaceholderUrl: c,
2985
+ isApiError: e.isApiError,
2986
+ toggleTryAgain: e.toggleTryAgain,
2987
+ apiErrorMessage: e.apiErrorMessage,
2988
+ renderPresentedBy: (f) => /* @__PURE__ */ t(
2989
+ he,
2990
+ {
2991
+ brandingLogo: r,
2992
+ textColor: f,
2993
+ label: null
2994
+ }
2995
+ )
2996
+ }
2997
+ );
2998
+ }, je = (e) => `var(--fu-ucrc-egs-fg-${e})`, Si = je("text"), It = je("secondary"), Rr = je("image-text"), ki = je("image-secondary"), Re = { display: "flex", flexDirection: "column" }, Jt = {
2999
+ ...ae,
3000
+ fontWeight: 500,
3001
+ lineHeight: "166%",
3002
+ letterSpacing: "1px",
3003
+ fontSize: "0.75em",
3004
+ textTransform: "uppercase",
3005
+ fontFamily: "var(--fu-ucrc-font-secondary)"
3006
+ }, Qt = {
3007
+ fontWeight: 700,
3008
+ lineHeight: "133%",
3009
+ fontSize: "1.5em",
3010
+ fontFamily: "var(--fu-ucrc-font-primary)",
3011
+ unicodeBidi: "plaintext"
3012
+ }, en = {
3013
+ ...ae,
3014
+ fontWeight: 400,
3015
+ lineHeight: "140%",
3016
+ letterSpacing: "0.15px",
3017
+ fontSize: "1.25em",
3018
+ fontFamily: "var(--fu-ucrc-font-primary)",
3019
+ unicodeBidi: "plaintext"
3020
+ }, wi = {
3021
+ flex: "0.3",
3022
+ overflow: "hidden",
3023
+ height: "auto",
3024
+ position: "relative",
3025
+ minHeight: "auto",
3026
+ backgroundImage: je("image"),
3027
+ backgroundSize: "cover",
3028
+ backgroundPosition: "center center",
3029
+ backgroundRepeat: "no-repeat",
3030
+ alignItems: "center",
3031
+ justifyContent: "center"
3032
+ }, tn = { ...Re, flex: "1" }, ct = { display: "flex", alignItems: "center", gap: u("sm") }, Pi = { display: "flex", alignItems: "center", gap: u("3xs") }, V = {
3033
+ main: n({ ...tn, padding: u("md"), gap: u("md") }),
3034
+ mainImage: n({ ...tn, flex: "0.7", padding: u("md"), gap: u("md") }),
3035
+ mainMobile: n({ ...tn, padding: u("sm"), gap: u("sm") }),
3036
+ desktopHeadline: n({
3037
+ display: "flex",
3038
+ flexDirection: "column",
3039
+ justifyContent: "space-between",
3040
+ gap: u("2xl"),
3041
+ textAlign: "center"
3042
+ }),
3043
+ desktopHeadlineInner: n({ ...Re, alignItems: "center" }),
3044
+ kickerRowDesktop: n(Pi),
3045
+ kickerRow: n({ ...Pi, justifyContent: "center" }),
3046
+ texts: n({ ...Re, gap: u("3xs") }),
3047
+ kickerDesktop: n({ ...Jt, color: It, opacity: "60%" }),
3048
+ titleDesktop: n({ ...cn, ...Qt, letterSpacing: "0px", color: Si }),
3049
+ descriptionDesktop: n({ ...en, color: It, opacity: "60%" }),
3050
+ kicker: n({ ...Jt, color: It, opacity: "60%", textAlign: "center" }),
3051
+ title: n({ ...cn, ...Qt, letterSpacing: "0px", color: Si, textAlign: "center" }),
3052
+ description: n({ ...en, color: It, opacity: "60%", textAlign: "center" }),
3053
+ kickerOnImage: n({ ...Jt, color: ki, opacity: "70%", textAlign: "center" }),
3054
+ titleOnImage: n({ ...ae, ...Qt, letterSpacing: "0.15px", color: Rr, textAlign: "center" }),
3055
+ descriptionOnImage: n({ ...en, color: ki, opacity: "70%", textAlign: "center" }),
3056
+ mobileWithImage: n({
3057
+ display: "flex",
3058
+ flexDirection: "column",
3059
+ justifyContent: "space-between",
3060
+ gap: "10px",
3061
+ backgroundImage: je("image"),
3062
+ backgroundSize: "cover",
3063
+ backgroundPosition: "center",
3064
+ borderTopLeftRadius: "5px",
3065
+ borderTopRightRadius: "5px",
3066
+ position: "relative",
3067
+ minHeight: "210px",
3068
+ overflow: "hidden",
3069
+ height: "auto",
3070
+ "&::before": {
3071
+ content: '""',
3072
+ position: "absolute",
3073
+ width: "100%",
3074
+ height: "100%",
3075
+ background: je("gradient"),
3076
+ borderTopLeftRadius: "5px",
3077
+ borderTopRightRadius: "5px"
3078
+ }
3079
+ }),
3080
+ mobileWithImageContent: n({
3081
+ ...Re,
3082
+ zIndex: 1,
3083
+ height: "100%",
3084
+ padding: u("xl"),
3085
+ gap: u("2xl"),
3086
+ justifyContent: "space-between"
3087
+ }),
3088
+ mobileWithoutImage: n({
3089
+ ...Re,
3090
+ flex: "0.5",
3091
+ justifyContent: "space-between",
3092
+ padding: u("sm"),
3093
+ gap: u("2xl")
3094
+ }),
3095
+ image: n({ ...wi, display: "block" }),
3096
+ // Rendered but hidden on mobile, like the Joy original.
3097
+ imageHidden: n({ ...wi, display: "none" }),
3098
+ imageSafeArea: n({ position: "relative", zIndex: 2, width: "165px", height: "100%" }),
3099
+ area: n({ ...Re, paddingTop: u("md"), paddingInline: u("md") }),
3100
+ areaMobile: n({ ...Re, paddingTop: u("sm"), paddingInline: u("sm") }),
3101
+ question: n({ ...Re, gap: u("md") }),
3102
+ questionMobile: n({ ...Re, gap: u("lg") }),
3103
+ content: n({ ...Re, borderRadius: "var(--fu-ucrc-radius-md)", gap: u("md") }),
3104
+ presentedBy: n({ ...ct, flexDirection: "row", paddingInline: u("md") }),
3105
+ presentedByMobile: n({ ...ct, flexDirection: "row", paddingInline: u("sm") }),
3106
+ presentedByXs: n({ ...ct, flexDirection: "column-reverse", paddingInline: u("sm") }),
3107
+ // Physical margin: Joy's `ml` flipped under RTL as well.
3108
+ pagination: n({ ...ct, justifyContent: "flex-end", marginLeft: "auto" }),
3109
+ paginationXs: n({ ...ct, justifyContent: "center", marginLeft: "0" }),
3110
+ wrapperRow: n({ display: "flex", flexDirection: "row", width: "100%" }),
3111
+ wrapperColumn: n({ display: "flex", flexDirection: "column", width: "100%" })
3112
+ }, Ar = (e) => {
3113
+ var Y, k, A, L;
3114
+ const i = be(), o = Pe(), r = Me(
3115
+ {
3116
+ images: e.eventGame.images,
3117
+ imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
3118
+ },
3119
+ de.STANDARD
3120
+ ), { t: c } = ie(), f = oe(), d = ht(), l = e.imagePosition || "left", a = f ? ((Y = e.eventGame.branding) == null ? void 0 : Y.images.mobileLogo) || ((k = e.eventGame.branding) == null ? void 0 : k.images.mainLogo) || "" : ((A = e.eventGame.branding) == null ? void 0 : A.images.mainLogo) || "", s = ((L = e.eventGame.branding) == null ? void 0 : L.colors) || null, y = (s == null ? void 0 : s.contentColor) || o.textColor, h = i.colorSchemes.dark.textColor, v = Mt(
3121
+ de.STANDARD
3122
+ ), g = {
3123
+ "--fu-ucrc-egs-fg-text": y,
3124
+ "--fu-ucrc-egs-fg-secondary": (s == null ? void 0 : s.secondaryColor) || o.textColor,
3125
+ "--fu-ucrc-egs-fg-image-text": (s == null ? void 0 : s.contentColor) || h,
3126
+ "--fu-ucrc-egs-fg-image-secondary": (s == null ? void 0 : s.secondaryColor) || h,
3127
+ "--fu-ucrc-egs-fg-image": `url("${r}")`,
3128
+ "--fu-ucrc-egs-fg-gradient": v
3129
+ }, { rankings: b, pagination: p, loading: C, goToNextPage: S, goToPreviousPage: T } = Dn(e.eventGame.id, e.sdk), R = io(l), D = /* @__PURE__ */ t("div", { css: f ? V.imageHidden : V.image, style: g, children: /* @__PURE__ */ t("div", { css: V.imageSafeArea }) }), z = () => {
3130
+ var O;
3131
+ return /* @__PURE__ */ x(
3132
+ "div",
3133
+ {
3134
+ css: f ? V.mainMobile : r ? V.mainImage : V.main,
3135
+ style: g,
3136
+ children: [
3137
+ !f && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t("div", { css: V.desktopHeadline, children: /* @__PURE__ */ x("div", { css: V.desktopHeadlineInner, children: [
3138
+ /* @__PURE__ */ x("div", { css: V.kickerRowDesktop, children: [
3139
+ /* @__PURE__ */ t("p", { css: V.kickerDesktop, children: c("eventGame.headline") }),
3140
+ /* @__PURE__ */ t(
3141
+ Bt,
3142
+ {
3143
+ rules: e.eventGame.rules || "",
3144
+ rulesDisplay: e.rulesDisplay,
3145
+ isOverlayVariant: !1
3146
+ }
3147
+ )
3148
+ ] }),
3149
+ /* @__PURE__ */ x("div", { css: V.texts, children: [
3150
+ /* @__PURE__ */ t("h4", { css: V.titleDesktop, children: e.eventGame.title }),
3151
+ /* @__PURE__ */ t("p", { css: V.descriptionDesktop, children: dt(e.eventGame.description) })
3152
+ ] })
3153
+ ] }) }) }),
3154
+ /* @__PURE__ */ t("div", { css: f ? V.areaMobile : V.area, children: /* @__PURE__ */ t("div", { css: f ? V.questionMobile : V.question, children: /* @__PURE__ */ t("div", { css: V.content, children: /* @__PURE__ */ t(
3155
+ Gn,
3156
+ {
3157
+ leaderboard: b,
3158
+ userRanking: e.prediction,
3159
+ brandingColors: (O = e.eventGame.branding) == null ? void 0 : O.colors,
3160
+ showHeading: !e.showPredictionDetails,
3161
+ loading: C
3162
+ }
3163
+ ) }) }) }),
3164
+ (a || (p == null ? void 0 : p.hasNextPage) || (p == null ? void 0 : p.hasPreviousPage)) && /* @__PURE__ */ x(
3165
+ "div",
3166
+ {
3167
+ css: d ? V.presentedByXs : f ? V.presentedByMobile : V.presentedBy,
3168
+ children: [
3169
+ /* @__PURE__ */ t(
3170
+ he,
3171
+ {
3172
+ brandingLogo: a,
3173
+ textColor: y,
3174
+ label: null
3175
+ }
3176
+ ),
3177
+ /* @__PURE__ */ t("div", { css: d ? V.paginationXs : V.pagination, children: /* @__PURE__ */ t(
3178
+ Tn,
3179
+ {
3180
+ hasNextPage: (p == null ? void 0 : p.hasNextPage) || !1,
3181
+ hasPreviousPage: (p == null ? void 0 : p.hasPreviousPage) || !1,
3182
+ onNextPage: S,
3183
+ onPreviousPage: T,
3184
+ isOverlayVariant: !1,
3185
+ justifyContent: "flex-start"
3186
+ }
3187
+ ) })
3188
+ ]
3189
+ }
3190
+ )
3191
+ ]
3192
+ }
3193
+ );
3194
+ }, q = () => {
3195
+ if (!f) return null;
3196
+ const O = (le) => /* @__PURE__ */ x("div", { css: V.kickerRow, children: [
3197
+ /* @__PURE__ */ t("p", { css: le ? V.kickerOnImage : V.kicker, children: c("eventGame.headline") }),
3198
+ /* @__PURE__ */ t(
3199
+ Bt,
3200
+ {
3201
+ rules: e.eventGame.rules || "",
3202
+ rulesDisplay: e.rulesDisplay,
3203
+ isOverlayVariant: !1
3204
+ }
3205
+ )
3206
+ ] });
3207
+ return r ? /* @__PURE__ */ t("div", { css: V.mobileWithImage, style: g, children: /* @__PURE__ */ t("div", { css: V.mobileWithImageContent, children: /* @__PURE__ */ x("div", { children: [
3208
+ O(!0),
3209
+ /* @__PURE__ */ x("div", { css: V.texts, children: [
3210
+ /* @__PURE__ */ t("p", { css: V.titleOnImage, children: e.eventGame.title }),
3211
+ /* @__PURE__ */ t("p", { css: V.descriptionOnImage, children: dt(e.eventGame.description) })
3212
+ ] })
3213
+ ] }) }) }) : /* @__PURE__ */ t("div", { css: V.mobileWithoutImage, style: g, children: /* @__PURE__ */ x("div", { children: [
3214
+ O(!1),
3215
+ /* @__PURE__ */ x("div", { css: V.texts, children: [
3216
+ /* @__PURE__ */ t("h4", { css: V.title, children: e.eventGame.title }),
3217
+ /* @__PURE__ */ t("p", { css: V.description, children: dt(e.eventGame.description) })
3218
+ ] })
3219
+ ] }) });
3220
+ };
3221
+ return /* @__PURE__ */ t(De, { brandingBorderColor: (s == null ? void 0 : s.borderColor) || null, children: e.showPredictionDetails ? /* @__PURE__ */ t(
3222
+ In,
3223
+ {
3224
+ prediction: e.prediction,
3225
+ game: e.eventGame,
3226
+ brandingColors: s,
3227
+ resultsTabPanelSxProps: {
3228
+ display: "flex",
3229
+ flexDirection: f ? "column" : "row",
3230
+ px: 0,
3231
+ pb: 0,
3232
+ pt: 0
3233
+ },
3234
+ children: /* @__PURE__ */ x("div", { css: f ? V.wrapperColumn : V.wrapperRow, children: [
3235
+ r && R === "left" && D,
3236
+ z(),
3237
+ r && R === "right" && D
3238
+ ] })
3239
+ }
3240
+ ) : /* @__PURE__ */ x(Q, { children: [
3241
+ q(),
3242
+ r && R === "left" && D,
3243
+ z(),
3244
+ r && R === "right" && D
3245
+ ] }) });
3246
+ }, Rt = "var(--fu-ucrc-font-primary)", Ii = "var(--fu-ucrc-eg-ovl-text)", Zi = "var(--fu-ucrc-eg-ovl-primary)", En = "var(--fu-ucrc-eg-ovl-on-primary)", Gi = "var(--fu-ucrc-eg-ovl-danger)", Lr = pn({
3247
+ "0%": { transform: "scale(0.95)", boxShadow: "0 0 0 0 var(--fu-ucrc-eg-ovl-glow)" },
3248
+ "70%": { transform: "scale(1)", boxShadow: "0 0 0 10px var(--fu-ucrc-eg-ovl-glow-out)" },
3249
+ "100%": { transform: "scale(0.95)", boxShadow: "0 0 0 0 var(--fu-ucrc-eg-ovl-glow-out)" }
3250
+ }), Gt = { display: "flex", alignItems: "center", gap: u("lg") }, nn = {
3251
+ paddingBlock: "10px",
3252
+ paddingInline: "16px",
3253
+ borderRadius: "var(--fu-ucrc-eg-ovl-radius-xl)",
3254
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
3255
+ transform: "scale(1)",
3256
+ alignSelf: "center",
3257
+ fontSize: "0.9375em",
3258
+ "&:hover": { transform: "scale(1.02)" },
3259
+ "&:active": { transform: "scale(0.98)" }
3260
+ }, $r = {
3261
+ ...ae,
3262
+ fontFamily: Rt,
3263
+ fontWeight: 500,
3264
+ fontSize: "0.9375em",
3265
+ lineHeight: "24px",
3266
+ letterSpacing: "0.46px",
3267
+ textTransform: "uppercase",
3268
+ color: En,
3269
+ gap: "8px",
3270
+ display: "flex",
3271
+ alignItems: "center"
3272
+ }, Ti = {
3273
+ backgroundColor: Zi,
3274
+ color: En,
3275
+ "&:disabled": { opacity: "12%" }
3276
+ }, Z = {
3277
+ // No box of its own: only carries the per-instance vars.
3278
+ scope: n({ display: "contents" }),
3279
+ // A blurred panel over the artwork, tinted by the content background at half opacity.
3280
+ backdrop: n({
3281
+ borderRadius: "var(--fu-ucrc-radius-md)",
3282
+ padding: u("md"),
3283
+ display: "flex",
3284
+ flexDirection: "column",
3285
+ gap: u("md"),
3286
+ backdropFilter: "blur(4px)",
3287
+ position: "relative",
3288
+ "&::before": {
3289
+ content: '""',
3290
+ position: "absolute",
3291
+ top: 0,
3292
+ left: 0,
3293
+ right: 0,
3294
+ bottom: 0,
3295
+ backgroundColor: "var(--fu-ucrc-eg-ovl-content-bg)",
3296
+ opacity: 0.5,
3297
+ borderRadius: "inherit",
3298
+ zIndex: 0
3299
+ },
3300
+ "& > *": { position: "relative", zIndex: 1 },
3301
+ zIndex: 2
3302
+ }),
3303
+ gameState: n({
3304
+ display: "flex",
3305
+ flexDirection: "column",
3306
+ alignItems: "center",
3307
+ justifyContent: "center",
3308
+ textAlign: "center",
3309
+ padding: `${u("xs")} ${u("sm")}`,
3310
+ gap: u("3xs")
3311
+ }),
3312
+ stateTitle: n(ae, { fontFamily: Rt, fontSize: "1.5em", fontWeight: 700, color: Ii, lineHeight: 1.3 }),
3313
+ stateDescription: n(ae, {
3314
+ fontFamily: Rt,
3315
+ fontSize: "1.25em",
3316
+ letterSpacing: "0.15px",
3317
+ fontWeight: 400,
3318
+ color: Ii,
3319
+ lineHeight: 1.4,
3320
+ opacity: "60%"
3321
+ }),
3322
+ liveRow: n({ display: "flex", alignItems: "center", gap: u("xs"), marginTop: u("xs") }),
3323
+ liveDot: n({
3324
+ width: "12px",
3325
+ height: "12px",
3326
+ borderRadius: "50%",
3327
+ backgroundColor: Gi,
3328
+ animation: `${Lr} 2s infinite`
3329
+ }),
3330
+ liveText: n(ae, {
3331
+ fontFamily: Rt,
3332
+ fontSize: "0.875em",
3333
+ color: Gi,
3334
+ fontWeight: 600,
3335
+ textTransform: "uppercase",
3336
+ letterSpacing: "0.5px"
3337
+ }),
3338
+ closedHeader: n({
3339
+ display: "flex",
3340
+ alignItems: "center",
3341
+ justifyContent: "center",
3342
+ gap: u("sm"),
3343
+ flexWrap: "wrap"
3344
+ }),
3345
+ // Without a sponsor logo the buttons sit at the end; extra small stacks the row.
3346
+ footer: {
3347
+ logo: {
3348
+ row: n(Gt, { flexDirection: "row", justifyContent: "space-between" }),
3349
+ column: n(Gt, { flexDirection: "column", justifyContent: "space-between" })
3350
+ },
3351
+ end: {
3352
+ row: n(Gt, { flexDirection: "row", justifyContent: "flex-end" }),
3353
+ column: n(Gt, { flexDirection: "column", justifyContent: "flex-end" })
3354
+ }
3355
+ },
3356
+ nav: n({ display: "flex", gap: u("md"), justifyContent: "center", alignItems: "center" }),
3357
+ // Bordered in the brand colour, but labelled in on-primary.
3358
+ back: n(pe, nn, {
3359
+ border: `1px solid ${Zi}`,
3360
+ backgroundColor: "transparent",
3361
+ color: En,
3362
+ "&:hover": { backgroundColor: "var(--fu-ucrc-eg-ovl-hover-bg)" }
3363
+ }),
3364
+ next: n(pe, nn, Ti),
3365
+ // Until a pick is made Next stays enabled, but dimmed and inert.
3366
+ nextIdle: n(pe, nn, Ti, { opacity: 0.5, cursor: "not-allowed" }),
3367
+ navLabel: n($r)
3368
+ }, Br = (e) => {
3369
+ const [i, o] = Ye.useState(1), r = be(), { t: c } = ie(), f = oe(), d = ht(), { brandingImage: l, brandingColors: a, brandingLogo: s } = Ft(e.eventGame.branding || null), y = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : f ? qe : _e, h = Me(
3370
+ { images: e.eventGame.images, imagePlaceholder: y },
3371
+ de.OVERLAY
3372
+ ), v = l || h, g = r.colorSchemes.dark, b = r.colorSchemes.light, p = (a == null ? void 0 : a.primaryColor) || b.palette.primary.plainColor, C = b.palette.primary.onPrimary, S = b.palette.danger.plainColor || "#d32f2f", T = (a == null ? void 0 : a.contentColor) || g.textColor, R = {
3373
+ "--fu-ucrc-eg-ovl-content-bg": (a == null ? void 0 : a.backgroundColor) || g.surfaceVariant,
3374
+ "--fu-ucrc-eg-ovl-primary": p,
3375
+ "--fu-ucrc-eg-ovl-on-primary": C,
3376
+ "--fu-ucrc-eg-ovl-radius-xl": r.customRadius.light.xl,
3377
+ "--fu-ucrc-eg-ovl-hover-bg": `${p}10`,
3378
+ "--fu-ucrc-eg-ovl-text": T,
3379
+ "--fu-ucrc-eg-ovl-danger": S,
3380
+ "--fu-ucrc-eg-ovl-glow": `${S}40`,
3381
+ "--fu-ucrc-eg-ovl-glow-out": `${S}00`
3382
+ }, D = { "--fu-ucrc-primary-on-primary": C }, z = () => {
3383
+ var w, K, ne, m;
3384
+ return /* @__PURE__ */ t(
3385
+ he,
3386
+ {
3387
+ brandingLogo: s,
3388
+ textColor: g.textColor,
3389
+ label: null,
3390
+ primaryUrl: (K = (w = e.eventGame.branding) == null ? void 0 : w.urls) == null ? void 0 : K.primaryUrl,
3391
+ secondaryUrl: (m = (ne = e.eventGame.branding) == null ? void 0 : ne.urls) == null ? void 0 : m.secondaryUrl
3392
+ }
3393
+ );
3394
+ }, q = s ? "logo" : "end", Y = d ? "column" : "row", { setPrediction: k } = e, A = Ht(
3395
+ (w, K) => {
3396
+ k((ne) => {
3397
+ const m = { ...ne }, P = m.fixtures.find(($) => $.id === w);
3398
+ return P && (P.prediction = K), m;
3399
+ });
3400
+ },
3401
+ [k]
3402
+ ), L = e.eventGame.fixtures.length + 1, O = e.eventGame.status === "OPEN" && wn(e.eventGame.predictionsCutoff || ""), le = () => {
3403
+ var K, ne;
3404
+ const w = e.eventGame.fixtures[i - 1];
3405
+ if (w && w.outcomeType === H.NUMBER) {
3406
+ const m = w.validOutcomes, P = (ne = (K = e.prediction) == null ? void 0 : K.fixtures) == null ? void 0 : ne.find(
3407
+ ($) => $.id === w.id
3408
+ );
3409
+ if (P && typeof P.prediction == "number") {
3410
+ const $ = vt(
3411
+ P.prediction,
3412
+ m
3413
+ );
3414
+ $ !== P.prediction && A(w.id, $);
3415
+ }
3416
+ }
3417
+ i < L ? o(i + 1) : e.play();
3418
+ }, se = () => {
3419
+ var ne, m;
3420
+ if (i === L) return !0;
3421
+ const w = e.eventGame.fixtures[i - 1];
3422
+ if (!w) return !1;
3423
+ const K = (m = (ne = e.prediction) == null ? void 0 : ne.fixtures) == null ? void 0 : m.find(
3424
+ (P) => P.id === w.id
3425
+ );
3426
+ if (!K) return !1;
3427
+ switch (w.outcomeType) {
3428
+ case H.BOOLEAN:
3429
+ return typeof K.prediction == "boolean";
3430
+ case H.NUMBER:
3431
+ return typeof K.prediction == "number";
3432
+ case H.FREE_INPUT:
3433
+ case H.ENUM:
3434
+ return typeof K.prediction == "string" && K.prediction.trim().length > 0;
3435
+ default:
3436
+ return !1;
3437
+ }
3438
+ }, ce = () => {
3439
+ i > 1 && o(i - 1);
3440
+ }, me = (w) => {
3441
+ o(w + 1);
3442
+ }, j = () => /* @__PURE__ */ t("div", { css: Z.backdrop, children: /* @__PURE__ */ x("div", { css: Z.gameState, children: [
3443
+ /* @__PURE__ */ t("h5", { css: Z.stateTitle, children: c("eventGame.states.pending.title") }),
3444
+ /* @__PURE__ */ t("p", { css: Z.stateDescription, children: c("eventGame.states.pending.description") })
3445
+ ] }) }), B = () => /* @__PURE__ */ t("div", { css: Z.backdrop, children: /* @__PURE__ */ x("div", { css: Z.gameState, children: [
3446
+ /* @__PURE__ */ x("div", { css: Z.liveRow, children: [
3447
+ /* @__PURE__ */ t("div", { css: Z.liveDot }),
3448
+ /* @__PURE__ */ t("h5", { css: Z.liveText, children: c("eventGame.states.live.indicator") })
3449
+ ] }),
3450
+ /* @__PURE__ */ t("p", { css: Z.stateDescription, children: c("eventGame.states.live.description") })
3451
+ ] }) }), te = () => /* @__PURE__ */ t("div", { css: Z.backdrop, children: /* @__PURE__ */ x("div", { css: Z.gameState, children: [
3452
+ /* @__PURE__ */ t("div", { css: Z.closedHeader, children: /* @__PURE__ */ t("h5", { css: Z.stateTitle, children: c("eventGame.states.closed.title") }) }),
3453
+ /* @__PURE__ */ t("p", { css: Z.stateDescription, children: c("eventGame.states.closed.description") })
3454
+ ] }) }), ue = () => /* @__PURE__ */ x("div", { css: Z.gameState, children: [
3455
+ /* @__PURE__ */ t("h5", { css: Z.stateTitle, children: c("eventGame.states.open.title") }),
3456
+ /* @__PURE__ */ t("p", { css: Z.stateDescription, children: c("eventGame.states.open.description") })
3457
+ ] }), fe = ft(() => e.eventGame.fixtures[i - 1], [e.eventGame.fixtures, i]), Ce = () => {
3458
+ var K, ne, m, P, $, _, U, I;
3459
+ const w = fe;
3460
+ if (O)
3461
+ return ue();
3462
+ if (w)
3463
+ switch (w.outcomeType) {
3464
+ case H.BOOLEAN: {
3465
+ const M = (ne = (K = e.prediction) == null ? void 0 : K.fixtures) == null ? void 0 : ne.find(
3466
+ (X) => X.id === w.id
3467
+ );
3468
+ return /* @__PURE__ */ t(
3469
+ Wt,
3470
+ {
3471
+ prediction: typeof (M == null ? void 0 : M.prediction) == "boolean" ? M.prediction : null,
3472
+ onSelectionChange: (X) => {
3473
+ A(w.id, X);
3474
+ },
3475
+ question: w.question,
3476
+ fixtureId: w.id,
3477
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3478
+ },
3479
+ `${w.outcomeType}-${i}-${w.id}`
3480
+ );
3481
+ }
3482
+ case H.NUMBER: {
3483
+ const M = (P = (m = e.prediction) == null ? void 0 : m.fixtures) == null ? void 0 : P.find(
3484
+ (ke) => ke.id === w.id
3485
+ ), X = w.validOutcomes;
3486
+ return /* @__PURE__ */ t(
3487
+ Vt,
3488
+ {
3489
+ prediction: typeof (M == null ? void 0 : M.prediction) == "number" ? M.prediction : 0,
3490
+ onChange: (ke) => {
3491
+ A(w.id, ke);
3492
+ },
3493
+ question: w.question,
3494
+ validOutcomes: X || null,
3495
+ fixtureId: w.id,
3496
+ isOverlayVariant: !0,
3497
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3498
+ },
3499
+ `${w.outcomeType}-${i}-${w.id}`
3500
+ );
3501
+ }
3502
+ case H.FREE_INPUT: {
3503
+ const M = (_ = ($ = e.prediction) == null ? void 0 : $.fixtures) == null ? void 0 : _.find(
3504
+ (X) => X.id === w.id
3505
+ );
3506
+ return /* @__PURE__ */ t(
3507
+ He,
3508
+ {
3509
+ question: w.question,
3510
+ prediction: typeof (M == null ? void 0 : M.prediction) == "string" ? M.prediction : null,
3511
+ validOutcomes: null,
3512
+ onTextChange: (X) => {
3513
+ A(w.id, X);
3514
+ },
3515
+ fixtureId: w.id,
3516
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3517
+ },
3518
+ `${w.outcomeType}-${i}-${w.id}`
3519
+ );
3520
+ }
3521
+ case H.ENUM: {
3522
+ const M = (I = (U = e.prediction) == null ? void 0 : U.fixtures) == null ? void 0 : I.find(
3523
+ (X) => X.id === w.id
3524
+ );
3525
+ return /* @__PURE__ */ t(
3526
+ He,
3527
+ {
3528
+ question: w.question,
3529
+ prediction: typeof (M == null ? void 0 : M.prediction) == "string" ? M.prediction : null,
3530
+ validOutcomes: w.validOutcomes,
3531
+ onTextChange: (X) => {
3532
+ A(w.id, X);
3533
+ },
3534
+ fixtureId: w.id,
3535
+ optionsLayout: e.optionsLayout,
3536
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3537
+ },
3538
+ `${w.id}-${i}`
3539
+ );
3540
+ }
3541
+ default:
3542
+ return /* @__PURE__ */ t(Q, {});
3543
+ }
3544
+ }, ye = () => {
3545
+ const w = se();
3546
+ return /* @__PURE__ */ x(Q, { children: [
3547
+ e.showCountdown && e.eventGame.status === "OPEN" && /* @__PURE__ */ t(
3548
+ kn,
3549
+ {
3550
+ predictionsCutoffTime: e.eventGame.predictionsCutoff || ""
3551
+ }
3552
+ ),
3553
+ !O && /* @__PURE__ */ t(
3554
+ Sn,
3555
+ {
3556
+ eventGame: e.eventGame,
3557
+ currentStep: i,
3558
+ totalSteps: L,
3559
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3560
+ }
3561
+ ),
3562
+ /* @__PURE__ */ t("div", { css: Z.backdrop, children: i === L ? /* @__PURE__ */ t(
3563
+ Ke,
3564
+ {
3565
+ fixtures: e.eventGame.fixtures,
3566
+ prediction: e.prediction,
3567
+ onEditPrediction: me,
3568
+ onPredictionUpdate: e.setPrediction,
3569
+ view: "play",
3570
+ play: async () => e.play(),
3571
+ isOverlayVariant: !0,
3572
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3573
+ }
3574
+ ) : Ce() }),
3575
+ /* @__PURE__ */ x("div", { css: Z.footer[q][Y], children: [
3576
+ d ? /* @__PURE__ */ t(Q, {}) : z(),
3577
+ /* @__PURE__ */ x("div", { css: Z.nav, children: [
3578
+ i > 1 && i < L && /* @__PURE__ */ t("button", { type: "button", css: Z.back, onClick: ce, children: /* @__PURE__ */ t("p", { css: Z.navLabel, children: c("eventGame.buttons.back") }) }),
3579
+ !O && /* @__PURE__ */ x(
3580
+ "button",
3581
+ {
3582
+ type: "button",
3583
+ css: w ? Z.next : Z.nextIdle,
3584
+ style: D,
3585
+ onClick: w ? le : void 0,
3586
+ disabled: e.isPlaying,
3587
+ children: [
3588
+ /* @__PURE__ */ t("p", { css: Z.navLabel, children: i === L ? e.hasAfterConsents ? c("eventGame.buttons.continue") : c("eventGame.buttons.play") : c("eventGame.buttons.next") }),
3589
+ e.isPlaying && /* @__PURE__ */ t(Ot, { size: 20, thickness: 3 })
3590
+ ]
3591
+ }
3592
+ )
3593
+ ] })
3594
+ ] }),
3595
+ d ? z() : /* @__PURE__ */ t(Q, {})
3596
+ ] });
3597
+ }, xe = () => {
3598
+ switch (e.eventGame.status) {
3599
+ case "PENDING":
3600
+ return j();
3601
+ case "LIVE":
3602
+ return B();
3603
+ case "CLOSED":
3604
+ return te();
3605
+ default:
3606
+ return ye();
3607
+ }
3608
+ }, Se = () => {
3609
+ var w, K, ne;
3610
+ return /* @__PURE__ */ x(Q, { children: [
3611
+ /* @__PURE__ */ t("div", { css: Z.backdrop, children: /* @__PURE__ */ t(
3612
+ Ze,
3613
+ {
3614
+ consents: e.consents,
3615
+ primaryColor: p,
3616
+ textColor: g.textColor,
3617
+ brandingUrls: (w = e.eventGame.branding) == null ? void 0 : w.urls
3618
+ }
3619
+ ) }),
3620
+ /* @__PURE__ */ x("div", { css: Z.footer[q][Y], children: [
3621
+ d ? /* @__PURE__ */ t(Q, {}) : z(),
3622
+ /* @__PURE__ */ t("div", { css: Z.nav, children: /* @__PURE__ */ t(
3623
+ Ut,
3624
+ {
3625
+ onClick: e.startPredicting,
3626
+ label: ((ne = (K = e.consents) == null ? void 0 : K.labels) == null ? void 0 : ne.ctaLabel) || c("eventGame.buttons.start"),
3627
+ isSubmitting: e.isSubmitting,
3628
+ primaryColor: p,
3629
+ showArrow: !1
3630
+ }
3631
+ ) })
3632
+ ] }),
3633
+ d ? z() : /* @__PURE__ */ t(Q, {})
3634
+ ] });
3635
+ };
3636
+ return /* @__PURE__ */ t(
3637
+ bo,
3638
+ {
3639
+ entity: { ...e.eventGame, labels: null },
3640
+ headline: c("eventGame.headline"),
3641
+ finalImage: v,
3642
+ rulesDisplay: e.rulesDisplay,
3643
+ children: /* @__PURE__ */ t("div", { css: Z.scope, style: R, children: e.applyConsentGate ? Se() : xe() })
3644
+ }
3645
+ );
3646
+ }, At = "var(--fu-ucrc-font-primary)", Di = "var(--fu-ucrc-danger-plain-color)", mn = "var(--fu-ucrc-primary-on-primary)", Ki = "var(--fu-ucrc-eg-split-primary)", zr = "var(--fu-ucrc-eg-split-text)", Mr = pn({
3647
+ "0%": { opacity: 1, transform: "scale(1)" },
3648
+ "50%": { opacity: 0.7, transform: "scale(1.1)" },
3649
+ "100%": { opacity: 1, transform: "scale(1)" }
3650
+ }), Fr = {
3651
+ display: "flex",
3652
+ flexDirection: "column",
3653
+ backdropFilter: "blur(4px)",
3654
+ backgroundColor: "var(--fu-ucrc-eg-split-bg)",
3655
+ borderRadius: "var(--fu-ucrc-radius-sm)"
3656
+ }, on = {
3657
+ alignSelf: "center",
3658
+ paddingBlock: "10px",
3659
+ paddingInline: "16px",
3660
+ borderRadius: "var(--fu-ucrc-radius-xl)",
3661
+ fontSize: "0.9375em",
3662
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
3663
+ transform: "scale(1)",
3664
+ "&:hover": { transform: "scale(1.02)" },
3665
+ "&:active": { transform: "scale(0.98)" }
3666
+ }, Ei = {
3667
+ margin: 0,
3668
+ fontFamily: At,
3669
+ fontWeight: 500,
3670
+ fontSize: "0.9375em",
3671
+ lineHeight: "24px",
3672
+ letterSpacing: "0.46px",
3673
+ textTransform: "uppercase",
3674
+ gap: "8px",
3675
+ display: "flex",
3676
+ alignItems: "center"
3677
+ }, Ri = {
3678
+ backgroundColor: Ki,
3679
+ color: mn,
3680
+ "&:disabled": { opacity: "12%" }
3681
+ }, ee = {
3682
+ contentArea: n({ padding: u("lg"), display: "flex", flexDirection: "column", justifyContent: "center", gap: "16px" }),
3683
+ mainPanel: n(Fr, { padding: u("lg"), gap: u("md"), position: "relative", zIndex: 2 }),
3684
+ gameState: n({ display: "flex", flexDirection: "column", gap: u("xs"), textAlign: "center" }),
3685
+ stateTitle: n({
3686
+ margin: 0,
3687
+ fontFamily: At,
3688
+ fontWeight: 700,
3689
+ fontSize: "1.5em",
3690
+ lineHeight: "133%",
3691
+ letterSpacing: "0.15px",
3692
+ color: zr
3693
+ }),
3694
+ stateDescription: n({
3695
+ margin: 0,
3696
+ fontFamily: At,
3697
+ fontWeight: 400,
3698
+ fontSize: "1.25em",
3699
+ lineHeight: "140%",
3700
+ letterSpacing: "0.15px",
3701
+ color: "var(--fu-ucrc-eg-split-secondary)",
3702
+ opacity: "60%"
3703
+ }),
3704
+ liveRow: n({ display: "flex", alignItems: "center", justifyContent: "center", gap: u("xs") }),
3705
+ liveDot: n({
3706
+ width: "12px",
3707
+ height: "12px",
3708
+ borderRadius: "50%",
3709
+ backgroundColor: Di,
3710
+ animation: `${Mr} 2s infinite`
3711
+ }),
3712
+ liveText: n({
3713
+ margin: 0,
3714
+ fontFamily: At,
3715
+ fontWeight: 600,
3716
+ fontSize: "1em",
3717
+ lineHeight: 1.5,
3718
+ color: Di,
3719
+ textTransform: "uppercase",
3720
+ letterSpacing: "0.5px"
3721
+ }),
3722
+ countdown: n({ marginTop: u("lg"), marginBottom: u("lg") }),
3723
+ pagination: n({ display: "flex", justifyContent: "center", paddingInline: u("lg") }),
3724
+ navigation: n({ display: "flex", gap: u("md"), justifyContent: "center", alignItems: "center" }),
3725
+ back: n(pe, on, {
3726
+ border: `1px solid ${Ki}`,
3727
+ backgroundColor: "transparent",
3728
+ color: mn,
3729
+ "&:hover": { backgroundColor: "var(--fu-ucrc-eg-split-primary-hover)" }
3730
+ }),
3731
+ // An unstyled Typography: Joy's text.secondary.
3732
+ backLabel: n(Ei, { color: "var(--fu-ucrc-palette-text-secondary)" }),
3733
+ // Enabled until a pick is made, but a dimmed no-op. Busy, Joy disabled it and kept the label.
3734
+ next: n(pe, on, Ri),
3735
+ nextIdle: n(pe, on, Ri, { opacity: 0.5, cursor: "not-allowed" }),
3736
+ nextLabel: n(Ei, { color: mn }),
3737
+ presentedBy: n({ marginBottom: u("lg"), paddingInline: u("lg") })
3738
+ }, Hr = (e) => {
3739
+ var Ce, ye, xe, Se, w, K, ne;
3740
+ const [i, o] = Ye.useState(1), r = be(), c = Pe(), { t: f } = ie(), d = oe(), l = Hi(), a = ((Ce = e.eventGame.branding) == null ? void 0 : Ce.colors) || null, s = d ? ((xe = (ye = e.eventGame.branding) == null ? void 0 : ye.images) == null ? void 0 : xe.mobileLogo) || ((w = (Se = e.eventGame.branding) == null ? void 0 : Se.images) == null ? void 0 : w.mainLogo) || "" : ((ne = (K = e.eventGame.branding) == null ? void 0 : K.images) == null ? void 0 : ne.mainLogo) || "", y = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : d ? qe : _e, h = Me(
3741
+ {
3742
+ images: e.eventGame.images,
3743
+ imagePlaceholder: y
3744
+ },
3745
+ de.SPLIT
3746
+ ), v = (a == null ? void 0 : a.contentColor) || c.textColor, g = (a == null ? void 0 : a.secondaryColor) || c.textColor, b = xt((a == null ? void 0 : a.backgroundColor) || c.surfaceVariant || ""), p = (a == null ? void 0 : a.primaryColor) || c.palette.primary.plainColor, C = {
3747
+ "--fu-ucrc-eg-split-primary": p,
3748
+ "--fu-ucrc-eg-split-primary-hover": `${p}10`,
3749
+ "--fu-ucrc-eg-split-text": v,
3750
+ "--fu-ucrc-eg-split-secondary": g,
3751
+ "--fu-ucrc-eg-split-bg": `rgba(${b ? b.replace(/[^\d,]/g, "") : ""}, 0.5)`
3752
+ }, S = (m) => {
3753
+ var P, $, _, U;
3754
+ return /* @__PURE__ */ t(
3755
+ he,
3756
+ {
3757
+ brandingLogo: s,
3758
+ textColor: m,
3759
+ label: null,
3760
+ primaryUrl: ($ = (P = e.eventGame.branding) == null ? void 0 : P.urls) == null ? void 0 : $.primaryUrl,
3761
+ secondaryUrl: (U = (_ = e.eventGame.branding) == null ? void 0 : _.urls) == null ? void 0 : U.secondaryUrl
3762
+ }
3763
+ );
3764
+ }, { setPrediction: T } = e, R = Ht(
3765
+ (m, P) => {
3766
+ T(($) => {
3767
+ const _ = { ...$ }, U = _.fixtures.find((I) => I.id === m);
3768
+ return U && (U.prediction = P), _;
3769
+ });
3770
+ },
3771
+ [T]
3772
+ ), D = e.eventGame.fixtures.length + 1, z = e.eventGame.status === "OPEN" && wn(e.eventGame.predictionsCutoff || ""), q = () => {
3773
+ var P, $;
3774
+ const m = e.eventGame.fixtures[i - 1];
3775
+ if (m && m.outcomeType === H.NUMBER) {
3776
+ const _ = m.validOutcomes, U = ($ = (P = e.prediction) == null ? void 0 : P.fixtures) == null ? void 0 : $.find((I) => I.id === m.id);
3777
+ if (U && typeof U.prediction == "number") {
3778
+ const I = vt(U.prediction, _);
3779
+ I !== U.prediction && R(m.id, I);
3780
+ }
3781
+ }
3782
+ i < D ? o(i + 1) : e.play();
3783
+ }, Y = (m) => {
3784
+ o(m + 1);
3785
+ }, k = () => {
3786
+ var $, _;
3787
+ if (i === D) return !0;
3788
+ const m = e.eventGame.fixtures[i - 1];
3789
+ if (!m) return !1;
3790
+ const P = (_ = ($ = e.prediction) == null ? void 0 : $.fixtures) == null ? void 0 : _.find((U) => U.id === m.id);
3791
+ if (!P) return !1;
3792
+ switch (m.outcomeType) {
3793
+ case H.BOOLEAN:
3794
+ return typeof P.prediction == "boolean";
3795
+ case H.NUMBER:
3796
+ return typeof P.prediction == "number";
3797
+ case H.FREE_INPUT:
3798
+ return typeof P.prediction == "string" && P.prediction.trim().length > 0;
3799
+ case H.ENUM:
3800
+ return typeof P.prediction == "string" && P.prediction.trim().length > 0;
3801
+ default:
3802
+ return !1;
3803
+ }
3804
+ }, A = () => {
3805
+ i > 1 && o(i - 1);
3806
+ }, L = (m) => /* @__PURE__ */ t("div", { css: ee.contentArea, style: C, children: /* @__PURE__ */ t("div", { css: ee.mainPanel, children: /* @__PURE__ */ t("div", { css: ee.gameState, children: m }) }) }), O = () => L(
3807
+ /* @__PURE__ */ x(Q, { children: [
3808
+ /* @__PURE__ */ t("p", { css: ee.stateTitle, children: f("eventGame.states.pending.title") }),
3809
+ /* @__PURE__ */ t("p", { css: ee.stateDescription, children: f("eventGame.states.pending.description") })
3810
+ ] })
3811
+ ), le = () => L(
3812
+ /* @__PURE__ */ x(Q, { children: [
3813
+ /* @__PURE__ */ x("div", { css: ee.liveRow, children: [
3814
+ /* @__PURE__ */ t("div", { css: ee.liveDot }),
3815
+ /* @__PURE__ */ t("p", { css: ee.liveText, children: f("eventGame.states.live.indicator") })
3816
+ ] }),
3817
+ /* @__PURE__ */ t("p", { css: ee.stateDescription, children: f("eventGame.states.live.description") })
3818
+ ] })
3819
+ ), se = () => L(
3820
+ /* @__PURE__ */ x(Q, { children: [
3821
+ /* @__PURE__ */ t("p", { css: ee.stateTitle, children: f("eventGame.states.closed.title") }),
3822
+ /* @__PURE__ */ t("p", { css: ee.stateDescription, children: f("eventGame.states.closed.description") })
3823
+ ] })
3824
+ ), ce = () => /* @__PURE__ */ x("div", { css: ee.gameState, children: [
3825
+ /* @__PURE__ */ t("p", { css: ee.stateTitle, children: f("eventGame.states.open.title") }),
3826
+ /* @__PURE__ */ t("p", { css: ee.stateDescription, children: f("eventGame.states.open.description") })
3827
+ ] }), me = ft(() => e.eventGame.fixtures[i - 1], [e.eventGame.fixtures, i]), j = ft(() => me ? {
3828
+ onSelectionChange: (m) => R(me.id, m)
3829
+ } : {}, [me == null ? void 0 : me.id, R]), B = () => {
3830
+ var P, $, _, U, I, M, X, ke;
3831
+ const m = me;
3832
+ if (z)
3833
+ return ce();
3834
+ if (m)
3835
+ switch (m.outcomeType) {
3836
+ case H.NUMBER: {
3837
+ const G = ($ = (P = e.prediction) == null ? void 0 : P.fixtures) == null ? void 0 : $.find((Le) => Le.id === m.id), J = m.validOutcomes;
3838
+ return /* @__PURE__ */ t(
3839
+ Vt,
3840
+ {
3841
+ prediction: typeof (G == null ? void 0 : G.prediction) == "number" ? G.prediction : 0,
3842
+ isSplitVariant: !0,
3843
+ onChange: (Le) => j.onSelectionChange(Le),
3844
+ question: m.question,
3845
+ validOutcomes: J || null,
3846
+ fixtureId: m.id,
3847
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3848
+ },
3849
+ `${m.id}-${i}`
3850
+ );
3851
+ }
3852
+ case H.BOOLEAN: {
3853
+ const G = (U = (_ = e.prediction) == null ? void 0 : _.fixtures) == null ? void 0 : U.find(
3854
+ (J) => J.id === m.id
3855
+ );
3856
+ return /* @__PURE__ */ t(
3857
+ Wt,
3858
+ {
3859
+ prediction: typeof (G == null ? void 0 : G.prediction) == "boolean" ? G.prediction : null,
3860
+ isSplitVariant: !0,
3861
+ onSelectionChange: j.onSelectionChange,
3862
+ question: m.question,
3863
+ fixtureId: m.id,
3864
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3865
+ },
3866
+ m.id
3867
+ );
3868
+ }
3869
+ case H.FREE_INPUT: {
3870
+ const G = (M = (I = e.prediction) == null ? void 0 : I.fixtures) == null ? void 0 : M.find((J) => J.id === m.id);
3871
+ return /* @__PURE__ */ t(
3872
+ He,
3873
+ {
3874
+ question: m.question,
3875
+ prediction: typeof (G == null ? void 0 : G.prediction) == "string" ? G.prediction : null,
3876
+ validOutcomes: null,
3877
+ onTextChange: (J) => j.onSelectionChange(J),
3878
+ isSplitVariant: !0,
3879
+ fixtureId: m.id,
3880
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3881
+ },
3882
+ `${m.id}-${i}`
3883
+ );
3884
+ }
3885
+ case H.ENUM: {
3886
+ const G = (ke = (X = e.prediction) == null ? void 0 : X.fixtures) == null ? void 0 : ke.find((J) => J.id === m.id);
3887
+ return /* @__PURE__ */ t(
3888
+ He,
3889
+ {
3890
+ question: m.question,
3891
+ prediction: typeof (G == null ? void 0 : G.prediction) == "string" ? G.prediction : null,
3892
+ validOutcomes: m.validOutcomes,
3893
+ onTextChange: (J) => j.onSelectionChange(J),
3894
+ isSplitVariant: !0,
3895
+ fixtureId: m.id,
3896
+ optionsLayout: e.optionsLayout,
3897
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3898
+ },
3899
+ `${m.id}-${i}`
3900
+ );
3901
+ }
3902
+ }
3903
+ }, te = () => {
3904
+ const m = !!e.isPlaying, P = k();
3905
+ return /* @__PURE__ */ x(Q, { children: [
3906
+ e.showCountdown && !z && e.eventGame.status === "OPEN" && /* @__PURE__ */ t("div", { css: ee.countdown, children: /* @__PURE__ */ t(kn, { predictionsCutoffTime: e.eventGame.predictionsCutoff || "", isSplitVariant: !0 }) }),
3907
+ !z && /* @__PURE__ */ t("div", { css: ee.pagination, children: /* @__PURE__ */ t(Sn, { eventGame: e.eventGame, currentStep: i, totalSteps: D, isSplitVariant: !0, brandingPrimaryColor: a == null ? void 0 : a.primaryColor }) }),
3908
+ /* @__PURE__ */ t("div", { css: ee.contentArea, style: C, children: /* @__PURE__ */ x("div", { css: ee.mainPanel, children: [
3909
+ i === D ? /* @__PURE__ */ t(
3910
+ Ke,
3911
+ {
3912
+ fixtures: e.eventGame.fixtures,
3913
+ prediction: e.prediction,
3914
+ onEditPrediction: Y,
3915
+ onPredictionUpdate: e.setPrediction,
3916
+ view: "play",
3917
+ play: async () => e.play(),
3918
+ isSplitVariant: !0,
3919
+ brandingPrimaryColor: a == null ? void 0 : a.primaryColor
3920
+ }
3921
+ ) : B(),
3922
+ /* @__PURE__ */ x("div", { css: ee.navigation, children: [
3923
+ i > 1 && i < D && /* @__PURE__ */ t("button", { type: "button", css: ee.back, onClick: A, children: /* @__PURE__ */ t("p", { css: ee.backLabel, children: f("eventGame.buttons.back") }) }),
3924
+ !z && /* @__PURE__ */ x(
3925
+ "button",
3926
+ {
3927
+ type: "button",
3928
+ css: P ? ee.next : ee.nextIdle,
3929
+ onClick: P ? q : () => {
3930
+ },
3931
+ disabled: m,
3932
+ children: [
3933
+ /* @__PURE__ */ t("p", { css: ee.nextLabel, children: i === D ? e.hasAfterConsents ? f("eventGame.buttons.continue") : f("eventGame.buttons.play") : f("eventGame.buttons.next") }),
3934
+ m && /* @__PURE__ */ t(Ot, { size: 20, thickness: 3 })
3935
+ ]
3936
+ }
3937
+ )
3938
+ ] })
3939
+ ] }) })
3940
+ ] });
3941
+ }, ue = () => {
3942
+ switch (e.eventGame.status) {
3943
+ case "PENDING":
3944
+ return O();
3945
+ case "LIVE":
3946
+ return le();
3947
+ case "CLOSED":
3948
+ return se();
3949
+ default:
3950
+ return te();
3951
+ }
3952
+ }, fe = () => {
3953
+ var m;
3954
+ return /* @__PURE__ */ t("div", { css: ee.contentArea, style: C, children: /* @__PURE__ */ t("div", { css: ee.mainPanel, children: /* @__PURE__ */ t(
3955
+ Ze,
3956
+ {
3957
+ consents: e.consents,
3958
+ primaryColor: p,
3959
+ textColor: v,
3960
+ brandingUrls: (m = e.eventGame.branding) == null ? void 0 : m.urls,
3961
+ onSubmit: e.startPredicting,
3962
+ isSubmitting: e.isSubmitting,
3963
+ ctaLabel: f("eventGame.buttons.start"),
3964
+ showArrow: !1,
3965
+ align: "center"
3966
+ }
3967
+ ) }) });
3968
+ };
3969
+ return /* @__PURE__ */ x(De, { brandingBorderColor: (a == null ? void 0 : a.borderColor) || null, children: [
3970
+ /* @__PURE__ */ t(
3971
+ Co,
3972
+ {
3973
+ entity: { ...e.eventGame, labels: null },
3974
+ headline: f("eventGame.headline"),
3975
+ finalImage: h,
3976
+ brandingLogo: s,
3977
+ renderPresentedBy: S,
3978
+ rulesDisplay: e.rulesDisplay,
3979
+ children: e.applyConsentGate ? fe() : ue()
3980
+ }
3981
+ ),
3982
+ s && l && /* @__PURE__ */ t("div", { css: ee.presentedBy, children: S((a == null ? void 0 : a.contentColor) || r.colorSchemes.dark.textColor) })
3983
+ ] });
3984
+ }, rn = "var(--fu-ucrc-radius-md)", Or = "var(--fu-ucrc-eg-split-image-text)", Ji = "var(--fu-ucrc-eg-split-image-secondary)", Ai = {
3985
+ side: { flex: "0 0 50%", width: "50%", minWidth: "50%", maxWidth: "50%" },
3986
+ stacked: { flex: "1", width: "100%", minWidth: "100%", maxWidth: "100%" }
3987
+ }, Ur = {
3988
+ display: "flex",
3989
+ flexDirection: "column",
3990
+ justifyContent: "space-between",
3991
+ gap: "10px",
3992
+ backgroundImage: "var(--fu-ucrc-eg-split-image)",
3993
+ backgroundSize: "cover",
3994
+ backgroundPosition: "center",
3995
+ overflow: "hidden",
3996
+ height: "auto",
3997
+ position: "relative",
3998
+ "&::before": {
3999
+ content: '""',
4000
+ position: "absolute",
4001
+ width: "100%",
4002
+ height: "100%",
4003
+ background: "var(--fu-ucrc-eg-split-gradient)",
4004
+ borderTopLeftRadius: "5px",
4005
+ borderTopRightRadius: "5px"
4006
+ }
4007
+ }, Tt = (e, i) => n(Ur, e ? Ai.stacked : Ai.side, {
4008
+ borderTopLeftRadius: i ? 0 : rn,
4009
+ borderTopRightRadius: e && !i ? rn : 0,
4010
+ borderBottomLeftRadius: e ? 0 : rn,
4011
+ minHeight: e ? "210px" : "430px"
4012
+ }), Li = {
4013
+ margin: 0,
4014
+ fontWeight: 500,
4015
+ lineHeight: "166%",
4016
+ letterSpacing: "1px",
4017
+ fontSize: "0.75em",
4018
+ color: Ji,
4019
+ opacity: "70%",
4020
+ textTransform: "uppercase",
4021
+ fontFamily: "var(--fu-ucrc-font-secondary)"
4022
+ }, $i = {
4023
+ margin: 0,
4024
+ fontWeight: 700,
4025
+ lineHeight: "133%",
4026
+ fontSize: "1.5em",
4027
+ letterSpacing: "0.15px",
4028
+ color: Or,
4029
+ fontFamily: "var(--fu-ucrc-font-primary)",
4030
+ unicodeBidi: "plaintext"
4031
+ }, Bi = {
4032
+ margin: 0,
4033
+ fontWeight: 400,
4034
+ lineHeight: "140%",
4035
+ fontSize: "1.25em",
4036
+ letterSpacing: "0.15px",
4037
+ color: Ji,
4038
+ opacity: "70%",
4039
+ fontFamily: "var(--fu-ucrc-font-primary)",
4040
+ unicodeBidi: "plaintext"
4041
+ }, zi = { display: "flex", alignItems: "center", gap: u("3xs") }, Mi = {
4042
+ padding: u("lg"),
4043
+ display: "flex",
4044
+ flexDirection: "column",
4045
+ justifyContent: "center",
4046
+ gap: "16px"
4047
+ }, ve = {
4048
+ section: {
4049
+ side: Tt(!1, !1),
4050
+ sideTabulated: Tt(!1, !0),
4051
+ stacked: Tt(!0, !1),
4052
+ stackedTabulated: Tt(!0, !0)
4053
+ },
4054
+ headlineContent: n({
4055
+ zIndex: 1,
4056
+ height: "100%",
4057
+ padding: u("xl"),
4058
+ gap: u("xl"),
4059
+ display: "flex",
4060
+ flexDirection: "column",
4061
+ justifyContent: "space-between"
4062
+ }),
4063
+ kickerRow: {
4064
+ side: n(zi, { justifyContent: "flex-start" }),
4065
+ stacked: n(zi, { justifyContent: "center" })
4066
+ },
4067
+ texts: n({ display: "flex", flexDirection: "column", gap: u("3xs") }),
4068
+ kicker: { side: n(Li, { textAlign: "left" }), stacked: n(Li, { textAlign: "center" }) },
4069
+ title: { side: n($i, { textAlign: "left" }), stacked: n($i, { textAlign: "center" }) },
4070
+ description: {
4071
+ side: n(Bi, { textAlign: "left" }),
4072
+ stacked: n(Bi, { textAlign: "center" })
4073
+ },
4074
+ content: { side: n(Mi, { width: "100%" }), stacked: n(Mi, { width: "auto" }) },
4075
+ // Translucent panel, from the branding background.
4076
+ panel: n({
4077
+ padding: u("lg"),
4078
+ gap: u("md"),
4079
+ display: "flex",
4080
+ flexDirection: "column",
4081
+ alignItems: "center",
4082
+ justifyContent: "center",
4083
+ backdropFilter: "blur(4px)",
4084
+ backgroundColor: "var(--fu-ucrc-eg-split-bg)",
4085
+ borderRadius: "var(--fu-ucrc-radius-sm)",
4086
+ minHeight: "300px"
4087
+ }),
4088
+ pagination: n({ display: "flex", justifyContent: "center", marginLeft: 0 }),
4089
+ branding: n({
4090
+ minWidth: "180px",
4091
+ display: "flex",
4092
+ gap: "8px",
4093
+ alignItems: "center",
4094
+ justifyContent: "center",
4095
+ textAlign: "center",
4096
+ fontSize: "1em"
4097
+ })
4098
+ }, Vr = { maxHeight: "50px", maxWidth: "100px" }, Wr = (e) => {
4099
+ var Y, k, A, L, O, le, se;
4100
+ const i = be(), o = Pe(), { t: r } = ie(), c = oe(), f = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : c ? qe : _e, d = Me(
4101
+ {
4102
+ images: e.event.images,
4103
+ imagePlaceholder: f
4104
+ },
4105
+ de.SPLIT
4106
+ ), l = c ? ((k = (Y = e.event.branding) == null ? void 0 : Y.images) == null ? void 0 : k.mobileLogo) || ((L = (A = e.event.branding) == null ? void 0 : A.images) == null ? void 0 : L.mainLogo) || "" : ((le = (O = e.event.branding) == null ? void 0 : O.images) == null ? void 0 : le.mainLogo) || "", a = ((se = e.event.branding) == null ? void 0 : se.colors) || null, s = i.colorSchemes.dark.textColor, y = xt((a == null ? void 0 : a.backgroundColor) || o.surfaceVariant || ""), h = Mt(de.SPLIT), v = {
4107
+ "--fu-ucrc-eg-split-image": `url("${d}")`,
4108
+ "--fu-ucrc-eg-split-gradient": h,
4109
+ "--fu-ucrc-eg-split-image-text": (a == null ? void 0 : a.contentColor) || s,
4110
+ "--fu-ucrc-eg-split-image-secondary": (a == null ? void 0 : a.secondaryColor) || s,
4111
+ "--fu-ucrc-eg-split-bg": `rgba(${y ? y.replace(/[^\d,]/g, "") : ""}, 0.5)`
4112
+ }, g = c ? "stacked" : "side", b = e.showPredictionDetails || !1, { rankings: p, pagination: C, loading: S, goToNextPage: T, goToPreviousPage: R } = Dn(
4113
+ e.event.id,
4114
+ e.sdk
4115
+ ), D = () => {
4116
+ var ce;
4117
+ return /* @__PURE__ */ t("div", { css: ve.content[g], style: v, children: /* @__PURE__ */ x("div", { css: ve.panel, children: [
4118
+ /* @__PURE__ */ t(
4119
+ Gn,
4120
+ {
4121
+ leaderboard: p,
4122
+ userRanking: e.prediction,
4123
+ brandingColors: (ce = e.event.branding) == null ? void 0 : ce.colors,
4124
+ showHeading: !e.showPredictionDetails,
4125
+ isSplitVariant: !0,
4126
+ loading: S
4127
+ }
4128
+ ),
4129
+ C && (C.hasNextPage || C.hasPreviousPage) && /* @__PURE__ */ t("div", { css: ve.pagination, children: /* @__PURE__ */ t(
4130
+ Tn,
4131
+ {
4132
+ hasNextPage: C.hasNextPage,
4133
+ hasPreviousPage: C.hasPreviousPage,
4134
+ onNextPage: T,
4135
+ onPreviousPage: R,
4136
+ isOverlayVariant: !1,
4137
+ justifyContent: "center"
4138
+ }
4139
+ ) }),
4140
+ l && c && /* @__PURE__ */ t("div", { css: ve.branding, children: /* @__PURE__ */ t("img", { src: l, alt: "branding-logo", style: Vr }) })
4141
+ ] }) });
4142
+ }, z = (ce) => /* @__PURE__ */ t(he, { brandingLogo: l, textColor: ce, label: null }), q = () => /* @__PURE__ */ t(
4143
+ "div",
4144
+ {
4145
+ css: c ? b ? ve.section.stackedTabulated : ve.section.stacked : b ? ve.section.sideTabulated : ve.section.side,
4146
+ style: v,
4147
+ children: /* @__PURE__ */ x("div", { css: ve.headlineContent, children: [
4148
+ /* @__PURE__ */ x("div", { children: [
4149
+ /* @__PURE__ */ x("div", { css: ve.kickerRow[g], children: [
4150
+ /* @__PURE__ */ t("p", { css: ve.kicker[g], children: r("eventGame.headline") }),
4151
+ /* @__PURE__ */ t(Bt, { rules: e.event.rules || "", rulesDisplay: e.rulesDisplay, isOverlayVariant: !1 })
4152
+ ] }),
4153
+ /* @__PURE__ */ x("div", { css: ve.texts, children: [
4154
+ /* @__PURE__ */ t("p", { css: ve.title[g], children: e.event.title }),
4155
+ /* @__PURE__ */ t("p", { css: ve.description[g], children: dt(e.event.description) })
4156
+ ] })
4157
+ ] }),
4158
+ l && !c && /* @__PURE__ */ t("div", { children: z((a == null ? void 0 : a.contentColor) || s) })
4159
+ ] })
4160
+ }
4161
+ );
4162
+ return /* @__PURE__ */ t(De, { brandingBorderColor: (a == null ? void 0 : a.borderColor) || null, children: e.showPredictionDetails ? /* @__PURE__ */ x(
4163
+ In,
4164
+ {
4165
+ prediction: e.prediction,
4166
+ game: e.event,
4167
+ brandingColors: a,
4168
+ resultsTabPanelSxProps: {
4169
+ display: "flex",
4170
+ flexDirection: c ? "column" : "row",
4171
+ px: 0,
4172
+ pb: 0,
4173
+ pt: 0
4174
+ },
4175
+ children: [
4176
+ q(),
4177
+ D()
4178
+ ]
4179
+ }
4180
+ ) : /* @__PURE__ */ x(Q, { children: [
4181
+ q(),
4182
+ D()
4183
+ ] }) });
4184
+ }, Nr = (e) => {
4185
+ var f, d, l;
4186
+ const { t: i } = ie(), o = ((f = e.eventGame.branding) == null ? void 0 : f.colors) || null, r = Pe(), c = (o == null ? void 0 : o.primaryColor) || r.palette.primary.plainColor;
4187
+ return /* @__PURE__ */ t(
4188
+ So,
4189
+ {
4190
+ entity: e.eventGame,
4191
+ headline: i("eventGame.headline"),
4192
+ sdk: e.sdk,
4193
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4194
+ imagePosition: e.imagePosition,
4195
+ onLeadSubmitted: e.onSubmit,
4196
+ isSubmitting: e.isSubmitting,
4197
+ MainCard: De,
4198
+ PresentedBy: he,
4199
+ rulesDisplay: e.rulesDisplay,
4200
+ content: /* @__PURE__ */ t(
4201
+ Ze,
4202
+ {
4203
+ consents: e.consents,
4204
+ primaryColor: c,
4205
+ brandingUrls: (d = e.eventGame.branding) == null ? void 0 : d.urls,
4206
+ align: "center"
4207
+ }
4208
+ ),
4209
+ footerAction: /* @__PURE__ */ t(
4210
+ Ut,
4211
+ {
4212
+ onClick: e.onSubmit,
4213
+ label: ((l = e.consents.labels) == null ? void 0 : l.ctaLabel) || i("eventGame.buttons.play"),
4214
+ isSubmitting: e.isSubmitting,
4215
+ primaryColor: c,
4216
+ showArrow: !1
4217
+ }
4218
+ )
4219
+ }
4220
+ );
4221
+ }, jr = (e) => {
4222
+ var f, d;
4223
+ const { t: i } = ie(), o = ((f = e.eventGame.branding) == null ? void 0 : f.colors) || null, r = Pe(), c = (o == null ? void 0 : o.primaryColor) || r.palette.primary.plainColor;
4224
+ return /* @__PURE__ */ t(
4225
+ ko,
4226
+ {
4227
+ entity: e.eventGame,
4228
+ headline: i("eventGame.headline"),
4229
+ sdk: e.sdk,
4230
+ defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
4231
+ onLeadSubmitted: e.onSubmit,
4232
+ isSubmitting: e.isSubmitting,
4233
+ MainCard: De,
4234
+ PresentedBy: he,
4235
+ rulesDisplay: e.rulesDisplay,
4236
+ content: (
4237
+ // This template keeps its CTA inside the content frame, as its own Play button is
4238
+ /* @__PURE__ */ t(
4239
+ Ze,
4240
+ {
4241
+ consents: e.consents,
4242
+ primaryColor: c,
4243
+ brandingUrls: (d = e.eventGame.branding) == null ? void 0 : d.urls,
4244
+ onSubmit: e.onSubmit,
4245
+ isSubmitting: e.isSubmitting,
4246
+ ctaLabel: i("eventGame.buttons.play"),
4247
+ showArrow: !1,
4248
+ align: "center"
4249
+ }
4250
+ )
4251
+ )
4252
+ }
4253
+ );
4254
+ }, qr = (e) => {
4255
+ var f, d, l;
4256
+ const { t: i } = ie(), o = be(), r = ((f = e.eventGame.branding) == null ? void 0 : f.colors) || null, c = (r == null ? void 0 : r.primaryColor) || o.colorSchemes.dark.palette.primary.plainColor;
4257
+ return /* @__PURE__ */ t(
4258
+ wo,
4259
+ {
4260
+ entity: e.eventGame,
4261
+ headline: i("eventGame.headline"),
4262
+ sdk: e.sdk,
4263
+ defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
4264
+ onLeadSubmitted: e.onSubmit,
4265
+ isSubmitting: e.isSubmitting,
4266
+ PresentedBy: he,
4267
+ rulesDisplay: e.rulesDisplay,
4268
+ content: /* @__PURE__ */ t(
4269
+ Ze,
4270
+ {
4271
+ consents: e.consents,
4272
+ primaryColor: c,
4273
+ textColor: (r == null ? void 0 : r.contentColor) || o.colorSchemes.dark.textColor,
4274
+ brandingUrls: (d = e.eventGame.branding) == null ? void 0 : d.urls
4275
+ }
4276
+ ),
4277
+ footerAction: /* @__PURE__ */ t(
4278
+ Ut,
4279
+ {
4280
+ onClick: e.onSubmit,
4281
+ label: ((l = e.consents.labels) == null ? void 0 : l.ctaLabel) || i("eventGame.buttons.play"),
4282
+ isSubmitting: e.isSubmitting,
4283
+ primaryColor: c,
4284
+ showArrow: !1
4285
+ }
4286
+ )
4287
+ }
4288
+ );
4289
+ }, gn = { display: "flex", justifyContent: "center", alignItems: "center" }, Fi = (e, i, o) => n(pe, {
4290
+ ...gn,
4291
+ flexDirection: "row",
4292
+ gap: "8px",
4293
+ paddingBlock: u(i),
4294
+ paddingInline: u(o),
4295
+ borderRadius: "var(--fu-ucrc-eg-oss-radius-xl)",
4296
+ backgroundColor: "var(--fu-ucrc-secondary-container)",
4297
+ color: "var(--fu-ucrc-primary-solid-color, #fff)",
4298
+ fontSize: `${e}em`,
4299
+ fontWeight: 500,
4300
+ textTransform: "uppercase",
4301
+ "&:hover": { opacity: 0.9 },
4302
+ "& > div": { ...gn, gap: "8px" },
4303
+ "& p": {
4304
+ ...ae,
4305
+ color: "var(--fu-ucrc-eg-oss-secondary)",
4306
+ fontFamily: "var(--fu-ucrc-eg-oss-font-primary)",
4307
+ fontSize: `calc(1em / ${e})`,
4308
+ fontStyle: "normal",
4309
+ lineHeight: "24px",
4310
+ letterSpacing: "0.40px",
4311
+ textTransform: "uppercase"
4312
+ }
4313
+ }), Fe = {
4314
+ main: n({ display: "flex", flexDirection: "column", gap: "24px", zIndex: 10 }),
4315
+ // A blurred panel over the artwork, tinted by the content background at a quarter opacity.
4316
+ results: n({
4317
+ borderRadius: "var(--fu-ucrc-eg-oss-radius-md)",
4318
+ padding: u("md"),
4319
+ display: "flex",
4320
+ flexDirection: "column",
4321
+ alignItems: "center",
4322
+ alignSelf: "stretch",
4323
+ gap: u("md"),
4324
+ backdropFilter: "blur(4px)",
4325
+ position: "relative",
4326
+ "&::before": {
4327
+ content: '""',
4328
+ position: "absolute",
4329
+ top: 0,
4330
+ left: 0,
4331
+ right: 0,
4332
+ bottom: 0,
4333
+ backgroundColor: "var(--fu-ucrc-eg-oss-content-bg)",
4334
+ opacity: 0.25,
4335
+ borderRadius: "inherit",
4336
+ zIndex: 0,
4337
+ backdropFilter: "blur(4px)"
4338
+ },
4339
+ "& > *": { position: "relative", zIndex: 1 }
4340
+ }),
4341
+ resultsInner: n({
4342
+ display: "flex",
4343
+ flexDirection: "column",
4344
+ justifyContent: "center",
4345
+ alignItems: "center",
4346
+ alignSelf: "stretch"
4347
+ }),
4348
+ centered: n(gn),
4349
+ row: n({
4350
+ display: "flex",
4351
+ flexDirection: "row",
4352
+ alignItems: "center",
4353
+ justifyContent: "space-between",
4354
+ gap: u("md")
4355
+ }),
4356
+ additionalCta: Fi(0.8125, "sm", "md"),
4357
+ additionalCtaMobile: Fi(0.75, "xs", "sm")
4358
+ }, _r = (e) => {
4359
+ const i = be(), { t: o } = ie(), r = oe(), c = Mt(
4360
+ de.OVERLAY
4361
+ ), { brandingImage: f, brandingColors: d, brandingLogo: l } = Ft(e.eventGame.branding), a = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : r ? qe : _e, s = Me(
4362
+ { images: e.eventGame.images, imagePlaceholder: a },
4363
+ de.OVERLAY
4364
+ ), y = f || s, h = i.colorSchemes.dark, v = {
4365
+ "--fu-ucrc-eg-oss-secondary": (d == null ? void 0 : d.secondaryColor) || h.textSecondary,
4366
+ "--fu-ucrc-eg-oss-font-primary": oo(i.customFontFamily.light.primary),
4367
+ "--fu-ucrc-eg-oss-radius-md": i.customRadius.light.md,
4368
+ "--fu-ucrc-eg-oss-radius-xl": i.customRadius.light.xl,
4369
+ "--fu-ucrc-eg-oss-content-bg": (d == null ? void 0 : d.backgroundColor) || h.surfaceVariant
4370
+ }, g = e.eventGame.status === "OPEN" && e.prediction && e.onPredictionUpdate, b = (S) => {
4371
+ console.log(`Edit prediction for fixture at index: ${S}`);
4372
+ }, p = () => /* @__PURE__ */ t(
4373
+ he,
4374
+ {
4375
+ brandingLogo: l,
4376
+ textColor: h.textColor,
4377
+ label: null
4378
+ }
4379
+ ), C = () => /* @__PURE__ */ x("div", { css: Fe.main, style: v, children: [
4380
+ e.isUnauthorized ? /* @__PURE__ */ t(
4381
+ Pn,
4382
+ {
4383
+ variant: "error",
4384
+ title: o("common.authentication.accessRequired"),
4385
+ message: o("common.authentication.invalidOrMissingAuth")
4386
+ }
4387
+ ) : /* @__PURE__ */ t("div", { css: Fe.results, children: /* @__PURE__ */ t("div", { css: Fe.resultsInner, children: g ? /* @__PURE__ */ t(
4388
+ Ke,
4389
+ {
4390
+ fixtures: e.eventGame.fixtures,
4391
+ prediction: e.prediction,
4392
+ onEditPrediction: b,
4393
+ onPredictionUpdate: e.onPredictionUpdate,
4394
+ play: e.play,
4395
+ view: "score",
4396
+ isOverlayVariant: !0,
4397
+ brandingPrimaryColor: d == null ? void 0 : d.primaryColor
4398
+ }
4399
+ ) : null }) }),
4400
+ e.chanceGameContent,
4401
+ r ? /* @__PURE__ */ x(Q, { children: [
4402
+ e.additionalCTA && /* @__PURE__ */ t("div", { css: Fe.centered, children: /* @__PURE__ */ t(
4403
+ $t,
4404
+ {
4405
+ additionalCTA: e.additionalCTA,
4406
+ css: Fe.additionalCtaMobile
4407
+ }
4408
+ ) }),
4409
+ /* @__PURE__ */ t("div", { css: Fe.centered, children: p() })
4410
+ ] }) : (l || e.additionalCTA) && /* @__PURE__ */ x("div", { css: Fe.row, children: [
4411
+ p(),
4412
+ /* @__PURE__ */ t(
4413
+ $t,
4414
+ {
4415
+ additionalCTA: e.additionalCTA,
4416
+ css: Fe.additionalCta
4417
+ }
4418
+ )
4419
+ ] })
4420
+ ] });
4421
+ return /* @__PURE__ */ t(
4422
+ Po,
4423
+ {
4424
+ entity: { ...e.eventGame, labels: null },
4425
+ headline: o("eventGame.headline"),
4426
+ backgroundImage: ro(y),
4427
+ imageBackgroundGradient: c,
4428
+ rulesDisplay: e.rulesDisplay,
4429
+ children: C()
4430
+ }
4431
+ );
4432
+ }, Yr = (e) => {
4433
+ const i = (r, c) => {
4434
+ switch (r) {
4435
+ case H.NUMBER:
4436
+ return (c == null ? void 0 : c.min) !== null && (c == null ? void 0 : c.min) !== void 0 ? c.min : 0;
4437
+ case H.BOOLEAN:
4438
+ case H.ENUM:
4439
+ case H.FREE_INPUT:
4440
+ return null;
4441
+ }
4442
+ }, o = new fo();
4443
+ return o.fixtures = e.map((r) => ({
4444
+ id: r.id,
4445
+ predictionType: r.outcomeType,
4446
+ prediction: i(
4447
+ r.outcomeType,
4448
+ r.validOutcomes
4449
+ )
4450
+ })), o.tiebreaker = null, o;
4451
+ };
4452
+ function lt(e) {
4453
+ return e.template === de.STANDARD;
4454
+ }
4455
+ const Xr = (e) => {
4456
+ var U;
4457
+ const { t: i } = ie(), { game: o, points: r } = Fo(
4458
+ e.entityId,
4459
+ e.sdk,
4460
+ e.showPoints
4461
+ ), {
4462
+ myPrediction: c,
4463
+ setMyPrediction: f,
4464
+ isApiError: d,
4465
+ apiErrorMessage: l,
4466
+ setIsApiError: a,
4467
+ isUnauthorized: s,
4468
+ setIsUnauthorized: y,
4469
+ setApiErrorMessage: h
4470
+ } = Ho(e.entityId, e.sdk), [v, g] = N(!1), [b, p] = N(!1), [C, S] = N(!1), [T, R] = N(!1), [D, z] = N(!1), [q, Y] = N(!1), k = Ae(!1), [A, L] = N({
4471
+ fixtures: [],
4472
+ tiebreaker: null
4473
+ }), [O, le] = N({
4474
+ open: !1,
4475
+ variant: "success",
4476
+ title: "",
4477
+ message: ""
4478
+ }), {
4479
+ loading: se,
4480
+ pending: ce,
4481
+ checked: me,
4482
+ setChecked: j,
4483
+ allRequiredChecked: B,
4484
+ submit: te
4485
+ } = ao({
4486
+ sdk: e.sdk,
4487
+ consents: (U = e.consents) == null ? void 0 : U.items,
4488
+ // The SDK's ConsentEntityType has no event-game member, so only the id is recorded
4489
+ entityId: e.entityId
4490
+ }), ue = ce.filter(
4491
+ (I) => I.position !== "after"
4492
+ ), fe = ce.filter(
4493
+ (I) => I.position === "after"
4494
+ ), Ce = (I) => {
4495
+ j(I), z(!1);
4496
+ }, ye = (I) => {
4497
+ var M;
4498
+ return {
4499
+ items: I,
4500
+ checked: me,
4501
+ onChange: Ce,
4502
+ labels: (M = e.consents) == null ? void 0 : M.labels,
4503
+ showError: D
4504
+ };
4505
+ };
4506
+ Be(() => {
4507
+ se || k.current || p(ue.length > 0);
4508
+ }, [se, ue.length]);
4509
+ const xe = (I, M, X) => {
4510
+ le({
4511
+ open: !0,
4512
+ variant: I,
4513
+ title: M,
4514
+ message: X
4515
+ });
4516
+ }, Se = () => {
4517
+ le((I) => ({ ...I, open: !1 }));
4518
+ }, w = ft(() => o ? co(o.related) : null, [o]);
4519
+ if (Be(() => {
4520
+ o && o.status === "OPEN" && L(Yr(o.fixtures));
4521
+ }, [o == null ? void 0 : o.status]), !o || c === void 0)
4522
+ return /* @__PURE__ */ t(Io, { marginBlock: "160px" });
4523
+ if (!o.id)
4524
+ return /* @__PURE__ */ t(Gr, {});
4525
+ const K = () => {
4526
+ a(!1), y(!1), h("");
4527
+ };
4528
+ if (s || d)
4529
+ return lt(e) ? /* @__PURE__ */ t(
4530
+ Tr,
4531
+ {
4532
+ eventGame: o,
4533
+ imagePosition: e.imagePosition,
4534
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4535
+ isApiError: d,
4536
+ apiErrorMessage: l,
4537
+ toggleTryAgain: K
4538
+ }
4539
+ ) : e.template === de.OVERLAY ? /* @__PURE__ */ t(
4540
+ Er,
4541
+ {
4542
+ eventGame: o,
4543
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4544
+ isApiError: d,
4545
+ apiErrorMessage: l,
4546
+ toggleTryAgain: K
4547
+ }
4548
+ ) : /* @__PURE__ */ t(
4549
+ Dr,
4550
+ {
4551
+ eventGame: o,
4552
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4553
+ isApiError: d,
4554
+ apiErrorMessage: l,
4555
+ toggleTryAgain: K
4556
+ }
4557
+ );
4558
+ const ne = async () => {
4559
+ if (ue.length > 0) {
4560
+ if (q) return;
4561
+ if (!B(ue)) {
4562
+ z(!0);
4563
+ return;
4564
+ }
4565
+ Y(!0), await te(ue), Y(!1);
4566
+ }
4567
+ k.current = !0, p(!1);
4568
+ }, m = async () => {
4569
+ if (!B(fe)) {
4570
+ z(!0);
4571
+ return;
4572
+ }
4573
+ Y(!0), await te(fe), R(!0), await $(), Y(!1), S(!1);
4574
+ }, P = async () => fe.length > 0 && !T ? (S(!0), !1) : $(), $ = async () => {
4575
+ var X, ke;
4576
+ g(!0);
4577
+ let I = {
4578
+ fixtures: [],
4579
+ tiebreaker: null
4580
+ //TODO:
4581
+ };
4582
+ c ? I.fixtures = c.fixtures.map((G) => ({
4583
+ id: G.id,
4584
+ predictionType: G.predictionType,
4585
+ prediction: G.prediction
4586
+ })) : I = { ...A };
4587
+ let M = !1;
4588
+ try {
4589
+ const G = c ? await e.sdk.eventGame.updatePrediction(
4590
+ e.entityId,
4591
+ c.id,
4592
+ I
4593
+ ) : await e.sdk.eventGame.makePrediction(
4594
+ e.entityId,
4595
+ I
4596
+ );
4597
+ f(G), (ke = (X = e.callbacks) == null ? void 0 : X.onFinish) == null || ke.call(X, G), xe(
4598
+ "success",
4599
+ i("eventGame.alerts.play.success.title"),
4600
+ i("eventGame.alerts.play.success.message")
4601
+ ), M = !0;
4602
+ } catch (G) {
4603
+ console.error("[event-game-play] play failed", G);
4604
+ const { code: J, message: Le } = lo(G, e.sdk);
4605
+ J === 401 || J === 403 ? y(!0) : xe(
4606
+ "error",
4607
+ i("eventGame.alerts.play.error.title"),
4608
+ Le || i("eventGame.alerts.play.error.message")
4609
+ );
4610
+ } finally {
4611
+ g(!1);
4612
+ }
4613
+ return M;
4614
+ };
4615
+ if (C && fe.length > 0) {
4616
+ const I = {
4617
+ eventGame: o,
4618
+ sdk: e.sdk,
4619
+ consents: ye(fe),
4620
+ onSubmit: m,
4621
+ isSubmitting: q,
4622
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4623
+ rulesDisplay: e.rulesDisplay
4624
+ };
4625
+ return e.template === de.OVERLAY ? /* @__PURE__ */ t(qr, { ...I }) : lt(e) ? /* @__PURE__ */ t(
4626
+ Nr,
4627
+ {
4628
+ ...I,
4629
+ imagePosition: e.imagePosition
4630
+ }
4631
+ ) : /* @__PURE__ */ t(jr, { ...I });
4632
+ }
4633
+ const _ = () => {
4634
+ const I = ye(ue), M = fe.length > 0 && !T;
4635
+ return e.template === de.OVERLAY ? /* @__PURE__ */ t(Nt, { points: r || [], children: /* @__PURE__ */ t(
4636
+ Br,
4637
+ {
4638
+ isPlaying: v,
4639
+ prediction: A,
4640
+ sdk: e.sdk,
4641
+ leads: e.leads,
4642
+ eventGame: o,
4643
+ play: P,
4644
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4645
+ setPrediction: L,
4646
+ showCountdown: e.showCountdown,
4647
+ optionsLayout: e.optionsLayout,
4648
+ rulesDisplay: e.rulesDisplay,
4649
+ consents: I,
4650
+ applyConsentGate: b,
4651
+ hasAfterConsents: M,
4652
+ isSubmitting: q,
4653
+ startPredicting: ne
4654
+ }
4655
+ ) }) : lt(e) ? /* @__PURE__ */ t(Nt, { points: r || [], children: /* @__PURE__ */ t(
4656
+ vr,
4657
+ {
4658
+ isPlaying: v,
4659
+ sdk: e.sdk,
4660
+ leads: e.leads,
4661
+ eventGame: o,
4662
+ play: P,
4663
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4664
+ imagePosition: e.imagePosition,
4665
+ prediction: A,
4666
+ setPrediction: L,
4667
+ showCountdown: e.showCountdown,
4668
+ optionsLayout: e.optionsLayout,
4669
+ rulesDisplay: e.rulesDisplay,
4670
+ consents: I,
4671
+ applyConsentGate: b,
4672
+ hasAfterConsents: M,
4673
+ isSubmitting: q,
4674
+ startPredicting: ne
4675
+ }
4676
+ ) }) : /* @__PURE__ */ t(Nt, { points: r || [], children: /* @__PURE__ */ t(
4677
+ Hr,
4678
+ {
4679
+ isPlaying: v,
4680
+ prediction: A,
4681
+ sdk: e.sdk,
4682
+ leads: e.leads,
4683
+ eventGame: o,
4684
+ play: P,
4685
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4686
+ setPrediction: L,
4687
+ showCountdown: e.showCountdown,
4688
+ optionsLayout: e.optionsLayout,
4689
+ rulesDisplay: e.rulesDisplay,
4690
+ consents: I,
4691
+ applyConsentGate: b,
4692
+ hasAfterConsents: M,
4693
+ isSubmitting: q,
4694
+ startPredicting: ne
4695
+ }
4696
+ ) });
4697
+ };
4698
+ if (o.status === "SETTLED")
4699
+ return lt(e) ? /* @__PURE__ */ t(
4700
+ Ar,
4701
+ {
4702
+ sdk: e.sdk,
4703
+ eventGame: o,
4704
+ prediction: c,
4705
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4706
+ imagePosition: e.imagePosition,
4707
+ showPredictionDetails: e.showPredictionDetails,
4708
+ rulesDisplay: e.rulesDisplay
4709
+ }
4710
+ ) : e.template === de.OVERLAY ? /* @__PURE__ */ t(
4711
+ Ir,
4712
+ {
4713
+ sdk: e.sdk,
4714
+ game: o,
4715
+ prediction: c,
4716
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4717
+ showPredictionDetails: e.showPredictionDetails,
4718
+ rulesDisplay: e.rulesDisplay
4719
+ }
4720
+ ) : /* @__PURE__ */ t(
4721
+ Wr,
4722
+ {
4723
+ sdk: e.sdk,
4724
+ event: o,
4725
+ prediction: c,
4726
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4727
+ showPredictionDetails: e.showPredictionDetails,
4728
+ rulesDisplay: e.rulesDisplay
4729
+ }
4730
+ );
4731
+ if (c) {
4732
+ const I = w ? /* @__PURE__ */ t(Rn, { entityId: w, sdk: e.sdk, children: (X) => /* @__PURE__ */ t(An, { infoPage: X, variant: e.chanceGameVariant }) }) : void 0, M = w ? /* @__PURE__ */ t(Rn, { entityId: w, sdk: e.sdk, children: (X) => /* @__PURE__ */ t(An, { infoPage: X, variant: e.chanceGameVariant, forceMobile: !0 }) }) : void 0;
4733
+ return e.template === de.OVERLAY ? /* @__PURE__ */ x(Q, { children: [
4734
+ /* @__PURE__ */ t(
4735
+ _r,
4736
+ {
4737
+ sdk: e.sdk,
4738
+ leads: e.leads,
4739
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4740
+ isUnauthorized: s,
4741
+ eventGame: o,
4742
+ prediction: c,
4743
+ onPredictionUpdate: L,
4744
+ play: P,
4745
+ additionalCTA: e.additionalCTA,
4746
+ rulesDisplay: e.rulesDisplay,
4747
+ chanceGameContent: I
4748
+ }
4749
+ ),
4750
+ /* @__PURE__ */ t(
4751
+ pt,
4752
+ {
4753
+ notification: O,
4754
+ onClose: Se
4755
+ }
4756
+ )
4757
+ ] }) : lt(e) ? /* @__PURE__ */ x(Q, { children: [
4758
+ /* @__PURE__ */ t(
4759
+ br,
4760
+ {
4761
+ imagePosition: e.imagePosition || "left",
4762
+ eventGame: o,
4763
+ sdk: e.sdk,
4764
+ leads: e.leads,
4765
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4766
+ isUnauthorized: s,
4767
+ prediction: c,
4768
+ onPredictionUpdate: L,
4769
+ play: P,
4770
+ additionalCTA: e.additionalCTA,
4771
+ rulesDisplay: e.rulesDisplay,
4772
+ chanceGameContent: M
4773
+ }
4774
+ ),
4775
+ /* @__PURE__ */ t(
4776
+ pt,
4777
+ {
4778
+ notification: O,
4779
+ onClose: Se
4780
+ }
4781
+ )
4782
+ ] }) : /* @__PURE__ */ x(Q, { children: [
4783
+ /* @__PURE__ */ t(
4784
+ Cr,
4785
+ {
4786
+ eventGame: o,
4787
+ sdk: e.sdk,
4788
+ leads: e.leads,
4789
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4790
+ isUnauthorized: s,
4791
+ prediction: c,
4792
+ onPredictionUpdate: L,
4793
+ play: P,
4794
+ additionalCTA: e.additionalCTA,
4795
+ rulesDisplay: e.rulesDisplay,
4796
+ chanceGameContent: M
4797
+ }
4798
+ ),
4799
+ /* @__PURE__ */ t(pt, { notification: O, onClose: Se })
4800
+ ] });
4801
+ }
4802
+ return /* @__PURE__ */ x(Q, { children: [
4803
+ _(),
4804
+ /* @__PURE__ */ t(pt, { notification: O, onClose: Se })
4805
+ ] });
4806
+ }, Zr = (e) => {
4807
+ var o;
4808
+ const i = Ye.useMemo(
4809
+ () => e.template === de.OVERLAY ? { ...e.themeOptions, mode: "dark" } : e.themeOptions,
4810
+ [e.template, e.themeOptions]
4811
+ );
4812
+ return /* @__PURE__ */ t(
4813
+ Go,
4814
+ {
4815
+ packageName: "event-game-play",
4816
+ language: e.language,
4817
+ themeOptions: i,
4818
+ disableCache: e.disableCache,
4819
+ optionsLayout: e.optionsLayout,
4820
+ leadPhoneCountryCode: (o = e.leads) == null ? void 0 : o.phoneCountryCode,
4821
+ children: e.children
4822
+ }
4823
+ );
4824
+ }, sa = (e) => /* @__PURE__ */ t(Zr, { ...e, children: /* @__PURE__ */ t(Xr, { ...e }) });
4825
+ export {
4826
+ sa as M
4827
+ };