fansunited-frontend-components 1.1.0 → 1.1.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.
package/BattleOfFans.js CHANGED
@@ -1,13 +1,13 @@
1
- import { jsx as l, Fragment as Wt, jsxs as b } from "@emotion/react/jsx-runtime";
2
- import { space as at, radius as lt, LeadForm as Pn, Notification as Ln, WidgetPortal as Tn } from "fansunited-frontend-core/ui/emotion";
3
- import en, { useState as T, useRef as on, useEffect as Ft, useMemo as j, useCallback as At } from "react";
4
- import { useTranslation as mt } from "react-i18next";
5
- import { useDisableCache as Nn, extractSdkError as xt, getSportsApiCredentials as Dn, hexColor as rn, fetchSearchEntitiesByIds as Bn, contrastRatio as pt, standsOut as Ct, cdnAssets as zn, initialsOf as Mn, useIsRtl as Rt, useIntlLocale as sn, useIsMobile as Vn, useColors as Hn, stripHtmlTags as An } from "fansunited-frontend-core";
6
- import { a as an, u as jn, O as _n } from "./chunks/OddsSkeleton-DP5Yfqpr.js";
7
- import { keyframes as ot, css as d } from "@emotion/react";
8
- import { EmojiEventsIcon as Gn, CheckIcon as qn, LockOutlinedIcon as Un } from "fansunited-frontend-core/ui/icons";
1
+ import { jsx as a, Fragment as Ot, jsxs as b } from "@emotion/react/jsx-runtime";
2
+ import { space as dt, radius as ut, LeadForm as zn, Notification as An, WidgetPortal as Vn } from "fansunited-frontend-core/ui/emotion";
3
+ import dn, { useState as A, useRef as un, useEffect as ht, useMemo as q, useCallback as qt } from "react";
4
+ import { useTranslation as bt } from "react-i18next";
5
+ import { useDisableCache as _n, extractSdkError as vt, getSportsApiCredentials as Hn, hexColor as pn, fetchSearchEntitiesByIds as jn, contrastRatio as gt, standsOut as Ft, cdnAssets as Gn, initialsOf as qn, useIsRtl as Pt, useIntlLocale as mn, useIsMobile as Un, useColors as Yn, stripHtmlTags as Xn } from "fansunited-frontend-core";
6
+ import { a as fn, u as Kn, O as Jn } from "./chunks/OddsSkeleton-DP5Yfqpr.js";
7
+ import { keyframes as rt, css as d } from "@emotion/react";
8
+ import { EmojiEventsIcon as Qn, CheckIcon as Zn, LockOutlinedIcon as te } from "fansunited-frontend-core/ui/icons";
9
9
  import "fansunited-sdk-esm/enums";
10
- import { w as Yn } from "./chunks/withVersionStamp-Cck3fT4t.js";
10
+ import { w as ne } from "./chunks/withVersionStamp-CzdDF1rG.js";
11
11
  const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
12
12
  fontPrimary: "var(--fu-ucrc-font-primary)",
13
13
  fontSecondary: "var(--fu-ucrc-font-secondary)",
@@ -24,25 +24,25 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
24
24
  shadow: "rgba(var(--fu-ucrc-shadow-channel) / var(--fu-ucrc-shadow-opacity))",
25
25
  trophy: "var(--fu-ucrc-warning-plain-color)",
26
26
  trophyOn: "var(--bof-trophy-on)",
27
- spaceXs: at("xs"),
28
- spaceSm: at("sm"),
29
- spaceMd: at("md"),
30
- spaceLg: at("lg"),
31
- radiusSm: lt("sm"),
32
- radiusMd: lt("md"),
33
- radiusLg: lt("lg"),
34
- radiusFull: lt("full"),
27
+ spaceXs: dt("xs"),
28
+ spaceSm: dt("sm"),
29
+ spaceMd: dt("md"),
30
+ spaceLg: dt("lg"),
31
+ radiusSm: ut("sm"),
32
+ radiusMd: ut("md"),
33
+ radiusLg: ut("lg"),
34
+ radiusFull: ut("full"),
35
35
  fill: "var(--bof-fill)",
36
36
  on: "var(--bof-on)",
37
37
  ink: "var(--bof-ink)",
38
38
  /** The side colour mixed into the card, at `--bof-tint`. */
39
39
  tint: "color-mix(in srgb, var(--bof-fill) var(--bof-tint), var(--fu-ucrc-surface))"
40
- }, et = {
40
+ }, ot = {
41
41
  logo: "drop-shadow(0 3px 6px rgba(0,0,0,0.18))",
42
42
  winnerLogo: "drop-shadow(0 8px 14px rgba(0,0,0,0.35))",
43
43
  winnerHeadshot: "0 10px 22px -10px rgba(0,0,0,0.5)",
44
44
  trophy: "0 4px 10px -3px rgba(0,0,0,0.45)"
45
- }, Xn = "@media (prefers-reduced-motion: reduce)", Z = {
45
+ }, ee = "@media (prefers-reduced-motion: reduce)", tt = {
46
46
  pad: 24,
47
47
  arenaBar: 238,
48
48
  arenaFill: 324,
@@ -72,7 +72,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
72
72
  trophy: 40,
73
73
  trophyRing: 3,
74
74
  slant: 4
75
- }, tt = {
75
+ }, nt = {
76
76
  pad: 16,
77
77
  arenaBar: 196,
78
78
  arenaFill: 264,
@@ -102,18 +102,18 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
102
102
  trophy: 28,
103
103
  trophyRing: 2,
104
104
  slant: 3
105
- }, kt = 76, I = ([t, n]) => ({
105
+ }, $t = 76, I = ([t, n]) => ({
106
106
  fontSize: s(t),
107
107
  lineHeight: n / t
108
- }), St = ot({
108
+ }), Ct = rt({
109
109
  "0%, 100%": { opacity: 1 },
110
110
  "50%": { opacity: 0.45 }
111
- }), jt = {
111
+ }), Ut = {
112
112
  margin: 0,
113
113
  fontFamily: i.fontPrimary,
114
114
  fontWeight: 700,
115
115
  letterSpacing: "-0.01em"
116
- }, _t = (t, n) => ({
116
+ }, Yt = (t, n) => ({
117
117
  root: d({
118
118
  fontSize: "1em",
119
119
  boxSizing: "border-box",
@@ -129,7 +129,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
129
129
  boxShadow: `0 1px 2px 0 ${i.shadow}, 0 2px 4px 0 ${i.shadow}`,
130
130
  "--bof-tint": "10%",
131
131
  ".dark &": { "--bof-tint": "26%" },
132
- [Xn]: {
132
+ [ee]: {
133
133
  "& *, & *::before, & *::after": {
134
134
  animation: "none !important",
135
135
  transition: "none !important"
@@ -159,7 +159,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
159
159
  }),
160
160
  // Title and open subtitle can be poll (CMS) text, in any language.
161
161
  title: d({
162
- ...jt,
162
+ ...Ut,
163
163
  unicodeBidi: "plaintext",
164
164
  ...I(n ? [22, 28] : [28, 34])
165
165
  }),
@@ -205,7 +205,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
205
205
  arenaSkeleton: d({
206
206
  borderRadius: i.radiusMd,
207
207
  backgroundColor: i.inner,
208
- animation: `${St} 1.5s ease-in-out infinite`
208
+ animation: `${Ct} 1.5s ease-in-out infinite`
209
209
  }),
210
210
  resultsSkeleton: d({
211
211
  height: s(t.pctBar[1] + (n ? 8 : 10) + t.bar),
@@ -223,14 +223,14 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
223
223
  height: s(t.bar),
224
224
  borderRadius: i.radiusFull,
225
225
  backgroundColor: i.track,
226
- animation: `${St} 1.5s ease-in-out infinite`
226
+ animation: `${Ct} 1.5s ease-in-out infinite`
227
227
  }),
228
228
  titleSkeleton: d({
229
229
  width: s(n ? 170 : 220),
230
230
  height: s(n ? 28 : 34),
231
231
  borderRadius: i.radiusSm,
232
232
  backgroundColor: i.inner,
233
- animation: `${St} 1.5s ease-in-out infinite`
233
+ animation: `${Ct} 1.5s ease-in-out infinite`
234
234
  }),
235
235
  message: d({
236
236
  display: "flex",
@@ -244,7 +244,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
244
244
  padding: i.spaceLg,
245
245
  boxSizing: "border-box"
246
246
  }),
247
- messageTitle: d({ ...jt, ...I([18, 24]) }),
247
+ messageTitle: d({ ...Ut, ...I([18, 24]) }),
248
248
  messageText: d({ margin: 0, color: i.dim, ...I([14, 20]) }),
249
249
  retry: d({
250
250
  marginTop: s(8, 15),
@@ -263,7 +263,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
263
263
  outlineOffset: "2px"
264
264
  }
265
265
  })
266
- }), Gt = (t) => ({
266
+ }), Xt = (t) => ({
267
267
  root: d(
268
268
  t ? {
269
269
  width: "100%",
@@ -325,39 +325,39 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
325
325
  fontSize: s(20),
326
326
  color: i.dim
327
327
  })
328
- }), y = { d: _t(Z, !1), m: _t(tt, !0) }, q = { d: Gt(!1), m: Gt(!0) }, Kn = "battle-of-fans", Jn = "voting_ends_at", qt = { team: "team", player: "player" }, Qn = (t) => {
328
+ }), y = { d: Yt(tt, !1), m: Yt(nt, !0) }, Y = { d: Xt(!1), m: Xt(!0) }, oe = "battle-of-fans", re = "voting_ends_at", ie = "voting_starts_at", Kt = 5 * 6e4, se = 15e3, Jt = { team: "team", player: "player" }, ae = (t) => {
329
329
  var r;
330
330
  const n = (((r = t.context) == null ? void 0 : r.tags) ?? []).filter(
331
- (o) => !!(o != null && o.id) && !!qt[(o.type ?? "").toLowerCase()]
331
+ (o) => !!(o != null && o.id) && !!Jt[(o.type ?? "").toLowerCase()]
332
332
  ), e = t.options ?? [];
333
333
  return n.length !== e.length && console.warn(
334
334
  `BattleOfFans: poll ${t.id} has ${e.length} options and ${n.length} team/player tags; using the first ${Math.min(n.length, e.length)}.`
335
- ), e.slice(0, n.length).map((o, a) => ({
335
+ ), e.slice(0, n.length).map((o, l) => ({
336
336
  optionId: o.id,
337
- entityId: n[a].id,
338
- kind: qt[n[a].type.toLowerCase()],
337
+ entityId: n[l].id,
338
+ kind: Jt[n[l].type.toLowerCase()],
339
339
  title: o.title ?? ""
340
340
  }));
341
- }, Zn = (t) => t.split("-")[0].toUpperCase(), te = (t, n) => {
342
- var o, a;
341
+ }, le = (t) => t.split("-")[0].toUpperCase(), ce = (t, n) => {
342
+ var o, l;
343
343
  if (!t) return null;
344
- const e = Zn(n);
345
- return (((a = (o = t.translations) == null ? void 0 : o.find(
344
+ const e = le(n);
345
+ return (((l = (o = t.translations) == null ? void 0 : o.find(
346
346
  (u) => {
347
347
  var m;
348
348
  return ((m = u.language) == null ? void 0 : m.toUpperCase()) === e;
349
349
  }
350
- )) == null ? void 0 : a.name) ?? t.name ?? "").trim() || null;
351
- }, ne = (t, n) => {
350
+ )) == null ? void 0 : l.name) ?? t.name ?? "").trim() || null;
351
+ }, de = (t, n) => {
352
352
  var e, r;
353
353
  return ((r = (e = t == null ? void 0 : t.assets) == null ? void 0 : e.find((o) => o.key === (n === "team" ? "LOGO" : "HEADSHOT"))) == null ? void 0 : r.value) ?? null;
354
- }, ln = (t) => {
354
+ }, hn = (t) => {
355
355
  var n, e;
356
356
  return ((e = (n = t == null ? void 0 : t.related) == null ? void 0 : n.find((r) => {
357
357
  var o;
358
358
  return ((o = r.relationship) == null ? void 0 : o.toUpperCase()) === "TEAM";
359
359
  })) == null ? void 0 : e.related_id) ?? null;
360
- }, ee = (t, n) => {
360
+ }, ue = (t, n) => {
361
361
  var r;
362
362
  const e = (r = t == null ? void 0 : t.metadata) == null ? void 0 : r.branding;
363
363
  return [
@@ -365,33 +365,33 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
365
365
  e == null ? void 0 : e.secondary_color,
366
366
  e == null ? void 0 : e.tertiary_color
367
367
  ].map((o) => n(o)).filter((o) => !!o);
368
- }, oe = (t, n, e, r) => t.map((o) => {
369
- const a = n.get(o.entityId), u = o.kind === "player" ? n.get(ln(a) ?? "") : a;
368
+ }, pe = (t, n, e, r) => t.map((o) => {
369
+ const l = n.get(o.entityId), u = o.kind === "player" ? n.get(hn(l) ?? "") : l;
370
370
  return {
371
371
  ...o,
372
- name: te(a, e) ?? o.title,
373
- image: ne(a, o.kind),
374
- brand: ee(u, r)
372
+ name: ce(l, e) ?? o.title,
373
+ image: de(l, o.kind),
374
+ brand: ue(u, r)
375
375
  };
376
- }), re = (t) => {
376
+ }), me = (t) => {
377
377
  const n = t.reduce((u, m) => u + Math.max(0, m), 0);
378
378
  if (n === 0) return t.map(() => 0);
379
379
  const e = t.map((u) => Math.max(0, u) / n * 100), r = e.map(Math.floor);
380
380
  let o = 100 - r.reduce((u, m) => u + m, 0);
381
- const a = e.map((u, m) => ({ i: m, rest: u - Math.floor(u) })).sort((u, m) => m.rest - u.rest || u.i - m.i);
382
- for (const { i: u } of a) {
381
+ const l = e.map((u, m) => ({ i: m, rest: u - Math.floor(u) })).sort((u, m) => m.rest - u.rest || u.i - m.i);
382
+ for (const { i: u } of l) {
383
383
  if (o <= 0) break;
384
384
  r[u] += 1, o -= 1;
385
385
  }
386
386
  return r;
387
- }, ie = (t) => {
387
+ }, fe = (t) => {
388
388
  const n = Math.max(...t);
389
389
  return n > 0 && t.filter((r) => r === n).length === 1 ? t.indexOf(n) : null;
390
- }, se = (t) => {
390
+ }, Qt = (t) => {
391
391
  if (!t) return null;
392
392
  const n = Date.parse(t);
393
393
  return Number.isNaN(n) ? null : n;
394
- }, ae = (t, n) => {
394
+ }, Zt = (t, n) => {
395
395
  const e = Math.max(0, Math.floor((t - n) / 1e3));
396
396
  return {
397
397
  days: Math.floor(e / 86400),
@@ -399,13 +399,13 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
399
399
  minutes: Math.floor(e % 3600 / 60),
400
400
  seconds: e % 60
401
401
  };
402
- }, le = [401, 403, 404], ce = async (t, n, e, r) => {
403
- const o = /* @__PURE__ */ new Map(), a = Dn(t);
404
- if (!a) return o;
402
+ }, he = [401, 403, 404], ge = async (t, n, e, r) => {
403
+ const o = /* @__PURE__ */ new Map(), l = Hn(t);
404
+ if (!l) return o;
405
405
  const u = async (c) => {
406
406
  if (!c.length) return;
407
- (await Bn(
408
- a,
407
+ (await jn(
408
+ l,
409
409
  c,
410
410
  {
411
411
  signal: e,
@@ -415,75 +415,75 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
415
415
  ).catch(() => [])).forEach((p) => p.id && o.set(p.id, p));
416
416
  };
417
417
  await u(n.map((c) => c.entityId));
418
- const m = n.filter((c) => c.kind === "player").map((c) => ln(o.get(c.entityId))).filter((c) => !!c && !o.has(c));
418
+ const m = n.filter((c) => c.kind === "player").map((c) => hn(o.get(c.entityId))).filter((c) => !!c && !o.has(c));
419
419
  return await u(m), o;
420
- }, de = (t) => {
420
+ }, be = (t) => {
421
421
  var n;
422
422
  return t != null && t.id ? ((n = t.optionIds) == null ? void 0 : n[0]) ?? t.optionId ?? null : null;
423
- }, ue = (t) => {
424
- var z;
425
- const { entityId: n, sdk: e, language: r, userIsLoggedIn: o } = t, a = Nn(), [u, m] = T("loading"), [c, f] = T(null), [p, h] = T(0), [R, P] = T(!1), [U, E] = T(!1), [_, $] = T(null), k = on(t.callbacks);
426
- k.current = t.callbacks, Ft(() => {
423
+ }, ye = (t) => {
424
+ var st, H;
425
+ const { entityId: n, sdk: e, language: r, userIsLoggedIn: o } = t, l = _n(), [u, m] = A("loading"), [c, f] = A(null), [p, h] = A(0), [F, B] = A(!1), [X, T] = A(!1), [U, $] = A(null), S = un(t.callbacks);
426
+ S.current = t.callbacks, ht(() => {
427
427
  const C = new AbortController();
428
- let S = !1;
429
- return m("loading"), E(!1), (async () => {
430
- let x;
428
+ let x = !1;
429
+ return m("loading"), T(!1), (async () => {
430
+ let v;
431
431
  try {
432
- x = await e.voting.getPollById(n, a);
433
- } catch (V) {
434
- if (S) return;
432
+ v = await e.voting.getPollById(n, l);
433
+ } catch (P) {
434
+ if (x) return;
435
435
  m(
436
- xt(V, e).code === 404 ? "notFound" : "error"
436
+ vt(P, e).code === 404 ? "notFound" : "error"
437
437
  );
438
438
  return;
439
439
  }
440
- const w = x != null && x.id && (x.type ?? "").toLowerCase() === Kn ? Qn(x) : [];
440
+ const w = v != null && v.id && (v.type ?? "").toLowerCase() === oe ? ae(v) : [];
441
441
  if (w.length < 2) {
442
- S || m("notFound");
442
+ x || m("notFound");
443
443
  return;
444
444
  }
445
- const Y = x.authRequirement === "REGISTERED" && !o ? Promise.resolve(null) : e.voting.getMyPollVote(n).catch((V) => {
446
- if (le.includes(xt(V, e).code))
445
+ const D = v.authRequirement === "REGISTERED" && !o ? Promise.resolve(null) : e.voting.getMyPollVote(n).catch((P) => {
446
+ if (he.includes(vt(P, e).code))
447
447
  return null;
448
- throw V;
448
+ throw P;
449
449
  });
450
450
  try {
451
- const [V, nt] = await Promise.all([
452
- Y,
453
- ce(e, w, C.signal, a)
451
+ const [P, et] = await Promise.all([
452
+ D,
453
+ ge(e, w, C.signal, l)
454
454
  ]);
455
- if (S) return;
455
+ if (x) return;
456
456
  f({
457
- poll: x,
457
+ poll: v,
458
458
  refs: w,
459
- entities: nt,
460
- votedOptionId: de(V)
459
+ entities: et,
460
+ votedOptionId: be(P)
461
461
  }), m("ready");
462
462
  } catch {
463
- S || m("error");
463
+ x || m("error");
464
464
  }
465
465
  })(), () => {
466
- S = !0, C.abort();
466
+ x = !0, C.abort();
467
467
  };
468
- }, [n, e, a, o, p]);
469
- const rt = j(
470
- () => c ? oe(c.refs, c.entities, r, rn) : [],
468
+ }, [n, e, l, o, p]);
469
+ const it = q(
470
+ () => c ? pe(c.refs, c.entities, r, pn) : [],
471
471
  [c, r]
472
- ), O = j(
472
+ ), E = q(
473
473
  () => c ? c.refs.map(
474
474
  (C) => {
475
- var S;
476
- return ((S = c.poll.options.find((M) => M.id === C.optionId)) == null ? void 0 : S.votes) ?? 0;
475
+ var x;
476
+ return ((x = c.poll.options.find((M) => M.id === C.optionId)) == null ? void 0 : x.votes) ?? 0;
477
477
  }
478
478
  ) : [],
479
479
  [c]
480
- ), G = At(
480
+ ), z = qt(
481
481
  async (C) => {
482
- var S, M;
483
- if (!(!c || R || c.votedOptionId)) {
484
- P(!0);
482
+ var x, M;
483
+ if (!(!c || F || c.votedOptionId)) {
484
+ B(!0);
485
485
  try {
486
- const x = await e.voting.voteForPoll(n, C);
486
+ const v = await e.voting.voteForPoll(n, C);
487
487
  f(
488
488
  (w) => w && {
489
489
  ...w,
@@ -492,149 +492,150 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
492
492
  ...w.poll,
493
493
  totalVotes: (w.poll.totalVotes ?? 0) + 1,
494
494
  options: w.poll.options.map(
495
- (L) => L.id === C ? { ...L, votes: (L.votes ?? 0) + 1 } : L
495
+ (N) => N.id === C ? { ...N, votes: (N.votes ?? 0) + 1 } : N
496
496
  )
497
497
  }
498
498
  }
499
- ), (M = (S = k.current) == null ? void 0 : S.onFinish) == null || M.call(S, x);
500
- } catch (x) {
501
- const { code: w, message: L } = xt(x, e);
502
- w === 401 || w === 403 ? E(!0) : $(L);
499
+ ), (M = (x = S.current) == null ? void 0 : x.onFinish) == null || M.call(x, v);
500
+ } catch (v) {
501
+ const { code: w, message: N } = vt(v, e);
502
+ w === 401 || w === 403 ? T(!0) : $(N);
503
503
  } finally {
504
- P(!1);
504
+ B(!1);
505
505
  }
506
506
  }
507
507
  },
508
- [n, e, c, R]
509
- ), ft = At(() => {
510
- e.voting.getPollById(n, a).then(
508
+ [n, e, c, F]
509
+ ), L = qt(() => {
510
+ e.voting.getPollById(n, l).then(
511
511
  (C) => f(
512
- (S) => S && (C != null && C.id) ? { ...S, poll: C } : S
512
+ (x) => x && (C != null && C.id) ? { ...x, poll: C } : x
513
513
  )
514
514
  ).catch(() => {
515
515
  });
516
- }, [n, e, a]), B = (c == null ? void 0 : c.poll) ?? null;
516
+ }, [n, e, l]), O = (c == null ? void 0 : c.poll) ?? null;
517
517
  return {
518
518
  status: u,
519
- poll: B,
520
- sides: rt,
521
- votes: O,
519
+ poll: O,
520
+ sides: it,
521
+ votes: E,
522
522
  votedOptionId: (c == null ? void 0 : c.votedOptionId) ?? null,
523
- endMs: se((z = B == null ? void 0 : B.customFields) == null ? void 0 : z[Jn]),
524
- signInRequired: U || (B == null ? void 0 : B.authRequirement) === "REGISTERED" && !o,
525
- submitting: R,
526
- voteError: _,
523
+ startMs: Qt((st = O == null ? void 0 : O.customFields) == null ? void 0 : st[ie]),
524
+ endMs: Qt((H = O == null ? void 0 : O.customFields) == null ? void 0 : H[re]),
525
+ signInRequired: X || (O == null ? void 0 : O.authRequirement) === "REGISTERED" && !o,
526
+ submitting: F,
527
+ voteError: U,
527
528
  clearVoteError: () => $(null),
528
- vote: G,
529
+ vote: z,
529
530
  retry: () => h((C) => C + 1),
530
- refresh: ft
531
+ refresh: L
531
532
  };
532
- }, pe = (t) => {
533
- const { t: n } = mt("common");
534
- return j(
533
+ }, xe = (t) => {
534
+ const { t: n } = bt("common");
535
+ return q(
535
536
  () => (e, r) => {
536
537
  const o = t == null ? void 0 : t[e];
537
538
  return typeof o == "string" && o.trim() ? o : n(`battleOfFans.${e}`, r ?? {});
538
539
  },
539
540
  [t, n]
540
541
  );
541
- }, me = (t) => {
542
- const [n, e] = T(() => Date.now()), r = t !== null && n >= t;
543
- return Ft(() => {
542
+ }, ke = (t) => {
543
+ const [n, e] = A(() => Date.now()), r = t !== null && n >= t;
544
+ return ht(() => {
544
545
  if (t === null || r) return;
545
546
  const o = setInterval(() => e(Date.now()), 1e3);
546
547
  return () => clearInterval(o);
547
548
  }, [t, r]), n;
548
- }, Ut = (t) => {
549
- const n = rn(t);
549
+ }, tn = (t) => {
550
+ const n = pn(t);
550
551
  if (!n) return null;
551
552
  const [e, r, o] = [1, 3, 5].map(
552
553
  (c) => parseInt(n.slice(c, c + 2), 16) / 255
553
- ), a = Math.max(e, r, o), u = a - Math.min(e, r, o);
554
- return u < 0.12 ? null : ((a === e ? (r - o) / u % 6 : a === r ? (o - e) / u + 2 : (e - r) / u + 4) * 60 + 360) % 360;
555
- }, J = (t, n) => {
556
- if (!Ct(t, n)) return !0;
557
- const e = Ut(t), r = Ut(n);
558
- if (e === null || r === null) return (pt(t, n) ?? 1) < 2;
554
+ ), l = Math.max(e, r, o), u = l - Math.min(e, r, o);
555
+ return u < 0.12 ? null : ((l === e ? (r - o) / u % 6 : l === r ? (o - e) / u + 2 : (e - r) / u + 4) * 60 + 360) % 360;
556
+ }, Q = (t, n) => {
557
+ if (!Ft(t, n)) return !0;
558
+ const e = tn(t), r = tn(n);
559
+ if (e === null || r === null) return (gt(t, n) ?? 1) < 2;
559
560
  const o = Math.abs(e - r);
560
561
  return Math.min(o, 360 - o) < 35;
561
- }, fe = (t, n) => {
562
+ }, Se = (t, n) => {
562
563
  const e = [n.primary, n.text, ...n.extras], r = t.map(
563
- (a) => a.filter((u) => Ct(u, n.surface))
564
+ (l) => l.filter((u) => Ft(u, n.surface))
564
565
  ), o = r.map(
565
- (a, u) => a[0] ?? e[u % e.length]
566
+ (l, u) => l[0] ?? e[u % e.length]
566
567
  );
567
- for (let a = 1; a < o.length; a += 1) {
568
- const u = o.slice(0, a);
569
- if (!u.some((p) => J(p, o[a]))) continue;
570
- const m = r[a].slice(1).find((p) => !u.some((h) => J(h, p)));
568
+ for (let l = 1; l < o.length; l += 1) {
569
+ const u = o.slice(0, l);
570
+ if (!u.some((p) => Q(p, o[l]))) continue;
571
+ const m = r[l].slice(1).find((p) => !u.some((h) => Q(h, p)));
571
572
  if (m) {
572
- o[a] = m;
573
+ o[l] = m;
573
574
  continue;
574
575
  }
575
576
  let c = !1;
576
- for (let p = 0; p < a && !c; p += 1) {
577
- if (!J(o[p], o[a])) continue;
577
+ for (let p = 0; p < l && !c; p += 1) {
578
+ if (!Q(o[p], o[l])) continue;
578
579
  const h = r[p].slice(1).find(
579
- (R) => o.slice(0, a + 1).every((P, U) => U === p || !J(P, R))
580
+ (F) => o.slice(0, l + 1).every((B, X) => X === p || !Q(B, F))
580
581
  );
581
- h && (o[p] = h), c = !o.slice(0, a).some((R) => J(R, o[a]));
582
+ h && (o[p] = h), c = !o.slice(0, l).some((F) => Q(F, o[l]));
582
583
  }
583
584
  if (c) continue;
584
- const f = e.find((p) => !u.some((h) => J(h, p)));
585
- f && u.some((p) => !Ct(p, o[a])) && (o[a] = f);
585
+ const f = e.find((p) => !u.some((h) => Q(h, p)));
586
+ f && u.some((p) => !Ft(p, o[l])) && (o[l] = f);
586
587
  }
587
588
  return o;
588
- }, cn = (t, n) => {
589
- if ((pt(n.onPrimary, t) ?? 21) >= 4.5)
589
+ }, gn = (t, n) => {
590
+ if ((gt(n.onPrimary, t) ?? 21) >= 4.5)
590
591
  return n.onPrimary;
591
592
  const e = [n.onPrimary, n.text, n.surface];
592
593
  let r = e[0], o = -1;
593
- for (const a of e) {
594
- const u = pt(a, t) ?? -1;
595
- u > o && (r = a, o = u);
594
+ for (const l of e) {
595
+ const u = gt(l, t) ?? -1;
596
+ u > o && (r = l, o = u);
596
597
  }
597
598
  return r;
598
- }, he = (t, n, e = 3) => (pt(t, n.surface) ?? 21) >= e ? t : n.text, ge = (t, n) => fe(t, n).map((e) => ({
599
+ }, Ie = (t, n, e = 3) => (gt(t, n.surface) ?? 21) >= e ? t : n.text, ve = (t, n) => Se(t, n).map((e) => ({
599
600
  fill: e,
600
- on: cn(e, n),
601
- ink: he(e, n)
602
- })), be = (t, n, e) => Math.max(n, Math.min(e, t)), ye = (t, n) => {
601
+ on: gn(e, n),
602
+ ink: Ie(e, n)
603
+ })), $e = (t, n, e) => Math.max(n, Math.min(e, t)), Ce = (t, n) => {
603
604
  const e = t.length, r = 100 / e;
604
605
  if (t.every((c) => c === 0)) return t.map(() => r);
605
- const o = r * (n || e > 2 ? 0.8 : 0.6), a = t.map((c) => Math.max(c, o)), u = a.reduce((c, f) => c + f, 0) - 100, m = a.reduce((c, f) => c + (f - o), 0);
606
- return a.map((c) => m > 0 ? c - (c - o) / m * u : r);
607
- }, xe = (t, n, e, r) => {
608
- const o = t.length, a = e ? be(t[n], r ? 60 : 56, r ? 68 : 74) : 64, u = 100 - a, c = t.filter((f, p) => p !== n).reduce((f, p) => f + p, 0);
609
- return t.map((f, p) => p === n ? a : !e || c === 0 ? u / (o - 1) : f / c * u);
610
- }, ke = (t) => {
606
+ const o = r * (n || e > 2 ? 0.8 : 0.6), l = t.map((c) => Math.max(c, o)), u = l.reduce((c, f) => c + f, 0) - 100, m = l.reduce((c, f) => c + (f - o), 0);
607
+ return l.map((c) => m > 0 ? c - (c - o) / m * u : r);
608
+ }, we = (t, n, e, r) => {
609
+ const o = t.length, l = e ? $e(t[n], r ? 60 : 56, r ? 68 : 74) : 64, u = 100 - l, c = t.filter((f, p) => p !== n).reduce((f, p) => f + p, 0);
610
+ return t.map((f, p) => p === n ? l : !e || c === 0 ? u / (o - 1) : f / c * u);
611
+ }, We = (t) => {
611
612
  const n = [];
612
613
  let e = 0;
613
614
  for (let r = 0; r < t.length - 1; r += 1)
614
615
  e += t[r], n.push(e);
615
616
  return n;
616
- }, Se = (t) => `${Math.round(t * 100) / 100}%`, Ie = (t, n, e, r) => {
617
- const o = (h) => Se(r ? 100 - h : h), a = n === 0 ? null : t[n - 1], u = n === t.length ? null : t[n], m = o(a === null ? 0 : a + e), c = o(a === null ? 0 : a - e), f = o(u === null ? 100 : u + e), p = o(u === null ? 100 : u - e);
617
+ }, Re = (t) => `${Math.round(t * 100) / 100}%`, Fe = (t, n, e, r) => {
618
+ const o = (h) => Re(r ? 100 - h : h), l = n === 0 ? null : t[n - 1], u = n === t.length ? null : t[n], m = o(l === null ? 0 : l + e), c = o(l === null ? 0 : l - e), f = o(u === null ? 100 : u + e), p = o(u === null ? 100 : u - e);
618
619
  return `polygon(${m} 0, ${f} 0, ${p} 100%, ${c} 100%)`;
619
- }, ct = "cubic-bezier(.2,.8,.2,1)", ve = ot({ from: { clipPath: "var(--bof-from)" } }), wt = ot({ from: { opacity: 0, transform: "translateY(10px)" } }), $e = ot({ to: { transform: "rotate(360deg)" } }), dn = ot({
620
+ }, pt = "cubic-bezier(.2,.8,.2,1)", Ee = rt({ from: { clipPath: "var(--bof-from)" } }), Et = rt({ from: { opacity: 0, transform: "translateY(10px)" } }), Oe = rt({ to: { transform: "rotate(360deg)" } }), bn = rt({
620
621
  "0%": { transform: "scale(.92)", opacity: 0 },
621
622
  "60%": { transform: "scale(1.03)" },
622
623
  "100%": { transform: "scale(1)", opacity: 1 }
623
- }), N = { fontFamily: i.fontPrimary, fontWeight: 700 }, It = ([t, n]) => ({
624
+ }), V = { fontFamily: i.fontPrimary, fontWeight: 700 }, wt = ([t, n]) => ({
624
625
  fontSize: `min(${s(t)}, 30cqi)`,
625
626
  lineHeight: n / t
626
- }), Yt = (t) => ({
627
+ }), nn = (t) => ({
627
628
  paddingInlineStart: `calc(${s(t)} + var(--bof-pad-start, 0%))`,
628
629
  paddingInlineEnd: `calc(${s(t)} + var(--bof-pad-end, 0%))`
629
- }), vt = { overflowWrap: "anywhere", maxWidth: "100%" }, $t = ([t, n]) => ({
630
+ }), Wt = { overflowWrap: "anywhere", maxWidth: "100%" }, Rt = ([t, n]) => ({
630
631
  fontSize: `min(${s(t)}, 18cqi)`,
631
632
  lineHeight: n / t
632
- }), dt = { unicodeBidi: "plaintext" }, ut = {
633
+ }), mt = { unicodeBidi: "plaintext" }, ft = {
633
634
  display: "-webkit-box",
634
635
  WebkitLineClamp: 2,
635
636
  WebkitBoxOrient: "vertical",
636
637
  overflow: "hidden"
637
- }, Xt = (t, n) => ({
638
+ }, en = (t, n) => ({
638
639
  boxSizing: "border-box",
639
640
  height: s(t, n),
640
641
  padding: `0 min(${s(20, n)}, 6cqi)`,
@@ -656,8 +657,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
656
657
  outline: `2px solid ${i.focus}`,
657
658
  outlineOffset: "2px"
658
659
  }
659
- }), un = (t, n, e) => ({
660
- vote: d(Xt(t, n), e, {
660
+ }), yn = (t, n, e) => ({
661
+ vote: d(en(t, n), e, {
661
662
  backgroundColor: i.fill,
662
663
  color: i.on,
663
664
  cursor: "pointer",
@@ -670,22 +671,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
670
671
  "&:active:not(:disabled)": { transform: "translateY(0)" },
671
672
  "&:disabled": { cursor: "default", opacity: 0.7 }
672
673
  }),
673
- thanks: d(Xt(t, n), e, {
674
+ thanks: d(en(t, n), e, {
674
675
  padding: `0 ${s(12, n)}`,
675
676
  border: `2px solid ${i.ink}`,
676
677
  backgroundColor: i.surface,
677
678
  color: i.ink,
678
- animation: `${dn} .35s ease-out`
679
+ animation: `${bn} .35s ease-out`
679
680
  }),
680
681
  icon: d({ fontSize: "1.25em", flexShrink: 0 })
681
- }), Ce = (t) => {
682
- const n = (a) => ({
682
+ }), Pe = (t) => {
683
+ const n = (l) => ({
683
684
  display: "block",
684
- width: `min(${s(a)}, 100%)`,
685
+ width: `min(${s(l)}, 100%)`,
685
686
  height: "auto",
686
687
  aspectRatio: "1",
687
688
  flexShrink: 0
688
- }), e = (a, u) => d(n(a), {
689
+ }), e = (l, u) => d(n(l), {
689
690
  boxSizing: "border-box",
690
691
  borderRadius: "50%",
691
692
  overflow: "hidden",
@@ -698,32 +699,32 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
698
699
  objectFit: "cover",
699
700
  objectPosition: "top"
700
701
  }
701
- }), r = (a) => d({
702
+ }), r = (l) => d({
702
703
  flexShrink: 0,
703
- width: `min(${s(a, a * 0.36)}, 100%)`,
704
+ width: `min(${s(l, l * 0.36)}, 100%)`,
704
705
  aspectRatio: "1",
705
706
  boxSizing: "border-box",
706
707
  borderRadius: "50%",
707
708
  display: "flex",
708
709
  alignItems: "center",
709
710
  justifyContent: "center",
710
- fontSize: s(a * 0.36),
711
- ...N,
711
+ fontSize: s(l * 0.36),
712
+ ...V,
712
713
  color: i.text,
713
714
  backgroundColor: i.surface,
714
715
  border: `${i.borderSize} solid ${i.border}`
715
- }), o = (a, u) => d(n(a), { objectFit: "contain", filter: u });
716
+ }), o = (l, u) => d(n(l), { objectFit: "contain", filter: u });
716
717
  return {
717
718
  side: {
718
- logo: o(t.img, et.logo),
719
+ logo: o(t.img, ot.logo),
719
720
  headshot: e(t.img, `${s(t.trophyRing)} solid ${i.fill}`),
720
721
  initials: r(t.img)
721
722
  },
722
723
  winner: {
723
- logo: o(t.winImg, et.winnerLogo),
724
+ logo: o(t.winImg, ot.winnerLogo),
724
725
  headshot: d(
725
726
  e(t.winImg, `${s(t.trophyRing + 1)} solid ${i.on}`),
726
- { boxShadow: et.winnerHeadshot }
727
+ { boxShadow: ot.winnerHeadshot }
727
728
  ),
728
729
  initials: r(t.winImg)
729
730
  },
@@ -733,17 +734,17 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
733
734
  initials: r(t.loserImg)
734
735
  },
735
736
  row: {
736
- logo: o(44, et.logo),
737
+ logo: o(44, ot.logo),
737
738
  headshot: e(44, `2px solid ${i.fill}`),
738
739
  initials: r(44)
739
740
  }
740
741
  };
741
- }, we = [
742
+ }, Te = [
742
743
  "top-left",
743
744
  "top-right",
744
745
  "bottom-left",
745
746
  "bottom-right"
746
- ], pn = (t) => {
747
+ ], xn = (t) => {
747
748
  const n = {
748
749
  position: "absolute",
749
750
  width: s(t.trophy),
@@ -753,41 +754,41 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
753
754
  border: `${s(t.trophyRing)} solid ${i.on}`,
754
755
  backgroundColor: i.trophy,
755
756
  color: i.trophyOn,
756
- boxShadow: et.trophy,
757
+ boxShadow: ot.trophy,
757
758
  display: "flex",
758
759
  alignItems: "center",
759
760
  justifyContent: "center",
760
761
  fontSize: "1em",
761
- animation: `${dn} .5s .55s ease-out both`
762
- }, e = (o, a) => {
763
- const [u, m] = o.split("-"), c = a ? m === "left" ? "right" : "left" : m;
762
+ animation: `${bn} .5s .55s ease-out both`
763
+ }, e = (o, l) => {
764
+ const [u, m] = o.split("-"), c = l ? m === "left" ? "right" : "left" : m;
764
765
  return d(n, { [u]: s(-4), [c]: s(-4) });
765
766
  }, r = {};
766
- for (const o of we)
767
+ for (const o of Te)
767
768
  r[`${o}|ltr`] = e(o, !1), r[`${o}|rtl`] = e(o, !0);
768
769
  return { at: r, icon: d({ fontSize: s(t.trophy * 0.5) }) };
769
- }, Kt = (t, n) => {
770
- const e = (a) => d({
770
+ }, on = (t, n) => {
771
+ const e = (l) => d({
771
772
  position: "relative",
772
- height: s(a),
773
+ height: s(l),
773
774
  display: "flex",
774
775
  overflow: "hidden",
775
776
  borderRadius: i.radiusMd,
776
777
  backgroundColor: i.inner
777
- }), r = (a) => d({
778
+ }), r = (l) => d({
778
779
  position: "relative",
779
780
  zIndex: 1,
780
781
  minWidth: 0,
781
782
  boxSizing: "border-box",
782
783
  containerType: "inline-size",
783
784
  paddingBlock: s(t.colPad[0]),
784
- ...Yt(t.colPad[1]),
785
+ ...nn(t.colPad[1]),
785
786
  display: "flex",
786
787
  flexDirection: "column",
787
788
  alignItems: "center",
788
789
  justifyContent: "center",
789
- gap: s(a),
790
- transition: `flex-basis .6s ${ct}`
790
+ gap: s(l),
791
+ transition: `flex-basis .6s ${pt}`
791
792
  }), o = n ? { width: "100%" } : { minWidth: `min(${s(180, t.btnFont)}, 100%)`, maxWidth: "100%" };
792
793
  return {
793
794
  bar: e(t.arenaBar),
@@ -799,7 +800,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
799
800
  position: "absolute",
800
801
  inset: 0,
801
802
  backgroundColor: i.tint,
802
- transition: `clip-path .6s ${ct}, background-color .3s`
803
+ transition: `clip-path .6s ${pt}, background-color .3s`
803
804
  }),
804
805
  layerNeutral: d({
805
806
  position: "absolute",
@@ -810,7 +811,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
810
811
  position: "absolute",
811
812
  inset: 0,
812
813
  backgroundColor: i.fill,
813
- animation: `${ve} .9s ${ct} both`
814
+ animation: `${Ee} .9s ${pt} both`
814
815
  }),
815
816
  column: r(t.colGap),
816
817
  columnFill: r(10),
@@ -830,17 +831,17 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
830
831
  } : {}
831
832
  ),
832
833
  name: d({
833
- ...N,
834
- ...$t(t.name),
835
- ...dt,
836
- ...ut,
837
- ...vt,
834
+ ...V,
835
+ ...Rt(t.name),
836
+ ...mt,
837
+ ...ft,
838
+ ...Wt,
838
839
  textAlign: "center",
839
840
  textWrap: "balance"
840
841
  }),
841
842
  pct: d({
842
- ...N,
843
- ...It(t.pctFill),
843
+ ...V,
844
+ ...wt(t.pctFill),
844
845
  color: i.ink,
845
846
  fontVariantNumeric: "tabular-nums"
846
847
  }),
@@ -858,7 +859,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
858
859
  display: "flex",
859
860
  justifyContent: "center"
860
861
  }),
861
- ...un(t.btnH, t.btnFont, o),
862
+ ...yn(t.btnH, t.btnFont, o),
862
863
  // Winner panel
863
864
  winColumn: d({
864
865
  position: "relative",
@@ -867,8 +868,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
867
868
  boxSizing: "border-box",
868
869
  containerType: "inline-size",
869
870
  paddingBlock: s(n ? 12 : 24),
870
- ...Yt(n ? 12 : 24),
871
- transition: `flex-basis .6s ${ct}`,
871
+ ...nn(n ? 12 : 24),
872
+ transition: `flex-basis .6s ${pt}`,
872
873
  display: "flex",
873
874
  alignItems: "center",
874
875
  justifyContent: "center"
@@ -882,7 +883,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
882
883
  textAlign: n ? "center" : "start",
883
884
  color: i.on,
884
885
  minWidth: 0,
885
- animation: `${wt} .6s .25s ease-out both`
886
+ animation: `${Et} .6s .25s ease-out both`
886
887
  }),
887
888
  winWrap: d({
888
889
  position: "relative",
@@ -902,7 +903,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
902
903
  pointerEvents: "none",
903
904
  background: `repeating-conic-gradient(from 0deg, color-mix(in srgb, ${i.on} 12%, transparent) 0deg 9deg, transparent 9deg 18deg), radial-gradient(circle closest-side, color-mix(in srgb, ${i.on} 24%, transparent) 0%, transparent 72%)`,
904
905
  maskImage: "radial-gradient(circle closest-side, #000 28%, transparent 100%)",
905
- animation: `${$e} 80s linear infinite`
906
+ animation: `${Oe} 80s linear infinite`
906
907
  }),
907
908
  winText: d({
908
909
  minWidth: 0,
@@ -917,11 +918,11 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
917
918
  ...I(t.eyebrow)
918
919
  }),
919
920
  winName: d({
920
- ...N,
921
- ...$t(t.winName),
922
- ...dt,
923
- ...ut,
924
- ...vt,
921
+ ...V,
922
+ ...Rt(t.winName),
923
+ ...mt,
924
+ ...ft,
925
+ ...Wt,
925
926
  letterSpacing: "-0.01em",
926
927
  textWrap: "balance"
927
928
  }),
@@ -940,8 +941,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
940
941
  }
941
942
  ),
942
943
  winPct: d({
943
- ...N,
944
- ...It(t.winPct),
944
+ ...V,
945
+ ...wt(t.winPct),
945
946
  fontVariantNumeric: "tabular-nums"
946
947
  }),
947
948
  ofVotes: d({ fontWeight: 500, ...I([14, 20]) }),
@@ -953,7 +954,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
953
954
  gap: s(6),
954
955
  textAlign: "center",
955
956
  minWidth: 0,
956
- animation: `${wt} .6s .4s ease-out both`
957
+ animation: `${Et} .6s .4s ease-out both`
957
958
  }),
958
959
  loserSlot: d({
959
960
  width: "100%",
@@ -964,23 +965,23 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
964
965
  filter: "grayscale(1) opacity(0.7)"
965
966
  }),
966
967
  loserName: d({
967
- ...N,
968
- ...$t(t.loserName),
969
- ...dt,
970
- ...ut,
971
- ...vt,
968
+ ...V,
969
+ ...Rt(t.loserName),
970
+ ...mt,
971
+ ...ft,
972
+ ...Wt,
972
973
  paddingTop: s(2),
973
974
  textWrap: "balance"
974
975
  }),
975
976
  loserPct: d({
976
- ...N,
977
- ...It(t.loserPct),
977
+ ...V,
978
+ ...wt(t.loserPct),
978
979
  fontVariantNumeric: "tabular-nums"
979
980
  }),
980
- img: Ce(t),
981
- trophy: pn(t)
981
+ img: Pe(t),
982
+ trophy: xn(t)
982
983
  };
983
- }, We = () => ({
984
+ }, Le = () => ({
984
985
  shell: d({
985
986
  display: "flex",
986
987
  flexDirection: "column",
@@ -992,7 +993,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
992
993
  }),
993
994
  row: d({
994
995
  position: "relative",
995
- height: s(kt),
996
+ height: s($t),
996
997
  boxSizing: "border-box",
997
998
  padding: `0 ${s(12)}`,
998
999
  display: "flex",
@@ -1002,7 +1003,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1002
1003
  }),
1003
1004
  rowNeutral: d({
1004
1005
  position: "relative",
1005
- height: s(kt),
1006
+ height: s($t),
1006
1007
  boxSizing: "border-box",
1007
1008
  padding: `0 ${s(12)}`,
1008
1009
  display: "flex",
@@ -1011,7 +1012,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1011
1012
  }),
1012
1013
  rowWinner: d({
1013
1014
  position: "relative",
1014
- height: s(kt),
1015
+ height: s($t),
1015
1016
  boxSizing: "border-box",
1016
1017
  padding: `0 ${s(12)}`,
1017
1018
  display: "flex",
@@ -1019,46 +1020,46 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1019
1020
  gap: s(12),
1020
1021
  backgroundColor: i.fill,
1021
1022
  color: i.on,
1022
- animation: `${wt} .6s ease-out both`
1023
+ animation: `${Et} .6s ease-out both`
1023
1024
  }),
1024
1025
  greyed: d({ filter: "grayscale(1) opacity(0.7)", display: "flex" }),
1025
1026
  imgWrap: d({ position: "relative", display: "flex", flexShrink: 0 }),
1026
1027
  name: d({
1027
- ...N,
1028
+ ...V,
1028
1029
  ...I([15, 20]),
1029
- ...dt,
1030
- ...ut,
1030
+ ...mt,
1031
+ ...ft,
1031
1032
  flex: 1,
1032
1033
  minWidth: 0
1033
1034
  }),
1034
1035
  pct: d({
1035
- ...N,
1036
+ ...V,
1036
1037
  ...I([20, 24]),
1037
1038
  color: i.ink,
1038
1039
  fontVariantNumeric: "tabular-nums",
1039
1040
  flexShrink: 0
1040
1041
  }),
1041
1042
  pctOn: d({
1042
- ...N,
1043
+ ...V,
1043
1044
  ...I([20, 24]),
1044
1045
  fontVariantNumeric: "tabular-nums",
1045
1046
  flexShrink: 0
1046
1047
  }),
1047
1048
  action: d({ width: s(104), flexShrink: 0, display: "flex" }),
1048
- ...un(40, 14, { width: "100%" }),
1049
- trophy: pn({ trophy: 22, trophyRing: 2 })
1050
- }), g = { d: Kt(Z, !1), m: Kt(tt, !0) }, F = We(), Q = ({ side: t, layout: n, variant: e, language: r }) => {
1051
- const [o, a] = T(null), u = t.image && o !== t.image ? t.image : null;
1052
- return t.kind === "player" ? /* @__PURE__ */ l("div", { css: g[n].img[e].headshot, "aria-hidden": "true", children: /* @__PURE__ */ l(
1049
+ ...yn(40, 14, { width: "100%" }),
1050
+ trophy: xn({ trophy: 22, trophyRing: 2 })
1051
+ }), g = { d: on(tt, !1), m: on(nt, !0) }, R = Le(), Z = ({ side: t, layout: n, variant: e, language: r }) => {
1052
+ const [o, l] = A(null), u = t.image && o !== t.image ? t.image : null;
1053
+ return t.kind === "player" ? /* @__PURE__ */ a("div", { css: g[n].img[e].headshot, "aria-hidden": "true", children: /* @__PURE__ */ a(
1053
1054
  "img",
1054
1055
  {
1055
- src: u ?? zn.playerPlaceholder,
1056
+ src: u ?? Gn.playerPlaceholder,
1056
1057
  alt: "",
1057
1058
  loading: "lazy",
1058
1059
  decoding: "async",
1059
- onError: () => u && a(u)
1060
+ onError: () => u && l(u)
1060
1061
  }
1061
- ) }) : u ? /* @__PURE__ */ l(
1062
+ ) }) : u ? /* @__PURE__ */ a(
1062
1063
  "img",
1063
1064
  {
1064
1065
  css: g[n].img[e].logo,
@@ -1066,85 +1067,85 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1066
1067
  alt: "",
1067
1068
  loading: "lazy",
1068
1069
  decoding: "async",
1069
- onError: () => a(u)
1070
+ onError: () => l(u)
1070
1071
  }
1071
- ) : /* @__PURE__ */ l("div", { css: g[n].img[e].initials, "aria-hidden": "true", children: Mn(t.name, r) });
1072
- }, mn = ({ position: t, layout: n, row: e }) => {
1073
- const r = `${t}|${Rt() ? "rtl" : "ltr"}`;
1074
- return /* @__PURE__ */ l(
1072
+ ) : /* @__PURE__ */ a("div", { css: g[n].img[e].initials, "aria-hidden": "true", children: qn(t.name, r) });
1073
+ }, kn = ({ position: t, layout: n, row: e }) => {
1074
+ const r = `${t}|${Pt() ? "rtl" : "ltr"}`;
1075
+ return /* @__PURE__ */ a(
1075
1076
  "div",
1076
1077
  {
1077
- css: e ? F.trophy.at[r] : g[n].trophy.at[r],
1078
+ css: e ? R.trophy.at[r] : g[n].trophy.at[r],
1078
1079
  "aria-hidden": "true",
1079
- children: /* @__PURE__ */ l(
1080
- Gn,
1080
+ children: /* @__PURE__ */ a(
1081
+ Qn,
1081
1082
  {
1082
- css: e ? F.trophy.icon : g[n].trophy.icon
1083
+ css: e ? R.trophy.icon : g[n].trophy.icon
1083
1084
  }
1084
1085
  )
1085
1086
  }
1086
1087
  );
1087
- }, Fe = (t) => {
1088
+ }, Me = (t) => {
1088
1089
  if (t != null && t.onClick) return t.onClick;
1089
1090
  const n = t == null ? void 0 : t.url;
1090
1091
  if (n)
1091
1092
  return () => {
1092
1093
  ((t == null ? void 0 : t.target) ?? "_self") === "_blank" ? window.open(n, "_blank") : window.location.href = n;
1093
1094
  };
1094
- }, fn = ({
1095
+ }, Sn = ({
1095
1096
  state: t,
1096
1097
  layout: n,
1097
1098
  row: e,
1098
1099
  labels: r,
1099
1100
  signInCTA: o,
1100
- onVote: a
1101
+ onVote: l
1101
1102
  }) => {
1102
1103
  if (t === "signIn") {
1103
- if (o != null && o.component) return /* @__PURE__ */ l(Wt, { children: o.component });
1104
- const u = Fe(o);
1105
- return /* @__PURE__ */ l(
1104
+ if (o != null && o.component) return /* @__PURE__ */ a(Ot, { children: o.component });
1105
+ const u = Me(o);
1106
+ return /* @__PURE__ */ a(
1106
1107
  "button",
1107
1108
  {
1108
1109
  type: "button",
1109
- css: e ? F.vote : g[n].vote,
1110
+ css: e ? R.vote : g[n].vote,
1110
1111
  disabled: !u,
1111
1112
  onClick: u,
1112
- children: /* @__PURE__ */ l("span", { children: (o == null ? void 0 : o.defaultLabel) || r.signIn })
1113
+ children: /* @__PURE__ */ a("span", { children: (o == null ? void 0 : o.defaultLabel) || r.signIn })
1113
1114
  }
1114
1115
  );
1115
1116
  }
1116
- return t === "chosen" ? /* @__PURE__ */ b("div", { css: e ? F.thanks : g[n].thanks, role: "status", children: [
1117
- /* @__PURE__ */ l(qn, { css: g.d.icon }),
1118
- /* @__PURE__ */ l("span", { children: r.thankYou })
1119
- ] }) : t === "locked" ? null : /* @__PURE__ */ l(
1117
+ return t === "chosen" ? /* @__PURE__ */ b("div", { css: e ? R.thanks : g[n].thanks, role: "status", children: [
1118
+ /* @__PURE__ */ a(Zn, { css: g.d.icon }),
1119
+ /* @__PURE__ */ a("span", { children: r.thankYou })
1120
+ ] }) : t === "locked" ? null : /* @__PURE__ */ a(
1120
1121
  "button",
1121
1122
  {
1122
1123
  type: "button",
1123
- css: e ? F.vote : g[n].vote,
1124
+ css: e ? R.vote : g[n].vote,
1124
1125
  "aria-label": r.voteFor,
1125
- disabled: t === "submitting",
1126
- onClick: a,
1127
- children: /* @__PURE__ */ l("span", { children: r.vote })
1126
+ disabled: t === "submitting" || t === "upcoming",
1127
+ onClick: l,
1128
+ children: /* @__PURE__ */ a("span", { children: r.vote })
1128
1129
  }
1129
1130
  );
1130
- }, D = (t, n) => ({
1131
+ }, _ = (t, n) => ({
1131
1132
  "--bof-fill": t.fill,
1132
1133
  "--bof-on": t.on,
1133
1134
  "--bof-ink": t.ink,
1134
1135
  ...n ? { "--bof-from": n } : {}
1135
- }), Et = (t, n) => ({
1136
- ...D(t.colours[n]),
1136
+ }), Tt = (t, n) => ({
1137
+ ..._(t.colours[n]),
1137
1138
  flex: `0 0 ${t.widths[n]}%`,
1138
1139
  "--bof-pad-start": n > 0 ? `${t.slant}%` : "0%",
1139
1140
  "--bof-pad-end": n < t.sides.length - 1 ? `${t.slant}%` : "0%"
1140
- }), hn = (t, n) => ({
1141
+ }), In = (t, n) => ({
1141
1142
  vote: t.label("vote"),
1142
1143
  voteFor: t.label("voteFor", { name: n.name }),
1143
1144
  thankYou: t.label("thankYou"),
1144
1145
  signIn: t.label("signIn")
1145
- }), Re = ({ view: t }) => /* @__PURE__ */ l("div", { css: F.shell, role: "group", "aria-label": t.splitLabel ?? void 0, children: t.sides.map((n, e) => {
1146
- const r = t.winner === e, o = t.winner !== null && !r, a = /* @__PURE__ */ l(
1147
- Q,
1146
+ }), Ne = ({ view: t }) => /* @__PURE__ */ a("div", { css: R.shell, role: "group", "aria-label": t.splitLabel ?? void 0, children: t.sides.map((n, e) => {
1147
+ const r = t.winner === e, o = t.winner !== null && !r, l = /* @__PURE__ */ a(
1148
+ Z,
1148
1149
  {
1149
1150
  side: n,
1150
1151
  layout: "m",
@@ -1155,22 +1156,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1155
1156
  return /* @__PURE__ */ b(
1156
1157
  "div",
1157
1158
  {
1158
- css: r ? F.rowWinner : t.lit[e] && !o ? F.row : F.rowNeutral,
1159
- style: D(t.colours[e]),
1159
+ css: r ? R.rowWinner : t.lit[e] && !o ? R.row : R.rowNeutral,
1160
+ style: _(t.colours[e]),
1160
1161
  children: [
1161
- /* @__PURE__ */ b("div", { css: F.imgWrap, children: [
1162
- o ? /* @__PURE__ */ l("div", { css: F.greyed, children: a }) : a,
1163
- r && t.showTrophy && /* @__PURE__ */ l(mn, { position: t.trophyPosition, layout: "m", row: !0 })
1162
+ /* @__PURE__ */ b("div", { css: R.imgWrap, children: [
1163
+ o ? /* @__PURE__ */ a("div", { css: R.greyed, children: l }) : l,
1164
+ r && t.showTrophy && /* @__PURE__ */ a(kn, { position: t.trophyPosition, layout: "m", row: !0 })
1164
1165
  ] }),
1165
- /* @__PURE__ */ l("div", { css: F.name, children: n.name }),
1166
- t.fill && t.percents[e] !== null && /* @__PURE__ */ l("div", { css: r ? F.pctOn : F.pct, children: t.percents[e] }),
1167
- !t.ended && /* @__PURE__ */ l("div", { css: F.action, children: /* @__PURE__ */ l(
1168
- fn,
1166
+ /* @__PURE__ */ a("div", { css: R.name, children: n.name }),
1167
+ t.fill && t.percents[e] !== null && /* @__PURE__ */ a("div", { css: r ? R.pctOn : R.pct, children: t.percents[e] }),
1168
+ !t.ended && /* @__PURE__ */ a("div", { css: R.action, children: /* @__PURE__ */ a(
1169
+ Sn,
1169
1170
  {
1170
1171
  state: t.actions[e],
1171
1172
  layout: "m",
1172
1173
  row: !0,
1173
- labels: hn(t, n),
1174
+ labels: In(t, n),
1174
1175
  signInCTA: t.signInCTA,
1175
1176
  onVote: () => t.onVote(e)
1176
1177
  }
@@ -1179,16 +1180,16 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1179
1180
  },
1180
1181
  n.optionId
1181
1182
  );
1182
- }) }), Ee = ({
1183
+ }) }), De = ({
1183
1184
  view: t,
1184
1185
  index: n
1185
1186
  }) => {
1186
1187
  const e = t.sides[n];
1187
- return /* @__PURE__ */ l("div", { css: g[t.layout].winColumn, style: Et(t, n), children: /* @__PURE__ */ b("div", { css: g[t.layout].winContent, children: [
1188
+ return /* @__PURE__ */ a("div", { css: g[t.layout].winColumn, style: Tt(t, n), children: /* @__PURE__ */ b("div", { css: g[t.layout].winContent, children: [
1188
1189
  /* @__PURE__ */ b("div", { css: g[t.layout].winWrap, children: [
1189
- /* @__PURE__ */ l("div", { css: g[t.layout].rays, "aria-hidden": "true" }),
1190
- /* @__PURE__ */ l(
1191
- Q,
1190
+ /* @__PURE__ */ a("div", { css: g[t.layout].rays, "aria-hidden": "true" }),
1191
+ /* @__PURE__ */ a(
1192
+ Z,
1192
1193
  {
1193
1194
  side: e,
1194
1195
  layout: t.layout,
@@ -1196,8 +1197,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1196
1197
  language: t.language
1197
1198
  }
1198
1199
  ),
1199
- t.showTrophy && /* @__PURE__ */ l(
1200
- mn,
1200
+ t.showTrophy && /* @__PURE__ */ a(
1201
+ kn,
1201
1202
  {
1202
1203
  position: t.trophyPosition,
1203
1204
  layout: t.layout,
@@ -1206,22 +1207,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1206
1207
  )
1207
1208
  ] }),
1208
1209
  /* @__PURE__ */ b("div", { css: g[t.layout].winText, children: [
1209
- /* @__PURE__ */ l("div", { css: g[t.layout].eyebrow, children: t.label("winner") }),
1210
- /* @__PURE__ */ l("div", { css: g[t.layout].winName, children: e.name }),
1210
+ /* @__PURE__ */ a("div", { css: g[t.layout].eyebrow, children: t.label("winner") }),
1211
+ /* @__PURE__ */ a("div", { css: g[t.layout].winName, children: e.name }),
1211
1212
  t.fill && t.percents[n] !== null && /* @__PURE__ */ b("div", { css: g[t.layout].winPctRow, children: [
1212
- /* @__PURE__ */ l("span", { css: g[t.layout].winPct, children: t.percents[n] }),
1213
- /* @__PURE__ */ l("span", { css: g[t.layout].ofVotes, children: t.label("ofTheVotes") })
1213
+ /* @__PURE__ */ a("span", { css: g[t.layout].winPct, children: t.percents[n] }),
1214
+ /* @__PURE__ */ a("span", { css: g[t.layout].ofVotes, children: t.label("ofTheVotes") })
1214
1215
  ] })
1215
1216
  ] })
1216
1217
  ] }) });
1217
- }, Oe = ({
1218
+ }, Be = ({
1218
1219
  view: t,
1219
1220
  index: n
1220
1221
  }) => {
1221
1222
  const e = t.sides[n];
1222
- return /* @__PURE__ */ l("div", { css: g[t.layout].winColumn, style: Et(t, n), children: /* @__PURE__ */ b("div", { css: g[t.layout].loserContent, children: [
1223
- /* @__PURE__ */ l("div", { css: g[t.layout].loserSlot, children: /* @__PURE__ */ l(
1224
- Q,
1223
+ return /* @__PURE__ */ a("div", { css: g[t.layout].winColumn, style: Tt(t, n), children: /* @__PURE__ */ b("div", { css: g[t.layout].loserContent, children: [
1224
+ /* @__PURE__ */ a("div", { css: g[t.layout].loserSlot, children: /* @__PURE__ */ a(
1225
+ Z,
1225
1226
  {
1226
1227
  side: e,
1227
1228
  layout: t.layout,
@@ -1229,10 +1230,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1229
1230
  language: t.language
1230
1231
  }
1231
1232
  ) }),
1232
- /* @__PURE__ */ l("div", { css: g[t.layout].loserName, children: e.name }),
1233
- t.fill && t.percents[n] !== null && /* @__PURE__ */ l("div", { css: g[t.layout].loserPct, children: t.percents[n] })
1233
+ /* @__PURE__ */ a("div", { css: g[t.layout].loserName, children: e.name }),
1234
+ t.fill && t.percents[n] !== null && /* @__PURE__ */ a("div", { css: g[t.layout].loserPct, children: t.percents[n] })
1234
1235
  ] }) });
1235
- }, Pe = ({
1236
+ }, ze = ({
1236
1237
  view: t,
1237
1238
  index: n
1238
1239
  }) => {
@@ -1241,10 +1242,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1241
1242
  "div",
1242
1243
  {
1243
1244
  css: t.fill ? g[t.layout].columnFill : g[t.layout].column,
1244
- style: Et(t, n),
1245
+ style: Tt(t, n),
1245
1246
  children: [
1246
- /* @__PURE__ */ l("div", { css: g[t.layout].imgSlot, children: /* @__PURE__ */ l(
1247
- Q,
1247
+ /* @__PURE__ */ a("div", { css: g[t.layout].imgSlot, children: /* @__PURE__ */ a(
1248
+ Z,
1248
1249
  {
1249
1250
  side: e,
1250
1251
  layout: t.layout,
@@ -1252,19 +1253,19 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1252
1253
  language: t.language
1253
1254
  }
1254
1255
  ) }),
1255
- /* @__PURE__ */ l("div", { css: g[t.layout].nameBox, children: /* @__PURE__ */ l("div", { css: g[t.layout].name, children: e.name }) }),
1256
- t.fill && t.percents[n] !== null && /* @__PURE__ */ l("div", { css: g[t.layout].pct, children: t.percents[n] }),
1257
- !t.ended && /* @__PURE__ */ l(
1256
+ /* @__PURE__ */ a("div", { css: g[t.layout].nameBox, children: /* @__PURE__ */ a("div", { css: g[t.layout].name, children: e.name }) }),
1257
+ t.fill && t.percents[n] !== null && /* @__PURE__ */ a("div", { css: g[t.layout].pct, children: t.percents[n] }),
1258
+ !t.ended && /* @__PURE__ */ a(
1258
1259
  "div",
1259
1260
  {
1260
1261
  css: t.fill ? g[t.layout].actionFill : g[t.layout].action,
1261
- children: /* @__PURE__ */ l(
1262
- fn,
1262
+ children: /* @__PURE__ */ a(
1263
+ Sn,
1263
1264
  {
1264
1265
  state: t.actions[n],
1265
1266
  layout: t.layout,
1266
1267
  row: !1,
1267
- labels: hn(t, e),
1268
+ labels: In(t, e),
1268
1269
  signInCTA: t.signInCTA,
1269
1270
  onVote: () => t.onVote(n)
1270
1271
  }
@@ -1274,8 +1275,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1274
1275
  ]
1275
1276
  }
1276
1277
  );
1277
- }, Le = ({ view: t }) => {
1278
- if (t.rows) return /* @__PURE__ */ l(Re, { view: t });
1278
+ }, Ae = ({ view: t }) => {
1279
+ if (t.rows) return /* @__PURE__ */ a(Ne, { view: t });
1279
1280
  const n = t.winner;
1280
1281
  return /* @__PURE__ */ b(
1281
1282
  "div",
@@ -1284,85 +1285,94 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1284
1285
  role: "group",
1285
1286
  "aria-label": t.splitLabel ?? void 0,
1286
1287
  children: [
1287
- n !== null ? /* @__PURE__ */ l(
1288
+ n !== null ? /* @__PURE__ */ a(
1288
1289
  "div",
1289
1290
  {
1290
1291
  css: g[t.layout].layerWinner,
1291
1292
  "aria-hidden": "true",
1292
1293
  style: {
1293
- ...D(t.colours[n], t.evenClips[n]),
1294
+ ..._(t.colours[n], t.evenClips[n]),
1294
1295
  clipPath: t.clips[n]
1295
1296
  }
1296
1297
  },
1297
1298
  "winner"
1298
- ) : t.sides.map((e, r) => /* @__PURE__ */ l(
1299
+ ) : t.sides.map((e, r) => /* @__PURE__ */ a(
1299
1300
  "div",
1300
1301
  {
1301
1302
  css: t.lit[r] ? g[t.layout].layer : g[t.layout].layerNeutral,
1302
1303
  "aria-hidden": "true",
1303
- style: { ...D(t.colours[r]), clipPath: t.clips[r] }
1304
+ style: { ..._(t.colours[r]), clipPath: t.clips[r] }
1304
1305
  },
1305
1306
  e.optionId
1306
1307
  )),
1307
1308
  t.sides.map(
1308
- (e, r) => n === null ? /* @__PURE__ */ l(Pe, { view: t, index: r }, e.optionId) : r === n ? /* @__PURE__ */ l(Ee, { view: t, index: r }, e.optionId) : /* @__PURE__ */ l(Oe, { view: t, index: r }, e.optionId)
1309
+ (e, r) => n === null ? /* @__PURE__ */ a(ze, { view: t, index: r }, e.optionId) : r === n ? /* @__PURE__ */ a(De, { view: t, index: r }, e.optionId) : /* @__PURE__ */ a(Be, { view: t, index: r }, e.optionId)
1309
1310
  )
1310
1311
  ]
1311
1312
  }
1312
1313
  );
1313
- }, Te = ({ layout: t, label: n, left: e }) => {
1314
- const r = sn(), o = j(
1315
- () => new Intl.NumberFormat(r, {
1314
+ }, Ve = ({ layout: t, label: n, caption: e, left: r }) => {
1315
+ const o = mn(), l = q(
1316
+ () => new Intl.NumberFormat(o, {
1316
1317
  minimumIntegerDigits: 2,
1317
1318
  useGrouping: !1
1318
1319
  }),
1319
- [r]
1320
- ), a = [
1321
- { value: e.days, caption: n("days") },
1322
- { value: e.hours, caption: n("hours") },
1323
- { value: e.minutes, caption: n("minutes") },
1324
- { value: e.seconds, caption: n("seconds") }
1320
+ [o]
1321
+ ), u = [
1322
+ { value: r.days, caption: n("days") },
1323
+ { value: r.hours, caption: n("hours") },
1324
+ { value: r.minutes, caption: n("minutes") },
1325
+ { value: r.seconds, caption: n("seconds") }
1325
1326
  ];
1326
- return /* @__PURE__ */ b("div", { css: q[t].root, children: [
1327
- /* @__PURE__ */ l("div", { css: q[t].label, children: n("votingEndsIn") }),
1328
- /* @__PURE__ */ l("div", { css: q[t].units, children: a.map((u, m) => /* @__PURE__ */ b(en.Fragment, { children: [
1329
- t === "d" && m > 0 && /* @__PURE__ */ l("div", { css: q.d.colon, "aria-hidden": "true", children: ":" }),
1330
- /* @__PURE__ */ b("div", { css: q[t].unit, children: [
1331
- /* @__PURE__ */ l("div", { css: q[t].value, children: o.format(u.value) }),
1332
- /* @__PURE__ */ l("div", { css: q[t].caption, children: u.caption })
1327
+ return /* @__PURE__ */ b("div", { css: Y[t].root, children: [
1328
+ /* @__PURE__ */ a("div", { css: Y[t].label, children: e }),
1329
+ /* @__PURE__ */ a("div", { css: Y[t].units, children: u.map((m, c) => /* @__PURE__ */ b(dn.Fragment, { children: [
1330
+ t === "d" && c > 0 && /* @__PURE__ */ a("div", { css: Y.d.colon, "aria-hidden": "true", children: ":" }),
1331
+ /* @__PURE__ */ b("div", { css: Y[t].unit, children: [
1332
+ /* @__PURE__ */ a("div", { css: Y[t].value, children: l.format(m.value) }),
1333
+ /* @__PURE__ */ a("div", { css: Y[t].caption, children: m.caption })
1333
1334
  ] })
1334
- ] }, m)) })
1335
+ ] }, c)) })
1335
1336
  ] });
1336
- }, Ne = ({
1337
+ }, _e = ({
1337
1338
  layout: t,
1338
1339
  label: n,
1339
1340
  title: e,
1340
1341
  openSubtitle: r,
1341
1342
  ended: o,
1342
- draw: a,
1343
- left: u
1343
+ draw: l,
1344
+ upcoming: u,
1345
+ left: m
1344
1346
  }) => {
1345
- const m = [
1347
+ const c = [
1346
1348
  { key: "open", text: r, on: !o },
1347
- { key: "ended", text: n("endedSubtitle"), on: o && !a },
1348
- { key: "draw", text: n("drawSubtitle"), on: o && a }
1349
- ], c = o ? /* @__PURE__ */ l("div", { css: y[t].pill, children: n("votingEnded") }) : u ? /* @__PURE__ */ l(Te, { layout: t, label: n, left: u }) : null;
1349
+ { key: "ended", text: n("endedSubtitle"), on: o && !l },
1350
+ { key: "draw", text: n("drawSubtitle"), on: o && l }
1351
+ ], f = o ? /* @__PURE__ */ a("div", { css: y[t].pill, children: n("votingEnded") }) : m ? /* @__PURE__ */ a(
1352
+ Ve,
1353
+ {
1354
+ layout: t,
1355
+ label: n,
1356
+ caption: n(u ? "votingStartsIn" : "votingEndsIn"),
1357
+ left: m
1358
+ }
1359
+ ) : u ? /* @__PURE__ */ a("div", { css: y[t].pill, children: n("votingStartsSoon") }) : null;
1350
1360
  return /* @__PURE__ */ b("div", { css: y[t].header, children: [
1351
1361
  /* @__PURE__ */ b("div", { css: y[t].titles, children: [
1352
- /* @__PURE__ */ l("h2", { css: y[t].title, children: e }),
1353
- /* @__PURE__ */ l("div", { css: y[t].subtitles, children: m.map((f) => /* @__PURE__ */ l(
1362
+ /* @__PURE__ */ a("h2", { css: y[t].title, children: e }),
1363
+ /* @__PURE__ */ a("div", { css: y[t].subtitles, children: c.map((p) => /* @__PURE__ */ a(
1354
1364
  "p",
1355
1365
  {
1356
- css: f.on ? y[t].subtitle : y[t].subtitleHidden,
1357
- "aria-hidden": !f.on,
1358
- children: f.text
1366
+ css: p.on ? y[t].subtitle : y[t].subtitleHidden,
1367
+ "aria-hidden": !p.on,
1368
+ children: p.text
1359
1369
  },
1360
- f.key
1370
+ p.key
1361
1371
  )) })
1362
1372
  ] }),
1363
- t === "m" ? c && /* @__PURE__ */ l("div", { css: y.m.status, children: c }) : c
1373
+ t === "m" ? f && /* @__PURE__ */ a("div", { css: y.m.status, children: f }) : f
1364
1374
  ] });
1365
- }, Jt = (t) => ({
1375
+ }, rn = (t) => ({
1366
1376
  fontSize: "1em",
1367
1377
  display: "flex",
1368
1378
  flexDirection: "column",
@@ -1370,16 +1380,16 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1370
1380
  gap: t ? i.spaceMd : i.spaceLg,
1371
1381
  padding: t ? i.spaceMd : `${s(32)} ${i.spaceLg}`,
1372
1382
  borderRadius: i.radiusMd
1373
- }), Qt = (t) => d({
1383
+ }), sn = (t) => d({
1374
1384
  flexShrink: 0,
1375
1385
  width: "2px",
1376
1386
  height: s(32),
1377
1387
  backgroundColor: i.border,
1378
1388
  transform: `skewX(${t ? 14 : -14}deg)`
1379
- }), Zt = (t) => ({
1380
- panel: d(Jt(t), { backgroundColor: i.inner }),
1389
+ }), an = (t) => ({
1390
+ panel: d(rn(t), { backgroundColor: i.inner }),
1381
1391
  // "after": the panel takes the picked side's tint.
1382
- panelPicked: d(Jt(t), { backgroundColor: i.tint }),
1392
+ panelPicked: d(rn(t), { backgroundColor: i.tint }),
1383
1393
  intro: d({
1384
1394
  display: "flex",
1385
1395
  flexDirection: "column",
@@ -1441,11 +1451,11 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1441
1451
  backgroundColor: i.surface,
1442
1452
  border: `${i.borderSize} solid ${i.border}`
1443
1453
  })
1444
- }), H = { d: Zt(!1), m: Zt(!0) }, De = { ltr: Qt(!1), rtl: Qt(!0) }, Be = (t) => {
1454
+ }), j = { d: an(!1), m: an(!0) }, He = { ltr: sn(!1), rtl: sn(!0) }, je = (t) => {
1445
1455
  var h;
1446
- const { layout: n, poll: e, sides: r, colours: o, picked: a } = t, { t: u } = mt("common"), m = Rt(), c = a !== null ? r[a] : null, f = e.labels, p = c ? /* @__PURE__ */ b("div", { css: H[n].pick, children: [
1447
- /* @__PURE__ */ l(
1448
- Q,
1456
+ const { layout: n, poll: e, sides: r, colours: o, picked: l } = t, { t: u } = bt("common"), m = Pt(), c = l !== null ? r[l] : null, f = e.labels, p = c ? /* @__PURE__ */ b("div", { css: j[n].pick, children: [
1457
+ /* @__PURE__ */ a(
1458
+ Z,
1449
1459
  {
1450
1460
  side: c,
1451
1461
  layout: n,
@@ -1453,38 +1463,38 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1453
1463
  language: t.language
1454
1464
  }
1455
1465
  ),
1456
- /* @__PURE__ */ l("p", { css: H[n].pickName, children: c.name })
1457
- ] }) : /* @__PURE__ */ l("div", { css: H[n].sides, "aria-hidden": "true", children: r.map((R, P) => /* @__PURE__ */ b(en.Fragment, { children: [
1458
- P > 0 && /* @__PURE__ */ l("span", { css: De[m ? "rtl" : "ltr"] }),
1459
- /* @__PURE__ */ l("span", { style: D(o[P]), children: /* @__PURE__ */ l(
1460
- Q,
1466
+ /* @__PURE__ */ a("p", { css: j[n].pickName, children: c.name })
1467
+ ] }) : /* @__PURE__ */ a("div", { css: j[n].sides, "aria-hidden": "true", children: r.map((F, B) => /* @__PURE__ */ b(dn.Fragment, { children: [
1468
+ B > 0 && /* @__PURE__ */ a("span", { css: He[m ? "rtl" : "ltr"] }),
1469
+ /* @__PURE__ */ a("span", { style: _(o[B]), children: /* @__PURE__ */ a(
1470
+ Z,
1461
1471
  {
1462
- side: R,
1472
+ side: F,
1463
1473
  layout: n,
1464
1474
  variant: "row",
1465
1475
  language: t.language
1466
1476
  }
1467
1477
  ) })
1468
- ] }, R.optionId)) });
1478
+ ] }, F.optionId)) });
1469
1479
  return /* @__PURE__ */ b(
1470
1480
  "div",
1471
1481
  {
1472
- css: c ? H[n].panelPicked : H[n].panel,
1473
- style: a !== null ? {
1474
- ...D(o[a]),
1475
- "--fu-ucrc-primary-on-primary": o[a].on
1482
+ css: c ? j[n].panelPicked : j[n].panel,
1483
+ style: l !== null ? {
1484
+ ..._(o[l]),
1485
+ "--fu-ucrc-primary-on-primary": o[l].on
1476
1486
  } : void 0,
1477
1487
  children: [
1478
- /* @__PURE__ */ b("div", { css: H[n].intro, children: [
1488
+ /* @__PURE__ */ b("div", { css: j[n].intro, children: [
1479
1489
  p,
1480
- /* @__PURE__ */ l("h3", { css: H[n].title, children: (f == null ? void 0 : f.leadTitle) || u("leads.header.title") }),
1481
- /* @__PURE__ */ l("p", { css: H[n].description, children: (f == null ? void 0 : f.leadDescription) || u("leads.header.description") })
1490
+ /* @__PURE__ */ a("h3", { css: j[n].title, children: (f == null ? void 0 : f.leadTitle) || u("leads.header.title") }),
1491
+ /* @__PURE__ */ a("p", { css: j[n].description, children: (f == null ? void 0 : f.leadDescription) || u("leads.header.description") })
1482
1492
  ] }),
1483
- /* @__PURE__ */ l("div", { css: H[n].form, children: /* @__PURE__ */ l(
1484
- Pn,
1493
+ /* @__PURE__ */ a("div", { css: j[n].form, children: /* @__PURE__ */ a(
1494
+ zn,
1485
1495
  {
1486
1496
  sdk: t.sdk,
1487
- brandingColors: c ? { primaryColor: o[a].fill } : void 0,
1497
+ brandingColors: c ? { primaryColor: o[l].fill } : void 0,
1488
1498
  brandingUrls: (h = e.branding) == null ? void 0 : h.urls,
1489
1499
  fields: t.leads.fields,
1490
1500
  campaignId: t.leads.campaignId,
@@ -1508,17 +1518,17 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1508
1518
  ]
1509
1519
  }
1510
1520
  );
1511
- }, tn = (t) => {
1521
+ }, ln = (t) => {
1512
1522
  const n = {
1513
1523
  flex: 1,
1514
1524
  fontFamily: i.fontPrimary,
1515
1525
  fontWeight: 700,
1516
1526
  fontVariantNumeric: "tabular-nums",
1517
1527
  ...I(t.pctBar)
1518
- }, e = (a) => d({
1528
+ }, e = (l) => d({
1519
1529
  minWidth: s(t.bar),
1520
1530
  backgroundColor: i.fill,
1521
- borderRadius: a,
1531
+ borderRadius: l,
1522
1532
  transition: "flex-grow .6s cubic-bezier(.2,.8,.2,1)"
1523
1533
  }), r = i.radiusFull, o = s(3);
1524
1534
  return {
@@ -1571,146 +1581,155 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1571
1581
  backgroundColor: i.track
1572
1582
  })
1573
1583
  };
1574
- }, W = { d: tn(Z), m: tn(tt) }, ze = ({
1584
+ }, W = { d: ln(tt), m: ln(nt) }, Ge = ({
1575
1585
  layout: t,
1576
1586
  label: n,
1577
1587
  colours: e,
1578
1588
  shares: r,
1579
1589
  percents: o,
1580
- ended: a,
1590
+ ended: l,
1581
1591
  splitLabel: u
1582
1592
  }) => {
1583
1593
  if (o.some((p) => p === null))
1584
1594
  return /* @__PURE__ */ b("div", { css: W[t].root, children: [
1585
1595
  /* @__PURE__ */ b("div", { css: W[t].lock, children: [
1586
- /* @__PURE__ */ l(Un, { css: W[t].lockIcon }),
1587
- /* @__PURE__ */ l("span", { children: n("voteToSeeResults") })
1596
+ /* @__PURE__ */ a(te, { css: W[t].lockIcon }),
1597
+ /* @__PURE__ */ a("span", { children: n("voteToSeeResults") })
1588
1598
  ] }),
1589
- /* @__PURE__ */ l("div", { css: W[t].track, "aria-hidden": "true" })
1599
+ /* @__PURE__ */ a("div", { css: W[t].track, "aria-hidden": "true" })
1590
1600
  ] });
1591
1601
  const m = r.length, c = r.every((p) => p === 0) ? r.map(() => 1) : r, f = m - 1;
1592
1602
  return /* @__PURE__ */ b("div", { css: W[t].root, children: [
1593
1603
  m === 2 ? /* @__PURE__ */ b("div", { css: W[t].labels, children: [
1594
- /* @__PURE__ */ l("div", { css: W[t].pct, style: D(e[0]), children: o[0] }),
1595
- a && /* @__PURE__ */ l("div", { css: W[t].caption, children: n("finalResult") }),
1596
- /* @__PURE__ */ l("div", { css: W[t].pctEnd, style: D(e[1]), children: o[1] })
1597
- ] }) : /* @__PURE__ */ l("div", { css: W[t].labels, children: o.map((p, h) => /* @__PURE__ */ l(
1604
+ /* @__PURE__ */ a("div", { css: W[t].pct, style: _(e[0]), children: o[0] }),
1605
+ l && /* @__PURE__ */ a("div", { css: W[t].caption, children: n("finalResult") }),
1606
+ /* @__PURE__ */ a("div", { css: W[t].pctEnd, style: _(e[1]), children: o[1] })
1607
+ ] }) : /* @__PURE__ */ a("div", { css: W[t].labels, children: o.map((p, h) => /* @__PURE__ */ a(
1598
1608
  "div",
1599
1609
  {
1600
1610
  css: W[t].cell,
1601
- style: { ...D(e[h]), flex: `${c[h]} 1 0%` },
1611
+ style: { ..._(e[h]), flex: `${c[h]} 1 0%` },
1602
1612
  children: p
1603
1613
  },
1604
1614
  h
1605
1615
  )) }),
1606
- /* @__PURE__ */ l(
1616
+ /* @__PURE__ */ a(
1607
1617
  "div",
1608
1618
  {
1609
1619
  css: W[t].bar,
1610
1620
  role: "img",
1611
1621
  "aria-label": u ?? void 0,
1612
- children: e.map((p, h) => /* @__PURE__ */ l(
1622
+ children: e.map((p, h) => /* @__PURE__ */ a(
1613
1623
  "div",
1614
1624
  {
1615
1625
  css: h === 0 ? W[t].segFirst : h === f ? W[t].segLast : W[t].segMid,
1616
- style: { ...D(p), flex: `${c[h]} 1 0%` }
1626
+ style: { ..._(p), flex: `${c[h]} 1 0%` }
1617
1627
  },
1618
1628
  h
1619
1629
  ))
1620
1630
  }
1621
1631
  )
1622
1632
  ] });
1623
- }, Me = { d: s(90), m: s(120) }, gn = { d: s(Z.arenaFill), m: s(tt.arenaFill) }, Ve = { d: s(Z.arenaBar), m: s(tt.arenaBar) }, He = ({ layout: t, fill: n, odds: e }) => /* @__PURE__ */ b("div", { css: y[t].root, "aria-busy": "true", children: [
1633
+ }, qe = { d: s(90), m: s(120) }, vn = { d: s(tt.arenaFill), m: s(nt.arenaFill) }, Ue = { d: s(tt.arenaBar), m: s(nt.arenaBar) }, Ye = ({ layout: t, fill: n, odds: e }) => /* @__PURE__ */ b("div", { css: y[t].root, "aria-busy": "true", children: [
1624
1634
  /* @__PURE__ */ b("div", { css: y[t].body, children: [
1625
- /* @__PURE__ */ l("div", { css: y[t].header, style: { minHeight: Me[t] }, children: /* @__PURE__ */ l("div", { css: y[t].titleSkeleton }) }),
1626
- n ? /* @__PURE__ */ l(
1635
+ /* @__PURE__ */ a("div", { css: y[t].header, style: { minHeight: qe[t] }, children: /* @__PURE__ */ a("div", { css: y[t].titleSkeleton }) }),
1636
+ n ? /* @__PURE__ */ a(
1627
1637
  "div",
1628
1638
  {
1629
1639
  css: y[t].arenaSkeleton,
1630
- style: { height: gn[t] }
1640
+ style: { height: vn[t] }
1631
1641
  }
1632
- ) : /* @__PURE__ */ b(Wt, { children: [
1633
- /* @__PURE__ */ l(
1642
+ ) : /* @__PURE__ */ b(Ot, { children: [
1643
+ /* @__PURE__ */ a(
1634
1644
  "div",
1635
1645
  {
1636
1646
  css: y[t].arenaSkeleton,
1637
- style: { height: Ve[t] }
1647
+ style: { height: Ue[t] }
1638
1648
  }
1639
1649
  ),
1640
- /* @__PURE__ */ l("div", { css: y[t].resultsSkeleton, children: /* @__PURE__ */ l("div", { css: y[t].barSkeleton }) })
1650
+ /* @__PURE__ */ a("div", { css: y[t].resultsSkeleton, children: /* @__PURE__ */ a("div", { css: y[t].barSkeleton }) })
1641
1651
  ] })
1642
1652
  ] }),
1643
- e && /* @__PURE__ */ l("div", { css: y[t].oddsSlot, children: /* @__PURE__ */ l(an, { size: t === "m" ? "dense" : "default" }) })
1644
- ] }), Ae = ({
1653
+ e && /* @__PURE__ */ a("div", { css: y[t].oddsSlot, children: /* @__PURE__ */ a(fn, { size: t === "m" ? "dense" : "default" }) })
1654
+ ] }), Xe = ({
1645
1655
  layout: t,
1646
1656
  label: n,
1647
1657
  kind: e,
1648
1658
  onRetry: r
1649
1659
  }) => {
1650
- const { t: o } = mt("common"), a = e === "notFound" ? n("notAvailableTitle") : o("common.error.title"), u = e === "notFound" ? n("notAvailableMessage") : o("common.error.message");
1651
- return /* @__PURE__ */ l("div", { css: y[t].root, children: /* @__PURE__ */ b("div", { css: y[t].body, children: [
1652
- /* @__PURE__ */ l("div", { css: y[t].header, children: /* @__PURE__ */ l("h2", { css: y[t].title, children: n("title") }) }),
1660
+ const { t: o } = bt("common"), l = e === "notFound" ? n("notAvailableTitle") : o("common.error.title"), u = e === "notFound" ? n("notAvailableMessage") : o("common.error.message");
1661
+ return /* @__PURE__ */ a("div", { css: y[t].root, children: /* @__PURE__ */ b("div", { css: y[t].body, children: [
1662
+ /* @__PURE__ */ a("div", { css: y[t].header, children: /* @__PURE__ */ a("h2", { css: y[t].title, children: n("title") }) }),
1653
1663
  /* @__PURE__ */ b(
1654
1664
  "div",
1655
1665
  {
1656
1666
  css: y[t].message,
1657
- style: { minHeight: gn[t] },
1667
+ style: { minHeight: vn[t] },
1658
1668
  role: "alert",
1659
1669
  children: [
1660
- /* @__PURE__ */ l("h3", { css: y[t].messageTitle, children: a }),
1661
- /* @__PURE__ */ l("p", { css: y[t].messageText, children: u }),
1662
- e === "error" && /* @__PURE__ */ l("button", { type: "button", css: y[t].retry, onClick: r, children: o("common.retry") })
1670
+ /* @__PURE__ */ a("h3", { css: y[t].messageTitle, children: l }),
1671
+ /* @__PURE__ */ a("p", { css: y[t].messageText, children: u }),
1672
+ e === "error" && /* @__PURE__ */ a("button", { type: "button", css: y[t].retry, onClick: r, children: o("common.retry") })
1663
1673
  ]
1664
1674
  }
1665
1675
  )
1666
1676
  ] }) });
1667
- }, nn = (t, n, e) => {
1668
- const r = ke(t);
1669
- return t.map((o, a) => Ie(r, a, n, e));
1670
- }, je = (t) => {
1671
- var Nt, Dt, Bt, zt, Mt, Vt, Ht;
1677
+ }, cn = (t, n, e) => {
1678
+ const r = We(t);
1679
+ return t.map((o, l) => Fe(r, l, n, e));
1680
+ }, Ke = (t) => {
1681
+ var zt, At, Vt, _t, Ht, jt, Gt;
1672
1682
  const {
1673
1683
  sdk: n,
1674
1684
  language: e,
1675
1685
  progressDisplay: r = "bar",
1676
1686
  showResultsBeforeVote: o = !0,
1677
- showTrophy: a = !0,
1687
+ showTrophy: l = !0,
1678
1688
  trophyPosition: u = "bottom-right",
1679
1689
  showOdds: m = !1,
1680
1690
  odds: c
1681
- } = t, { t: f } = mt("common"), p = pe(t.labels), h = Vn() ? "m" : "d", R = h === "m" ? tt : Z, P = Rt(), U = sn(), E = Hn(), _ = r === "background", $ = ue({
1691
+ } = t, { t: f } = bt("common"), p = xe(t.labels), h = Un() ? "m" : "d", F = h === "m" ? nt : tt, B = Pt(), X = mn(), T = Yn(), U = r === "background", $ = ye({
1682
1692
  entityId: t.entityId,
1683
1693
  sdk: n,
1684
1694
  language: e,
1685
1695
  userIsLoggedIn: t.userIsLoggedIn,
1686
1696
  callbacks: t.callbacks
1687
- }), { sides: k, votes: rt, poll: O, endMs: G } = $, [ft, B] = T(!1), [z, C] = T(null), S = me(G), M = G !== null && S >= G, x = !!O && (O.status !== "ACTIVE" || M), w = on(!1), { refresh: L } = $;
1688
- Ft(() => {
1689
- O && (M ? w.current && (w.current = !1, L()) : w.current = !0);
1690
- }, [O, M, L]);
1691
- const Y = j(
1697
+ }), { sides: S, votes: it, poll: E, startMs: z, endMs: L } = $, [O, st] = A(!1), [H, C] = A(null), x = z !== null ? z + Kt : null, M = ke(
1698
+ x !== null && L !== null ? Math.max(x, L) : x ?? L
1699
+ ), v = (E == null ? void 0 : E.status) === "INACTIVE" && z !== null && M < z + Kt && (L === null || z < L), w = v && M >= (z ?? 0), N = L !== null && M >= L, D = !!E && !v && (E.status !== "ACTIVE" || N), { refresh: P } = $;
1700
+ ht(() => {
1701
+ if (!w) return;
1702
+ P();
1703
+ const k = setInterval(P, se);
1704
+ return () => clearInterval(k);
1705
+ }, [w, P]);
1706
+ const et = un(!1);
1707
+ ht(() => {
1708
+ E && (N ? et.current && (et.current = !1, P()) : et.current = !0);
1709
+ }, [E, N, P]);
1710
+ const at = q(
1692
1711
  () => {
1693
- var v, A;
1712
+ var k, G;
1694
1713
  return {
1695
- surface: E.surface,
1696
- text: E.textPrimary,
1697
- primary: E.palette.primary.plainColor,
1698
- onPrimary: E.palette.primary.onPrimary,
1714
+ surface: T.surface,
1715
+ text: T.textPrimary,
1716
+ primary: T.palette.primary.plainColor,
1717
+ onPrimary: T.palette.primary.onPrimary,
1699
1718
  extras: [
1700
- (v = E.palette.success) == null ? void 0 : v.plainColor,
1701
- (A = E.palette.warning) == null ? void 0 : A.plainColor
1702
- ].filter((On) => !!On)
1719
+ (k = T.palette.success) == null ? void 0 : k.plainColor,
1720
+ (G = T.palette.warning) == null ? void 0 : G.plainColor
1721
+ ].filter((Bn) => !!Bn)
1703
1722
  };
1704
1723
  },
1705
- [E]
1706
- ), V = j(() => k.map((v) => v.brand), [k]), nt = j(() => ge(V, Y), [V, Y]), bn = cn(
1707
- ((Nt = E.palette.warning) == null ? void 0 : Nt.plainColor) ?? Y.primary,
1708
- Y
1709
- ), X = c == null ? void 0 : c.eventId, ht = m && !!X && k.length === 2 && k.every((v) => v.kind === "team"), yn = m && !!X, { odds: xn, loading: kn } = jn(
1724
+ [T]
1725
+ ), Lt = q(() => S.map((k) => k.brand), [S]), yt = q(() => ve(Lt, at), [Lt, at]), $n = gn(
1726
+ ((zt = T.palette.warning) == null ? void 0 : zt.plainColor) ?? at.primary,
1727
+ at
1728
+ ), K = c == null ? void 0 : c.eventId, xt = m && !!K && S.length === 2 && S.every((k) => k.kind === "team"), Cn = m && !!K, { odds: wn, loading: Wn } = Kn(
1710
1729
  n,
1711
- ht && X ? [X] : [],
1730
+ xt && K ? [K] : [],
1712
1731
  {
1713
- enabled: ht,
1732
+ enabled: xt,
1714
1733
  markets: [(c == null ? void 0 : c.market) ?? "FT_1X2"],
1715
1734
  sport: "FOOTBALL",
1716
1735
  pollingIntervalMs: c == null ? void 0 : c.pollingInterval,
@@ -1718,18 +1737,18 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1718
1737
  affiliateId: c == null ? void 0 : c.affiliateId,
1719
1738
  affiliateIds: c == null ? void 0 : c.affiliateIds
1720
1739
  }
1721
- ), Ot = X ? xn.get(X) : void 0, Sn = j(
1722
- () => new Intl.NumberFormat(U, {
1740
+ ), Mt = K ? wn.get(K) : void 0, Rn = q(
1741
+ () => new Intl.NumberFormat(X, {
1723
1742
  style: "percent",
1724
1743
  maximumFractionDigits: 0
1725
1744
  }),
1726
- [U]
1745
+ [X]
1727
1746
  );
1728
1747
  if ($.status === "loading")
1729
- return /* @__PURE__ */ l(He, { layout: h, fill: _, odds: yn });
1730
- if ($.status !== "ready" || !O)
1731
- return /* @__PURE__ */ l(
1732
- Ae,
1748
+ return /* @__PURE__ */ a(Ye, { layout: h, fill: U, odds: Cn });
1749
+ if ($.status !== "ready" || !E)
1750
+ return /* @__PURE__ */ a(
1751
+ Xe,
1733
1752
  {
1734
1753
  layout: h,
1735
1754
  label: p,
@@ -1737,104 +1756,105 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1737
1756
  onRetry: $.retry
1738
1757
  }
1739
1758
  );
1740
- const it = re(rt), st = x ? ie(rt) : null, In = x && st === null, K = k.findIndex(
1741
- (v) => v.optionId === $.votedOptionId
1742
- ), gt = x || o || K >= 0, bt = it.map(
1743
- (v) => gt ? Sn.format(v / 100) : null
1744
- ), vn = h === "m" && k.length > 2, Pt = k.map(() => 100 / k.length), Lt = st !== null ? xe(it, st, _, h === "m") : _ && gt ? ye(it, h === "m") : Pt, $n = k.map((v, A) => x || K < 0 || K === A), Cn = k.map((v, A) => K === A ? "chosen" : K >= 0 ? "locked" : $.signInRequired ? "signIn" : $.submitting ? "submitting" : "open"), yt = O.authRequirement === "LEAD" && !ft && !x && K < 0 ? (Dt = t.leads) == null ? void 0 : Dt.position : void 0, wn = yt === "before" || yt === "after" && z !== null, Wn = (v) => {
1745
- yt === "after" ? C(v) : $.vote(k[v].optionId);
1746
- }, Fn = async () => {
1747
- B(!0), z !== null && (await $.vote(k[z].optionId), C(null));
1748
- }, Tt = gt ? `${p("voteSplit")}: ${k.map((v, A) => `${v.name} ${bt[A]}`).join(", ")}` : null, Rn = k.every((v) => v.kind === "player"), En = G !== null && !x ? ae(G, S) : null;
1759
+ const lt = me(it), ct = D ? fe(it) : null, Fn = D && ct === null, J = S.findIndex(
1760
+ (k) => k.optionId === $.votedOptionId
1761
+ ), kt = D || o || J >= 0, St = lt.map(
1762
+ (k) => kt ? Rn.format(k / 100) : null
1763
+ ), En = h === "m" && S.length > 2, Nt = S.map(() => 100 / S.length), Dt = ct !== null ? we(lt, ct, U, h === "m") : U && kt ? Ce(lt, h === "m") : Nt, On = S.map((k, G) => D || J < 0 || J === G), Pn = S.map((k, G) => v ? "upcoming" : J === G ? "chosen" : J >= 0 ? "locked" : $.signInRequired ? "signIn" : $.submitting ? "submitting" : "open"), It = E.authRequirement === "LEAD" && !O && !D && !v && J < 0 ? (At = t.leads) == null ? void 0 : At.position : void 0, Tn = It === "before" || It === "after" && H !== null, Ln = (k) => {
1764
+ It === "after" ? C(k) : $.vote(S[k].optionId);
1765
+ }, Mn = async () => {
1766
+ st(!0), H !== null && (await $.vote(S[H].optionId), C(null));
1767
+ }, Bt = kt ? `${p("voteSplit")}: ${S.map((k, G) => `${k.name} ${St[G]}`).join(", ")}` : null, Nn = S.every((k) => k.kind === "player"), Dn = v ? w || z === null ? null : Zt(z, M) : L !== null && !D ? Zt(L, M) : null;
1749
1768
  return /* @__PURE__ */ b(
1750
1769
  "div",
1751
1770
  {
1752
1771
  css: y[h].root,
1753
- style: { "--bof-trophy-on": bn },
1772
+ style: { "--bof-trophy-on": $n },
1754
1773
  children: [
1755
1774
  /* @__PURE__ */ b("div", { css: y[h].body, children: [
1756
- /* @__PURE__ */ l(
1757
- Ne,
1775
+ /* @__PURE__ */ a(
1776
+ _e,
1758
1777
  {
1759
1778
  layout: h,
1760
1779
  label: p,
1761
- title: ((zt = (Bt = t.labels) == null ? void 0 : Bt.title) == null ? void 0 : zt.trim()) || ((Mt = O.title) == null ? void 0 : Mt.trim()) || p("title"),
1762
- openSubtitle: ((Ht = (Vt = t.labels) == null ? void 0 : Vt.subtitle) == null ? void 0 : Ht.trim()) || An(O.description ?? null).trim() || p(Rn ? "subtitlePlayers" : "subtitleTeams"),
1763
- ended: x,
1764
- draw: In,
1765
- left: En
1780
+ title: ((_t = (Vt = t.labels) == null ? void 0 : Vt.title) == null ? void 0 : _t.trim()) || ((Ht = E.title) == null ? void 0 : Ht.trim()) || p("title"),
1781
+ openSubtitle: ((Gt = (jt = t.labels) == null ? void 0 : jt.subtitle) == null ? void 0 : Gt.trim()) || Xn(E.description ?? null).trim() || p(Nn ? "subtitlePlayers" : "subtitleTeams"),
1782
+ ended: D,
1783
+ draw: Fn,
1784
+ upcoming: v,
1785
+ left: Dn
1766
1786
  }
1767
1787
  ),
1768
- wn && t.leads ? /* @__PURE__ */ l(
1769
- Be,
1788
+ Tn && t.leads ? /* @__PURE__ */ a(
1789
+ je,
1770
1790
  {
1771
1791
  layout: h,
1772
1792
  sdk: n,
1773
- poll: O,
1793
+ poll: E,
1774
1794
  leads: t.leads,
1775
- sides: k,
1776
- colours: nt,
1777
- picked: z,
1795
+ sides: S,
1796
+ colours: yt,
1797
+ picked: H,
1778
1798
  language: e,
1779
- continueLabel: z !== null ? p("voteFor", { name: k[z].name }) : f("poll.buttons.continue"),
1780
- onContinue: Fn,
1799
+ continueLabel: H !== null ? p("voteFor", { name: S[H].name }) : f("poll.buttons.continue"),
1800
+ onContinue: Mn,
1781
1801
  submitting: $.submitting
1782
1802
  }
1783
- ) : /* @__PURE__ */ b(Wt, { children: [
1784
- /* @__PURE__ */ l(
1785
- Le,
1803
+ ) : /* @__PURE__ */ b(Ot, { children: [
1804
+ /* @__PURE__ */ a(
1805
+ Ae,
1786
1806
  {
1787
1807
  view: {
1788
1808
  layout: h,
1789
- fill: _,
1790
- rows: vn,
1791
- sides: k,
1792
- colours: nt,
1793
- percents: bt,
1794
- ended: x,
1795
- winner: st,
1796
- lit: $n,
1797
- widths: Lt,
1798
- clips: nn(Lt, R.slant, P),
1799
- slant: R.slant,
1800
- evenClips: nn(Pt, R.slant, P),
1801
- actions: Cn,
1802
- showTrophy: a,
1809
+ fill: U,
1810
+ rows: En,
1811
+ sides: S,
1812
+ colours: yt,
1813
+ percents: St,
1814
+ ended: D,
1815
+ winner: ct,
1816
+ lit: On,
1817
+ widths: Dt,
1818
+ clips: cn(Dt, F.slant, B),
1819
+ slant: F.slant,
1820
+ evenClips: cn(Nt, F.slant, B),
1821
+ actions: Pn,
1822
+ showTrophy: l,
1803
1823
  trophyPosition: u,
1804
1824
  language: e,
1805
1825
  label: p,
1806
- splitLabel: Tt,
1826
+ splitLabel: Bt,
1807
1827
  signInCTA: t.signInCTA,
1808
- onVote: Wn
1828
+ onVote: Ln
1809
1829
  }
1810
1830
  }
1811
1831
  ),
1812
- !_ && /* @__PURE__ */ l(
1813
- ze,
1832
+ !U && /* @__PURE__ */ a(
1833
+ Ge,
1814
1834
  {
1815
1835
  layout: h,
1816
1836
  label: p,
1817
- colours: nt,
1818
- shares: it,
1819
- percents: bt,
1820
- ended: x,
1821
- splitLabel: Tt
1837
+ colours: yt,
1838
+ shares: lt,
1839
+ percents: St,
1840
+ ended: D,
1841
+ splitLabel: Bt
1822
1842
  }
1823
1843
  )
1824
1844
  ] })
1825
1845
  ] }),
1826
- Ot ? /* @__PURE__ */ l(
1827
- _n,
1846
+ Mt ? /* @__PURE__ */ a(
1847
+ Jn,
1828
1848
  {
1829
- odds: Ot,
1849
+ odds: Mt,
1830
1850
  market: (c == null ? void 0 : c.market) ?? "FT_1X2",
1831
1851
  size: h === "m" ? "dense" : "default",
1832
1852
  mode: c == null ? void 0 : c.mode,
1833
1853
  flashInterval: c == null ? void 0 : c.flashInterval
1834
1854
  }
1835
- ) : ht && kn && /* @__PURE__ */ l("div", { css: y[h].oddsSlot, children: /* @__PURE__ */ l(an, { size: h === "m" ? "dense" : "default" }) }),
1836
- /* @__PURE__ */ l(
1837
- Ln,
1855
+ ) : xt && Wn && /* @__PURE__ */ a("div", { css: y[h].oddsSlot, children: /* @__PURE__ */ a(fn, { size: h === "m" ? "dense" : "default" }) }),
1856
+ /* @__PURE__ */ a(
1857
+ An,
1838
1858
  {
1839
1859
  notification: {
1840
1860
  open: !!$.voteError,
@@ -1848,20 +1868,20 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
1848
1868
  ]
1849
1869
  }
1850
1870
  );
1851
- }, _e = (t) => {
1871
+ }, Je = (t) => {
1852
1872
  var n;
1853
- return /* @__PURE__ */ l(
1854
- Tn,
1873
+ return /* @__PURE__ */ a(
1874
+ Vn,
1855
1875
  {
1856
1876
  packageName: "battle-of-fans",
1857
1877
  language: t.language,
1858
1878
  themeOptions: t.themeOptions,
1859
1879
  disableCache: t.disableCache,
1860
1880
  leadPhoneCountryCode: (n = t.leads) == null ? void 0 : n.phoneCountryCode,
1861
- children: /* @__PURE__ */ l(je, { ...t })
1881
+ children: /* @__PURE__ */ a(Ke, { ...t })
1862
1882
  }
1863
1883
  );
1864
- }, no = Yn(_e);
1884
+ }, lo = ne(Je);
1865
1885
  export {
1866
- no as BattleOfFans
1886
+ lo as BattleOfFans
1867
1887
  };